public function indexAction() { $_SESSION['list_page'] = "0"; $facebookadmin = new Ishali_FacebookAdmin(); $facebook = new Ishali_Facebook(); $facebook->begins_works('1'); $manage_pages = $facebookadmin->checkpermissions('manage_pages'); if (!isset($this->_SESSION->iduseradmin)) { $link_login = APP_DOMAIN . "/admin/login"; header("Location:{$link_login}"); } if ($manage_pages) { $this->view->appid = $facebook->getAppId(); $this->view->fbuserid = $facebook->getuserfbid(); $this->view->list_pages = $facebookadmin->list_pages($this->view->fbuserid, 'page'); // $article = App_Models_ArticleModel::getInstance()->getDetail(1); //$time_start = microtime(true); $this->view->pageslist = App_Models_PagesModel::getInstance()->getList('a', 10, 1, $this->view->fbuserid); // $time_end = microtime(true); //$time = $time_end - $time_start; //echo "Did nothing in $time seconds\n"; // $mausac = App_Models_BangmauModel::getInstance()->getList(); // echo "<pre>"; // print_r( $this->view->pageslist); // echo "</pre>"; //// exit; } else { $facebookadmin->install(); } }
public function luuAction() { echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"; echo "Nội dung đang được lưu"; App_Models_PagesModel::getInstance()->updatepage(); // $Admin = new Admin_Model_DbTable_Showpageform(); // $Admin->updatepage(); }
public static function getInstance() { if (self::$_instance == NULL) { self::$_instance = new App_Models_PagesModel(); self::$_instance->_db = App_Storage_Mysql_Connector::getInstance(); } return self::$_instance; }
public function removepageAction() { $page = App_Models_PagesModel::getInstance(); $idpage = $_GET['idpage']; $data = $page->xoaTatCaThongTinPage($idpage); if ($data == 1) { $link = ROOT_DOMAIN . '/admin'; echo "<script>ThongBaoDongY('Xóa Thành Công.', '{$link}');</script>"; } else { echo "<script>ThongBaoDongY('Xóa không thành công<br/>Vui Lòng thực hiện lại thao tác.', '{$link}');</script>"; } }
public function indexAction() { $store = App_Models_StoreModel::getInstance(); $id_page_add_tab = $this->_request->getParam("pg"); $_SESSION['list_page'] = "0"; $facebookadmin = new Ishali_FacebookAdmin(); $facebook = new Ishali_Facebook(); $facebook->begins_works('1', $id_page_add_tab); $manage_pages = $facebookadmin->checkpermissions('manage_pages'); /* if(!isset($this->_SESSION->iduseradmin)) { $link_login = APP_DOMAIN."/admin/login"; header("Location:$link_login"); } */ //Cai App Vao Page if ($id_page_add_tab != "") { $iduser_fb = $facebook->getuserfbid(); $user_page = $facebook->getuserpages(); $status = 0; //echo '<pre>';print_r($user_page);exit; foreach ($user_page as $key => $value) { //echo $value['id'];exit; if ($id_page_add_tab == $value['id']) { $status = 1; } } if ($status == 1) { $linkGraphPage = "http://graph.facebook.com/{$id_page_add_tab}"; $info_page = $facebook->getGraphFB($linkGraphPage); $page_name = $info_page->name; $link_page = $info_page->link; if (!$store->checkManagerPage($id_page_add_tab, $iduser_fb)) { $sql = "insert into ishali_pages(id_fb_page, page_name, id_fb, link_page) values('{$id_page_add_tab}', '{$page_name}', '{$iduser_fb}', '{$link_page}')"; $store->InsertDeleteUpdateQuery($sql); } } } if ($manage_pages) { $this->view->appid = $facebook->getAppId(); $this->view->fbuserid = $facebook->getuserfbid(); $this->view->list_pages = $facebookadmin->list_pages($this->view->fbuserid, 'page'); $this->view->pageslist = App_Models_PagesModel::getInstance()->getList('a', 10, 1, $this->view->fbuserid); } else { $facebookadmin->install(); } }
public function indexAction() { $facebook = new Ishali_Facebook(); $this->view->fbuserid = $facebook->getuserfbid(); if (isset($_GET['pageid']) && $_GET['pageid'] > 0) { $this->view->pageid = $_GET['pageid']; $this->view->page_name = $_GET['pagename']; $this->view->listArticle = App_Models_ArticleModel::getInstance()->getListByFbPage_admin($this->view->pageid); $this->view->list_pages = App_Models_ArticleModel::getInstance()->listArticlePages($this->view->fbuserid); $layoutPath = APPLICATION_PATH . '/templates/giaodien_admin'; $option = array('layout' => 'article_ajax', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); } else { $PagesList = App_Models_PagesModel::getInstance()->getList('', '', '', $this->view->fbuserid); $this->view->page_name = $PagesList[0]['page_name']; $this->view->pageid = $PagesList[0]['id_fb_page']; $this->view->listArticle = App_Models_ArticleModel::getInstance()->getListByFbPage_admin($this->view->pageid); $this->view->list_pages = App_Models_ArticleModel::getInstance()->listArticlePages($this->view->fbuserid); // $layoutPath = APPLICATION_PATH . '/templates/giaodien_admin'; // $option = array('layout' => 'index', 'layoutPath' => $layoutPath); // Zend_Layout::startMvc($option); } }
public function listSelectPages($userid) { $pageList = App_Models_PagesModel::getInstance()->getList('', '', '', $userid); $name = "page"; $html = "<SELECT onchange='show_list_thisinh(this.value, this.options[this.selectedIndex].text)' NAME='" . $name . "' >"; // $html .= "<OPTION VALUE='-1'>Chọn Trang</OPTION>"; foreach ($pageList as $row) { $html .= "<OPTION VALUE=\"{$row['id_fb_page']}\">{$row['page_name']}</OPTION>"; } $html .= "</SELECT>"; return $html; }
public function preDispatch() { $request = $this->getRequest(); $facebook = new Ishali_Facebook(); /* http://www.facebook.com/pages/HCM/448507661830693?sk=app_121397851394173&app_data=index/detail?id=109 $pagedata = $facebook->getpagearr(); echo "<pre>"; print_r($pagedata['app_data']); echo "</pre>"; //exit; */ if (isset($_GET['request_ids'])) { $ts = $_GET['request_ids']; } else { $ts = 0; } $facebook->begins_works($ts); $this->view->id_fb_page = $facebook->getpageid(); $this->view->id_user = $facebook->getuserfbid(); // TODO: // $this->view->id_fb_page = 123453; // $this->view->id_fb_page ='388347091211147'; // $this->view->id_user = 9999; /* * get page info */ // exit; if ($this->view->id_fb_page <= 0) { $this->view->id_fb_page = $_SESSION['idpage']; } else { $_SESSION['idpage'] = $this->view->id_fb_page; } // echo $_SESSION['idpage']; $page = new App_Entities_Pages(); $page = App_Models_PagesModel::getInstance()->getDetail($this->view->id_fb_page); // echo $page->an_hien; // exit; //$this->_redirect('/home/index'); if ($page->an_hien == 0) { // $this->_redirect('/thongbao'); } // echo $page->templates; /* * init layout */ /*End thiet lap nhan tin*/ $fb = $facebook->getFB(); if (isset($_GET['request_ids'])) { $reqId = $_GET['request_ids']; $requests = $fb->api('/me/apprequests/?request_ids=' . $reqId); $itemData = $requests['data'][0]['data']; // echo "<pre>"; // print_r($requests); // echo "</pre>"; // exit; if (isset($itemData) && $itemData != "") { echo "<script language='javascript'>top.location.href='" . $itemData . "'</script>"; exit(0); } else { if (isset($requests['data'][1]['data']) && $requests['data'][1]['data'] != "") { echo "<script language='javascript'>top.location.href='" . $requests['data'][1]['data'] . "'</script>"; exit(0); } else { if (isset($requests['data'][2]['data']) && $requests['data'][2]['data'] != "") { echo "<script language='javascript'>top.location.href='" . $requests['data'][2]['data'] . "'</script>"; exit(0); } } } } /*End thiet lap nhan tin*/ $option = array('layout' => 'layout', 'layoutPath' => LAYOUT_PATH . '/' . $page->templates); Zend_Layout::startMvc($option); /* * get menu */ $listMenu = App_Models_ArticleModel::getInstance()->getListByFbPage($this->view->id_fb_page); /* * assign param */ $this->view->page = $page; $this->view->appTitle = $page->page_name; $this->view->appFooter = $page->footer; $this->view->bodystyle = "font-size:{$page->font_size};"; $this->view->bodystyle .= 'color:' . $page->color . ';'; if ($page->background_images != null && $page->background_images != '') { $page_background = APP_DOMAIN . '/public/images/background_images/' . $page->background_images; $this->view->bodystyle .= 'background-image: url(' . $page_background . ');'; } else { if ($page->background_color != null && $page->background_color != '') { $this->view->bodystyle .= 'background-color:' . $page->background_color . ';'; } } $this->view->listMenu = $listMenu; }
public function binhchonAction() { $request = $this->getRequest(); $this->view->curr_page = $request->getParam('search_page', 1); $this->view->count = 20; if (isset($_GET['thisinhid']) && $_GET['thisinhid'] > 0) { $facebook = new Ishali_Facebook(); $this->view->fbuserid = $facebook->getuserfbid(); $this->view->list_pages = App_Models_PagesModel::getInstance()->listSelectPages($this->view->fbuserid); $this->view->pagename = $request->getParam('pagename'); $this->view->pageid = $request->getParam('pageid', 0); $this->view->id = $request->getParam('thisinhid', 0); // $this->view->page_name = $_GET['page_name']; $binhchondetail = App_Models_ImageInfoModel::getInstance()->getBinhchon($this->view->id, $this->view->curr_page, $this->view->count); $this->view->binhchondetail = $binhchondetail; $this->view->total = $binhchondetail['total']; $paging = array(); $paging['totalRecord'] = $binhchondetail['total']; $paging['currentPage'] = $this->view->curr_page; $paging['numDisplay'] = 2; $paging['pageSize'] = $this->view->count; $paging['action'] = APP_DOMAIN . "/admin/thisinh/binhchon"; $this->view->paging = json_encode($paging); } if ($request->getParam('isajax')) { $layoutPath = APPLICATION_PATH . '/templates/giaodien_admin'; $option = array('layout' => 'install', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); } }