This repository has been archived by the owner on Jan 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateSettings.php
40 lines (35 loc) · 1.85 KB
/
updateSettings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php session_start();
if(isset($_SESSION['key']) && isset($_SESSION['permissions'])) {
if(in_array($_POST['guildId'], $_SESSION['permissions'])) {
include_once 'dbCredentials.php';
$conn = new mysqli($dbhost, $dbuser2, $dbpass2, $dbname2);
$stmt = $conn->prepare("UPDATE `GuildSettings` SET prefix = ?, deleteExecuted = ?, nowPlaying = ?, djMode = ?, starboard = ?, commandLog = ?, modLog = ?, newMember = ?, newMemberMessage = ? WHERE guildId = ?");
$stmt -> bind_param("siiissssss", $prefix, $deleteExecuted, $nowPlaying, $djMode, $starboard, $commandLog, $modLog, $newMember, $newMemberMessage, $guildId);
if(!isset($_POST['reset'])) {
$prefix = ($_POST['prefix'] == "") ? "-" : $_POST['prefix'];
$deleteExecuted = ($_POST['deleteExecuted'] == "true") ? 1 : 0;
$nowPlaying = ($_POST['nowPlaying'] == "true") ? 1 : 0;
$djMode = ($_POST['djMode'] == "true") ? 1 : 0;
$starboard = ($_POST['starboard'] == "") ? null : $_POST['starboard'];
$commandLog = ($_POST['commandLog'] == "") ? null : $_POST['commandLog'];
$modLog = ($_POST['modLog'] == "") ? null : $_POST['modLog'];
$newMember = ($_POST['newMember'] == "") ? null : $_POST['newMember'];
$newMemberMessage = ($_POST['newMemberMessage'] == "") ? null : $_POST['newMemberMessage'];
$guildId = $_POST['guildId'];
} else {
$prefix = "-";
$deleteExecuted = 0;
$nowPlaying = 1;
$djMode = 0;
$starboard = null;
$commandLog = null;
$modLog = null;
$newMember = null;
$newMemberMessage = null;
$guildId = $_POST['guildId'];
}
$stmt->execute();
$stmt->close();
$conn->close();
}
}