public function getPersonColl() { $personColl = new \crm\PersonColl($this->db); $personColl->setCompanyId($this->data['partIVA']); $personColl->loadAll(); return $personColl; }
public function getPersonColl() { $personColl = new \crm\PersonColl($this->db); $personColl->setPersonId($this->data['codFisc']); $personColl->loadAll(); return $personColl; }
<?php if (!array_key_exists('action', $_REQUEST)) { $_REQUEST['action'] = null; } $this->getTemplate()->setBlock('head', 'person/head.phtml'); $this->getTemplate()->setBlock('middle', 'person/middle.phtml'); $this->getTemplate()->setBlock('footer_a', 'person/footer_a.phtml'); $this->getTemplate()->setBlock('footer', 'person/footer.phtml'); switch ($_REQUEST['action']) { case 'jExponentList': $personColl = new \crm\PersonColl($GLOBALS['db']); $personColl->loadAll(array_merge(array('page' => 0, 'count' => 10), $_REQUEST)); $result = array('count' => $personColl->countAll($_REQUEST), 'data' => array()); foreach ($personColl->getItems() as $person) { $result['data'][] = $person->getData(); } header('Content-Type: application/json'); echo json_encode($result); exit; break; case 'edit': $person = new \crm\Person($GLOBALS['db']); $person->loadFromId($_REQUEST['codFisc']); $this->getTemplate()->setObjectData($person); $this->getTemplate()->setBlock('middle', 'person/edit.phtml'); $this->getTemplate()->setBlock('footer', 'person/footer.phtml'); $this->getTemplate()->setBlock('footer_a', 'person/empty.phtml'); break; }