<?php 
$query="SELECT  a.id,b.name AS lineno,mydate,timeval,entrydate,a.active FROM ".$prefix."production_record AS a,".$prefix."line AS b WHERE a.lineno=b.id";
$resultType=mysqli_query($linkid,$query);
?>
<script type="text/javascript">
/*------------------------------------Delete Student---------------------------------------------*/
 function delVoucher(id)
	{
	   var row=confirm("Do you want to delete this?");
	   if(row==true)
	   {
		 deleteJournal(id);	 
	   }
	   else 
	   return false;
	 }
	 
	function deleteJournal(id)
	{
	  var param="id="+id;
	  //alert(param);
	  $.ajax({
		type: "POST",
		url: "modules/production/delProd.php",
		data:param,
		cache: false,
		success: function(html)
		{
		//alert(html)
		$(".bar"+id).slideUp('slow', function() {$(this).remove();});
		}
		});
	 }

</script>
<div id="contentwrapper">
  <div class="main_content">
    <nav>
      <div id="jCrumbs" class="breadCrumb module">
        <ul>
          <li> <a href="#"><i class="icon-home"></i></a> </li>
          <li> <a href="#">Accounts</a> </li>
          <li> <a href="#">Production Datagrid</a> </li>
        </ul>
      </div>
    </nav>
    <div class="row-fluid">
      <div class="span12">
        <h3 class="heading">Production<span style="float:right; text-decoration:none; font-size:15px;"> <a href="index.php?tab=new-production"><img src="images/details_open.png" /> New Production</a></span>
          </li>
        </h3>
        <table class="table table-striped table-bordered dTableR" id="dt_a">
          <thead>
            <tr>
              <th>Date</th>
              <th>Line No</th>
              <th>Time</th>
              <th width="16%">Entry Date</th>
              <th width="10%">Action</th>
            </tr>
          </thead>
          <tbody>
            <?php 
			  if($resultType)
				{
				while($mydata = mysqli_fetch_assoc($resultType))
				{
				$dateval=explode("-",$mydata['mydate']);
			    $monthval=date("d M-Y",mktime(0,0,0,$dateval[1],$dateval[2],$dateval[0]));
			  ?>
            <tr  class="bar<?php echo $mydata['id']?>">
              <td><?php echo $monthval;?></td>
			  <td><?php echo $mydata['lineno']?></td>
              <td><?php echo $mydata['timeval']?></td>
              <td><?php echo $mydata['entrydate']?></td>
              <td><table width="80%" border="0">
                  <tr>                   
                    <td><a href="javascript:void(0);" onclick="delVoucher('<?php echo $mydata['id']?>')" title="Trash"><i class="icon-trash"></i></a></td>
                  </tr>
                </table></td>
            </tr>
            <?php 
				 }
				 } 
?>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>
