public function indexAction()
 {
     $this->_helper->layout()->disableLayout();
     //config contentType
     // 		$contentType = array(
     // 				"apk" => "application/vnd.android.package-archive"
     // 		);
     $gameId = $this->_request->getParam("productId");
     if (!$gameId) {
         echo "error";
         return;
     }
     $game_model = new Model_Game();
     $game = $game_model->getGameById($gameId);
     $file = $game[0]['install_file'];
     $game_model->addDownload($gameId);
     if ($file !== false) {
         //$ext = pathinfo($file, PATHINFO_EXTENSION);
         if (file_exists($this->_FILE_APK_PATH . $file)) {
             // 				header("Content-Type: ".isset($contentType[$ext]) ? $contentType[$ext] : "");
             // 				header('Content-Disposition: attachment; filename="'.$file.'"');
             // 				header('Content-Transfer-Encoding: binary');
             // 				header('Accept-Ranges: bytes');
             // 				readfile($this->_FILE_APK_PATH.$file);
             $this->_redirect($this->_FILE_APK_PATH . $file);
         } else {
             echo "error";
         }
     }
 }
 public function indexAction()
 {
     $this->view->headScript()->offsetSetFile("4", $this->view->baseUrl() . "/public/common/js/jquery.touchslider.js", "text/javascript");
     $gameId = 1;
     if ($gameId != null) {
         $gameModel = new Model_Game();
         $this->view->game = $gameModel->getGameById($gameId);
         $this->view->game = $this->view->game[0];
         //$this->view->gameLists = $gameModel->listall();
         $filePath = "public/common/game/" . $this->view->game['install_file'];
         $this->view->install_file_size = file_exists($filePath) ? round(filesize($filePath) / 1024 / 1024, 1) : 0;
         $this->view->url = $this->view->serverUrl() . $this->getRequest()->getRequestUri();
         $this->view->images = $gameModel->getGameImageById($gameId);
     } else {
         $this->_redirect("/default");
     }
 }
 public function detailAction()
 {
     $this->view->headScript()->offsetSetFile("4", $this->view->baseUrl() . "/public/common/js/jquery.easing.1.2.js", "text/javascript");
     $this->view->headScript()->offsetSetFile("2", $this->view->baseUrl() . "/public/common/js/jquery.movingboxes.js", "text/javascript");
     $this->view->headScript()->offsetSetFile("3", $this->view->baseUrl() . "/public/common/js/jquery.movingboxes.min.js", "text/javascript");
     $this->view->headLink()->appendStylesheet($this->view->baseUrl() . "/public/common/css/movingboxes-ie.css");
     $this->view->headLink()->appendStylesheet($this->view->baseUrl() . "/public/common/css/movingboxes.css");
     $gameId = $this->_request->getParam("gameId");
     if ($gameId != null) {
         $gameModel = new Model_Game();
         $this->view->game = $gameModel->getGameById($gameId);
         if ($this->view->game == null) {
             $this->_redirect("/mobile");
         }
         $this->view->game = $this->view->game[0];
         $this->view->gameLists = $gameModel->listall();
         $this->view->install_file_size = round(filesize("public/common/game/" . $this->view->game['install_file']) / 1024 / 1024, 1);
         $this->view->url = $this->getRequest()->getRequestUri();
         $this->view->images = $gameModel->getGameImageById($gameId);
     } else {
         $this->_redirect("/mobile");
     }
 }
 public function indexAction()
 {
     //$gameModel = new Model_Game();
     //     	$paginator = Zend_Paginator::factory($gameModel->listall());
     //     	$paginator->setItemCountPerPage(2);
     //     	$paginator->setCurrentPageNumber($this->_request->getParam("page",1));
     //     	$this->view->gameLists = $paginator;
     //Zend_Debug::dump($gameModel->listall());
     $this->view->headScript()->offsetSetFile("4", $this->view->baseUrl() . "/public/common/js/jquery.touchslider.js", "text/javascript");
     $gameId = 1;
     if ($gameId != null) {
         $gameModel = new Model_Game();
         $this->view->game = $gameModel->getGameById($gameId);
         $this->view->game = $this->view->game[0];
         //$this->view->gameLists = $gameModel->listall();
         $filePath = "public/common/game/" . $this->view->game['install_file'];
         $this->view->install_file_size = file_exists($filePath) ? round(filesize($filePath) / 1024 / 1024, 1) : 0;
         $this->view->url = $this->view->serverUrl() . $this->getRequest()->getRequestUri();
         $this->view->images = $gameModel->getGameImageById($gameId);
     } else {
         $this->_redirect("/mobile");
     }
 }