protected function populateTables()
 {
     $locations = [['name' => "Ravenwood Golf Club", 'address' => "929 Lynaugh Rd.  \r\nVictor, NY 14564", 'phone' => '585-924-5100', 'url' => 'http://www.ravenwoodgolf.com/'], ['name' => "Mill Creek Golf Club", 'address' => "128 Cedars Ave.  \r\nRochester, NY 14428", 'phone' => '585-889-4110', 'url' => 'http://www.millcreekgolf.com/']];
     foreach ($locations as $location) {
         LocationModel::create($location);
     }
 }
Ejemplo n.º 2
0
 public function createloctreeAction()
 {
     $title = Zend_Filter::filterStatic($this->getRequest()->getParam('title'), 'StripTags');
     $description = Zend_Filter::filterStatic($this->getRequest()->getParam('desc'), 'StripTags');
     if (get_magic_quotes_gpc()) {
         $title = Zend_Filter::filterStatic(stripslashes($this->getRequest()->getParam('title')), 'StripTags');
         $description = Zend_Filter::filterStatic(stripslashes($this->getRequest()->getParam('desc')), 'StripTags');
     }
     if (!empty($title) || is_numeric($title)) {
         $data['title'] = $title;
         $data['description'] = $description;
         try {
             $this->view->id = LocationModel::create($data);
         } catch (Exception $e) {
             $this->view->error = $e->getMessage();
             Globals::getLog()->err('ADMIN create location tree error: ' . $this->view->error);
             $this->render('error-xhr');
             return false;
         }
         // TODO: see if this fails...
         // if so, delete loc and throw an error
     } else {
         $this->view->error = 'Title must not be empty';
         Globals::getLog()->err('ADMIN create location tree error: ' . $this->view->error);
         $this->render('error-xhr');
         return false;
     }
 }