        <!-- Title Section -->
        <div class="title-section module">
            <div class="row">
        
                <div class="small-12 columns">
                    <h1>New Book Arrivals</h1>
                </div><!-- Top Row /-->
        
                <div class="small-12 columns">
                    <ul class="breadcrumbs">
                        <li><a href="#">Home</a></li>
                        <li><a href="#">New Book Arrivals</a></li>
                        
                    </ul><!-- Breadcrumbs /-->
                </div><!-- Bottom Row /-->
                
            </div><!-- Row /-->
        </div>
        <!-- Title Section Ends /-->
        
        <!-- Content section -->
        <div class="content-section course-page">
        	
            <!-- Seminar/Events -->
            <div class="module">
                <div class="row">
                    <form id="categoryBook" name="categoryBook" method="post" action="#">
                                  <input type="hidden" name="hdAction" id="hdAction">     
                                  
                                   <input type="hidden" name="userId" id="userId" value="{$smarty.session.User_ID}">
                                   <input type="hidden" name="membercode" id="membercode" value="{$smarty.session.MemberCode}">
                                   <input type="text" class="form-control" id="search" name="search"  placeholder="Search Catagories..." autocomplete="off">
                           
                             </form>
                    <div class="courses-wrapper">
						
                        <div class="course-section">
                            
                            <div class="section-title">
                           
                            </div><!-- Section Title Ends /-->
                           
                             {foreach from=$PageList item=num8}
                            <div class="medium-3 small-12 columns">
                                <div class="course">
                                    <div class="course-thumb">
									{if $num8.image neq ""}
									<img src="https://www.easwarilibrary.in/images/BookImages/{$num8.image}" alt="images/noimage.jpg" style="width:217px; height:240px;">
									{else}
									<img src="images/noimage.png" alt="images/noimage.jpg" style="width:217px; height:240px;">
									{/if}
                                        <!--<img src="images/help/print.jpg" alt="Graphic Design" />-->
                                        <!--<img src="images/help/teacher3.jpg" class="teacher" alt="Michel" />-->
                                      <!--  <div class="teacher-name">{$num8.author}</div>-->
                                        <!--<div class="price-tag">$28.55</div>-->
                                    </div>
                                   <!-- <h5>{$num8.category|truncate:30}</h5>-->
									<h5 style="font-weight:100; font-size:11px;" title="{$num8.book_name}">{$num8.book_name|truncate:35}</h5>
                                   <h4 style="font-weight:100; font-size:11px;" title="{$num8.author}">Author: {$num8.author|truncate:30}</h4>
                                    <!--<p>Suspendisse dictum feugiat nisl ut dapibus.  Vivamus hendrerit arcu sed erat molestie vehicula.</p>
                                    <ul class="no-bullet">
                                        <li><i class="fa fa-clock-o" aria-hidden="true"></i> <strong>Timing: </strong>8:00-9:00 / Wednesday and Sunday only</li>
                                        <li><i class="fa fa-calendar" aria-hidden="true"></i> <strong>Starting From: </strong>November 28, 2013</li>
                                    </ul>-->
                                    <button class="secondary button" id="cart" name="cart[{$num8.id}]" onclick="ajaxInsert('{$num8.id}','{$num8.category}'); ajaxCount(this);">Add to Cart!</button>
                                </div>    
                            </div><!-- First Course /-->
                 
                                    
                           
                            {/foreach}
                          
                            <!-- Second Course /-->	
                            
                            <!-- Third Course /-->
                            
                            <div class="clearfix"></div>
                        </div><!-- Courses Section Ends /-->    		
                        
                        <!-- Courses Section ends /-->     
                        
                    </div><!-- Events Wrapper Ends /-->
					<!-- Pagination -->
		           		  <div class="pagination-container">
		           		      <table width="100%" border="0" cellspacing=1 cellpadding=2>
            					<tr>
            				    <td colspan="2" align="center">{$LinkPage}{$PerPageNavigation}</td>
            				    </tr>
            				    </table>
		           		</div>
		           		
                    
                </div><!-- Row Ends /-->
            </div>
            
            <!-- Seminar Events Ends /-->
            
            <!-- Seminar/Events -->
            
            <!-- Seminar Events Ends /-->
            
        </div>
        <!-- Content Section Ends /-->
{literal}
    <script type="text/javascript">
    
   
     
    function ajaxInsert(bookId,category)
    {
     var userId=document.getElementById('userId').value;
     var memberCode=document.getElementById('membercode').value;
      // alert(category);
     if(userId=="")
     {
    //window.location('login.php');
      window.location = "login.php";
     }   
     else
     {
         //alert(memberCode);
        // alert(category);
     /*  
         $.post("ajax_insertCart.php",{book_id:bookId,user_id:userId,member_code:memberCode,category_name:category},function(data){
            console.log(data)
            alert("Your email has been updated");


        }); 
     */
        $.ajax({
        type: "POST",
        url: "ajax_insertCart.php",
        data:{book_id:bookId,user_id:userId,member_code:memberCode,category_name:category},
      //  dataType: "JSON",
        cache: false,
        success: function(json){
               // var option = json.toString()
          //  alert(option);
         //alert(json);
      var jsontrim= json.trim();
          if(jsontrim=="Already Added")
          {
            alert("This Book Already Added In Your Cart");
          }
          else if(jsontrim=="Successfully Added")
          {
            alert("Your Cart has been updated");
            
          }
        }
       
        });
        
     }
    }

     function ajaxCount()
    {
     var userId=document.getElementById('userId').value;
  
        $.ajax({
        type: "POST",
        url: "ajax_CountCart.php",
        data:{user_id:userId},
      //  dataType: "JSON",
        cache: false,
        success: function(json){
            // alert(json);
                //document.getElementById('CartCnt').value=json;
                $('#my_IDLabel').attr('data-count', json);
           // alert(userId);
           //alert("Your email has been updated");
        }
       
       
        });
         
        
  

    } 

 
    </script>
{/literal}