Server IP : 80.241.246.6 / Your IP : 216.73.216.188 Web Server : Apache/2.4.25 (Debian) System : Linux kharagauli 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64 User : www-data ( 33) PHP Version : 7.0.33-0+deb9u12 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/kharagauli_new/admin/clases/ |
Upload File : |
<?php /** * Class Post * * @author suxoza <suxoza@gmail.com> */ class Post extends Base_class{ public $_url_masiv_2; private $URL; public function __construct(){ parent::__construct(); $this->URL = explode('/',urldecode($_SERVER['REQUEST_URI'])); $this->make_url(); } public function make_url(){ $_ = $this; $_->make_masiv(); $lang = 1; $_->_url = $_->URL[$lang]; $_->_url = (!$_->_url || strlen($_->_url) < 2)?'/':$_->_url; try{ if($_->_url && in_array($_->_url,$_->_url_masiv['Geo'])) $_->reflection($_->_url_masiv,__CLASS__); elseif($_->_url && in_array($_->_url,$_->_url_masiv_2['Geo'])) $_->reflection($_->_url_masiv_2,__CLASS__); ///widgets elseif($_->_url && in_array($_->_url,$_->_widgets[0])){ $reflection = new ReflectionClass(__CLASS__); echo $reflection->getMethod('widgets')->invoke($_,$_->_url); } ///end widgets else throw new Page_not_found; }catch(Page_not_found $ex){ die($this->render('404',["menu" => $_->menu_names(),'message' => $ex->getMessage()])); } } public function make_masiv(){ parent::make_masiv(); $this->_url_masiv_2 = [ //'Eng' => ['add_new_category','add_new_category_change','change_menu_pos','page'], 'Geo' => ['add_new_category','add_new_category_change','change_menu_pos','page','კითხვები','გამოკითხვა','რუქა','საკონტაქტო_ინფორმაცია'], ['add_new_category','add_new_category_change','change_menu_pos','page','users_help','users_help','map','contact_info'] ]; } public function change_menu_pos($a){ $_ = $this; $id = $_->clier($_POST['change_menu_pos_id']); $pos = $_->clier($_POST['change_menu_pos']); if($_->update("menu",[["menu_pos"],[$pos],["id",$id]])){ $this->pos_recursion($id,$pos); header("Location:".$_SERVER['HTTP_REFERER'].$_COOKIE['location_href_menu']); } } public function pos_recursion($id,$pos){ $_ = $this; $_->update("menu",[["menu_pos"],[$pos],["parent",$id]]); $select = $_->select("id","menu","big",["parent",$id]); $select = (isset($select['body']))?$select['body']:[]; if($select && count($select)){ for($i = 0; $i < count($select); $i++) $this->pos_recursion($select[$i]['id'],$pos); } } public function add_new_category($a){//HTTP_REFERER $_ = $this; $category = $_->clear($_POST['category']); $category = ($category == 2)?4:$category; $parent = (isset($_POST['parent']) && $_POST['parent'])?$_->clear($_POST['parent']):0; $menu_pos = $_->clear($_POST['menu_pos']); $category_name = 0; $open_in = (isset($_POST['open_in']))?1:0; $_url_page = 0; $_url_site = ''; $location_url = ''; if($category == 0){ $location_url = 'none'; if(!isset($_POST['page_action_2']) || !is_numeric($_POST['page_action_2']))return; $category_name = $_->clier($_POST['page_action_2']); if($_POST['page_action_2'] == 1){ if(!isset($_POST['page_action_3']) || !is_numeric($_POST['page_action_3']))return; $_url_page = $_->clier($_POST['page_action_3']); $location_url = '/page/'.$_url_page; }elseif($_POST['page_action_2'] == 2){ if(!isset($_POST['href_url'])/* || !filter_var($_POST['href_url'], FILTER_VALIDATE_URL)*/)return; $_url_site = $_->clier($_POST['href_url']); } } $def_ = $_->language_config[0]; $home_page = $_->select('id',"menu","count",["home_page",1])?0:1; $insert_ = ["parent","menu_pos", "category","category_name","open_in","url_page","url_site","date","home_page"]; $value_ = [$parent,$menu_pos, $category,$category_name,$open_in,$_url_page,$_url_site,time(),$home_page]; for($i = 0; $i < count($_->language_config); $i++){ $insert_[] = "url_".$_->language_config[$i]; $insert_[] = "name_".$_->language_config[$i]; $value_[] = $_->clier($_POST['URL_'.$_->language_config[$i]]); $value_[] = $_->clier($_POST['name_'.$_->language_config[$i]]); } if($ID = $_->insert("menu",[$insert_,$value_])){ if($category){ // $body_id = $_->insert("body",[ // ["name_".$def_,"date"], // [$_->clear($_POST['name_'.$def_]),time()]] // ); // //table menu_body // $_->insert("menu_body",[ // ["menu_id","body_id"], // [$ID,$body_id] // ]); } $return_location = (!$location_url)?'/page/'.$ID:$_SERVER['HTTP_REFERER']; $return_location = ($location_url == 'none')?$_SERVER['HTTP_REFERER']:$return_location; header("Location:".$return_location.$_COOKIE['location_href_menu']); }else echo 'error from insert...'; } public function add_new_category_change($a){//HTTP_REFERER $_ = $this; if(!isset($_POST['page_id']))return; $_id = $_->clear($_POST['page_id']); $category = $_->clear($_POST['category']); $category = ($category == 2)?4:$category; $category_name = 0; $open_in = (isset($_POST['open_in']))?1:0; $_url_page = 0; $_url_site = ''; if($category == 0){ if(!isset($_POST['page_action_2']) || !is_numeric($_POST['page_action_2']))return; $category_name = $_->clier($_POST['page_action_2']); if($_POST['page_action_2'] == 1){ if(!isset($_POST['page_action_3']) || !is_numeric($_POST['page_action_3']))return; $_url_page = $_->clier($_POST['page_action_3']); }elseif($_POST['page_action_2'] == 2){ if(!isset($_POST['href_url'])/* || !filter_var($_POST['href_url'], FILTER_VALIDATE_URL)*/)return; $_url_site = $_->clier($_POST['href_url']); } }else{ $def_ = $_->language_config[0]; // if(!$_->select("menu_id","body","count",["menu_id",$_id])){ // $selected = $_->select("name_".$def_,"menu","small",["id",$_id]); // $body_id = $_->insert("body",[ // ["name_".$def_,"date"], // [$selected,time()]] // ); // //table menu_body // $_->insert("menu_body",[ // ["menu_id","body_id"], // [$_id,$body_id] // ]); // } } if($_->select("id","menu","count",["category_name",1,"url_page",$_id])){ $_href = (!$category)?'none':''; if($_url_page)$_href = $_url_page; elseif($_url_site)$_href = $_url_site; $_->update("menu",[["url_site"],[$_href],["url_page",$_id]]); } $insert_ = ["category","category_name","open_in","url_page","url_site","modify_date"]; $value_ = [$category,$category_name,$open_in,$_url_page,$_url_site,time()]; for($i = 0; $i < count($_->language_config); $i++){ $insert_[] = "url_".$_->language_config[$i]; $value_[] = $_->clier($_POST['URL_'.$_->language_config[$i]]); } if($_->update("menu",[$insert_,$value_,["id",$_id]])) header("Location:".$_SERVER['HTTP_REFERER'].$_COOKIE['location_href_menu']); else echo 'error from update'; } public function map($a){ $_ = $this; if(!$_->permission_("map","choose")) throw new Exception("Error Processing Request", 1); $arr = [ ['lat','lon','address_to_string','info_'.$_->_lang,'modify_date'], [$_POST['lat'],$_POST['lon'],$_POST['address_to_string'],$_POST['info_win'],time()], ["id",1] ]; $_->update("map",$arr,0); header("Location:".$_SERVER['HTTP_REFERER']); } public function contact_info($a){ $_ = $this; if(!$_->permission_("contactInfo","choose")) throw new Exception("Error Processing Request", 1); $arr = [ ['tel','address_'.$_->_lang,'email','fost','return_email','fb_link','twitter_link','google_link','title','description','google_analitic','top_ge'], [$_POST['tel'],$_POST['address_'.$_->_lang],$_POST['email'],$_POST['fost'],$_POST['return_email'], $_POST['fb_link'],$_POST['twitter_link'],$_POST['google_link'],$_POST['title'],$_POST['description'],trim(addslashes($_POST['google_analitic'])),trim(addslashes($_POST['top_ge'])) ], ["id",1] ]; $_->update("contact_info",$arr,0); header("Location:".$_SERVER['HTTP_REFERER']); } }