<?php /* Smarty version 2.6.25, created on 2021-11-24 16:59:11
         compiled from newBooks.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'truncate', 'newBooks.tpl', 57, false),)), $this); ?>
        <!-- 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="<?php echo $this->_supers['session']['User_ID']; ?>
">
                                   <input type="hidden" name="membercode" id="membercode" value="<?php echo $this->_supers['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 /-->
                           
                             <?php $_from = $this->_tpl_vars['PageList']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['num8']):
?>
                            <div class="medium-3 small-12 columns">
                                <div class="course">
                                    <div class="course-thumb">
									<?php if ($this->_tpl_vars['num8']['image'] != ""): ?>
									<img src="https://www.easwarilibrary.in/images/BookImages/<?php echo $this->_tpl_vars['num8']['image']; ?>
" alt="images/noimage.jpg" style="width:217px; height:240px;">
									<?php else: ?>
									<img src="images/noimage.png" alt="images/noimage.jpg" style="width:217px; height:240px;">
									<?php endif; ?>
                                        <!--<img src="images/help/print.jpg" alt="Graphic Design" />-->
                                        <!--<img src="images/help/teacher3.jpg" class="teacher" alt="Michel" />-->
                                      <!--  <div class="teacher-name"><?php echo $this->_tpl_vars['num8']['author']; ?>
</div>-->
                                        <!--<div class="price-tag">$28.55</div>-->
                                    </div>
                                   <!-- <h5><?php echo ((is_array($_tmp=$this->_tpl_vars['num8']['category'])) ? $this->_run_mod_handler('truncate', true, $_tmp, 30) : smarty_modifier_truncate($_tmp, 30)); ?>
</h5>-->
									<h5 style="font-weight:100; font-size:11px;" title="<?php echo $this->_tpl_vars['num8']['book_name']; ?>
"><?php echo ((is_array($_tmp=$this->_tpl_vars['num8']['book_name'])) ? $this->_run_mod_handler('truncate', true, $_tmp, 35) : smarty_modifier_truncate($_tmp, 35)); ?>
</h5>
                                   <h4 style="font-weight:100; font-size:11px;" title="<?php echo $this->_tpl_vars['num8']['author']; ?>
">Author: <?php echo ((is_array($_tmp=$this->_tpl_vars['num8']['author'])) ? $this->_run_mod_handler('truncate', true, $_tmp, 30) : smarty_modifier_truncate($_tmp, 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[<?php echo $this->_tpl_vars['num8']['id']; ?>
]" onclick="ajaxInsert('<?php echo $this->_tpl_vars['num8']['id']; ?>
','<?php echo $this->_tpl_vars['num8']['category']; ?>
'); ajaxCount(this);">Add to Cart!</button>
                                </div>    
                            </div><!-- First Course /-->
                 
                                    
                           
                            <?php endforeach; endif; unset($_from); ?>
                          
                            <!-- 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"><?php echo $this->_tpl_vars['LinkPage']; ?>
<?php echo $this->_tpl_vars['PerPageNavigation']; ?>
</td>
            				    </tr>
            				    </table>
		           		</div>
		           		
                    
                </div><!-- Row Ends /-->
            </div>
            
            <!-- Seminar Events Ends /-->
            
            <!-- Seminar/Events -->
            
            <!-- Seminar Events Ends /-->
            
        </div>
        <!-- Content Section Ends /-->
<?php echo '
    <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>
'; ?>