Ejemplo n.º 1
0
 public function getpromodetailAction()
 {
     $this->_helper->layout->setLayout('json');
     $callback = $this->getRequest()->getParam('jsoncallback');
     if ($callback != "") {
         // strip all non alphanumeric elements from callback
         $callback = preg_replace('/[^a-zA-Z0-9_]/', '', $callback);
     }
     $this->view->callback = $callback;
     $lat = $this->_getParam('lat');
     //$_GET['lat'];
     $lng = $this->_getParam('lng');
     //$_GET['lng'];
     $promotion_id = $this->_getParam('promoid');
     //$_GET['lng'];
     $promotion = new PAP_Model_Promotion();
     $data = $promotion->getPromotionById($promotion_id, $lat, $lng);
     $data["logo"] = $this->getDataURI("./images" . $data["logo"]);
     $data["path"] = $this->getDataURI("./images" . $this->getThumb($data["path"]));
     $data["promo_photo"] = "./images" . $data["path"];
     $response = $this->getFrontController()->getResponse();
     $response->appendBody($callback . '(' . json_encode($data) . ')');
     $this->getFrontController()->setResponse($response);
 }