<?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>Demand On:</strong> <?php if($info4view) { echo dfltdttmFormat($info4view->fld_datetime); }?>
			<span style="float:right;"> <?php if($info4view->fld_closedon!="") {?> <strong>Closed On:</strong> <?php echo dfltdttmFormat($info4view->fld_closedon); }?></span>
		</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="59%"><strong>Demand Number:</strong> <?php if($info4view) { echo $info4view->fld_refno; }?></td>
					<td style="vertical-align:top;" width="41%"><strong>Demand to warehouse: <?php if($info4view) { echo $info4view->warehousename; }?></strong></td>
				</tr>			
				<tr>
				<td style="vertical-align:top;"><strong> Date:</strong> 
				<?php if($info4view) { echo dfltdtFormat($info4view->fld_refdate); }?></td>
					
					<td style="vertical-align:top;"><strong>Status:</strong> <span class="text-<?php echo arrOSColor()[$info4view->fld_status];?>"><strong><?php echo arrOrderStatus()[$info4view->fld_status];?></strong></span></td>
					
				</tr>

				
		  </tbody>
		</table>
		<br>		
		<br>
		<h5 class="mb-0">Product Info.</h5>
		<br>
		<table class="webforms mt-0 table-responsive-sm">
		<thead>
		<tr>
			<th width="4%" class="text-left">Sr.No.</th>
			<th width="32%" class="text-left">Product</th>
			<th width="10%">Qty.</th>			
			
		</tr>
		</thead>
		<tbody>
<?php
		$poindex = 1;
		$subtotalamount = 0;
		$totalamount = 0;
		foreach($transinfo4view as $row)
		{
			$subtotalamount += ($row->fld_subtotal);
?>
						<tr>
							<td class="text-left"><?php echo $poindex;?></td>
							<td class="text-left"><?php echo $row->fld_name;?></td>
							<td class="text-center"><?php echo $row->fld_qty;?></td>							
						</tr>
<?php
$poindex++;
}													
?>
										
					</tbody>
				</table>
		<?php
				}													
		?>			
		<br><br>
		
  </div>
  </div>
  </section>     
	 <div class="clearfix"></div>
	</div>
	</div>
<?php
if($tasktype=="print")
{
	?>
<script>
    window.print();
    
</script>
<?php
}
?>