materialmaster changes code
This commit is contained in:
parent
1047ec0970
commit
a665dc58e9
@ -14,27 +14,27 @@ class rawmaterialdetails extends BaseController
|
|||||||
/**
|
/**
|
||||||
* This is default constructor of the class
|
* This is default constructor of the class
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->load->model('rawmaterialdetails_model');
|
$this->load->model('rawmaterialdetails_model');
|
||||||
$this->load->library('pagination');
|
$this->load->library('pagination');
|
||||||
$this->load->library('form_validation');
|
$this->load->library('form_validation');
|
||||||
$this->load->library('Excel');
|
$this->load->library('Excel');
|
||||||
|
|
||||||
$this->isLoggedIn();
|
$this->isLoggedIn();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This function used to load the first screen of the user
|
* This function used to load the first screen of the user
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$this->global['pageTitle'] = 'Siddharth : RawMaterialDetails';
|
$this->global['pageTitle'] = 'Siddharth : RawMaterialDetails';
|
||||||
|
|
||||||
$this->loadViews("rawmaterialListing", $this->global, NULL , NULL);
|
$this->loadViews("rawmaterialListing", $this->global, NULL , NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is used to load the RawMaterialDetails list
|
* This function is used to load the RawMaterialDetails list
|
||||||
*/
|
*/
|
||||||
function rawmaterialListing()
|
function rawmaterialListing()
|
||||||
@ -42,8 +42,6 @@ class rawmaterialdetails extends BaseController
|
|||||||
|
|
||||||
$this->load->model('rawmaterialdetails_model');
|
$this->load->model('rawmaterialdetails_model');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$data['userRecords'] = $this->rawmaterialdetails_model->rawmaterialListing();
|
$data['userRecords'] = $this->rawmaterialdetails_model->rawmaterialListing();
|
||||||
|
|
||||||
$this->global['pageTitle'] = 'Siddharth : RawMaterial Listing';
|
$this->global['pageTitle'] = 'Siddharth : RawMaterial Listing';
|
||||||
@ -51,62 +49,78 @@ class rawmaterialdetails extends BaseController
|
|||||||
$this->loadViews("rawmaterialListing", $this->global, $data, NULL);
|
$this->loadViews("rawmaterialListing", $this->global, $data, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This function is used to load the add new cost */
|
* This function is used to load the add new cost */
|
||||||
function addRawMaterial()
|
function addRawMaterial()
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->load->model('rawmaterialdetails_model');
|
$this->load->model('rawmaterialdetails_model');
|
||||||
$data['material'] = $this->rawmaterialdetails_model->getmaterialType();
|
$data['material'] = $this->rawmaterialdetails_model->getmaterialType();
|
||||||
|
$data['materialcategory'] = $this->rawmaterialdetails_model->getmaterialCategory();
|
||||||
$data['UOM'] = $this->rawmaterialdetails_model->getUOM();
|
$data['UOM'] = $this->rawmaterialdetails_model->getUOM();
|
||||||
|
$data['assetcode'] = $this->rawmaterialdetails_model->getAssetcode();
|
||||||
|
$data['costcentercode'] =$this->rawmaterialdetails_model->getcostcentercode();
|
||||||
|
$data['cfUOM'] = $this->rawmaterialdetails_model->getConversionfactorUOM();
|
||||||
$this->global['pageTitle'] = 'siddharth : AddNew RawMaterial';
|
$this->global['pageTitle'] = 'siddharth : AddNew RawMaterial';
|
||||||
|
|
||||||
$this->loadViews("addRawMaterial", $this->global, $data, NULL);
|
$this->loadViews("addRawMaterial", $this->global, $data, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
Validation for Material Type Dropdown
|
/* Validation for Material Type Dropdown */
|
||||||
*/
|
function MaterialType_validate($selectValue)
|
||||||
function MaterialType_validate($selectValue)
|
{
|
||||||
{
|
//echo 'select_validate method called';
|
||||||
//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('MaterialType_validate', 'Please Select Material Type.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else // user picked something
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Validation for Material Type Dropdown */
|
||||||
|
function UOM_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')
|
if($selectValue == '-1')
|
||||||
{
|
{
|
||||||
$this->form_validation->set_message('MaterialType_validate', 'Please Select Material Type.');
|
$this->form_validation->set_message('UOM_validate', 'Please Select UOM.');
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
else // user picked something
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // user picked something
|
|
||||||
{
|
/* Validation for Material Category Dropdown */
|
||||||
return true;
|
function materialcategory_validate($selectValue)
|
||||||
}
|
{
|
||||||
}
|
|
||||||
/*
|
if($selectValue == '0')
|
||||||
Validation for Material Type Dropdown
|
{
|
||||||
*/
|
$this->form_validation->set_message('materialcategory_validate', 'Please Select Material Category.');
|
||||||
function UOM_validate($selectValue)
|
return false;
|
||||||
{
|
}
|
||||||
//echo 'select_validate method called';
|
else
|
||||||
// 'none' is the first option and the text says something like "-Choose one-"
|
{
|
||||||
if($selectValue == '-1')
|
return true;
|
||||||
{
|
}
|
||||||
$this->form_validation->set_message('UOM_validate', 'Please Select UOM.');
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else // user picked something
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* This function is used to add new Cost to the system
|
|
||||||
*/
|
|
||||||
function addNewRawMaterial()
|
function addNewRawMaterial()
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->form_validation->set_rules('MaterialName','Material Name','trim|required|');
|
$this->form_validation->set_rules('MaterialName','Material Name','trim|required|');
|
||||||
$this->form_validation->set_rules('MaterialType','MaterialType','trim|callback_MaterialType_validate');
|
$this->form_validation->set_rules('MaterialType','MaterialType','trim|callback_MaterialType_validate');
|
||||||
$this->form_validation->set_rules('UOM','UOM','trim|callback_UOM_validate');
|
$this->form_validation->set_rules('UOM','UOM','trim|callback_UOM_validate');
|
||||||
|
$this->form_validation->set_rules('MaterialCategory','MaterialCategory','trim|callback__validate');
|
||||||
|
|
||||||
if($this->form_validation->run() == FALSE)
|
if($this->form_validation->run() == FALSE)
|
||||||
{
|
{
|
||||||
@ -117,79 +131,92 @@ class rawmaterialdetails extends BaseController
|
|||||||
$MaterialName = $this->input->post('MaterialName');
|
$MaterialName = $this->input->post('MaterialName');
|
||||||
$MaterialType = $this->input->post('MaterialType');
|
$MaterialType = $this->input->post('MaterialType');
|
||||||
$UOM = $this->input->post('UOM');
|
$UOM = $this->input->post('UOM');
|
||||||
|
$MaterialCategory = $this->input->post('MaterialCategory');
|
||||||
|
$Remarks = $this->input->post('remarks');
|
||||||
|
$AssetCode = $this->input->post('Assetcode');
|
||||||
|
$CostCenterCode = $this->input->post('Costcenter');
|
||||||
|
$ConversionFactor = $this->input->post('conversionfactor');
|
||||||
|
$ConversionFactorUOM = $this->input->post('conversionfactorUOM');
|
||||||
$CreatedBy = $this->session->userdata('userId');
|
$CreatedBy = $this->session->userdata('userId');
|
||||||
|
|
||||||
$chked = $this->input->post('isactive');
|
$chked = $this->input->post('isactive');
|
||||||
|
|
||||||
if( $chked != '')
|
if( $chked != '')
|
||||||
{
|
{
|
||||||
$IsActive = '1';
|
$IsActive = '1';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$IsActive = '0';
|
$IsActive = '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
$RawMaterial = array('MaterialName'=>$MaterialName, 'MaterialType'=>$MaterialType, 'UOM'=>$UOM,'CreatedBy'=>$CreatedBy,'IsActive' => $IsActive);
|
|
||||||
|
|
||||||
|
$RawMaterial = array('MaterialName'=>$MaterialName, 'MaterialType'=>$MaterialType, 'UOM'=>$UOM,'Category'=>$MaterialCategory, 'CreatedBy'=>$CreatedBy,'IsActive' => $IsActive,'assetcode'=>$AssetCode,'CostCenterCode'=>$CostCenterCode,'ConversionFactorUnit'=>$ConversionFactor,'ConversionFactorUOM'=>$ConversionFactorUOM,'Remarks'=>$Remarks);
|
||||||
$result = $this->rawmaterialdetails_model->addNewRawMaterial($RawMaterial);
|
$result = $this->rawmaterialdetails_model->addNewRawMaterial($RawMaterial);
|
||||||
|
|
||||||
if($result > 0)
|
if($result > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
redirect('rawmaterialListing','refresh');
|
redirect('rawmaterialListing','refresh');
|
||||||
echo "<script>alert('RawMaterial Created successfully!');</script>";
|
echo "<script>alert('RawMaterial Created successfully!');</script>";
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
redirect('rawmaterialListing','refresh');
|
redirect('rawmaterialListing','refresh');
|
||||||
echo "<script>alert('RawMaterial Not Created!');</script>";
|
echo "<script>alert('RawMaterial Not Created!');</script>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function viewRawmaterial($RID= '')
|
|
||||||
|
function viewRawmaterial($RID= '')
|
||||||
{
|
{
|
||||||
$MaterialType = '';
|
$MaterialType = '';
|
||||||
$UOM = '';
|
$UOM = '';
|
||||||
if($RID == '')
|
$MaterialCategory = '';
|
||||||
{
|
|
||||||
$RawMaterialID = $_GET['RID'];
|
|
||||||
$MaterialType = $_GET['MType'];
|
if($RID == '')
|
||||||
$UOM = $_GET['UOM'];
|
{
|
||||||
}
|
$RawMaterialID = $_GET['RID'];
|
||||||
else
|
$MaterialType = $_GET['MType'];
|
||||||
{
|
$UOM = $_GET['UOM'];
|
||||||
$RawMaterialID = $RID;
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
$RawMaterialID = $RID;
|
||||||
|
}
|
||||||
|
|
||||||
$data['materialDetails'] = $this->rawmaterialdetails_model->getMaterialDetails($RawMaterialID);
|
$data['materialDetails'] = $this->rawmaterialdetails_model->getMaterialDetails($RawMaterialID);
|
||||||
|
$data['materialType'] = $this->rawmaterialdetails_model->getmaterialType($MaterialType );
|
||||||
$data['materialType'] = $this->rawmaterialdetails_model->getmaterialType($MaterialType );
|
$data['materialCategory'] = $this->rawmaterialdetails_model->getmaterialCategory($MaterialCategory);
|
||||||
$data['UOMList'] = $this->rawmaterialdetails_model->getUOM($UOM);
|
$data['UOMList'] = $this->rawmaterialdetails_model->getUOM($UOM);
|
||||||
|
$data['costcentercode'] =$this->rawmaterialdetails_model->getCostCenterCode();
|
||||||
|
$data['cfUOM'] = $this->rawmaterialdetails_model->getConversionfactorUOM();
|
||||||
|
$data['assetcode'] = $this->rawmaterialdetails_model->getAssetcode();
|
||||||
$this->global['pageTitle'] = 'Siddharth : Edit Material Master';
|
$this->global['pageTitle'] = 'Siddharth : Edit Material Master';
|
||||||
$this->loadViews("editOldRawmaterial", $this->global,$data, NULL);
|
$this->loadViews("editOldRawmaterial", $this->global,$data, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is used to edit the user information
|
* This function is used to edit the user information
|
||||||
*/
|
*/
|
||||||
function editRawmaterial()
|
function editRawmaterial()
|
||||||
{
|
{
|
||||||
if($this->isAdmin() == TRUE)
|
if($this->isAdmin() == TRUE)
|
||||||
{
|
{
|
||||||
$this->loadThis();
|
$this->loadThis();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$RawmaterialID = $this->input->post('MaterialCode');
|
$RawmaterialID = $this->input->post('MaterialCode');
|
||||||
$this->form_validation->set_rules('MaterialName','Material Name','trim|required|');
|
$this->form_validation->set_rules('MaterialName','Material Name','trim|required|');
|
||||||
$this->form_validation->set_rules('MaterialType','MaterialType','trim');
|
$this->form_validation->set_rules('MaterialType','MaterialType','trim');
|
||||||
$this->form_validation->set_rules('UOM','UOM','trim');
|
$this->form_validation->set_rules('UOM','UOM','trim');
|
||||||
|
|
||||||
|
|
||||||
if($this->form_validation->run() == FALSE)
|
if($this->form_validation->run() == FALSE)
|
||||||
{
|
{
|
||||||
$this->viewRawmaterial($RawmaterialID);
|
$this->viewRawmaterial($RawmaterialID);
|
||||||
@ -197,37 +224,44 @@ class rawmaterialdetails extends BaseController
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$MaterialCode = $this->input->post('MaterialCode');
|
$MaterialCode = $this->input->post('MaterialCode');
|
||||||
$MaterialName = $this->input->post('MaterialName');
|
$MaterialName = $this->input->post('MaterialName');
|
||||||
$MaterialType = $this->input->post('MaterialType');
|
$MaterialType = $this->input->post('MaterialType');
|
||||||
|
$MaterialCategory =$this->input->post('MaterialCategory');
|
||||||
$UOM = $this->input->post('UOM');
|
$UOM = $this->input->post('UOM');
|
||||||
|
$rmcode = $this->input->post('RMcode');
|
||||||
|
$Remarks = $this->input->post('remarks');
|
||||||
|
$AssetCode = $this->input->post('Assetcode');
|
||||||
|
$CostCenterCode = $this->input->post('Costcenter');
|
||||||
|
$ConversionFactor = $this->input->post('conversionfactor');
|
||||||
|
$ConversionFactorUOM = $this->input->post('conversionfactorUOM');
|
||||||
$UpdatedBy = $this->session->userdata ('userId');
|
$UpdatedBy = $this->session->userdata ('userId');
|
||||||
$chked = $this->input->post('isactive');
|
$chked = $this->input->post('isactive');
|
||||||
|
|
||||||
if( $chked != '')
|
if( $chked != '')
|
||||||
{
|
{
|
||||||
$IsActive = '1';
|
$IsActive = '1';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$IsActive = '0';
|
$IsActive = '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
$RawMaterial = array();
|
$RawMaterial = array();
|
||||||
$RawMaterial = array('MaterialName'=>$MaterialName,'MaterialType'=>$MaterialType,'UpdatedBy'=>$UpdatedBy, 'UOM'=>$UOM,'IsActive' => $IsActive);
|
$RawMaterial = array('MaterialName'=>$MaterialName,'MaterialType'=>$MaterialType,'UpdatedBy'=>$UpdatedBy, 'UOM'=>$UOM,'IsActive' => $IsActive,'Category'=>$MaterialCategory,'ConversionFactorUnit'=>$ConversionFactor,'ConversionFactorUOM'=>$ConversionFactorUOM,'Remarks'=>$Remarks,'assetcode'=>$AssetCode,'CostCenterCode'=>$CostCenterCode);//,'RMCode'=>$rmcode);
|
||||||
|
//print_r($RawMaterial);die();
|
||||||
$result = $this->rawmaterialdetails_model->editRawmaterial($RawMaterial, $MaterialCode);
|
$result = $this->rawmaterialdetails_model->editRawmaterial($RawMaterial, $MaterialCode);
|
||||||
|
|
||||||
if($result == true)
|
if($result == true)
|
||||||
{
|
{
|
||||||
redirect('rawmaterialListing','refresh');
|
redirect('rawmaterialListing','refresh');
|
||||||
|
|
||||||
echo "<script>alert('RawMaterial Updated successfully!');</script>";
|
echo "<script>alert('RawMaterial Updated successfully!');</script>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
redirect('rawmaterialListing','refresh');
|
redirect('rawmaterialListing','refresh');
|
||||||
echo "<script>alert('RawMaterial Record Not updated!');</script>";
|
echo "<script>alert('RawMaterial Record Not updated!');</script>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,12 +269,13 @@ class rawmaterialdetails extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** this function can be use for excel report **/
|
|
||||||
|
|
||||||
function export_material(){
|
/** this function can be use for excel report **/
|
||||||
|
|
||||||
|
function export_material(){
|
||||||
|
|
||||||
|
|
||||||
$this->load->library('excel');
|
$this->load->library('excel');
|
||||||
$this->excel->setActiveSheetIndex(0)->mergeCells('D3:J3');
|
$this->excel->setActiveSheetIndex(0)->mergeCells('D3:J3');
|
||||||
|
|
||||||
$this->excel->getActiveSheet()->setTitle('Material Master');
|
$this->excel->getActiveSheet()->setTitle('Material Master');
|
||||||
@ -250,9 +285,16 @@ class rawmaterialdetails extends BaseController
|
|||||||
$this->excel->getActiveSheet()->setCellValue('D5', 'MaterialName');
|
$this->excel->getActiveSheet()->setCellValue('D5', 'MaterialName');
|
||||||
$this->excel->getActiveSheet()->setCellValue('E5', 'MaterialType');
|
$this->excel->getActiveSheet()->setCellValue('E5', 'MaterialType');
|
||||||
$this->excel->getActiveSheet()->setCellValue('F5', 'UOM');
|
$this->excel->getActiveSheet()->setCellValue('F5', 'UOM');
|
||||||
$this->excel->getActiveSheet()->setCellValue('G5', 'Created by');
|
$this->excel->getActiveSheet()->setCellValue('G5', 'RMCode');
|
||||||
$this->excel->getActiveSheet()->setCellValue('H5', 'Updated By');
|
$this->excel->getActiveSheet()->setCellValue('H5', 'Category');
|
||||||
$this->excel->getActiveSheet()->setCellValue('I5', 'IsActive');
|
$this->excel->getActiveSheet()->setCellValue('I5', 'assetcode');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('J5', 'CostCenterCode');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('K5', 'ConversionFactorUnit');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('L5', 'ConversionFactorUOM');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('M5', 'Remarks');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('N5', 'Created by');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('O5', 'Updated By');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('P5', 'IsActive');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -263,38 +305,53 @@ class rawmaterialdetails extends BaseController
|
|||||||
$this->excel->getActiveSheet()->getStyle('C5')->getFont()->setBold(true);
|
$this->excel->getActiveSheet()->getStyle('C5')->getFont()->setBold(true);
|
||||||
$this->excel->getActiveSheet()->getStyle('D5')->getFont()->setSize(12);
|
$this->excel->getActiveSheet()->getStyle('D5')->getFont()->setSize(12);
|
||||||
$this->excel->getActiveSheet()->getStyle('D5')->getFont()->setBold(true);
|
$this->excel->getActiveSheet()->getStyle('D5')->getFont()->setBold(true);
|
||||||
$this->excel->getActiveSheet()->getStyle('E5')->getFont()->setSize(12);
|
$this->excel->getActiveSheet()->getStyle('E5')->getFont()->setSize(12);
|
||||||
$this->excel->getActiveSheet()->getStyle('E5')->getFont()->setBold(true);
|
$this->excel->getActiveSheet()->getStyle('E5')->getFont()->setBold(true);
|
||||||
$this->excel->getActiveSheet()->getStyle('F5')->getFont()->setSize(12);
|
$this->excel->getActiveSheet()->getStyle('F5')->getFont()->setSize(12);
|
||||||
$this->excel->getActiveSheet()->getStyle('F5')->getFont()->setBold(true);
|
$this->excel->getActiveSheet()->getStyle('F5')->getFont()->setBold(true);
|
||||||
$this->excel->getActiveSheet()->getStyle('G5')->getFont()->setSize(12);
|
$this->excel->getActiveSheet()->getStyle('G5')->getFont()->setSize(12);
|
||||||
$this->excel->getActiveSheet()->getStyle('G5')->getFont()->setBold(true);
|
$this->excel->getActiveSheet()->getStyle('G5')->getFont()->setBold(true);
|
||||||
$this->excel->getActiveSheet()->getStyle('H5')->getFont()->setSize(12);
|
$this->excel->getActiveSheet()->getStyle('H5')->getFont()->setSize(12);
|
||||||
$this->excel->getActiveSheet()->getStyle('H5')->getFont()->setBold(true);
|
$this->excel->getActiveSheet()->getStyle('H5')->getFont()->setBold(true);
|
||||||
$this->excel->getActiveSheet()->getStyle('I5')->getFont()->setSize(12);
|
$this->excel->getActiveSheet()->getStyle('I5')->getFont()->setSize(12);
|
||||||
$this->excel->getActiveSheet()->getStyle('I5')->getFont()->setBold(true);
|
$this->excel->getActiveSheet()->getStyle('I5')->getFont()->setBold(true);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('J5')->getFont()->setSize(12);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('J5')->getFont()->setBold(true);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('K5')->getFont()->setSize(12);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('K5')->getFont()->setBold(true);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('L5')->getFont()->setSize(12);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('L5')->getFont()->setBold(true);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('M5')->getFont()->setSize(12);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('M5')->getFont()->setBold(true);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('N5')->getFont()->setSize(12);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('N5')->getFont()->setBold(true);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('O5')->getFont()->setSize(12);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('O5')->getFont()->setBold(true);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('P5')->getFont()->setSize(12);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('P5')->getFont()->setBold(true);
|
||||||
|
|
||||||
|
|
||||||
$exportData = $this->rawmaterialdetails_model->export_excel();
|
$exportData = $this->rawmaterialdetails_model->export_excel();
|
||||||
|
// print_r($exportData);die();
|
||||||
if ($exportData) {
|
if ($exportData) {
|
||||||
$i = 6;
|
$i = 6;
|
||||||
$s = 1;
|
$s = 1;
|
||||||
foreach ($exportData as $data) {
|
foreach ($exportData as $data) {
|
||||||
|
|
||||||
$this->excel->getActiveSheet()->setCellValue('C' . $i,$data['MaterialCode']);
|
$this->excel->getActiveSheet()->setCellValue('C' . $i,$data['MaterialCode']);
|
||||||
$this->excel->getActiveSheet()->setCellValue('D' . $i,$data['MaterialName']);
|
$this->excel->getActiveSheet()->setCellValue('D' . $i,$data['MaterialName']);
|
||||||
$this->excel->getActiveSheet()->setCellValue('E' . $i,$data['MaterialType']);
|
$this->excel->getActiveSheet()->setCellValue('E' . $i,$data['MaterialType']);
|
||||||
$this->excel->getActiveSheet()->setCellValue('F' . $i,$data['UOM']);
|
$this->excel->getActiveSheet()->setCellValue('F' . $i,$data['UOM']);
|
||||||
$this->excel->getActiveSheet()->setCellValue('G' . $i,$data['firstname']);
|
$this->excel->getActiveSheet()->setCellValue('G' . $i,$data['RMCode']);
|
||||||
$this->excel->getActiveSheet()->setCellValue('H' . $i,$data['Updated_By']);
|
$this->excel->getActiveSheet()->setCellValue('H' . $i,$data['Category']);
|
||||||
$this->excel->getActiveSheet()->setCellValue('I' . $i,$data['IsActive']);
|
$this->excel->getActiveSheet()->setCellValue('I' . $i,$data['assetcode']);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('J' . $i,$data['CostCenterCode']);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('K' . $i,$data['ConversionFactorUnit']);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('L' . $i,$data['ConversionFactorUOM']);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('M' . $i,$data['Remarks']);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('N' . $i,$data['firstname']);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('O' . $i,$data['Updated_By']);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('P' . $i,$data['IsActive']);
|
||||||
|
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
class rawmaterialdetails_model extends CI_Model
|
class rawmaterialdetails_model extends CI_Model
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is used to get the user listing count
|
* This function is used to get the user listing count
|
||||||
* @param string $searchText : This is optional search text
|
* @param string $searchText : This is optional search text
|
||||||
* @param number $page : This is pagination offset
|
* @param number $page : This is pagination offset
|
||||||
@ -14,57 +14,86 @@ class rawmaterialdetails_model extends CI_Model
|
|||||||
{
|
{
|
||||||
$this->db->select('*');
|
$this->db->select('*');
|
||||||
$this->db->from('T_MaterialMaster');
|
$this->db->from('T_MaterialMaster');
|
||||||
|
|
||||||
|
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
|
|
||||||
$result = $query->result();
|
$result = $query->result();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getUOM($UOM = '')
|
||||||
|
|
||||||
function getUOM($UOM = '')
|
|
||||||
{
|
{
|
||||||
$ConfigID = 'C001';
|
$ConfigID = 'C001';
|
||||||
$this->db->select('ConfigValue');
|
$this->db->select('ConfigValue');
|
||||||
$this->db->from('T_ConfigDetails');
|
$this->db->from('T_ConfigDetails');
|
||||||
$this->db->where('Config_id ',$ConfigID );
|
$this->db->where('Config_id ',$ConfigID );
|
||||||
if($UOM != '')
|
if($UOM != '')
|
||||||
{
|
{
|
||||||
$this->db->where('ConfigValue !=',$UOM );
|
$this->db->where('ConfigValue !=',$UOM );
|
||||||
}
|
}
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
|
|
||||||
return $query->result();
|
return $query->result();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getmaterialType($MaterialType = '')
|
function getmaterialType($MaterialType = '')
|
||||||
{
|
{
|
||||||
$Config_ID = 'C003';
|
$Config_ID = 'C003';
|
||||||
|
$this->db->select('Config_ID,ConfigValue');
|
||||||
$this->db->select('Config_ID,ConfigValue');
|
|
||||||
$this->db->from('T_ConfigDetails');
|
$this->db->from('T_ConfigDetails');
|
||||||
$this->db->where('Config_id',$Config_ID );
|
$this->db->where('Config_id',$Config_ID );
|
||||||
if($MaterialType != '')
|
if($MaterialType != '')
|
||||||
{
|
{
|
||||||
$this->db->where('ConfigValue !=',$MaterialType );
|
$this->db->where('ConfigValue !=',$MaterialType );
|
||||||
}
|
}
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
|
|
||||||
return $query->result();
|
return $query->result();
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
|
//This function used to get the material category using configdetails table
|
||||||
|
function getmaterialCategory($MaterialCategory = '')
|
||||||
|
{
|
||||||
|
$Config_ID = 'C023';
|
||||||
|
$this->db->select('Config_ID,ConfigValue');
|
||||||
|
$this->db->from('T_ConfigDetails');
|
||||||
|
$this->db->where('Config_id',$Config_ID );
|
||||||
|
if($MaterialCategory != '')
|
||||||
|
{
|
||||||
|
$this->db->where('ConfigValue !=',$MaterialCategory );
|
||||||
|
}
|
||||||
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
//This function used to get the conversionfactor using configdetails table
|
||||||
|
function getConversionfactorUOM($ConversionFactorUOM ='')
|
||||||
|
{
|
||||||
|
$Config_ID = 'C024';
|
||||||
|
$this->db->select('Config_ID,ConfigValue');
|
||||||
|
$this->db->from('T_ConfigDetails');
|
||||||
|
$this->db->where('Config_id',$Config_ID );
|
||||||
|
if($ConversionFactorUOM != '')
|
||||||
|
{
|
||||||
|
$this->db->where('ConfigValue !=',$ConversionFactorUOM );
|
||||||
|
}
|
||||||
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//AssetCode
|
||||||
|
/**
|
||||||
* This function used to get user information by id
|
* This function used to get user information by id
|
||||||
* @param number $userId : This is user id
|
* @param number $userId : This is user id
|
||||||
* @return array $result : This is user information
|
* @return array $result : This is user information
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function addNewRawMaterial($RawMaterial='')
|
|
||||||
|
function addNewRawMaterial($RawMaterial='')
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->db->insert('T_MaterialMaster', $RawMaterial);
|
$this->db->insert('T_MaterialMaster', $RawMaterial);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,20 +102,39 @@ function addNewRawMaterial($RawMaterial='')
|
|||||||
* @param number $userId : This is user id
|
* @param number $userId : This is user id
|
||||||
* @return array $result : This is user information
|
* @return array $result : This is user information
|
||||||
*/
|
*/
|
||||||
function getMaterialDetails($MaterialCode)
|
function getMaterialDetails($MaterialCode)
|
||||||
{
|
{
|
||||||
$this->db->select('*');
|
$this->db->select('*');
|
||||||
$this->db->from('T_MaterialMaster');
|
$this->db->from('T_MaterialMaster');
|
||||||
|
|
||||||
$this->db->where('MaterialCode', $MaterialCode);
|
$this->db->where('MaterialCode', $MaterialCode);
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
//sprint_r($this->db->last_query());
|
//sprint_r($this->db->last_query());
|
||||||
return $query->result();
|
return $query->result();
|
||||||
}
|
}
|
||||||
function editRawmaterial($RawMaterial, $MaterialCode)
|
|
||||||
|
function getAssetcode()
|
||||||
{
|
{
|
||||||
|
$this->db->select('AssetCode,AssetName');
|
||||||
|
$this->db->from('T_Asset_Details');
|
||||||
|
//$this->db->where('Assetcode',$Assetcode );
|
||||||
|
//$this->db->where('AssetCode',$Assetcode );
|
||||||
|
$query = $this->db->get();
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getCostCenterCode()//$CostCenterCode='')
|
||||||
|
{
|
||||||
|
$this->db->select('CostCenterCode,CostCenterName');
|
||||||
|
$this->db->from('T_CostCenter_Master');
|
||||||
|
//$this->db->where('CostCenterCode', $CostCenterCode);
|
||||||
|
$query = $this->db->get();
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function editRawmaterial($RawMaterial, $MaterialCode)
|
||||||
|
{
|
||||||
|
|
||||||
$this->db->where('MaterialCode', $MaterialCode);
|
$this->db->where('MaterialCode', $MaterialCode);
|
||||||
$this->db->update('T_MaterialMaster', $RawMaterial);
|
$this->db->update('T_MaterialMaster', $RawMaterial);
|
||||||
@ -94,10 +142,10 @@ function addNewRawMaterial($RawMaterial='')
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function viewrawmaterial($RawMaterial, $MaterialCode)
|
|
||||||
{
|
|
||||||
echo $MaterialCode; //."and".$RawMaterial ;
|
|
||||||
|
|
||||||
|
function viewrawmaterial($RawMaterial, $MaterialCode)
|
||||||
|
{
|
||||||
|
echo $MaterialCode; //."and".$RawMaterial ;
|
||||||
|
|
||||||
$this->db->where('MaterialCode', $MaterialCode);
|
$this->db->where('MaterialCode', $MaterialCode);
|
||||||
$this->db->update('T_MaterialMaster', $RawMaterial);
|
$this->db->update('T_MaterialMaster', $RawMaterial);
|
||||||
@ -105,26 +153,26 @@ function addNewRawMaterial($RawMaterial='')
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function export_excel(){
|
function export_excel(){
|
||||||
|
|
||||||
$this->db->select('det.MaterialCode,det.MaterialName,det.MaterialType,det.UOM,emp.firstname,emp1.firstname as Updated_By,det.IsActive');
|
$this->db->select('det.*,emp.firstname,emp1.firstname as Updated_By,det.IsActive');
|
||||||
$this->db->join('tbl_users as tbl',' det.createdby = tbl.userid','left');
|
$this->db->join('tbl_users as tbl',' det.createdby = tbl.userid','left');
|
||||||
$this->db->join('T_Employee_Details as emp', 'emp.empid=tbl.empid','left');
|
$this->db->join('T_Employee_Details as emp', 'emp.empid=tbl.empid','left');
|
||||||
$this->db->join('tbl_users as tbl1',' det.UpdatedBy = tbl1.userid','left');
|
$this->db->join('tbl_users as tbl1',' det.UpdatedBy = tbl1.userid','left');
|
||||||
$this->db->join('T_Employee_Details as emp1', 'emp1.empid=tbl1.empid','left');
|
$this->db->join('T_Employee_Details as emp1', 'emp1.empid=tbl1.empid','left');
|
||||||
return $this->db->get('T_MaterialMaster as det')->result_array();
|
return $this->db->get('T_MaterialMaster as det')->result_array();
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
|
/**
|
||||||
* This function is used to delete the user information
|
* This function is used to delete the user information
|
||||||
* @param number $userId : This is user id
|
* @param number $userId : This is user id
|
||||||
* @return boolean $result : TRUE / FALSE
|
* @return boolean $result : TRUE / FALSE*/
|
||||||
|
|
||||||
function deletePO($PO, $POinfo)
|
// function deletePO($PO, $POinfo)
|
||||||
{
|
// {
|
||||||
$this->db->where('PO', $PO);
|
// $this->db->where('PO', $PO);
|
||||||
$this->db->update('T_PurchaseOrderDetails', $POInfo);
|
// $this->db->update('T_PurchaseOrderDetails', $POInfo);
|
||||||
|
// return $this->db->affected_rows();
|
||||||
return $this->db->affected_rows();
|
// }
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -1,25 +1,28 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
function BlockSpecial(evt) {
|
function BlockSpecial(evt) {
|
||||||
var charCode;
|
var charCode;
|
||||||
if (window.event)
|
if (window.event
|
||||||
charCode = window.event.keyCode; //for IE
|
charCode = window.event.keyCode; //for IE
|
||||||
else
|
else
|
||||||
charCode = evt.which; //for firefox
|
charCode = evt.which; //for firefox
|
||||||
|
|
||||||
if (charCode >= 91 && charCode <= 96)
|
if (charCode >= 91 && charCode <= 96)
|
||||||
return false;
|
|
||||||
if (charCode >= 123 && charCode <= 126)
|
|
||||||
return false;
|
|
||||||
if (charCode >= 33 && charCode <= 47)
|
|
||||||
return false;
|
return false;
|
||||||
if (charCode >= 58&& charCode <= 64)
|
if (charCode >= 123 && charCode <= 126)
|
||||||
|
return false;
|
||||||
|
if (charCode >= 33 && charCode <= 47)
|
||||||
|
return false;
|
||||||
|
if (charCode >= 58&& charCode <= 64)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
@ -34,33 +37,30 @@ function BlockSpecial(evt) {
|
|||||||
<section class="content">
|
<section class="content">
|
||||||
<div style="text-align:right;">
|
<div style="text-align:right;">
|
||||||
<a href="<?php echo base_url() ?>rawmaterialdetails/rawmaterialListing" class="btn btn-info" value="Back"/>Back</a>
|
<a href="<?php echo base_url() ?>rawmaterialdetails/rawmaterialListing" class="btn btn-info" value="Back"/>Back</a>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- left column -->
|
<!-- left column -->
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<!-- general form elements -->
|
<!-- general form elements -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
|
|
||||||
<!-- form start -->
|
<!-- form start -->
|
||||||
|
|
||||||
<form id="addUser" action="<?php echo base_url() ?>rawmaterialdetails/addNewRawMaterial" method="post" role="form">
|
<form id="addUser" action="<?php echo base_url() ?>rawmaterialdetails/addNewRawMaterial" method="post" role="form">
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="row">
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="MaterialName">Material Name</span><font color="Red">*</font>
|
||||||
|
<input type="text" class="form-control required " onkeypress="return BlockSpecial(event);" onchange="hello()" required id="MaterialName" name="MaterialName" maxlength="255">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<span for="MaterialName">Material Name</span>
|
<span for="MaterialType">Material Type</span><font color="Red">*</font>
|
||||||
<input type="text" class="form-control required " onkeypress="return BlockSpecial(event);" required id="MaterialName" name="MaterialName" maxlength="255">
|
<select class="form-control required select2" id="MaterialType" name="MaterialType">
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="form-group">
|
|
||||||
<span for="MaterialType">Material Type</span>
|
|
||||||
<select class="form-control required" id="MaterialType" name="MaterialType">
|
|
||||||
<option value="-1" required>Select Material Type</option>
|
<option value="-1" required>Select Material Type</option>
|
||||||
<?php
|
<?php
|
||||||
if(!empty($material))
|
if(!empty($material))
|
||||||
@ -76,10 +76,30 @@ function BlockSpecial(evt) {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<span for="UOM">Unit of Measurement</span>
|
<span for="MaterialCategory">Material Category</span><font color="Red">*</font>
|
||||||
<select class="form-control required" id="UOM" name="UOM">
|
<select class="form-control required select2" id="MaterialCategory" name="MaterialCategory" onchange="changeTextBox()">
|
||||||
|
<option value="0" requried>Select Material Category</option>
|
||||||
|
<?php
|
||||||
|
if(!empty($materialcategory))
|
||||||
|
{
|
||||||
|
foreach ($materialcategory as $MC)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $MC->ConfigValue ?>"><?php echo $MC->ConfigValue ?></option>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="UOM">Unit of Measurement</span><font color="Red">*</font>
|
||||||
|
<select class="form-control required select2" id="UOM" name="UOM">
|
||||||
<option value="-1" required>Select UOM</option>
|
<option value="-1" required>Select UOM</option>
|
||||||
<?php
|
<?php
|
||||||
if(!empty($UOM))
|
if(!empty($UOM))
|
||||||
@ -94,17 +114,90 @@ function BlockSpecial(evt) {
|
|||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="Assetcode">Asset Code</span>
|
||||||
|
<select class="form-control required select2" id="Assetcode" name="Assetcode">
|
||||||
|
<option value="0">Select Asset Code</option>
|
||||||
|
<?php
|
||||||
|
if(!empty($assetcode))
|
||||||
|
{
|
||||||
|
foreach ($assetcode as $AC)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $AC->AssetCode ?>"><?php echo $AC->AssetCode ?> - <?php echo $AC->AssetName ?></option>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="Costcenter">Cost Center Code</span>
|
||||||
|
<select class="form-control select2" id="Costcenter" name="Costcenter">
|
||||||
|
<option value="0">Select Cost Center</option>
|
||||||
|
<?php
|
||||||
|
if(!empty($costcentercode))
|
||||||
|
{
|
||||||
|
foreach ($costcentercode as $CC)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $CC->CostCenterCode ?>"><?php echo $CC->CostCenterCode ?> - <?php echo $CC->CostCenterName?></option>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="conversionfactor">Conversion Factor</span>
|
||||||
|
<input type="text" class="form-control" id="conversionfactor" name="conversionfactor" maxlength="255">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="conversionfactorUOM">Conversion Factor UOM</span>
|
||||||
|
<select class="form-control select2" id="conversionfactorUOM" name="conversionfactorUOM">
|
||||||
|
<option value="0">Select Conversion Factor UOM</option>
|
||||||
|
<?php
|
||||||
|
if(!empty($cfUOM))
|
||||||
|
{
|
||||||
|
foreach ($cfUOM as $cfuom)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $cfuom->ConfigValue; ?>"><?php echo $cfuom->ConfigValue ?></option>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-9">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="remarks">Remarks</span>
|
||||||
|
<input type="text" class="form-control" id="remarks" name="remarks" maxlength="255">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<span for="Active">IsActive</span> <br>
|
<span for="Active">IsActive</span> <br>
|
||||||
<input type="checkbox" id="isactive" name="isactive" >
|
<input type="checkbox" id="isactive" name="isactive" >
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div><!-- /.box-body -->
|
</div><!-- /.box-body -->
|
||||||
|
|
||||||
@ -149,3 +242,28 @@ function BlockSpecial(evt) {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script src="<?php echo base_url(); ?>assets/js/addUser.js" type="text/javascript"></script>
|
<script src="<?php echo base_url(); ?>assets/js/addUser.js" type="text/javascript"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
$("#MaterialType").select2();
|
||||||
|
|
||||||
|
$("#MaterialCategory").select2();
|
||||||
|
$("#UOM").select2();
|
||||||
|
$("#Assetcode").select2();
|
||||||
|
$("#Costcenter").select2();
|
||||||
|
$("#conversionfactorUOM").select2();
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
function changeTextBox() {
|
||||||
|
var x = document.getElementById("MaterialCategory");
|
||||||
|
if(x.value=='Spares')
|
||||||
|
{
|
||||||
|
document.getElementById("Assetcode").disabled=false;
|
||||||
|
document.getElementById("Costcenter").disabled=false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
document.getElementById("Assetcode").disabled=true;
|
||||||
|
document.getElementById("Costcenter").disabled=true; }
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -3,7 +3,14 @@
|
|||||||
$MaterialCode = '';
|
$MaterialCode = '';
|
||||||
$MaterialName = '';
|
$MaterialName = '';
|
||||||
$MaterialType = '';
|
$MaterialType = '';
|
||||||
|
$MaterialCategory = '';
|
||||||
$UOM = '';
|
$UOM = '';
|
||||||
|
$Assetcode ='';
|
||||||
|
$costcenter='';
|
||||||
|
$remarks='';
|
||||||
|
$conversionfactorUOM='';
|
||||||
|
$conversionactor ='';
|
||||||
|
$RMCode = '';
|
||||||
$IsActive = '';
|
$IsActive = '';
|
||||||
|
|
||||||
if(!empty($materialDetails))
|
if(!empty($materialDetails))
|
||||||
@ -13,23 +20,82 @@ if(!empty($materialDetails))
|
|||||||
$MaterialCode = $MD->MaterialCode;
|
$MaterialCode = $MD->MaterialCode;
|
||||||
$MaterialName = $MD->MaterialName;
|
$MaterialName = $MD->MaterialName;
|
||||||
$MaterialType = $MD->MaterialType;
|
$MaterialType = $MD->MaterialType;
|
||||||
|
$MaterialCategory = $MD->Category;
|
||||||
$UOM = $MD->UOM;
|
$UOM = $MD->UOM;
|
||||||
$chk = $MD->IsActive;
|
$Assetcode = $MD->assetcode;
|
||||||
|
$costcenter = $MD->CostCenterCode;
|
||||||
|
$remarks = $MD->Remarks;
|
||||||
|
$conversionfactor = $MD->ConversionFactorUnit;
|
||||||
|
$conversionfactorUOM = $MD->ConversionFactorUOM;
|
||||||
|
$RMCode = $MD->RMCode;
|
||||||
|
$chk = $MD->IsActive;
|
||||||
|
|
||||||
if($chk == 1)
|
if($chk == 1)
|
||||||
{
|
{
|
||||||
$IsActive = 'checked';
|
$IsActive = 'checked';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$IsActive = '';
|
$IsActive = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
//$("#MaterialType").select2();
|
||||||
|
//$("#MaterialCategory").select2();
|
||||||
|
$("#UOM").select2();
|
||||||
|
$("#Assetcode").select2();
|
||||||
|
$("#Costcenter").select2();
|
||||||
|
$("#conversionfactorUOM").select2();
|
||||||
|
|
||||||
|
var x = $("#MaterialCategory").val() == 'Spares';
|
||||||
|
if(x)
|
||||||
|
{
|
||||||
|
document.getElementById("Assetcode").disabled=false;
|
||||||
|
document.getElementById("Costcenter").disabled=false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//alert('i am a else part');
|
||||||
|
document.getElementById("Assetcode").disabled=true;
|
||||||
|
document.getElementById("Costcenter").disabled=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// $(function() {
|
||||||
|
// $('#MaterialCategory').change(function() {
|
||||||
|
// var x = $(this).val();
|
||||||
|
// alert(x);
|
||||||
|
// $('#mchiddenfield').val(x);
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
function changeTextBox() {
|
||||||
|
//alert('changeTextBox entered');
|
||||||
|
var x = document.getElementById("MaterialCategory");
|
||||||
|
if(x.value=='Spares')
|
||||||
|
{
|
||||||
|
//alert('i am an if part');
|
||||||
|
document.getElementById("Assetcode").disabled=false;
|
||||||
|
document.getElementById("Costcenter").disabled=false;}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//alert('i am a else part');
|
||||||
|
document.getElementById("Assetcode").disabled=true;
|
||||||
|
document.getElementById("Costcenter").disabled=true;}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
@ -42,8 +108,8 @@ if(!empty($materialDetails))
|
|||||||
<section class="content">
|
<section class="content">
|
||||||
<div style="text-align:right;">
|
<div style="text-align:right;">
|
||||||
<a href="<?php echo base_url() ?>rawmaterialdetails/rawmaterialListing" class="btn btn-info" value="Back"/>Back</a>
|
<a href="<?php echo base_url() ?>rawmaterialdetails/rawmaterialListing" class="btn btn-info" value="Back"/>Back</a>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- left column -->
|
<!-- left column -->
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
@ -60,37 +126,74 @@ if(!empty($materialDetails))
|
|||||||
<form role="form" action="<?php echo base_url() ?>rawmaterialdetails/editRawmaterial" method="post" id="editRawmaterial" role="form">
|
<form role="form" action="<?php echo base_url() ?>rawmaterialdetails/editRawmaterial" method="post" id="editRawmaterial" role="form">
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-12">
|
||||||
<div class="form-group">
|
|
||||||
<label for="MaterialName">Material Name</label>
|
<div class="col-md-3">
|
||||||
<input type="text" class="form-control required " id="MaterialName" name="MaterialName" maxlength="255" value="<?php echo $MaterialName;?>">
|
<div class="form-group">
|
||||||
<input type="hidden" class="form-control required " id="MaterialCode" value="<?php echo $MaterialCode;?>"name="MaterialCode" maxlength="255">
|
<span for="RMcode">RM code</span>
|
||||||
</div>
|
<input type="text" class="form-control" readonly id="RMcode" name="RMcode" maxlength="255" value="<?php echo $RMCode;?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
</div>
|
||||||
<div class="form-group">
|
<div class="col-md-3">
|
||||||
<label for="MaterialType">Material Type</label>
|
<div class="form-group">
|
||||||
<select class="form-control required" id="MaterialType" name="MaterialType">
|
<span for="MaterialName">Material Name</span><font color="Red">*</font>
|
||||||
<option value="<?php echo $MaterialType;?> "><?php echo $MaterialType;?></option>
|
<input type="text" class="form-control required " id="MaterialName" name="MaterialName" maxlength="255" value="<?php echo $MaterialName;?>">
|
||||||
<?php
|
<input type="hidden" class="form-control required " id="MaterialCode" value="<?php echo $MaterialCode;?>"name="MaterialCode" maxlength="255">
|
||||||
if(!empty($materialType))
|
</div>
|
||||||
{
|
</div>
|
||||||
foreach ($materialType as $MID)
|
|
||||||
|
<div class="col-md-3" style="padding:0px;">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="MaterialType">Material Type</span>
|
||||||
|
<input type="text" class="form-control" readonly id="MaterialType" name="MaterialType" value="<?php echo $MaterialType;?>">
|
||||||
|
<!-- <select class="form-control select2" id="MaterialType" name="MaterialType" readonly="true">
|
||||||
|
|
||||||
|
<option value="<?php echo $MaterialType;?> "><?php echo $MaterialType;?></option>
|
||||||
|
<?php
|
||||||
|
if(!empty($materialType))
|
||||||
{
|
{
|
||||||
?>
|
foreach ($materialType as $MID)
|
||||||
<option value="<?php echo $MID->ConfigValue ?>"><?php echo $MID->ConfigValue ?></option>
|
{
|
||||||
<?php
|
?>
|
||||||
|
<option value="<?php echo $MID->ConfigValue ?>"><?php echo $MID->ConfigValue ?></option>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
?>
|
||||||
?>
|
</select>
|
||||||
</select>
|
-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="MaterialCategory">Material Category</span>
|
||||||
|
<input type="text" class="form-control" readonly id="MaterialCategory" name="MaterialCategory" value="<?php echo $MaterialCategory;?>" onChange="changeTextBox();">
|
||||||
|
<!-- <select class="form-control readonly select2" id="MaterialCategory" name="MaterialCategory" onChange="changeTextBox();">
|
||||||
|
<option value="<?php echo $MaterialCategory;?> "><?php echo $MaterialCategory;?></option>
|
||||||
|
<?php
|
||||||
|
if(!empty($materialCategory))
|
||||||
|
{
|
||||||
|
foreach ($materialCategory as $MC)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $MC->ConfigValue ?>"><?php echo $MC->ConfigValue ?></option>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
--> <!-- <input type='hidden' id='mchiddenfield' name='mchiddenfield' value=''> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="UOM">Unit of Measurement</label>
|
<span for="UOM">Unit of Measurement</span><font color="Red">*</font>
|
||||||
<select class="form-control required" id="UOM" name="UOM">
|
<select class="form-control required select2" id="UOM" name="UOM">
|
||||||
<option value="<?php echo $UOM;?>" ><?php echo $UOM;?></option>
|
<option value="<?php echo $UOM;?>"><?php echo $UOM;?></option>
|
||||||
<?php
|
<?php
|
||||||
if(!empty($UOMList))
|
if(!empty($UOMList))
|
||||||
{
|
{
|
||||||
@ -104,13 +207,94 @@ if(!empty($materialDetails))
|
|||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="form-group">
|
|
||||||
<span for="Active">IsActive</span> <br>
|
|
||||||
<input type="checkbox" id="isactive" name="isactive" <?php echo $IsActive; ?> >
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="assetcode">Asset Code</span>
|
||||||
|
<select class="form-control select2" id="Assetcode" name="Assetcode" disabled="disabled">
|
||||||
|
<option value="<?php echo $Assetcode;?>"><?php echo $Assetcode;?></option>
|
||||||
|
<?php
|
||||||
|
if(!empty($assetcode))
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach($assetcode as $AC)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $AC->AssetCode ?>"><?php echo $AC->AssetCode ?> - <?php echo $AC->AssetName ?></option>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="costcenter">Cost Center Code</span>
|
||||||
|
<select class="form-control select2" id="Costcenter" name="Costcenter" disabled="disabled">
|
||||||
|
<option><?php echo $costcenter;?></option>
|
||||||
|
<?php
|
||||||
|
if(!empty($costcentercode))
|
||||||
|
{
|
||||||
|
foreach ($costcentercode as $CC)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $CC->CostCenterCode ?>"><?php echo $CC->CostCenterCode ?> - <?php echo $CC->CostCenterName?></option>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="conversionfactor">Conversion Factor</span>
|
||||||
|
<input type="text" class="form-control" id="conversionfactor" name="conversionfactor" maxlength="255" value="<?php echo $conversionfactor;?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="conversionfactorUOM">Conversion Factor UOM</span>
|
||||||
|
<select class="form-control select2" id="conversionfactorUOM" name="conversionfactorUOM">
|
||||||
|
<option value="<?php echo $conversionfactorUOM;?>"><?php echo $conversionfactorUOM;?></option>
|
||||||
|
<?php
|
||||||
|
if(!empty($cfUOM))
|
||||||
|
{
|
||||||
|
foreach ($cfUOM as $cfuom)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $cfuom->ConfigValue; ?>"><?php echo $cfuom->ConfigValue ?>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
<div class="col-md-9">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="remarks">Remarks</span>
|
||||||
|
<input type="text" class="form-control" id="remarks" name="remarks" maxlength="255" value="<?php echo $remarks;?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<span for="Active">IsActive</span> <br/>
|
||||||
|
<input type="checkbox" id="isactive" name="isactive" <?php echo $IsActive; ?> >
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -16,23 +16,29 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
|
|||||||
<div class="col-xs-12 text-right">
|
<div class="col-xs-12 text-right">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<a class="btn btn-primary" href="<?php echo base_url(); ?>addRawmaterial">Add New Material</a>
|
<a class="btn btn-primary" href="<?php echo base_url(); ?>addRawmaterial">Add New Material</a>
|
||||||
<a class="btn btn-primary" href="<?php echo base_url(); ?>rawmaterialdetails/export_material">Export Material Master <i class="fa fa-download"aira-hidden="true"></i></a>
|
<a class="btn btn-primary" href="<?php echo base_url(); ?>rawmaterialdetails/export_material">Export Material Master <i class="fa fa-download"aira-hidden="true"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
|
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Material Code</th>
|
<th>Material Code</th>
|
||||||
|
<th>Raw Material Code</th>
|
||||||
<th>Material Description</th>
|
<th>Material Description</th>
|
||||||
<th>Type of Material</th>
|
<th>Type of Material</th>
|
||||||
<th>Unit Of Measurement</th>
|
<th>Unit Of Measurement</th>
|
||||||
|
<th>Material Category</th>
|
||||||
|
<th>Conversion Factor</th>
|
||||||
|
<th>Conversion Factor UOM</th>
|
||||||
|
<th>Asset Code</th>
|
||||||
|
<th>Cost Center</th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
if(!empty($userRecords))
|
if(!empty($userRecords))
|
||||||
{
|
{
|
||||||
@ -41,26 +47,33 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
|
|||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td><u><a href="<?php echo base_url().'rawmaterialdetails/viewRawmaterial/?RID='.$record->MaterialCode.'&MType='.$record->MaterialType.'&UOM='.$record->UOM ; ?>" data-toggle="tooltip" title="<?php echo $record->MaterialCode; ?> - Click here to view Material details"><?php echo $record->MaterialCode ?> </a></u></td>
|
|
||||||
|
<td><u><a href="<?php echo base_url().'rawmaterialdetails/viewRawmaterial?RID='.$record->MaterialCode.'&MType='.$record->MaterialType.'&UOM='.$record->UOM ?>" data-toggle="tooltip" title="<?php echo $record->MaterialCode; ?> - Click here to view Material details"><?php echo $record->MaterialCode ?> </a></u></td>
|
||||||
|
<td><?php echo $record->RMCode ?></td>
|
||||||
<td><?php echo $record->MaterialName ?></td>
|
<td><?php echo $record->MaterialName ?></td>
|
||||||
<td><?php echo $record->MaterialType ?></td>
|
<td><?php echo $record->MaterialType ?></td>
|
||||||
<td><?php echo $record->UOM ?></td>
|
<td><?php echo $record->UOM ?></td>
|
||||||
|
<td><?php echo $record->Category ?></td>
|
||||||
|
<td><?php echo $record->ConversionFactorUnit ?></td>
|
||||||
|
<td><?php echo $record->ConversionFactorUOM ?></td>
|
||||||
|
<td><?php echo $record->assetcode ?></td>
|
||||||
|
<td><?php echo $record->CostCenterCode ?></td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
|
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
$('#datatable').DataTable({
|
$('#datatable').DataTable({
|
||||||
"paging": true,
|
"paging": true,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user