<link href="<?php echo base_url(); ?>assets/autocomplete/jquery-ui.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/autocomplete/ui.theme.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/autocomplete/autocomplete.css" rel="stylesheet">
	
 <link href="<?php echo base_url(); ?>assets/select/chosen.min.css" rel="stylesheet" media="screen">
	
		   
		   		   <script src="<?php echo base_url(); ?>assets/select/chosen.jquery.min.js"></script>


 

<script type="text/javascript">
  
	 $(document).on("click", "#managebtndelete", function()
        {
			       

          var itemid2 = $(this).data('id');
		  $("#itemid1").val(itemid2); 
		     var qty1 = $(this).data('qty');
		  $("#qty1").val(qty1); 
		  
		     var stockfrom = $(this).data('stockfrom');
		  $("#stockfrom1").val(stockfrom); 
		     var stockto = $(this).data('stockto');
		  $("#stockto1").val(stockto); 
		  
		    var code = $(this).data('code');
		  $("#code1").val(code); 
		   
        });
				    $(function() {
<!--             $(".datepicker").datepicker(); -->
<!--             $(".uniform_on").uniform() -->;
            $(".chzn-select").chosen();
   <!--          $('.textarea').wysihtml5(); -->

        });
	
		
		
		
		 $(this).ready( function() {  
            $("#newproduct").autocomplete({  
 
                minLength: 1,  
                source:   
                function(req, add){  
                    $.ajax({  
                        url: "<?php echo base_url(); ?>Systemusers/productlistlookup",  
                        dataType: 'json',  
                        type: 'POST',  
                        data: req,  
                        success:      
                        function(data){  
                            if(data.response =="true"){  
                                add(data.message);  
                                console.log(data);
                            }  
                        },  
                    });  
                },  
                     
            });  
        });  
		

		
      $(this).ready( function() { 
var searchterm = $("#searchterm").val();
                     var frombranch = $("#from").val();	  
            $("#searchterm").autocomplete({  
 
                minLength: 1,  
                source:   
                function(req, add){  
                    $.ajax({  
                       url: "<?php echo base_url(); ?>Systemusers/productlookup",
                      // url: "<?php echo base_url(); ?>Systemusers/productlookupdispatch",  
						
                        dataType: 'json',  
                        type: 'POST',  
                        data: req,  
										 ///data: {term: $(this).val(),frombranch: frombranch},

                        success:      
                        function(data){  
                            if(data.response =="true"){  
                                add(data.message);  
                                console.log(data);
                            }  
                        },  
                    });  
                },  
                     
            });  
        });  
		
		
		  $(this).ready( function() {  
            $("#toproduct").autocomplete({  
 
                minLength: 1,  
                source:   
                function(req, add){  
                    $.ajax({  
                        url: "<?php echo base_url(); ?>Systemusers/productlookup",  
                        dataType: 'json',  
                        type: 'POST',  
                        data: req,  
                        success:      
                        function(data){  
                            if(data.response =="true"){  
                                add(data.message);  
                                console.log(data);
                            }  
                        },  
                    });  
                },  
                     
            });  
        });  
		
		
		
		
    </script>   
 
 <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"> Move/distribute/break products</span>	
	  	  				 <a href="<?php echo base_url();?>user/viewproducts" class="btn btn-default"> Back to Products</a>
          				 <a href="<?php echo base_url();?>user/viewbulkdispatch" class="btn btn-default"> View previous bulk  dispatch </a>
	 <a  id="more" class="btn btn-info" href="<?php echo base_url();?>user/printgrn?invoice=<?php     if(isset($invoice)) {echo $invoice; } ?>&type=dispatched">  
								 

                                                <i class="glyphicon glyphicon-pencil"></i>
																Print Internal Transfer Note(All)
                                                </a>
												
												
													 <a  id="more" class="btn btn-info" href="<?php echo base_url();?>user/printgrn?invoice=<?php     if(isset($invoice)) {echo $invoice; } ?>&type=Move From">  
								 

                                                <i class="glyphicon glyphicon-pencil"></i>
																Print Internal Transfer Note(From)
                                                </a>
												
												
													 <a  id="more" class="btn btn-info" href="<?php echo base_url();?>user/printgrn?invoice=<?php     if(isset($invoice)) {echo $invoice; } ?>&type=Move">  
								 

                                                <i class="glyphicon glyphicon-pencil"></i>
																Print Internal Transfer Note(To)
                                                </a>
													  <?php
													
													  		 	  $mystatus=$viewdistribution[0]['remarks'];
																  		$receivestock=$viewdistribution[0]['enddate'];
																	
																		  if($receivestock=="Yes"){
																  if($mystatus=="Approved"){
													  ?>
			 								<a  id="more"  class="btn btn-success" href="<?php echo base_url();?>user/receivedispatch?invoice=<?php   {echo  $invoice;}  ?>"> Receive Products</a>
													<?php
																  }else{
																echo "Items must be approved fisrt for you to receive them.";	  
																	  
																  }
																		  }else{
																			  
													  ?>
													  
													  
													  			 								<a  id="more"  class="btn btn-success" href="<?php echo base_url();?>user/receivedispatch?invoice=<?php   {echo  $invoice;}  ?>"> Receive Products</a>

													  
													  <?PHP
																		  }
													  ?>
				
            	</div>
            </div>
			<div class="panel-body">

	  <?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['branchid'] = $session_data['branchid'];
	 $branchid = $data['branchid'];
	 
	 
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
  
    $deleteincoming=$this->usermodel->populatuserpermissionsdataarray('incomingstock','delete',$userid);
  $viewbprice=$this->usermodel->populatuserpermissionsdataarray('productlist','viewbprice',$userid);

   function formatMoney($number, $fractional=false) {
						if ($fractional) {
							$number = sprintf('%.2f', $number);
						}
						while (true) {
							$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number);
							if ($replaced != $number) {
								$number = $replaced;
							} else {
								break;
							}
						}
						return $number;
					}	

 $smsconfig = $this->usermodel->populateallarray('smsconfig','id',$companyid);
		 	  $view=$smsconfig[0]['view'];	
		  		 	  $display1=$smsconfig[0]['display1'];	
				$etims=$smsconfig[0]["hscode"];
								$etimsonline=$smsconfig[0]["etimsonline"];

  ?>
										
		
							
	<div class="widget-content nopadding table_holder table-responsive" >				
	
							
		


    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Transfer/Move/Distribute stock</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');

  
  $type=trim($type);
    if($type=="Movement"){
				                 echo form_open('user/movebulktock' , array('class' => 'form-inline form-groups-bordered validate', 'enctype' => 'multipart/form-data'));

	}else{
				                 echo form_open('user/addbulkstock' , array('class' => 'form-inline 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="type" value="product"id="type" class="form-control" required placeholder="Enter type">
				<input type="hidden" name="frombranch" value="<?php echo$frombranch;?>" id="frombranch" class="form-control" required placeholder="Enter type">

						 		  		<input readonly type="hidden" name="invoice" required value="<?php echo set_value('invoice',$invoice); ?>" class="form-control"  placeholder="Enter invoice or Receip tnumber">
		 		  		<input readonly type="hidden" name="category" required value="<?php echo set_value('category',$category); ?>" class="form-control"  placeholder="Enter category ">
		 		  		<input readonly type="hidden" name="status" required value="<?php echo set_value('status',$status); ?>" class="form-control"  placeholder="Enter status ">

				<input type="hidden" name="view" value="user/bulkdispatch?invoice=<?php echo$invoice;?>&type=<?php echo$type; ?>&frombranch=<?php echo$frombranch; ?>&tobranch=<?php echo$tobranch;?>&status=<?php echo$status;?>&category=<?php echo$category;?>&salestype=<?php echo$salestype;?>        "id="view" class="form-control" required placeholder="Enter view">
		<input type="hidden" name="productid" value=""id="productid1" class="form-control" required placeholder="Enter productid">
		<input type="hidden" name="page" value=""id="page" class="form-control" required placeholder="Enter bookid">
<input type="hidden" name="mytype" value="shop"id="mytype" class="form-control" required placeholder="Enter type">




  <div class="col-md-12">

  














  <div class="form-group">
    <label for="inputcode" class="col-sm-2 control-label"> Product name</label>
    <div class="col-sm-4">
	

		                    <input class="form-control" required id="searchterm"  autofocus name="code" placeholder="Search for product by name, code,description.." type="text" value="<?php echo set_value('code'); ?>" />

		
	
		
		
		
		
	</div>
  </div>
    <?php
  if(trim($type) =="Movement"){
  ?>
	  
		<div class="form-group">
    <label for="inputtoproduct" class="col-sm-2 control-label"> To which Product?</label>
    <div class="col-sm-4">
	

				                    <input class="form-control" id="toproduct"  autofocus name="toproduct" placeholder="Search for product by name, code,description.." type="text" value="<?php echo set_value('toproduct'); ?>" />

		
	
		
		
		
		
	</div>
  </div>
<?php
  }
  ?>
  	<div class="form-group">
    <label for="inputtotal" class="col-sm-2 control-label">	Total qty to add</label>
    <div class="col-sm-4">
	    <?php

  if(trim($type) =="Movement"){
  ?>
 		  		<input type="text"   name="total" value="<?php echo set_value('total',1); ?>"id="total3" class="form-control" required placeholder="Enter total/Factor">
 		  	Remove	<input type="text"   name="deduct" value="<?php echo set_value('deduct',1); ?>"id="total3" class="form-control" required placeholder="Enter total/Factor">

    <?php
  }else{
	  ?>  
	  		<input type="text"   name="total" value="<?php echo set_value('total',1); ?>"id="total3" class="form-control" required placeholder="Enter total/Factor">
 		  		<input type="hidden"   name="deduct" value="<?php echo set_value('deduct',1); ?>"id="total3" class="form-control" required placeholder="Enter total/Factor">

  <?php	  
  }
	  ?> 	 
				
		<span class="text-danger"><?php echo form_error('total'); ?>
		
		</span>
	</div>
  </div>
  
  
  
     <?php

  if($type=="Transfer"){
  ?>
	  
	<div class="form-group">
    <label for="inpubuyingprice" class="col-sm-3 control-label">Get AVG 

	
	</label>
    <div class="col-sm-3">
	
		 	<select class="form-contro1" name="compare" required>
	
	<option value="Yes"  >Yes</option>
	<option value="No" selected="selected"  >No</option>

	

</select>



	</div>
  </div>
  
    <?php

  }
  
 // echo"----". $frombranch;
  ?>
   
   <?php 
   
   	if ($etims=="EnableEtims"){
		//
   ?>
   
   
   <div class="form-group">
    <label for="inputetimsstockio" class="col-sm-3 control-label">Etims StockIo

	
	</label>
    <div class="col-sm-3">

		 	<select class="form-contro1" name="etimsstockio" required>
	  <?php 
   
   	if ($etimsonline=="yes"){
		
		//
   ?>
   	<option value="No"  selected="selected" >No</option>

     <?php 
   
	}else{		//
   ?>
   
   	<option value="Yes"  selected="selected"  >Yes</option>

   
     <?php 
   
	}		//
   ?>
   
	<option value="Yes"   >Yes</option>
	<option value="No"  >No</option>

	

</select>



	</div>
  </div>
   
   
   
     <?php 
   
	}else{		//
   ?>
  	 <input type="hidden"name="etimsstockio"  value="No">

  
      <?php 
   
	}   ?>
  
   
   
   
	</div>
	<div class="col-md-12">
	
  



<div class="form-group">
    <label for="inputbranch" class="col-sm-2 control-label">	From </label>

    <div class="col-sm-4">
	<select class="form-control" name="from"   required >


	
	<?php 

			
			if($frombranch=="Main"){
				?>
			 	<option value="Main" selected="selected" >Main Store</option>

				<?php
				
			}else{
					 $branch= $this->usermodel->populateall('branch','id',$frombranch);



if(is_array($branch)) {

   foreach($branch as $branchrow){

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



	<?php

}} else {
    echo 'No branch available.';
}
	
	}
	?>
				 	<option value="Main"  >Main Store</option>

	<?php

					 //$branch= $this->usermodel->populateall('branch','companyid',$companyid);
								 $branch= $this->usermodel->populateall('branch','id',$branchid);



if(is_array($branch)) {

   foreach($branch as $branchrow){

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



	<?php

}} else {
    echo 'No branch available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('from'); ?>

	</div>
  </div>


  <div class="form-group">
    <label for="inputtobranch" class="col-sm-2 control-label">To?
	

	</label>
    <div class="col-sm-4">
	<select class="form-control" name="tobranch" required>
	
	<option value=""  >---Where to?---</option>
			 	<option value="Main" selected="selected" >Main Store</option>

	
	<?php 

			
			if($tobranch=="Main"){
				?>
			 	<option value="Main" selected="selected" >Main Store</option>

				<?php
				
			}else{
					 $branch= $this->usermodel->populateall('branch','id',$tobranch);



if(is_array($branch)) {

   foreach($branch as $branchrow){

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



	<?php

}} else {
    echo 'No branch available.';
}
	
	}
	?>

	<?php

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



if(is_array($branch)) {

   foreach($branch as $branchrow){

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



	<?php

}} else {
    echo 'No branch available.';
}
	
?>
</select>
		
		
						<span class="text-danger"><?php echo form_error('from'); ?>

	</div>
		

  </div>
  	<div class="form-group">
   
	<input type="text" readonly  name="salestype" value="<?php echo set_value('salestype',$salestype); ?>"id="total3" class="form-control" required placeholder="Enter retail or wholesale here">

		  		<input type="text" readonly  name="type" value="<?php echo set_value('type',$type); ?>"id="total3" class="form-control" required placeholder="Enter type">
		         <button type="submit"  value="stock" name="btn_movestock" class="btn btn-info"> Post Now  </button>

  </div>

  	</div>









	
  
  
  
  
  

  
  
  					<?php echo form_close();?>
			
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	 </div>
	 
  

  						
	<div class="widget-content nopadding table_holder table-responsive" >				
	
									
									
				<table class="tablesorter table table-bordered  table-hover" id="printableArea">			

             <thead>
			 <?php if(isset($configuration[0]['businessname'])) {

				 
				 ?>
			   <tr>
								
								<td colspan="16" ><center  >
								
						
									

										<?php

										$bussinessname=$configuration[0]['businessname']; if(isset($bussinessname)) {echo   $bussinessname; }
										
									
			
										
										?>
												<span id="mytitle"></br><b> Stock movement report between   <?PHP echo $finalfromdate ?> and <?PHP echo $finaltodate ?></b>		
								
								<br>Name----------------------Date--------------------Signature----------------</span>

								</center></td>
								
								
							</tr>
							<?php
								 
				 }
							?>
         <tr>
       <th>Invoice /P.O No</th>
	        <th>Code</th>
     <th>S/n</th>
     <th>Name</th>
	 	       <th>Received</th>


	       <th>Added</th>
	 

		     <th>Before</th>
		 	     <th>After</th>
		 	   
				 		 	     <th>S.Price</th>
				 		 	     <th>TT S.price</th>
	<?php
if( $viewbprice==true){
?>
	 
<?php	

 }else{
?>
  <th>B.Price</th>
<th>TT 	B.price</th>
								 
 <?php
 }
  ?>
  
								

	     <th>From</th>
		  <th>To</th>
		    <th>Branch</th>
		 <th>Added Date</th>
		 	 <th>Supplier</th>
<th>Added by</th>
<th>Receiver </th>

	<th>More</th>

                 </tr>
             </thead>
<?php

 if(!is_array($viewincomingstock)) 

 {


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

  	foreach ($viewincomingstock as $c): 

		 		    $totalamount= $totalamount+($c->buyingprice*$c->total ) ;


             ?>



             <tr>
                
            <?php 
$id=$c->id;
$myqty=$myqty+$c->total;
$salesid=$c->invoice;

$itemid=$c->item_id;



?>
    <td><?php if($c->invoice_number !=""){
		
		echo$c->invoice_number;
	}else{
			echo$c->invoice;
			//	echo$c->invoice."<br> Internal";

	}
	; ?></td>
	
	    <td><?php 
		echo $c->item_id ;
		
		
	
		
		
		?></td>
  <td><?php 
			if($c->serial !=""){
		
		echo $c->serial;
		
			$myserials = $this->usermodel->populateallarray('serials','serial', $c->serial);

		

   echo "-".$myserials[0]['status'];
   
   if($myserials[0]['status']=="used"){
	   
	   
			$allsalesmyserials = $this->usermodel->populateallarray('sales_order','serial', $c->serial);
	   $myinvoice=$allsalesmyserials[0]['invoice'];
	   
	   
	   	  	 $recipt = $this->usermodel->populateallarray('sales','invoice',$myinvoice);
		 	 $receiptno=$recipt[0]['id'];

?>
		  
  		   <a  id="non-printable" class=" btn-default" target="_blank"  href="<?php echo base_url();?>user/searchallmyinvoices?searchterm=<?php   if(isset($myinvoice )) {echo $myinvoice ; } ?>&view=userdata/allinvoices"> 		
<?php 

	  echo " RCT: ".$receiptno  ;



  ?>
  </a>
  
			  
	<?php 		  
	   
   }
		
		
		
		
		
		
	}
	
		
		
	
		
		
		?></td>
                 <td><?php 
	$itemid=$c->item_id;
	
	$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 echo $c->qty ; ?></td>

    <td><?php echo $c->total ; ?></td>
	
	
										

	    <td><?php echo $c->item_id1 ; ?></td>
		    <td><?php echo $c->balance ; ?></td>

		
			    <td><?php echo $c->sellingprice ; ?></td>
				
							    <td><?php echo $c->sellingprice*$c->total  ; ?></td>

 
 	<?php
if( $viewbprice==true){
?>
	 
<?php	

 }else{
?>
 
 <td><?php echo $c->buyingprice ; ?></td>
	 <td><?php echo $c->buyingprice*$c->total  ; ?></td>

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

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



if(is_array($branchfrom)) {

   foreach($branchfrom as $branchfromrow){

   echo $branchfromrow->name;
 
 
}} else {
    echo $stockfrom;
}
	
?>
												 
	 </td>											 
			
	 <td>
												 
	<?php 
					// $branch="";
					 $MYtype=$c->stockto;

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



if(is_array($branchtype)) {

   foreach($branchtype as $branchtyperow){

   echo $branchtyperow->name;
 
 
}} else {
    echo $MYtype;
}
	
?>
												 
	 </td>											 
			
	
	
	 <td>
												 
	<?php 
					// $branch="";
					 $branch=$c->branchid;

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



if(is_array($branch)) {

   foreach($branch as $branchrow){

   echo $branchrow->name;
 
 
}} else {
    echo 'General.';
}
	
?>
												 
	 </td>
	
	
	
	
	
	 <td><?php echo $c->date ; ?></td>
	 
		 
		  <td><?php 
		  
		  
		  
		  
		  
		  $allstocks = $this->usermodel->getstockbyinvoice($c->invoice_number);
						 $mysupplier=$allstocks[0]['supplier'];
if($mysupplier !=""){
$supliers=$this->usermodel->geteuser($mysupplier);

if($supliers[0]['company']!=""){
	   echo $supliers[0]['company'];
}else{
   echo $supliers[0]['firstname'];	
}

   
   
   
   
   
}else{
	
 echo "Internal ";	




}
		  
		  
		  

?>
</td>
		 
		 
		 
		 
		 
		 
		 
		 
		 
		 
		 
	 <td><?php  $userids= $c->userid ;

$myuser=$this->usermodel->geteuser($userids);
   echo $myname=$myuser[0]['firstname'];

  ?></td>
  		 
	 <td><?php  $updatedby= $c->updatedby ;

$myusersss=$this->usermodel->geteuser($updatedby);
   echo $myname=$myusersss[0]['firstname'];

  ?></td>
  
  
  
  
  
  
	 	 <td> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                                        More <span class="caret"></span>
                                    </button>
								
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
			 								<?php
										if($deleteincoming==true){
											
											?>
											  <li> 
										 <a class="btn btn-danger managebtn" id="managebtndelete"	data-code='<?php echo  $c->item_id;?>' data-stockto='<?php echo  $c->stockto;?>' data-stockfrom='<?php echo  $c->stockfrom;?>'	data-qty='<?php echo  $c->total;?>'  data-id='<?php echo  $c->id;?>'    data-toggle='modal' data-target='#deleteModal<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Cancel Stock Transfer
                                                </a>
                                                        </li>
									
										<?php
										}
										?>
                                        <li class="divider"></li>
										
										
										   <a  id="more" class="btn btn-warning" href="<?php echo base_url();?>user/comfirmstocktransfer?randomitemidentifier=<?php   {echo  $salesid;}  ?>&transactionid=<?php   {echo  $id;}  ?>&mycode=<?php   {echo  $itemid;}  ?>&type=return&branch=<?php   {echo  $c->branchid;}  ?>&view=user/bulkdispatch?invoice=<?php echo$invoice;?>&type=<?php echo$type;?> &frombranch=<?php echo$frombranch;?>&tobranch=<?php echo$tobranch;?>&status=<?php echo$status;?>&category=<?php echo$category;?>&salestype=<?php echo$salestype;?> "> 




                                                <i class="glyphicon glyphicon-pencil"></i>
															Confirm Stock Transfer
                                                </a>
                                                        </li>	
                                        
                                        <!-- teacher DELETION LINK -->
                                        
                                    </ul>
										
                                </div>
</td>
		 
             </tr>

	<?php endforeach;} ?>

            
 								<tr border="1" background="green">
									<td colspan="4"><b>Total Quantity</b></td>

									<td  colspan="5"><b><?php if(isset($myqty)) {echo $myqty;   }?></b> </td>
																											<td><b><?php if(isset($totalamount)) { echo formatMoney($totalamount , true);  }?></b> </td>


	<td colspan="3"></td>								
</tr>
	
        </table>

        </div>
  
  
  
  
  
  
  
  
  






							
</div>	

	
					

					
					
				
					
							<div id="deleteModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <! Modal content>
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Cancel Stock</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to delete this item? </h3>
      </div>
      <div class="modal-footer">
	  	

		<?PHP
				$session_data = $this->session->userdata('adminlogged_in');
 echo $this->session->flashdata('deletemsg'); 
//
		
                 echo form_open('user/deletebyid' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
 <input type="hidden" id="table"name="table" class="table" placeholder="view" value="newstock">
 <input type="hidden" id="qty1"name="qty" class="qty" placeholder="qty" value=""><br>
 <input type="hidden" id="stockfrom1"name="stockfrom" class="stockfrom" placeholder="stockfrom" value=""><br>
 <input type="hidden" id="stockto1"name="stockto" class="stockto" placeholder="stockto" value=""><br>
 <input type="hidden" id="code1"name="code" class="code" placeholder="code" value=""><br>
				<input type="hidden" name="view" value="user/bulkdispatch?invoice=<?php echo$invoice;?>&type=<?php echo$type;?> &frombranch=<?php echo$frombranch;?>&tobranch=<?php echo$tobranch;?>&status=<?php echo$status;?>&category=<?php echo$category;?>       "id="view" class="form-control" required placeholder="Enter view">
 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
 <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_delete" value="deletebyid" class="btn btn-danger"> Cancel  </button>

	<?php echo form_close();?>
      </div>
    </div>

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

 
</div>



















