<link rel="stylesheet" href="css/new_mxerp.css">


<?php extract($_POST);
$PageSecurity = 1;
$tabindex=0;
include('includes/DefinePaymentClass.php');
$title = _('Month Wise Production Report');
include('includes/SQL_CommonFunctions.inc');
	
?>


<div class="body_contain">
<div class="tab_div">

<h1><?php echo $title;?></h1>
   


			<form  action="" method="post">
			<table width="100%" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">
			  <tr>
				<td  class="tabledata"
				     style="width:146px;">Sop  No</td>
				<td><select name="sop_no" id="sop_no"
				style="width:40%">
				   <option value="0">---Select---</option>
				  <?php 		
		$site_sql=DB_query("Select id,sop_no from tbl_monthwise_production",$db);
		while($site_row=DB_fetch_array($site_sql)){
				?>
				  <option value="<?php echo $site_row['id'];?><?php echo ($_REQUEST['sop_no']==$site_row['id']?'selected':'')?>"><?php echo $site_row['sop_no'];?></option>
				  <?php } ?>
				</select></td>
				
			  </tr>	 
  
		  </table>
		  <p align="left" style="padding-left:10px;"><input type="Submit" name="Proceed" value="Proceed" /></p>
		  </form>

	  

	
		  <table width="100%" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">
    	  <tr>
    	    <td class="tabledata">S.No.</td>
    	    <td class="tabledata">Sop No</td>
    	    <td class="tabledata">Delivery Schudule</td>
    	    <td class="tabledata">Item Code</td>
    	    <td class="tabledata">Quantity</td>
    	     <td class="tabledata">Schedule Date/Time Form </td>
    	    <td class="tabledata">Schedule Date/Time To</td>
    	    <td class="tabledata">Total Hrs</td>
    	        	     	      </tr>
    	  <?php 
    	 if(isset($_POST['Proceed']))
		 {		  	
    	$filter=array();		
		if($_REQUEST['sop_no']!='0')
		$filter[]="sop_no='".$_REQUEST['sop_no']."'";
		
		if($filter!='')
		{
			
			$filter2=implode(" and ",$filter);
		}			
				
		if($_REQUEST['sop_no']!='0')
		{
	  $sql="Select * from tbl_monthwise_production where  $filter2 ";
		}
		else{
		  $sql="Select * from tbl_monthwise_production"; }
		$result=DB_query($sql,$db);
		$i=1;
		 $mmm=DB_num_rows($result);
		if(DB_num_rows($result)>0)
		{			
		while($myrow=DB_fetch_array($result))
			{				
          ?>
	  <tr bgcolor="#c1c1c1">
    	    <td><?php echo $i;?></td>
    	    <td><?php echo $myrow['sop_no'];?></td>
	 <td><?php echo $myrow['delivery_schudule'];?></td>
    	    <td><?php echo $myrow['item_code'];?></td>
    	    <td><?php echo $myrow['quantity'];?></td>
    	    <td><?php echo $myrow['schedule_form'];?></td>
    	    <td><?php echo $myrow['schedule_to'];?></td>
    	      <td><?php echo $myrow['total_hrs'];?></td>
    	       
    	    	       </tr>
    	  
  	  <?php $i++; }  }else
		{?>
		<tr bgcolor="#c1c1c1">
		   <td colspan="12"><font color="#FF0000">No Record Found</font></td></tr>
		<?php 	
		}
		}
	?></table>

</div></div>

     
<?php
//include('includes/footer.inc');
?>