date format for employee,supplier and asset screen
This commit is contained in:
parent
96b89a2685
commit
0263b8286e
@ -210,14 +210,14 @@ class assetdetails extends BaseController
|
|||||||
$Location = $this->input->post('Location');
|
$Location = $this->input->post('Location');
|
||||||
$User = $this->input->post('User');
|
$User = $this->input->post('User');
|
||||||
$SupplierName = $this->input->post('SupplierName');
|
$SupplierName = $this->input->post('SupplierName');
|
||||||
|
|
||||||
$DateOfCommission = $this->input->post('DateOfCommission');
|
$DateOfCommission = $this->input->post('DateOfCommission');
|
||||||
$CreatedBy = $this->session->userdata('userId');
|
$CreatedBy = $this->session->userdata('userId');
|
||||||
$AssetValue = $this->input->post('Assetvalue');
|
$AssetValue = $this->input->post('Assetvalue');
|
||||||
|
|
||||||
if($DateOfCommission != '')
|
if($DateOfCommission != '')
|
||||||
{
|
{
|
||||||
$DOCommission= $this->getDateformat($DateOfCommission);
|
$DOCommission= $this->dateformat($DateOfCommission);
|
||||||
|
//$DOCommission= $this->getDateformat($DateOfCommission);
|
||||||
}
|
}
|
||||||
$AssetStatus = $this->input->post('AssetStatus');
|
$AssetStatus = $this->input->post('AssetStatus');
|
||||||
$Remarks = $this->input->post('Remarks');
|
$Remarks = $this->input->post('Remarks');
|
||||||
@ -318,9 +318,9 @@ class assetdetails extends BaseController
|
|||||||
$this->form_validation->set_rules('Location','Location','trim|required');
|
$this->form_validation->set_rules('Location','Location','trim|required');
|
||||||
$this->form_validation->set_rules('User','User','trim|required');
|
$this->form_validation->set_rules('User','User','trim|required');
|
||||||
$this->form_validation->set_rules('SupplierName','SupplierName','trim|callback_Supplier_validate');
|
$this->form_validation->set_rules('SupplierName','SupplierName','trim|callback_Supplier_validate');
|
||||||
$this->form_validation->set_rules('DateOfCommission','DateOfCommission','trim|required');
|
$this->form_validation->set_rules('DateOfCommission','DateOfCommission','trim|required');
|
||||||
$this->form_validation->set_rules('Assetvalue','Assetvalue','trim|required');
|
$this->form_validation->set_rules('Assetvalue','Assetvalue','trim|required');
|
||||||
$this->form_validation->set_rules('AssetStatus','AssetStatus','trim|callback_Asset_validate');
|
$this->form_validation->set_rules('AssetStatus','AssetStatus','trim|callback_Asset_validate');
|
||||||
|
|
||||||
if($this->form_validation->run() == FALSE)
|
if($this->form_validation->run() == FALSE)
|
||||||
{
|
{
|
||||||
@ -336,17 +336,23 @@ class assetdetails extends BaseController
|
|||||||
$Location = $this->input->post('Location');
|
$Location = $this->input->post('Location');
|
||||||
$User = $this->input->post('User');
|
$User = $this->input->post('User');
|
||||||
$SupplierName = $this->input->post('SupplierName');
|
$SupplierName = $this->input->post('SupplierName');
|
||||||
|
$DateOfPurchase = $this->input->post('DateOfPurchase');
|
||||||
|
if($DateOfPurchase != '')
|
||||||
|
{
|
||||||
|
$DOpurchase = $this->dateformat($DateOfPurchase);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// $DateOfPurchase = $DateOfPurchase ->format('d-m-y');
|
|
||||||
$DateOfCommission = $this->input->post('DateOfCommission');
|
$DateOfCommission = $this->input->post('DateOfCommission');
|
||||||
$UpdatedBy = $this->session->userdata('userId');
|
$UpdatedBy = $this->session->userdata('userId');
|
||||||
$Assetvalue = $this->input->post('Assetvalue');
|
$Assetvalue = $this->input->post('Assetvalue');
|
||||||
|
|
||||||
if($DateOfCommission != '')
|
if($DateOfCommission != '')
|
||||||
{
|
{
|
||||||
$DOCommission= $this->getDateformat($DateOfCommission);
|
|
||||||
}
|
//$DOCommission= $this->getDateformat($DateOfCommission);
|
||||||
|
$DOCommission= $this->dateformat($DateOfCommission);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$AssetStatus = $this->input->post('AssetStatus');
|
$AssetStatus = $this->input->post('AssetStatus');
|
||||||
@ -370,9 +376,7 @@ class assetdetails extends BaseController
|
|||||||
$asset = array();
|
$asset = array();
|
||||||
|
|
||||||
|
|
||||||
$asset = array('AssetName'=>$AssetName, 'Description'=>$Description,'DEPCode'=>$Department,'Location'=>$Location,'UserName'=>$User,'SupplierCode'=>$SupplierName,'DateOfCommison'=>$DOCommission,'AssetValue'=>$Assetvalue,'AssetStatus'=>$AssetStatus,'IsActive'=>$IsActive,'Remarks'=>$Remarks,'UpdatedBy'=>$UpdatedBy,'PONO'=>$PONO,'POLineItem'=>$lineitem,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity);
|
$asset = array('AssetName'=>$AssetName, 'Description'=>$Description,'DEPCode'=>$Department,'Location'=>$Location,'UserName'=>$User,'SupplierCode'=>$SupplierName,'DateOfPurchase'=>$DOpurchase,'DateOfCommison'=>$DOCommission,'AssetValue'=>$Assetvalue,'AssetStatus'=>$AssetStatus,'IsActive'=>$IsActive,'Remarks'=>$Remarks,'UpdatedBy'=>$UpdatedBy,'PONO'=>$PONO,'POLineItem'=>$lineitem,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity);
|
||||||
|
|
||||||
//print_r($asset);die();
|
|
||||||
|
|
||||||
$result = $this->assetdetails_model->editasset($asset, $Asset_Code);
|
$result = $this->assetdetails_model->editasset($asset, $Asset_Code);
|
||||||
|
|
||||||
@ -398,6 +402,22 @@ class assetdetails extends BaseController
|
|||||||
return $retDate;
|
return $retDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//this function used to dateformat to store in db
|
||||||
|
function dateformat($DateValue)
|
||||||
|
{
|
||||||
|
$date = DateTime::createFromFormat('d/m/Y', $DateValue);//we should give the date as per DatePicker format.
|
||||||
|
|
||||||
|
//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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function export_asset(){
|
function export_asset(){
|
||||||
|
|
||||||
|
|||||||
@ -238,15 +238,14 @@ class employeedetails extends BaseController
|
|||||||
$Picture = $this->add();
|
$Picture = $this->add();
|
||||||
|
|
||||||
$FirstName = $this->input->post('FirstName');
|
$FirstName = $this->input->post('FirstName');
|
||||||
$LastName = $this->input->post('LastName');
|
$LastName = $this->input->post('LastName');
|
||||||
$FatherName = $this->input->post('FatherName');
|
$FatherName = $this->input->post('FatherName');
|
||||||
$DateofBirth = $this->input->post('DateofBirth');
|
$DateofBirth = $this->input->post('DateofBirth');
|
||||||
$ContactNumber = $this->input->post('ContactNumber');
|
$ContactNumber = $this->input->post('ContactNumber');
|
||||||
$EmailId = $this->input->post('emailid');
|
$EmailId = $this->input->post('emailid');
|
||||||
$comEmailId = $this->input->post('comemailid');
|
$comEmailId = $this->input->post('comemailid');
|
||||||
$Gender = $this->input->post('gender');
|
$Gender = $this->input->post('gender');
|
||||||
$MartialStatus = $this->input->post('MartialStatus');
|
$MartialStatus = $this->input->post('MartialStatus');
|
||||||
|
|
||||||
$BloodGroup = $this->input->post('bloodgroup');
|
$BloodGroup = $this->input->post('bloodgroup');
|
||||||
$CurrentAddress = $this->input->post('currentaddress');
|
$CurrentAddress = $this->input->post('currentaddress');
|
||||||
$permanentaddress = $this->input->post('permanentaddress');
|
$permanentaddress = $this->input->post('permanentaddress');
|
||||||
@ -267,7 +266,7 @@ class employeedetails extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$eduqualifaction = $this->input->post('eduqualifaction');
|
$eduqualifaction = $this->input->post('eduqualifaction');
|
||||||
$addqualification = $this->input->post('addqualification');
|
$addqualification = $this->input->post('addqualification');
|
||||||
$referredby = $this->input->post('referredby');
|
$referredby = $this->input->post('referredby');
|
||||||
$referrercontno = $this->input->post('referrercontno');
|
$referrercontno = $this->input->post('referrercontno');
|
||||||
$accountno = $this->input->post('accountno');
|
$accountno = $this->input->post('accountno');
|
||||||
@ -287,18 +286,18 @@ class employeedetails extends BaseController
|
|||||||
|
|
||||||
if($licenseExpiryDate != '')
|
if($licenseExpiryDate != '')
|
||||||
{
|
{
|
||||||
$License_ExpiryDate = $this->getDateformat($licenseExpiryDate);
|
$License_ExpiryDate = $this->dateformat($licenseExpiryDate);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$License_ExpiryDate = null;
|
$License_ExpiryDate = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$DOB = $this->getDateformat($DateofBirth);
|
$DOB = $this->dateformat($DateofBirth);
|
||||||
$DOJ = $this->getDateformat($dateofjoining);
|
$DOJ = $this->dateformat($dateofjoining);
|
||||||
if($ValidTill != '')
|
if($ValidTill != '')
|
||||||
{
|
{
|
||||||
$Valid = $this->getDateformat($ValidTill);
|
$Valid = $this->dateformat($ValidTill);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -337,6 +336,22 @@ echo "<script>alert('Record Not Saved!');</script>";
|
|||||||
return $retDate;
|
return $retDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//this function used to dateformat to store in db
|
||||||
|
function dateformat($DateValue)
|
||||||
|
{
|
||||||
|
$date = DateTime::createFromFormat('d/m/Y', $DateValue);//we should give the date as per DatePicker format.
|
||||||
|
|
||||||
|
//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 load the add new Employee form with dropdown values */
|
* This function is used to load the add new Employee form with dropdown values */
|
||||||
function addemployee()
|
function addemployee()
|
||||||
@ -550,9 +565,14 @@ echo "<script>alert('Record Not Saved!');</script>";
|
|||||||
{
|
{
|
||||||
$EmpId = $this->input->post('employeeid');
|
$EmpId = $this->input->post('employeeid');
|
||||||
$this->load->library('form_validation');
|
$this->load->library('form_validation');
|
||||||
|
//$mail = $this->this->.post('emailid');
|
||||||
|
|
||||||
$this->form_validation->set_rules('ContactNumber', 'ContactNumber', 'trim|required|min_length[10]|max_length[10]');
|
$this->form_validation->set_rules('ContactNumber', 'ContactNumber', 'trim|required|min_length[10]|max_length[10]');
|
||||||
|
//if($mail == ''){
|
||||||
$this->form_validation->set_rules('emailid', 'emailid', 'trim');
|
$this->form_validation->set_rules('emailid', 'emailid', 'trim');
|
||||||
|
//}else{
|
||||||
|
//$this->form_validation->set_rules('emailid', 'emailid', 'trim|callback_checkMailEmp');
|
||||||
|
//}
|
||||||
$this->form_validation->set_rules('gender', 'gender', 'callback_Gender_validate');
|
$this->form_validation->set_rules('gender', 'gender', 'callback_Gender_validate');
|
||||||
$this->form_validation->set_rules('MartialStatus', 'MartialStatus', 'callback_Martial_validate');
|
$this->form_validation->set_rules('MartialStatus', 'MartialStatus', 'callback_Martial_validate');
|
||||||
$this->form_validation->set_rules('bloodgroup', 'bloodgroup', 'callback_Blood_validate');
|
$this->form_validation->set_rules('bloodgroup', 'bloodgroup', 'callback_Blood_validate');
|
||||||
@ -619,7 +639,7 @@ echo "<script>alert('Record Not Saved!');</script>";
|
|||||||
$Previousexperience = $pre_experience;
|
$Previousexperience = $pre_experience;
|
||||||
}
|
}
|
||||||
$eduqualifaction = $this->input->post('eduqualifaction');
|
$eduqualifaction = $this->input->post('eduqualifaction');
|
||||||
$addqualification = $this->input->post('addqualification');
|
$addqualification = $this->input->post('addqualification');
|
||||||
$referredby = $this->input->post('referredby');
|
$referredby = $this->input->post('referredby');
|
||||||
$referrercontno = $this->input->post('referrercontno');
|
$referrercontno = $this->input->post('referrercontno');
|
||||||
$accountno = $this->input->post('accountno');
|
$accountno = $this->input->post('accountno');
|
||||||
@ -631,7 +651,7 @@ echo "<script>alert('Record Not Saved!');</script>";
|
|||||||
$passportno = $this->input->post('passportno');
|
$passportno = $this->input->post('passportno');
|
||||||
$ValidTill = $this->input->post('ValidTill');
|
$ValidTill = $this->input->post('ValidTill');
|
||||||
$addinfo = $this->input->post('addinfo');
|
$addinfo = $this->input->post('addinfo');
|
||||||
$driverlicense = $this->input->post ( 'Driverlicense' );
|
$driverlicense = $this->input->post ( 'Driverlicense' );
|
||||||
$licenseExpiryDate = $this->input->post ( 'LicenseExpiryDate' );
|
$licenseExpiryDate = $this->input->post ( 'LicenseExpiryDate' );
|
||||||
$VoterID = $this->input->post ( 'VoterID' );
|
$VoterID = $this->input->post ( 'VoterID' );
|
||||||
$chked = $this->input->post('isactive');
|
$chked = $this->input->post('isactive');
|
||||||
@ -648,11 +668,11 @@ echo "<script>alert('Record Not Saved!');</script>";
|
|||||||
$UpdatedBY = $this->session->userdata ( 'userId' );
|
$UpdatedBY = $this->session->userdata ( 'userId' );
|
||||||
|
|
||||||
//$licenseExpiryDate = $this->getDateformat($licenseExpiryDate);
|
//$licenseExpiryDate = $this->getDateformat($licenseExpiryDate);
|
||||||
$DOB = $this->getDateformat($DateofBirth);
|
$DOB = $this->dateformat($DateofBirth);
|
||||||
$DOJ = $this->getDateformat($dateofjoining);
|
$DOJ = $this->dateformat($dateofjoining);
|
||||||
if($ValidTill != '')
|
if($ValidTill != '')
|
||||||
{
|
{
|
||||||
$Valid = $this->getDateformat($ValidTill);
|
$Valid = $this->dateformat($ValidTill);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -661,7 +681,7 @@ echo "<script>alert('Record Not Saved!');</script>";
|
|||||||
|
|
||||||
if($licenseExpiryDate != '')
|
if($licenseExpiryDate != '')
|
||||||
{
|
{
|
||||||
$License_ExpiryDate = $this->getDateformat($licenseExpiryDate);
|
$License_ExpiryDate = $this->dateformat($licenseExpiryDate);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -671,7 +691,6 @@ echo "<script>alert('Record Not Saved!');</script>";
|
|||||||
//echo $DOB;
|
//echo $DOB;
|
||||||
$Employee = array('FirstName'=>$FirstName, 'LastName'=>$LastName,'FatherName'=>$FatherName,'Gender'=>$Gender,'DateofBirth'=>$DOB,'ContactNumber'=>$ContactNumber,'EmailId'=>$EmailId,'BloodGroup'=>$BloodGroup,'MartialStatus'=>$MartialStatus,'DateofJoining'=>$DOJ,'PreviousYearsOfExp'=>$Previousexperience,'Designation'=>$desigination,'Departmentcode'=>$departmentCode,'PresentAddress'=>$CurrentAddress,'PermanentAddress'=>$permanentaddress,'EmergencyContactName'=>$emergencycontactname,'EmergencyContactNumber'=>$emergencycontactnumber,'Edu_Qualification'=>$eduqualifaction,'Additional_Qualification'=>$addqualification,'AadharNo'=>$aadharno,'PANNo'=>$panno,'BankAccountNo'=>$accountno,'IFSCCode'=>$ifsccode,'BankBranchName'=>$bankbranchname,'BankAddress'=>$bankaddress,'PassportNo'=>$passportno,'Passport_Valid_till'=>$Valid,'IsActive'=>$IsActive,'ProfilePic'=>$Picture,'Reference_Name'=>$referredby,'Reference_ContactNumber'=>$referrercontno,'Remarks'=>$addinfo,'UpdatedBY'=>$UpdatedBY,'personalEmailId'=>$comEmailId,'DriverLicense'=>$driverlicense,'LicenseValidtill'=>$License_ExpiryDate,'VoterID'=>$VoterID);
|
$Employee = array('FirstName'=>$FirstName, 'LastName'=>$LastName,'FatherName'=>$FatherName,'Gender'=>$Gender,'DateofBirth'=>$DOB,'ContactNumber'=>$ContactNumber,'EmailId'=>$EmailId,'BloodGroup'=>$BloodGroup,'MartialStatus'=>$MartialStatus,'DateofJoining'=>$DOJ,'PreviousYearsOfExp'=>$Previousexperience,'Designation'=>$desigination,'Departmentcode'=>$departmentCode,'PresentAddress'=>$CurrentAddress,'PermanentAddress'=>$permanentaddress,'EmergencyContactName'=>$emergencycontactname,'EmergencyContactNumber'=>$emergencycontactnumber,'Edu_Qualification'=>$eduqualifaction,'Additional_Qualification'=>$addqualification,'AadharNo'=>$aadharno,'PANNo'=>$panno,'BankAccountNo'=>$accountno,'IFSCCode'=>$ifsccode,'BankBranchName'=>$bankbranchname,'BankAddress'=>$bankaddress,'PassportNo'=>$passportno,'Passport_Valid_till'=>$Valid,'IsActive'=>$IsActive,'ProfilePic'=>$Picture,'Reference_Name'=>$referredby,'Reference_ContactNumber'=>$referrercontno,'Remarks'=>$addinfo,'UpdatedBY'=>$UpdatedBY,'personalEmailId'=>$comEmailId,'DriverLicense'=>$driverlicense,'LicenseValidtill'=>$License_ExpiryDate,'VoterID'=>$VoterID);
|
||||||
|
|
||||||
//print_r($Employee);die();
|
|
||||||
$result = $this->employeedetails_model->UpdateEmployee($Employee,$EmpId);
|
$result = $this->employeedetails_model->UpdateEmployee($Employee,$EmpId);
|
||||||
|
|
||||||
if($result > 0)
|
if($result > 0)
|
||||||
@ -701,10 +720,12 @@ echo "<script>alert('Record Not Updated!');</script>";
|
|||||||
|
|
||||||
$this->load->library('excel');
|
$this->load->library('excel');
|
||||||
$this->excel->setActiveSheetIndex(0)->mergeCells('L3:S3');
|
$this->excel->setActiveSheetIndex(0)->mergeCells('L3:S3');
|
||||||
|
$this->excel->setActiveSheetIndex(0)->getStyle('L3')->getAlignment()->applyFromArray(array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,));
|
||||||
|
|
||||||
$this->excel->getActiveSheet()->setTitle('Employee details');
|
$this->excel->getActiveSheet()->setTitle('Employee details');
|
||||||
|
|
||||||
$this->excel->getActiveSheet()->setCellValue('L3', 'SIDDHARTH INDUSTRIES Employee Details');
|
$this->excel->getActiveSheet()->setCellValue('L3', 'SIDDHARTH INDUSTRIES Employee Details');
|
||||||
|
|
||||||
$this->excel->getActiveSheet()->setCellValue('A5', 'EmpID');
|
$this->excel->getActiveSheet()->setCellValue('A5', 'EmpID');
|
||||||
$this->excel->getActiveSheet()->setCellValue('B5', 'FirstName-LastName');
|
$this->excel->getActiveSheet()->setCellValue('B5', 'FirstName-LastName');
|
||||||
$this->excel->getActiveSheet()->setCellValue('C5', 'FatherName');
|
$this->excel->getActiveSheet()->setCellValue('C5', 'FatherName');
|
||||||
@ -854,7 +875,7 @@ echo "<script>alert('Record Not Updated!');</script>";
|
|||||||
$this->excel->getActiveSheet()->setCellValue('B'. $i,$data['FirstName'].'-'.$data['LastName']);
|
$this->excel->getActiveSheet()->setCellValue('B'. $i,$data['FirstName'].'-'.$data['LastName']);
|
||||||
$this->excel->getActiveSheet()->setCellValue('C'. $i,$data['FatherName']);
|
$this->excel->getActiveSheet()->setCellValue('C'. $i,$data['FatherName']);
|
||||||
$this->excel->getActiveSheet()->setCellValue('D'. $i,$data['Gender']);
|
$this->excel->getActiveSheet()->setCellValue('D'. $i,$data['Gender']);
|
||||||
$this->excel->getActiveSheet()->setCellValue('E'. $i,$data['DateofBirth'],PHPExcel_Cell_DataType::TYPE_STRING);
|
$this->excel->getActiveSheet()->setCellValue('E'. $i,$data['DateofBirth']);
|
||||||
$this->excel->getActiveSheet()->setCellValue('F'. $i,$data['ContactNumber']);
|
$this->excel->getActiveSheet()->setCellValue('F'. $i,$data['ContactNumber']);
|
||||||
$this->excel->getActiveSheet()->setCellValue('G'. $i,$data['EmailId']);
|
$this->excel->getActiveSheet()->setCellValue('G'. $i,$data['EmailId']);
|
||||||
$this->excel->getActiveSheet()->setCellValue('H'. $i,$data['BloodGroup']);
|
$this->excel->getActiveSheet()->setCellValue('H'. $i,$data['BloodGroup']);
|
||||||
|
|||||||
@ -219,7 +219,9 @@ class supplier extends BaseController
|
|||||||
$CSTDate = null;
|
$CSTDate = null;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$CSTDate = $this->getDateformat($CSTDt);
|
|
||||||
|
$CSTDate = $this->dateformat($CSTDt);
|
||||||
|
//$CSTDate = $this->getDateformat($CSTDt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -269,6 +271,24 @@ class supplier extends BaseController
|
|||||||
$retDate = $date->format('Y-m-d H:i:s');
|
$retDate = $date->format('Y-m-d H:i:s');
|
||||||
return $retDate;
|
return $retDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//this function used to dateformat to store in db
|
||||||
|
function dateformat($DateValue)
|
||||||
|
{
|
||||||
|
$date = DateTime::createFromFormat('d/m/Y', $DateValue);//we should give the date as per DatePicker format.
|
||||||
|
|
||||||
|
//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
|
* This function is used to edit the Supplier information
|
||||||
*/
|
*/
|
||||||
@ -332,8 +352,8 @@ class supplier extends BaseController
|
|||||||
$CSTDt = $this->input->post('dateofCST');
|
$CSTDt = $this->input->post('dateofCST');
|
||||||
|
|
||||||
if($CSTDt != '')
|
if($CSTDt != '')
|
||||||
{
|
{$CSTDate = $this->dateformat($CSTDt);
|
||||||
$CSTDate = $this->getDateformat($CSTDt);
|
//$CSTDate = $this->getDateformat($CSTDt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -357,7 +377,7 @@ class supplier extends BaseController
|
|||||||
$supplier = array();
|
$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);
|
$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);
|
//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);
|
||||||
// print_r($supplier);die();
|
|
||||||
$result = $this->supplier_model->UpdateSupplier($supplier, $supplierID);
|
$result = $this->supplier_model->UpdateSupplier($supplier, $supplierID);
|
||||||
|
|
||||||
|
|
||||||
@ -406,6 +426,7 @@ class supplier extends BaseController
|
|||||||
|
|
||||||
$this->load->library('excel');
|
$this->load->library('excel');
|
||||||
$this->excel->setActiveSheetIndex(0)->mergeCells('J3:R3');
|
$this->excel->setActiveSheetIndex(0)->mergeCells('J3:R3');
|
||||||
|
$this->excel->setActiveSheetIndex(0)->getStyle('J3')->getAlignment()->applyFromArray(array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,));
|
||||||
|
|
||||||
$this->excel->getActiveSheet()->setTitle('Supplier details');
|
$this->excel->getActiveSheet()->setTitle('Supplier details');
|
||||||
|
|
||||||
@ -413,7 +434,6 @@ class supplier extends BaseController
|
|||||||
|
|
||||||
$this->excel->getActiveSheet()->setCellValue('A5', 'SupplierID');
|
$this->excel->getActiveSheet()->setCellValue('A5', 'SupplierID');
|
||||||
$this->excel->getActiveSheet()->setCellValue('B5', 'SupplierName');
|
$this->excel->getActiveSheet()->setCellValue('B5', 'SupplierName');
|
||||||
// $this->execl->getActiveSheet()->setCellValue( '' , '');
|
|
||||||
$this->excel->getActiveSheet()->setCellValue('C5', 'Address');
|
$this->excel->getActiveSheet()->setCellValue('C5', 'Address');
|
||||||
$this->excel->getActiveSheet()->setCellValue('D5', 'ContactNumber');
|
$this->excel->getActiveSheet()->setCellValue('D5', 'ContactNumber');
|
||||||
$this->excel->getActiveSheet()->setCellValue('E5', 'AlternateContactNumber');
|
$this->excel->getActiveSheet()->setCellValue('E5', 'AlternateContactNumber');
|
||||||
|
|||||||
@ -58,7 +58,6 @@ if(!empty($EmpDetails))
|
|||||||
$DOB = $from ->format('d/m/Y');
|
$DOB = $from ->format('d/m/Y');
|
||||||
$ContactNumber = $Emp->ContactNumber;
|
$ContactNumber = $Emp->ContactNumber;
|
||||||
$EmailId = $Emp->EmailId;
|
$EmailId = $Emp->EmailId;
|
||||||
//$comEmailId = $Emp->comEmailId;
|
|
||||||
$BloodGroup = $Emp->BloodGroup;
|
$BloodGroup = $Emp->BloodGroup;
|
||||||
$MartialStatus =$Emp->MartialStatus;
|
$MartialStatus =$Emp->MartialStatus;
|
||||||
$DateofJoining = $Emp->DateofJoining;
|
$DateofJoining = $Emp->DateofJoining;
|
||||||
@ -82,27 +81,34 @@ if(!empty($EmpDetails))
|
|||||||
$BankAddress = $Emp->BankAddress;
|
$BankAddress = $Emp->BankAddress;
|
||||||
$PassportNo = $Emp->PassportNo;
|
$PassportNo = $Emp->PassportNo;
|
||||||
$Passport_Valid_till = $Emp->Passport_Valid_till;
|
$Passport_Valid_till = $Emp->Passport_Valid_till;
|
||||||
if($Passport_Valid_till != '')
|
if($Passport_Valid_till != '' && $Passport_Valid_till != '0000-00-00 00:00:00')
|
||||||
{
|
{
|
||||||
$dtpassport = new DateTime($Passport_Valid_till);
|
$dtpassport = new DateTime($Passport_Valid_till);
|
||||||
$DOPassport = $dtpassport ->format('d/m/Y');
|
$DOPassport = $dtpassport ->format('d/m/Y');
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
$DOPassport = '';
|
||||||
|
}
|
||||||
|
|
||||||
$isactive = $Emp->IsActive;
|
$isactive = $Emp->IsActive;
|
||||||
//print_r($isactive);
|
|
||||||
$ProfilePic = $Emp->ProfilePic;
|
$ProfilePic = $Emp->ProfilePic;
|
||||||
$Reference_Name = $Emp->Reference_Name;
|
$Reference_Name = $Emp->Reference_Name;
|
||||||
$Reference_ContactNumber = $Emp->Reference_ContactNumber;
|
$Reference_ContactNumber = $Emp->Reference_ContactNumber;
|
||||||
$Remarks = $Emp->Remarks;
|
$Remarks = $Emp->Remarks;
|
||||||
$personalEmailId = $Emp->personalEmailId;
|
$personalEmailId = $Emp->personalEmailId;
|
||||||
$DriverLicense = $Emp->DriverLicense;
|
$DriverLicense = $Emp->DriverLicense;
|
||||||
|
$VoterID = $Emp->VoterID;
|
||||||
|
|
||||||
$VoterID = $Emp->VoterID;
|
if($Emp->LicenseValidtill != '' && $Emp->LicenseValidtill != '0000-00-00 00:00:00')
|
||||||
|
|
||||||
if($Emp->LicenseValidtill != '')
|
|
||||||
{
|
{
|
||||||
$License = new DateTime($Emp->LicenseValidtill);
|
$License = new DateTime($Emp->LicenseValidtill);
|
||||||
$LicenseValidtill = $License ->format('d/m/Y');
|
$LicenseValidtill = $License ->format('d/m/Y');
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$LicenseValidtill = '';
|
||||||
|
}
|
||||||
//$chk = $uf->IsActive;
|
//$chk = $uf->IsActive;
|
||||||
if($isactive == 1)
|
if($isactive == 1)
|
||||||
{
|
{
|
||||||
@ -112,9 +118,6 @@ if(!empty($EmpDetails))
|
|||||||
{
|
{
|
||||||
$IsActive = '';
|
$IsActive = '';
|
||||||
}
|
}
|
||||||
// //$dtLicenseValidtill = new DateTime($LicenseValidtill);
|
|
||||||
//$LicenseValidtill = $dtLicenseValidtill ->format('Y-m-d');
|
|
||||||
//$LicenseValidtill = $Emp->
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -477,20 +480,20 @@ $(function() {
|
|||||||
$("#DateofBirth").datepicker({
|
$("#DateofBirth").datepicker({
|
||||||
minDate : new Date(mindt,1,1),
|
minDate : new Date(mindt,1,1),
|
||||||
maxDate : new Date(maxdt,1,1),
|
maxDate : new Date(maxdt,1,1),
|
||||||
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
dateFormat: 'dd/mm/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
$("#dateofjoining").datepicker({
|
$("#dateofjoining").datepicker({
|
||||||
minDate : new Date(year-SIAStartYear,1,1),
|
minDate : new Date(year-SIAStartYear,1,1),
|
||||||
maxDate :'now',
|
maxDate :'now',
|
||||||
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,
|
dateFormat: 'dd/mm/yy',changeMonth: true, changeYear: true,
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
$("#ValidTill").datepicker({dateFormat: 'mm/dd/yy',minDate :'now',changeMonth: true, changeYear: true,yearRange: '-0:+100'
|
$("#ValidTill").datepicker({dateFormat: 'dd/mm/yy',minDate :'now',changeMonth: true, changeYear: true,yearRange: '-0:+100'
|
||||||
});
|
});
|
||||||
$("#LicenseExpiryDate").datepicker({dateFormat: 'mm/dd/yy',minDate :'now',changeMonth: true, changeYear: true,yearRange: '-0:+100'
|
$("#LicenseExpiryDate").datepicker({dateFormat: 'dd/mm/yy',minDate :'now',changeMonth: true, changeYear: true,yearRange: '-0:+100'
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -23,6 +23,7 @@ $Quantity='';
|
|||||||
$UOM = '';
|
$UOM = '';
|
||||||
$MaterialName='';
|
$MaterialName='';
|
||||||
$DeliveryDate='';
|
$DeliveryDate='';
|
||||||
|
$DDate = '';
|
||||||
if(!empty($assetList))
|
if(!empty($assetList))
|
||||||
{
|
{
|
||||||
foreach ($assetList as $Asset)
|
foreach ($assetList as $Asset)
|
||||||
@ -38,13 +39,24 @@ if(!empty($assetList))
|
|||||||
$SupplierName = $Asset->SupplierName;
|
$SupplierName = $Asset->SupplierName;
|
||||||
$SupplierCode = $Asset->SupplierCode;
|
$SupplierCode = $Asset->SupplierCode;
|
||||||
$DateOfPurchase = $Asset->DateOfPurchase;//print_r($Asset->DateOfPurchase);
|
$DateOfPurchase = $Asset->DateOfPurchase;//print_r($Asset->DateOfPurchase);
|
||||||
$PODate = new DateTime($DateOfPurchase);
|
if($DateOfPurchase != '' && $DateOfPurchase != '0000-00-00 00:00:00' ) {
|
||||||
$DateOfPurchase = $PODate->format('d/m/Y');
|
$PODate = new DateTime($DateOfPurchase);
|
||||||
//print_r($Asset->DateOfCommison);
|
$DateOfPurchase = $PODate->format('d/m/Y');
|
||||||
//$assetDate = new DateTime($DateOfCommison);
|
}
|
||||||
$DateOfCommission= new DateTime($Asset->DateOfCommison, new DateTimeZone('Asia/Kolkata'));
|
else {
|
||||||
$DateOfCommison = $DateOfCommission->format('d/m/Y');
|
$DateOfPurchase = '';
|
||||||
$AssetValue = $Asset->AssetValue;
|
}
|
||||||
|
$DateOfCommison = $Asset->DateOfCommison;
|
||||||
|
if($DateOfCommison != '' && $DateOfCommison != '0000-00-00 00:00:00' ) {
|
||||||
|
$DateOfCommission= new DateTime($Asset->DateOfCommison, new DateTimeZone('Asia/Kolkata'));
|
||||||
|
$DateOfCommison = $DateOfCommission->format('d/m/Y');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$DateOfCommison = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$AssetValue = $Asset->AssetValue;
|
||||||
$AssetStatus = $Asset->AssetStatus;
|
$AssetStatus = $Asset->AssetStatus;
|
||||||
$MaterialCode = $Asset->MaterialCode;
|
$MaterialCode = $Asset->MaterialCode;
|
||||||
$PONO = $Asset->PONO;
|
$PONO = $Asset->PONO;
|
||||||
@ -52,12 +64,19 @@ if(!empty($assetList))
|
|||||||
$Quantity = $Asset->Quantity;
|
$Quantity = $Asset->Quantity;
|
||||||
$MaterialName = $Asset->MaterialName;
|
$MaterialName = $Asset->MaterialName;
|
||||||
$UOM = $Asset->UOM;
|
$UOM = $Asset->UOM;
|
||||||
$DDate = new DateTime($Asset->DeliveryDate, new DateTimeZone('Asia/Kolkata'));
|
$DDt = $Asset->DeliveryDate;
|
||||||
//$PODelivery = new DateTime($DeliveryDate);//print_r($Asset->DeliveryDate);
|
|
||||||
$DeliveryDate = $DDate ->format('d/m/Y');
|
if($DDate != '' && $DDate != '0000-00-00 00:00:00'){
|
||||||
//print_r($DateOfPurchase);print_r($DateOfCommison);print_r($DeliveryDate);
|
$DDate = new DateTime($DDt, new DateTimeZone('Asia/Kolkata'));
|
||||||
|
$DeliveryDate = $DDate->format('d/m/Y');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$DeliveryDate = '';
|
||||||
|
}
|
||||||
|
|
||||||
$Remarks = $Asset->Remarks;
|
$Remarks = $Asset->Remarks;
|
||||||
$chk = $Asset->IsActive;
|
$chk = $Asset->IsActive;
|
||||||
|
|
||||||
if($chk == 1)
|
if($chk == 1)
|
||||||
{
|
{
|
||||||
@ -68,11 +87,11 @@ if(!empty($assetList))
|
|||||||
$IsActive = '';
|
$IsActive = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($DateOfPurchase != '')
|
// if($DateOfPurchase != '')
|
||||||
{
|
// {
|
||||||
$dtpurchase = new DateTime($DateOfPurchase);
|
// $dtpurchase = new DateTime($DateOfPurchase);
|
||||||
$DOPurchase = $dtpurchase ->format('d/m/Y');
|
// $DOPurchase = $dtpurchase ->format('d/m/Y');
|
||||||
}
|
// }
|
||||||
// if($DateOfCommission != '')
|
// if($DateOfCommission != '')
|
||||||
// {
|
// {
|
||||||
// $dtCommission = new DateTime($DateOfCommission);
|
// $dtCommission = new DateTime($DateOfCommission);
|
||||||
@ -102,7 +121,7 @@ $(function() {
|
|||||||
$("#DateOfCommission").datepicker({
|
$("#DateOfCommission").datepicker({
|
||||||
minDate : new Date(year-SIAStartYear,1,1),
|
minDate : new Date(year-SIAStartYear,1,1),
|
||||||
maxDate :'now',
|
maxDate :'now',
|
||||||
dateFormat: 'dd/mm//yy',changeMonth: true, changeYear: true,
|
dateFormat: 'dd/mm/yy',changeMonth: true, changeYear: true,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -55,18 +55,15 @@ if(!empty($supplier))
|
|||||||
$CSTNO = $uf->CSTNO;
|
$CSTNO = $uf->CSTNO;
|
||||||
$CSTDt = $uf->CSTDate;
|
$CSTDt = $uf->CSTDate;
|
||||||
|
|
||||||
if($CSTDt != '')
|
if($CSTDt != '' && $CSTDt != '0000-00-00 00:00:00' )
|
||||||
{
|
|
||||||
if ($CSTDt == "0000-00-00 00:00:00" )
|
|
||||||
{
|
{
|
||||||
$CSTDate = "";
|
$dtCST = new DateTime($CSTDt);
|
||||||
|
$CSTDate = $dtCST ->format('d/m/Y');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$dtCST = new DateTime($CSTDt);
|
$CSTDate = "";
|
||||||
$CSTDate = $dtCST ->format('d/m/Y');
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$chk = $uf->IsActive;
|
$chk = $uf->IsActive;
|
||||||
@ -527,11 +524,11 @@ function onlyAlphabets(evt) {
|
|||||||
<div class="col-md-5" style="padding:0px;">
|
<div class="col-md-5" style="padding:0px;">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<span for="IMSNo">IMS Number</span>
|
<span for="IMSNo">IMS Number</span>
|
||||||
<input type="text" class="form-control " id="IMSNo" name="IMSNo" value="<?php echo $IMSNo;?>"maxlength="10">
|
<input type="text" class="form-control " id="IMSNo" name="IMSNo" value="<?php echo $IMSNo;?>" maxlength="10">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<span for="ISONo">ISO Number</span>
|
<span for="ISONo">ISO Number</span>
|
||||||
<input type="text" class="form-control " id="ISONo" name="ISONo" value="<?php echo $ISONo;?>"maxlength="10">
|
<input type="text" class="form-control " id="ISONo" name="ISONo" value="<?php echo $ISONo;?>" maxlength="10">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2 ">
|
<div class="col-md-2 ">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user