Example #1
0
 /**
  * @before _secure, _admin
  */
 public function all()
 {
     $this->seo(array("title" => "All Labs", "view" => $this->getLayoutView()));
     $view = $this->getActionView();
     $page = RequestMethods::get("page", 1);
     $limit = RequestMethods::get("limit", 10);
     //$where = array("zone_id = ?" => $this->managing[0]->zone_id);
     $where = array();
     $centres = Centre::all($where, array("id", "department", "location_id", "phone"), "created", "desc", $limit, $page);
     $count = Centre::count($where);
     $view->set("centres", $centres);
     $view->set("limit", $limit);
     $view->set("page", $page);
     $view->set("count", $count);
 }
Example #2
0
 /**
  * @before _secure, _vendor
  */
 public function add()
 {
     if ($this->member->designation != 'admin') {
         $this->redirect("/vendor");
     }
     $this->seo(array("title" => "Add Medical Test", "view" => $this->getLayoutView()));
     $view = $this->getActionView();
     $centres = Centre::count(array("organization_id = ?" => $this->organization->id));
     $tests = Test::all(array("live = ?" => true), array("id", "title"));
     $len = count($tests);
     $tests1 = array_slice($tests, 0, $len / 2);
     $tests2 = array_slice($tests, $len / 2);
     $data = $this->_saveAllCharges();
     $view->set("centres", $centres)->set("tests1", $tests1)->set("tests2", $tests2)->set($data);
 }