NEW INPROCESS MODULE

This commit is contained in:
velz2020 2018-02-21 12:42:55 +05:30
parent 021aef14d9
commit 92df4b36d1
15 changed files with 10906 additions and 25 deletions

View File

@ -272,5 +272,11 @@ $route['addNewdepartment'] = "department/addNewdepartment";
$route['editOlddepartment'] = "department/viewdepartment";
$route['editOlddepartment/(:num)'] = "department/viewdepartment/$1";
$route['editdepartment'] = "department/editdepartment";
//<-------------Reports page----------------->
$route['normalinprocess'] = "inprocess/addNewInprocessInspection";
$route['nissaninprocess'] = "inprocess/addNewNissaanInprocessInspection";
/* End of file routes.php */
/* Location: ./application/config/routes.php */

View File

@ -0,0 +1,881 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
require APPPATH . '/libraries/BaseController.php';
/**
* Class : purchaseorder (PurchaseorderController)
* User Class to control all user related operations.
* @author : VenbaMail Mali
* @version : 1.1
* @since : 15 Feb 2016
*/
class inprocess extends BaseController
{
/**
* This is default constructor of the class
*/
public function __construct()
{
parent::__construct();
$this->isLoggedIn();
$this->load->model('quality_model');
$this->load->model('inprocess_model');
$this->load->library('form_validation');
//$this->load->library('dompdf_gen');
}
/**
* This function used to load the first screen of the user
*/
public function index()
{
$data['reportlist'] = $this->inprocess_model->getAllTestReports();
$this->global['pageTitle'] = 'Siddharth : Inprocess Test Reports List';
$this->loadViews("reportlist_inprocesstest", $this->global, $data , NULL);
}
public function addNewInprocessInspection()
{
$data['productsoutward'] = $this->quality_model->getAllprodcuts();
$data['customersoutward'] = $this->quality_model->getAllcustomers();
$data['emplist'] = $this->quality_model->getEmplistforReport();
$this->global['pageTitle'] = 'Siddharth : New Inprcess Test Report ';
$this->loadViews("newinprocessreport", $this->global, $data , NULL);
}
function addNewNissanInprocessInspection()
{
$data['productsoutward'] = $this->quality_model->getAllprodcuts();
$data['customersoutward'] = $this->quality_model->getAllcustomers();
$data['emplist'] = $this->quality_model->getEmplistforReport();
$this->global['pageTitle'] = 'Siddharth : New Inprcess Test Report ';
$this->loadViews("newnissaninprocessreport", $this->global, $data , NULL);
}
function editIndInprocessReport()
{
$rid = $this->uri->segment(3);
$data['reportdata'] = $this->inprocess_model->getIndividualInprocessReportData($rid);
$pspecid = null;
$psubtype = null;
$time = null;
$temparray = array();
$time = array();
$index = 0;
foreach($data['reportdata']['masterreport'] as $key => $d)
{
if($pspecid != $d->specid){
$index++;
$temparray[$index] = array('specid'=>$d->specid,'specname'=>$d->testtype,'smin'=>$d->min,'smax'=>$d->max,'suom'=>$d->uom,'stype'=>$d->subtype,$d->ivalue);
$time = array_merge($time,array($d->itime));
}
else{
array_push($temparray[$index],$d->ivalue);
$time = array_merge($time,array($d->itime));
}
$pspecid = $d->specid;
}
$data['reportdata']['masterreport'] = $temparray;
$data['timearray'] = $time;
$data['emplist'] = $this->quality_model->getEmplistforReport();
if($data['reportdata']['master'][0]->test_type == 0 )
{
$this->global['pageTitle'] = 'Siddharth : Edit Inprocess Report';
$this->loadViews("editInprocessReport", $this->global, $data , NULL);
}
else
{
//echo "Under Developing";
$this->global['pageTitle'] = 'Siddharth : Edit Nissan Inprocess Report';
$this->loadViews("editNissanInprocessReport", $this->global, $data , NULL);
}
}
function getAllSpecforReport()
{
$productid = $this->input->post('param1');
$customerid = $this->input->post('param2');
//echo 'from cn'.$productid.'-'.$customerid;exit();
$res = $this->quality_model->getSpecifications($productid,$customerid);
echo json_encode($res);
}
function saveTestReportData()
{
date_default_timezone_get('Asia/Kolkata');
$testjson = $this->input->post('param1');
$testjson2 = $this->input->post('param2');
$afsjson = $this->input->post('param3');
$loijson = $this->input->post('param4');
$productid = $this->input->post('param5');
$customerid = $this->input->post('param6');
$batchno = $this->input->post('param7');
$batchdate = $this->input->post('param8');
$batchdate = date_format(date_create($batchdate),'Y-m-d');
$plantname = $this->input->post('param9');
$sanddesc = $this->input->post('param10');
$resindesc = $this->input->post('param11');
$qty = $this->input->post('param12');
$times = $this->input->post('param13');
$times = explode(",",$times);
$approvedby = $this->input->post('param14');
$remarks = $this->input->post('param15');
$testphpdata = json_decode($testjson,true);
$testphpdata2 = json_decode($testjson2,true);
$loiphpdata = json_decode($loijson,true);
$afsphpdata = json_decode($afsjson,true);
//print_r($afsphpdata);die();
$createdon = date('Y-m-d H:i:s');
$createby = $this->session->userdata ( 'userId' );
$document = null;
if(!empty($_FILES['rfile']['name']))
{
$fs = $this->uploadFile();
$document = $fs;
}
$masterreportdata = array('productid'=>$productid,'customerid'=>$customerid,'batchno'=>$batchno,'batchdate'=>$batchdate,'plantname'=>$plantname,'sand_description'=>$sanddesc,'resin_description'=>$resindesc,'qty'=>$qty,'remarks'=>$remarks,'document'=>$document,'createdby'=>$createby,'approvedby'=>$approvedby);
$MASTERID = $this->inprocess_model->saveMasterTestData($masterreportdata);
//$MASTERID = 1;
foreach($testphpdata as $data)
{
//print_r($data);
$temparray = array();
$specid = $data['SPECID'];
$subtype = 0;
$actarray = array($data['ACT X1'],$data['ACT X2'],$data['ACT X3'],$data['ACT X4'],$data['ACT X5'],$data['ACT X6'],$data['ACT X7'],$data['ACT X8']);
for($i=1;$i<=8;$i++)
{
$temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-1],'ivalue'=>$actarray[$i-1]);
}
$this->inprocess_model->saveTestReportData($temparray);
}
foreach($testphpdata2 as $data)
{
//print_r($data);
$temparray = array();
$specid = $data['SPECID'];
$subtype = 1;
$cstarray = array($data['CST X1'],$data['CST X2'],$data['CST X3'],$data['CST X4'],$data['CST X5'],$data['CST X6'],$data['CST X7'],$data['CST X8']);
$rstarray = array($data['RST Y1'],$data['RST Y2'],$data['RST Y3']);
for($i=1;$i<=3;$i++)
{
$temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>'','ivalue'=>$rstarray[$i-1]);
}
for($i=4;$i<=11;$i++)
{
$temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-4],'ivalue'=>$cstarray[$i-4]);
}
$this->inprocess_model->saveTestReportData($temparray);
}
$count =0;
foreach($afsphpdata as $afs)
{
//print_r($afs);
$count++;
if($count != 12){
$ssize = $afs['Sieve Size µm'];
$spec = $afs['Spec'];
$factor = $afs['Factor'];
$rst1 = $afs['RST Y1'];$rst2 = $afs['RST Y2'];$rst3 = $afs['RST Y3'];
$cst1 = $afs['CST X1'];$cst2 = $afs['CST X2'];$cst3 = $afs['CST X3'];$cst4 = $afs['CST X4'];
$cst5 = $afs['CST X5'];$cst6 = $afs['CST X6'];$cst7 = $afs['CST X7'];$cst8 = $afs['CST X8'];
$afstabledata = array('masterreport_id'=>$MASTERID,'sieve_size'=>$ssize,'factor'=>$factor,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
//print_r($afstabledata);
$afsid = $this->inprocess_model->saveTestReportAFSData($afstabledata);
}
}
//die();
foreach($loiphpdata as $loi)
{
//print_r($loi);
$loidetails = $loi['Description'];
$spec = $loi['Spec'];
$rst1 = $loi['RST Y1'];
$rst2 = $loi['RST Y2'];
$rst3 = $loi['RST Y3'];
$cst1 = $loi['CST X1'];$cst2 = $loi['CST X2'];$cst3 = $loi['CST X3'];$cst4 = $loi['CST X4'];
$cst5 = $loi['CST X5'];$cst6 = $loi['CST X6'];$cst7 = $loi['CST X7'];$cst8 = $loi['CST X8'];
$loitabledata = array('masterreport_id'=>$MASTERID,'loidetails'=>$loidetails,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
$loiid = $this->inprocess_model->saveTestReportLOIData($loitabledata);
}
echo "Report Data Saved Successfully!";
}
function updateTestReportData()
{
date_default_timezone_get('Asia/Kolkata');
$testjson = $this->input->post('param1');
$testjson2 = $this->input->post('param2');
$afsjson = $this->input->post('param3');
$loijson = $this->input->post('param4');
$productid = $this->input->post('param5');
$customerid = $this->input->post('param6');
$batchno = $this->input->post('param7');
$batchdate = $this->input->post('param8');
$batchdate = date_format(date_create($batchdate),'Y-m-d');
$plantname = $this->input->post('param9');
$sanddesc = $this->input->post('param10');
$resindesc = $this->input->post('param11');
$qty = $this->input->post('param12');
$times = $this->input->post('param13');
$times = explode(",",$times);
$approvedby = $this->input->post('param14');
$remarks = $this->input->post('param15');
$masterid = $this->input->post('param16');
$olddoc = $this->input->post('param17');
$testphpdata = json_decode($testjson,true);
$testphpdata2 = json_decode($testjson2,true);
$loiphpdata = json_decode($loijson,true);
$afsphpdata = json_decode($afsjson,true);
//print_r($afsphpdata);die();
$createdon = date('Y-m-d H:i:s');
$createby = $this->session->userdata ( 'userId' );
$document = $olddoc;
if(!empty($_FILES['rfile']['name']))
{
$file = getcwd()."\\uploads\INPROCESS\\".$document;
if(unlink($file)){ echo "sucess";}else{ echo "Failed";}
$fs = $this->uploadFile();
$document = $fs;
}
$masterreportdata = array('productid'=>$productid,'customerid'=>$customerid,'batchno'=>$batchno,'batchdate'=>$batchdate,'plantname'=>$plantname,'sand_description'=>$sanddesc,'resin_description'=>$resindesc,'qty'=>$qty,'remarks'=>$remarks,'document'=>$document,'updatedby'=>$createby,'approvedby'=>$approvedby);
$this->inprocess_model->updateMasterTestData($masterreportdata,$masterid);
foreach($testphpdata as $data)
{
//print_r($data);
$temparray = array();
$specid = $data['SPECID'];
$subtype = 0;
$actarray = array($data['ACT X1'],$data['ACT X2'],$data['ACT X3'],$data['ACT X4'],$data['ACT X5'],$data['ACT X6'],$data['ACT X7'],$data['ACT X8']);
for($i=1;$i<=8;$i++)
{
//$temparray[$i] = array('itime'=>$times[$i-1],'ivalue'=>$actarray[$i-1]);
$temparray[$i] = array('masterreport_id'=>$masterid,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-1],'ivalue'=>$actarray[$i-1]);
}
$this->inprocess_model->updateTestReportData($temparray,$masterid,$specid);
}
foreach($testphpdata2 as $data)
{
//print_r($data);
$temparray = array();
$specid = $data['SPECID'];
$subtype = 1;
$cstarray = array($data['CST X1'],$data['CST X2'],$data['CST X3'],$data['CST X4'],$data['CST X5'],$data['CST X6'],$data['CST X7'],$data['CST X8']);
$rstarray = array($data['RST Y1'],$data['RST Y2'],$data['RST Y3']);
for($i=1;$i<=3;$i++)
{
$temparray[$i] = array('masterreport_id'=>$masterid,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>'','ivalue'=>$rstarray[$i-1]);
}
for($i=4;$i<=11;$i++)
{
$temparray[$i] = array('masterreport_id'=>$masterid,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-4],'ivalue'=>$cstarray[$i-4]);
}
$this->inprocess_model->updateTestReportData($temparray,$masterid,$specid);
}
$count =0;
foreach($afsphpdata as $afs)
{
//print_r($afs);
$count++;
if($count != 12){
$ssize = $afs['Sieve Size µm'];
$spec = $afs['Spec'];
$factor = $afs['Factor'];
$rst1 = $afs['RST Y1'];$rst2 = $afs['RST Y2'];$rst3 = $afs['RST Y3'];
$cst1 = $afs['CST X1'];$cst2 = $afs['CST X2'];$cst3 = $afs['CST X3'];$cst4 = $afs['CST X4'];
$cst5 = $afs['CST X5'];$cst6 = $afs['CST X6'];$cst7 = $afs['CST X7'];$cst8 = $afs['CST X8'];
$afstabledata = array('spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
$this->inprocess_model->updateTestReportAFSData($afstabledata,$masterid,$ssize,$factor);
}
}
foreach($loiphpdata as $loi)
{
//print_r($loi);
$loidetails = $loi['Description'];
$spec = $loi['Spec'];
$rst1 = $loi['RST Y1'];
$rst2 = $loi['RST Y2'];
$rst3 = $loi['RST Y3'];
$cst1 = $loi['CST X1'];$cst2 = $loi['CST X2'];$cst3 = $loi['CST X3'];$cst4 = $loi['CST X4'];
$cst5 = $loi['CST X5'];$cst6 = $loi['CST X6'];$cst7 = $loi['CST X7'];$cst8 = $loi['CST X8'];
$loitabledata = array('spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
$loiid = $this->inprocess_model->updateTestReportLOIData($loitabledata,$masterid,$loidetails);
}
echo "Report Data Saved Successfully!";
}
function printIndInprocessReport()
{
$rid = $this->input->post('masterreportid');
$data['reportdata'] = $this->inprocess_model->getIndividualInprocessReportData($rid);
$pspecid = null;
$psubtype = null;
$time = null;
$temparray = array();
$time = array();
$index = 0;
foreach($data['reportdata']['masterreport'] as $key => $d)
{
if($pspecid != $d->specid){
$index++;
$temparray[$index] = array('specid'=>$d->specid,'specname'=>$d->testtype,'smin'=>$d->min,'smax'=>$d->max,'suom'=>$d->uom,'stype'=>$d->subtype,$d->ivalue);
$time = array_merge($time,array($d->itime));
}
else{
array_push($temparray[$index],$d->ivalue);
$time = array_merge($time,array($d->itime));
}
$pspecid = $d->specid;
}
$data['reportdata']['masterreport'] = $temparray;
$data['timearray'] = $time;
$data['emplist'] = $this->quality_model->getEmplistforReport();
$this->global['pageTitle'] = 'Siddharth :Inprocess Report';
$html = $this->load->View("viewindinprocesspdf",$data,true);
require APPPATH . '/third_party/mpdf/mpdf.php';
$mpdf=new mPDF('utf-8','A4-P',7,10,10, 10, 10, 24, 4, 6);
$mpdf->SetDisplayMode('fullpage');
$mpdf->list_indent_first_level = 1;
$mpdf->setAutoTopMargin = 'stretch';
$mpdf->setAutoBottomMargin = 'stretch';
$mpdf->WriteHTML($html);
$mpdf->Output($filename.'.pdf','I');
}
function printIndNissanInprocessReport()
{
$rid = $this->input->post('masterreportid');
$data['reportdata'] = $this->inprocess_model->getIndividualInprocessReportData($rid);
//print_r($data['reportdata'] );die();
$pspecid = null;
$psubtype = null;
$time = null;
$temparray = array();
$time = array();
$index = 0;
foreach($data['reportdata']['masterreport'] as $key => $d)
{
if($pspecid != $d->specid){
$index++;
$temparray[$index] = array('specid'=>$d->specid,'specname'=>$d->testtype,'smin'=>$d->min,'smax'=>$d->max,'suom'=>$d->uom,'stype'=>$d->subtype,$d->ivalue);
$time = array_merge($time,array($d->itime));
}
else{
array_push($temparray[$index],$d->ivalue);
$time = array_merge($time,array($d->itime));
}
$pspecid = $d->specid;
}
$data['reportdata']['masterreport'] = $temparray;
$data['timearray'] = $time;
$data['emplist'] = $this->quality_model->getEmplistforReport();
$this->global['pageTitle'] = 'Siddharth :Inprocess Report';
$html = $this->load->View("viewindnissaninprocesspdf",$data,true);
require APPPATH . '/third_party/mpdf/mpdf.php';
$mpdf=new mPDF('utf-8','A4-P',7,10,10, 10, 10, 24, 4, 6);
$mpdf->SetDisplayMode('fullpage');
$mpdf->list_indent_first_level = 1;
$mpdf->setAutoTopMargin = 'stretch';
$mpdf->setAutoBottomMargin = 'stretch';
$mpdf->WriteHTML($html);
$mpdf->Output($filename.'.pdf','I');
}
function saveNissanTestReportData()
{
date_default_timezone_get('Asia/Kolkata');
$testjson = $this->input->post('param1');
$testjson2 = $this->input->post('param2');
$afsjson = $this->input->post('param3');
$loijson = $this->input->post('param4');
$productid = $this->input->post('param5');
$customerid = $this->input->post('param6');
$batchno = $this->input->post('param7');
$batchdate = $this->input->post('param8');
$batchdate = date_format(date_create($batchdate),'Y-m-d');
$plantname = $this->input->post('param9');
$sanddesc = $this->input->post('param10');
$resindesc = $this->input->post('param11');
$qty = $this->input->post('param12');
$times = $this->input->post('param13');
$times = explode(",",$times);
$approvedby = $this->input->post('param14');
$remarks = $this->input->post('param15');
$nissansubtype = $this->input->post('param16');
//echo $nissansubtype;
$testphpdata = json_decode($testjson,true);
$testphpdata2 = json_decode($testjson2,true);
$loiphpdata = json_decode($loijson,true);
$afsphpdata = json_decode($afsjson,true);
//print_r($afsphpdata);die();
$createdon = date('Y-m-d H:i:s');
$createby = $this->session->userdata ( 'userId' );
$document = null;
if(!empty($_FILES['rfile']['name']))
{
$fs = $this->uploadFile();
$document = $fs;
}
$masterreportdata = array('productid'=>$productid,'customerid'=>$customerid,'batchno'=>$batchno,'batchdate'=>$batchdate,'plantname'=>$plantname,'sand_description'=>$sanddesc,'resin_description'=>$resindesc,'qty'=>$qty,'test_type'=>1,'subtype'=>$nissansubtype,'remarks'=>$remarks,'document'=>$document,'createdby'=>$createby,'approvedby'=>$approvedby);
$MASTERID = $this->inprocess_model->saveMasterTestData($masterreportdata);
//$MASTERID = 1;
foreach($testphpdata as $data)
{
//print_r($data);
$temparray = array();
$specid = $data['SPECID'];
$subtype = 0;
$actarray = array($data['ACT X1'],$data['ACT X2'],$data['ACT X3'],$data['ACT X4'],$data['ACT X5'],$data['ACT X6'],$data['ACT X7'],$data['ACT X8']);
for($i=1;$i<=8;$i++)
{
$temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-1],'ivalue'=>$actarray[$i-1]);
}
$this->inprocess_model->saveTestReportData($temparray);
}
foreach($testphpdata2 as $data)
{
//print_r($data);
$temparray = array();
$specid = $data['SPECID'];
$subtype = 1;
$cstarray = array($data['CST X1'],$data['CST X2'],$data['CST X3'],$data['CST X4'],$data['CST X5'],$data['CST X6'],$data['CST X7'],$data['CST X8']);
$rstarray = array($data['RST Y1'],$data['RST Y2'],$data['RST Y3']);
for($i=1;$i<=3;$i++)
{
$temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>'','ivalue'=>$rstarray[$i-1]);
}
for($i=4;$i<=11;$i++)
{
$temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-4],'ivalue'=>$cstarray[$i-4]);
}
$this->inprocess_model->saveTestReportData($temparray);
}
foreach($afsphpdata as $key => $afs)
{
if($nissansubtype == 0){
if(($key != 3) && ($key != 9) && ($key != 12) && ($key != 14)){
$ssize = $afs['Sieve Size µm'];
$spec = $afs['Spec'];
$factor = $afs['Factor'];
$rst1 = $afs['RST Y1'];$rst2 = $afs['RST Y2'];$rst3 = $afs['RST Y3'];
$cst1 = $afs['CST X1'];$cst2 = $afs['CST X2'];$cst3 = $afs['CST X3'];$cst4 = $afs['CST X4'];
$cst5 = $afs['CST X5'];$cst6 = $afs['CST X6'];$cst7 = $afs['CST X7'];$cst8 = $afs['CST X8'];
$afstabledata = array('masterreport_id'=>$MASTERID,'sieve_size'=>$ssize,'factor'=>$factor,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
//print_r($afstabledata);
$afsid = $this->inprocess_model->saveTestReportAFSData($afstabledata);
}
}
else
{
if(($key != 6) && ($key != 9) && ($key != 12) && ($key != 14)){
$ssize = $afs['Sieve Size µm'];
$spec = $afs['Spec'];
$factor = $afs['Factor'];
$rst1 = $afs['RST Y1'];$rst2 = $afs['RST Y2'];$rst3 = $afs['RST Y3'];
$cst1 = $afs['CST X1'];$cst2 = $afs['CST X2'];$cst3 = $afs['CST X3'];$cst4 = $afs['CST X4'];
$cst5 = $afs['CST X5'];$cst6 = $afs['CST X6'];$cst7 = $afs['CST X7'];$cst8 = $afs['CST X8'];
$afstabledata = array('masterreport_id'=>$MASTERID,'sieve_size'=>$ssize,'factor'=>$factor,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
//print_r($afstabledata);
$afsid = $this->inprocess_model->saveTestReportAFSData($afstabledata);
}
}
}
foreach($loiphpdata as $loi)
{
//print_r($loi);
$loidetails = $loi['Description'];
$spec = $loi['Spec'];
$rst1 = $loi['RST Y1'];
$rst2 = $loi['RST Y2'];
$rst3 = $loi['RST Y3'];
$cst1 = $loi['CST X1'];$cst2 = $loi['CST X2'];$cst3 = $loi['CST X3'];$cst4 = $loi['CST X4'];
$cst5 = $loi['CST X5'];$cst6 = $loi['CST X6'];$cst7 = $loi['CST X7'];$cst8 = $loi['CST X8'];
$loitabledata = array('masterreport_id'=>$MASTERID,'loidetails'=>$loidetails,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
$loiid = $this->inprocess_model->saveTestReportLOIData($loitabledata);
}
echo "Report Data Saved Successfully!";
}
function uploadFile()
{
$pathinfo = pathinfo($_FILES['rfile']['name']);
$config['upload_path'] = 'uploads/INPROCESS/';
$config['allowed_types'] = '*';
$filename = $_FILES['rfile']['name'];
$ext = end(explode('.',$filename));
$ext = strtolower($ext);
$fn = 'inprocess' . date('Y-m-d') . time() . '.' . $ext;
//print_r($fn);die();
$config['file_name'] = $fn;
//echo $config['file_name'];
$this->load->library('upload',$config);
$this->upload->initialize($config);
if($this->upload->do_upload('rfile'))
{
$uploadData = $this->upload->data();
$uploadfilename = $uploadData['file_name'];
return $uploadfilename;
}
else
{
$error = array('error' => $this->upload->display_errors());
$uploadfilename = '';
print_r($error);
return null;
}
}
function updateNissanInprocessTestReportData()
{
//echo "controller";die();
date_default_timezone_get('Asia/Kolkata');
$testjson = $this->input->post('param1');
$testjson2 = $this->input->post('param2');
$afsjson = $this->input->post('param3');
$loijson = $this->input->post('param4');
$productid = $this->input->post('param5');
$customerid = $this->input->post('param6');
$batchno = $this->input->post('param7');
$batchdate = $this->input->post('param8');
$batchdate = date_format(date_create($batchdate),'Y-m-d');
$plantname = $this->input->post('param9');
$sanddesc = $this->input->post('param10');
$resindesc = $this->input->post('param11');
$qty = $this->input->post('param12');
$times = $this->input->post('param13');
$times = explode(",",$times);
$approvedby = $this->input->post('param14');
$remarks = $this->input->post('param15');
$nissansubtype = $this->input->post('param16');
$masterid = $this->input->post('param17');
$olddoc = $this->input->post('param18');
//echo $nissansubtype;
$testphpdata = json_decode($testjson,true);
$testphpdata2 = json_decode($testjson2,true);
$loiphpdata = json_decode($loijson,true);
$afsphpdata = json_decode($afsjson,true);
//print_r($afsphpdata);die();
$createdon = date('Y-m-d H:i:s');
$createby = $this->session->userdata ( 'userId' );
$document = $olddoc;
if(!empty($_FILES['rfile']['name']))
{
$fs = $this->uploadFile();
$document = $fs;
}
//echo 'From COn'.$masterid;
$masterreportdata = array('productid'=>$productid,'customerid'=>$customerid,'batchno'=>$batchno,'batchdate'=>$batchdate,'plantname'=>$plantname,'sand_description'=>$sanddesc,'resin_description'=>$resindesc,'qty'=>$qty,'test_type'=>1,'subtype'=>$nissansubtype,'remarks'=>$remarks,'document'=>$document,'updatedby'=>$createby,'approvedby'=>$approvedby);
//print_r($masterreportdata);
$this->inprocess_model->updateNissanMasterTestData($masterreportdata,$masterid);
$MASTERID = $masterid;
foreach($testphpdata as $data)
{
//print_r($data);
$temparray = array();
$specid = $data['SPECID'];
$subtype = 0;
$actarray = array($data['ACT X1'],$data['ACT X2'],$data['ACT X3'],$data['ACT X4'],$data['ACT X5'],$data['ACT X6'],$data['ACT X7'],$data['ACT X8']);
for($i=1;$i<=8;$i++)
{
$temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-1],'ivalue'=>$actarray[$i-1]);
}
$this->inprocess_model->updateNissanTestReportData($temparray,$masterid,$specid);
}
foreach($testphpdata2 as $data)
{
//print_r($data);
$temparray = array();
$specid = $data['SPECID'];
$subtype = 1;
$cstarray = array($data['CST X1'],$data['CST X2'],$data['CST X3'],$data['CST X4'],$data['CST X5'],$data['CST X6'],$data['CST X7'],$data['CST X8']);
$rstarray = array($data['RST Y1'],$data['RST Y2'],$data['RST Y3']);
for($i=1;$i<=3;$i++)
{
$temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>'','ivalue'=>$rstarray[$i-1]);
}
for($i=4;$i<=11;$i++)
{
$temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-4],'ivalue'=>$cstarray[$i-4]);
}
$this->inprocess_model->updateNissanTestReportData($temparray,$masterid,$specid);
}
foreach($afsphpdata as $key => $afs)
{
if($nissansubtype == 0){
if(($key != 3) && ($key != 9) && ($key != 12) && ($key != 14)){
$ssize = $afs['Sieve Size µm'];
$spec = $afs['Spec'];
$factor = $afs['Factor'];
$rst1 = $afs['RST Y1'];$rst2 = $afs['RST Y2'];$rst3 = $afs['RST Y3'];
$cst1 = $afs['CST X1'];$cst2 = $afs['CST X2'];$cst3 = $afs['CST X3'];$cst4 = $afs['CST X4'];
$cst5 = $afs['CST X5'];$cst6 = $afs['CST X6'];$cst7 = $afs['CST X7'];$cst8 = $afs['CST X8'];
$afstabledata = array('masterreport_id'=>$MASTERID,'sieve_size'=>$ssize,'factor'=>$factor,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
//print_r($afstabledata);
$afsid = $this->inprocess_model->updateNissanTestReportAFSData($afstabledata,$masterid,$ssize,$factor);
}
}
else
{
if(($key != 6) && ($key != 9) && ($key != 12) && ($key != 14)){
$ssize = $afs['Sieve Size µm'];
$spec = $afs['Spec'];
$factor = $afs['Factor'];
$rst1 = $afs['RST Y1'];$rst2 = $afs['RST Y2'];$rst3 = $afs['RST Y3'];
$cst1 = $afs['CST X1'];$cst2 = $afs['CST X2'];$cst3 = $afs['CST X3'];$cst4 = $afs['CST X4'];
$cst5 = $afs['CST X5'];$cst6 = $afs['CST X6'];$cst7 = $afs['CST X7'];$cst8 = $afs['CST X8'];
$afstabledata = array('masterreport_id'=>$MASTERID,'sieve_size'=>$ssize,'factor'=>$factor,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
//print_r($afstabledata);
$afsid = $this->inprocess_model->updateNissanTestReportAFSData($afstabledata,$masterid,$ssize,$factor);
}
}
}
foreach($loiphpdata as $loi)
{
//print_r($loi);
$loidetails = $loi['Description'];
$spec = $loi['Spec'];
$rst1 = $loi['RST Y1'];
$rst2 = $loi['RST Y2'];
$rst3 = $loi['RST Y3'];
$cst1 = $loi['CST X1'];$cst2 = $loi['CST X2'];$cst3 = $loi['CST X3'];$cst4 = $loi['CST X4'];
$cst5 = $loi['CST X5'];$cst6 = $loi['CST X6'];$cst7 = $loi['CST X7'];$cst8 = $loi['CST X8'];
$loitabledata = array('masterreport_id'=>$MASTERID,'loidetails'=>$loidetails,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
$loiid = $this->inprocess_model->updateNissanTestReportLOIData($loitabledata,$masterid,$loidetails);
}
echo "Report Data Saved Successfully!";
}
}
?>

View File

@ -74,7 +74,8 @@ class quality extends BaseController
$customer = $this->input->post('param3');
$jsondata = $this->input->post('param1');
$type = $this->input->post('param4');
//echo $customer;exit();
$createdby = $this->session->userdata ( 'userId' );
$phpdata = json_decode($jsondata);
@ -90,19 +91,21 @@ class quality extends BaseController
$min = $data->Min;
$max = $data->Max;
$temp = $data->Temp;
$isExist = $this->quality_model->checkExist($product,$customer,$name);
$sub = $data->SubCatagory;
$isExist = $this->quality_model->checkExist($product,$customer,$name,$type);
//echo $isExist[0]->count;die();
if($isExist[0]->count == 0)
{
$tostore = array('customer_id'=>$customer,'product_id'=>$product,'testtype'=>$name,'uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'created_by'=>$createdby);
$tostore = array('customer_id'=>$customer,'product_id'=>$product,'testtype'=>$name,'uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'subtype' => $sub,'created_by'=>$createdby);
$res = $this->quality_model->addSpecMast($tostore);
//echo 'i'.$res;
}
else if($isExist[0]->count == 1)
{
$tostore = array('uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'updated_by'=>$createdby);
$tostore = array('uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'subtype'=>$sub,'updated_by'=>$createdby);
$res = $this->quality_model->updateSpecMast($tostore,$product,$customer,$name);
//echo 'u'.$res;
}
@ -209,8 +212,18 @@ class quality extends BaseController
{
$productid = $this->input->post('param1');
$customerid = $this->input->post('param2');
//echo 'from cn'.$productid.'-'.$customerid;exit();
$res = $this->quality_model->getSpecifications($productid,$customerid);
$res = '';
if($this->input->post('param3'))
{
$ttype = $this->input->post('param3');
$res = $this->quality_model->getSpecifications($productid,$customerid,$ttype);
}
else
{
$res = $this->quality_model->getSpecifications($productid,$customerid);
}
echo json_encode($res);
}

View File

@ -0,0 +1,261 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
class inprocess_model extends CI_Model
{
function getAllprodcuts()
{
$this->db->select('product_id,product_name,product_description');
$this->db->from('ip_products');
$result = $this->db->get();
return $result->result();
}
function getAllcustomers()
{
$this->db->select('client_id,client_name');
$this->db->from('ip_clients');
$result = $this->db->get();
return $result->result();
}
function getAllTestReports()
{
$this->db->select('masterreport_id,productid,ip_products.product_name,customerid,ip_clients.client_name,batchno,batchdate,document');
$this->db->join('ip_products','T_Inprocess_Testreport_Master.productid=ip_products.product_id');
$this->db->join('ip_clients','T_Inprocess_Testreport_Master.customerid=ip_clients.client_id');
$this->db->from('T_Inprocess_Testreport_Master');
$result = $this->db->get();
return $result->result();
}
function getSpecifications($productid,$customerid)
{
//echo 'from model'.$productid.'-'.$customerid;
// $this->db->where('product_id',$productid);
// $this->db->where('customer_id',$customerid);
// $res = $this->db->get('T_Prodcut_Specification_Master');
$sql = "Select * from T_Prodcut_Specification_Master where product_id = ? and customer_id = ?";
$res = $this->db->query($sql,array($productid,$customerid));
// print_r($this->db->last_query());
return $res->result();
//print_r($res->result());
}
function getEmplistforReport()
{
$this->db->select('T_Employee_Details.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.Departmentcode,T_DepartmentDetails.shortName,');
$this->db->from('T_Employee_Details');
$this->db->join('T_DepartmentDetails','T_Employee_Details.Departmentcode=T_DepartmentDetails.DEPCode');
//$this->db->join('ip_invoice_items','ip_invoices.invoice_number=ip_invoice_items.invoice_number');
//$this->db->join('ip_products','ip_invoice_items.item_product_id=ip_products.product_id');
//$this->db->join('ip_invoice_custom','ip_invoices.invoice_number=ip_invoice_custom.invoice_number and invoice_custom_fieldid=62');
$this->db->order_by('T_Employee_Details.EmpID');
$res = $this->db->get();
return $res->result();
}
function saveMasterTestData($masterreportdata)
{
$this->db->insert('T_Inprocess_Testreport_Master',$masterreportdata);
$id = $this->db->insert_id();
return $id;
}
function saveTestReportData($testreportdata)
{
foreach($testreportdata as $data)
{
$this->db->insert('T_Inprocess_Testreport',$data);
//$row = $this->db->affected_rows();
//return $row;
//print_r($data);
}
}
function saveTestReportAFSData($afstabledata)
{
$this->db->insert('T_Inprocess_AFSTestreport',$afstabledata);
$row = $this->db->affected_rows();
//return $row;
}
function saveTestReportLOIData($loitabledata)
{
$this->db->insert('T_Inprocess_LOITestreport',$loitabledata);
$row = $this->db->affected_rows();
//return $row;
}
function getIndividualInprocessReportData($reportid)
{
$this->db->select('T_Inprocess_Testreport_Master.*,ip_clients.client_name,ip_products.product_name,ip_products.product_description,T_Employee_Details.FirstName,T_Employee_Details.LastName');
$this->db->from('T_Inprocess_Testreport_Master');
$this->db->join('ip_clients','T_Inprocess_Testreport_Master.customerid=ip_clients.client_id');
$this->db->join('ip_products','T_Inprocess_Testreport_Master.productid=ip_products.product_id');
$this->db->join('tbl_users','T_Inprocess_Testreport_Master.createdby=tbl_users.userid');
$this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID');
$this->db->where('T_Inprocess_Testreport_Master.masterreport_id',$reportid);
$res = $this->db->get();
$reportdata['master'] = $res->result();
$this->db->select('T_Inprocess_Testreport.*,T_Prodcut_Specification_Master.testtype,T_Prodcut_Specification_Master.min,T_Prodcut_Specification_Master.max,T_Prodcut_Specification_Master.uom');
$this->db->from('T_Inprocess_Testreport');
$this->db->join('T_Prodcut_Specification_Master','T_Inprocess_Testreport.specid=T_Prodcut_Specification_Master.productspecmaster_id');
$this->db->where('masterreport_id',$reportid);
$res1 = $this->db->get();
$reportdata['masterreport'] = $res1->result();
$this->db->select('T_Inprocess_LOITestreport.*');
$this->db->from('T_Inprocess_LOITestreport');
$this->db->where('masterreport_id',$reportid);
$res1 = $this->db->get();
$reportdata['masterreportloi'] = $res1->result();
$this->db->select('T_Inprocess_AFSTestreport.*');
$this->db->from('T_Inprocess_AFSTestreport');
$this->db->where('masterreport_id',$reportid);
$res1 = $this->db->get();
$reportdata['masterreportafs'] = $res1->result();
$this->db->select('T_Company_Details.CompanyName,T_Company_Details.Address,T_Company_Details.ProfilePic');
$this->db->from('T_Company_Details');
//$this->db->where('testreport_id',$reportid);
$res1 = $this->db->get();
$reportdata['company'] = $res1->result();
return $reportdata;
}
function getTestMasterforList()
{
$this->db->select('T_Test_Report_Master.testreport_id,T_Test_Report_Master.invoiceid,T_Test_Report_Master.batchdate,T_Test_Report_Master.document,ip_clients.client_id,ip_clients.client_name,ip_products.product_id,ip_products.product_name,ip_products.product_description');
$this->db->from('T_Test_Report_Master');
$this->db->join('ip_invoices','T_Test_Report_Master.invoiceid=ip_invoices.invoice_number');
$this->db->join('ip_clients','ip_invoices.client_id=ip_clients.client_id');
$this->db->join('ip_invoice_items','ip_invoices.invoice_id=ip_invoice_items.invoice_id');
$this->db->join('ip_products','ip_products.product_id=ip_invoice_items.item_product_id');
//$this->db->where('T_Test_Report_Master.invoiceid','!=0');
$res = $this->db->get();
return $res->result();
}
function updateMasterTestData($masterreportdata,$masterid)
{
$this->db->where('masterreport_id',$masterid);
$this->db->update('T_Inprocess_Testreport_Master',$masterreportdata);
}
function updateTestReportData($testreportdata,$masterid,$specid)
{
foreach($testreportdata as $data)
{
$this->db->where('masterreport_id',$masterid);
$this->db->where('specid',$specid);
$this->db->where('iteration',$data['iteration']);
$this->db->where('subtype',$data['subtype']);
$this->db->update('T_Inprocess_Testreport',$data);
//echo $this->db->last_query();
}
}
function updateTestReportAFSData($afstabledata,$masterid,$ssize,$factor)
{
$this->db->where('masterreport_id',$masterid);
$this->db->where('sieve_size',$ssize);
$this->db->where('factor',$factor);
$this->db->update('T_Inprocess_AFSTestreport',$afstabledata);
// echo $this->db->last_query();
}
function updateTestReportLOIData($loitabledata,$masterid,$loidetails)
{
$this->db->where('masterreport_id',$masterid);
$this->db->where('loidetails',$loidetails);
$this->db->update('T_Inprocess_LOITestreport',$loitabledata);
//echo $this->db->last_query();
}
//FOR NISSAN INPROCESS
function updateNissanMasterTestData($masterreportdata,$masterid)
{
//echo "from model";
//print_r($masterreportdata);die();
$this->db->where('masterreport_id',$masterid);
$this->db->update('T_Inprocess_Testreport_Master',$masterreportdata);
}
function updateNissanTestReportData($testreportdata,$masterid,$specid)
{
foreach($testreportdata as $data)
{
$this->db->where('masterreport_id',$masterid);
$this->db->where('specid',$specid);
$this->db->where('iteration',$data['iteration']);
$this->db->where('subtype',$data['subtype']);
$this->db->update('T_Inprocess_Testreport',$data);
//echo $this->db->last_query();
}
}
function updateNissanTestReportAFSData($afstabledata,$masterid,$ssize,$factor)
{
$this->db->where('masterreport_id',$masterid);
$this->db->where('sieve_size',$ssize);
$this->db->where('factor',$factor);
$this->db->update('T_Inprocess_AFSTestreport',$afstabledata);
// echo $this->db->last_query();
}
function updateNissanTestReportLOIData($loitabledata,$masterid,$loidetails)
{
$this->db->where('masterreport_id',$masterid);
$this->db->where('loidetails',$loidetails);
$this->db->update('T_Inprocess_LOITestreport',$loitabledata);
//echo $this->db->last_query();
}
}
?>

View File

@ -44,13 +44,14 @@ class Quality_model extends CI_Model
return $result->result();
}
function checkExist($product,$customer,$name)
function checkExist($product,$customer,$name,$type)
{
$this->db->select('count(*) as count');
$this->db->from('T_Prodcut_Specification_Master');
$this->db->where('product_id',$product);
$this->db->where('customer_id',$customer);
$this->db->where('testtype',$name);
$this->db->where('type',$type);
$result = $this->db->get();
return $result->result();
}
@ -152,14 +153,25 @@ class Quality_model extends CI_Model
return $res->result();
}
function getSpecifications($productid,$customerid)
function getSpecifications($productid,$customerid,$ttype="")
{
//echo 'from model'.$productid.'-'.$customerid;
// $this->db->where('product_id',$productid);
// $this->db->where('customer_id',$customerid);
// $res = $this->db->get('T_Prodcut_Specification_Master');
$sql = "Select * from T_Prodcut_Specification_Master where product_id = ? and customer_id = ?";
$res = $this->db->query($sql,array($productid,$customerid));
$sql ='';
$res = "";
if(!empty($ttype))
{
$sql = "Select * from T_Prodcut_Specification_Master where product_id = ? and customer_id = ? and type = ?";
$res = $this->db->query($sql,array($productid,$customerid,$ttype));
}
else
{
$sql = "Select * from T_Prodcut_Specification_Master where product_id = ? and customer_id = ?";
$res = $this->db->query($sql,array($productid,$customerid));
}
// print_r($this->db->last_query());
return $res->result();
//print_r($res->result());

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -348,6 +348,92 @@ $(function() {
</li>
<?php }?>
<?php }?>
<!-- INPROCESS MODULE-->
<?php if($DEPCode != HR){?>
<?php if($DEPCode != SECURITY){?>
<li class="treeview">
<span id="menu" data-toggle="dropdown" ><i class="fa fa fa-first-order"></i> In Process Inspection<span class="caret"></span></span>
<ul class="dropdown-menu" role="menu" aria-labelledby="menu2">
<?php if(empty($DepAccesslist)){?>
<?php if($DEPCode == STORE || $DEPCode == FINANCE || $DEPCode == MANAGEMENT || $DEPCode == QUALITY || $DEPCode == PRODUCTION){?>
<li class="treeview">
<a href="<?php echo base_url(); ?>inprocess">
<i class="fa fa-server "></i>
<span>In Process Inspection Report List</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>normalinprocess">
<i class="fa fa-ticket"></i>
<span> New In Process Inspection</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>nissaninprocess">
<i class="fa fa-random"></i>
<span>New Nissan In Process Inspection</span>
</a>
</li>
<?php }?>
<?php }
else{ $check = 0;?>
<?php foreach($DepAccesslist as $dep){?>
<?php $assd=$dep->AssDep;
if($assd == STORE || $assd == QUALITY || $DEPCode == STORE || $DEPCode == QUALITY || $DEPCode == PRODUCTION || $assd == PRODUCTION){ $check =1;?>
<li class="treeview">
<a href="<?php echo base_url(); ?>inprocess">
<i class="fa fa-server "></i>
<span>In Process Inspection Report List</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>normalinprocess">
<i class="fa fa-ticket"></i>
<span>New In Process Inspection</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>nissaninprocess">
<i class="fa fa-random"></i>
<span>New Nissan In Process Inspection</span>
</a>
</li>
<?php } if($check == 1){break;} }?>
<?php }?>
</ul>
</li>
<?php }?>
<?php }?>
<!-- INPROCESS MODULE-->
<!-- <?php print_r($DepAccesslist)?> -->
<?php if(empty($DepAccesslist)){ ?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -66,18 +66,7 @@ foreach($customersinward as $customer)
<div class="row">
<div class="col-md-1">
<?php
// $data = array(
// 'name' => 'newsletter',
// 'id' => 'newsletter',
// 'value' => 'accept',
// 'checked' => TRUE,
// 'style' => 'margin:10px'
// );
// echo form_checkbox($data);
?>
<input type="radio" value="1" name="type" id="OutWard" onclick="changeType(this.value);"/>&nbsp;&nbsp;OutWard
</div>
@ -106,7 +95,18 @@ foreach($customersinward as $customer)
<div class="col-md-6">
<?php echo form_dropdown('name="customerinward"',$customersinward1,set_value('customerinward',$customersinward1[-1]),'id="customerinward"' ,'class="form-control select2');?>
</div>
</div>
<div class="col-md-2" id="inprocessarea">
<div class="col-md-1">
<?php
$data = array('id'=> 'inprocess','value' => 'accept','checked' => false);
echo form_checkbox($data);
?>
</div>
<div class="col-md-1">InProcess</div>
</div>
<div class="col-md-2">
<input type="button" id="addspec" class="btn btn-primary" value = "Add New Specification">
@ -123,6 +123,7 @@ foreach($customersinward as $customer)
<th>Min</th>
<th>Max</th>
<th>Temp</th>
<th>SubCatagory</th>
<!-- <th>Action</th> -->
@ -182,6 +183,11 @@ foreach($customersinward as $customer)
<tr>
<td style="text-align:center;padding:10px;;">Temp</td><td style="padding:10px;"><input type="text" name="temp" id="temp"/></td>
</tr>
<tr id="sub">
<td style="text-align:center;padding:10px;;">Sub Category</td><td style="padding:10px;"><input type="checkbox" name="subcata" id="subcata"/>&nbsp;&nbsp;&nbsp; Raw Sand Test</td>
</tr>
</table>
</center>
</form>
@ -225,6 +231,7 @@ foreach($customersinward as $customer)
<td align="right" contenteditable="true"><%=Min%></td>
<td align="right" contenteditable="true"><%=Max%></td>
<td align="right" contenteditable="true"><%=Temp%></td>
<td align="center" contenteditable="true"><%=SubCatagory%></td>
<!-- <td align="center" contenteditable="false"><a data-target='#specmodel' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#specmodel">&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick = "DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a></td> -->
</tr> <!-- <i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit <%=index%> "></i> -->
</script>
@ -247,12 +254,15 @@ $('#OutWard').attr('checked','true');
//alert('InWard');
$('#inwardarea').show();
$('#outwardarea').hide();
$('#inprocessarea').hide();
}
else if(val == 1)
{
//alert('OutWard');
$('#inwardarea').hide();
$('#outwardarea').show();
$('#inprocessarea').show();
}
}
$('#product').select2();
@ -305,6 +315,8 @@ function addNewRow()
var min = $('#min').val();
var max = $('#max').val();
var temp = $('#temp').val();
var sub = 0;
if($('#subcata').is(':checked')){ sub = 1;}
if(sname == '' || uom =='' || min == '' || max == '' || temp == '')
{
@ -316,19 +328,26 @@ function addNewRow()
var rows = document.getElementById('testspecifications').rows.length;
//rows = rows-1;
var template = jQuery("#addList").html();
$('#specAppend').append(_.template(template,{index:rows,Name:sname,UOM:uom,Min:min,Max:max,Temp:temp}));
$('#specAppend').append(_.template(template,{index:rows,Name:sname,UOM:uom,Min:min,Max:max,Temp:temp,SubCatagory:sub}));
$('#spname').val('');
$('#uom').val('');
$('#min').val('');
$('#max').val('');
$('#temp').val('');
$('#subcata').attr('checked',false);
document.getElementById('spname').focus();
}
}
$("#specmodel").on("shown.bs.modal", function(e) {
$('#sub').hide();
if($('#OutWard').is(':checked') && $('#inprocess').is(':checked'))
{
$('#sub').show();
}
else{ $('#sub').hide(); }
document.getElementById('spname').focus();
});
@ -339,9 +358,18 @@ $("#specmodel").on("shown.bs.modal", function(e) {
var type = '';
var product = '';
var customer = '';
// var subtype = '';
if($('#OutWard').is(':checked'))
{
type = 'OUTWARD';
if($('#inprocess').is(':checked'))
{
type = 'INPROCESS';
// if($('#subcata').is(':checked'))
// {
// subtype = 1;
// }
}
product = $('#product').val();
customer = $('#customer').val();
}
@ -351,6 +379,9 @@ $("#specmodel").on("shown.bs.modal", function(e) {
product = $('#productinward').val();
customer = $('#customerinward').val();
}
var alldata = $("#testspecifications").tableToJSON();
//alert(JSON.stringify(alldata));
alldata=JSON.stringify(alldata)

View File

@ -0,0 +1,164 @@
<style>
#typechosemodal {
margin-top:200px;
z-index: 1080 !important;
}
</style>
<?php
//print_r($reportlist);
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Inprocess Test Reports List</center>
</h1>
</section>
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<!--<center><h3 class="box-title">-->
<div class="box-tools">
<!-- <form action="<?php echo base_url() ?>assetListing" method="POST" id="searchList">-->
<div class="col-md-3">
<!-- <a href=" <?php echo base_url().'inprocess/addNewInprocessInspection';?> " type="button" class="btn btn-primary">Add New</a> -->
<input type="button" target="_blank" value = "Add New" class="btn btn-primary" onclick="newFunction();">
</div>
</form>
</div><!--</h3></center>-->
</div><!-- /.box-header -->
<div class="box-body">
<br/>
<table id="testspecifications" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>Test Report ID</th>
<th>Batch No</th>
<th>Batch Date</th>
<th>Product Name</th>
<th>Customer Name</th>
</tr>
</thead>
<tbody id="specAppend">
<?php
if(!empty($reportlist))
{
foreach($reportlist as $data)
{
//print_r($data);echo "</br></br>";
?>
<tr> <td><a href="<?php echo base_url()?>inprocess/editIndInprocessReport/<?php echo $data->masterreport_id ?>"><?php echo $data->masterreport_id?></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<?php if(!empty($data->document)){?>
<a target="_blank" href="<?php echo base_url()?>uploads/INPROCESS/<?php echo $data->document ?>"><span class="fa fa-file-o"></span></a>
<?php }?>
</td> <td><a href="<?php echo base_url()?>inprocess/editIndInprocessReport/<?php echo $data->masterreport_id ?>"> <?php echo $data->batchno?></a></td> <td style="text-align:right;"><?php echo date_format(date_create($data->batchdate),'d-m-Y');?></td><td><?php echo $data->product_name;?></td><td><?php echo $data->client_name;?></td></tr>
<?php
}
}
?>
</tbody>
</table>
<p>&nbsp;</p>
<div class="row">
</div>
</div><!-- /.box-body -->
<!-- <div class="box-footer clearfix">
</div> -->
</div><!-- /.box -->
</div>
</div>
</section>
</div>
<div id="typechosemodal" class="modal fade" data-backdrop-limit="1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Choose Inprocess Type</h4>
</div>
<div class="modal-body">
<form>
<div class="radio">
<label><input type="radio" id="normal"> Normal Inprocess Report</label>
<br>
<label><input type="radio" id="nissan" >Nissan Inprocess Report </label>
</div>
</form>
</div>
<div class="modal-footer">
<a class="btn btn-primary" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">Cancel</a>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
<script type="text/javascript">
$(function () {
$('#testspecifications').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"aaSorting": [[ 0, "asc" ]],
"info": true,
"autoWidth": true,
});
});
function newFunction()
{
$('#typechosemodal').modal('show');
}
$('#normal').click(function(){
window.location = "<?php echo base_url().'inprocess/addNewInprocessInspection';?>";
});
$('#nissan').click(function(){
window.location = "<?php echo base_url().'inprocess/addNewNissanInprocessInspection';?>";
});
</script>

View File

@ -82,6 +82,7 @@ foreach($specifications as $s)
<th>Min</th>
<th>Max</th>
<th>Temp</th>
<th style="width:100px;">SubCatagory</th>
<th>Action</th>
@ -96,7 +97,8 @@ foreach($specifications as $s)
{
$index++;
?>
<tr id="<?php echo $index;?>"> <td><?php echo $data->testtype?></td> <td contenteditable="true"><?php echo $data->uom?></td> <td contenteditable="true" style="text-align:right;"><?php echo $data->min?></td> <td contenteditable="true" style="text-align:right;"><?php echo $data->max?></td> <td contenteditable="true" style="text-align:right;"><?php if(!empty($data->temp)){ echo $data->temp; } else { echo "-"; }?></td> <td style="text-align:center;"><a href='#' onclick = "DeleteRow(this.parentNode.parentNode.id);"> <span class="glyphicon glyphicon-trash"></span></td> </tr>
<tr id="<?php echo $index;?>"> <td><?php echo $data->testtype?></td> <td contenteditable="true"><?php echo $data->uom?></td> <td contenteditable="true" style="text-align:right;"><?php echo $data->min?></td> <td contenteditable="true" style="text-align:right;"><?php echo $data->max?></td> <td contenteditable="true" style="text-align:right;"><?php if(!empty($data->temp)){ echo $data->temp; } else { echo "-"; }?></td>
<td <?php if($type == 'INPROCESS'){ echo "contenteditable='true'";}else {echo "contenteditable='false'";}?> style="text-align:center;"><?php echo $data->subtype;?> <td style="text-align:center;"><a href='#' onclick = "DeleteRow(this.parentNode.parentNode.id);"> <span class="glyphicon glyphicon-trash"></span></td> </tr>
<?php
}
}
@ -143,6 +145,9 @@ foreach($specifications as $s)
<tr>
<td style="text-align:center;padding:10px;;">Temp</td><td style="padding:10px;"><input type="text" name="temp" id="temp"/></td>
</tr>
<tr id="sub">
<td style="text-align:center;padding:10px;;">Sub Category</td><td style="padding:10px;"><input type="checkbox" name="subcata" id="subcata"/>&nbsp;&nbsp;&nbsp; Raw Sand Test</td>
</tr>
</table>
</center>
</form>
@ -175,17 +180,21 @@ foreach($specifications as $s)
"autoWidth": true
});
});
</script>
<script type="text/html" id="addList">
<tr id=<%=index%>>
<td align="left" contenteditable="false"><%=Name%></td>
<td align="left"contenteditable="true"><%=UOM%></td>
<td align="right" contenteditable="true"><%=Min%></td>
<td align="right" contenteditable="true"><%=Max%></td>
<td align="right" contenteditable="true"><%=Temp%></td>
<td align="center" contenteditable="true"><%=SubCatagory%></td>
<td align="center" contenteditable="false"> <a href='#' onclick = "DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a></td>
</tr> <!-- <i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit <%=index%> "></i> -->
</script>
@ -215,6 +224,8 @@ function addNewRow()
var min = $('#min').val();
var max = $('#max').val();
var temp = $('#temp').val();
var sub = 0;
if($('#subcata').is(':checked')){sub = 1;}
if(sname == '' || uom =='' || min == '' || max == '' || temp == '')
{
alert('Please Enter all specification');
@ -226,7 +237,7 @@ function addNewRow()
//rows = rows-1;
//alert(rows);
var template = jQuery("#addList").html();
$('#specAppend').append(_.template(template,{index:rows,Name:sname,UOM:uom,Min:min,Max:max,Temp:temp}));
$('#specAppend').append(_.template(template,{index:rows,Name:sname,UOM:uom,Min:min,Max:max,Temp:temp,SubCatagory:sub}));
$('#spname').val('');
$('#uom').val('');
@ -239,7 +250,14 @@ function addNewRow()
$("#specmodel").on("shown.bs.modal", function(e) {
document.getElementById('spname').focus();
var type = $('#ttype').val();
//alert(type);
if(type == 'INPROCESS')
{
$('#sub').show();
}
else {$('#sub').hide();}
document.getElementById('spname').focus();
});

View File

@ -0,0 +1,271 @@
<?php
$cname = '';
$caddress = '';
$pic = '';
if(!empty($reportdata['company'])){
foreach($reportdata['company'] as $c)
{
$cname = $c->CompanyName;
$caddress = $c->Address;
$pic = $c->ProfilePic;
}
}
?>
<style>
td{
text-align:center;
height:17px;
}
table{
font-size:10px;
}
</style>
<html>
<body>
<table style="border-collapse:collapse;border-left-style:hidden;width:100%;font-size:9px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="4"><h2>IN PROCESS TEST REPORT</h2></td>
</tr>
<tr >
<!-- <td rowspan="5" ><img src="<?php echo base_url().'uploads/images/'.$pic;?>" alt="no image"/></td> -->
<!-- <td rowspan="5" width="38%"><b><?php echo $cname;?></b><br><?php echo $caddress;?></td> -->
<td width="8%" >REPORT FOR</td>
<td colspan="3"><b><?php echo $reportdata['master'][0]->client_name.'-'.$reportdata['master'][0]->product_name .'-'.$reportdata['master'][0]->product_description;?></b></td>
</tr>
<tr>
<td rowspan="2" width="8%">PLANT NAME</td>
<td rowspan="2" ><b><?php echo $reportdata['master'][0]->plantname;?></td>
<td >BATCH NO</td>
<td ><b><?php echo $reportdata['master'][0]->batchno;?></b></td>
</tr>
<tr>
<td >BATCH DATE</td>
<td ><b><?php echo date_format(date_create($reportdata['master'][0]->batchdate),'d-m-Y');?></b></td>
</tr>
<tr >
<td rowspan="2" width="8%">QTY</td>
<td rowspan="2" ><b><?php echo $reportdata['master'][0]->qty;?>Kgs</b></td>
<td >SAND DESCRIPTION</td>
<td ><b><?php echo $reportdata['master'][0]->sand_description;?></b></td>
</tr>
<tr>
<td >RESIN DESCRIPTION</td>
<td><b><?php echo $reportdata['master'][0]->resin_description;?></b></td>
</tr>
</tbody>
</table>
<br>
<table style="border-collapse: collapse;border-left-style:hidden;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr><th rowspan="2">SNO</th><th rowspan="2" width="200px;">DESCRIPTION</th><th colspan="3" width="190px";>SPECIFICATION</th> <th colspan="1" width="40px;">1</th> <th colspan="1" width="40px;">2</th> <th colspan="1" width="40px;">3</th> <th colspan="1" width="40px;">4</th> <th colspan="1" width="40px;">5</th> <th colspan="1" width="40px;">6</th> <th colspan="1" width="40px;">7</th> <th colspan="1" width="40px;">8</th></tr> <tr><th>Min</th><th>Max</th><th>UOM</th><th><?php echo $timearray[0];?></th><th><?php echo $timearray[1];?></th><th><?php echo $timearray[2];?></th><th><?php echo $timearray[3];?></th><th><?php echo $timearray[4];?></th><th><?php echo $timearray[5];?></th><th><?php echo $timearray[6];?></th><th><?php echo $timearray[7];?></th></tr>
<tbody>
<?php
foreach($reportdata['masterreport'] as $key => $mas)
{
if($mas['stype'] == 0 )
{
?>
<tr id="<?php echo ($key);?>"> <td><?php echo($key); ?></td> <td><?php echo $mas['specname'];?></td> <td><?php echo $mas['smin'];?></td> <td><?php echo $mas['smax'];?></td> <td><?php echo $mas['suom'];?></td>
<td> <?php echo $mas['0']?> </td>
<td><?php echo $mas['1']?> </td>
<td><?php echo $mas['2']?> </td>
<td><?php echo $mas['3']?> </td>
<td><?php echo $mas['4']?> </td>
<td><?php echo $mas['5']?> </td>
<td><?php echo $mas['6']?> </td>
<td><?php echo $mas['7']?> </td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<br>
<table style="border-collapse: collapse;border-left-style:hidden;" border="1" cellspacing="0" cellpadding="0">
<tr><th >SNO</th><th width="120px;">DESCRIPTION</th><th width="80px"; >SPEC</th> <th colspan="3" width="190px;" >Raw Sand Tests</th><th colspan="8" width="320px;" colspan="8">Coated Sand Tests</th>
<tbody>
<?php
$index = 0;
foreach($reportdata['masterreport'] as $key => $mas)
{
if($mas['stype'] == 1)
{
if($mas['stype'] == 1){
$index++;
?>
<tr> <td><?php echo($index); ?></td> <td><?php echo $mas['specname'];?></td> <td><?php if($mas['smin'] != '-'){echo $mas['smin'].'-';}if($mas['smax'] != '-'){echo $mas['smax'];}?></td>
<td><?php echo $mas['0']?> </td>
<td><?php echo $mas['1']?> </td>
<td><?php echo $mas['2']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['3']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['4']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['5']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['6']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['7']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['8']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['9']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['10']?> </td>
</tr>
<?php
}
else
{
$index++;
?>
<tr> <td><?php echo($index); ?></td> <td><?php echo $mas['specname'];?></td> <td><?php if($mas['smin'] != '-'){echo $mas['smin'].'-';}if($mas['smax'] != '-'){echo $mas['smax'];}?></td>
<td style="background-color:#b8b894">NA</td><td style="background-color:#b8b894">NA</td><td style="background-color:#b8b894">NA</td><td><?php echo $mas['0']?> </td><td><?php echo $mas['1']?> </td><td><?php echo $mas['2']?> </td><td><?php echo $mas['3']?> </td><td><?php echo $mas['4']?> </td><td><?php echo $mas['5']?> </td><td><?php echo $mas['6']?> </td><td><?php echo $mas['7']?> </td></tr>
<?php
}
}
}
?>
</tbody>
</table>
<!-- <h4>AFS DETAILS</h4> -->
<br>
<table style="border-collapse: collapse;border-left-style:hidden;" border="1" cellspacing="0" cellpadding="0">
<tr><th>SNO</th><th width="60px;">Factor</th><th width="60px;">Mesh</th><th width="80px;">Spec</th><th colspan="3" width="190px;">Raw Sand Tests</th><th colspan="8" width="320px;">Coated Sand Tests</th></tr>
<tbody>
<?php
$rst1total = 0;$rst2total = 0;$rst3total = 0;$cst1total = 0;$cst2total = 0;$cst3total = 0;$cst4total = 0;$cst5total = 0;$cst6total = 0;$cst7total = 0;$cst8total = 0;
foreach($reportdata['masterreportafs'] as $key => $afs)
{
$rst1total += $afs->rst1;$rst2total += $afs->rst2;$rst3total += $afs->rst3;
$cst1total += $afs->cst1;$cst2total += $afs->cst2;$cst3total += $afs->cst3;$cst4total += $afs->cst4;$cst5total += $afs->cst5;$cst6total += $afs->cst6;$cst7total += $afs->cst7;$cst8total += $afs->cst8;
?>
<tr> <td><?php echo ($key+1);?></td> <td> <?php echo $afs->factor; ?></td> <td><?php echo $afs->sieve_size;?></td> <td><?php echo $afs->spec; ?></td>
<!-- raw test sand -->
<td><?php echo $afs->rst1;?></td>
<td><?php echo $afs->rst2;?></td>
<td><?php echo $afs->rst3;?></td>
<!-- coated test sand "-->
<td><?php echo $afs->cst1;?></td>
<td><?php echo $afs->cst2;?></td>
<td><?php echo $afs->cst3;?></td>
<td><?php echo $afs->cst4;?></td>
<td><?php echo $afs->cst5;?></td>
<td><?php echo $afs->cst6;?></td>
<td><?php echo $afs->cst7;?></td>
<td><?php echo $afs->cst8;?></td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr> <td colspan="4">Total</td><td ><?php echo $rst1total;?></td><td ><?php echo $rst2total;?></td><td ><?php echo $rst3total;?></td><td ><?php echo $cst1total;?></td><td ><?php echo $cst2total;?></td><td ><?php echo $cst3total;?></td><td ><?php echo $cst4total;?></td><td ><?php echo $cst5total;?></td><td ><?php echo $cst6total;?></td><td ><?php echo $cst7total;?></td><td ><?php echo $cst8total;?></td> </tr>
</tfoot>
</table>
<!-- h3>MASTER2 DETAILS</h3> -->
<!-- <h3>LOI DETAILS</h3> -->
<br>
<table style="border-collapse: collapse;border-left-style:hidden;" border="1" cellspacing="0" cellpadding="0">
<tr><th>SNO</th><th width="120px;">Description</th><th width="75px;">Spec</th><th colspan="3" width="186px;">Raw Sand Tests</th><th colspan="8" width="320px;">Coated Sand Tests</th></tr>
<tbody>
<?php
$loitableids = array('fit','fot','ct','w1','w2','w3');
//echo $loitableids[0];
foreach($reportdata['masterreportloi'] as $key => $loi)
{
?>
<tr>
<td><?php echo ($key+1)?></td> <td><?php echo $loi->loidetails?></td>
<td class="edit" id="<?php echo $loitableids[$key].'spec';?>" contenteditable="true"><?php echo $loi->spec;?></td>
<td id="<?php echo $loitableids[$key].'rst1'?>" class="editrst" contenteditable="true" onkeypress="return keyValidate(event)" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->rst1;?></td>
<td id="<?php echo $loitableids[$key].'rst2'?>" class="editrst" contenteditable="true" onkeypress="return keyValidate(event)" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->rst2;?></td>
<td id="<?php echo $loitableids[$key].'rst3'?>" class="editrst" contenteditable="true" onkeypress="return keyValidate(event)" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->rst3;?></td>
<td id="<?php echo $loitableids[$key].'cst1'?>" class="editcst" contenteditable="true" onkeypress="return keyValidate(event)" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst1;?></td>
<td id="<?php echo $loitableids[$key].'cst2'?>" class="editcst" contenteditable="true" onkeypress="return keyValidate(event)" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst2;?></td>
<td id="<?php echo $loitableids[$key].'cst3'?>" class="editcst" contenteditable="true" onkeypress="return keyValidate(event)" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst3;?></td>
<td id="<?php echo $loitableids[$key].'cst4'?>" class="editcst" contenteditable="true" onkeypress="return keyValidate(event)" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst4;?></td>
<td id="<?php echo $loitableids[$key].'cst5'?>" class="editcst" contenteditable="true" onkeypress="return keyValidate(event)" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst5;?></td>
<td id="<?php echo $loitableids[$key].'cst6'?>" class="editcst" contenteditable="true" onkeypress="return keyValidate(event)" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst6;?></td>
<td id="<?php echo $loitableids[$key].'cst7'?>" class="editcst" contenteditable="true" onkeypress="return keyValidate(event)" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst7;?></td>
<td id="<?php echo $loitableids[$key].'cst8'?>" class="editcst" contenteditable="true" onkeypress="return keyValidate(event)" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst8;?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<h4>Remarks:</h4> <p><?php echo $reportdata['master'][0]->remarks; ?></p>
<hr>
<br>
<table >
<tr><td>INSPECTOR NAME :<?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 $reportdata['master'][0]->approvedby; ?></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<!-- <tr><td>Signature</td><td>&nbsp;</td></tr>-->
</table>
</body>
</html>

View File

@ -0,0 +1,431 @@
<?php
$cname = '';
$caddress = '';
$pic = '';
if(!empty($reportdata['company'])){
foreach($reportdata['company'] as $c)
{
$cname = $c->CompanyName;
$caddress = $c->Address;
$pic = $c->ProfilePic;
}
}
$type = '-';
if($reportdata['master'][0]->subtype == 0)
{
$type = 'Type 5';
}
else { $type = 'Type 7'; }
?>
<style>
td{
text-align:center;
height:17px;
}
table{
font-size:10px;
}
</style>
<html>
<body>
<table style="border-collapse:collapse;border-left-style:hidden;width:100%;font-size:9px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="4"><h2>IN PROCESS TEST REPORT</h2></td>
</tr>
<tr >
<!-- <td rowspan="5" ><img src="<?php echo base_url().'uploads/images/'.$pic;?>" alt="no image"/></td> -->
<!-- <td rowspan="5" width="38%"><b><?php echo $cname;?></b><br><?php echo $caddress;?></td> -->
<td width="8%" >REPORT FOR <?php echo $reportdata['master'][0]->subtype?></td>
<td colspan="3"><b><?php echo $reportdata['master'][0]->client_name.'-'.$reportdata['master'][0]->product_name .'-'.$reportdata['master'][0]->product_description.'-'.$type;?></b></td>
</tr>
<tr>
<td rowspan="2" width="8%">PLANT NAME</td>
<td rowspan="2" ><b><?php echo $reportdata['master'][0]->plantname;?></td>
<td >BATCH NO</td>
<td ><b><?php echo $reportdata['master'][0]->batchno;?></b></td>
</tr>
<tr>
<td >BATCH DATE</td>
<td ><b><?php echo date_format(date_create($reportdata['master'][0]->batchdate),'d-m-Y');?></b></td>
</tr>
<tr >
<td rowspan="2" width="8%">QTY</td>
<td rowspan="2" ><b><?php echo $reportdata['master'][0]->qty;?>Kgs</b></td>
<td >SAND DESCRIPTION</td>
<td ><b><?php echo $reportdata['master'][0]->sand_description;?></b></td>
</tr>
<tr>
<td >RESIN DESCRIPTION</td>
<td><b><?php echo $reportdata['master'][0]->resin_description;?></b></td>
</tr>
</tbody>
</table>
<br>
<table style="border-collapse: collapse;border-left-style:hidden;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr><th rowspan="2">SNO</th><th rowspan="2" width="200px;">DESCRIPTION</th><th colspan="3" width="190px";>SPECIFICATION</th> <th colspan="1" width="40px;">1</th> <th colspan="1" width="40px;">2</th> <th colspan="1" width="40px;">3</th> <th colspan="1" width="40px;">4</th> <th colspan="1" width="40px;">5</th> <th colspan="1" width="40px;">6</th> <th colspan="1" width="40px;">7</th> <th colspan="1" width="40px;">8</th></tr> <tr><th>Min</th><th>Max</th><th>UOM</th><th><?php echo $timearray[0];?></th><th><?php echo $timearray[1];?></th><th><?php echo $timearray[2];?></th><th><?php echo $timearray[3];?></th><th><?php echo $timearray[4];?></th><th><?php echo $timearray[5];?></th><th><?php echo $timearray[6];?></th><th><?php echo $timearray[7];?></th></tr>
<tbody>
<?php
foreach($reportdata['masterreport'] as $key => $mas)
{
if($mas['stype'] == 0 )
{
?>
<tr id="<?php echo ($key);?>"> <td><?php echo($key); ?></td> <td><?php echo $mas['specname'];?></td> <td><?php echo $mas['smin'];?></td> <td><?php echo $mas['smax'];?></td> <td><?php echo $mas['suom'];?></td>
<td> <?php echo $mas['0']?> </td>
<td><?php echo $mas['1']?> </td>
<td><?php echo $mas['2']?> </td>
<td><?php echo $mas['3']?> </td>
<td><?php echo $mas['4']?> </td>
<td><?php echo $mas['5']?> </td>
<td><?php echo $mas['6']?> </td>
<td><?php echo $mas['7']?> </td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<br>
<table style="border-collapse: collapse;border-left-style:hidden;" border="1" cellspacing="0" cellpadding="0">
<tr><th >SNO</th><th width="120px;">DESCRIPTION</th><th width="80px"; >SPEC</th> <th colspan="3" width="190px;" >Raw Sand Tests</th><th colspan="8" width="320px;" colspan="8">Coated Sand Tests</th>
<tbody>
<?php
$index = 0;
foreach($reportdata['masterreport'] as $key => $mas)
{
if($mas['stype'] == 1)
{
if($mas['stype'] == 1){
$index++;
?>
<tr> <td><?php echo($index); ?></td> <td><?php echo $mas['specname'];?></td> <td><?php if($mas['smin'] != '-'){echo $mas['smin'].'-';}if($mas['smax'] != '-'){echo $mas['smax'];}?></td>
<td><?php echo $mas['0']?> </td>
<td><?php echo $mas['1']?> </td>
<td><?php echo $mas['2']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['3']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['4']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['5']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['6']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['7']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['8']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['9']?> </td>
<td <?php if(strtolower($mas['specname']) == 'loi raw sand'){ echo 'style="background-color:#b8b894"';}?>><?php echo $mas['10']?> </td>
</tr>
<?php
}
else
{
$index++;
?>
<tr> <td><?php echo($index); ?></td> <td><?php echo $mas['specname'];?></td> <td><?php if($mas['smin'] != '-'){echo $mas['smin'].'-';}if($mas['smax'] != '-'){echo $mas['smax'];}?></td>
<td style="background-color:#b8b894">NA</td><td style="background-color:#b8b894">NA</td><td style="background-color:#b8b894">NA</td><td><?php echo $mas['0']?> </td><td><?php echo $mas['1']?> </td><td><?php echo $mas['2']?> </td><td><?php echo $mas['3']?> </td><td><?php echo $mas['4']?> </td><td><?php echo $mas['5']?> </td><td><?php echo $mas['6']?> </td><td><?php echo $mas['7']?> </td></tr>
<?php
}
}
}
?>
</tbody>
</table>
<!-- <h4>AFS DETAILS</h4> -->
<br>
<table style="border-collapse: collapse;border-left-style:hidden;" border="1" cellspacing="0" cellpadding="0">
<tr><th>SNO</th><th width="60px;">Factor</th><th width="60px;">Mesh</th><th width="80px;">Spec</th><th colspan="3" width="190px;">Raw Sand Tests</th><th colspan="8" width="320px;">Coated Sand Tests</th></tr>
<tbody>
<?php if($reportdata['master'][0]->subtype == 0){
$rst51total1 = 0;$rst52total1 = 0;$rst53total1 = 0;$cst51total1 = 0;$cst52total1 = 0;$cst53total1 = 0;$cst54total1 = 0;$cst55total1 = 0;$cst56total1 = 0;$cst57total1 = 0;$cst58total1 = 0;
$rst51total2 = 0;$rst52total2 = 0;$rst53total2 = 0;$cst51total2 = 0;$cst52total2 = 0;$cst53total2 = 0;$cst54total2 = 0;$cst55total2 = 0;$cst56total2 = 0;$cst57total2 = 0;$cst58total2 = 0;
$rst51total3 = 0;$rst52total3 = 0;$rst53total3 = 0;$cst51total3 = 0;$cst52total3 = 0;$cst53total3 = 0;$cst54total3 = 0;$cst55total3 = 0;$cst56total3 = 0;$cst57total3 = 0;$cst58total3 = 0;
$rst51total = 0;$rst52total = 0;$rst53total = 0;$cst51total = 0;$cst52total = 0;$cst53total = 0;$cst54total = 0;$cst55total = 0;$cst56total = 0;$cst57total = 0;$cst58total = 0;
foreach($reportdata['masterreportafs'] as $key => $afs)
{
if($key == 10){
$rst51total += $afs->rst1;$rst52total += $afs->rst2;$rst53total += $afs->rst3;
$cst51total += $afs->cst1;$cst52total += $afs->cst2;$cst53total += $afs->cst3;$cst54total += $afs->cst4;$cst55total += $afs->cst5;$cst56total += $afs->cst6;$cst57total += $afs->cst7;$cst58total += $afs->cst8;
}
if($key == 9 || $key == 8)
{
$rst51total3 += $afs->rst1;$rst52total3 += $afs->rst2;$rst53total3 += $afs->rst3;
$cst51total3 += $afs->cst1;$cst52total3 += $afs->cst2;$cst53total3 += $afs->cst3;$cst54total3 += $afs->cst4;$cst55total3 += $afs->cst5;$cst56total3 += $afs->cst6;$cst57total3 += $afs->cst7;$cst58total3 += $afs->cst8;
}
if($key >= 3 && $key <= 7)
{
$rst51total2 += $afs->rst1;$rst52total2 += $afs->rst2;$rst53total2 += $afs->rst3;
$cst51total2 += $afs->cst1;$cst52total2 += $afs->cst2;$cst53total2 += $afs->cst3;$cst54total2 += $afs->cst4;$cst55total2 += $afs->cst5;$cst56total2 += $afs->cst6;$cst57total2 += $afs->cst7;$cst58total2 += $afs->cst8;
}
if($key >= 0 && $key <= 2)
{
$rst51total1 += $afs->rst1;$rst52total1 += $afs->rst2;$rst53total1 += $afs->rst3;
$cst51total1 += $afs->cst1;$cst52total1 += $afs->cst2;$cst53total1 += $afs->cst3;$cst54total1 += $afs->cst4;$cst55total1 += $afs->cst5;$cst56total1 += $afs->cst6;$cst57total1 += $afs->cst7;$cst58total1 += $afs->cst8;
}
?>
<tr> <td><?php echo ($key+1);?></td> <td > <?php echo $afs->factor; ?></td> <td><?php echo $afs->sieve_size;?></td>
<?php if($key == 0){?>
<td rowspan="3" class="edit" ><?php echo $afs->spec; ?></td>
<?php }?>
<?php if($key == 3){?>
<td rowspan="5" class="edit" ><?php echo $afs->spec; ?></td>
<?php }?>
<?php if($key == 8){?>
<td rowspan="2" class="edit" ><?php echo $afs->spec; ?></td>
<?php }?>
<?php if($key == 10){?>
<td rowspan="1" class="edit" ><?php echo $afs->spec; ?></td>
<?php }?>
<!-- raw test sand -->
<td class="editrst" ><?php echo $afs->rst1;?></td>
<td class="editrst" ><?php echo $afs->rst2;?></td>
<td class="editrst" ><?php echo $afs->rst3;?></td>
<!-- coated test sand calculateAFS(this.parentNode.id,this.textContent,this.id);"-->
<td class="editcst" ><?php echo $afs->cst1;?></td>
<td class="editcst" ><?php echo $afs->cst2;?></td>
<td class="editcst" ><?php echo $afs->cst3;?></td>
<td class="editcst" ><?php echo $afs->cst4;?></td>
<td class="editcst" ><?php echo $afs->cst5;?></td>
<td class="editcst" ><?php echo $afs->cst6;?></td>
<td class="editcst" ><?php echo $afs->cst7;?></td>
<td class="editcst" ><?php echo $afs->cst8;?></td>
<?php if($key == 2){?>
<tr><td colspan="4" style="background-color:#f5e0a5">Total</td> <td style="background-color:#f5e0a5" ><?php echo $rst51total1;?></td><td style="background-color:#f5e0a5" ><?php echo $rst52total1;?></td><td style="background-color:#f5e0a5"><?php echo $rst53total1;?></td><td style="background-color:#f5e0a5" ><?php echo $cst51total1;?></td><td style="background-color:#f5e0a5" ><?php echo $cst52total1;?></td><td style="background-color:#f5e0a5" ><?php echo $cst53total1;?></td><td style="background-color:#f5e0a5"><?php echo $cst54total1;?></td><td style="background-color:#f5e0a5"><?php echo $cst55total1;?></td><td style="background-color:#f5e0a5"><?php echo $cst57total1;?></td><td style="background-color:#f5e0a5"><?php echo $cst57total1;?></td><td style="background-color:#f5e0a5"><?php echo $cst58total1;?></td></tr>
<?php }?>
<?php if($key == 7){?>
<tr><td colspan="4" style="background-color:#f5e0a5">Total</td> <td style="background-color:#f5e0a5" ><?php echo $rst51total2;?></td><td style="background-color:#f5e0a5" ><?php echo $rst52total2;?></td><td style="background-color:#f5e0a5" ><?php echo $rst53total2;?></td><td style="background-color:#f5e0a5"><?php echo $cst51total2;?></td><td style="background-color:#f5e0a5" ><?php echo $cst52total2;?></td><td style="background-color:#f5e0a5"><?php echo $cst53total2;?></td><td style="background-color:#f5e0a5"><?php echo $cst54total2;?></td><td style="background-color:#f5e0a5"><?php echo $cst55total2;?></td><td style="background-color:#f5e0a5"><?php echo $cst56total2;?></td><td style="background-color:#f5e0a5"><?php echo $cst57total2;?></td><td style="background-color:#f5e0a5"><?php echo $cst58total2;?></td></tr>
<?php }?>
</tr>
<?php if($key == 9){?>
<tr><td colspan="4" style="background-color:#f5e0a5">Total</td> <td style="background-color:#f5e0a5"><?php echo $rst51total3;?></td><td style="background-color:#f5e0a5"><?php echo $rst52total3;?></td><td style="background-color:#f5e0a5"><?php echo $rst53total3;?></td><td style="background-color:#f5e0a5"><?php echo $cst51total3;?></td><td style="background-color:#f5e0a5"><?php echo $cst52total3;?></td><td style="background-color:#f5e0a5"><?php echo $cst53total3;?></td><td style="background-color:#f5e0a5"><?php echo $cst54total3;?></td><td style="background-color:#f5e0a5"><?php echo $cst55total3;?></td><td style="background-color:#f5e0a5"><?php echo $cst56total3;?></td><td style="background-color:#f5e0a5" ><?php echo $cst57total3;?></td><td style="background-color:#f5e0a5"><?php echo $cst58total3;?></td></tr>
<?php }?>
<?php if($key == 10){?>
<tr><td colspan="4" style="background-color:#f5e0a5">Total</td> <td style="background-color:#f5e0a5"><?php echo $rst51total;?></td><td style="background-color:#f5e0a5"><?php echo $rst52total;?></td><td style="background-color:#f5e0a5"><?php echo $rst53total;?></td><td style="background-color:#f5e0a5"><?php echo $cst51total;?></td><td style="background-color:#f5e0a5"><?php echo $cst52total;?></td><td style="background-color:#f5e0a5"><?php echo $cst54total;?></td><td style="background-color:#f5e0a5"><?php echo $cst54total;?></td><td style="background-color:#f5e0a5"><?php echo $cst55total;?></td><td style="background-color:#f5e0a5"><?php echo $cst56total;?></td><td style="background-color:#f5e0a5"><?php echo $cst57total;?></td><td style="background-color:#f5e0a5"><?php echo $cst58total;?></td></tr>
<?php }?>
</tr>
<?php
}
}
else
{
$rst1total1 = 0;$rst2total1 = 0;$rst3total1 = 0;$cst1total1 = 0;$cst2total1 = 0;$cst3total1 = 0;$cst4total1 = 0;$cst5total1 = 0;$cst6total1 = 0;$cst7total1 = 0;$cst8total1 = 0;
$rst1total2 = 0;$rst2total2 = 0;$rst3total2 = 0;$cst1total2 = 0;$cst2total2 = 0;$cst3total2 = 0;$cst4total2 = 0;$cst5total2 = 0;$cst6total2 = 0;$cst7total2 = 0;$cst8total2 = 0;
$rst1total3 = 0;$rst2total3 = 0;$rst3total3 = 0;$cst1total3 = 0;$cst2total3 = 0;$cst3total3 = 0;$cst4total3 = 0;$cst5total3 = 0;$cst6total3 = 0;$cst7total3 = 0;$cst8total3 = 0;
$rst1total = 0;$rst2total = 0;$rst3total = 0;$cst1total = 0;$cst2total = 0;$cst3total = 0;$cst4total = 0;$cst5total = 0;$cst6total = 0;$cst7total = 0;$cst8total = 0;
foreach($reportdata['masterreportafs'] as $key => $afs)
{
if($key == 10){
$rst1total += $afs->rst1;$rst2total += $afs->rst2;$rst3total += $afs->rst3;
$cst1total += $afs->cst1;$cst2total += $afs->cst2;$cst3total += $afs->cst3;$cst4total += $afs->cst4;$cst5total += $afs->cst5;$cst6total += $afs->cst6;$cst7total += $afs->cst7;$cst8total += $afs->cst8;
}
if($key == 9 || $key == 8)
{
$rst1total3 += $afs->rst1;$rst2total3 += $afs->rst2;$rst3total3 += $afs->rst3;
$cst1total3 += $afs->cst1;$cst2total3 += $afs->cst2;$cst3total3 += $afs->cst3;$cst4total3 += $afs->cst4;$cst5total3 += $afs->cst5;$cst6total3 += $afs->cst6;$cst7total3 += $afs->cst7;$cst8total3 += $afs->cst8;
}
if($key == 6 || $key == 7)
{
$rst1total2 += $afs->rst1;$rst2total2 += $afs->rst2;$rst3total2 += $afs->rst3;
$cst1total2 += $afs->cst1;$cst2total2 += $afs->cst2;$cst3total2 += $afs->cst3;$cst4total2 += $afs->cst4;$cst5total2 += $afs->cst5;$cst6total2 += $afs->cst6;$cst7total2 += $afs->cst7;$cst8total2 += $afs->cst8;
}
if($key >= 0 && $key <= 5)
{
$rst1total1 += $afs->rst1;$rst2total1 += $afs->rst2;$rst3total1 += $afs->rst3;
$cst1total1 += $afs->cst1;$cst2total1 += $afs->cst2;$cst3total1 += $afs->cst3;$cst4total1 += $afs->cst4;$cst5total1 += $afs->cst5;$cst6total1 += $afs->cst6;$cst7total1 += $afs->cst7;$cst8total1 += $afs->cst8;
}
?>
<tr > <td><?php echo ($key+1);?></td> <td > <?php echo $afs->factor; ?></td> <td><?php echo $afs->sieve_size;?></td>
<?php if($key == 0){?>
<td rowspan="6" class="edit" ><?php echo $afs->spec; ?></td>
<?php }?>
<?php if($key == 6){?>
<td rowspan="2" class="edit" ><?php echo $afs->spec; ?></td>
<?php }?>
<?php if($key == 8){?>
<td rowspan="2" class="edit" ><?php echo $afs->spec; ?></td>
<?php }?>
<?php if($key == 10){?>
<td rowspan="1" class="edit" ><?php echo $afs->spec; ?></td>
<?php }?>
<!-- raw test sand -->
<td class="editrst" ><?php echo $afs->rst1;?></td>
<td class="editrst" ><?php echo $afs->rst2;?></td>
<td class="editrst" ><?php echo $afs->rst3;?></td>
<!-- coated test sand calculateAFS(this.parentNode.id,this.textContent,this.id);"-->
<td class="editcst" ><?php echo $afs->cst1;?></td>
<td class="editcst" ><?php echo $afs->cst2;?></td>
<td class="editcst" ><?php echo $afs->cst3;?></td>
<td class="editcst" ><?php echo $afs->cst4;?></td>
<td class="editcst" ><?php echo $afs->cst5;?></td>
<td class="editcst" ><?php echo $afs->cst6;?></td>
<td class="editcst" ><?php echo $afs->cst7;?></td>
<td class="editcst" ><?php echo $afs->cst8;?></td>
<?php if($key == 5){?>
<tr><td colspan="4" style="background-color:#f5e0a5">Total</td> <td style="background-color:#f5e0a5" ><?php echo $rst1total1;?></td><td style="background-color:#f5e0a5" ><?php echo $rst2total1;?></td><td style="background-color:#f5e0a5" ><?php echo $rst3total1;?></td><td style="background-color:#f5e0a5" ><?php echo $cst1total1;?></td><td style="background-color:#f5e0a5" id="cst2total1"><?php echo $cst2total1;?></td><td style="background-color:#f5e0a5" ><?php echo $cst3total1;?></td><td style="background-color:#f5e0a5"><?php echo $cst4total1;?></td><td style="background-color:#f5e0a5"><?php echo $cst5total1;?></td><td style="background-color:#f5e0a5"><?php echo $cst6total1;?></td><td style="background-color:#f5e0a5"><?php echo $cst7total1;?></td><td style="background-color:#f5e0a5"><?php echo $cst8total1;?></td></tr>
<?php }?>
<?php if($key == 7){?>
<tr><td colspan="4" style="background-color:#f5e0a5">Total</td> <td style="background-color:#f5e0a5" ><?php echo $rst1total2;?></td><td style="background-color:#f5e0a5" ><?php echo $rst2total2;?></td><td style="background-color:#f5e0a5" ><?php echo $rst3total2;?></td><td style="background-color:#f5e0a5"><?php echo $cst1total2;?></td><td style="background-color:#f5e0a5" ><?php echo $cst2total2;?></td><td style="background-color:#f5e0a5"><?php echo $cst3total2;?></td><td style="background-color:#f5e0a5"><?php echo $cst4total2;?></td><td style="background-color:#f5e0a5"><?php echo $cst5total2;?></td><td style="background-color:#f5e0a5"><?php echo $cst6total2;?></td><td style="background-color:#f5e0a5"><?php echo $cst7total2;?></td><td style="background-color:#f5e0a5"><?php echo $cst8total2;?></td></tr>
<?php }?>
</tr>
<?php if($key == 9){?>
<tr><td colspan="4" style="background-color:#f5e0a5">Total</td> <td style="background-color:#f5e0a5"><?php echo $rst1total3;?></td><td style="background-color:#f5e0a5"><?php echo $rst2total3;?></td><td style="background-color:#f5e0a5"><?php echo $rst3total3;?></td><td style="background-color:#f5e0a5"><?php echo $cst1total3;?></td><td style="background-color:#f5e0a5"><?php echo $cst2total3;?></td><td style="background-color:#f5e0a5"><?php echo $cst3total3;?></td><td style="background-color:#f5e0a5"><?php echo $cst4total3;?></td><td style="background-color:#f5e0a5"><?php echo $cst5total3;?></td><td style="background-color:#f5e0a5"><?php echo $cst6total3;?></td><td style="background-color:#f5e0a5" ><?php echo $cst7total3;?></td><td style="background-color:#f5e0a5"><?php echo $cst8total3;?></td></tr>
<?php }?>
<?php if($key == 10){?>
<tr><td colspan="4" style="background-color:#f5e0a5">Total</td> <td style="background-color:#f5e0a5"><?php echo $rst1total;?></td><td style="background-color:#f5e0a5"><?php echo $rst2total;?></td><td style="background-color:#f5e0a5"><?php echo $rst3total;?></td><td style="background-color:#f5e0a5"><?php echo $cst1total;?></td><td style="background-color:#f5e0a5"><?php echo $cst2total;?></td><td style="background-color:#f5e0a5"><?php echo $cst3total;?></td><td style="background-color:#f5e0a5"><?php echo $cst4total;?></td><td style="background-color:#f5e0a5"><?php echo $cst5total;?></td><td style="background-color:#f5e0a5"><?php echo $cst6total;?></td><td style="background-color:#f5e0a5"><?php echo $cst7total;?></td><td style="background-color:#f5e0a5"><?php echo $cst8total;?></td></tr>
<?php }?>
</tr>
<?php
}
}
?>
</tbody>
</table>
<!-- h3>MASTER2 DETAILS</h3> -->
<!-- <h3>LOI DETAILS</h3> -->
<br>
<table style="border-collapse: collapse;border-left-style:hidden;" border="1" cellspacing="0" cellpadding="0">
<tr><th>SNO</th><th width="120px;">Description</th><th width="75px;">Spec</th><th colspan="3" width="186px;">Raw Sand Tests</th><th colspan="8" width="320px;">Coated Sand Tests</th></tr>
<tbody>
<?php
$loitableids = array('fit','fot','ct','w1','w2','w3');
//echo $loitableids[0];
foreach($reportdata['masterreportloi'] as $key => $loi)
{
?>
<tr>
<td><?php echo ($key+1)?></td> <td><?php echo $loi->loidetails?></td>
<td class="edit" id="<?php echo $loitableids[$key].'spec';?>" contenteditable="true"><?php echo $loi->spec;?></td>
<td id="<?php echo $loitableids[$key].'rst1'?>" class="editrst" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->rst1;?></td>
<td id="<?php echo $loitableids[$key].'rst2'?>" class="editrst" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->rst2;?></td>
<td id="<?php echo $loitableids[$key].'rst3'?>" class="editrst" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->rst3;?></td>
<td id="<?php echo $loitableids[$key].'cst1'?>" class="editcst" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst1;?></td>
<td id="<?php echo $loitableids[$key].'cst2'?>" class="editcst" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst2;?></td>
<td id="<?php echo $loitableids[$key].'cst3'?>" class="editcst" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst3;?></td>
<td id="<?php echo $loitableids[$key].'cst4'?>" class="editcst" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst4;?></td>
<td id="<?php echo $loitableids[$key].'cst5'?>" class="editcst" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst5;?></td>
<td id="<?php echo $loitableids[$key].'cst6'?>" class="editcst" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst6;?></td>
<td id="<?php echo $loitableids[$key].'cst7'?>" class="editcst" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst7;?></td>
<td id="<?php echo $loitableids[$key].'cst8'?>" class="editcst" onkeyup="calculateLOI(this.parentNode.id,this.id,this.textContent)"><?php echo $loi->cst8;?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<h4>Remarks:</h4> <p><?php echo $reportdata['master'][0]->remarks; ?></p>
<hr>
<br>
<table >
<tr><td>INSPECTOR NAME :<?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 $reportdata['master'][0]->approvedby; ?></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<!-- <tr><td>Signature</td><td>&nbsp;</td></tr>-->
</table>
</body>
</html>