resinbatchcardPDF

This commit is contained in:
venbatechnologies 2018-04-25 20:23:15 +05:30
parent 20501f6bed
commit f8156b4336
4 changed files with 66 additions and 65 deletions

View File

@ -206,7 +206,7 @@ class resinbatchcard extends BaseController
$batchdate = $this->input->post('param3'); $batchdate = $this->input->post('param3');
$batchdate = date_format(date_create($batchdate),'Y-m-d'); $batchdate = date_format(date_create($batchdate),'Y-m-d');
$plantname = $this->input->post('param4'); $plantname = $this->input->post('param4');
$macinecode = $this->input->post('param5'); $machines = $this->input->post('param5');
$trpbatchcard = $this->input->post('param6'); $trpbatchcard = $this->input->post('param6');
$igrnos = $this->input->post('param7'); $igrnos = $this->input->post('param7');
$igrlinenos = $this->input->post('param8'); $igrlinenos = $this->input->post('param8');
@ -230,6 +230,7 @@ class resinbatchcard extends BaseController
$Catalystigrno = $this->input->post('param22'); $Catalystigrno = $this->input->post('param22');
$bagsigrnos = $this->input->post('param23'); $bagsigrnos = $this->input->post('param23');
$tonigrnos= $this->input->post('param24'); $tonigrnos= $this->input->post('param24');
$resinname=$this->input->post('param25');
$opstoinsert = json_decode($opstoinsert); $opstoinsert = json_decode($opstoinsert);
$opstodelete = json_decode($opstodelete); $opstodelete = json_decode($opstodelete);
@ -279,7 +280,7 @@ class resinbatchcard extends BaseController
} }
} }
$masterreportdata = array('remarks'=>$remarks,'updatedby'=>$createby,'approvedby'=>$approvedby,'document'=>$document,'sandtotal'=>$sandtotal,'resintotal'=>$resintotal,'hextotal'=>$hextotal,'cstotal'=>$cstotal,'catalysttotal'=>$catalysttotal,'bags50total'=>$bags50total,'ton1bagstotal'=>$ton1bagstotal,'producitonloss'=>$producitonloss,'finishedproduct'=>$finishedproduct,'operatedby'=>$operatedby, $masterreportdata = array('batchdate'=>$batchdate,'plantname'=>$plantname,'machinecode'=>$machines,'trpbatchcardno'=>$trpbatchcardno,'igrno'=>$igrnos,'igrlineno'=>$igrlinenos,'resinname'=>$resinname,'remarks'=>$remarks,'updatedby'=>$createby,'approvedby'=>$approvedby,'document'=>$document,'sandtotal'=>$sandtotal,'resintotal'=>$resintotal,'hextotal'=>$hextotal,'cstotal'=>$cstotal,'catalysttotal'=>$catalysttotal,'bags50total'=>$bags50total,'ton1bagstotal'=>$ton1bagstotal,'producitonloss'=>$producitonloss,'finishedproduct'=>$finishedproduct,'operatedby'=>$operatedby,
'igrno_for_sand'=>$sandigrnos, 'igrno_for_sand'=>$sandigrnos,
'igrno_for_resin'=>$Resinigrnos, 'igrno_for_resin'=>$Resinigrnos,
'igrno_for_haxamine'=>$Hexamineigrnos, 'igrno_for_haxamine'=>$Hexamineigrnos,
@ -322,15 +323,15 @@ class resinbatchcard extends BaseController
} }
if(!empty($opstodelete)){ if(!empty($opstodelete)){
foreach($opstodelete as $key => $opstdel) foreach($opstodelete as $key => $opstdel)
{ {
//echo 'FROM CON'.'-'.$MASTERID.'-'.$opstdel[0];
$this->db->where('master_id',$MASTERID); $this->db->where('master_id',$MASTERID);
$this->db->where('EmpID',$opstdel[$key]); $this->db->where('EmpID',$opstdel[0]);
$this->db->delete('T_ResinBatchCard_Operators'); $this->db->delete('T_ResinBatchCard_Operators');
//print_r($tArray); //print_r($tArray);
} }
} }
echo "Report Data Saved Successfully!"; echo "Report Data Saved Successfully!";

View File

@ -263,12 +263,13 @@ class Quality_model extends CI_Model
function getResinBatchCardDetails($rbcid) function getResinBatchCardDetails($rbcid)
{ {
$sql = 'select T_ResinBatchCard_Master.*,ip_products.product_name,ip_products.product_description,ip_clients.client_name,T_Machine_Master.Machine_Name,T_Employee_Details.FirstName,T_Employee_Details.LastName from T_ResinBatchCard_Master $sql = 'select T_ResinBatchCard_Master.*,ip_products.product_name,ip_products.product_description,ip_clients.client_name,T_Machine_Master.Machine_Name,T_Employee_Details.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,a.FirstName as name from T_ResinBatchCard_Master
join ip_products on T_ResinBatchCard_Master.productid = ip_products.product_id join ip_products on T_ResinBatchCard_Master.productid = ip_products.product_id
join ip_clients on T_ResinBatchCard_Master.customerid = ip_clients.client_id join ip_clients on T_ResinBatchCard_Master.customerid = ip_clients.client_id
join T_Machine_Master on T_ResinBatchCard_Master.machinecode = T_Machine_Master.Machine_Code join T_Machine_Master on T_ResinBatchCard_Master.machinecode = T_Machine_Master.Machine_Code
join tbl_users on T_ResinBatchCard_Master.createdby = tbl_users.userId join tbl_users on T_ResinBatchCard_Master.createdby = tbl_users.userId
join T_Employee_Details on tbl_users.EmpID = T_Employee_Details.EmpID join T_Employee_Details on tbl_users.EmpID = T_Employee_Details.EmpID
join T_Employee_Details as a on a.EmpID = T_ResinBatchCard_Master.operatedby
where T_ResinBatchCard_Master.resinbatch_id = ?'; where T_ResinBatchCard_Master.resinbatch_id = ?';
$res['masterdata'] = $this->db->query($sql,array($rbcid))->result(); $res['masterdata'] = $this->db->query($sql,array($rbcid))->result();
//print_r($res['masterdata']); //print_r($res['masterdata']);

View File

@ -1030,8 +1030,8 @@ console.log(listopsforstore+'-'+oldops);
var customerid = $('#customer').val(); var customerid = $('#customer').val();
var batchdate = $('#batchdate').val(); var batchdate = $('#batchdate').val();
var plantname = $('#plantname').val(); var plantname = $('#plantname').val();
var macinecode = $('#machines').val(); var machines = $('#machines').val();
var trpbatchcard = $('#trpbatchnos').val(); var trpbatchcardno = $('#trpbatchnos').val();
var igrnos = $('#igrnos').val(); var igrnos = $('#igrnos').val();
var igrlinenos = $('#igrlinenos').val(); var igrlinenos = $('#igrlinenos').val();
var remarks = $('#remarks').val(); var remarks = $('#remarks').val();
@ -1051,6 +1051,7 @@ console.log(listopsforstore+'-'+oldops);
var bagsigrlinenos = $('#bagsigrlinenos').val(); var bagsigrlinenos = $('#bagsigrlinenos').val();
var tonigrnos = $('#tonigrnos').val(); var tonigrnos = $('#tonigrnos').val();
var tonigrlinenos = $('#tonigrlinenos').val(); var tonigrlinenos = $('#tonigrlinenos').val();
var resinname =$('#resinname').val();
if(approvedby == -1 || listopsforstore.length == 0 || operatedby == -1) if(approvedby == -1 || listopsforstore.length == 0 || operatedby == -1)
{ {
@ -1085,8 +1086,8 @@ console.log(listopsforstore+'-'+oldops);
var param2 = customerid; var param2 = customerid;
var param3 = batchdate; var param3 = batchdate;
var param4 = plantname; var param4 = plantname;
var param5 = macinecode; var param5 = machines;
var param6 = trpbatchcard; var param6 = trpbatchcardno;
var param7 = igrnos; var param7 = igrnos;
var param8 = igrlinenos; var param8 = igrlinenos;
var param9 = remarks; var param9 = remarks;
@ -1105,6 +1106,7 @@ console.log(listopsforstore+'-'+oldops);
var param22 = Catalystigrnos+'-'+Catalystigrlinenos; var param22 = Catalystigrnos+'-'+Catalystigrlinenos;
var param23 = bagsigrnos+'-'+bagsigrlinenos; var param23 = bagsigrnos+'-'+bagsigrlinenos;
var param24 = tonigrnos+'-'+tonigrlinenos; var param24 = tonigrnos+'-'+tonigrlinenos;
var param25 = resinname;
@ -1132,6 +1134,7 @@ console.log(listopsforstore+'-'+oldops);
formData.append('param22',param22); formData.append('param22',param22);
formData.append('param23',param23); formData.append('param23',param23);
formData.append('param24',param24); formData.append('param24',param24);
formData.append('param25',param25);

View File

@ -36,59 +36,57 @@ th{
<div class="row"> <div class="row">
<table style="border-collapse:collapse;border-left-style:hidden;width:100%;font-size:9px;" border="1" cellspacing="0" cellpadding="0"> <table style="border-collapse:collapse;border-left-style:hidden;width:100%;font-size:9px;" border="1" cellspacing="0" cellpadding="0">
<tbody> <tbody>
<br/>
<tr> <tr>
<td colspan="15"><h2 >RESIN BATCH CARD REPORT </h2></td> <td style="width: 51px;" colspan="4"><h2>RESIN BATCH CARD REPORT </h2></td>
</tr> </tr>
<br/>
<tr >
<td colspan="1" width="8%">B No : </td>
<td colspan="1" width="8%" ><?php echo $records['masterdata'][0]->trpbatchcardno;?></td>
<td colspan="1" width="8%" >Date:</td>
<td colspan=" 1" width="8%" ><?php echo date_format(date_create($records['masterdata'][0]->batchdate),'d-m-Y');?></td>
<!-- <td width="8%" ></td> -->
<td colspan=" 2" width="8%" >Shift:</td>
<td colspan=" 2" width="8%" ><?php echo $records['masterdata'][0]->plantname?></td>
<!-- <td colspan=" 2" width="8%" >IGR Line Item No:<?php echo $records['masterdata'][0]->igrlineno;?></td> -->
<td colspan="1" width="8%">SAND: </td>
<td colspan="2" width="8%"><?php echo $records['masterdata'][0]->igrno;?></td>
<td colspan=" 1" width="8%">RESIN:</td>
<td colspan=" 3" width="8%"><?php echo $records['masterdata'][0]->resinname?></td>
</tr>
&nbsp;
<tr> <tr>
<td colspan="1" width="8%" >Operator</td> <td style="width: 51px;" colspan="2"><b><?php echo $records['masterdata'][0]->client_name?></b></td>
<td colspan="3" width="8%" ><?php <td style="width: 51px;" colspan="2"><b><?php echo $records['masterdata'][0]->product_name.'-'.$records['masterdata'][0]->product_description?></b></td>
</tr>
<tr>
<td style="width: 51px;" colspan="2"><b>Resin Name : </b><b><?php echo $records['masterdata'][0]->resinname;?></b></td>
<td style="width: 51px;" colspan="2"><b> Batch Date : </b><b><?php echo date_format(date_create($records['masterdata'][0]->batchdate),'d-m-Y');?></td>
</tr>
<tr>
<td style="width: 51px;" colspan="2"><b>Shift Name : </b><b><?php echo $records['masterdata'][0]->plantname?></b></td>
<td style="width: 51px;" colspan="2"><b>TRP Batch No(For TRP Sand) : </b><b><?php echo $records['masterdata'][0]->trpbatchcardno;?></b></td>
</tr>
<tr>
<td style="width: 51px;"><b>IGR No(For Resin)</b></td>
<td style="width: 51px;"><b><?php echo $records['masterdata'][0]->igrno_for_resin;?> </b></td>
<td style="width: 51px;"><b>IGR No(For Hexamine)</b></td>
<td style="width: 51px;"><b><?php echo $records['masterdata'][0]->igrno_for_haxamine;?></td>
</tr>
<tr>
<td style="width: 51px;"><b>IGR No(For CS)</b></td>
<td style="width: 51px;"><b><?php echo $records['masterdata'][0]->igrno_for_cs;?></b></td>
<td style="width: 51px;"><b>IGR No(For Catalyst)</b></td>
<td style="width: 51px;"><b><?php echo $records['masterdata'][0]->igrno_for_catalyst;?></b></td>
</tr>
<tr>
<td style="width: 51px;"><b>IGR No(For 50 Bags)</b></td>
<td style="width: 51px;"><b><?php echo $records['masterdata'][0]->igrno_for_bags;?></b></td>
<td style="width: 51px;"><b>IGR No(For 1 ton Bag)</b></td>
<td style="width: 51px;"><?php echo $records['masterdata'][0]->igrno_for_tonbags;?></b></td>
</tr>
<tr>
<td style="width: 51px;"><b>IGR No(For Fresh Sand)</b></td>
<td style="width: 51px;"><?php echo $records['masterdata'][0]->igrno_for_sand;?></b></td>
<td style="width: 51px;"><b>Machine Name</b></td>
<td style="width: 51px;"><b><?php echo $records['masterdata'][0]->machinecode .'-'.$records['masterdata'][0]->Machine_Name?></td>
</tr>
<tr>
<td style="width: 51px;" colspan="1"><b>Helpers </b></td>
<td style="width: 51px;" colspan="3"><b><?php
foreach($existoperatorslist as $ex) foreach($existoperatorslist as $ex)
{ {
echo "<option value=".$ex->EmpID.">".$ex->EmpID.'-'.$ex->FirstName.'-'.$ex->LastName."</opiton>"; echo "<option value=".$ex->EmpID.">".$ex->EmpID.'-'.$ex->FirstName.'-'.$ex->LastName.','."</opiton>";
} }
?></td> ?></b></td>
<td colspan="1" >Customer:</td>
<td colspan="3" width="8%"><?php echo $records['masterdata'][0]->client_name?></td>
<td colspan="1" width="8%" >Grade:</td>
<td colspan="3" width="8%"><?php echo $records['masterdata'][0]->product_name.'-'.$records['masterdata'][0]->product_description?></td>
<td colspan="1" width="8%" >Machine Name:</td>
<td colspan="2"><?php echo $records['masterdata'][0]->machinecode;?></td>
</tr> </tr>
@ -96,10 +94,9 @@ th{
</tbody>
</table>
</table>
</tbody></table>
</div> </div>
</div> </div>
@ -278,8 +275,8 @@ th{
<hr> <hr>
<br> <br>
<table > <table >
<tr><td>INSPECTOR NAME <tr><td> Operator
:<?php echo $this->session->userdata ( 'name' );?></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>APPROVED BY:<?php echo $records['masterdata'][0]->approvedby; ?></td></tr> :<?php echo $records['masterdata'][0]->operatedby.'-'.$records['masterdata'][0]->name?></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>Production In charge :<?php echo $records['masterdata'][0]->approvedby; ?></td></tr>
<tr><td colspan="2">&nbsp;</td></tr> <tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2">&nbsp;</td></tr> <tr><td colspan="2">&nbsp;</td></tr>
@ -1076,4 +1073,3 @@ console.log(listopsforstore+'-'+oldops);