<?php
defined('BASEPATH') OR exit('No direct script access allowed');

?>

      <div class="main my-0">
        <div class="row mt-3 mx-0">
          <div class="col-md-6">
            <h3><?php echo $pgheading;?></h3>
          </div>
          <div class="col-md-5 text-right">
            &nbsp;
          </div>
        </div>
        
        <div class="container_fluid mt-2 px-3">
		<section class="tablewrap1">
  <div class="col-md-12">
  <div class="tablebox table-responsive">
        
             
 		<div class="mb-2">
			<strong>Created On:</strong> <?php if($info4view) { echo dfltdttmFormat($info4view->fld_datetime); }?>
			<?php
			if($info4view->fld_receivedon!="")
			{
			?>
			<span style="float:right;"><strong>Recieved On:</strong> <?php if($info4view) { echo dfltdttmFormat($info4view->fld_receivedon); }?></span>
			<?php
			}
			?>
		</div>            
<?php
		
$totalrow = 1;
$totalamount = 0;
if(is_array($transinfo4view) && count(array_filter($transinfo4view))>0)
{

?>
												
												

                                        
<table class="table-bordered">
	<thead>
	</thead>
		<tbody>
				<tr>
					<td style="vertical-align:top;" width="42%"><strong>From Warehouse:</strong> <?php if($info4view) { echo $info4view->warehousename; }?></td>
					<td style="vertical-align:top;"><strong>To Client:</strong> <?php if($info4view) { echo $info4view->clientname; }?></td>
				</tr>			
				<tr>
				<td style="vertical-align:top;"><strong>Challan Date:</strong> <?php if($info4view) { echo date("d-M-Y", strtotime($info4view->fld_refdate)); }?></td>
				<td style="vertical-align:top;" width="58%"><strong>Challan No.:</strong> <?php if($info4view) { echo $info4view->fld_refno; }?></td>
				</tr>

				
				
		  </tbody>
		</table>
		<br>		
		<br>
		<h5 class="mb-0">Product Info.</h5>
		<br>
<table class="table table-bordered">
                                            <thead>
                                                <tr>
                                                    <th align="left">Sr.No.</th>
                                                    <th align="left">Product Name</th>                                                    
                                                    <th align="right">Quantity</th>
                                                   

                                                   
                                                </tr>
                                            </thead>
                                            <tbody>
<?php
		$poindex = 1;
		$totalqty = 0;
		foreach($transinfo4view as $row)
		{
			$totalamount += $row->fld_price;
			$totalqty += round($row->fld_qty);
			if($row->fld_qty>0)
			{
?>
                                                <tr>
                                                    <td align="left"><?php echo $poindex;?></td>
                                                    <td align="left"><?php echo $row->fld_name;?></td>
                                                    <td align="right"><?php echo round($row->fld_qty);?></td>
                                                    
                                                
                                                </tr>
<?php
				$poindex++;
			}
		}													
?>
                                                <tr>
                                                    <td align="left"></td>
                                                    <td align="right"><strong>Total</strong></td>
                                                    <td align="right"><strong><?php echo number_format($totalqty);?></strong></td>
                                                </tr>

                                            </tbody>
                                        </table>
<?php
		}													
?>			
		<br><br>
		
  </div>
  </div>
  </section>
        
                 
	         <div class="clearfix"></div>
          
        </div>
        
            
        </div>


<?php
if($tasktype=="print")
{
	?>
<script>
    window.print();
    
</script>
<?php
}
?>
