<?php include('public_header.php'); ?>

<html>
<head>
<title>CodeIgniter Shopping Cart</title>
<link href="<?php echo base_url(); ?>assets/css/core.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/core.js"></script>

    

</head>
<body>

	<div class="bio_main">
    	<div class="bio_inner">
        	<div class="container">
        		<div class="col-lg-12 padding_part ">
                	<div class="bio_content">  
                		<h1> SHOP </h1>               		
             <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12 prdctdetails">                  
				 		<?php foreach($results as $row){ 
                             $details = $row->details;
                             //echo "$details"; exit;  ?>
                              <ul>
                       <?php  if($details !== '')
                            { ?>
                               
                                        <li>
                                          <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                        <h2><?php echo $row->name?></h2>
                                      </div>
                                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"> 
                                        <img src="<?php echo base_url(); ?>assets/img/products/<?php echo $row->image?>" alt="" 
                                            	class="product-img-search" />                                        
                                      </div>
                                      <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                        <h4>Price: <b>$<?php echo $row->price?></b></h4>
                                        <P><?php echo $row->details?></P>
                                        <?php echo form_open('cart/add_cart_item'); ?>
                                                   <fieldset>
                                                    <label>Quantity</label>
                                                    <?php echo form_input('quantity', '1', 'maxlength="2"'); ?>
                                                    <?php echo form_hidden('product_id', $row->p_id); ?>
                                                    <?php echo form_submit('add', 'Add'); ?>
                                                   </fieldset>
                                            <?php echo form_close(); ?>
                                      </div>                                      
                                         </li>
                                        
                                    <?php } else {?>                   
 <li>                                   
                                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                        <h2><?php echo $row->name?></h2>
                                        </div>
                                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"> 
                                        <img src="<?php echo base_url(); ?>assets/img/products/<?php echo $row->image?>" alt="" 
                                                class="product-img-search" />
                                        </div>
                                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                        <h4>Price: $<?php echo $row->price?></h4>
                                        <P><?php echo "No Product Details available" ?></P>
                                            <?php echo form_open('cart/add_cart_item'); ?>
                                                   <fieldset>
                                                    <label>Quantity</label>
                                                    <?php echo form_input('quantity', '1', 'maxlength="2"'); ?>
                                                    <?php echo form_hidden('product_id', $row->p_id); ?>
                                                    <?php echo form_submit('add', 'Add'); ?>
                                                   </fieldset>
                                            <?php echo form_close(); ?>
                                        </div>
                                         </li>
                                <?php } ?>
                                </ul>
                                <?php }  ?>
                    </div>  
                    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">                    
<div class="cart_list" style="width: 100%;">
                  <h3>Your shopping cart</h3>
                  <div id="cart_content">
                   <?php echo $this->view('cart/cart.php'); ?>
                   </div>
                    </div>
	
				  </div>
				 </div>
				</div>
		</div>
	</div>

<?php include('footer_inner.php'); ?>