function getProjectName($id = null) { App::import('Model', 'CustomerManager.BuilderProject'); $BuilderProjectModel = new BuilderProject(); $BuilderProject = $BuilderProjectModel->find('first', array('conditions' => array('BuilderProject.id' => $id))); return $BuilderProject['BuilderProject']['project_name']; }
public function ExtraDetail($id = null) { $customer = $this->Customer->find('first', array('conditions' => array('Customer.customer_type_id' => array('2', '3'), 'Customer.id' => $id))); App::uses("CustomerSalesRepresentetives", "CustomerManager.Model"); $sales = new CustomerSalesRepresentetives(); $sales_representatives = $sales->find("all", array("conditions" => array("CustomerSalesRepresentetives.customer_id" => $id))); App::uses("BuilderSupplyTypesList", "CustomerManager.Model"); $builder_supply_types_list = new BuilderSupplyTypesList(); $builder_supply_types = $builder_supply_types_list->find("all", array("conditions" => array("BuilderSupplyTypesList.builder_account_id" => $customer['BuilderAccount']['id']))); App::uses("BuilderProject", "CustomerManager.Model"); $BuilderProject_model = new BuilderProject(); $builderproject = $BuilderProject_model->find("all", array("conditions" => array('BuilderProject.customer_id' => $id))); $this->set(compact('customer', 'modal', 'sales_representatives', 'builderproject', 'builder_supply_types')); $this->render('Elements/Detail/Customer/project'); }