
 <div class="row">
  
   	

   	<div class="col-md-12">
	
  
		<div class="panel panel-default" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
						 <span class="pull-right"> UOM Price update page</span>	
                        <a  id="more" class="btn btn-info" href="<?php echo base_url();?>Systemusers/viewproducts/<?php   {echo  $page;}  ?>">Back to Products </a>


				
            	</div>
            </div>
			<div class="panel-body">

				<div class="widget-content nopadding table_holder table-responsive" >				
	  <?php
  echo $this->session->flashdata('deletemsg'); 
   echo $this->session->flashdata('msg'); 

				echo $this->session->flashdata('updatemsg'); 
   $session_data = $this->session->userdata('logged_in');

   
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];
$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
  
  



  ?>
										
					<div class="row">
						<div class="col-md-12">
							
	<div class="widget-content nopadding table_holder table-responsive" >				
	
									
									
				<table class="tablesorter table table-bordered  table-hover" id="sortable_table">			

             <thead>
			 
			   <tr>
 <td colspan="7">
<CENTER><H3> UPDATE PRICES IN THIS WINDOW</H3></CENTER> 
 </td>
 </tr>   
				 
         <tr>
									
       <th>Branch</th>
     <th>Name</th>
	   
		   <th>B.price</th> 
		   <th>S.price</th> 
		<th>H.price</th>
		<th>Save </th>

                 </tr>
             </thead>
<?php

 if(!is_array($product)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='6'>";
    
       echo '<div class="alert alert-warning text-center">There no records found..</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  $myqty=0;
  	foreach ($product as $row): 

		 

             ?>



             <tr>
			 				<?php
					
		
                 echo form_open('user/editprices' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>								
  
  
		 <td>
		 		 		 											<input type="hidden" name="page" id="page" value="<?php echo set_value('page',$page); ?>" class="form-control" required placeholder="page" >

		 		 											<input type="hidden" name="code" id="code" value="<?php echo set_value('code',$row->code); ?>" class="form-control" required placeholder="code" >

		 											<input type="hidden" name="myid" id="myid" value="<?php echo set_value('myid',$row->id); ?>" class="form-control" required placeholder="myid" >
		 											<input type="text" name="branch" id="branch" readonly value="Main Store" class="form-control" required placeholder="branch" >

												 
			  </td>
					
			           <td><?php 
	$itemid=$row->code;
	
	$mycategory = $this->usermodel->populateall('products','code', $itemid);
	


if(is_array($mycategory)) {

   foreach($mycategory as $mycategoryrow){
		echo $mycategoryrow->name." (" .$mycategoryrow->description.")";


}} else {
    echo 'No Product .';
}
	
?>
</td>
			 
			 
 <td>
		 								<input type="text" name="buyingprice" id="buyingprice" value="<?php echo set_value('buyingprice',$row->buyingprice); ?>" class="form-control" required placeholder="buying price" >

	
	</td>
				    <td>
					
					<input type="text" name="sellingprice" id="sellingprice" value="<?php echo set_value('sellingprice',$row->sellingprice); ?>" class="form-control" required placeholder="selling price" >
					
					</td>
						 
			
	    <td>
							<input type="text" name="wholesaleprice" id="wholesaleprice" value="<?php echo set_value('wholesaleprice',$row->wholesaleprice); ?>" class="form-control" required placeholder="whole  price" >

		</td>

<td>
	<button type="submit"  value="editprice" name="btn_editprice" class="btn btn-primary"> Save Price    </button>
</td>
 <?php echo form_close();?>	
  			

            </tr>
			
<?php endforeach;}





 if(!is_array($viewprice)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='6'>";
    
       echo '<div class="alert alert-warning text-center">There no records found..</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  $myqty=0;
  	foreach ($viewprice as $c): 

		 

             ?>



             <tr>
                
            <?php 
$id=$c->id;


?>
  
  
  				 
										<?php
					
		
                 echo form_open('user/editprices' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>								
  
  
		 <td>
		 		 		 											<input type="hidden" name="page" id="page" value="<?php echo set_value('page',$page); ?>" class="form-control" required placeholder="page" >

		 		 											<input type="hidden" name="code" id="code" value="<?php echo set_value('code',$c->code); ?>" class="form-control" required placeholder="code" >

		 											<input type="hidden" name="myid" id="myid" value="<?php echo set_value('myid',$c->id); ?>" class="form-control" required placeholder="myid" >
		 											<input type="hidden" name="branch" id="branch" value="<?php echo set_value('branch',$c->branch); ?>" class="form-control" required placeholder="branch" >

												 
	<?php 
					// $branch="";
					 $branch=$c->branch;

					 $branchtype= $this->usermodel->populateall('branch','id',$branch);



if(is_array($branchtype)) {

   foreach($branchtype as $branchtyperow){

   echo $branchtyperow->name;
 
 
}} else {
    echo $branch;
}
	
?>
												 
	 </td>		
                 <td><?php 
	$itemid=$c->code;
	
	$mycategory = $this->usermodel->populateall('products','code', $itemid);
	


if(is_array($mycategory)) {

   foreach($mycategory as $mycategoryrow){
		echo $mycategoryrow->name." (" .$mycategoryrow->description.")";


}} else {
    echo 'No Product .';
}
	
?>
</td>

 
    <td>
		 								<input type="text" name="buyingprice" id="buyingprice" value="<?php echo set_value('buyingprice',$c->buyingprice); ?>" class="form-control" required placeholder="buying price" >

	
	</td>
				    <td>
					
					<input type="text" name="sellingprice" id="sellingprice" value="<?php echo set_value('sellingprice',$c->sellingprice); ?>" class="form-control" required placeholder="selling price" >
					
					</td>
						 
			
	    <td>
							<input type="text" name="wholesaleprice" id="wholesaleprice" value="<?php echo set_value('wholesaleprice',$c->wholesaleprice); ?>" class="form-control" required placeholder="whole  price" >

		</td>

<td>
	<button type="submit"  value="editprice" name="btn_editprice" class="btn btn-primary"> Save Price    </button>
</td>
 <?php echo form_close();?>	
  					
	
		 
             </tr>

	<?php endforeach;} ?>

             
 	
	
        </table>

					
				

<br>

<br>
<br>










				<table class="tablesorter table table-bordered  table-hover" id="sortable_table">			

 <thead>
 <tr>
 <td colspan="7">
<CENTER><H3> UNITS OF MEASUREMENTS(UOM)</H3></CENTER> 
 </td>
 </tr>
  <tr>
				  <?php   echo form_open('user/adduomprice' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>	
	<input type="hidden" name="page" id="page" value="<?php echo set_value('page',$page); ?>" class="form-control" required placeholder="page" >
	<input type="hidden" name="code" id="code" value="<?php echo set_value('code',$itemid); ?>" class="form-control" required placeholder="code" >

<td>
<select class="form-control" name="branch"  required>
	
	<option value="" selected="selected" >---Select Branch/Counter Name-</option>

	
	<?php 
					 
					 		$maincategory = $this->usermodel->populateall('branch','companyid',$companyid);


							


if(is_array($maincategory)) {

   foreach($maincategory as $maincategoryrow){

   //echo $courserow->coursename;
    ?>
					<option  selected="selected" value="<?=  $maincategoryrow->id;   ?>"><?=  $maincategoryrow->name; ?></option>



	<?php

}} else {
    echo 'No Branch/Counter.';
}
	
?>
</select>
		
</td>
<td>
	<select class="form-control" name="name"  required>
	
	<option value="" selected="selected"  >---Select UOM-</option>

	
	<?php 
					 
					 		$uom = $this->usermodel->populateall('uom','companyid',$companyid);


							


if(is_array($uom)) {

   foreach($uom as $uomrow){

   //echo $courserow->coursename;
    ?>
					<option  value="<?=  $uomrow->code;   ?>"><?=  $uomrow->name; ?></option>



	<?php

}} else {
    echo 'No uom.';
}
	
?>
</select>
</td>

      <td>
		 								<input type="text" name="qty" id="qty" value="<?php echo set_value('qty'); ?>" class="form-control" required placeholder="qty ">

	
	</td>
				    <td>
					
					<input type="text" name="price" id="price" value="<?php echo set_value('price'); ?>" class="form-control" required placeholder="selling price" >
					
					</td>
						 
			
	   

<td colspan="3">
	<button type="submit"  value="adduomprice" name="btn_adduomprice" class="btn btn-primary"> Add new UOM    </button>
</td>
 <?php echo form_close();?>	
  			


                 </tr>
				 
  <tr>
									
	    <th>code</th>
     <th>Name</th>
	          <th>Branch</th>
		   <th>UOM</th> 

		   <th>Qty</th> 
		   <th>S.price</th> 
		<th>Update </th>

                 </tr>
             </thead>
<?php 
 if(!is_array($uomprice)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='6'>";
    
       echo '<div class="alert alert-warning text-center">There no uom found..</div>';
    echo "</td>";
   echo "</tr>";
    }else {

  $myqty=0;
  	foreach ($uomprice as $uomc): 

		 

             ?>



             <tr>
                
            <?php 
$id=$uomc->id;


?>
  
  
  				 
										<?php
					
		
                 echo form_open('user/editprices' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>								
  
  
		
		 		 		 											<input type="hidden" name="page" id="page" value="<?php echo set_value('page',$page); ?>" class="form-control" required placeholder="page" >

		 		 											<input type="hidden" name="code" id="code" value="<?php echo set_value('code',$uomc->code); ?>" class="form-control" required placeholder="code" >

		 											<input type="hidden" name="myid" id="myid" value="<?php echo set_value('myid',$uomc->id); ?>" class="form-control" required placeholder="myid" >
		 											<input type="hidden" name="branch" id="branch" value="<?php echo set_value('branch',$uomc->branch); ?>" class="form-control" required placeholder="branch" >

				
		<td>
<?php  echo $uomc->code; ?> 
		</td>	 
                 <td><?php 
	$itemid=$uomc->code;
	
	$mycategory = $this->usermodel->populateall('products','code', $itemid);
	


if(is_array($mycategory)) {

   foreach($mycategory as $mycategoryrow){
		echo $mycategoryrow->name." (" .$mycategoryrow->description.")";


}} else {
    echo 'No Product .';
}
	
?>
</td>
 <td>								 
	<?php 
					// $branch="";
					 $branch=$uomc->branch;

					 $branchtype= $this->usermodel->populateall('branch','id',$branch);



if(is_array($branchtype)) {

   foreach($branchtype as $branchtyperow){

   echo $branchtyperow->name;
 
 
}} else {
    echo $branch;
}
	
?>
												 
	 </td>



 <td>								 
	<?php 
					// $branch="";
					 $uomname=$uomc->name;

					 $uom= $this->usermodel->populateall('uom','code',$uomname);



if(is_array($uom)) {

   foreach($uom as $uomrow){

   echo $uomrow->name."(".$uomrow->code.")";
 
 
}} else {
    echo $uomname;
}
	
?>
												 
	 </td>





	 
 <td>
							<input type="text" name="qty" id="qty" value="<?php echo set_value('qty',$uomc->qty); ?>" class="form-control" required placeholder="Enter qty" >

		</td>
    <td>
		 								<input type="text" name="price" id="price" value="<?php echo set_value('price',$uomc->price); ?>" class="form-control" required placeholder="selling price" >

	
	</td>
						 
			
	    

<td>
	<button type="submit"  value="editprice" name="btn_editprice" class="btn btn-primary"> Update Uom    </button>
</td>
 <?php echo form_close();?>	
  					
	
		 
             </tr>

	<?php endforeach;} ?>


</table>				
									
									
					</div>	



			
			</div>
		</div>
  
  </div>
			
			
			
		
		
  

 
</div>


















