Ejemplo n.º 1
0
 /**
  * Load the data
  */
 protected function loadData()
 {
     //--Check the params
     if ($this->URL->getParameter(0) === null) {
         $this->redirect(FrontendNavigation::getURL(404), 404);
     }
     //--Get record
     $this->record = FrontendAddressesModel::get($this->URL->getParameter(1));
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404), 307);
     }
 }
Ejemplo n.º 2
0
 /**
  * Load the data
  */
 protected function loadData()
 {
     //        if ($this->search != "")
     //        {
     $this->items = FrontendAddressesModel::getAllAddresses($this->search, array($this->data['id']), $this->lat, $this->lng, null);
     //        }
     //        else
     //        {
     //            $this->items = FrontendAddressesModel::getAllAddresses();
     //        }
     //--Check if map has to be centered
     if ($this->search != "") {
         $this->addJSData('centerMap', 1);
     } else {
         $this->addJSData('centerMap', 0);
     }
     //--Fields for the jsdata
     $jsData = array();
     $fields = array("id", "name", "firstname", "address", "zipcode", "city", "country", "phone", "fax", "website", "lat", "lng");
     //--Check if items are not empty
     if (!empty($this->items)) {
         //--Loop the addresses
         foreach ($this->items as $row) {
             //--Create empty array
             $address = array();
             //--Loop the fields for the address
             foreach ($fields as $field) {
                 $address[$field] = $row[$field];
             }
             //--Add data to array for JS
             $jsData[] = $address;
         }
     }
     //--Add JSData
     $this->addJSData('items', $jsData);
 }
Ejemplo n.º 3
0
 /**
  * Load the form
  */
 private function loadForm()
 {
     $this->frm = new FrontendForm("search", null, "get", null, false);
     $this->frm->addText("search", $this->search, null, "form-control");
     $this->frm->addHidden("lat", null, null);
     $this->frm->addHidden("lng", null, null);
     $groups = FrontendAddressesModel::getAllGroupsForDropbox();
     $this->frm->addDropdown("groups", $groups, null, true);
     //        $topGroups = FrontendAddressesModel::getAllTopGroups();
     //        $topGroupsChk = array();
     //        foreach($topGroups as $tgk => $tg){
     //            $topGroupsChk[] = array('label' => $tg, 'value' => $tgk);
     //        }
     //        $this->frm->addMultiCheckbox("topgroups", $topGroupsChk, null);
 }