diff --git a/application/controllers/CostCenter.php b/application/controllers/CostCenter.php index 5343dbde..55cea728 100755 --- a/application/controllers/CostCenter.php +++ b/application/controllers/CostCenter.php @@ -45,9 +45,18 @@ class CostCenter extends BaseController $this->global['pageTitle'] = 'Siddharth : Cost List'; + + if($this->DEPCode == FINANCE ) + { $this->loadViews("costListing", $this->global, $data, NULL); - + } + + else + { + $this->loadViews("access", $this->global, $data, NULL); + + } } /** @@ -176,9 +185,17 @@ class CostCenter extends BaseController //print_r(count($data['BudType'])); $this->global['pageTitle'] = 'Siddharth : Edit Cost'; + + if($this->DEPCode == FINANCE ) + { $this->loadViews("editOldcost", $this->global, $data,NULL); - + } + + else + { + $this->loadViews("access", $this->global, $data,NULL); + } } function GetBudgetForYear() @@ -238,6 +255,9 @@ class CostCenter extends BaseController function editcost() { + + if($this->DEPCode == FINANCE ) + { $this->form_validation->set_rules('CostCode','CostCode','trim|required'); $this->form_validation->set_rules('CostName','CostName','trim|required'); @@ -322,6 +342,17 @@ class CostCenter extends BaseController echo('Successfully Updated Cost details'); } + + + } + + + else + { + //$this->loadViews("access"); + $this->load->view('access'); + + } } diff --git a/application/controllers/MRIRcontroller.php b/application/controllers/MRIRcontroller.php index 0f7db260..3b2c22f6 100755 --- a/application/controllers/MRIRcontroller.php +++ b/application/controllers/MRIRcontroller.php @@ -92,8 +92,17 @@ class MRIRcontroller extends BaseController $this->global['pageTitle'] = 'Siddharth : Billing '; $data['Billing'] = $this->mrir_model->view_mrir_Billing(); + if($this->DEPCode == FINANCE) + { $this->loadViews("viewmrirforbilling", $this->global,$data , NULL); + } + + else + { + $this->loadViews("access", $this->global,$data , NULL); + } + } public function viewmMaterialDistributionList() { @@ -101,8 +110,17 @@ public function viewmMaterialDistributionList() $data['Distribution'] = $this->mrir_model->ViewDistributionList(); $data['status'] = $this->mrir_model->getStatus(); + + if($this->DEPCode == STORE) + { $this->loadViews("MaterialIssueList", $this->global,$data , NULL); + } + + else + { + $this->loadViews("access", $this->global,$data , NULL); + } } @@ -125,9 +143,23 @@ public function viewmMaterialDistributionList() $this->global['pageTitle'] = 'Siddharth : View Inward Gate Register'; $data['IGR']= $this->mrir_model->ViewigrListing(); + + + + if($this->DEPCode == STORE || $this->DEPCode == QUALITY) + { $this->loadViews("viewinwardgateregister",$this->global,$data,NULL); - } + } + + else + { + $this->loadViews("access",$this->global,$data,NULL); + + } + + + } /* For View MRIR Screen (view folder - view page)*/ function viewmaterialinspectionreport() @@ -140,7 +172,17 @@ public function viewmMaterialDistributionList() //old name:mrirdatas2 $this->global['pageTitle'] = 'Siddharth : View Material Inspection Report'; //print_r( $data); + + if($this->DEPCode == STORE || $this->DEPCode == QUALITY) + { $this->loadViews("viewmaterialinspectionreport", $this->global,$data,NULL); + + } + + else + { + $this->loadViews("access", $this->global,$data,NULL); + } } diff --git a/application/controllers/emergencypurchaseorder.php b/application/controllers/emergencypurchaseorder.php index 957dca2e..ac33b11d 100755 --- a/application/controllers/emergencypurchaseorder.php +++ b/application/controllers/emergencypurchaseorder.php @@ -70,8 +70,19 @@ class emergencypurchaseorder extends BaseController $data['WorkStatus']=$this->purchaseorder_model->getStatus(7); $data['ServiceOption'] = $this->requistion_model->getConfigValue('C022'); $data['PoTypeOptions'] = $this->purchaseorder_model->getConfigValue('C026'); + + + if($this->DEPCode == PURCHASE ) + { $this->loadViews("alterpurchaseorder", $this->global, $data, Null); + } + + else + { + $this->loadViews("access", $this->global, $data, Null); + } + } /** * this function used for get all material code using request type @@ -859,8 +870,18 @@ $RequestedBy = $this->input->post('drpDepartment'); $this->global['pageTitle'] = 'Siddharth : Purchase Orders'; + if($this->DEPCode == PURCHASE ) + { + $this->loadViews("POlist", $this->global, $data, NULL); + } + + else + { + $this->loadViews("access", $this->global, $data, NULL); + + } } function Req_validate($selectValue) { diff --git a/application/controllers/employeedetails.php b/application/controllers/employeedetails.php index 8cdaf9f3..06cf413a 100755 --- a/application/controllers/employeedetails.php +++ b/application/controllers/employeedetails.php @@ -43,8 +43,23 @@ class employeedetails extends BaseController $data['userRecords'] = $this->employeedetails_model->employeeListing(); $this->global['pageTitle'] = 'Siddharth : Employee Listing'; + + if($this->role == ROLE_ADMIN || $this->DEPCode == HR) + { + + if($this->DEPCode != HR) + { $this->loadViews("employeeListing", $this->global, $data, NULL); + + } + + } + + else + { + $this->loadViews("access", $this->global, $data, NULL); + } } /* @@ -385,7 +400,21 @@ echo "";redirect('employeeListing',' $data['Department'] = $this->employeedetails_model->getDepartment(); $this->global['pageTitle'] = 'Siddharth : Add New Employee'; + + if($this->role == ROLE_ADMIN || $this->DEPCode == HR) + { + + if($this->DEPCode != HR) + { $this->loadViews("addemployee", $this->global, $data, NULL); + + } + } + + else + { + $this->loadViews("access", $this->global, $data, NULL); + } } /** diff --git a/application/controllers/inwardgateregister.php b/application/controllers/inwardgateregister.php index 02d7126b..47920189 100755 --- a/application/controllers/inwardgateregister.php +++ b/application/controllers/inwardgateregister.php @@ -40,8 +40,19 @@ class inwardgateregister extends BaseController $this->load->model('inwardgateregister_model'); $this->global['pageTitle'] = 'Siddharth : Inward Gate Register Details'; $data['IGR']= $this->inwardgateregister_model->igrListing(); + + if($this->Designation == SECURITY) + { $this->loadViews("viewIGRDetails",$this->global,$data,NULL); + + } + + else + { + $this->loadViews("access",$this->global,$data,NULL); + + } } function addinwardgateregister() @@ -53,8 +64,17 @@ class inwardgateregister extends BaseController $data['PO_NO'] = $this->inwardgateregister_model->getpurchaseorder(); //print_r($data['PO_NO']); + + if($this->Designation == SECURITY) + { $this->loadViews("inwardgateregister", $this->global, $data, NULL); + } + + else + { + $this->loadViews("access", $this->global, $data, NULL); + } } function getDateformat($Val) diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 1aef3966..c7b8f991 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -50,7 +50,16 @@ class purchaseorder extends BaseController $data['PONO']=$this->purchaseorder_model->getadvancePONO('ST026'); //print_r($data['PONO']); + + if($this->DEPCode == PURCHASE) + { $this->loadViews("advancerequest", $this->global, $data, NULL); + } + + else + { + $this->loadViews("access", $this->global, $data, NULL); + } } function requisition() { @@ -64,8 +73,18 @@ class purchaseorder extends BaseController $data['ReqList'] = $this->purchaseorder_model->getAllRequistionListToCreatePO(); /* End Here */ $this->global['pageTitle'] = 'Siddharth : Create PO from Requisition List'; + + if($this->DEPCode== PURCHASE) + { $this->loadViews("createPOfromRequistion", $this->global, $data,Null); + + } + + else + { + $this->loadViews("access", $this->global, $data,Null); + } } @@ -86,10 +105,21 @@ class purchaseorder extends BaseController $data['POData'] = $this->purchaseorder_model->purchaseorderListing(); $this->global['pageTitle'] = 'Siddharth : Purchase Orders'; + + if($this->DEPCode == PURCHASE ) + { $this->loadViews("POlist", $this->global, $data, NULL); - + } + + else + { + $this->loadViews("access", $this->global, $data, NULL); + } } + + + function Req_validate($selectValue) { //echo 'select_validate method called'; @@ -110,7 +140,11 @@ class purchaseorder extends BaseController */ function CreatePurchaseOrder() { - + + // if( $DEPCode == PURCHASE) + // { + + $this->form_validation->set_rules('txtReqNo', 'txtReqNo', 'callback_Req_validate'); if($this->form_validation->run() == FALSE) @@ -260,7 +294,12 @@ class purchaseorder extends BaseController } $this->loadViews($ViewName, $this->global,$data, NULL); } - } + // } + + +} + + function CreatePOPrint() { $PONO = $_GET['PONO']; diff --git a/application/controllers/requisitionform.php b/application/controllers/requisitionform.php index 501d9949..172eb75d 100755 --- a/application/controllers/requisitionform.php +++ b/application/controllers/requisitionform.php @@ -39,7 +39,19 @@ class requisitionform extends BaseController $data['TotNoOfLine'] =$this->requistion_model->getRequistionList($userID); + if (($this->role == ROLE_MANAGER || $this->role == ROLE_EMPLOYEE || $this->role == ROLE_ADMIN ) && $this->Designation != SECURITY) + { + $this->loadViews("requisitionlisting", $this->global, $data, NULL); + + } + + else + { + $this->loadViews("access", $this->global, $data, NULL); + + } + } /** * This function used to load the first screen of the requisition Form @@ -75,9 +87,17 @@ class requisitionform extends BaseController $data['AppList'] = $this->requistion_model->getApproverRequistList($userID); - + if($this->role == ROLE_MANAGER ) + { $this->loadViews("requisitionlistapproval", $this->global, $data, NULL); + } + + else + { + $this->loadViews("access", $this->global, $data, NULL); + } + } diff --git a/application/controllers/servicepurchaseorder.php b/application/controllers/servicepurchaseorder.php index 179ef65f..39418fef 100755 --- a/application/controllers/servicepurchaseorder.php +++ b/application/controllers/servicepurchaseorder.php @@ -35,8 +35,19 @@ class servicepurchaseorder extends BaseController $data["Billing"] = $this->purchaseorder_model->GetServicePOListforBilling(); //print_r($data["Billing"]); + + if($this->DEPCode == FINANCE) + { $this->loadViews("serviceporeport", $this->global,$data,null); + + } + + else + { + $this->loadViews("access", $this->global,$data,null); + + } } diff --git a/application/controllers/storerequisitionlist.php b/application/controllers/storerequisitionlist.php index dbfe0acc..f321e53e 100755 --- a/application/controllers/storerequisitionlist.php +++ b/application/controllers/storerequisitionlist.php @@ -51,9 +51,18 @@ class storerequisitionlist extends BaseController $this->global['pageTitle'] = 'Siddharth : StoreRequisition Listing'; $userId= $this->session->userdata ('userId'); $data['Store'] = $this->storerequistion_model->Storeall($userId); + if ($this->Designation != SECURITY && $this->DEPCode != HR ) + { $this->loadViews("storerequisition", $this->global,$data,null); - } + + } + + else + { + $this->loadViews("access", $this->global,$data,null); + } + } /** * This function used to load the Delete the StoreRequistion Items @@ -75,6 +84,9 @@ class storerequisitionlist extends BaseController /* The Function Edit Store Requistion list */ function EditStoreRequistion() { + + if ($this->Designation != SECURITY && $this->DEPCode != HR ) + { $StoreReqNo = $_GET['StoreReqNo']; //$StoreReqNo= $this->input->post('id'); @@ -90,7 +102,13 @@ class storerequisitionlist extends BaseController $data['LineItem']=$this ->storerequistion_model->editstorerequistions($StoreReqNo); $this->loadViews("editstorerequisition", $this->global,$data,null); - } + } + + else + { + $this->load->view('access'); + } + } @@ -197,8 +215,15 @@ class storerequisitionlist extends BaseController $data['Status']= $this->storerequistion_model->getStatus(); $data['TotNoOfLine']=$this->storerequistion_model->getRequistionList(); //print_r($data['TotNoOfLine']); - $this->loadViews("storerequisitionlisting", $this->global,$data,null); + if ( $this->Designation != SECURITY && $this->DEPCode != HR ) + { + $this->loadViews("storerequisitionlisting", $this->global,$data,null); + } + else + { + $this->loadViews("access", $this->global,$data,null); + } } @@ -214,8 +239,16 @@ class storerequisitionlist extends BaseController $data['ReqItem'] = $this->storerequistion_model->getRequistItemList($StoreReqNo); $data['ReqListDetails'] = $this->storerequistion_model->getRequistDetails($StoreReqNo); //print_r($data['ReqItem']); + + if($this->DEPCode == STORE) + { $this->loadViews("issueStoreRequistion", $this->global,$data,null); - + } + + else + { + $this->loadViews("access", $this->global,$data,null); + } } function UpdateIssueRequistion() @@ -360,10 +393,19 @@ class storerequisitionlist extends BaseController $data['AppList'] = $this->storerequistion_model->getApproverRequistList($userID); //print_r($data['AppList']); $this->global['pageTitle'] = 'Siddharth : ApprovalStoreRequisitionSlip'; - $data['Status']= $this->storerequistion_model->getStatus(); + $data['Status']= $this->storerequistion_model->getStatus(); + + if ($this->Designation != SECURITY && $this->DEPCode != HR ) + { $this->loadViews("approvalstorerequisitionslip", $this->global, $data, NULL); + } + + else + { + $this->loadViews("access", $this->global, $data, NULL); + } } /*Approve Completed*/ diff --git a/application/controllers/storestatus.php b/application/controllers/storestatus.php index aa36f56c..70b1a210 100755 --- a/application/controllers/storestatus.php +++ b/application/controllers/storestatus.php @@ -51,8 +51,16 @@ class storestatus extends BaseController // print_r($data['Stock']); $data['MaterialList'] = $this->store_model->GetAllMaterialList(); $data['StockStatus'] = $this->store_model->GetConfigValue('C021'); + + if($this->DEPCode == STORE) + { $this->loadViews("storestatus", $this->global, $data,null); - + } + + else + { + $this->loadViews("access", $this->global, $data,null); + } } /** diff --git a/application/controllers/supplier.php b/application/controllers/supplier.php index 6713c535..b9f0d22a 100755 --- a/application/controllers/supplier.php +++ b/application/controllers/supplier.php @@ -44,9 +44,22 @@ class supplier extends BaseController $data['userRecords'] = $this->supplier_model->supplierListing(); $this->global['pageTitle'] = 'Siddharth Industries : Supplier Listing'; + + if($this->role == ROLE_ADMIN || $this->DEPCode == SALES || $this->DEPCode == FINANCE ||$this->DEPCode == HR) + { + + if($this->DEPCode != FINANCE && $this->DEPCode != HR) + { $this->loadViews("supplierListing", $this->global, $data, NULL); - + + } + } + + else + { + $this->loadViews("access", $this->global, $data, NULL); + } } /** * This function is used to load the add new supplier */ @@ -59,8 +72,21 @@ class supplier extends BaseController $this->global['pageTitle'] = 'siddharth : Add New Supplier'; + + if($this->role == ROLE_ADMIN || $this->DEPCode == SALES || $this->DEPCode == FINANCE ||$this->DEPCode == HR) + { + + if($this->DEPCode != FINANCE && $this->DEPCode != HR) + { $this->loadViews("addsupplier", $this->global,$data, NULL); + } + } + + else + { + $this->loadViews("access", $this->global,$data, NULL); + } } /** * This function is used to check whether PAN already exist or not