-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathguilds-add.php
107 lines (71 loc) · 2.99 KB
/
guilds-add.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
//ob_start();
session_start();
// If User is logged => redirect to tavern.php and announce it
if ( !isset($_SESSION['user']) ) {
$_SESSION['logged'] = 1;
header("Location: tavern.php");
echo "<meta http-equiv='refresh' content='0; url=tavern.php'>";
exit;
}
require_once 'inc.php';
html_head("Guild Adding");
navbar('bgimg_index_logged');
HelpButton();
pageFade();
if( isset($_POST['Send']) ) {
$conn = connect_db();
$sql = "INSERT INTO `guilds` (name,shortcut,note) VALUES ('". $_POST['name'] ."', '". $_POST['short'] ."','". htmlspecialchars($_POST['note']) ."')";
$res = mysqli_query($conn, $sql);
if ($res) {
echo '<script>
swal({
title: "Successfully added!!",
text: "Guild has been added without any problem!",
type: "success",
showConfirmButton: false,
timer: 1990
});
</script>';
echo "<meta http-equiv='refresh' content='2; url=guilds-add.php'>";
} else {
mysqli_error($conn);
}
mysqli_close($conn);
}
?>
<script>
$(function() {
$source=$("#name");
$output=$("#result");
$source.keyup(function() {
$output.text($source.val());
});
});
</script>
<div class="w3-row w3-text-light-grey Oswald">
<p class="w3-center" style="margin-top: -4%; font-size: 5vw;">Guild Adding</p>
<form method="post" action="">
<div style="margin-top: -2%;">
<div class="w3-half" style="padding-left: 25%;">
<b><label for="name" style="font-size: 1.5vw;">Guild Name: </label></b>
<input type="text" class="w3-input w3-animate-input w3-transparent w3-text-light-grey w3-center w3-margin-top" placeholder="Fill in the Name..." name="name" id="name" style="width: 70%; max-width: 90%; font-size: 1.25vw;" required />
<br /><br />
<b><label for="short" style="font-size: 1.5vw;">Guild Shortcut: </label></b>
<input type="text" class="w3-input w3-animate-input w3-transparent w3-text-light-grey w3-center w3-margin-top" placeholder="Fill in the Image Link..." name="short" id="short" style="width: 70%; max-width: 90%; font-size: 1.25vw;" required />
</div>
<div class="w3-half" style="padding-left: 5%;">
<b><label for="note" class="w3-text-light-grey" style="font-size: 2vw;">Guild Description: </label></b><br />
<textarea class="w3-transparent w3-text-light-grey w3-border-0 w3-leftbar" onKeyDown="limitText(this.form.note,this.form.countdown,255);"
onKeyUp="limitText(this.form.note,this.form.countdown,255);" name="note" id="note" style="width: 50%; resize: none; height: 14rem; padding-left: 2%; font-size: 1vw;"></textarea>
<input class="w3-input w3-transparent w3-text-light-grey w3-center" name="countdown" value="255" style="width: 10%;" /> characters left
</div>
<div class='w3-center' style='margin-top: 4%; font-size: 1.5vw;'>
<input type='submit' value='Add' name='Send' class='w3-btn w3-transparent w3-text-lime w3-border w3-border-lime w3-padding-large' />
<input type='reset' value='Reset' class='w3-btn w3-transparent w3-text-red w3-border w3-border-red w3-padding-large' style='margin-left: 5%;' />
</div>
</div>
</form>
</div>
</body>
</html>