One Hat Cyber Team
Your IP :
18.116.202.216
Server IP :
192.185.194.254
Server :
Linux raider.websitewelcome.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
Server Software :
Apache
PHP Version :
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home2
/
glenar
/
www
/
web
/
Panel
/
ajax
/
View File Name :
action_region.php
<?php ob_start(); require_once('../class/Admin/Admin.class.php'); require_once('../class/AdminGroups/AdminGroups.class.php'); require_once('../class/Regional/Regional.class.php'); $AdminGroups = new UserGroups(); $Users = new Users(); $Regional = new Regional(); if(isset($_POST['action']) && $_POST['action'] == "newregion") { if (isset($_POST['name']) && isset($_POST['type'])) { if ($_POST['name'] != "" && $_POST['type'] != "") { if($_POST['type'] == "1"){ $parentID = NULL; }elseif ($_POST['type'] == "2"){ $parentID = $_POST['country']; }elseif ($_POST['type'] == "3"){ $parentID = $_POST['province']; } $result = $Regional->Add($_POST['type'],$_POST['name'],$parentID); header('Content-Type: application/json'); $result['redircet'] = "../region_new.php?Type=" . $_POST['type']; echo $result; $array = json_decode($result, true); /* if ($array['success'] == "true") { if (isset($_SESSION['AdminID'])) { header('location: ../region_new.php?Type=' . $_POST['type'] ); } else { header('location: ../region_new.php?Type=' . $_POST['type']); } } else { if (isset($_SESSION['AdminID'])) { header('location: ../region_new.php?Type=' . $_POST['type'] ); } else { header('location: ../region_new.php?Type=' . $_POST['type']); } }*/ }else{ header('Content-Type: application/json'); $Result['success'] = false; $Result['message'] = 'لطفا تمامی موارد را پر کنید'; echo json_encode($Result); } } }elseif(isset($_POST['action']) && $_POST['action'] == "editregion") { if (isset($_POST['name']) && isset($_POST['ID'])) { if ($_POST['name'] != "" && $_POST['ID'] != "") { $parentID = $_POST['parent']; if($parentID == ""){ $parentID = NULL; } $result = $Regional->Edit($_POST['ID'],$_POST['name'],$parentID); header('Content-Type: application/json'); //$result['redircet'] = "../region_new.php?Type=" . $_POST['type']; echo $result; $array = json_decode($result, true); /* if ($array['success'] == "true") { if (isset($_SESSION['AdminID'])) { header('location: ../region_new.php?Type=' . $_POST['type'] ); } else { header('location: ../region_new.php?Type=' . $_POST['type']); } } else { if (isset($_SESSION['AdminID'])) { header('location: ../region_new.php?Type=' . $_POST['type'] ); } else { header('location: ../region_new.php?Type=' . $_POST['type']); } }*/ }else{ header('Content-Type: application/json'); $Result['success'] = false; $Result['message'] = 'لطفا تمامی موارد را پر کنید'; echo json_encode($Result); } } }elseif (isset($_POST['action']) && $_POST['action'] == "edituser"){ if (isset($_POST['id'],$_POST['email'], $_POST['password'], $_POST['name'], $_POST['gender'], $_POST['issupervisor'], $_POST['groupid'])) { if ($_POST['id']!= "" && $_POST['email'] != "" && $_POST['password'] != "" && $_POST['name'] != "" && $_POST['gender'] != "" && $_POST['issupervisor'] != "" && $_POST['groupid']!= "") { $data = $_POST; $id = $data['id']; $username = $data['email']; $password = $data['password']; $name = $data['name']; $gender = $data['gender']; $issupervisor = $data['issupervisor']; $groupid = $data['groupid']; $result = $Users->EditAdmin($id, $username, $password, $name, $gender, $issupervisor, $groupid); header('Content-Type: application/json'); echo $result; }else{ header('Content-Type: application/json'); $Result['success'] = false; $Result['message'] = 'لطفا تمامی موارد را پر کنید'; echo json_encode($Result); } } }elseif (isset($_POST['action']) && $_POST['action'] == "newusergroup"){ if (isset($_POST['name'])) { if ($_POST['name'] != "") { $data = $_POST; $name = $data['name']; $privilage = array(); $privilage = $data['priv']; $result = $AdminGroups->AddAdminGroup( $name, $_POST['priv']); header('Content-Type: application/json'); echo $result; }else{ header('Content-Type: application/json'); $Result['success'] = false; $Result['message'] = 'لطفا تمامی موارد را پر کنید'; echo json_encode($Result); } } }elseif (isset($_POST['action']) && $_POST['action'] == "editusergroup"){ if (isset($_POST['name'])) { if ($_POST['name'] != "") { $data = $_POST; $id = $data['id']; $name = $data['name']; $privilage = array(); $privilage = $data['priv']; $result = $AdminGroups->EditAdminGroup($id, $name, '1',$privilage); header('Content-Type: application/json'); echo $result; }else{ header('Content-Type: application/json'); $Result['success'] = false; $Result['message'] = 'لطفا تمامی موارد را پر کنید'; echo json_encode($Result); } } }