district select
This commit is contained in:
29
admin/district_chk.php
Normal file
29
admin/district_chk.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
session_start();
|
||||
$strLoginName=(isset($_SESSION['user'])) ? $_SESSION['user'] : "" ;
|
||||
$boolLogin = (!empty($strLoginName));
|
||||
if (!$boolLogin) {
|
||||
header("Location: login.php");
|
||||
}
|
||||
require("../config.php");
|
||||
|
||||
if($_POST['csrf'] !== $_SESSION['csrf_token']) {
|
||||
die("Ungültiger Token");
|
||||
}
|
||||
|
||||
$strSQL="SELECT * FROM district";
|
||||
$result = $db->query($strSQL);
|
||||
$numCounter=1;
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
$strDistrict=$row['district'];
|
||||
if (isset($_POST[$strDistrict])) {
|
||||
$db->query("UPDATE `district` SET `active`= '1' WHERE `district`='$strDistrict'");
|
||||
} else {
|
||||
$db->query("UPDATE `district` SET `active`= '0' WHERE `district`='$strDistrict'");
|
||||
}
|
||||
}
|
||||
header("Location: configuration.php");
|
||||
//print_r($_POST);
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user