kohjhjhصثقص5572hjkhk7872ثقصثقgdfgdg
Ele57885fddfg872782782782 hjkhj782dfgfghgقفغفغفقhfg555434536
/
home4
/
kisgavwq
/
divinegurukulam.in
/
dvnadmin
/
Upload FileeE
HOME
<?php //MenuAction.php session_start(); require_once("../includes/settings.php"); require_once("../includes/database.php"); require_once("../includes/classes/db.cls.php"); require_once("../includes/classes/sitedata.cls.php"); require_once("includes/functions/common.php"); require_once("../includes/classes/Admin.cls.php"); require_once("../includes/classes/Pages.cls.php"); require_once("../includes/classes/Menus.cls.php"); $conn = mysqli_connect(SYSTEM_DBHOST,SYSTEM_DBUSER,SYSTEM_DBPWD,SYSTEM_DBNAME); loginValidate(); $db = new SiteData(); $adminObj = new Admin(); $pageObj = new Pages(); $menuObj = new Menus(); $act = isset($_REQUEST['act'])?$_REQUEST['act']:""; $ext = array("html", "htm", "php"); define("ROOT_PATH","./"); $location = "menu-management.php"; switch($act) { case "addmenu": { // $menuObj->addMenu($_REQUEST); // print_r($_FILES);exit(); $menu_pid = $_POST['menu_pid']; $menu_name = $_POST['menu_name']; $menu_position = $_POST['menu_position']; $menu_target = $_POST['menu_target']; if ($_FILES['icon']['name'] != "") { $path2 = "../img/icon"; $delpath = $path2 . "/" . $_POST['icon']; @unlink($delpath); $s1 = rand(); $realname = $_FILES['icon']['name']; $realname = $s1 . "_" . $realname; $dest = $path2 . "/" . $realname; move_uploaded_file($_FILES['icon']['tmp_name'], $dest); $img_name = trim($realname); $img = $img_name; } else { $img = trim($_POST['icon']); } if($_POST['menu_link']!="") { $menu_page = $_POST['menu_link']; } else{ $menu_page= $_POST['menu_page_id']; } $sql = "INSERT INTO ".MENU." (menu_id, menu_pid, menu_name, menu_position, menu_page, menu_target, menu_status,icon) VALUES (NULL, '$menu_pid', '$menu_name', '$menu_position', '$menu_page', '$menu_target', '1', '$img')";//print $sql;exit(); // $res = $this->inserttoDB($sql); $res = mysqli_query($conn,$sql); $msg = 'New Menu Added.'; setMessage($msg, "correct"); // $location = $_SERVER['HTTP_REFERER']; $location = $location; // $location = $_SERVER['HTTP_REFERER']; }break; case "updmenu": { // $menuObj->updateMenu($_REQUEST); //print_r($_POST);exit(); // if ($_POST['act'] == 'updmenu') { $menu_id = $_POST['menu_id']; $iconquery = "select icon from ".MENU." where menu_id='$menu_id'";//print $iconquery;exit(); $res_icon = mysqli_query($conn,$iconquery); $res_icon_data = mysqli_fetch_assoc($res_icon);//print_r($res_icon_data);exit(); $menu_pid = $_POST['menu_pid']; $menu_name = $_POST['menu_name']; $menu_position = $_POST['menu_position']; $menu_target = $_POST['menu_target']; if ($_FILES['icon']['name'] != "") { $path2 = "../img/icon"; $delpath = $path2 . "/" . $_POST['icon']; @unlink($delpath); $s1 = rand(); $realname = $_FILES['icon']['name']; $realname = $s1 . "_" . $realname; $dest = $path2 . "/" . $realname; move_uploaded_file($_FILES['icon']['tmp_name'], $dest); $img_name = trim($realname); $img = $img_name; } else { // $img = trim($_POST['icon']); $img = $res_icon_data['icon']; } if($_POST['menu_link']!="") { $menu_page = $_POST['menu_link']; } else{ $menu_page= $_POST['menu_page_id']; } $sql = "UPDATE ".MENU." set menu_name='$menu_name', menu_position=$menu_position, menu_page='$menu_page', menu_target='$menu_target',icon='$img' where menu_id='$menu_id'";//print $sql;exit(); $res = mysqli_query($conn,$sql); $msg = 'Menu Updated.'; setMessage($msg, "correct"); // print "<script>"; // print "self.location = 'menu-management.php?msg=$msg';"; // print "</script>"; // } // $location = $_SERVER['HTTP_REFERER']; $location = $location; }break; case "del": { $menu_id = (int)$_REQUEST['mid']; $menu_pid = $menuObj->getParentMenuID($menu_id); $menuObj->deleteMenu($menu_id); $location = $location."?pid=".$menu_pid; }break; default : break; } redirect ($location); ?>