diff --git a/application/controllers/assetdetails.php b/application/controllers/assetdetails.php index d07a958e..f9ce432f 100644 --- a/application/controllers/assetdetails.php +++ b/application/controllers/assetdetails.php @@ -61,6 +61,7 @@ class assetdetails extends BaseController $this->load->model('assetdetails_model'); $data['SupplierName'] = $this->assetdetails_model->getSupplierName(); + $data['Department'] = $this->assetdetails_model->getDepartment(); //$data['POdate'] = $this->assetdetails_model->getPODate(); $this->global['pageTitle'] = 'siddharth : Add Asset'; @@ -84,13 +85,12 @@ class assetdetails extends BaseController $this->form_validation->set_rules('Description','Description','trim'); $this->form_validation->set_rules('Department','Department','trim'); $this->form_validation->set_rules('Location','Location','trim'); - $this->form_validation->set_rules('AssetOwner','AssetOwner','trim'); + $this->form_validation->set_rules('User','User','trim'); $this->form_validation->set_rules('SupplierName','SupplierName','trim'); $this->form_validation->set_rules('DateOfPurchase','DateOfPurchase','trim'); $this->form_validation->set_rules('DateOfCommission','DateOfCommission','trim'); - $this->form_validation->set_rules('SupportVendor','SupportVendor','trim'); - $this->form_validation->set_rules('SupportFrom','SupportFrom','trim'); - $this->form_validation->set_rules('SupportTo','SupportTo','trim'); + $this->form_validation->set_rules('AssetValue','AssetValue','trim'); + @@ -104,29 +104,29 @@ class assetdetails extends BaseController $Description = $this->input->post('Description'); $Department = $this->input->post('Department'); $Location = $this->input->post('Location'); - $AssetOwner = $this->input->post('AssetOwner'); + $User = $this->input->post('User'); $SupplierName = $this->input->post('SupplierName'); $DateOfPurchase = $this->input->post('DateOfPurchase'); $DateOfCommission = $this->input->post('DateOfCommission'); - $SupportVendor = $this->input->post('SupportVendor'); - $SupportFrom = $this->input->post('SupportFrom'); - $SupportTo = $this->input->post('SupportTo'); + $Createdby = $this->input->post('Createdby'); + $AssetValue = $this->input->post('AssetValue'); - $asset = array('Asset_Name'=>$AssetName, 'Description'=>$Description,'Department'=>$Department,'Location'=>$Location,'AssetOwner'=>$AssetOwner,'SupplierName'=>$SupplierName,'DateOfPurchase'=>$DateOfPurchase,'DateOfCommission'=>$DateOfCommission,'SupportVendor'=>$SupportVendor,'SupportFrom'=>$SupportFrom,'SupportTo'=>$SupportTo,'createdDate'=>date('Y-m-d H:i:sa')); + + $asset = array('Asset_Name'=>$AssetName, 'Description'=>$Description,'Department'=>$Department,'Location'=>$Location,'User'=>$User,'SupplierName'=>$SupplierName,'DateOfPurchase'=>$DateOfPurchase,'DateOfCommission'=>$DateOfCommission,'AssetValue'=>$AssetValue,'Createdby'=>$Createdby,'createdDate'=>date('Y-m-d H:i:sa')); $this->load->model('assetdetails_model'); $result = $this->assetdetails_model->addNewasset($asset); if($result > 0) { - $this->session->set_flashdata('success', 'New PO created successfully'); + $this->session->set_flashdata('success', 'New Asset created successfully'); } else { - $this->session->set_flashdata('error', 'PO Not Create'); + $this->session->set_flashdata('error', 'Asset Not Create'); } redirect('assetdetails/assetListing'); @@ -153,8 +153,9 @@ class assetdetails extends BaseController } $data['asset'] = $this->assetdetails_model->getUserInfo($assetcode); - $data['SupplierName'] = $this->assetdetails_model->getSupplierName(); - + $data['SupplierList'] = $this->assetdetails_model->getSupplierName(); + $data['DepartmentList'] = $this->assetdetails_model->getDepartment(); + //$data['roles'] = $this->assetdetails_model->getUserRoles(); $this->global['pageTitle'] = 'Siddharth : Edit Asset'; $this->loadViews("editOldasset", $this->global, $data,NULL); @@ -175,14 +176,11 @@ class assetdetails extends BaseController $this->form_validation->set_rules('Description','Description','trim|required'); $this->form_validation->set_rules('Department','Department','trim|required'); $this->form_validation->set_rules('Location','Location','trim'); - $this->form_validation->set_rules('AssetOwner','AssetOwner','trim'); + $this->form_validation->set_rules('User','AssetOwner','trim'); $this->form_validation->set_rules('SupplierName','SupplierName','trim|required'); $this->form_validation->set_rules('DateOfPurchase','DateOfPurchase','trim'); $this->form_validation->set_rules('DateOfCommission','DateOfCommission','trim'); - $this->form_validation->set_rules('SupportVendor','SupportVendor','trim'); - $this->form_validation->set_rules('SupportFrom','SupportFrom','trim'); - $this->form_validation->set_rules('SupportTo','SupportTo','trim'); - + $this->form_validation->set_rules('AssetValue','AssetValue','trim|required'); if($this->form_validation->run() == FALSE) { @@ -196,19 +194,17 @@ class assetdetails extends BaseController $Description = $this->input->post('Description'); $Department = $this->input->post('Department'); $Location = $this->input->post('Location'); - $AssetOwner = $this->input->post('AssetOwner'); + $User = $this->input->post('User'); $SupplierName = $this->input->post('SupplierName'); $DateOfPurchase = $this->input->post('DateOfPurchase'); $DateOfCommission = $this->input->post('DateOfCommission'); - $SupportVendor = $this->input->post('SupportVendor'); - $SupportFrom = $this->input->post('SupportFrom'); - $SupportTo = $this->input->post('SupportTo'); + $Createdby = $this->input->post('Createdby'); + $AssetValue = $this->input->post('AssetValue'); $asset = array(); - - $asset = array('Asset_Code'=>$Asset_Code,'Asset_Name'=>$AssetName, 'Description'=>$Description,'Department'=>$Department,'Location'=>$Location,'AssetOwner'=>$AssetOwner,'SupplierName'=>$SupplierName,'DateOfPurchase'=>$DateOfPurchase,'DateOfCommission'=>$DateOfCommission,'SupportVendor'=>$SupportVendor,'SupportFrom'=>$SupportFrom,'SupportTo'=>$SupportTo,'createdDate'=>date('Y-m-d H:i:sa')); + $asset = array('Asset_Name'=>$AssetName, 'Description'=>$Description,'Department'=>$Department,'Location'=>$Location,'User'=>$User,'SupplierName'=>$SupplierName,'DateOfPurchase'=>$DateOfPurchase,'DateOfCommission'=>$DateOfCommission,'AssetValue'=>$AssetValue,'Createdby'=>$Createdby,'createdDate'=>date('Y-m-d H:i:sa')); @@ -222,8 +218,8 @@ class assetdetails extends BaseController { $this->session->set_flashdata('error', 'Asset updation failed'); } - - redirect('assetListing'); + echo $asset; + // redirect('assetListing'); } } diff --git a/application/controllers/rawmaterialdetails.php b/application/controllers/rawmaterialdetails.php index 7e797e5c..3fe6c9a6 100644 --- a/application/controllers/rawmaterialdetails.php +++ b/application/controllers/rawmaterialdetails.php @@ -58,21 +58,17 @@ class rawmaterialdetails extends BaseController * This function is used to load the add new cost */ function addRawMaterial() { - if($this->isAdmin() == TRUE) - { - $this->loadThis(); - } - else - { + $this->load->model('rawmaterialdetails_model'); - $data['SupplierName'] = $this->rawmaterialdetails_model->getSupplierName(); + //$data['SupplierName'] = $this->rawmaterialdetails_model->getSupplierName(); $data['material'] = $this->rawmaterialdetails_model->getmaterial(); + $data['UOM'] = $this->rawmaterialdetails_model->getUOM(); $this->global['pageTitle'] = 'siddharth : AddNew RawMaterial'; $this->loadViews("addRawmaterial", $this->global, $data, NULL); - } + } /** @@ -80,13 +76,7 @@ class rawmaterialdetails extends BaseController */ function addNewRawMaterial() { - echo 'allowed edit'; - if($this->isAdmin() == TRUE) - { - $this->loadThis(); - } - else - { + $this->load->library('form_validation'); //$PO = $this->input->post('costID'); @@ -94,24 +84,25 @@ class rawmaterialdetails extends BaseController //$this->form_validation->set_rules('CostCenterID','cost Name','trim'); $this->form_validation->set_rules('MaterialName','Material Name','trim|required|'); $this->form_validation->set_rules('MaterialType','MaterialType','trim'); - $this->form_validation->set_rules('SupplierID','SupplierID','trim'); + $this->form_validation->set_rules('UOM','UOM','trim'); if($this->form_validation->run() == FALSE) { - $this->addcost(); + $this->addRawMaterial(); } else { $MaterialName = ucwords(strtolower($this->input->post('MaterialName'))); $MaterialType = $this->input->post('MaterialType'); - $SupplierID = $this->input->post('SupplierID'); + $UOM = $this->input->post('UOM'); + $CreatedBy = $this->input->post('CreatedBy'); - $RawMaterial = array('MaterialName'=>$MaterialName, 'MaterialType'=>$MaterialType, 'SupplierID'=>$SupplierID,'createdDate'=>date('Y-m-d H:i:sa')); + $RawMaterial = array('MaterialName'=>$MaterialName, 'MaterialType'=>$MaterialType, 'UOM'=>$UOM,'CreatedBy'=>$CreatedBy,'createdDate'=>date('Y-m-d H:i:sa')); $this->load->model('rawmaterialdetails_model'); $result = $this->rawmaterialdetails_model->addNewRawMaterial($RawMaterial); @@ -127,37 +118,20 @@ class rawmaterialdetails extends BaseController redirect('rawmaterialListing'); } - } + } function viewRawmaterial($RawMaterialID = NULL) { - //echo 'allowed edit'; - if($this->isAdmin() == TRUE || $RawMaterialID == 1) - { - //echo 'allowed Admin'; - $this->loadThis(); - } - else - { - //echo 'allowed Update'; - if($RawMaterialID == null) - { - //echo 'Before Update'; - redirect('rawmaterialListing'); - } - - //echo 'Before Update'; - //$data['costName'] = $this->purchaseorder_model->getcostName(); - $data['SupplierName'] = $this->rawmaterialdetails_model->getSupplierName(); + $this->load->model('rawmaterialdetails_model'); $data['userRecords'] = $this->rawmaterialdetails_model->getuserInfo($RawMaterialID); $data['material'] = $this->rawmaterialdetails_model->getmaterial(); - $this->global['pageTitle'] = 'Siddharth : Edit RawMaterial'; + $this->global['pageTitle'] = 'Siddharth : View MaterialMaster'; $this->loadViews("viewrawmaterial", $this->global,$data, NULL); - } + } /** * This function is used load user edit information @@ -165,31 +139,14 @@ class rawmaterialdetails extends BaseController */ function editOldRawmaterial($RawMaterialID = NULL) { - //echo 'allowed edit'; + $data['material'] = $this->rawmaterialdetails_model->getmaterial(); + $data['UOMList'] = $this->rawmaterialdetails_model->getUOM(); + $data['userRecords'] = $this->rawmaterialdetails_model->getUserInfo($RawMaterialID); + + $this->global['pageTitle'] = 'Siddharth : Edit MaterialMaster'; + + $this->loadViews("editOldrawmaterial", $this->global, $data, NULL); - if($this->isAdmin() == TRUE || $RawMaterialID == 1) - { - //echo 'allowed Admin'; - $this->loadThis(); - } - else - { - //echo 'allowed Update'; - if($RawMaterialID == null) - { - //echo 'Before Update'; - redirect('rawmaterialListing'); - } - - //echo 'Before Update'; - //$data['costName'] = $this->purchaseorder_model->getcostName(); - $data['SupplierName'] = $this->rawmaterialdetails_model->getSupplierName(); - $data['userRecords'] = $this->rawmaterialdetails_model->getuserInfo($RawMaterialID); - $data['material'] = $this->rawmaterialdetails_model->getmaterial(); - $this->global['pageTitle'] = 'Siddharth : Edit RawMaterial'; - - $this->loadViews("editOldrawmaterial", $this->global,$data, NULL); - } } @@ -217,7 +174,7 @@ class rawmaterialdetails extends BaseController $this->form_validation->set_rules('MaterialName','Material Name','trim|required|'); $this->form_validation->set_rules('MaterialType','MaterialType','trim'); - $this->form_validation->set_rules('SupplierID','SupplierID','trim'); + $this->form_validation->set_rules('UOM','UOM','trim'); if($this->form_validation->run() == FALSE) { @@ -229,14 +186,16 @@ class rawmaterialdetails extends BaseController $MaterialCode = $this->input->post('MaterialCode'); $MaterialName = ucwords(strtolower($this->input->post('MaterialName'))); $MaterialType = $this->input->post('MaterialType'); - $SupplierID = $this->input->post('SupplierID'); + $UOM = $this->input->post('UOM'); + $UpdatedBy = $this->input->post('UpdatedBy'); + $CreatedBy = $this->input->post('CreatedBy'); //echo $MaterialCode; //echo 'passed model'; $RawMaterial = array(); - $RawMaterial = array('MaterialName'=>$MaterialName,'MaterialType'=>$MaterialType, 'SupplierID'=>$SupplierID, 'MaterialCode'=>$MaterialCode, 'createdDate'=>date('Y-m-d H:i:sa')); + $RawMaterial = array('MaterialName'=>$MaterialName,'MaterialType'=>$MaterialType,'CreatedBy'=>$CreatedBy,'UpdatedBy'=>$UpdatedBy, 'UOM'=>$UOM, 'MaterialCode'=>$MaterialCode, 'UpdatedDate'=>date('Y-m-d H:i:sa')); // echo ' before db Call'; $result = $this->rawmaterialdetails_model->editRawmaterial($RawMaterial, $MaterialCode); diff --git a/application/controllers/supplier.php b/application/controllers/supplier.php index c55f832e..c3f4ee60 100644 --- a/application/controllers/supplier.php +++ b/application/controllers/supplier.php @@ -120,7 +120,7 @@ class supplier extends BaseController $this->form_validation->set_rules('UANumber','UANumber','trim|required'); $this->form_validation->set_rules('PaymentTerms','PaymentTerms','trim|required'); $this->form_validation->set_rules('PaymentDays','PaymentTerms','trim|required'); - $this->form_validation->set_rules('PayableAT','PaymentTerms','trim|required'); + $this->form_validation->set_rules('PayableAT','PayableAT','trim|required'); if($this->form_validation->run() == FALSE) @@ -239,6 +239,7 @@ class supplier extends BaseController $PaymentDays = $this->input->post('PaymentDays'); $PayableAT = $this->input->post('PayableAT'); $UpdatedBy = $this->input->post('UpdatedBy'); + $Createdby = $this->input->post('Createdby'); $supplier = array(); @@ -247,10 +248,10 @@ class supplier extends BaseController if(empty($ContactNumber)) { - $supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'Exiseregistration'=>$Exiseregistration,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$PaymentDays,'PayableAT'=>$PayableAT,'UpdatedBy'=>$UpdatedBy,'createdDate'=>date('Y-m-d H:i:sa')); + $supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'Exiseregistration'=>$Exiseregistration,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$PaymentDays,'PayableAT'=>$PayableAT,'UpdatedBy'=>$UpdatedBy,'Createdby'=>$Createdby,'createdDate'=>date('Y-m-d H:i:sa')); } else{ - $supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'Exiseregistration'=>$Exiseregistration,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$PaymentDays,'PayableAT'=>$PayableAT,'UpdatedBy'=>$UpdatedBy,'createdDate'=>date('Y-m-d H:i:sa')); + $supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'Exiseregistration'=>$Exiseregistration,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$PaymentDays,'PayableAT'=>$PayableAT,'UpdatedBy'=>$UpdatedBy,'Createdby'=>$Createdby,'createdDate'=>date('Y-m-d H:i:sa')); } $result = $this->supplier_model->editsupplier($supplier, $supplierID); diff --git a/application/models/assetdetails_model.php b/application/models/assetdetails_model.php index 53dcc25f..75513d2d 100644 --- a/application/models/assetdetails_model.php +++ b/application/models/assetdetails_model.php @@ -9,7 +9,7 @@ class assetdetails_model extends CI_Model */ function assetListingCount($searchText = ''){ - $this->db->select('BaseT.Asset_Code, BaseT.Asset_Name, BaseT.Description, ID.SupplierName,BaseT.Department, BaseT.Location,BaseT.AssetOwner,BaseT.DateOfCommission,BaseT.SupportVendor,BaseT.SupportFrom,BaseT.SupportTo,BaseT.DateOfPurchase'); + $this->db->select('BaseT.Asset_Code, BaseT.Asset_Name, BaseT.Description, ID.SupplierName,BaseT.Department, BaseT.Location,BaseT.User,BaseT.DateOfCommission,BaseT.AssetValue,BaseT.DateOfPurchase'); $this->db->from('T_AssetDetails as BaseT'); $this->db->join('T_SupplierDetailsN as ID', 'ID.SupplierName = BaseT.SupplierName','left'); @@ -24,12 +24,11 @@ class assetdetails_model extends CI_Model OR BaseT.Department LIKE '%".$searchText."%' OR BaseT.DateOfPurchase LIKE '%".$searchText."%' OR BaseT.Location LIKE '%".$searchText."%' - OR BaseT.AssetOwner LIKE '%".$searchText."%' + OR BaseT.User LIKE '%".$searchText."%' OR BaseT.DateOfCommission LIKE '%".$searchText."%' OR BaseT.DateOfPurchase LIKE '%".$searchText."%' - OR BaseT.SupportVendor LIKE '%".$searchText."%' - OR BaseT.SupportFrom LIKE '%".$searchText."%' - OR BaseT.SupportTo LIKE '%".$searchText."%' + OR BaseT.AssetValue LIKE '%".$searchText."%' + OR BaseT.AssetValue LIKE '%".$searchText."%' OR BaseT.CreatedDate LIKE '%".$searchText."%' )"; $this->db->where($likeCriteria); @@ -48,7 +47,7 @@ class assetdetails_model extends CI_Model */ function assetListing($searchText = '', $page, $segment) { - $this->db->select('BaseT.Asset_Code, BaseT.Asset_Name, BaseT.Description, BaseT.Department, BaseT.Location,BaseT.AssetOwner,BaseT.DateOfCommission,BaseT.DateOfPurchase,BaseT.SupportVendor,BaseT.SupportFrom,BaseT.SupportTo,BaseT.CreatedDate,BaseT.SupplierName'); + $this->db->select('BaseT.Asset_Code, BaseT.Asset_Name, BaseT.Description, BaseT.Department, BaseT.Location,BaseT.User,BaseT.DateOfCommission,BaseT.DateOfPurchase,BaseT.AssetValue,BaseT.CreatedDate,BaseT.SupplierName'); $this->db->from('T_AssetDetails as BaseT'); //$this->db->join('T_SupplierDetailsN as ID', 'ID.SupplierName = BaseT.SupplierName','left'); @@ -61,12 +60,11 @@ class assetdetails_model extends CI_Model OR BaseT.Department LIKE '%".$searchText."%' OR BaseT.DateOfPurchase LIKE '%".$searchText."%' OR BaseT.Location LIKE '%".$searchText."%' - OR BaseT.AssetOwner LIKE '%".$searchText."%' + OR BaseT.User LIKE '%".$searchText."%' OR BaseT.DateOfCommission LIKE '%".$searchText."%' OR BaseT.DateOfPurchase LIKE '%".$searchText."%' - OR BaseT.SupportVendor LIKE '%".$searchText."%' - OR BaseT.SupportFrom LIKE '%".$searchText."%' - OR BaseT.SupportTo LIKE '%".$searchText."%' + OR BaseT.AssetValue LIKE '%".$searchText."%' + OR BaseT.CreatedDate LIKE '%".$searchText."%' )"; $this->db->where($likeCriteria); @@ -81,17 +79,30 @@ class assetdetails_model extends CI_Model } + function getDepartment() + { + $ConfigID = 'C005'; + $this->db->select('ConfigValue'); + $this->db->from('T_ConfigDetails'); + $this->db->where('Config_id ',$ConfigID ); + $query = $this->db->get(); + + return $query->result(); + } + function getSupplierName() { $this->db->select('SupplierID, SupplierName'); $this->db->from('T_SupplierDetailsN'); - //$this->db->where('roleId !=', 1); + // $this->db->where('Address'); + //$this->db->where('roleId !=', 1); $query = $this->db->get(); return $query->result(); } + /** * This function used to get user information by id * @param number $userId : This is user id @@ -117,7 +128,7 @@ function addNewasset($asset) */ function getuserInfo($Asset_Code) { - $this->db->select('Asset_Code, Asset_Name,Description,Department,Location,AssetOwner,SupplierName,DateOfPurchase,DateOfCommission,SupportVendor,SupportFrom,SupportTo,CreatedDate'); + $this->db->select('Asset_Code, Asset_Name,Description,Department,Location,User,SupplierName,DateOfPurchase,DateOfCommission,AssetValue,Createdby,CreatedDate'); $this->db->from('T_AssetDetails'); //$this->db->where('isDeleted', 0); //$this->db->where('roleId !=', 1); diff --git a/application/models/rawmaterialdetails_model.php b/application/models/rawmaterialdetails_model.php index 7ca8f479..b5e8343e 100644 --- a/application/models/rawmaterialdetails_model.php +++ b/application/models/rawmaterialdetails_model.php @@ -9,10 +9,10 @@ class rawmaterialdetails_model extends CI_Model */ function rawmaterialListingCount($searchText = '') { - $this->db->select('BaseT.MaterialCode, BaseT.MaterialName, BaseT.MaterialType, ID.SupplierID, BaseT.CreatedDate'); - $this->db->from('T_RawMaterialDetailsN as BaseT'); + $this->db->select('BaseT.MaterialCode, BaseT.MaterialName, BaseT.MaterialType, BaseT.UOM, BaseT.CreatedDate'); + $this->db->from('T_MaterialMaster as BaseT'); //$this->db->join('tbl_users as users', 'users.userId = BaseT.userId','left'); - $this->db->join('T_SupplierDetailsN as ID', 'ID.SupplierID = BaseT.SupplierID','left'); + //$this->db->join('T_SupplierDetailsN as ID', 'ID.SupplierID = BaseT.SupplierID','left'); if(!empty($searchText)) { $likeCriteria = "(BaseT.MaterialCode LIKE '%".$searchText."%' OR BaseT.MaterialName LIKE '%".$searchText."%' @@ -35,8 +35,8 @@ class rawmaterialdetails_model extends CI_Model */ function rawmaterialListing($searchText = '', $page, $segment) { - $this->db->select('BaseT.MaterialCode, BaseT.MaterialName, BaseT.MaterialType, BaseT.SupplierID ,BaseT.CreatedDate'); - $this->db->from('T_RawMaterialDetailsN as BaseT'); + $this->db->select('BaseT.MaterialCode, BaseT.MaterialName, BaseT.MaterialType, BaseT.UOM ,BaseT.CreatedDate'); + $this->db->from('T_MaterialMaster as BaseT'); //$this->db->join('T_SupplierDetailsN as ID', 'ID.SupplierID = BaseT.SupplierID','left'); if(!empty($searchText)) { @@ -55,14 +55,17 @@ class rawmaterialdetails_model extends CI_Model return $result; } - function getSupplierName() + + + function getUOM() { - - $this->db->select('SupplierID, SupplierName'); - $this->db->from('T_SupplierDetailsN'); - $query = $this->db->get(); - - return $query->result(); + $ConfigID = 'C001'; + $this->db->select('ConfigValue'); + $this->db->from('T_ConfigDetails'); + $this->db->where('Config_id ',$ConfigID ); + $query = $this->db->get(); + + return $query->result(); } function getmaterial() @@ -85,7 +88,7 @@ class rawmaterialdetails_model extends CI_Model function addNewRawMaterial($RawMaterial) { $this->db->trans_start(); - $this->db->insert('T_RawMaterialDetailsN', $RawMaterial); + $this->db->insert('T_MaterialMaster', $RawMaterial); $MaterialCode = $this->db->insert_id(); @@ -101,8 +104,8 @@ function addNewRawMaterial($RawMaterial) */ function getuserInfo($MaterialCode) { - $this->db->select('MaterialCode, MaterialName,MaterialType,SupplierID,CreatedDate'); - $this->db->from('T_RawMaterialDetailsN'); + $this->db->select('MaterialCode, MaterialName,MaterialType,UOM,CreatedBy,UpdatedBy,CreatedDate'); + $this->db->from('T_MaterialMaster'); //$this->db->where('isDeleted', 0); //$this->db->where('roleId !=', 1); $this->db->where('MaterialCode', $MaterialCode); @@ -116,7 +119,7 @@ function addNewRawMaterial($RawMaterial) $this->db->where('MaterialCode', $MaterialCode); - $this->db->update('T_RawMaterialDetailsN', $RawMaterial); + $this->db->update('T_MaterialMaster', $RawMaterial); return TRUE; } @@ -127,7 +130,7 @@ function addNewRawMaterial($RawMaterial) $this->db->where('MaterialCode', $MaterialCode); - $this->db->update('T_RawMaterialDetailsN', $RawMaterial); + $this->db->update('T_MaterialMaster', $RawMaterial); return TRUE; } diff --git a/application/views/addRawMaterial.php b/application/views/addRawMaterial.php index 9505771c..0142e1f8 100644 --- a/application/views/addRawMaterial.php +++ b/application/views/addRawMaterial.php @@ -2,7 +2,7 @@

-
Raw Material List
+
Add Material Master

@@ -22,11 +22,11 @@
-

Add Raw Material Details

+

Add Material Master Details

-
+
diff --git a/application/views/addsupplier.php b/application/views/addsupplier.php index a038c00e..74baa8b3 100644 --- a/application/views/addsupplier.php +++ b/application/views/addsupplier.php @@ -127,7 +127,7 @@
- +
diff --git a/application/views/assetListing.php b/application/views/assetListing.php index 54c72cd8..d697f38a 100644 --- a/application/views/assetListing.php +++ b/application/views/assetListing.php @@ -38,13 +38,13 @@ Description Department Location - Asset Owner + User Supplier Name Date Of Purchase - Support From - Support To + Asset Value + Create Date - Edit + Action Description ?> Department ?> Location ?> - AssetOwner ?> + User ?> SupplierName ?> DateOfPurchase ?> - SupportFrom ?> - SupportTo ?> + + AssetValue ?> + CreatedDate ?> diff --git a/application/views/editOldRawmaterial.php b/application/views/editOldRawmaterial.php index c4d48a7e..8eec53f3 100644 --- a/application/views/editOldRawmaterial.php +++ b/application/views/editOldRawmaterial.php @@ -3,9 +3,8 @@ $MaterialCode = ''; $MaterialName = ''; $MaterialType = ''; -$SupplierID = ''; -$CreatedDate = ''; - +$UOM = ''; +$CreatedBy = ''; if(!empty($userRecords)) { @@ -14,8 +13,9 @@ if(!empty($userRecords)) $MaterialCode = $uf->MaterialCode; $MaterialName = $uf->MaterialName; $MaterialType = $uf->MaterialType; - $SupplierID = $uf->SupplierID; - $CreatedDate = $uf->CreatedDate; + $UOM = $uf->UOM; + $CreatedBy = $uf->CreatedBy; + } } @@ -27,7 +27,7 @@ if(!empty($userRecords))

-
Raw Material List
+
Edit Material Master

@@ -46,7 +46,7 @@ if(!empty($userRecords))
-

Edit Raw Material Details

+

Edit Material Master

@@ -56,24 +56,22 @@ if(!empty($userRecords))
- - + +
- + + +
diff --git a/application/views/editOldasset.php b/application/views/editOldasset.php index 3c3ed101..79d48e81 100644 --- a/application/views/editOldasset.php +++ b/application/views/editOldasset.php @@ -5,13 +5,12 @@ $Asset_Name = ''; $Description = ''; $Department = ''; $Location = ''; -$AssetOwner = ''; +$User = ''; $SupplierName = ''; $DateOfPurchase = ''; $DateOfCommission = ''; -$SupportVendor = ''; -$SupportFrom = ''; -$SupportTo = ''; +$AssetValue = ''; +$Createdby = ''; @@ -24,13 +23,12 @@ if(!empty($asset)) $Description = $uf->Description; $Department = $uf->Department; $Location = $uf->Location; - $AssetOwner = $uf->AssetOwner; + $User = $uf->User; $SupplierName = $uf->SupplierName; $DateOfPurchase = $uf->DateOfPurchase; $DateOfCommission = $uf->DateOfCommission; - $SupportVendor = $uf->SupportVendor; - $SupportFrom = $uf->SupportFrom; - $SupportTo = $uf->SupportTo; + $Createdby = $uf->Createdby; + $AssetValue = $uf->AssetValue; } } @@ -101,7 +99,20 @@ function demo(){
- +
@@ -118,8 +129,8 @@ function demo(){
- - + +
@@ -127,7 +138,21 @@ function demo(){
- +
@@ -148,22 +173,11 @@ function demo(){
- - + + +
-
-
-
- - max= value="" class="form-control" placeholder="" /> -
-
-
-
- - max= value="" class="form-control" placeholder="" /> -
-
+
@@ -175,37 +189,5 @@ function demo(){
-
- load->helper('form'); - $error = $this->session->flashdata('error'); - if($error) - { - ?> -
- - session->flashdata('error'); ?> -
- - session->flashdata('success'); - if($success) - { - ?> -
- - session->flashdata('success'); ?> -
- - -
-
- ', '
'); ?> -
-
- - -
- + - \ No newline at end of file diff --git a/application/views/editOldsupplier.php b/application/views/editOldsupplier.php index b0bbfc65..5bfa5b76 100644 --- a/application/views/editOldsupplier.php +++ b/application/views/editOldsupplier.php @@ -168,7 +168,7 @@ function demo(){
- +
diff --git a/application/views/rawmaterialListing.php b/application/views/rawmaterialListing.php index d9af9524..2d63ddbb 100644 --- a/application/views/rawmaterialListing.php +++ b/application/views/rawmaterialListing.php @@ -2,7 +2,7 @@

-
RAW MATERIAL LIST
+
MATERIAL Master LIST

@@ -17,7 +17,7 @@
-

Raw Material List

+

Material Master List

@@ -35,8 +35,8 @@ Material Code Material Name Material Type - Supplier ID - Created Date + UOM + Edit @@ -52,8 +52,8 @@ MaterialCode ?> MaterialName ?> MaterialType ?> - SupplierID ?> - CreatedDate ?> + UOM ?> + diff --git a/application/views/viewasset.php b/application/views/viewasset.php index 7e0a6593..ae78ea1d 100644 --- a/application/views/viewasset.php +++ b/application/views/viewasset.php @@ -5,13 +5,14 @@ $Asset_Name = ''; $Description = ''; $Department = ''; $Location = ''; -$AssetOwner = ''; +$User = ''; $SupplierName = ''; $DateOfPurchase = ''; $DateOfCommission = ''; -$SupportVendor = ''; -$SupportFrom = ''; -$SupportTo = ''; +$AssetValue = ''; +$Createdby = ''; +$CreatedDate = ''; + @@ -24,13 +25,13 @@ if(!empty($asset)) $Description = $uf->Description; $Department = $uf->Department; $Location = $uf->Location; - $AssetOwner = $uf->AssetOwner; + $User = $uf->User; $SupplierName = $uf->SupplierName; $DateOfPurchase = $uf->DateOfPurchase; $DateOfCommission = $uf->DateOfCommission; - $SupportVendor = $uf->SupportVendor; - $SupportFrom = $uf->SupportFrom; - $SupportTo = $uf->SupportTo; + $AssetValue = $uf->AssetValue; + $Createdby = $uf->Createdby; + $CreatedDate = $uf->CreatedDate; } } @@ -112,8 +113,8 @@ function demo(){ - - + + @@ -131,16 +132,16 @@ function demo(){ - - + + - - + + - - + +
diff --git a/application/views/viewrawmaterial.php b/application/views/viewrawmaterial.php index eab52718..949a53fb 100644 --- a/application/views/viewrawmaterial.php +++ b/application/views/viewrawmaterial.php @@ -3,8 +3,9 @@ $MaterialCode = ''; $MaterialName = ''; $MaterialType = ''; -$SupplierID = ''; -$CreatedDate = ''; +$UOM = ''; +$CreatedBy = ''; +$UpdatedBy = ''; if(!empty($userRecords)) @@ -14,8 +15,9 @@ if(!empty($userRecords)) $MaterialCode = $uf->MaterialCode; $MaterialName = $uf->MaterialName; $MaterialType = $uf->MaterialType; - $SupplierID = $uf->SupplierID; - $CreatedDate = $uf->CreatedDate; + $UOM = $uf->UOM; + $CreatedBy = $uf->CreatedBy; + $UpdatedBy = $uf->UpdatedBy; } } @@ -81,8 +83,14 @@ if(!empty($userRecords)) - - + + + + + + + +