public static function checkisadminpage() { $fb = Ishali_Facebook::getFB(); $pageid = Ishali_Facebook::getpageid(); if (empty($pageid) || $pageid == 0) { Ishali_Facebook::directadminlink(); } }
public function updatepage() { $id_fb_page = $_POST['id_fb_page']; $banner_link = $_POST['banner_link']; $templates = $_POST['templates']; $show_gioi_tinh = $_POST['show_gioi_tinh']; $show_ma = $_POST['show_ma']; $show_ten = $_POST['show_ten']; $show_luot_xem = $_POST['show_luot_xem']; $show_so_binh_chon = $_POST['show_so_binh_chon']; $show_gioi_thieu = $_POST['show_gioi_thieu']; $so_lan_binh_chon = $_POST['so_lan_binh_chon']; $like_binh_chon = $_POST['like_binh_chon']; $like_tham_gia = $_POST['like_tham_gia']; $like_comment = $_POST['like_comment']; $cam_on_binh_chon = $_POST['cam_on_binh_chon']; $cam_on_tham_gia = $_POST['cam_on_tham_gia']; $footer = $_POST['footer']; $font_size = $_POST['font_size']; $background_color = $_POST['background_color']; $background_images = $_POST['background_images']; $color = $_POST['color']; if ($_FILES['banner']['name'] != "") { $urlhinh = time() . '_' . $_FILES["banner"]['name']; move_uploaded_file($_FILES["banner"]['tmp_name'], "public/images/banner/" . $urlhinh); $banner = "`banner` = '{$urlhinh}' , "; } else { $banner = ' '; } if ($_FILES['background_images']['name'] != "") { $urlhinh = time() . '_' . $_FILES["background_images"]['name']; move_uploaded_file($_FILES["background_images"]['tmp_name'], "public/images/background_images/" . $urlhinh); $background_images = "`background_images` = '{$urlhinh}' , "; } else { $background_images = ' '; } $str_update = "UPDATE `ishali_pages` \r\n\t\t\t\t\t\tSET\t\t\t\r\n\t\t\t\t\t\t{$banner}\r\n\t\t\t\t\t\t`banner_link` = '{$banner_link}' , \r\n\t\t\t\t\t\t`templates` = '{$templates}' , \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t`show_gioi_tinh` = '{$show_gioi_tinh}' , \r\n\t\t\t\t\t\t`show_ma` = '{$show_ma}' , \r\n\t\t\t\t\t\t`show_ten` = '{$show_ten}' , \r\n\t\t\t\t\t\t`show_luot_xem` = '{$show_luot_xem}' , \r\n\t\t\t\t\t\t`show_so_binh_chon` = '{$show_so_binh_chon}' , \r\n\t\t\t\t\t\t`show_gioi_thieu` = '{$show_gioi_thieu}' , \r\n\t\t\t\t\t\t`so_lan_binh_chon` = '{$so_lan_binh_chon}' , \r\n\t\t\t\t\t\t`like_binh_chon` = '{$like_binh_chon}' , \r\n\t\t\t\t\t\t`like_tham_gia` = '{$like_tham_gia}' , \r\n\t\t\t\t\t\t`like_comment` = '{$like_comment}' , \r\n\t\t\t\t\t\r\n\t\t\t\t\t\t`cam_on_binh_chon` = '{$cam_on_binh_chon}' , \r\n\t\t\t\t\t\t`cam_on_tham_gia` = '{$cam_on_tham_gia}' , \r\n\t\t\t\t\t\t`footer` = '{$footer}' , \r\n\t\t\t\t\t\t`font_size` = '{$font_size}' , \r\n\t\t\t\t\t\t`background_color` = '{$background_color}' , \r\n\t\t\t\t\t\t{$background_images} \r\n\t\t\t\t\t\t`color` = '{$color}'\t\t\t\t\t\t\r\n\t\t\t\t\t\tWHERE\t`id_fb_page` = '{$id_fb_page}' ;\r\n\t\t\t\t\t"; $this->_db->executeReader($str_update); // $config = Zend_Registry::get(APPLICATION_CONFIG); $url = Ishali_Facebook::directadminlink(); // $url = 'http://apps.facebook.com/tochuccuocthihinh/admin'; echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"; exit("Nội dung đang được luu.....<script>window.top.location.replace('{$url}');</script>"); }