QAD files merged in resico
This commit is contained in:
parent
1e26bf600f
commit
3dda02f2a0
@ -79,6 +79,7 @@ $route['emppayListings/(:num)'] = 'emppaydate/emppayListing/$1';
|
||||
$route['attendance'] = 'monthlypay/attendanceLoad';
|
||||
$route['publicholidays'] = 'monthlypay/loadPublicholidays';
|
||||
$route['loanreports'] = 'payslip/loadLoanReport';
|
||||
$route['qualityreportlist'] = "quality/reportList";
|
||||
|
||||
|
||||
|
||||
|
||||
@ -4,15 +4,16 @@ require APPPATH . '/libraries/BaseController.php';
|
||||
|
||||
/**
|
||||
* Class : assetdetails (Asset Details - Controller)
|
||||
* User Class to control all user related operations.
|
||||
* Assetdetails Class to control all Asset Details related operations.
|
||||
* @author : Venba Info Tech
|
||||
* @version : 1.1
|
||||
* @since : 18 November 2017
|
||||
*/
|
||||
|
||||
class assetdetails extends BaseController
|
||||
{
|
||||
/**
|
||||
* This is default constructor of the class
|
||||
* default constructor of the class
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@ -21,54 +22,49 @@ class assetdetails extends BaseController
|
||||
$this->load->library('form_validation');
|
||||
$this->isLoggedIn();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function used to load the first screen of the user
|
||||
* default function of the assetdetails class
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Resico : Asset Details';
|
||||
|
||||
$this->global['pageTitle'] = 'Resico : Asset Details';
|
||||
$this->loadViews("assetListing", $this->global, NULL , NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to load the Supplier list
|
||||
* To load the Asset list
|
||||
*/
|
||||
function assetListing()
|
||||
{
|
||||
|
||||
$this->load->model('assetdetails_model');
|
||||
|
||||
$data['userRecords'] = $this->assetdetails_model->assetListing();
|
||||
|
||||
$this->global['pageTitle'] = 'Resico : Asset List';
|
||||
//print_r($data);die();
|
||||
$this->loadViews("assetListing", $this->global, $data, NULL);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to load the add new supplier */
|
||||
* To load the add asset
|
||||
*/
|
||||
function addasset()
|
||||
{
|
||||
|
||||
|
||||
|
||||
$data['AssetStatus'] = $this->assetdetails_model->getConfigValue('C015');
|
||||
$data['po'] = $this->assetdetails_model->getPO();
|
||||
|
||||
//print_r($data);die();
|
||||
$this->global['pageTitle'] = 'Resico : Add Asset';
|
||||
|
||||
$this->global['pageTitle'] = 'Resico : Add Asset';
|
||||
$this->loadViews("addasset", $this->global, $data, NULL);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Based on PONO its display relvant material code's are listed in dropdown
|
||||
*/
|
||||
function getpodetails()
|
||||
{
|
||||
$PO= $this->input->post('PONO');
|
||||
|
||||
$data = $this->assetdetails_model->getpodetails($PO);
|
||||
//print_r($data);die();
|
||||
|
||||
$HTML = "<option value='0'>SelectMaterialCode</option>";
|
||||
if(count($data) > 0)
|
||||
@ -78,22 +74,18 @@ class assetdetails extends BaseController
|
||||
$Code = $data[$j]->LineItemNo;
|
||||
$Name = $data[$j]->MaterialCode;
|
||||
|
||||
|
||||
|
||||
$HTML .="<option value='".$Code."'>".$Code."-".$Name."</option>";
|
||||
}
|
||||
}
|
||||
//echo $HTML;
|
||||
die(json_encode(array($HTML)));
|
||||
//echo json_encode($data);
|
||||
//die();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Based on PO type its get relvant material code's
|
||||
*/
|
||||
function getline()
|
||||
{
|
||||
$line = $this->input->post('line');
|
||||
|
||||
|
||||
$type = $this->assetdetails_model->gettyp($line);
|
||||
|
||||
$data='';
|
||||
@ -118,59 +110,52 @@ class assetdetails extends BaseController
|
||||
}
|
||||
elseif($data=='CAPITAL'){
|
||||
$ser = $this->assetdetails_model->getlineitemcap($line);
|
||||
}
|
||||
//print_r($ser);die();
|
||||
|
||||
|
||||
//print_r($data);die();
|
||||
//$data = $this->getDateformat($data);
|
||||
};
|
||||
echo json_encode($ser);
|
||||
die();
|
||||
}
|
||||
// function getlin(){
|
||||
// $line = $this->input->post('line');
|
||||
|
||||
|
||||
// }
|
||||
/* Validation for Department Dropdown
|
||||
*/
|
||||
|
||||
/**
|
||||
* Validation for Department Dropdown
|
||||
*/
|
||||
function Department_validate($selectValue)
|
||||
{
|
||||
//echo 'select_validate method called';
|
||||
// 'none' is the first option and the text says something like "-Choose one-"
|
||||
if($selectValue == '-1')
|
||||
{
|
||||
$this->form_validation->set_message('Department_validate', 'Please Select Department.');
|
||||
return false;
|
||||
{
|
||||
// 'none' is the first option and the text says something like "-Choose one-"
|
||||
if($selectValue == '-1')
|
||||
{
|
||||
$this->form_validation->set_message('Department_validate', 'Please Select Department.');
|
||||
return false;
|
||||
}
|
||||
else // user picked something
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else // user picked something
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/* Validation for Supplier Dropdown
|
||||
*/
|
||||
function Supplier_validate($selectValue)
|
||||
{
|
||||
//echo 'select_validate method called';
|
||||
// 'none' is the first option and the text says something like "-Choose one-"
|
||||
if($selectValue == '-1')
|
||||
{
|
||||
$this->form_validation->set_message('Supplier_validate', 'Please Select Supplier.');
|
||||
return false;
|
||||
}
|
||||
else // user picked something
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* Validation for Supplier Dropdown
|
||||
*/
|
||||
/**
|
||||
* Validation for Supplier Dropdown
|
||||
*/
|
||||
function Supplier_validate($selectValue)
|
||||
{
|
||||
// 'none' is the first option and the text says something like "-Choose one-"
|
||||
if($selectValue == '-1')
|
||||
{
|
||||
$this->form_validation->set_message('Supplier_validate', 'Please Select Supplier.');
|
||||
return false;
|
||||
}
|
||||
else // user picked something
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validation for Asset Status Dropdown
|
||||
*/
|
||||
function Asset_validate($selectValue)
|
||||
{
|
||||
{
|
||||
//echo 'select_validate method called';
|
||||
// 'none' is the first option and the text says something like "-Choose one-"
|
||||
//'none' is the first option and the text says something like "-Choose one-"
|
||||
if($selectValue == '-1')
|
||||
{
|
||||
$this->form_validation->set_message('Asset_validate', 'Please Select Asset Status.');
|
||||
@ -182,13 +167,12 @@ class assetdetails extends BaseController
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This function is used to add new user to the system
|
||||
* To add new asset to the system
|
||||
*/
|
||||
function addNewasset()
|
||||
{
|
||||
|
||||
$this->form_validation->set_rules('AssetName','AssetName','trim|required');
|
||||
//$this->form_validation->set_rules('Description','Description','trim|required');
|
||||
$this->form_validation->set_rules('Department','Department','trim|callback_Department_validate');
|
||||
$this->form_validation->set_rules('Location','Location','trim|required');
|
||||
$this->form_validation->set_rules('User','User','trim|required');
|
||||
@ -222,7 +206,6 @@ class assetdetails extends BaseController
|
||||
if($DateOfCommission != '')
|
||||
{
|
||||
$DOCommission= $this->getDateformat($DateOfCommission);
|
||||
//$DOCommission= $this->getDateformat($DateOfCommission);
|
||||
}
|
||||
$AssetStatus = $this->input->post('AssetStatus');
|
||||
$Remarks = $this->input->post('Remarks');
|
||||
@ -252,7 +235,6 @@ class assetdetails extends BaseController
|
||||
|
||||
if($result > 0)
|
||||
{
|
||||
// $this->session->set_flashdata('success', 'New Asset created successfully');
|
||||
echo "<script>alert('Asset Created successfully!');</script>";
|
||||
redirect('assetListing','refresh');
|
||||
|
||||
@ -267,16 +249,10 @@ class assetdetails extends BaseController
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* This function is used load user edit information
|
||||
* @param number $userId : Optional : This is user id
|
||||
*/
|
||||
|
||||
/*function ech(){
|
||||
|
||||
echo $this->input->post('Asset_Code');
|
||||
}*/
|
||||
|
||||
/**
|
||||
* To edit exists asset details to the system (href link)
|
||||
*/
|
||||
function editOldasset($AssetCode = '',$PO='')
|
||||
{
|
||||
|
||||
@ -293,30 +269,22 @@ class assetdetails extends BaseController
|
||||
{
|
||||
$AssetID = $AssetCode;
|
||||
}
|
||||
//echo $AssetID;
|
||||
|
||||
$data['assetList'] = $this->assetdetails_model->getAssetDetails($AssetID);
|
||||
// $data['SupplierList'] = $this->assetdetails_model->getSupplierName($SupplierName);
|
||||
// $data['DepartmentList'] = $this->assetdetails_model->getDepartment($Department);
|
||||
$data['AssetStatusList'] = $this->assetdetails_model->getConfigValue('C015');
|
||||
$data['PO'] = $this->assetdetails_model->getPO($PO);
|
||||
//print_r($data);die();
|
||||
$this->global['pageTitle'] = 'Resico : Edit Asset';
|
||||
|
||||
$this->loadViews("editasset", $this->global, $data,NULL);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is used to edit the user information
|
||||
* To store edited asset data into DB.
|
||||
*/
|
||||
function editasset()
|
||||
{
|
||||
|
||||
|
||||
$Asset_Code = $this->input->post('AssetCode');
|
||||
|
||||
$this->form_validation->set_rules('AssetName','AssetName','trim|required');
|
||||
$this->form_validation->set_rules('Description','Description','trim|required');
|
||||
$this->form_validation->set_rules('Department','Department','trim|callback_Department_validate');
|
||||
@ -356,7 +324,7 @@ class assetdetails extends BaseController
|
||||
{
|
||||
|
||||
$DOCommission= $this->getDateformat($DateOfCommission);
|
||||
//$DOCommission= $this->dateformat($DateOfCommission);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -399,7 +367,10 @@ class assetdetails extends BaseController
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To convert the dateformat (date with time) and store to DB
|
||||
*/
|
||||
function getDateformat($Val)
|
||||
{
|
||||
$date = new DateTime($Val);
|
||||
@ -407,7 +378,9 @@ class assetdetails extends BaseController
|
||||
return $retDate;
|
||||
}
|
||||
|
||||
//this function used to dateformat to store in db
|
||||
/**
|
||||
* To convert the dateformat (date only) and store to DB
|
||||
*/
|
||||
function dateformat($DateValue)
|
||||
{
|
||||
$date = DateTime::createFromFormat('d/m/Y', $DateValue);//we should give the date as per DatePicker format.
|
||||
@ -415,15 +388,17 @@ class assetdetails extends BaseController
|
||||
//if the date picker format is mismatched means it display as invalid date so that we can use this "IF" Conditions (i.e) If the above format returns false then the date is not formatted correctly
|
||||
if ($date === false) {
|
||||
return false;
|
||||
//return null;
|
||||
|
||||
}
|
||||
|
||||
$retDate = $date->format('Y-m-d'); //in this line using the parsed date., we can create a new formatting for storing value to datebase ("we choosing date value based on datepicker")
|
||||
// echo "<script>alert($retDate);</script>";
|
||||
|
||||
return $retDate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is used to export report of asset details in excel
|
||||
*/
|
||||
function export_asset(){
|
||||
|
||||
|
||||
@ -503,7 +478,7 @@ class assetdetails extends BaseController
|
||||
|
||||
|
||||
$exportData = $this->assetdetails_model->export_excel();
|
||||
//print_r($exportData);die();
|
||||
|
||||
if ($exportData) {
|
||||
$i = 6;
|
||||
$s = 1;
|
||||
@ -550,6 +525,9 @@ class assetdetails extends BaseController
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* To load pagenotfound view
|
||||
*/
|
||||
function pageNotFound()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Resico : 404 - Page Not Found';
|
||||
@ -558,4 +536,4 @@ class assetdetails extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>s
|
||||
@ -4,7 +4,7 @@ require APPPATH . '/libraries/BaseController.php';
|
||||
|
||||
/**
|
||||
* Class : companycontroller (Company Details - Controller)
|
||||
* User Class to control all user related operations.
|
||||
* companycontoller Class to control all company details related operations.
|
||||
* @author :Venba Info Tech - Gandhimathi
|
||||
* @version : 1.1
|
||||
* @since : 18 November 2017
|
||||
@ -12,26 +12,27 @@ require APPPATH . '/libraries/BaseController.php';
|
||||
class companycontroller extends BaseController
|
||||
{
|
||||
/**
|
||||
* This is default constructor of the class
|
||||
* default constructor of the class
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('companydetailsmodel');
|
||||
$this->load->model('companydetailsmodel');
|
||||
$this->isLoggedIn();
|
||||
}
|
||||
/**
|
||||
* This function used to load the first screen of the user
|
||||
* default function of the companycontroller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Resico : Company Details';
|
||||
|
||||
//$this->loadViews("companyadd", $this->global, NULL , NULL);
|
||||
|
||||
//$this->loadViews("Updatecompany", $this->global,NULL,NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* To load update company
|
||||
*/
|
||||
public function companyview()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Resico : Company Details';
|
||||
@ -40,20 +41,16 @@ class companycontroller extends BaseController
|
||||
$data['payment'] = $this->companydetailsmodel->getPaymentTerms();
|
||||
$data['filenames']=$this->companydetailsmodel->filelist();
|
||||
$data['bankdetails']=$this->companydetailsmodel->getBankDetails();
|
||||
//$data['filetype']=$this->companydetailsmodel->getfilename();
|
||||
$data['filetype']=$this->companydetailsmodel->getfilename();
|
||||
$this->loadViews("companyview", $this->global,$data, NULL);
|
||||
}
|
||||
|
||||
/* this function used to add and update the bank details*/
|
||||
/**
|
||||
* To add and update the bank details
|
||||
*/
|
||||
public function bankdtl()
|
||||
{
|
||||
|
||||
//$bankname = $this->input->post('id1');
|
||||
//$ifsccode = $this->input->post('id2');
|
||||
//$bankaddress = $this->input->post('id3');
|
||||
//$isactive = $this->input->post('');
|
||||
|
||||
$id = $this->input->post('id');
|
||||
$tablevalue = json_decode($id,true);
|
||||
|
||||
@ -75,22 +72,24 @@ class companycontroller extends BaseController
|
||||
$Bank = array('Bank_name'=>$bankname,'IFSC'=>$ifsccode,'Address'=>$bankaddress,'Is_Active'=>$isactive,'Bank_Accno'=>$bankaccno);
|
||||
$result = $this->companydetailsmodel->BankDetails($Bank);
|
||||
|
||||
}
|
||||
|
||||
//$Bank = array('Bank_name'=>$bankname,'IFSC'=>$ifsccode,'Address'=>$bankaddress);
|
||||
//$result = $this->companydetailsmodel->AddBankDetails($Bank);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To load add company
|
||||
*
|
||||
* Note : this function Temporary not in use
|
||||
*/
|
||||
function companyadd(){
|
||||
|
||||
$this->global['pageTitle'] = 'Resico : Company Details';
|
||||
$this->loadViews("companyadd", $this->global, NULL);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To add company revalant files
|
||||
*/
|
||||
function add()
|
||||
{
|
||||
$picture = '';
|
||||
@ -120,10 +119,14 @@ class companycontroller extends BaseController
|
||||
}
|
||||
|
||||
return $picture ;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To Edit company revalant Images
|
||||
*/
|
||||
function editimage($ModifyPictureName)
|
||||
{
|
||||
//$picture = $ModifyPictureName;
|
||||
|
||||
if(!empty($_FILES['photo']['name']))
|
||||
{
|
||||
$config['upload_path'] = 'uploads/images/';
|
||||
@ -150,7 +153,11 @@ class companycontroller extends BaseController
|
||||
}
|
||||
|
||||
return $picture ;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To add company revalant files
|
||||
*/
|
||||
function addfile()
|
||||
{
|
||||
$file = '';
|
||||
@ -185,9 +192,11 @@ class companycontroller extends BaseController
|
||||
return $file ;
|
||||
}
|
||||
|
||||
|
||||
function checkPanValidate()
|
||||
{
|
||||
/**
|
||||
* To check whether PAN already exist or not
|
||||
*/
|
||||
function checkPanValidate()
|
||||
{
|
||||
$PanNo = $this->input->post('panno');
|
||||
$query = $this->supplier_model->checkPAN($PanNo);
|
||||
if (count($query)> 0)
|
||||
@ -199,9 +208,13 @@ class companycontroller extends BaseController
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function deletefile()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* To delete company revalant files
|
||||
*/
|
||||
function deletefile()
|
||||
{
|
||||
|
||||
$ID = $this->input->post('id');
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
@ -213,11 +226,11 @@ class companycontroller extends BaseController
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* To edit exists Company details
|
||||
*/
|
||||
function UpdateCompany()
|
||||
{
|
||||
//die();
|
||||
// $data['payment'] = $this->companydetailsmodel->getpayment();
|
||||
if($this->isAdmin() == TRUE)
|
||||
{
|
||||
$this->loadThis();
|
||||
@ -229,22 +242,20 @@ class companycontroller extends BaseController
|
||||
$PictureName = $this->input->post('Image');
|
||||
$ModifyPictureName = $this->input->post('ModifyImage');
|
||||
if ($PictureName != '')
|
||||
{ //echo 'Exists';
|
||||
{
|
||||
if(strlen($ModifyPictureName) == 0)
|
||||
{
|
||||
//echo 'Exists But Not replace';
|
||||
|
||||
$Picture = $PictureName;
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo 'Exists But Replace';
|
||||
//$Picture = $this->editimage($ModifyPictureName);
|
||||
$Picture = $this->add($ModifyPictureName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo 'Not Exists';
|
||||
|
||||
$Picture = $this->add();
|
||||
}
|
||||
$file =$this->addfile();
|
||||
@ -262,38 +273,22 @@ class companycontroller extends BaseController
|
||||
$CollectrateAddress = $this->input->post('CollectrateAddress');
|
||||
$UANumber = $this->input->post('UANumber');
|
||||
$PaymentId = $this->input->post('paymentid');
|
||||
//$Payment = $this->input->post('PaymentTerms');
|
||||
//$PaymentDays = $this->input->post('PaymentDays');
|
||||
//$PayableAT = $this->input->post('PayableAT');
|
||||
$createdby = $this->session->userdata ( 'userId' );
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$createddt = $dt->format('Y-m-d H:i:s');
|
||||
$updatedby = $this->session->userdata ( 'userId' );
|
||||
$date = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$updateddt = $date->format('Y-m-d H:i:s');
|
||||
//$UpdatedBY = $this->session->userdata ( 'Userid' );
|
||||
//$companywebsite = $this->input->post('companywebsite');
|
||||
//$ceoname = $this->input->post('ceoname');
|
||||
//$mdname = $this->input->post('mdname');
|
||||
//$companystartedon = $this->input->post('companystartedon');
|
||||
//$partnerdetails = $this->input->post ('partnerdetails');
|
||||
$companywebsite = $this->input->post('companywebsite');
|
||||
//$ProfilePic = $this->input->post ('ProfilePic');
|
||||
//$files = $this->input->post('files');
|
||||
$companywebsite = $this->input->post('companywebsite');
|
||||
$filedescription1= $this->input->post('filedescription');
|
||||
//$files = $this->input->post('filename');
|
||||
//$financialstart=$this->input->post('financialstart');
|
||||
//$financialend=$this->input->post('financialend');
|
||||
$date = new DateTime($this->input->post('financialstart'));
|
||||
$date = new DateTime($this->input->post('financialstart'));
|
||||
$financialstart = $date->format('Y-m-d H:i:s');
|
||||
|
||||
$date2 = new DateTime($this->input->post('financialend'));
|
||||
$financialend = $date2->format('Y-m-d H:i:s');
|
||||
|
||||
$ID= $this->input->post('ID');
|
||||
//$createdDate=$this->input->post('createdDate');
|
||||
|
||||
//$Company = array('CompID'=>$CompID,'CompanyName'=>$CompanyName,'Address'=>$Address,'ContactNumber'=>$ContactNumber,'AlternateContactNumber'=>$AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNO'=>$GSTNO,'GSTRange'=>$GSTRange,'UANumber'=>$UANumber,'PaymentTerms'=>$Payment ,'PaymentDays'=>$PaymentDays ,'PayableAT'=>$PayableAT ,'Createdby'=>$createdby,'ProfilePic'=>$Picture,'Exiseregistration'=>$Exiseregistration,'CollectrateAddress'=>$CollectrateAddress,'FiscalYearStartOn'=>$financialstart,'FiscalYearEndsOn'=> $financialend);
|
||||
|
||||
$Company = array('CompID'=>$CompID,'CompanyName'=>$CompanyName,'Address'=>$Address,'ContactNumber'=>$ContactNumber,'AlternateContactNumber'=>$AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNO'=>$GSTNO,'GSTRange'=>$GSTRange,'UANumber'=>$UANumber,'Createdby'=>$createdby,'ProfilePic'=>$Picture,'Exiseregistration'=>$Exiseregistration,'CollectrateAddress'=>$CollectrateAddress,'FiscalYearStartOn'=>$financialstart,'FiscalYearEndsOn'=> $financialend,'paymentID'=>$PaymentId,'companyWebsite'=>$companywebsite,'UpdatedBY'=>$updatedby,'Updatedon'=>$updateddt);
|
||||
|
||||
if(!empty($file))
|
||||
@ -313,7 +308,6 @@ class companycontroller extends BaseController
|
||||
}
|
||||
|
||||
|
||||
// redirect('companyview');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
287
application/controllers/quality.php
Normal file
287
application/controllers/quality.php
Normal file
@ -0,0 +1,287 @@
|
||||
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require APPPATH . '/libraries/BaseController.php';
|
||||
|
||||
/**
|
||||
* Class : quality (Quality Controller)
|
||||
* User Class to control all user related operations.
|
||||
* @author : VenbaInfoTech -
|
||||
* @version : 1.1
|
||||
* @since : 09 December 2017
|
||||
*/
|
||||
class quality extends BaseController
|
||||
{
|
||||
/**
|
||||
* This is default constructor of the class
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('quality_model');
|
||||
$this->load->library('form_validation');
|
||||
//$this->load->library('dompdf_gen');
|
||||
$this->isLoggedIn();
|
||||
}
|
||||
/**
|
||||
* This function used to load the first screen of the user
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['products'] = $this->quality_model->getAllprodcuts();
|
||||
$data['customers'] = $this->quality_model->getAllcustomers();
|
||||
$data['existspec'] = $this->quality_model->getAllspec();
|
||||
$this->global['pageTitle'] = 'Resico : Quality Master';
|
||||
|
||||
$this->loadViews("qualitymasterlistview", $this->global, $data , NULL);
|
||||
}
|
||||
|
||||
|
||||
public function reportList()
|
||||
{
|
||||
$data['records'] = $this->quality_model->getTestMasterforList();
|
||||
|
||||
$this->global['pageTitle'] = 'Resico : Quality Master';
|
||||
$this->loadViews("reportmasterlist", $this->global, $data , NULL);
|
||||
}
|
||||
|
||||
function addNewPage()
|
||||
{
|
||||
$data['products'] = $this->quality_model->getAllprodcuts();
|
||||
$data['customers'] = $this->quality_model->getAllcustomers();
|
||||
|
||||
$this->global['pageTitle'] = 'Resico : Quality Master';
|
||||
|
||||
$this->loadViews("qualitymaster", $this->global, $data , NULL);
|
||||
}
|
||||
|
||||
function saveSpectficationData()
|
||||
{
|
||||
$product = $this->input->post('param2');
|
||||
$customer = $this->input->post('param3');
|
||||
$jsondata = $this->input->post('param1');
|
||||
$createdby = $this->session->userdata ( 'userId' );
|
||||
$phpdata = json_decode($jsondata);
|
||||
$total = 0;
|
||||
// echo $product .'-'. $customer;
|
||||
// print_r($phpdata);die();
|
||||
|
||||
foreach($phpdata as $data)
|
||||
{
|
||||
$name = $data->Name;
|
||||
$name = strtoupper($name);
|
||||
$uom = $data->UOM;
|
||||
$min = $data->Min;
|
||||
$max = $data->Max;
|
||||
$temp = $data->Temp;
|
||||
$isExist = $this->quality_model->checkExist($product,$customer,$name);
|
||||
//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,'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,'updated_by'=>$createdby);
|
||||
$res = $this->quality_model->updateSpecMast($tostore,$product,$customer,$name);
|
||||
//echo 'u'.$res;
|
||||
}
|
||||
|
||||
$total +=$res;
|
||||
}
|
||||
|
||||
echo $total.'- Specification Saved Successfully';
|
||||
}
|
||||
|
||||
function deleteSpecification()
|
||||
{
|
||||
$spname = $this->input->post('param1');
|
||||
$product = $this->input->post('param2');
|
||||
$customer = $this->input->post('param3');
|
||||
$res = $this->quality_model->deleteSpecification($spname,$product,$customer);
|
||||
if($res == 1)
|
||||
{
|
||||
echo "Deleted Successfully..!";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Something Went Wrong..!Try later";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function report()
|
||||
{
|
||||
|
||||
$data['records'] = $this->quality_model->getDataforReport();
|
||||
$data['emplist'] = $this->quality_model->getEmplistforReport();
|
||||
$this->global['pageTitle'] = 'Resico : Inspection Report Screen';
|
||||
$this->loadViews("qualityreport", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
function viewSpec()
|
||||
{
|
||||
$prodcutid = $this->uri->segment(3);
|
||||
$customerid =$this->uri->segment(4);
|
||||
$data['specifications'] = $this->quality_model->getIndividualSpec($prodcutid,$customerid);
|
||||
$this->global['pageTitle'] = 'Resico : View reports Lists';
|
||||
|
||||
$this->loadViews("viewIndSpec", $this->global, $data, NULL);
|
||||
|
||||
}
|
||||
|
||||
function viewIndReport()
|
||||
{
|
||||
$reportid = $this->uri->segment(3);
|
||||
|
||||
$data['reportdata'] = $this->quality_model->getIndividualReportData($reportid);
|
||||
$this->global['pageTitle'] = 'Resico : View Individual Report';
|
||||
$this->loadViews("viewindreport", $this->global, $data, NULL);
|
||||
|
||||
}
|
||||
|
||||
function printReportPDF()
|
||||
{
|
||||
|
||||
|
||||
$reportid = $this->input->post('rid');
|
||||
|
||||
$data['reportdata'] = $this->quality_model->getIndividualReportData($reportid);
|
||||
|
||||
$filename = 'PRE DESPATCH INSPECTION REPORT'.$reportid;
|
||||
|
||||
$html = $this->load->View("viewindreportpdf",$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 getAllSpecforReport()
|
||||
{
|
||||
$productid = $this->input->post('param1');
|
||||
$customerid = $this->input->post('param2');
|
||||
//echo 'from cn'.$productid.'-'.$customerid;
|
||||
$res = $this->quality_model->getSpecifications($productid,$customerid);
|
||||
echo json_encode($res);
|
||||
}
|
||||
|
||||
|
||||
function saveTestReportData()
|
||||
{
|
||||
|
||||
date_default_timezone_get('Asia/Kolkata');
|
||||
$testjson = $this->input->post('param1');
|
||||
$loijson = $this->input->post('param2');
|
||||
$afsjson = $this->input->post('param3');
|
||||
$invoiceno = $this->input->post('param4');
|
||||
$batchno = $this->input->post('param5');
|
||||
$chart = $this->input->post('param7');
|
||||
$batchno = date_format(date_create($batchno),'Y-m-d');
|
||||
|
||||
$approver = $this->input->post('param6');
|
||||
|
||||
$testphpdata = json_decode($testjson,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' );
|
||||
|
||||
$masterreportdata = array('invoiceid'=>$invoiceno,'batchdate'=>$batchno,'createdby'=>$createby,'createdon'=>$createdon,'approvedby'=>$approver,'chartdata'=>$chart);
|
||||
$MASTERID = $this->quality_model->saveMasterTestData($masterreportdata);
|
||||
|
||||
|
||||
|
||||
$descrition = '';
|
||||
$min = '';
|
||||
$max = '';
|
||||
$uom = '';
|
||||
$act1 = '';
|
||||
$act2 = '';
|
||||
$act3 = '';
|
||||
$average = '';
|
||||
$results = '';
|
||||
$remarks1 = '';
|
||||
foreach($testphpdata as $data)
|
||||
{
|
||||
//print_r($data);die();
|
||||
$descrition = $data['Description'];
|
||||
$min = $data['SpecificationMin'];
|
||||
$max = $data['SpecificationMax'];
|
||||
$uom = $data['SpecificationUOM'];
|
||||
$act1 = $data['ACT X1'];
|
||||
$act2 = $data['ACT X2'];
|
||||
$act3 = $data['ACT X3'];
|
||||
$average = $data['Average'];
|
||||
$results = $data['Results'];
|
||||
$remarks1 = $data['Remarks'];
|
||||
$testreportdata = array('testreport_id'=>$MASTERID,'description'=>$descrition,'min'=>$min,'max'=>$max,'UOM'=>$uom,'act1'=>$act1,'act2'=>$act2,'act3'=>$act3,'average'=>$average,'result'=>$results,'remarks'=>$remarks1);
|
||||
$reportid = $this->quality_model->saveTestReportData($testreportdata);
|
||||
}
|
||||
|
||||
|
||||
$start = '';
|
||||
$end = '';
|
||||
$temp = '';
|
||||
$w1 = '';
|
||||
$w2 = '';
|
||||
$w3 = '';
|
||||
$loip = '';
|
||||
$remark = '';
|
||||
foreach($loiphpdata as $loi)
|
||||
{
|
||||
$start = $loi['Heating Timestart'];
|
||||
$end = $loi['Heating Timeend'];
|
||||
$temp = $loi['Temp *c'];
|
||||
$w1 = $loi['Crucible Weight w1(g)'];
|
||||
$w2 = $loi['Before Heatingw2(g)'];
|
||||
$w3 = $loi['After Heatingw3(g)'];
|
||||
$loip = $loi['L.O.I %'];
|
||||
$remark = $loi['Remarks'];
|
||||
//echo $loip;
|
||||
//echo $remark;die();
|
||||
$loitabledata = array('testreport_id'=>$MASTERID,'start_time'=>$start,'end_time'=>$end,'temp'=>$temp,'w1'=>$w1,'w2'=>$w2,'w3'=>$w3,'loi_percentage'=>$loip,'remarks'=>$remark);
|
||||
$loiid = $this->quality_model->saveTestReportLOIData($loitabledata);
|
||||
|
||||
}
|
||||
|
||||
$count =0;
|
||||
foreach($afsphpdata as $afs)
|
||||
{
|
||||
$count++;
|
||||
if($count != 12){
|
||||
$ssize = $afs['Sieve Size µm'];
|
||||
$sandweight = $afs['Sand Weight'];
|
||||
$Percentage = $afs['Percentage'];
|
||||
$Multiplier = $afs['Multiplier'];
|
||||
$Product = $afs['Product'];
|
||||
$afstabledata = array('testreport_id'=>$MASTERID,'sieve_size'=>$ssize,'sandweight'=>$sandweight,'percentage'=>$Percentage,'multiplier'=>$Multiplier,'product'=>$Product);
|
||||
$afsid = $this->quality_model->saveTestReportAFSData($afstabledata);
|
||||
}
|
||||
}
|
||||
|
||||
echo "Report Data Saved Successfully!";
|
||||
|
||||
|
||||
}
|
||||
|
||||
function pageNotFound()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Resico : 404 - Page Not Found';
|
||||
|
||||
$this->loadViews("404", $this->global, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -4,15 +4,16 @@ require APPPATH . '/libraries/BaseController.php';
|
||||
|
||||
/**
|
||||
* Class : supplier (Supplier Details - Controller)
|
||||
* User Class to control all user related operations.
|
||||
* Supplier Class to control all Supplier related operations.
|
||||
* @author :Venba Info Tech - Gandhimathi
|
||||
* @version : 1.1
|
||||
* @since : 18 November 2017
|
||||
*/
|
||||
|
||||
class supplier extends BaseController
|
||||
{
|
||||
/**
|
||||
* This is default constructor of the class
|
||||
* default constructor of the class
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@ -23,18 +24,19 @@ class supplier extends BaseController
|
||||
$this->load->library('Excel');
|
||||
$this->isLoggedIn();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function used to load the first screen of the user
|
||||
* default function of the supplier class
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Resico : Supplier';
|
||||
|
||||
//Load the view supplierListing.php
|
||||
$this->loadViews("supplierListing", $this->global, NULL , NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to load the Supplier list
|
||||
* To load the Supplier list
|
||||
*/
|
||||
function supplierListing()
|
||||
{
|
||||
@ -45,46 +47,72 @@ class supplier extends BaseController
|
||||
|
||||
$this->global['pageTitle'] = 'Resico : Supplier Listing';
|
||||
|
||||
if($this->role == ROLE_ADMIN || $this->DEPCode == SALES || $this->DEPCode == FINANCE ||$this->DEPCode == HR)
|
||||
{
|
||||
|
||||
if($this->DEPCode != FINANCE && $this->DEPCode != HR)
|
||||
{
|
||||
//Load the view supplierListing.php
|
||||
$this->loadViews("supplierListing", $this->global, $data, NULL);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//Load the view access.php
|
||||
$this->loadViews("access", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to load the add new supplier */
|
||||
* To load the add new supplier
|
||||
*/
|
||||
function addsupplier()
|
||||
{
|
||||
|
||||
//$data['payment'] = $this->supplier_model->getpayment();
|
||||
$data['payment'] = $this->supplier_model->getPaymentTerms();
|
||||
//$data['users'] = $this->purchaseorder_model->getusers();
|
||||
|
||||
$this->global['pageTitle'] = 'Resico : Add New Supplier';
|
||||
$data['payment'] = $this->supplier_model->getPaymentTerms();
|
||||
$this->global['pageTitle'] = 'Resico : Add New Supplier';
|
||||
if($this->role == ROLE_ADMIN || $this->DEPCode == SALES || $this->DEPCode == FINANCE ||$this->DEPCode == HR)
|
||||
{
|
||||
|
||||
$this->loadViews("addsupplier", $this->global,$data, NULL);
|
||||
if($this->DEPCode != FINANCE && $this->DEPCode != HR)
|
||||
{
|
||||
//Load the view addsupplier.php
|
||||
$this->loadViews("addsupplier", $this->global,$data, NULL);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//Load the view access.php
|
||||
$this->loadViews("access", $this->global,$data, NULL);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* This function is used to check whether PAN already exist or not
|
||||
*/
|
||||
|
||||
function CheckPAN()
|
||||
|
||||
/**
|
||||
* To check whether PAN already exist or not
|
||||
*/
|
||||
function CheckPAN()
|
||||
{
|
||||
|
||||
$id = $this->input->post('id');
|
||||
|
||||
$query = $this->supplier_model->checkPAN($id );
|
||||
|
||||
$id = $this->input->post('id');
|
||||
$query = $this->supplier_model->checkPAN($id);
|
||||
$query = $query[0]['PAN'];
|
||||
|
||||
print_r($query);
|
||||
|
||||
}
|
||||
|
||||
/* To Check the Pan Number is exists in the database or not for the selected Supplier */
|
||||
/**
|
||||
* To Check the Pan Number is exists in the database or not for the selected Supplier
|
||||
*/
|
||||
function checkPanValidateSupplier() {
|
||||
|
||||
$SupplierID = $this->input->post('SupplierID');
|
||||
$PanNo = $this->input->post('panno');
|
||||
// echo 'Sup'. $SupplierID ;
|
||||
$query = $this->supplier_model->checkPAN($PanNo,$SupplierID);
|
||||
if (count($query)> 0)
|
||||
{
|
||||
@ -97,13 +125,13 @@ class supplier extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
/* To Check the Pan Number is exists in the database or not */
|
||||
/**
|
||||
* To Check the Pan Number is exists in the database or not
|
||||
*/
|
||||
function checkPanValidate()
|
||||
{
|
||||
// alert('validation pan');
|
||||
|
||||
|
||||
$PanNo = $this->input->post('panno');
|
||||
|
||||
$query = $this->supplier_model->checkPAN($PanNo);
|
||||
if (count($query)> 0)
|
||||
{
|
||||
@ -117,24 +145,25 @@ class supplier extends BaseController
|
||||
}
|
||||
|
||||
|
||||
|
||||
function CheckGST()
|
||||
{
|
||||
//alert('check validation GST');
|
||||
/**
|
||||
* To check whether GST Number already exist or not
|
||||
*/
|
||||
function CheckGST()
|
||||
{
|
||||
|
||||
$id = $this->input->post('id');
|
||||
$query = $this->supplier_model->checkGST($id);
|
||||
$query = $query[0]['GSTNO'];
|
||||
print_r($query);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* To Check the GST Number is exists in the database or not for the selected Supplier */
|
||||
function checkGstValidateSupplier() {
|
||||
//alert(' gst validation GST');
|
||||
/**
|
||||
* To Check the GST Number is exists in the database or not for the selected Supplier
|
||||
*/
|
||||
function checkGstValidateSupplier()
|
||||
{
|
||||
$SupplierID = $this->input->post('SupplierID');
|
||||
$GstNo = $this->input->post('GSTNo');
|
||||
//echo 'Sup'. $SupplierID ;
|
||||
$query = $this->supplier_model->checkGST($GstNo,$SupplierID);
|
||||
if (count($query)> 0)
|
||||
{
|
||||
@ -148,7 +177,9 @@ class supplier extends BaseController
|
||||
}
|
||||
|
||||
|
||||
/* To Check the GST Number is exists in the database or not */
|
||||
/**
|
||||
* To Check the GST Number is exists in the database or not
|
||||
*/
|
||||
function checkGstValidate()
|
||||
{
|
||||
|
||||
@ -167,7 +198,7 @@ class supplier extends BaseController
|
||||
|
||||
|
||||
/**
|
||||
* This function is used to add new Supplier to the system
|
||||
* To add new Supplier
|
||||
*/
|
||||
function addNewsupplier()
|
||||
{
|
||||
@ -215,9 +246,7 @@ class supplier extends BaseController
|
||||
$CSTDate = null;
|
||||
}
|
||||
else{
|
||||
|
||||
//$CSTDate = $this->dateformat($CSTDt);
|
||||
$CSTDate = $this->getDateformat($CSTDt);
|
||||
$CSTDate = $this->getDateformat($CSTDt);
|
||||
}
|
||||
}
|
||||
else{
|
||||
@ -264,6 +293,9 @@ class supplier extends BaseController
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* To Convert the dateformat (date with time) and stored into DB
|
||||
*/
|
||||
function getDateformat($Val)
|
||||
{
|
||||
$date = new DateTime($Val);
|
||||
@ -271,7 +303,9 @@ class supplier extends BaseController
|
||||
return $retDate;
|
||||
}
|
||||
|
||||
//this function used to dateformat to store in db
|
||||
/**
|
||||
* To Convert the dateformat (date only) and stored into DB
|
||||
*/
|
||||
function dateformat($DateValue)
|
||||
{
|
||||
$date = DateTime::createFromFormat('d/m/Y', $DateValue);//we should give the date as per DatePicker format.
|
||||
@ -279,24 +313,23 @@ class supplier extends BaseController
|
||||
//if the date picker format is mismatched means it display as invalid date so that we can use this "IF" Conditions (i.e) If the above format returns false then the date is not formatted correctly
|
||||
if ($date === false) {
|
||||
return false;
|
||||
//return null;
|
||||
|
||||
}
|
||||
|
||||
$retDate = $date->format('Y-m-d'); //in this line using the parsed date., we can create a new formatting for storing value to datebase ("we choosing date value based on datepicker")
|
||||
// echo "<script>alert($retDate);</script>";
|
||||
return $retDate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is used to edit the Supplier information
|
||||
* To store edited Supplier information into DB
|
||||
*/
|
||||
function editsupplier()
|
||||
{ $pan = $this->input->post('panno');
|
||||
{
|
||||
$pan = $this->input->post('panno');
|
||||
$this->form_validation->set_rules('SupplierName','Supplier Name','trim|required');
|
||||
$this->form_validation->set_rules('Address','Address','trim|required|');
|
||||
$supplierID = $this->input->post('SupplierID');
|
||||
//echo 'supID' . $supplierID ;
|
||||
$this->form_validation->set_rules('ContactNumber','Contact Number','trim|required|max_length[13]');
|
||||
$this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim|max_length[13]');
|
||||
$this->form_validation->set_rules('emailid','emailid','valid_email|max_length[128]|required');
|
||||
@ -334,7 +367,6 @@ class supplier extends BaseController
|
||||
$CollectrateAddress = $this->input->post('CollectrateAddress');
|
||||
$UANumber = $this->input->post('UANumber');
|
||||
$PaymentTerms = $this->input->post('paymentname');
|
||||
//print_r($PaymentTerms);
|
||||
$UpdatedBy = $this->session->userdata ( 'userId' );
|
||||
$chked = $this->input->post('isactive');
|
||||
|
||||
@ -351,7 +383,7 @@ class supplier extends BaseController
|
||||
$CSTDt = $this->input->post('dateofCST');
|
||||
|
||||
if($CSTDt != '')
|
||||
{//$CSTDate = $this->dateformat($CSTDt);
|
||||
{
|
||||
$CSTDate = $this->getDateformat($CSTDt);
|
||||
}
|
||||
else
|
||||
@ -374,8 +406,7 @@ class supplier extends BaseController
|
||||
$PaymentId = $this->input->post('paymentid');
|
||||
|
||||
$supplier = array();
|
||||
$supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'Exiseregistration'=>$Exiseregistration,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentID'=>$PaymentId,'CSTNo'=>$CSTNo,'CSTDate'=>$CSTDate,'Cert_EMS'=>$EMSNo, 'Cert_TS'=>$TSNo, 'Cert_IMS'=>$IMSNo, 'Cert_ISO'=>$ISONo, 'Cert_OSHAS'=>$OSHASNo, 'BankAcNumber'=>$accno, 'IFSCCode'=>$ifsc, 'BranchName'=>$branchname, 'BankAddress'=>$bankaddress,'UpdatedBy'=>$UpdatedBy,'IsActive'=>$IsActive,'IsService'=>$service,'IsMaintanance'=>$maintanance,'IsRawMaterial'=>$rawmaterial); //'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$Payment);
|
||||
//SupplierID, SupplierName, Address, ContactNumber, AlternateContactNumber, EmailAddress, Exiseregistration, TIN, PAN, CSTNO, CSTDate, GSTNO, GSTRange, CollectrateAddress, UANumber, PaymentTerms, PaymentDays, PayableAT, Cert_EMS, Cert_TS, Cert_IMS, Cert_ISO, Cert_OSHAS, BankAcNumber, IFSCCode, BranchName, BankAddress, Createdby, UpdatedBy, Updatedon, CreatedOn, IsActive);
|
||||
$supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'Exiseregistration'=>$Exiseregistration,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentID'=>$PaymentId,'CSTNo'=>$CSTNo,'CSTDate'=>$CSTDate,'Cert_EMS'=>$EMSNo, 'Cert_TS'=>$TSNo, 'Cert_IMS'=>$IMSNo, 'Cert_ISO'=>$ISONo, 'Cert_OSHAS'=>$OSHASNo, 'BankAcNumber'=>$accno, 'IFSCCode'=>$ifsc, 'BranchName'=>$branchname, 'BankAddress'=>$bankaddress,'UpdatedBy'=>$UpdatedBy,'IsActive'=>$IsActive,'IsService'=>$service,'IsMaintanance'=>$maintanance,'IsRawMaterial'=>$rawmaterial);
|
||||
|
||||
$result = $this->supplier_model->UpdateSupplier($supplier, $supplierID);
|
||||
|
||||
@ -397,7 +428,10 @@ class supplier extends BaseController
|
||||
|
||||
}
|
||||
|
||||
function viewsupplier($SID = '')
|
||||
/**
|
||||
* To view the Supplier information and load's the edit supplier screen
|
||||
*/
|
||||
function viewusupplier($SID = '')
|
||||
{
|
||||
$Payment = '';
|
||||
if($SID == '')
|
||||
@ -413,15 +447,30 @@ class supplier extends BaseController
|
||||
|
||||
|
||||
$data['supplier'] = $this->supplier_model->getSupplierInfo($supplierID);
|
||||
//$data['payment'] = $this->supplier_model->getpayment($Payment );
|
||||
$data['payment'] = $this->supplier_model->getPaymentTerms($Payment);
|
||||
$this->global['pageTitle'] = 'Resico : Edit Supplier';
|
||||
if($this->role == ROLE_ADMIN || $this->DEPCode == SALES || $this->DEPCode == FINANCE ||$this->DEPCode == HR)
|
||||
{
|
||||
|
||||
if($this->DEPCode != FINANCE && $this->DEPCode != HR)
|
||||
{
|
||||
//Load the view editSupplier.php
|
||||
$this->loadViews("editSupplier", $this->global,$data, NULL);
|
||||
|
||||
$this->loadViews("editSupplier", $this->global,$data, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//Load the view access.php
|
||||
$this->loadViews("access", $this->global,$data, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/** this function can be use for excel report **/
|
||||
|
||||
/**
|
||||
* This function is used to export report of supplier details in excel
|
||||
*/
|
||||
function export_supplierdetails(){
|
||||
|
||||
|
||||
@ -430,8 +479,7 @@ class supplier extends BaseController
|
||||
$this->excel->setActiveSheetIndex(0)->getStyle('J3')->getAlignment()->applyFromArray(array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,));
|
||||
|
||||
$this->excel->getActiveSheet()->setTitle('Supplier details');
|
||||
|
||||
$this->excel->getActiveSheet()->setCellValue('J3', 'Resico INDUSTRIES Supplier Details');
|
||||
$this->excel->getActiveSheet()->setCellValue('J3', 'RESICO INDUSTRIES Supplier Details');
|
||||
|
||||
$this->excel->getActiveSheet()->setCellValue('A5', 'SupplierID');
|
||||
$this->excel->getActiveSheet()->setCellValue('B5', 'SupplierName');
|
||||
@ -579,11 +627,13 @@ class supplier extends BaseController
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To load pagenotfound view
|
||||
*/
|
||||
function pageNotFound()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Resico : 404 - Page Not Found';
|
||||
|
||||
//Load the view 404.php
|
||||
$this->loadViews("404", $this->global, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,10 +4,7 @@ class assetdetails_model extends CI_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* This function is used to get the user listing count
|
||||
* @param string $searchText : This is optional search text
|
||||
* @param number $page : This is pagination offset
|
||||
* @param number $segment : This is pagination limit
|
||||
* To get the Asset data for listing
|
||||
* @return array $result : This is result
|
||||
*/
|
||||
function assetListing()
|
||||
@ -16,19 +13,23 @@ class assetdetails_model extends CI_Model
|
||||
$this->db->from('T_Asset_Details asd');
|
||||
$this->db->join('T_DepartmentDetails dep', ' dep.DEPCode = asd.DEPCode','left');
|
||||
$this->db->join ('T_SupplierDetailsN sup','sup.SupplierID = asd.SupplierCode','left');
|
||||
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
$result = $query->result();
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To get the actived department information
|
||||
* @param $Department : Optional : To get department code
|
||||
* @return $query->result() : This is result of the query (department information)
|
||||
*
|
||||
* Note : This function Temporary not in use
|
||||
*/
|
||||
|
||||
function getDepartment($Department = '')
|
||||
{
|
||||
$this->db->select('DEPCode,DepartmentName');
|
||||
$this->db->from('T_DepartmentDetails');
|
||||
$this->db->from('T_DepartmentDetails');
|
||||
$this->db->where('IsActive',1 );
|
||||
if($Department != '')
|
||||
{
|
||||
@ -39,6 +40,11 @@ class assetdetails_model extends CI_Model
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
/**
|
||||
* To get the actived supplier information
|
||||
* @param $SupplierID : Optional : To get Supplier id
|
||||
* @return $query->result() : This is result of the query (supplier information)
|
||||
*/
|
||||
function getSupplierName($SupplierID = '')
|
||||
{
|
||||
$this->db->select('SupplierID, SupplierName');
|
||||
@ -51,52 +57,89 @@ class assetdetails_model extends CI_Model
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
function getpodetails($PO){
|
||||
|
||||
|
||||
$this->db->distinct();
|
||||
}
|
||||
|
||||
/**
|
||||
* To get the MRIR Approved PO details
|
||||
* @param $PO : To get PO number from the controller
|
||||
* @return $query->result() : This is result of the query (po details)
|
||||
*/
|
||||
|
||||
function getpodetails($PO)
|
||||
{
|
||||
|
||||
$this->db->distinct();
|
||||
$this->db->select('POM.PONO,POM.SupplierID,POL.MaterialCode,DeliveryDate,PODate,sup.SupplierName,POL.LineItemNo');
|
||||
$this->db->from('T_PurchaseOrder_Master POM');
|
||||
$this->db->join('T_PurchaseOrder_LineItem POL', 'POL.PONO = POM.PONO');
|
||||
$this->db->join('T_SupplierDetailsN sup', 'sup.SupplierID = POM.SupplierID');
|
||||
$this->db->where('POM.status',MRIR_APPROVED);
|
||||
if(!empty($PO)){
|
||||
$this->db->where('POM.PONO',$PO);
|
||||
|
||||
$this->db->where('POM.PONO',$PO);
|
||||
}
|
||||
$query = $this->db->get();
|
||||
//print_r($this->db->last_query());
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* To get the MRIR Approved PO number (listed on dropdown)
|
||||
* @param $PO :Optional : To get PO number
|
||||
* @return $query->result() : This is result of the query (po no)
|
||||
*/
|
||||
function getPO($PO='')
|
||||
{
|
||||
$this->db->distinct();
|
||||
$this->db->select(' POM.PONO');//,DeliveryDate,PODate,sup.SupplierName,POM.SupplierID');
|
||||
$this->db->distinct();
|
||||
$this->db->select(' POM.PONO');
|
||||
$this->db->from('T_PurchaseOrder_Master POM');
|
||||
//$this->db->join ('T_PurchaseOrder_LineItem POL ',' POL.PONO = POM.PONO');
|
||||
//$this->db->join ('T_SupplierDetailsN sup ',' sup.SupplierID = POM.SupplierID');
|
||||
$this->db->where('POM.status',MRIR_APPROVED);
|
||||
$this->db->where('POM.POType','CAPITAL');
|
||||
$this->db->where('POM.status',MRIR_APPROVED);
|
||||
$this->db->where('POM.POType','CAPITAL');
|
||||
if(!empty($PO)){
|
||||
$this->db->where('POM.PONO',$PO);
|
||||
}
|
||||
$query = $this->db->get();
|
||||
//print_r($this->db->last_query());
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
/**
|
||||
* To get the PO lineitem details for revenue po.
|
||||
* @param $line : To get PO lineitem number from the controller
|
||||
* @return $result : This is result of the query (po lineitem no)
|
||||
*/
|
||||
function getlineitemre($line){
|
||||
$this->db->select('POL.LineItemNo,POL.MaterialCode,MM.MaterialName,MM.UOM,POL.Quantity,POM.POType,re.TotalValue,req.ReqNo,emp.firstname,emp.Departmentcode,dep.DepartmentName,sup.SupplierName,date(POM.DeliveryDate) as DeliveryDate,POM.PODate,POM.SupplierID');
|
||||
$this->db->from('T_PurchaseOrder_LineItem POL');
|
||||
$this->db->join('T_Requestion_Master req','req.ReqNo = POL.ReqNo','left');
|
||||
$this->db->join('T_PurchaseOrder_Master POM','POM.PONO=POL.PONO','left');
|
||||
$this->db->join('T_MaterialMaster MM','MM.MaterialCode = POL.MaterialCode','left');
|
||||
$this->db->join('T_Employee_Details emp','emp.EmpID = req.Requestedby','left');
|
||||
$this->db->join('T_DepartmentDetails dep','dep.DEPCode = emp.Departmentcode','left');
|
||||
$this->db->join('T_Revenue_Tax re','re.LineItemNo = POL.LineItemNo','left');
|
||||
$this->db->join('T_SupplierDetailsN sup','sup.SupplierID = POM.SupplierID','left');
|
||||
$this->db->where('POL.LineItemNo',$line);
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
$result = $query->result();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* To get the PO lineitem details for service po.
|
||||
* @param $line : To get PO lineitem number from the controller
|
||||
* @return $result : This is result of the query (po lineitem no)
|
||||
*/
|
||||
function getlineitemser($line){
|
||||
$this->db->select('POL.LineItemNo,POL.MaterialCode,MM.MaterialName,MM.UOM,POM.POType,POL.Quantity,ser.TotalValue,req.ReqNo,emp.firstname,dep.DepartmentName,emp.Departmentcode,sup.SupplierName,date(POM.DeliveryDate) as DeliveryDate,POM.PODate,POM.SupplierID');
|
||||
$this->db->from('T_PurchaseOrder_LineItem POL');
|
||||
$this->db->join('T_Requestion_Master req','req.ReqNo = POL.ReqNo','left');
|
||||
$this->db->join('T_PurchaseOrder_Master POM','POM.PONO=POL.PONO','left');
|
||||
$this->db->join ('T_MaterialMaster MM','MM.MaterialCode = POL.MaterialCode','left');
|
||||
$this->db->join('T_Employee_Details emp','emp.EmpID = req.Requestedby','left');
|
||||
$this->db->join('T_DepartmentDetails dep','dep.DEPCode = emp.Departmentcode','left');
|
||||
$this->db->join ('T_Revenue_Tax re','re.LineItemNo = POL.LineItemNo','left');
|
||||
$this->db->join('T_SupplierDetailsN sup','sup.SupplierID = POM.SupplierID','left');
|
||||
$this->db->where('POL.LineItemNo',$line);
|
||||
$this->db->join('T_Employee_Details emp','emp.EmpID = req.Requestedby','left');
|
||||
$this->db->join('T_DepartmentDetails dep','dep.DEPCode = emp.Departmentcode','left');
|
||||
$this->db->join ('T_Service_Tax ser','ser.LineItemNo = POL.LineItemNo','left');
|
||||
$this->db->join('T_SupplierDetailsN sup','sup.SupplierID = POM.SupplierID','left');
|
||||
$this->db->where('POL.LineItemNo',$line);
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
@ -104,23 +147,11 @@ class assetdetails_model extends CI_Model
|
||||
return $result;
|
||||
}
|
||||
|
||||
function getlineitemser($line){
|
||||
$this->db->select('POL.LineItemNo,POL.MaterialCode,MM.MaterialName,MM.UOM,POM.POType,POL.Quantity,ser.TotalValue,req.ReqNo,emp.firstname,dep.DepartmentName,emp.Departmentcode,sup.SupplierName,date(POM.DeliveryDate) as DeliveryDate,POM.PODate,POM.SupplierID');
|
||||
$this->db->from('T_PurchaseOrder_LineItem POL');
|
||||
$this->db->join('T_Requestion_Master req','req.ReqNo = POL.ReqNo','left');
|
||||
$this->db->join('T_PurchaseOrder_Master POM','POM.PONO=POL.PONO','left');
|
||||
$this->db->join ('T_MaterialMaster MM','MM.MaterialCode = POL.MaterialCode','left');
|
||||
$this->db->join('T_Employee_Details emp','emp.EmpID = req.Requestedby','left');
|
||||
$this->db->join('T_DepartmentDetails dep','dep.DEPCode = emp.Departmentcode','left');
|
||||
$this->db->join ('T_Service_Tax ser','ser.LineItemNo = POL.LineItemNo','left');
|
||||
$this->db->join('T_SupplierDetailsN sup','sup.SupplierID = POM.SupplierID','left');
|
||||
$this->db->where('POL.LineItemNo',$line);
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
$result = $query->result();
|
||||
return $result;
|
||||
}
|
||||
/**
|
||||
* To get the PO lineitem details for import po.
|
||||
* @param $line : To get PO lineitem number from the controller
|
||||
* @return $result : This is result of the query (po lineitem no)
|
||||
*/
|
||||
function getlineitemimport($line){
|
||||
$this->db->select('POL.LineItemNo,POL.MaterialCode,MM.MaterialName,MM.UOM,POM.POType,POL.Quantity,ser.TotalValue,req.ReqNo,emp.firstname,dep.DepartmentName,emp.Departmentcode,sup.SupplierName,date(POM.DeliveryDate) as DeliveryDate,POM.PODate,POM.SupplierID');
|
||||
$this->db->from('T_PurchaseOrder_LineItem POL');
|
||||
@ -139,6 +170,11 @@ class assetdetails_model extends CI_Model
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* To get the PO lineitem details for capital po.
|
||||
* @param $line : To get PO lineitem number from the controller
|
||||
* @return $result : This is result of the query (po lineitem no)
|
||||
*/
|
||||
function getlineitemcap($line){
|
||||
|
||||
$sql="SELECT POL.LineItemNo,POL.MaterialCode,MM.MaterialName,MM.UOM,POM.POType,POL.Quantity,sum(coalesce(ser.TotalValue,0) + coalesce((POL.Quantity*POL.Rate*POM.ExchangeRate),0)) as TotalValue,req.ReqNo,emp.firstname,dep.DepartmentName,emp.Departmentcode,sup.SupplierName,date(POM.DeliveryDate) as DeliveryDate,POM.PODate,POM.SupplierID
|
||||
@ -156,6 +192,12 @@ class assetdetails_model extends CI_Model
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* To get the PO lineitem details revalant po.
|
||||
* @param $type : To get PO type from the controller
|
||||
* @return $result : This is result of the query (po lineitem no)
|
||||
*/
|
||||
function gettyp($type)
|
||||
{
|
||||
$this->db->select('POM.POType,POL.LineItemNo');
|
||||
@ -167,9 +209,12 @@ class assetdetails_model extends CI_Model
|
||||
$result = $query->result();
|
||||
return $result;
|
||||
}
|
||||
/**
|
||||
* This function is used to get the Config value from configuration table
|
||||
* @return array $result : This is result of the query
|
||||
|
||||
/**
|
||||
* To get the Config value from configuration table
|
||||
* @param $ConfigID : To get Configid from the controller
|
||||
* @param $ConfigValue : Optional : To get PO type
|
||||
* @return array $query->result() : This is result of the query(config details)
|
||||
*/
|
||||
function getConfigValue($ConfigID ,$ConfigValue = '')
|
||||
{
|
||||
@ -187,61 +232,69 @@ class assetdetails_model extends CI_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* This function used to get user information by id
|
||||
* @param number $userId : This is user id
|
||||
* @return array $result : This is user information
|
||||
* To Store the values
|
||||
* @param number $asset : To get all the information of asset from the controller
|
||||
* @return $Asset_Code : This will return how many value are inserted (return as number/count)
|
||||
*/
|
||||
|
||||
function addNewasset($asset)
|
||||
function addNewasset($asset)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
$this->db->insert('T_Asset_Details', $asset);
|
||||
|
||||
//$Asset_Code = $this->db->insert_id();
|
||||
$Asset_Code = $this->db->affected_rows();
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
return $Asset_Code;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function used to get Asset details by Asset Code
|
||||
* @param number $Asset_Code : This is AssetCode
|
||||
* @return array $result : This is Asset information
|
||||
* To get Asset details on respective Asset Code
|
||||
* @param number $Asset_Code : To get asset code from the controller
|
||||
* @return array $query->result() : This is result of the query(asset data)
|
||||
*/
|
||||
function getAssetDetails($Asset_Code)
|
||||
{
|
||||
//echo $Asset_Code;
|
||||
$this->db->select('Asset.*,POM.DeliveryDate,Dep.DepartmentName as DepartmentName,MM.MaterialName,MM.UOM,Supp.SupplierName as SupplierName');
|
||||
$this->db->from('T_Asset_Details Asset');
|
||||
$this->db->join('T_DepartmentDetails Dep', 'Asset.DEPCode = Dep.DEPCode','left');
|
||||
$this->db->join('T_SupplierDetailsN Supp', 'Asset.SupplierCode = Supp.SupplierID','left');
|
||||
$this->db->join('T_MaterialMaster MM ', 'MM.MaterialCode = Asset.MaterialCode','left');
|
||||
$this->db->join('T_PurchaseOrder_Master POM','POM.PONO = Asset.PONO','left');
|
||||
$this->db->join('T_DepartmentDetails Dep', 'Asset.DEPCode = Dep.DEPCode','left');
|
||||
$this->db->join('T_SupplierDetailsN Supp', 'Asset.SupplierCode = Supp.SupplierID','left');
|
||||
$this->db->join('T_MaterialMaster MM ', 'MM.MaterialCode = Asset.MaterialCode','left');
|
||||
$this->db->join('T_PurchaseOrder_Master POM','POM.PONO = Asset.PONO','left');
|
||||
$this->db->where('Asset.AssetCode', $Asset_Code);
|
||||
|
||||
|
||||
$query = $this->db->get();
|
||||
//print_r($this->db->last_query());
|
||||
return $query->result();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To Stored edited Asset details in respective Asset Code
|
||||
* @param number $asset : To get all the information of asset from the controller
|
||||
* @param number $Asset_Code : To get asset code from the controller
|
||||
*/
|
||||
function editasset($asset, $Asset_Code)
|
||||
{
|
||||
$this->db->where('AssetCode', $Asset_Code);
|
||||
$this->db->update('T_Asset_Details', $asset);
|
||||
//print_r($this->db->last_query());
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To Stored edited Asset details in respective Asset Code
|
||||
* @param number $asset : To get all the information of asset from the controller
|
||||
* @param number $Asset_Code : To get asset code from the controller
|
||||
*
|
||||
* Note : This function Temporary not in use
|
||||
*/
|
||||
function viewasset($asset, $Asset_Code)
|
||||
{
|
||||
$this->db->where('AssetCode', $Asset_Code);
|
||||
$this->db->update('T_Asset_Details', $asset);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To get Asset's information for export xl
|
||||
*/
|
||||
function export_excel(){
|
||||
|
||||
$this->db->select('det.*,dep.DepartmentName as DEPCode,sup.SupplierName,MM.MaterialName,emp.firstname,emp1.firstname as Updated_By');
|
||||
|
||||
@ -2,13 +2,11 @@
|
||||
|
||||
class companydetailsmodel extends CI_Model
|
||||
{
|
||||
/**
|
||||
* This function is used to get the user listing count
|
||||
* @param string $searchText : This is optional search text
|
||||
* @return number $count : This is row count
|
||||
/**
|
||||
* To Store the values
|
||||
* @param number $Company : To get all the information of company
|
||||
* @return $CompID : This will return how many value are inserted (return as number/count)
|
||||
*/
|
||||
|
||||
//inserted data into companydetails table//
|
||||
function Companyadd($Company)
|
||||
{
|
||||
$this->db->insert('T_Company_Details', $Company);
|
||||
@ -16,8 +14,11 @@ class companydetailsmodel extends CI_Model
|
||||
return $Company;
|
||||
}
|
||||
|
||||
|
||||
//inserted data into file table//
|
||||
/**
|
||||
* To Store the values
|
||||
* @param number $myfile : To get all the information of company's file
|
||||
* @return $CompID : This will return how many value are inserted (return as number/count)
|
||||
*/
|
||||
function filedetails($myfile)
|
||||
{
|
||||
$this->db->insert('file',$myfile);
|
||||
@ -26,7 +27,10 @@ class companydetailsmodel extends CI_Model
|
||||
}
|
||||
|
||||
|
||||
//for listing file//
|
||||
/**
|
||||
* To get the company files for listing
|
||||
* @return array $query->result() : This is result of the query (company files's information)
|
||||
*/
|
||||
function filelist()
|
||||
{
|
||||
$sql=" select ID,filename,filedescription,createdDate from file where isDeleted IS NULL OR isDeleted=0";
|
||||
@ -35,7 +39,12 @@ class companydetailsmodel extends CI_Model
|
||||
}
|
||||
|
||||
|
||||
//for deleting file//
|
||||
/**
|
||||
* To update the company files as inactive(if deleted means)
|
||||
* @param number $ID :
|
||||
* @param number $userInfo : To get all the information of company's files
|
||||
* @return array $this->db->affected_rows() : This will return how many value are changed (return as number/count)
|
||||
*/
|
||||
function deletefile($ID,$userInfo)
|
||||
{
|
||||
$this->db->where('ID', $ID);
|
||||
@ -44,7 +53,13 @@ class companydetailsmodel extends CI_Model
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* To update the company related information
|
||||
* @param number $compID :
|
||||
* @param number $Comp : To get all the information of company's files
|
||||
* @return array $this->db->affected_rows() : This will return how many value are changed (return as number/count)
|
||||
*/
|
||||
|
||||
function Updatecompany($Comp, $CompID)
|
||||
{
|
||||
$this->db->where('CompID', $CompID);
|
||||
|
||||
226
application/models/quality_model.php
Normal file
226
application/models/quality_model.php
Normal file
@ -0,0 +1,226 @@
|
||||
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Quality_model extends CI_Model
|
||||
{
|
||||
function getAllInvoiceNo()
|
||||
{
|
||||
$this->db->select('invoice_number');
|
||||
$this->db->from('ip_invoices');
|
||||
$result = $this->db->get();
|
||||
return $result->result();
|
||||
}
|
||||
|
||||
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 checkExist($product,$customer,$name)
|
||||
{
|
||||
$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);
|
||||
$result = $this->db->get();
|
||||
return $result->result();
|
||||
}
|
||||
|
||||
|
||||
function addSpecMast($data)
|
||||
{
|
||||
//print_r($data);
|
||||
$this->db->insert('T_Prodcut_Specification_Master',$data);
|
||||
$r = $this->db->affected_rows();
|
||||
return $r;
|
||||
}
|
||||
|
||||
function updateSpecMast($data,$product,$customer,$name)
|
||||
{
|
||||
//echo $product.$customer.$name;
|
||||
//print_r($data);
|
||||
$this->db->where('product_id',$product);
|
||||
$this->db->where('customer_id',$customer);
|
||||
$this->db->where('testtype',$name);
|
||||
$this->db->update('T_Prodcut_Specification_Master',$data);
|
||||
$r = $this->db->affected_rows();
|
||||
//echo $r;die();
|
||||
return $r;
|
||||
}
|
||||
|
||||
function getAllspec()
|
||||
{
|
||||
$this->db->select('T_Prodcut_Specification_Master.*,ip_products.product_name,ip_products.product_description,ip_clients.client_name,count(*) as count');
|
||||
$this->db->from('T_Prodcut_Specification_Master');
|
||||
$this->db->join('ip_products','T_Prodcut_Specification_Master.product_id=ip_products.product_id');
|
||||
$this->db->join('ip_clients','T_Prodcut_Specification_Master.customer_id=ip_clients.client_id');
|
||||
$this->db->group_by('product_id,customer_id');
|
||||
$result = $this->db->get();
|
||||
return $result->result();
|
||||
}
|
||||
|
||||
|
||||
function getIndividualSpec($prodcutid,$customerid)
|
||||
{
|
||||
$this->db->select('T_Prodcut_Specification_Master.*,ip_products.product_name,ip_products.product_description,ip_clients.client_name');
|
||||
$this->db->from('T_Prodcut_Specification_Master');
|
||||
$this->db->join('ip_products','T_Prodcut_Specification_Master.product_id=ip_products.product_id');
|
||||
$this->db->join('ip_clients','T_Prodcut_Specification_Master.customer_id=ip_clients.client_id');
|
||||
$this->db->where('T_Prodcut_Specification_Master.product_id',$prodcutid);
|
||||
$this->db->where('T_Prodcut_Specification_Master.customer_id',$customerid);
|
||||
$result = $this->db->get();
|
||||
return $result->result();
|
||||
}
|
||||
|
||||
|
||||
function deleteSpecification($spname,$product,$customer)
|
||||
{
|
||||
$this->db->where("testtype", $spname);
|
||||
$this->db->where("product_id", $product);
|
||||
$this->db->where("customer_id", $customer);
|
||||
$this->db->delete('T_Prodcut_Specification_Master');
|
||||
$r = $this->db->affected_rows();
|
||||
return $r;
|
||||
}
|
||||
|
||||
|
||||
function getDataforReport()
|
||||
{
|
||||
$this->db->select('ip_invoices.invoice_number,ip_invoices.client_id,ip_invoice_custom.invoice_custom_fieldvalue,ip_clients.client_name,ip_invoices.invoice_date_created,ip_invoice_items.item_product_id,ip_products.product_name,ip_products.product_description,ip_invoice_items.item_quantity');
|
||||
$this->db->from('ip_invoices');
|
||||
$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_invoice_items.item_product_id=ip_products.product_id');
|
||||
$this->db->join('ip_invoice_custom','ip_invoices.invoice_id=ip_invoice_custom.invoice_id and invoice_custom_fieldid=62');
|
||||
$this->db->where('ip_invoices.invoice_number NOT IN (SELECT invoiceid from T_Test_Report_Master)',NULL,false);
|
||||
$this->db->order_by('ip_invoices.invoice_number','desc');
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
function getSpecifications($productid,$customerid)
|
||||
{
|
||||
$this->db->where('product_id',$productid);
|
||||
$this->db->where('customer_id',$customerid);
|
||||
$res = $this->db->get('T_Prodcut_Specification_Master');
|
||||
return $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_Test_Report_Master',$masterreportdata);
|
||||
$id = $this->db->insert_id();
|
||||
return $id;
|
||||
}
|
||||
|
||||
function saveTestReportData($testreportdata)
|
||||
{
|
||||
$this->db->insert('T_Test_Report',$testreportdata);
|
||||
$row = $this->db->affected_rows();
|
||||
return $row;
|
||||
}
|
||||
|
||||
function saveTestReportAFSData($afstabledata)
|
||||
{
|
||||
$this->db->insert('T_Test_Report_AFS',$afstabledata);
|
||||
$row = $this->db->affected_rows();
|
||||
return $row;
|
||||
}
|
||||
|
||||
function saveTestReportLOIData($loitabledata)
|
||||
{
|
||||
$this->db->insert('T_Test_Report_LOI',$loitabledata);
|
||||
$row = $this->db->affected_rows();
|
||||
return $row;
|
||||
}
|
||||
|
||||
function getIndividualReportData($reportid)
|
||||
{
|
||||
|
||||
$this->db->select('T_Test_Report_Master.testreport_id,ip_invoices.invoice_date_created,T_Test_Report_Master.invoiceid,T_Test_Report_Master.batchdate,T_Test_Report_Master.chartdata,ip_clients.client_id,ip_clients.client_name,invoice_custom_fieldvalue,ip_products.product_id,ip_products.product_name,ip_products.product_description,T_Employee_Details.FirstName,T_Employee_Details.LastName,ip_invoice_items.item_quantity,T_Test_Report_Master.approvedby');
|
||||
$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->join('ip_invoice_custom','ip_invoices.invoice_id=ip_invoice_custom.invoice_id and invoice_custom_fieldid=62');
|
||||
$this->db->join('tbl_users','T_Test_Report_Master.createdby=tbl_users.userid');
|
||||
$this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID');
|
||||
//$this->db->join('T_Employee_Details','T_Test_Report_Master.EmpID=T_Employee_Details.EmpID');
|
||||
//$this->db->join('ip_invoice_custom','ip_invoices.invoice_number=ip_invoice_custom.invoice_number and invoice_custom_fieldid=62');
|
||||
$this->db->where('testreport_id',$reportid);
|
||||
// $this->db->join('T_Test_Report','T_Test_Report_Master.testreport_id=T_Test_Report.testreport_id');
|
||||
// $this->db->join('T_Test_Report_loi','T_Test_Report_Master.testreport_id=T_Test_Report_loi.testreport_id');
|
||||
// $this->db->join('T_Test_Report_afs','T_Test_Report_Master.testreport_id=T_Test_Report_afs.testreport_id');
|
||||
|
||||
$res = $this->db->get();
|
||||
$reportdata['master'] = $res->result();
|
||||
|
||||
$this->db->select('T_Test_Report.*');
|
||||
$this->db->from('T_Test_Report');
|
||||
$this->db->where('testreport_id',$reportid);
|
||||
$res1 = $this->db->get();
|
||||
$reportdata['masterreport'] = $res1->result();
|
||||
|
||||
$this->db->select('T_Test_Report_LOI.*');
|
||||
$this->db->from('T_Test_Report_LOI');
|
||||
$this->db->where('testreport_id',$reportid);
|
||||
$res1 = $this->db->get();
|
||||
$reportdata['masterreportloi'] = $res1->result();
|
||||
|
||||
$this->db->select('T_Test_Report_AFS.*');
|
||||
$this->db->from('T_Test_Report_AFS');
|
||||
$this->db->where('testreport_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,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');
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -3,11 +3,8 @@
|
||||
class supplier_model extends CI_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* This function is used to get the user listing count
|
||||
* @param string $searchText : This is optional search text
|
||||
* @param number $page : This is pagination offset
|
||||
* @param number $segment : This is pagination limit
|
||||
/**
|
||||
* To get the Supplier Information for listing
|
||||
* @return array $result : This is result
|
||||
*/
|
||||
function supplierListing()
|
||||
@ -15,20 +12,17 @@ class supplier_model extends CI_Model
|
||||
$this->db->select('BaseT.SupplierID, BaseT.SupplierName, BaseT.Address, BaseT.ContactNumber, BaseT.AlternateContactNumber,BaseT.EmailAddress,BaseT.Exiseregistration, BaseT.TIN, BaseT.PAN,,BaseT.GSTNO,BaseT.GSTRange,BaseT.CollectrateAddress,BaseT.UANumber,BaseT.CreatedOn,BaseT.PaymentID,pmt.PaymentTerms,BaseT.CSTDate');//,BaseT.PaymentTerms,BaseT.PaymentDays,BaseT.PayableAT,pmt.Details');
|
||||
$this->db->from('T_SupplierDetailsN as BaseT');
|
||||
$this->db->join('T_PaymentTerms as pmt', 'pmt.PaymentID = BaseT.PaymentID','left');
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
$result = $query->result();
|
||||
return $result;
|
||||
}
|
||||
/**
|
||||
* This function used to get user information by id
|
||||
* @param number $userId : This is user id
|
||||
* @return array $result : This is user information
|
||||
|
||||
/**
|
||||
* To get Config information by config id and config value
|
||||
* @param number $Configvalue :Optional : To get config value
|
||||
* @return $query->result() : This is result of the query (config information)
|
||||
*/
|
||||
|
||||
|
||||
function getpayment($Configvalue = '')
|
||||
function getpayment($Configvalue = '')
|
||||
{
|
||||
$ConfigID = 'C009';
|
||||
$this->db->select('ConfigValue');
|
||||
@ -39,37 +33,51 @@ class supplier_model extends CI_Model
|
||||
$this->db->where('ConfigValue !=',$Configvalue );
|
||||
}
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function getPaymentTerms($payment = '')
|
||||
/**
|
||||
* To get Payment information
|
||||
* @param number $payment :Optional : To get payment value
|
||||
* @return array $result : This is result of the query(payment information)
|
||||
*/
|
||||
function getPaymentTerms($payment = '')
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('T_PaymentTerms');
|
||||
$query = $this->db->get();
|
||||
$result = $query->result();
|
||||
return $result;
|
||||
$query = $this->db->get();
|
||||
$result = $query->result();
|
||||
return $result;
|
||||
}
|
||||
|
||||
function checkPAN($PAN,$SID = '')
|
||||
/**
|
||||
* To Check PAN number is already exists are not
|
||||
* @param number $SID : Optional:To get Supplier ID
|
||||
* @param number $PAN : To get PAN number from the controller - for check purpose if already exists are not
|
||||
* @return $query->result_array() : This is result of the query (PAN Number information based on supplier ID)
|
||||
*/
|
||||
function checkPAN($PAN,$SID = '')
|
||||
{
|
||||
$this->db->select('PAN');
|
||||
$this->db->from('T_SupplierDetailsN');
|
||||
$this->db->where('PAN',$PAN);
|
||||
if ($SID != '')
|
||||
if ($SID != '')
|
||||
{
|
||||
$this->db->where('SupplierID !=',$SID);
|
||||
}
|
||||
$query = $this->db->get();
|
||||
//print_r($this->db->last_query());
|
||||
if ($query->num_rows > 0) {
|
||||
//echo $result->num_rows;
|
||||
return $query->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* To Check GST number is already exists are not
|
||||
* @param number $SID :Optional: To get Supplier ID
|
||||
* @param number $GST : To get GST number from the controller - for check purpose if already exists are not
|
||||
* @return $query->result_array() : This is result of the query (This is GST Number information based on supplier ID)
|
||||
*/
|
||||
function checkGST($GST,$SID = '')
|
||||
{
|
||||
$this->db->select('GSTNO');
|
||||
@ -80,50 +88,44 @@ class supplier_model extends CI_Model
|
||||
$this->db->where('SupplierID !=',$SID);
|
||||
}
|
||||
$query = $this->db->get();
|
||||
//print_r($this->db->last_query());
|
||||
if ($query->num_rows > 0) {
|
||||
// echo $query->num_rows;
|
||||
return $query->result_array();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function addNewsupplier($supplier)
|
||||
/**
|
||||
* To Store the values
|
||||
* @param number $supplier : To get all the information of Supplier from the controller
|
||||
* @return $SID : This will return how many value are inserted (return as number/count)
|
||||
*/
|
||||
function addNewsupplier($supplier)
|
||||
{
|
||||
|
||||
$this->db->insert('T_SupplierDetailsN', $supplier);
|
||||
$SID = $this->db->affected_rows();
|
||||
|
||||
// if($SID>0)
|
||||
// {
|
||||
// $subQuery = 'select max(SupplierID) as suppid from T_SupplierDetailsN';
|
||||
// $query = $this->db->query($subQuery);
|
||||
// return $query->result();
|
||||
// }
|
||||
return $SID;
|
||||
|
||||
$SID = $this->db->affected_rows();
|
||||
return $SID;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function used to get user information by id
|
||||
* @param number $userId : This is user id
|
||||
* @return array $result : This is user information
|
||||
* To get Supplier information on respective supplier id
|
||||
* @param number $supplierID : Optional : To get Supplier ID
|
||||
* @return $query->result() : This is result of the query
|
||||
*/
|
||||
function getSupplierInfo($supplierID='')
|
||||
{
|
||||
{
|
||||
$this->db->select('SD.*,PT.PaymentTerms');
|
||||
//$this->db->select('SD.SupplierID, SD.SupplierName, SD.Address, SD.ContactNumber, SD.AlternateContactNumber, SD.EmailAddress, SD.Exiseregistration, SD.TIN, SD.PAN, SD.CSTNO, SD.CSTDate, SD.GSTNO, SD.GSTRange, SD.CollectrateAddress, SD.UANumber, SD.Cert_EMS, SD.Cert_TS, SD.Cert_IMS, SD.Cert_ISO, SD.Cert_OSHAS, SD.BankAcNumber, SD.IsService, SD.IsMaintanance, SD.IsRawMaterial, SD.IFSCCode, SD.BranchName, SD.BankAddress, SD.IsActive, SD.PaymentID,PT.PaymentTerms');
|
||||
$this->db->from('T_SupplierDetailsN SD');
|
||||
$this->db->join('T_PaymentTerms PT','PT.PaymentID = SD.PaymentID','left');
|
||||
$this->db->where('SD.SupplierID', $supplierID);
|
||||
$query = $this->db->get();
|
||||
// print_r($this->db->last_query());
|
||||
return $query->result();
|
||||
}
|
||||
/* This function to get the Supplier Address on respective Supplier ID */
|
||||
|
||||
/**
|
||||
* To get the Supplier Address on respective Supplier ID
|
||||
* @param number $supplierID : To get Supplier ID from the controller
|
||||
* @return $query->result_array() : This is result of the query (Supplier's address information)
|
||||
*/
|
||||
function GetSupplierAddress($supplierID)
|
||||
{
|
||||
$this->db->select('Address');
|
||||
@ -132,37 +134,49 @@ function addNewsupplier($supplier)
|
||||
$query = $this->db->get();
|
||||
return $query->result_array();
|
||||
}
|
||||
|
||||
/**
|
||||
* To Update the values of supplier on respective Supplier ID
|
||||
* @param number $supplier : To get all the information of Supplier from the controller
|
||||
* @param number $supplierID : To get Supplier ID from the controller
|
||||
*/
|
||||
function UpdateSupplier($supplier, $supplierID)
|
||||
{
|
||||
$this->db->where('SupplierID', $supplierID);
|
||||
$this->db->update('T_SupplierDetailsN', $supplier);
|
||||
|
||||
|
||||
|
||||
|
||||
$this->db->update('T_SupplierDetailsN', $supplier);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* To updated the Supplier information
|
||||
* @param number $supplier : To get all the information of Supplier from the controller
|
||||
* @param number $supplierID : To get Supplier ID from the controller
|
||||
*
|
||||
* Note : This function Temporary not in use
|
||||
*/
|
||||
function viewsupplier($supplier, $supplierID)
|
||||
{
|
||||
$this->db->where('SupplierID', $supplierID);
|
||||
$this->db->update('T_SupplierDetailsN', $supplier);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* To store the Supplier Certificate details
|
||||
* @param number $cerificate : To get all the information of cerficate from the controller
|
||||
*
|
||||
* Note : This function Temporary not in use
|
||||
*/
|
||||
function SupplierCertification($cerificate)
|
||||
{
|
||||
$this->db->insert_id('T_Supplier_Certification',$cerificate);
|
||||
$insert_id = $this->db->affected_rows();
|
||||
|
||||
return $insert_id;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* To get Supplier's information for export xl
|
||||
*/
|
||||
function export_excel(){
|
||||
|
||||
$this->db->select('det.SupplierID,SupplierName,det.Address,det.ContactNumber,det.AlternateContactNumber,det.EmailAddress,det.Exiseregistration,det.TIN,
|
||||
@ -175,11 +189,6 @@ function addNewsupplier($supplier)
|
||||
$this->db->join('T_Employee_Details as emp1', 'emp1.empid=tbl1.empid','left');
|
||||
$this->db->join('T_PaymentTerms as pmt', 'pmt.PaymentID = det.PaymentID','left');
|
||||
return $this->db->get('T_SupplierDetailsN as det')->result_array();
|
||||
}
|
||||
|
||||
|
||||
/*SUPPLIER */
|
||||
/*SUPPLIER TYPE */
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -563,6 +563,22 @@ $(function() {
|
||||
<span>View Material Inspection Report</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>quality">
|
||||
<i class="fa fa-list-alt"></i>
|
||||
<span>Product Test Specification Master</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>qualityreportlist">
|
||||
<i class="fa fa-table"></i>
|
||||
<span>Product Test Report</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
315
application/views/qualitymaster.php
Normal file
315
application/views/qualitymaster.php
Normal file
@ -0,0 +1,315 @@
|
||||
|
||||
<style>
|
||||
th{
|
||||
text-align:center ! important;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
//print_r($products);
|
||||
|
||||
|
||||
|
||||
$products2=array(-1=>'Select Products');
|
||||
|
||||
foreach($products as $product)
|
||||
{
|
||||
$products2[$product->product_id] =$product->product_id.'-'.$product->product_name.'-'.$product->product_description;
|
||||
}
|
||||
|
||||
$customers2 = array(-1 => 'Select Customer');
|
||||
foreach($customers as $customer)
|
||||
{
|
||||
$customers2[$customer->client_id] = $customer->client_name;
|
||||
}
|
||||
?>
|
||||
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
|
||||
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center>Product Test Specification Master Screen</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">-->
|
||||
|
||||
|
||||
</form>
|
||||
</div><!--</h3></center>-->
|
||||
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
|
||||
<div class="box-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?php echo form_dropdown('name="product"',$products2,set_value('product',$products2[-1]),'id="product"' ,'class="form-control select2');?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<?php echo form_dropdown('name="customer"',$customers2,set_value('customer',$customers2[-1]),'id="customer"' ,'class="form-control select2');?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<input type="button" id="addspec" class="btn btn-primary" value = "Add New Specification">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br/>
|
||||
<table id="testspecifications" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
<th>UOM</th>
|
||||
<th>Min</th>
|
||||
<th>Max</th>
|
||||
<th>Temp</th>
|
||||
<th>Action</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="specAppend">
|
||||
<?php
|
||||
if(!empty($existspec))
|
||||
{
|
||||
foreach($existspec as $data)
|
||||
{
|
||||
?>
|
||||
<!-- <tr> <td><?php echo $data->testtype?></td> <td contenteditable="true"><?php echo $data->uom?></td> <td contenteditable="true"><?php echo $data->min?></td> <td contenteditable="true"><?php echo $data->max?></td></tr> -->
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p> </p>
|
||||
<div class="row">
|
||||
<div class="col-md-3" id="savebutton">
|
||||
<input type="button" id="submit" value = "Save" class="btn btn-primary" onclick="getAllData();">
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
<!-- <div class="box-footer clearfix">
|
||||
|
||||
</div> -->
|
||||
</div><!-- /.box -->
|
||||
|
||||
<div id="specmodel" 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">×</button>
|
||||
<h4 class="modal-title">Add New Specification</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<center>
|
||||
<table >
|
||||
<tr>
|
||||
<td style="text-align:center;padding:10px;">Specification Name</td><td style="padding:10px;"><input type="text" name="spname" id="spname"/> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;padding:10px;">UOM</td><td style="padding:10px;"><input type="text" name="uom" id="uom"/> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;padding:10px;">Min</td><td style="padding:10px;"><input type="text" name="min`" id="min"/> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;padding:10px;;">Max</td><td style="padding:10px;"><input type="text" name="max" id="max"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;padding:10px;;">Temp</td><td style="padding:10px;"><input type="text" name="temp" id="temp"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
<button class="btn btn-primary" ID="addNewRow" onclick="addNewRow();" style="margin-top:-10px;">OK</button>
|
||||
<button class="btn btn-primary" data-dismiss="modal" style="margin-top: -10px;" value="Cancel">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
$('#monthlylisting').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"aaSorting": [[ 0, "asc" ]],
|
||||
"info": true,
|
||||
"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="false"><a data-target='#specmodel' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#specmodel"> </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>
|
||||
|
||||
<script>
|
||||
$('#addspec').click(function(){
|
||||
|
||||
var product = $('#product').val();
|
||||
var customer = $('#customer').val();
|
||||
if(product == -1 || customer == -1)
|
||||
{
|
||||
alert('Please Select Product and Customer.');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#specmodel').modal('show');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
function addNewRow()
|
||||
{
|
||||
var sname = $('#spname').val();
|
||||
sname = sname.toUpperCase();
|
||||
var uom = $('#uom').val();
|
||||
var min = $('#min').val();
|
||||
var max = $('#max').val();
|
||||
var temp = $('#temp').val();
|
||||
|
||||
if(sname == '' || uom =='' || min == '' || max == '' || temp == '')
|
||||
{
|
||||
alert('Please Enter all specification');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
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}));
|
||||
|
||||
$('#spname').val('');
|
||||
$('#uom').val('');
|
||||
$('#min').val('');
|
||||
$('#max').val('');
|
||||
$('#temp').val('');
|
||||
document.getElementById('spname').focus();
|
||||
}
|
||||
}
|
||||
|
||||
$("#specmodel").on("shown.bs.modal", function(e) {
|
||||
|
||||
document.getElementById('spname').focus();
|
||||
|
||||
});
|
||||
|
||||
function getAllData()
|
||||
{
|
||||
|
||||
var alldata = $("#testspecifications").tableToJSON();
|
||||
//alert(JSON.stringify(alldata));
|
||||
alldata=JSON.stringify(alldata)
|
||||
var product = $('#product').val();
|
||||
var customer = $('#customer').val();
|
||||
if(product == -1 || customer == -1)
|
||||
{
|
||||
alert('Please Select Product and Customer.');
|
||||
}
|
||||
else{
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:{param1:alldata,param2:product,param3:customer},
|
||||
//dataType:"json",
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>quality/saveSpectficationData",
|
||||
success:function(data) {
|
||||
if(data)
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
alert(data);
|
||||
//console.log(data);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function DeleteRow(rowid)
|
||||
{
|
||||
var product = $('#product').val();
|
||||
var customer = $('#customer').val();
|
||||
if(product == -1 || customer == -1)
|
||||
{
|
||||
alert('Please Select Product and Customer.');
|
||||
}
|
||||
else{
|
||||
var rowid = rowid;
|
||||
var d='';
|
||||
|
||||
var Row = $('#testspecifications').find('tr').eq(rowid).find('td');
|
||||
$.each(Row,function(index,value){
|
||||
if(index == 0 ){
|
||||
|
||||
d = value.textContent
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:{param1:d,param2:product,param3:customer},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>quality/deleteSpecification",
|
||||
|
||||
success:function(data){
|
||||
$('#content').loader('hide');
|
||||
alert(data);
|
||||
}
|
||||
|
||||
});
|
||||
//rowid.parentNode.removeChild(rowid);
|
||||
$('#testspecifications').find('tr').eq(rowid).remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
293
application/views/qualitymasterlistview.php
Normal file
293
application/views/qualitymasterlistview.php
Normal file
@ -0,0 +1,293 @@
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
//print_r($existspec);
|
||||
|
||||
?>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center>Product Test Specification 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().'quality/addNewPage';?> " type="button" class="btn btn-primary">Add New</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div><!--</h3></center>-->
|
||||
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
|
||||
<div class="box-body">
|
||||
|
||||
<!-- <div class="row">
|
||||
<div class="col-md-3">
|
||||
<?php echo form_dropdown('name="product"',$products2,set_value('product',$products2[-1]),'id="product"' ,'class="form-control select2');?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<?php echo form_dropdown('name="customer"',$customers2,set_value('customer',$customers2[-1]),'id="customer"' ,'class="form-control select2');?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<input type="button" id="addspec" class="btn btn-primary" value = "Add New Specification">
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
<br/>
|
||||
<table id="testspecifications" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
|
||||
<th>Product Name</th>
|
||||
<th>Company Name</th>
|
||||
<th>Total Specification</th>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="specAppend">
|
||||
<?php
|
||||
if(!empty($existspec))
|
||||
{
|
||||
foreach($existspec as $data)
|
||||
{
|
||||
|
||||
//print_r($data);echo "</br></br>";
|
||||
?>
|
||||
<tr> <td><a href="<?php echo base_url()?>quality/viewSpec/<?php echo $data->product_id.'/'.$data->customer_id ?>"><?php echo $data->product_name.'-'.$data->product_description?></a></td> <td><a href="<?php echo base_url()?>quality/viewSpec/<?php echo $data->product_id.'/'.$data->customer_id ?>"><?php echo $data->client_name?></a></td> <td><?php echo $data->count?></td></tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p> </p>
|
||||
<div class="row">
|
||||
<div class="col-md-3" id="savebutton">
|
||||
<input type="button" id="submit" value = "Save" class="btn btn-primary" onclick="getAllData();">
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
<!-- <div class="box-footer clearfix">
|
||||
|
||||
</div> -->
|
||||
</div><!-- /.box -->
|
||||
|
||||
<div id="specmodel" 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">×</button>
|
||||
<h4 class="modal-title">Add New Specification</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<center>
|
||||
<table >
|
||||
<tr>
|
||||
<td style="text-align:center;padding:10px;">Specification Name</td><td style="padding:10px;"><input type="text" name="spname" id="spname"/> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;padding:10px;">UOM</td><td style="padding:10px;"><input type="text" name="uom" id="uom"/> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;padding:10px;">Min</td><td style="padding:10px;"><input type="text" name="min`" id="min"/> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;padding:10px;;">Max</td><td style="padding:10px;"><input type="text" name="max" id="max"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
<a class="btn btn-primary" ID="addNewRow" onclick="addNewRow();" style="margin-top: -24px;"> <span class="bold">Ok</span></a>
|
||||
<a class="btn btn-primary" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</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
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</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="center" contenteditable="false"><a data-target='#specmodel' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#specmodel"> </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>
|
||||
|
||||
<script>
|
||||
$('#addspec').click(function(){
|
||||
|
||||
var product = $('#product').val();
|
||||
var customer = $('#customer').val();
|
||||
if(product == -1 || customer == -1)
|
||||
{
|
||||
alert('Please Select Product and Customer.');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#specmodel').modal('show');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
function addNewRow()
|
||||
{
|
||||
var sname = $('#spname').val();
|
||||
sname = sname.toUpperCase();
|
||||
var uom = $('#uom').val();
|
||||
var min = $('#min').val();
|
||||
var max = $('#max').val();
|
||||
|
||||
if(sname == '' || uom =='' || min == '' || max == '')
|
||||
{
|
||||
alert('Please Enter all specification');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
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}));
|
||||
|
||||
$('#spname').val('');
|
||||
$('#uom').val('');
|
||||
$('#min').val('');
|
||||
$('#max').val('');
|
||||
}
|
||||
}
|
||||
|
||||
$("#specmodel").on("shown.bs.modal", function(e) {
|
||||
|
||||
// userid = $(e.relatedTarget).data('userid');
|
||||
|
||||
// var tr= document.getElementById(userid);
|
||||
// var cellval = tr.cells;
|
||||
|
||||
});
|
||||
|
||||
function getAllData()
|
||||
{
|
||||
|
||||
var alldata = $("#testspecifications").tableToJSON();
|
||||
//alert(JSON.stringify(alldata));
|
||||
alldata=JSON.stringify(alldata)
|
||||
var product = $('#product').val();
|
||||
var customer = $('#customer').val();
|
||||
if(product == -1 || customer == -1)
|
||||
{
|
||||
alert('Please Select Product and Customer.');
|
||||
}
|
||||
else{
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:{param1:alldata,param2:product,param3:customer},
|
||||
//dataType:"json",
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>quality/saveSpectficationData",
|
||||
success:function(data) {
|
||||
if(data)
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
alert(data);
|
||||
//console.log(data);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function DeleteRow(rowid)
|
||||
{
|
||||
var product = $('#product').val();
|
||||
var customer = $('#customer').val();
|
||||
if(product == -1 || customer == -1)
|
||||
{
|
||||
alert('Please Select Product and Customer.');
|
||||
}
|
||||
else{
|
||||
var d='';
|
||||
|
||||
var Row = $('#testspecifications').find('tr').eq(rowid).find('td');
|
||||
$.each(Row,function(index,value){
|
||||
if(index == 1 ){
|
||||
|
||||
d = value.textContent
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:{param1:d,param2:product,param3:customer},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>quality/deleteSpecification",
|
||||
|
||||
success:function(data){
|
||||
$('#content').loader('hide');
|
||||
alert(data);
|
||||
}
|
||||
|
||||
});
|
||||
tr.parentNode.removeChild(tr);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
964
application/views/qualityreport.php
Normal file
964
application/views/qualityreport.php
Normal file
@ -0,0 +1,964 @@
|
||||
<style>
|
||||
.edit{
|
||||
|
||||
background-color:#eeffcc ! important;
|
||||
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
//color:red ! important;
|
||||
|
||||
$invoicenos = array(-1=>'Select Invoice No');
|
||||
foreach($records as $rec)
|
||||
{
|
||||
$invoicenos[$rec->invoice_number] = $rec->invoice_number;
|
||||
}
|
||||
|
||||
//print_r($emplist);
|
||||
$approvedby = array(-1=>'Select Approver Name');
|
||||
foreach($emplist as $r)
|
||||
{
|
||||
$approvedby[$r->FirstName.' '.$r->LastName] = $r->FirstName.' '.$r->LastName.'-'.$r->shortName;
|
||||
}
|
||||
|
||||
?>
|
||||
<style>
|
||||
th{
|
||||
text-align:center !important;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
|
||||
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center>Pre Dispatch Inspection Report Screen</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">-->
|
||||
<form action="<?php echo base_url() ?>monthlypay/monthlyListing" method="POST" id="searchList">
|
||||
|
||||
</form>
|
||||
</div><!--</h3></center>-->
|
||||
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
|
||||
<div class="box-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<label>Invoice No</label>
|
||||
<?php echo form_dropdown('name="invoiceno"',$invoicenos,set_value('invoiceno',$invoicenos[-1]),'id="invoiceno"' ,'class="form-control select2', 'style="text-align:center;"');?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>Invoice Date</label>
|
||||
<input type="text" id="invoicedate" name="invoicedate" class="form-control" readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>Customer Name</label>
|
||||
<input type="text" id="customername" name="customername" class="form-control" readonly>
|
||||
<input type="hidden" id="customerid" name="customerid" readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>Product Name</label>
|
||||
<input type="text" id="productname" name="productname" class="form-control" readonly>
|
||||
<input type="hidden" id="productid" name="productid" readonly>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<label>Batch No</label>
|
||||
<input type="text" id="batchno" name="batchno" class="form-control" readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>Qty</label>
|
||||
<input type="text" id="qty" name="qty" class="form-control ;" readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>Batch Date</label>
|
||||
<input type="text" id="reportdate" name="reportdate" class="form-control">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<br/>
|
||||
<table id="testreport" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;text-align:center;">
|
||||
<thead style="background-color:#ddf;">
|
||||
<tr>
|
||||
|
||||
<th width="3px">SNO</th>
|
||||
<th>Description</th>
|
||||
<th width="5px">Specification</br>Min</th><th width="5px">Specification</br>Max</th><th width="5px">Specification</br>UOM</th><th>ACT X1</th><th>ACT X2</th><th>ACT X3</th><th width="5px">Average</th><th width="5px">Results</th><th>Remarks</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="specAppend">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<p> </p>
|
||||
<hr>
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3"><b> L.O.I Details </b></div> <div class="col-md-1 col-md-offset-8 text-right"><i class="fa fa-expand" id="loibutton"></i></div>
|
||||
|
||||
</div>
|
||||
<div id="loiarea">
|
||||
<table id="loitable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;text-align:center;">
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
|
||||
<th><center>SNO</center></th><th><center>Heating Time</center></br><center>start</center></th><th><center>Heating Time</center></br><center>end</center></th><th>Temp *c</th><th><center>Crucible Weight</center></br> <center>w1(g)<center></th><th><center>Before Heating</center></br><center>w2(g)</center></th><th><center>After Heating<center></br>w3(g)</center></th><th>L.O.I %</th><th>Remarks</th>
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
<tbody id="loiAppend">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3"><b> AFS Details </b></div> <div class="col-md-1 col-md-offset-8 text-right"><i class="fa fa-expand" id="afsbutton"></i></div>
|
||||
|
||||
</div>
|
||||
<div id="afsarea">
|
||||
<table id="afstable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;text-align:center;">
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
|
||||
<th>NO</th><th>Sieve Size µm</th><th>Sand Weight</th><th>Percentage</th><th>Multiplier</th><th>Product</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="afsAppend">
|
||||
<tr id="1"> <td>1</td> <td id="1size">1700</td> <td id="1sw" class="edit" contenteditable="true" onkeyup="calculateAFS(this.parentNode.id,this.textContent,this.id);">0.00</td><td id="1p">0.00</td><td id="1m">5</td><td id="1pt">0.0000</td></tr>
|
||||
<tr id="2"> <td>2</td> <td id="2size">850</td> <td id="2sw" class="edit" contenteditable="true" onkeyup="calculateAFS(this.parentNode.id,this.textContent,this.id);">0.00</td><td id="2p">0.00</td><td id="2m">10</td><td id="2pt">0.0000</td></tr>
|
||||
<tr id="3"> <td>3</td> <td id="3size">600</td> <td id="3sw" class="edit" contenteditable="true" onkeyup="calculateAFS(this.parentNode.id,this.textContent,this.id);">0.00</td><td id="3p">0.00</td><td id="3m">20</td><td id="3pt">0.0000</td></tr>
|
||||
<tr id="4"> <td>4</td> <td id="4size">425</td> <td id="4sw" class="edit" contenteditable="true" onkeyup="calculateAFS(this.parentNode.id,this.textContent,this.id);">0.00</td><td id="4p">0.00</td><td id="4m">30</td><td id="4pt">0.0000</td></tr>
|
||||
<tr id="5"> <td>5</td> <td id="5size">300</td> <td id="5sw" class="edit" contenteditable="true" onkeyup="calculateAFS(this.parentNode.id,this.textContent,this.id);">0.00</td><td id="5p">0.00</td><td id="5m">40</td><td id="5pt">0.0000</td></tr>
|
||||
<tr id="6"> <td>6</td> <td id="6size">212</td> <td id="6sw" class="edit" contenteditable="true" onkeyup="calculateAFS(this.parentNode.id,this.textContent,this.id);">0.00</td><td id="6p">0.00</td><td id="6m">50</td><td id="6pt">0.0000</td></tr>
|
||||
<tr id="7"> <td>7</td> <td id="7size">150</td> <td id="7sw" class="edit" contenteditable="true" onkeyup="calculateAFS(this.parentNode.id,this.textContent,this.id);">0.00</td><td id="7p">0.00</td><td id="7m">70</td><td id="7pt">0.0000</td></tr>
|
||||
<tr id="8"> <td>8</td> <td id="8size">106</td> <td id="8sw" class="edit" contenteditable="true" onkeyup="calculateAFS(this.parentNode.id,this.textContent,this.id);">0.00</td><td id="8p">0.00</td><td id="8m">100</td><td id="8pt">0.0000</td></tr>
|
||||
<tr id="9"> <td>9</td> <td id="9size">75</td> <td id="9sw" class="edit" contenteditable="true" onkeyup="calculateAFS(this.parentNode.id,this.textContent,this.id);">0.00</td><td id="9p">0.00</td><td id="9m">140</td><td id="9pt">0.0000</td></tr>
|
||||
<tr id="10"> <td>10</td> <td id="10size">53</td> <td id="10sw" class="edit" contenteditable="true" onkeyup="calculateAFS(this.parentNode.id,this.textContent,this.id);">0.00</td><td id="10p">0.00</td><td id="10m">200</td><td id="10pt">0.0000</td></tr>
|
||||
<tr id="11"> <td>11</td> <td id="11size">pan</td> <td id="11sw" class="edit" contenteditable="true" onkeyup="calculateAFS(this.parentNode.id,this.textContent,this.id);">0.00</td><td id="11p">0.00</td><td id="11m">300</td><td id="11pt">0.0000</td></tr>
|
||||
<tr id="12"> <td> </td> <td><b>Total</b></td> <td id="12sw">0.00</td><td id="12p">0.00</td><td id="12m"> </td><td id="12pt">0.0000</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3"><b>AFS CHART </b></div> <div class="col-md-1 col-md-offset-8 text-right"><i class="fa fa-expand" id="chartbutton"></i></div>
|
||||
|
||||
</div>
|
||||
<div id="chartarea">
|
||||
<div>
|
||||
<center><canvas id="myCanvas" width="1000" height="350" style="border:1px solid #d3d3d3;">
|
||||
Your browser does not support the HTML5 canvas tag.</canvas></center>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row"> </div>
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>Inspected By :</label>
|
||||
<input type="text" id="inspector" class="form-control" value="<?php echo $this->session->userdata ( 'name' );?>" readonly>
|
||||
<input type="hidden" value="<?php echo $this->session->userdata ( 'userId' );?>">
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 col-md-offset-6 ">
|
||||
<label>Approved By :</label>
|
||||
<?php echo form_dropdown('name="approvedby"',$approvedby,set_value('approvedby',$approvedby[-1]),'id="approvedby"' ,'class="form-control select2', 'style="text-align:center;"');?>
|
||||
<!-- <input type="text" id="approvedby" class="form-control"> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row"> </div>
|
||||
<div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="col-md-3" id="savebutton">
|
||||
<input type="button" id="submit" value = "Save" class="btn btn-primary" onclick="getAllData();">
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
<!-- <div class="box-footer clearfix">
|
||||
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
$('#monthlylisting').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"aaSorting": [[ 0, "asc" ]],
|
||||
"info": true,
|
||||
"autoWidth": true
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#loibutton").click(function(){
|
||||
$("#loiarea").toggle("slow");
|
||||
});
|
||||
$("#afsbutton").click(function(){
|
||||
$("#afsarea").toggle("slow");
|
||||
});
|
||||
$("#chartbutton").click(function(){
|
||||
$("#chartarea").toggle("slow");
|
||||
});
|
||||
|
||||
$('#reportdate').datepicker({
|
||||
//minDate : 'year+16',
|
||||
maxDate : 'now',
|
||||
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
|
||||
|
||||
});
|
||||
|
||||
// $('#testreport td').click(funciton(e){
|
||||
|
||||
// alert(e);
|
||||
// });
|
||||
|
||||
var jsrecords = <?php echo json_encode($records);?>;
|
||||
|
||||
|
||||
$('#invoiceno').change(function(){
|
||||
|
||||
var invoiceid = $('#invoiceno').val();
|
||||
//alert(invoiceid);
|
||||
////console.log(jsrecords);
|
||||
//console.log(jsrecords[0]['invoice_id'])
|
||||
$.each(jsrecords,function(index,value){
|
||||
// console.log(index+'-'+value['invoice_id']);
|
||||
|
||||
if(invoiceid == value['invoice_number'])
|
||||
{
|
||||
|
||||
$('#testreport tbody').remove();
|
||||
$('#testreport').append('<tbody id="specAppend"></tbody>');
|
||||
|
||||
$('#loitable tbody').remove();
|
||||
$('#loitable').append('<tbody id="loiAppend"></tbody>');
|
||||
|
||||
var d=new Date(value['invoice_date_created']);
|
||||
var d = d.getDate()+'-'+(d.getMonth()+1)+'-'+d.getFullYear();
|
||||
$('#invoicedate').val(d);
|
||||
$('#customername').val(value['client_id']+'-'+value['client_name']);
|
||||
$('#customerid').val(value['client_id']);
|
||||
$('#productname').val(value['item_product_id']+'-'+value['product_name']+'-'+value['product_description']);
|
||||
$('#productid').val(value['item_product_id']);
|
||||
$('#qty').val(value['item_quantity']);
|
||||
var batchno = 0;
|
||||
if(value['invoice_custom_fieldvalue'] != ''){ batchno = value['invoice_custom_fieldvalue'];}
|
||||
$('#batchno').val(batchno);
|
||||
}
|
||||
});
|
||||
|
||||
var productid = $('#productid').val();
|
||||
var customerid = $('#customerid').val();
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:{param1:productid,param2:customerid},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>quality/getAllSpecforReport",
|
||||
success:function(data) {
|
||||
if(data)
|
||||
{
|
||||
//alert(data);
|
||||
var jsdata = data;
|
||||
var jsdata = JSON.parse(jsdata);
|
||||
// console.log(jsdata);
|
||||
var html = '';
|
||||
var html2 = '';
|
||||
$.each(jsdata,function(i,item){
|
||||
|
||||
var index = i+1;
|
||||
var test = item['testtype'];
|
||||
var min = item['min'];
|
||||
var max = item['max'];
|
||||
var uom = item['uom'];
|
||||
var temp = item['temp'];
|
||||
//console.log(spec);
|
||||
|
||||
html += '<tr id='+index+'><td>'+index+'</td><td id='+index+'description>'+test+'</td><td id='+index+'min>'+min+'</td><td id='+index+'max>'+max+'</td><td>'+uom+'</td>';
|
||||
|
||||
if(test != 'AFS' && test != 'LOI')
|
||||
{
|
||||
html +='<td class="edit" contenteditable="true" onkeyup="calculateMaster(this.id);" id='+index+'act1>0.00</td> <td class="edit" contenteditable="true" onkeyup="calculateMaster(this.id);" id='+index+'act2>0.00</td> <td class="edit" contenteditable="true" onkeyup="calculateMaster(this.id);" id='+index+'act3>0.00</td>';
|
||||
}
|
||||
else if(test == 'AFS')
|
||||
{
|
||||
html += '<td colspan="3" id="AFS" onkeyup="calculateMaster(this.id);">0.00</td>';
|
||||
}
|
||||
else if(test == 'LOI')
|
||||
{
|
||||
html +='<td onkeyup="calculateMaster(this.id);" id=1loi'+index+'>0.00</td> <td onkeyup="calculateMaster(this.id);" id=2loi'+index+'>0.00</td> <td onkeyup="calculateMaster(this.id);" id=3loi'+index+'>0.00</td>';
|
||||
}
|
||||
|
||||
html += '<td id='+index+'avg>0.00</td><td id='+index+'result>-</td><td contenteditable="true"></td></tr>';
|
||||
|
||||
if(test == 'LOI')
|
||||
{
|
||||
for(i=1;i<=3;i++){
|
||||
html2 += '<tr id='+i+'> <td>'+i+'</td> <td class="edit" contenteditable="true" id='+i+'start onkeyup="calculateMaster(this.id);">0.00</td> <td class="edit" contenteditable="true" id='+i+'end onkeyup="calculateMaster(this.id);">0.00</td> <td id='+i+'temp>'+temp+'</td>';
|
||||
html2 += '<td class="edit" contenteditable="true" id='+i+'w1 onkeyup="calculateMaster(this.id);">0.00</td> <td class="edit" contenteditable="true" id='+i+'w2 onkeyup="calculateMaster(this.id);">0.00</td> <td class="edit" contenteditable="true" id='+i+'w3 onkeyup="calculateMaster(this.id);">0.00</td> <td id='+i+'loi>0.00</td> <td contenteditable="true"></td> </tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
$("#testreport tbody").append(html);
|
||||
$("#loitable tbody").append(html2);
|
||||
$('#content').loader('hide');
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
});//End of invoice change funciton
|
||||
|
||||
|
||||
$('.edit').bind('keypress', function(e)
|
||||
{
|
||||
|
||||
|
||||
if(((e.which || e.keyCode) == 8) || ((e.which || e.keyCode) == 9) || ((e.which || e.keyCode) == 46) || ((e.which || e.keyCode) == 37) || ((e.which || e.keyCode) == 39))
|
||||
{
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
if(e.keyCode == 13)
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
if(((e.which || e.keyCode) < 48) || ((e.which || e.keyCode) > 57))
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
}); // End of document on ready funciton
|
||||
|
||||
function calculateMaster(id)
|
||||
{
|
||||
if(document.getElementById('12sw')){
|
||||
var SW12 = document.getElementById('12sw').textContent;
|
||||
if(SW12 != 100)
|
||||
{
|
||||
alert('AFS Details Sand Weight Total Should be 100..!');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if($('#invoiceno').val() == -1)
|
||||
{
|
||||
alert('Select Invoice No');
|
||||
return false;
|
||||
}
|
||||
var cid = id;
|
||||
if(document.getElementById(id)){
|
||||
var cvalue = document.getElementById(id).textContent;
|
||||
if(cvalue == 0 )
|
||||
{
|
||||
document.getElementById(id).textContent = '';
|
||||
}
|
||||
}
|
||||
var Rows = $('#testreport').find('tr');
|
||||
var size = Object.keys(Rows).length;
|
||||
size = size-5;
|
||||
var LOIROWNO = 0;
|
||||
|
||||
for(i=1;i<=size;i++)
|
||||
{
|
||||
var Row = $('#testreport').find('tr').eq(i).find('td');
|
||||
//console.log(Row);
|
||||
var desc = ''; var min =''; var max = ''; var act1 = ''; var act2 = ''; var act3 = ''; var avg = ''; var res = '';
|
||||
|
||||
|
||||
$.each(Row,function(index,value){
|
||||
|
||||
//console.log(index);
|
||||
|
||||
if(index != 0 && index != 4 && index != 10)
|
||||
{
|
||||
//console.log('**************************************');
|
||||
//console.log(value.id+'-'+value.textContent);
|
||||
if(index == 1){ desc = value.textContent; }
|
||||
if(index == 2){ min = value.textContent; }
|
||||
if(index == 3){ max = value.textContent; }
|
||||
if(index == 5){ act1 = value.textContent; }
|
||||
if(index == 6){ act2 = value.textContent; }
|
||||
if(index == 7){ act3 = value.textContent; }
|
||||
}
|
||||
|
||||
});
|
||||
if(desc == 'LOI')
|
||||
{
|
||||
LOIROWNO = i;
|
||||
}
|
||||
if(desc != 'AFS')
|
||||
{
|
||||
if(isNaN(act1) || act1 == '' || act1 == null)
|
||||
{
|
||||
act1 = 0.00;
|
||||
}
|
||||
if(isNaN(act2) || act2 == '' || act2 == null)
|
||||
{
|
||||
act2 = 0.00;
|
||||
}
|
||||
if(isNaN(act3) || act3 == '' || act3 == null)
|
||||
{
|
||||
act3 = 0.00;
|
||||
}
|
||||
avg = ((parseFloat(act1) + parseFloat(act2) + parseFloat(act3))/ 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
avg = document.getElementById('AFS').textContent;
|
||||
}
|
||||
|
||||
min = parseFloat(min);
|
||||
max = parseFloat(max);
|
||||
avg = parseFloat(avg);
|
||||
//console.log(min+'-'+max+'-'+avg);
|
||||
|
||||
var curavgid = i+'avg';
|
||||
document.getElementById(curavgid).textContent = parseFloat(avg).toFixed(2);
|
||||
if($.isNumeric(min) && $.isNumeric(max))
|
||||
{
|
||||
if(avg >= min && avg <= max)
|
||||
{
|
||||
res = 'OK';
|
||||
}
|
||||
else
|
||||
{
|
||||
res = 'NG';
|
||||
}
|
||||
}
|
||||
else if($.isNumeric(min) && !($.isNumeric(max)))
|
||||
{
|
||||
if(avg >= min)
|
||||
{
|
||||
res = 'OK';
|
||||
//alert(res);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = 'NG';
|
||||
}
|
||||
}
|
||||
else if(!$.isNumeric(min) && $.isNumeric(max))
|
||||
{
|
||||
if(avg <= max)
|
||||
{
|
||||
res = 'OK';
|
||||
}
|
||||
else
|
||||
{
|
||||
res = 'NG';
|
||||
}
|
||||
}
|
||||
var curresultid = i+'result';
|
||||
document.getElementById(curresultid).textContent = res;
|
||||
}
|
||||
|
||||
|
||||
for(j=1;j<=3;j++)
|
||||
{
|
||||
var loiRow = $('#loitable').find('tr').eq(j).find('td');
|
||||
var start = ''; var end =''; var temp = ''; var act1 = ''; var w1 = ''; var w2 = ''; var w3 = ''; var loiid = '';var loi = 0;
|
||||
$.each(loiRow,function(iter,rec){
|
||||
|
||||
|
||||
if(iter != 0 && iter != 8)
|
||||
{
|
||||
//console.log('**************************************');
|
||||
//console.log(iter+'-'+rec.id+'-'+rec.textContent);
|
||||
if(iter == 1){ start = rec.textContent; }
|
||||
if(iter == 2){ end = rec.textContent; }
|
||||
if(iter == 3){ temp = rec.textContent; }
|
||||
if(iter == 4){ w1 = rec.textContent; }
|
||||
if(iter == 5){ w2 = rec.textContent; }
|
||||
if(iter == 6){ w3 = rec.textContent; }
|
||||
if(iter == 7){ loiid = rec.id; }
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
w1 = parseFloat(w1);
|
||||
w2 = parseFloat(w2);
|
||||
w3 = parseFloat(w3);
|
||||
//console.log(w1+'-'+w2+'-'+w3);
|
||||
loi = ((w2 - w3)/(w2 - w1))*100;
|
||||
loi = isNaN(loi)?0.00:parseFloat(loi).toFixed(2);
|
||||
//console.log(w1+'-'+w2+'-'+w3+'-'+loi);
|
||||
var curid = j+'loi';
|
||||
if(document.getElementById(curid))
|
||||
{
|
||||
document.getElementById(curid).textContent = parseFloat(loi).toFixed(2);
|
||||
}
|
||||
var curid = j+'loi'+LOIROWNO;
|
||||
//console.log(curid);
|
||||
if(document.getElementById(curid))
|
||||
{
|
||||
document.getElementById(curid).textContent = parseFloat(loi).toFixed(2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function getAllData()
|
||||
{
|
||||
|
||||
calculateMaster();
|
||||
var Rows = $('#testreport').find('tr');
|
||||
var size = Object.keys(Rows).length;
|
||||
var flag = 0;
|
||||
size = size-5;
|
||||
|
||||
|
||||
if($('#invoiceno').val() == -1 || $('#reportdate').val() == '')
|
||||
{
|
||||
alert('Select Invoice No and Batch Date');
|
||||
return false;
|
||||
}
|
||||
|
||||
for(z=1;z<=size;z++)
|
||||
{
|
||||
var ide = z+'result';
|
||||
var res = document.getElementById(ide).textContent;
|
||||
//console.log(res)
|
||||
if(res != 'OK')
|
||||
{
|
||||
flag++;
|
||||
}
|
||||
}
|
||||
// alert(flag);
|
||||
var total_sandweight = parseFloat(document.getElementById('12sw').textContent);
|
||||
if(flag != 0 || (total_sandweight!=100) )
|
||||
{
|
||||
alert('Test Failed, Cant Save Test Report!');
|
||||
return false;
|
||||
}
|
||||
|
||||
if($('#approvedby').val() == -1)
|
||||
{
|
||||
alert('Enter Approver Name');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var testreportdata = $("#testreport").tableToJSON();
|
||||
var testloidata = $("#loitable").tableToJSON();
|
||||
var testafsdata = $("#afstable").tableToJSON();
|
||||
|
||||
testreportdata=JSON.stringify(testreportdata);
|
||||
testloidata=JSON.stringify(testloidata);
|
||||
testafsdata=JSON.stringify(testafsdata);
|
||||
// alert(testreportdata);
|
||||
// alert(testloidata);
|
||||
// alert(testafsdata);
|
||||
|
||||
var invoiceno = $('#invoiceno').val();
|
||||
var batchno = $('#reportdate').val();
|
||||
var approvedby = $('#approvedby').val();
|
||||
|
||||
var product = $('#product').val();
|
||||
var customer = $('#customer').val();
|
||||
if(product == -1 || customer == -1)
|
||||
{
|
||||
alert('Please Select Product and Customer.');
|
||||
}
|
||||
else{
|
||||
|
||||
var c = document.getElementById("myCanvas");
|
||||
var fullQuality = c.toDataURL('image/png', 1.0);
|
||||
$('.content').loader('show');
|
||||
$.ajax({
|
||||
data:{param1:testreportdata,param2:testloidata,param3:testafsdata,param4:invoiceno,param5:batchno,param6:approvedby,param7:fullQuality},
|
||||
//dataType:"json",
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>quality/saveTestReportData",
|
||||
success:function(data) {
|
||||
if(data){
|
||||
alert(data);
|
||||
$('.content').loader('hide');
|
||||
window.location = "<?php echo base_url().'qualityreportlist';?>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function calculateAFS(pid,cvalue,cid)
|
||||
{
|
||||
|
||||
if($('#invoiceno').val() == -1)
|
||||
{
|
||||
alert('Select Invoice No');
|
||||
return false;
|
||||
}
|
||||
var cid = cid;
|
||||
// if(cvalue == 0)
|
||||
// {
|
||||
// document.getElementById(cid).textContent = '';
|
||||
// }
|
||||
|
||||
var Row = $('#afstable').find('tr').eq(pid).find('td');
|
||||
|
||||
var sandweight = '';
|
||||
var sandweightid ='';
|
||||
var percentage = '';
|
||||
var percentageid = '';
|
||||
var multiplier = '';
|
||||
var multiplierid = '';
|
||||
var product = '';
|
||||
var productid = '';
|
||||
|
||||
$.each(Row,function(index,item){
|
||||
|
||||
|
||||
if(index == 2){
|
||||
|
||||
//console.log('sanweight'+item.textContent);
|
||||
sandweight = item.textContent;
|
||||
sandweightid = item.id;
|
||||
//console.log('sanweight'+item.textContent);
|
||||
}
|
||||
else if(index == 3){
|
||||
percentageid = item.id;
|
||||
percentage = item.textContent;
|
||||
}
|
||||
|
||||
else if(index == 4){
|
||||
multiplierid = item.id;
|
||||
multiplier = item.textContent;
|
||||
}
|
||||
else if(index == 5){
|
||||
product = item.textContent;
|
||||
productid = item.id;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if(isNaN(sandweight) || sandweight == '' || sandweight == null)
|
||||
{
|
||||
sandweight = 0.00;
|
||||
}
|
||||
|
||||
//console.log('sanweight'+sandweight);
|
||||
if(isNaN(cvalue) || cvalue == '' || cvalue == null)
|
||||
{
|
||||
cvalue = 0.00;
|
||||
}
|
||||
document.getElementById(percentageid).textContent = parseFloat(sandweight).toFixed(2);
|
||||
prodcut = ( sandweight * multiplier);
|
||||
document.getElementById(productid).textContent = parseFloat(prodcut).toFixed(4);
|
||||
var totalsandweight = 0;
|
||||
var totalproduct = 0;
|
||||
for(i=1;i<=11;i++)
|
||||
{
|
||||
var id = i+'sw';
|
||||
var temp = parseFloat(document.getElementById(id).textContent);
|
||||
if(isNaN(temp) || temp == '' || temp == null)
|
||||
{
|
||||
temp = 0.00;
|
||||
}
|
||||
totalsandweight = totalsandweight + temp;
|
||||
|
||||
var id2 = i+'pt';
|
||||
var temp2 = parseFloat(document.getElementById(id2).textContent);
|
||||
totalproduct = totalproduct + temp2;
|
||||
}
|
||||
|
||||
|
||||
if(isNaN(totalsandweight) || totalsandweight == '' || totalsandweight == null)
|
||||
{
|
||||
totalsandweight = 0.00;
|
||||
}
|
||||
|
||||
if(isNaN(totalproduct) || totalproduct == '' || totalproduct == null)
|
||||
{
|
||||
totalproduct = 0.00;
|
||||
}
|
||||
|
||||
document.getElementById('12sw').textContent = parseFloat(totalsandweight).toFixed(2);
|
||||
document.getElementById('12p').textContent = parseFloat(totalsandweight).toFixed(2);
|
||||
document.getElementById('12pt').textContent = parseFloat(totalproduct).toFixed(3);
|
||||
if(document.getElementById('AFS') != null)
|
||||
{
|
||||
document.getElementById('AFS').textContent = isNaN(totalproduct)?'0.00': parseFloat((totalproduct/totalsandweight)).toFixed(2);
|
||||
}
|
||||
var dataset = [];
|
||||
var datalabel = [];
|
||||
for(x=1;x<=11;x++)
|
||||
{
|
||||
var swid = x+'p';
|
||||
var sanddata = document.getElementById(swid).textContent;
|
||||
dataset.push(sanddata);
|
||||
|
||||
var sizeid = x+'size';
|
||||
var sizedata = document.getElementById(sizeid).textContent;
|
||||
datalabel.push(sizedata);
|
||||
}
|
||||
// console.log(dataset);
|
||||
//console.log(datalabel);
|
||||
drawChart(dataset,datalabel);
|
||||
}
|
||||
|
||||
|
||||
$('td').focusin(function(e){
|
||||
|
||||
var id = e.target.id;
|
||||
var value = document.getElementById(id).textContent;
|
||||
if(value == 0 )
|
||||
{
|
||||
document.getElementById(id).textContent = '';
|
||||
}
|
||||
});
|
||||
|
||||
$('td').focusout(function(e){
|
||||
|
||||
var id = e.target.id;
|
||||
|
||||
var value = document.getElementById(id).textContent;
|
||||
if(value == '' )
|
||||
{
|
||||
document.getElementById(id).textContent = parseFloat(0.00).toFixed(2);
|
||||
}
|
||||
});
|
||||
|
||||
// $(".edit").focusin(function(){
|
||||
|
||||
// alert('skjhjkdf');
|
||||
// });
|
||||
|
||||
function drawChart(dataset,datalabel){
|
||||
var c = document.getElementById("myCanvas");
|
||||
var ctx = c.getContext("2d");
|
||||
ctx.clearRect(0, 0, c.width, c.height);
|
||||
var xlabels = datalabel;
|
||||
var xlabelscount = xlabels.length;
|
||||
//console.log(xlabelscount);
|
||||
var dataset = dataset;
|
||||
|
||||
Array.prototype.max = function() {
|
||||
return Math.max.apply(null, this);
|
||||
};
|
||||
var maxdataitem = dataset.max();
|
||||
maxdataitem = Math.round((maxdataitem + 10)/5);
|
||||
|
||||
|
||||
var dataset_locationsX = [];
|
||||
var dataset_locationsY = [];
|
||||
|
||||
var canvaswidth = document.getElementById('myCanvas').offsetWidth;
|
||||
var canvasheight = document.getElementById('myCanvas').offsetHeight;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(30,0);
|
||||
ctx.lineTo(30,canvasheight);
|
||||
ctx.strokeStyle="black";
|
||||
ctx.stroke();
|
||||
ctx.closePath();
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0,(canvasheight-30));
|
||||
ctx.lineTo(canvaswidth,(canvasheight-30));
|
||||
ctx.strokeStyle="black";
|
||||
ctx.stroke();
|
||||
ctx.closePath();
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.font = "bold 12px Arial";
|
||||
ctx.fillStyle = "black";
|
||||
ctx.fillText("Sieve size µm ",(canvaswidth/2),(canvasheight-2));
|
||||
ctx.closePath();
|
||||
|
||||
var xaxislabelwidth = (canvaswidth/12);
|
||||
|
||||
var startingpointX = 30;
|
||||
var startingpointY = (canvasheight-30);
|
||||
|
||||
|
||||
for(i=1;i<=xlabelscount;i++) //X DataLabel
|
||||
{
|
||||
ctx.beginPath();
|
||||
ctx.font = "10px Arial";
|
||||
ctx.fillStyle = "black";
|
||||
ctx.fillText(xlabels[i-1],(startingpointX+(xaxislabelwidth * i)),(startingpointY+15));
|
||||
ctx.closePath();
|
||||
}
|
||||
|
||||
|
||||
|
||||
for(i=1;i<=xlabelscount;i++) // X Data
|
||||
{
|
||||
ctx.beginPath();
|
||||
ctx.arc((startingpointX+(xaxislabelwidth * i)),startingpointY,3,0,2*Math.PI);
|
||||
ctx.fillStyle = "black";
|
||||
ctx.fill();
|
||||
ctx.closePath();
|
||||
var xl = (startingpointX+(xaxislabelwidth * i));
|
||||
|
||||
dataset_locationsX.push(xl);
|
||||
|
||||
}
|
||||
|
||||
|
||||
var j = 0;
|
||||
var ylabel = 0;
|
||||
for(i=1;i<=maxdataitem;i++) // y Data and Y labels
|
||||
{
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(startingpointX,(startingpointY-j),3,0,2*Math.PI);
|
||||
ctx.fillStyle = "black";
|
||||
ctx.fill();
|
||||
var yl = ((startingpointY-j));
|
||||
dataset_locationsY.push(yl);
|
||||
ctx.fillStyle = "black";
|
||||
ctx.font = "10px Arial";
|
||||
ctx.fillText((j/7),(startingpointX-30),(startingpointY-j));
|
||||
ylabel = ylabel + 5;
|
||||
j=j+35;
|
||||
ctx.closePath();
|
||||
|
||||
}
|
||||
|
||||
var finallocationofY = [];
|
||||
var finallocationofX = [];
|
||||
for(i=1;i<=xlabelscount;i++) //Exact chart Data Draw red circle
|
||||
{
|
||||
ctx.beginPath();
|
||||
<!-- ctx.arc((parseFloat(dataset_locationsX[i-1])),((startingpointY - parseFloat(dataset[i-1]) * 7)),4,0,2*Math.PI); -->
|
||||
ctx.fillStyle="red";
|
||||
ctx.lineCap = 'round';
|
||||
<!-- ctx.fill(); -->
|
||||
ctx.fillRect((parseFloat(dataset_locationsX[i-1])-5),((startingpointY - parseFloat(dataset[i-1]) * 7)-5),8,8)
|
||||
finallocationofY.push((startingpointY - parseFloat(dataset[i-1]) * 7));
|
||||
finallocationofX.push(parseFloat(dataset_locationsX[i-1]));
|
||||
ctx.closePath();
|
||||
//Draw text for data points
|
||||
ctx.beginPath();
|
||||
ctx.font = "10px Arial";
|
||||
ctx.fillStyle="blue";
|
||||
ctx.fillText(dataset[i-1],(parseFloat(dataset_locationsX[i-1])),((startingpointY - parseFloat(dataset[i-1]) * 7)-10));
|
||||
ctx.closePath();
|
||||
}
|
||||
|
||||
|
||||
for(i=0;i<=xlabelscount;i++) //Exact Chart Data Draw line
|
||||
{
|
||||
|
||||
|
||||
ctx.moveTo(finallocationofX[i],finallocationofY[i]);
|
||||
ctx.lineTo(finallocationofX[i+1],finallocationofY[i+1]);
|
||||
ctx.setLineDash([0,0]);
|
||||
//ctx.strokeStyle="#1a75ff";
|
||||
ctx.lineWidth=3;
|
||||
//setInterval(function(){
|
||||
ctx.stroke();
|
||||
//},30000);
|
||||
|
||||
|
||||
|
||||
}
|
||||
//ctx.beginPath();
|
||||
for(i=1;i<=dataset_locationsY.length;i++) // Drawing Dashed Lines from Y
|
||||
{
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(startingpointX,dataset_locationsY[i]);
|
||||
ctx.lineTo(canvaswidth,dataset_locationsY[i]);
|
||||
ctx.setLineDash([3,6]);
|
||||
ctx.strokeStyle="black";
|
||||
ctx.lineWidth=0.2;
|
||||
ctx.stroke();
|
||||
ctx.closePath();
|
||||
|
||||
}
|
||||
//sctx.closePath();
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
95
application/views/reportmasterlist.php
Normal file
95
application/views/reportmasterlist.php
Normal file
@ -0,0 +1,95 @@
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
//print_r($records);
|
||||
|
||||
?>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center>Product 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().'quality/report';?> " type="button" class="btn btn-primary">Add New</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div><!--</h3></center>-->
|
||||
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
|
||||
<div class="box-body">
|
||||
|
||||
<!-- <div class="row">
|
||||
<div class="col-md-3">
|
||||
<?php echo form_dropdown('name="product"',$products2,set_value('product',$products2[-1]),'id="product"' ,'class="form-control select2');?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<?php echo form_dropdown('name="customer"',$customers2,set_value('customer',$customers2[-1]),'id="customer"' ,'class="form-control select2');?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<input type="button" id="addspec" class="btn btn-primary" value = "Add New Specification">
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
<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>Invoice ID</th>
|
||||
<th>Batch Date</th>
|
||||
<th>Product Name</th>
|
||||
<th>Customer Name</th>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="specAppend">
|
||||
<?php
|
||||
if(!empty($records))
|
||||
{
|
||||
|
||||
foreach($records as $data)
|
||||
{
|
||||
|
||||
//print_r($data);echo "</br></br>";
|
||||
?>
|
||||
<tr> <td><a href="<?php echo base_url()?>quality/viewIndReport/<?php echo $data->testreport_id ?>"><?php echo $data->testreport_id?></a></td> <td><?php echo $data->invoiceid?></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> </p>
|
||||
<div class="row">
|
||||
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
<!-- <div class="box-footer clearfix">
|
||||
|
||||
</div> -->
|
||||
</div><!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
319
application/views/viewIndSpec.php
Normal file
319
application/views/viewIndSpec.php
Normal file
@ -0,0 +1,319 @@
|
||||
<style>
|
||||
th{
|
||||
text-align:center ! important;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
|
||||
$pname = '';
|
||||
$cnamme = '';
|
||||
$pid='';
|
||||
$cid='';
|
||||
foreach($specifications as $s)
|
||||
{
|
||||
$pname = $s->product_description;
|
||||
$cname = $s->client_name;
|
||||
$pid = $s->product_id;
|
||||
$cid = $s->customer_id;
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
|
||||
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center>Product Customer Test Specification Master Screen</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">-->
|
||||
<form action="<?php echo base_url() ?>monthlypay/monthlyListing" method="POST" id="searchList">
|
||||
|
||||
</form>
|
||||
</div><!--</h3></center>-->
|
||||
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
|
||||
<div class="box-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<input type="text" name="p" id="p" class="form-control" value="<?php echo $pname;?>" readonly>
|
||||
<input type="hidden" name="product" id="product" value="<?php echo $pid;?>">
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<input type="text" name="c" id="c" class="form-control" value="<?php echo $cname;?>" readonly>
|
||||
<input type="hidden" name="customer" id="customer" value="<?php echo $cid;?>">
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<input type="button" id="addspec" class="btn btn-primary" value = "Add New Specification">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br/>
|
||||
<table id="testspecifications" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
<th>UOM</th>
|
||||
<th>Min</th>
|
||||
<th>Max</th>
|
||||
<th>Temp</th>
|
||||
<th>Action</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="specAppend">
|
||||
<?php
|
||||
$index = 0;
|
||||
if(!empty($specifications))
|
||||
{
|
||||
foreach($specifications as $data)
|
||||
{
|
||||
$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>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p> </p>
|
||||
<div class="row">
|
||||
<div class="col-md-3" id="savebutton">
|
||||
<input type="button" id="submit" value = "Save" class="btn btn-primary" onclick="getAllData();">
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
<!-- <div class="box-footer clearfix">
|
||||
|
||||
</div> -->
|
||||
</div><!-- /.box -->
|
||||
|
||||
<div id="specmodel" 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">×</button>
|
||||
<h4 class="modal-title">Add New Specification</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<center>
|
||||
<table >
|
||||
<tr>
|
||||
<td style="text-align:center;padding:10px;">Specification Name</td><td style="padding:10px;"><input type="text" name="spname" id="spname"/> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;padding:10px;">UOM</td><td style="padding:10px;"><input type="text" name="uom" id="uom"/> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;padding:10px;">Min</td><td style="padding:10px;"><input type="text" name="min`" id="min"/> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;padding:10px;;">Max</td><td style="padding:10px;"><input type="text" name="max" id="max"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;padding:10px;;">Temp</td><td style="padding:10px;"><input type="text" name="temp" id="temp"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
<button class="btn btn-primary" ID="addNewRow" onclick="addNewRow();" style="margin-top: -10px;">OK</button>
|
||||
<button class="btn btn-primary" data-dismiss="modal" style="margin-top: -10px;" value="Cancel">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
$('#monthlylisting').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"aaSorting": [[ 0, "asc" ]],
|
||||
"info": true,
|
||||
"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="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>
|
||||
|
||||
<script>
|
||||
$('#addspec').click(function(){
|
||||
|
||||
var product = $('#product').val();
|
||||
var customer = $('#customer').val();
|
||||
if(product == -1 || customer == -1)
|
||||
{
|
||||
alert('Please Select Product and Customer.');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#specmodel').modal('show');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
function addNewRow()
|
||||
{
|
||||
var sname = $('#spname').val();
|
||||
sname = sname.toUpperCase();
|
||||
var uom = $('#uom').val();
|
||||
var min = $('#min').val();
|
||||
var max = $('#max').val();
|
||||
var temp = $('#temp').val();
|
||||
if(sname == '' || uom =='' || min == '' || max == '' || temp == '')
|
||||
{
|
||||
alert('Please Enter all specification');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var rows = document.getElementById('testspecifications').rows.length;
|
||||
//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}));
|
||||
|
||||
$('#spname').val('');
|
||||
$('#uom').val('');
|
||||
$('#min').val('');
|
||||
$('#max').val('');
|
||||
$('#temp').val('');
|
||||
document.getElementById('spname').focus();
|
||||
}
|
||||
}
|
||||
|
||||
$("#specmodel").on("shown.bs.modal", function(e) {
|
||||
|
||||
document.getElementById('spname').focus();
|
||||
|
||||
});
|
||||
|
||||
function getAllData()
|
||||
{
|
||||
|
||||
var alldata = $("#testspecifications").tableToJSON();
|
||||
//alert(JSON.stringify(alldata));
|
||||
alldata=JSON.stringify(alldata)
|
||||
var product = $('#product').val();
|
||||
var customer = $('#customer').val();
|
||||
if(product == -1 || customer == -1)
|
||||
{
|
||||
alert('Please Select Product and Customer.');
|
||||
}
|
||||
else{
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:{param1:alldata,param2:product,param3:customer},
|
||||
//dataType:"json",
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>quality/saveSpectficationData",
|
||||
success:function(data) {
|
||||
if(data)
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
alert(data);
|
||||
//console.log(data);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function DeleteRow(r)
|
||||
{
|
||||
var product = $('#product').val();
|
||||
var customer = $('#customer').val();
|
||||
if(product == '' || customer == '')
|
||||
{
|
||||
alert('Please Select Product and Customer.');
|
||||
}
|
||||
else{
|
||||
var rowid = r;
|
||||
//alert(rowid);
|
||||
var d='';
|
||||
|
||||
var Row = $('#testspecifications').find('tr').eq(rowid).find('td');
|
||||
//console.log(Row);
|
||||
$.each(Row,function(index,value){
|
||||
if(index == 0 ){
|
||||
|
||||
d = value.textContent
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:{param1:d,param2:product,param3:customer},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>quality/deleteSpecification",
|
||||
|
||||
success:function(data){
|
||||
$('#content').loader('hide');
|
||||
alert(data);
|
||||
}
|
||||
|
||||
});
|
||||
$('#testspecifications').find('tr').eq(rowid).remove();
|
||||
//rowid.parentNode.removeChild(rowid);
|
||||
//document.getElementById('#testspecifications').removeChild(document.getElementById('#'+rowid));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
473
application/views/viewindreport.php
Normal file
473
application/views/viewindreport.php
Normal file
@ -0,0 +1,473 @@
|
||||
<style>
|
||||
.edit{
|
||||
|
||||
background-color:#eeffcc ! important;
|
||||
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
//print_r($reportdata);die();
|
||||
$reportid = '';
|
||||
$invoiceno = '';
|
||||
$invoicedate = '';
|
||||
$customername = '';
|
||||
$product_description = '';
|
||||
$batchno = '';
|
||||
$qty = '';
|
||||
$batchdate = '';
|
||||
$inspector = '';
|
||||
$approvedby = '';
|
||||
foreach($reportdata['master'] as $m)
|
||||
{
|
||||
$reportid = $m->testreport_id;
|
||||
$invoiceno = $m->invoiceid;
|
||||
$invoicedate = $m->invoice_date_created;
|
||||
$customername = $m->client_id.'-'.$m->client_name;
|
||||
$product_description = $m->product_id.'-'.$m->product_description;
|
||||
$batchno = $m->invoice_custom_fieldvalue;
|
||||
$qty = $m->item_quantity;
|
||||
$batchdate = $m->batchdate;
|
||||
$inspector = $m->FirstName.' '.$m->LastName;
|
||||
$approvedby = $m->approvedby;
|
||||
}
|
||||
?>
|
||||
<style>
|
||||
th{
|
||||
text-align:center !important;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center>Pre Dispatch Inspection Report - Test Report No:<?php echo $reportid;?></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">
|
||||
<div class="col-md-3" id="savebutton">
|
||||
<input type="button" id="submit" target="_blank" value = "Print" class="btn btn-primary" onclick="PrintFunction();">
|
||||
</div>
|
||||
<form id="printPDF">
|
||||
</div><!--</h3></center>-->
|
||||
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
|
||||
<div class="box-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<label>Invoice No</label>
|
||||
<input type="text" class="form-control" value="<?php echo $invoiceno;?>" readonly>
|
||||
<input type="hidden" class="form-control" value="<?php echo $reportid;?>" name="rid" readonly>
|
||||
</div>
|
||||
</form>
|
||||
<div class="col-md-3">
|
||||
<label>Invoice Date</label>
|
||||
<input type="text" id="invoicedate" name="invoicedate" value="<?php echo date_format(date_create($invoicedate),'d-m-Y');?>" class="form-control" readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>Customer Name</label>
|
||||
<input type="text" id="customername" name="customername" value="<?php echo $customername;?>" class="form-control" readonly>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>Product Name</label>
|
||||
<input type="text" id="productname" name="productname" value="<?php echo $product_description;?>" class="form-control" readonly>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<label>Batch No</label>
|
||||
<input type="text" id="batchno" name="batchno" value="<?php echo $batchno;?>" class="form-control" readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>Qty</label>
|
||||
<input type="text" id="qty" name="qty" value="<?php echo $qty?>" class="form-control ;" readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>Batch Date</label>
|
||||
<input type="text" id="reportdate" name="reportdate" class="form-control" value = "<?php echo date_format(date_create($batchdate),'d-m-Y');?>" readonly>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<br/>
|
||||
<table id="testreport" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;text-align:center;">
|
||||
<thead style="background-color:#ddf;">
|
||||
<tr>
|
||||
|
||||
<th width="3px">SNO</th>
|
||||
<th>Description</th>
|
||||
<th width="5px">Specification</br>Min</th><th width="5px">Specification</br>Max</th><th width="5px">Specification</br>UOM</th><th>ACT X1</th><th>ACT X2</th><th>ACT X3</th><th width="5px">Average</th><th width="5px">Results</th><th>Remarks</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="specAppend">
|
||||
<?php
|
||||
$index = 0;
|
||||
foreach($reportdata['masterreport'] as $master)
|
||||
{
|
||||
$index++;
|
||||
?>
|
||||
<tr> <td><?php echo $index;?></td> <td><?php echo $master->description;?></td><td><?php echo $master->min;?></td> <td><?php echo $master->max;?></td> <td><?php echo $master->UOM;?></td><td><?php if(!empty($master->act1)){ echo $master->act1; }else {echo '0.00';}?></td><td><?php if(!empty($master->act2)){ echo $master->act2; } else {echo '0.00';}?></td> <td><?php if(!empty($master->act3)){ echo $master->act3; } else {echo '0.00';}?></td> <td><?php echo $master->average;?></td> <td><?php echo $master->result;?></td> <td><?php echo $master->remarks;?></td> </tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p> </p>
|
||||
<hr>
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3"><b> L.O.I Details </b></div> <div class="col-md-1 col-md-offset-8 text-right"><i class="fa fa-expand" id="loibutton"></i></div>
|
||||
|
||||
</div>
|
||||
<div id="loiarea">
|
||||
<table id="loitable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;text-align:center;">
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
|
||||
<th><center>SNO</center></th><th><center>Heating Time</center></br><center>start</center></th><th><center>Heating Time</center></br><center>end</center></th><th>Temp *c</th><th><center>Crucible Weight</center></br> <center>w1(g)<center></th><th><center>Before Heating</center></br><center>w2(g)</center></th><th><center>After Heating<center></br>w3(g)</center></th><th>L.O.I %</th><th>Remarks</th>
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
<tbody id="loiAppend">
|
||||
<?php
|
||||
$indexx = 0;
|
||||
foreach($reportdata['masterreportloi'] as $loi)
|
||||
{
|
||||
$indexx++;
|
||||
?>
|
||||
<tr> <td><?php echo $indexx;?></td> <td><?php echo $loi->start_time;?></td> <td><?php echo $loi->end_time;?></td> <td><?php echo $loi->temp;?></td> <td><?php echo $loi->w1;?></td> <td><?php echo $loi->w2;?></td> <td><?php echo $loi->w3;?></td> <td><?php echo $loi->loi_percentage;?></td> <td><?php echo $loi->remarks;?></td></tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3"><b> AFS Details </b></div> <div class="col-md-1 col-md-offset-8 text-right"><i class="fa fa-expand" id="afsbutton"></i></div>
|
||||
|
||||
</div>
|
||||
<div id="afsarea">
|
||||
<table id="afstable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;text-align:center;">
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
|
||||
<th>NO</th><th>Sieve Size µm</th><th>Sand Weight</th><th>Percentage</th><th>Multiplier</th><th>Product</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="afsAppend">
|
||||
<?php
|
||||
$ind = 0;
|
||||
$total_sandweight = 0;
|
||||
$totalproduct = 0;
|
||||
foreach($reportdata['masterreportafs'] as $afs)
|
||||
{
|
||||
$ind++;
|
||||
?>
|
||||
<tr> <td><?php echo $ind;?></td> <td id="<?php echo $ind.'size';?>"><?php echo $afs->sieve_size?></td> <td id="<?php echo $ind.'p';?>"><?php echo $afs->sandweight;?></td><td><?php echo $afs->percentage?></td><td ><?php echo $afs->multiplier?></td><td><?php echo $afs->product;?></td></tr>
|
||||
<?php
|
||||
$total_sandweight = $total_sandweight + $afs->sandweight;
|
||||
$totalproduct = $totalproduct + $afs->product;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<tr id="12"> <td> </td> <td><b>Total</b></td> <td id="12sw"><?php echo $total_sandweight;?></td><td id="12p"><?php echo $total_sandweight;?></td><td id="12m"> </td><td id="12pt"><?php echo number_format($totalproduct,3,'.','');?></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3"><b>AFS CHART </b></div> <div class="col-md-1 col-md-offset-8 text-right"><i class="fa fa-expand" id="chartbutton"></i></div>
|
||||
|
||||
</div>
|
||||
<div id="chartarea">
|
||||
<div>
|
||||
<center><canvas id="myCanvas" width="1000" height="350" style="border:1px solid #d3d3d3;">
|
||||
Your browser does not support the HTML5 canvas tag.</canvas></center>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row"> </div>
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>Inspected By :</label>
|
||||
<input type="text" id="inspector" class="form-control" value="<?php echo $inspector;?>" readonly>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 col-md-offset-6 ">
|
||||
<label>Approved By :</label>
|
||||
<input type="text" id="inspector" class="form-control" value="<?php echo $approvedby;?>" readonly>
|
||||
<!-- <input type="text" id="approvedby" class="form-control"> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row"> </div>
|
||||
<div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
<!-- <div class="box-footer clearfix">
|
||||
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
$('#monthlylisting').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"aaSorting": [[ 0, "asc" ]],
|
||||
"info": true,
|
||||
"autoWidth": true
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
|
||||
var dataset = [];
|
||||
var datalabel = [];
|
||||
for(x=1;x<=11;x++)
|
||||
{
|
||||
var swid = x+'p';
|
||||
var sanddata = document.getElementById(swid).textContent;
|
||||
dataset.push(sanddata);
|
||||
|
||||
var sizeid = x+'size';
|
||||
var sizedata = document.getElementById(sizeid).textContent;
|
||||
datalabel.push(sizedata);
|
||||
}
|
||||
|
||||
|
||||
drawChart(dataset,datalabel);
|
||||
|
||||
}); // End of document on ready funciton
|
||||
|
||||
function drawChart(dataset,datalabel){
|
||||
var c = document.getElementById("myCanvas");
|
||||
var ctx = c.getContext("2d");
|
||||
ctx.clearRect(0, 0, c.width, c.height);
|
||||
var xlabels = datalabel;
|
||||
var xlabelscount = xlabels.length;
|
||||
console.log(xlabelscount);
|
||||
var dataset = dataset;
|
||||
|
||||
Array.prototype.max = function() {
|
||||
return Math.max.apply(null, this);
|
||||
};
|
||||
var maxdataitem = dataset.max();
|
||||
maxdataitem = Math.round((maxdataitem + 10)/5);
|
||||
|
||||
|
||||
var dataset_locationsX = [];
|
||||
var dataset_locationsY = [];
|
||||
|
||||
var canvaswidth = document.getElementById('myCanvas').offsetWidth;
|
||||
var canvasheight = document.getElementById('myCanvas').offsetHeight;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(30,0);
|
||||
ctx.lineTo(30,canvasheight);
|
||||
ctx.strokeStyle="black";
|
||||
ctx.stroke();
|
||||
ctx.closePath();
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0,(canvasheight-30));
|
||||
ctx.lineTo(canvaswidth,(canvasheight-30));
|
||||
ctx.strokeStyle="black";
|
||||
ctx.stroke();
|
||||
ctx.closePath();
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.font = "bold 12px Arial";
|
||||
ctx.fillStyle = "black";
|
||||
ctx.fillText("Sieve Size µm",(canvaswidth/2),(canvasheight-2));
|
||||
ctx.closePath();
|
||||
|
||||
var xaxislabelwidth = (canvaswidth/12);
|
||||
|
||||
var startingpointX = 30;
|
||||
var startingpointY = (canvasheight-30);
|
||||
|
||||
|
||||
for(i=1;i<=xlabelscount;i++) //X DataLabel
|
||||
{
|
||||
ctx.beginPath();
|
||||
ctx.font = "10px Arial";
|
||||
ctx.fillStyle = "black";
|
||||
ctx.fillText(xlabels[i-1],(startingpointX+(xaxislabelwidth * i)),(startingpointY+15));
|
||||
ctx.closePath();
|
||||
}
|
||||
|
||||
|
||||
|
||||
for(i=1;i<=xlabelscount;i++) // X Data
|
||||
{
|
||||
ctx.beginPath();
|
||||
ctx.arc((startingpointX+(xaxislabelwidth * i)),startingpointY,3,0,2*Math.PI);
|
||||
ctx.fillStyle = "black";
|
||||
ctx.fill();
|
||||
ctx.closePath();
|
||||
var xl = (startingpointX+(xaxislabelwidth * i));
|
||||
|
||||
dataset_locationsX.push(xl);
|
||||
|
||||
}
|
||||
|
||||
|
||||
var j = 0;
|
||||
var ylabel = 0;
|
||||
for(i=1;i<=maxdataitem;i++) // y Data and Y labels
|
||||
{
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(startingpointX,(startingpointY-j),3,0,2*Math.PI);
|
||||
ctx.fillStyle = "black";
|
||||
ctx.fill();
|
||||
var yl = ((startingpointY-j));
|
||||
dataset_locationsY.push(yl);
|
||||
ctx.fillStyle = "black";
|
||||
ctx.font = "10px Arial";
|
||||
ctx.fillText((j/7),(startingpointX-30),(startingpointY-j));
|
||||
ylabel = ylabel + 5;
|
||||
j=j+35;
|
||||
ctx.closePath();
|
||||
|
||||
}
|
||||
|
||||
var finallocationofY = [];
|
||||
var finallocationofX = [];
|
||||
for(i=1;i<=xlabelscount;i++) //Exact chart Data Draw red circle
|
||||
{
|
||||
ctx.beginPath();
|
||||
<!-- ctx.arc((parseFloat(dataset_locationsX[i-1])),((startingpointY - parseFloat(dataset[i-1]) * 7)),4,0,2*Math.PI); -->
|
||||
ctx.fillStyle="red";
|
||||
ctx.lineCap = 'round';
|
||||
<!-- ctx.fill(); -->
|
||||
ctx.fillRect((parseFloat(dataset_locationsX[i-1])-5),((startingpointY - parseFloat(dataset[i-1]) * 7)-5),8,8)
|
||||
finallocationofY.push((startingpointY - parseFloat(dataset[i-1]) * 7));
|
||||
finallocationofX.push(parseFloat(dataset_locationsX[i-1]));
|
||||
ctx.closePath();
|
||||
//Draw text for data points
|
||||
ctx.beginPath();
|
||||
ctx.font = "10px Arial";
|
||||
ctx.fillStyle="blue";
|
||||
ctx.fillText(dataset[i-1],(parseFloat(dataset_locationsX[i-1])),((startingpointY - parseFloat(dataset[i-1]) * 7)-10));
|
||||
ctx.closePath();
|
||||
}
|
||||
|
||||
|
||||
for(i=0;i<=xlabelscount;i++) //Exact Chart Data Draw line
|
||||
{
|
||||
|
||||
|
||||
ctx.moveTo(finallocationofX[i],finallocationofY[i]);
|
||||
ctx.lineTo(finallocationofX[i+1],finallocationofY[i+1]);
|
||||
ctx.setLineDash([0,0]);
|
||||
//ctx.strokeStyle="#1a75ff";
|
||||
ctx.lineWidth=3;
|
||||
//setInterval(function(){
|
||||
ctx.stroke();
|
||||
//},30000);
|
||||
|
||||
|
||||
|
||||
}
|
||||
//ctx.beginPath();
|
||||
for(i=1;i<=dataset_locationsY.length;i++) // Drawing Dashed Lines from Y
|
||||
{
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(startingpointX,dataset_locationsY[i]);
|
||||
ctx.lineTo(canvaswidth,dataset_locationsY[i]);
|
||||
ctx.setLineDash([3,6]);
|
||||
ctx.strokeStyle="black";
|
||||
ctx.lineWidth=0.2;
|
||||
ctx.stroke();
|
||||
ctx.closePath();
|
||||
|
||||
}
|
||||
//sctx.closePath();
|
||||
|
||||
|
||||
}
|
||||
|
||||
function PrintFunction()
|
||||
{
|
||||
// var reportid = <?php echo $reportid;?>;
|
||||
// $.ajax({
|
||||
// data:{param1:reportid},
|
||||
// type:"POST",
|
||||
// url:"<?php echo base_url() ?>quality/printReportPDF",
|
||||
// success:function(data) {
|
||||
|
||||
// }
|
||||
// });
|
||||
|
||||
$('#printPDF').attr('action', '<?php echo base_url() ?>quality/printReportPDF');
|
||||
$('#printPDF').attr('method', 'post');
|
||||
$('#printPDF').submit();
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
180
application/views/viewindreportpdf.php
Normal file
180
application/views/viewindreportpdf.php
Normal file
@ -0,0 +1,180 @@
|
||||
|
||||
<?php
|
||||
//print_r($reportdata);
|
||||
$src='';
|
||||
$reportid = '';
|
||||
$invoiceno = '';
|
||||
$invoicedate = '';
|
||||
$customername = '';
|
||||
$product_description = '';
|
||||
$batchno = '';
|
||||
$qty = '';
|
||||
$batchdate = '';
|
||||
$inspector = '';
|
||||
$approvedby = '';
|
||||
if(!empty($reportdata['master'])){
|
||||
foreach($reportdata['master'] as $m)
|
||||
{
|
||||
$src = $m->chartdata;
|
||||
$reportid = $m->testreport_id;
|
||||
$invoiceno = $m->invoiceid;
|
||||
$invoicedate = $m->invoice_date_created;
|
||||
$customername = $m->client_name;
|
||||
$product_description = $m->product_description;
|
||||
$batchno = $m->invoice_custom_fieldvalue;
|
||||
$qty = $m->item_quantity;
|
||||
$batchdate = $m->batchdate;
|
||||
$inspector = $m->FirstName.' '.$m->LastName;
|
||||
$approvedby = $m->approvedby;
|
||||
}
|
||||
}
|
||||
|
||||
$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;" border="1" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr><td colspan="6" style="text-align:center;"><h2>PRE DISPATCH INSPECTION REPORT</h2></td></tr>
|
||||
<tr><td rowspan="5" style="text-align:center;width:20%"><img src="<?php echo base_url().'uploads/images/'.$pic;?>" alt="no image"/></td>
|
||||
<td rowspan="5" style="text-align:center;"><b><?php echo $cname;?></b><br><?php echo $caddress;?></td>
|
||||
<td style="text-align:center;width:30%">CUSTOMER NAME</td>
|
||||
|
||||
<td colspan="6"style="text-align:center;width:100%"><b><?php echo $customername;?></b></td>
|
||||
</tr>
|
||||
<tr><td style="text-align:center;width:10%">MATERIAL NAME</td><td style="text-align:center;width:20%"><b><?php echo $product_description;?><b></td><td style="text-align:center;width:20%">INVOICE NO</td><td style="text-align:center;width:10%"><b><?php echo $invoiceno;?></b></td></tr>
|
||||
<tr><td rowspan="3">Qty</td> <td rowspan="3"> <b><?php echo $qty;?> kgs</b></td> <td>INVOICE DATE</td><td><b><?php echo date_format(date_create($invoicedate),'d-m-Y');?></b></td></tr>
|
||||
<tr><td>Batch NO</td><td><b><?php echo $batchno;?></b></td></tr>
|
||||
<tr><td>BATCH DATE</td><td><b><?php echo date_format(date_create($batchdate),'d-m-Y');?></b></td></tr>
|
||||
</tbody>
|
||||
</table> -->
|
||||
<table style="border-collapse:collapse;border-left-style:hidden;width:100%" border="1" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="6"><h2>PRE DISPATCH INSPECTION 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%" >CUSTOMER NAME</td>
|
||||
<td colspan="3"><b><?php echo $customername;?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2" width="8%">MATERIAL NAME</td>
|
||||
<td rowspan="2" ><b><?php echo $product_description;?></td>
|
||||
<td >INVOICE NO</td>
|
||||
<td ><b><?php echo $invoiceno;?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td >INVOICE DATE</td>
|
||||
<td ><b><?php echo date_format(date_create($invoicedate),'d-m-Y');?></b></td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td rowspan="2" width="8%">QTY</td>
|
||||
<td rowspan="2" ><b><?php echo $qty;?> kgs</b></td>
|
||||
<td >BATCH NO</td>
|
||||
<td ><b><?php echo $batchno;?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td >BATCH DATE</td>
|
||||
<td><b><?php echo date_format(date_create($batchdate),'d-m-Y');?></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="3">S.NO</th><th rowspan="3" width="160">DESCRIPTION</th><th rowspan="2" colspan="3" width="110">SPECIFICATION</th><th colspan="3" width="170">ACT</th> <th rowspan="3" width="50">Average</th> <th rowspan="3" width="110">Results</th> <th rowspan="3" width="90">Remarks</th> </tr> <tr><th rowspan="2">X1</th> <th rowspan="2">X2</th> <th rowspan="2">X3</th></tr><tr><th>Min</th><th>Max</th><th width="46">UOM</th></tr>
|
||||
|
||||
<?php
|
||||
$index = 0;
|
||||
foreach($reportdata['masterreport'] as $master)
|
||||
{
|
||||
$index++;
|
||||
?>
|
||||
<tr> <td><?php echo $index;?></td> <td style="text-align:left;"><?php echo $master->description;?></td><td><?php if($master->min == 0 || $master->min == '') { echo "-"; } else { echo $master->min;} ?></td> <td><?php if($master->max == 0 || $master->max == '') { echo '-'; } else { echo $master->max; }?></td> <td><?php echo $master->UOM;?></td><td><?php if(!empty($master->act1)){ echo $master->act1; }else {echo '0.00';}?></td><td><?php if(!empty($master->act2)){ echo $master->act2; } else {echo '0.00';}?></td> <td><?php if(!empty($master->act3)){ echo $master->act3; } else {echo '0.00';}?></td> <td><?php echo $master->average;?></td> <td><?php echo $master->result;?></td> <td style="text-align:left;"><?php echo $master->remarks;?></td> </tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>L.O.I DETAILS</h3>
|
||||
<table style="border-collapse: collapse;border-left-style:hidden;" border="1" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr><th rowspan="2">S.NO</th><th width="160">HEATING TIME</th><th width="110">TEMP</th><th width="115">CRUCIBLE WEIGHT</th><th>BEFORE HEATING WEIGHT</th><th>AFTER HEATING WEIGHT</th> <th rowspan="2">L.O.I (%)</th><th rowspan="2">Remarks</th> </tr>
|
||||
<tr><th>START TIME - END TIME</th><th>*C</th> <th>W1(g)</th> <th>W2(g)</th> <th>W3(g)</th></tr>
|
||||
<?php
|
||||
$indexx = 0;
|
||||
foreach($reportdata['masterreportloi'] as $loi)
|
||||
{
|
||||
$indexx++;
|
||||
?>
|
||||
<tr> <td><?php echo $indexx;?></td> <td><?php echo $loi->start_time.'~'.$loi->end_time;?></td><td><?php echo $loi->temp;?></td> <td><?php echo $loi->w1;?></td> <td><?php echo $loi->w2;?></td> <td><?php echo $loi->w3;?></td> <td><?php echo $loi->loi_percentage;?></td> <td style="text-align:left;"><?php echo $loi->remarks;?></td></tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>AFS DETAILS</h3>
|
||||
<table style="border-collapse: collapse;border-left-style:hidden;" border="1" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr > <th height="20">S.NO</th> <th width="160">Sieve Size µm </th> <th width="110">SAND WEIGHT</th> <th width="220">Percantage</th> <th width="110">Multiplier</th> <th width="90">Product</th></tr>
|
||||
<?php
|
||||
$ind = 0;
|
||||
$total_sandweight = 0;
|
||||
$totalproduct = 0;
|
||||
foreach($reportdata['masterreportafs'] as $afs)
|
||||
{
|
||||
$ind++;
|
||||
?>
|
||||
<tr> <td><?php echo $ind;?></td> <td id="<?php echo $ind.'size';?>"><?php echo $afs->sieve_size?></td> <td id="<?php echo $ind.'p';?>"><?php echo $afs->sandweight;?></td><td><?php echo $afs->percentage?></td><td ><?php echo $afs->multiplier?></td><td><?php echo $afs->product;?></td></tr>
|
||||
<?php
|
||||
$total_sandweight = $total_sandweight + $afs->sandweight;
|
||||
$totalproduct = $totalproduct + $afs->product;
|
||||
}
|
||||
?>
|
||||
<tr id="12"> <td> </td> <td><b>Total</b></td> <td id="12sw"><?php echo $total_sandweight;?></td><td id="12p"><?php echo $total_sandweight;?></td><td id="12m"> </td><td id="12pt"><?php echo number_format($totalproduct,3,'.','');?></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<div>
|
||||
<!-- <center><canvas id="myCanvas" width="1000" height="350" style="border:1px solid #d3d3d3;"></canvas></center> -->
|
||||
<center><img id="ren" src="<?php echo $src;?>" alt="NO"/></center>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
<br><br>
|
||||
<table >
|
||||
<tr><td>INSPECTOR NAME :<?php echo $inspector;?></td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td>APPROVED BY :<?php echo $approvedby;?></td></tr>
|
||||
<tr><td colspan="2"> </td></tr>
|
||||
<tr><td colspan="2"> </td></tr>
|
||||
|
||||
<tr><td>Signature</td><td> </td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user