File manager - Edit - /home/custbahd/irungikitchen.com/admin/clients/ban/index.php
Back
<?php session_start(); include_once('../../db/saucerer.php'); // Define variables and initialize with empty values $id = $name = $token = $access = ""; $id_err = $name_err = $token_err = $access = ""; //IP Address Protocol $ip_address = $_SERVER["REMOTE_ADDR"]; // Check if the "mobile" word exists in User-Agent $isMob = is_numeric(strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "mobile")); // Check if the "tablet" word exists in User-Agent $isTab = is_numeric(strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "tablet")); // Platform check $isWin = is_numeric(strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "windows")); $isAndroid = is_numeric(strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "android")); $isIPhone = is_numeric(strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "iphone")); $isIPad = is_numeric(strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "ipad")); $isIOS = $isIPhone || $isIPad; if($isTab){ if ($isIPad) { $device = 'iPad'; } else { $device = 'Tablet'; } } elseif($isMob){ if ($isIPhone) { $device = 'iPhone'; } else { $device = 'Phone'; } } else{ $device = 'Desktop'; } if($isIOS){ $system = 'iOS'; }elseif($isAndroid){ $system = 'ANDROID'; }elseif($isWin){ $system = 'WINDOWS'; } $user = $_SESSION['name']; $token = $_SESSION['token']; $access = $_SESSION['access']; if(isset($_GET['id'])){ $fname = $_GET['fname']; $lname = $_GET['lname']; $name = "".$fname." ".$lname.""; $nav = $_GET['id']+1; date_default_timezone_set('Africa/Kampala'); $ban_date = date("Y-m-d",time()); $sql = "UPDATE clients SET ban='1', ban_date='$ban_date' WHERE id = '".$_GET['id']."'"; //use for MySQLi OOP if($conn->query($sql)){ $_SESSION['success'] = ''.$name.' banned successfully'; $result = "Success"; $channel = "Notifications"; $link = "clients/banned"; $summary = "".$name." has been banned"; } else{ $_SESSION['error'] = 'Something went wrong in banning '.$name.''; $result = "Error"; $channel = "System"; $link = "#!"; $summary = "System error banning from ".$name.""; } $attempt = "Client"; $action = "Ban"; $filter = "Client"; $category = "Ban"; $sql = "INSERT INTO secure (name, token, access, attempt, action, user, handler, result, filter, category, channel, summary, link, ip_address, device_name, system_name) VALUES ('$name', '$token', '$access', '$attempt', '$action', '$user', 'Admin', '$result', '$filter', '$category', '$channel', '$summary', '$link', '$ip_address', '$device', '$system')"; mysqli_query($mysqli, $sql); } header('location: ../#nav_'.$nav.''); ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 1.8 |
proxy
|
phpinfo
|
Settings