-
Notifications
You must be signed in to change notification settings - Fork 2
/
add_school.php
73 lines (68 loc) · 1.85 KB
/
add_school.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
<?php
/**
* Add All Subjects Marks of Students
* php version 8.1
*
* @category Exam
*
* @package None
*
* @author Waqas <admin@waqaskanju.com>
*
* @license http://www.waqaskanju.com/license MIT
*
* @link http://www.waqaskanju.com
**/
session_start();
require_once 'sand_box.php';
$link=$LINK;
if ($SCHOOL_CHANGES!=1) {
echo '<div class="bg-danger text-center"> Not allowed!! </div>';
exit;
}
/* Rules for Naming add under score between two words. */
if (isset($_POST['submit'])) {
$new_name=$_POST['school_name'];
$new_name=Validate_input($new_name);
$q="INSERT INTO schools (`Name`,`Status`) VALUES ('$new_name','1')";
$exe=mysqli_query($link, $q);
if ($exe) {
// echo "<div class='alert-info'>New school added</div>";
$message="School Name $new_name added";
$alert_type="info";
Show_alert($message,$alert_type);
header(1, 'add_school.php');
} else {
echo "Error in Insertion";
}
}
?>
<?php Page_header('Add School'); ?>
</head>
<body class="background">
<?php require_once 'nav.html';?>
<div class="container-fluid">
<form method="POST" class="p-3" action="#">
<div class="row bg-white mt-1 p-3">
<div class="form-group col-sm-3">
<label for="school_name" class="form-label">New School Name:</label>
<input type="text" name="school_name" id="school_name" class="form-control"
required>
</div>
<div class="col-sm-3">
<input type="submit" name="submit" value="Save"
class="btn btn-primary mt-4">
</div>
</div>
</form>
</div>
<div class="container-fluid">
<h3>Existing Schools</h3>
<p class="text-white">Click on the school name to edit.</p>
<div id="existing_schools" class="bg-white">
</div>
</div>
<script type="text/javascript" src="js/add_schools.js"></script>
<?php
Page_close();
?>