-
Notifications
You must be signed in to change notification settings - Fork 0
/
addnoti.php
133 lines (121 loc) · 5.09 KB
/
addnoti.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
include 'db2.php';
if(isset($_POST['notifica']))
{
$noti=$_POST['notific'];
$quali = $_POST['check'];
$new_qual = implode(",",$quali);
mysqli_query($con,"INSERT INTO `notification_db`(`content`,`to`) VALUES ('$noti','$new_qual')");
echo "<script>alert('Added');</script>";
echo "<script>window.history.back();</script>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="description" content="Vali is a responsive and free admin theme built with Bootstrap 4, SASS and PUG.js. It's fully customizable and modular.">
<!-- Twitter meta-->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:site" content="@pratikborsadiya">
<meta property="twitter:creator" content="@pratikborsadiya">
<!-- Open Graph Meta-->
<meta property="og:type" content="website">
<meta property="og:site_name" content="Vali Admin">
<meta property="og:title" content="Vali - Free Bootstrap 4 admin theme">
<meta property="og:url" content="http://pratikborsadiya.in/blog/vali-admin">
<meta property="og:image" content="http://pratikborsadiya.in/blog/vali-admin/hero-social.png">
<meta property="og:description" content="Vali is a responsive and free admin theme built with Bootstrap 4, SASS and PUG.js. It's fully customizable and modular.">
<title>Notification</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Main CSS-->
<link rel="stylesheet" type="text/css" href="css/main.css">
<!-- Font-icon css-->
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body class="app sidebar-mini">
<!-- Navbar-->
<?php
include 'header.php';
?>
<!-- Sidebar menu-->
<div class="app-sidebar__overlay" data-toggle="sidebar"></div>
<?php
include 'leftbar.php';
?>
<main class="app-content">
<div class="app-title">
<div>
<h1><i class="fa fa-dashboard"></i> Add Notification</h1>
<p></p>
</div>
<ul class="app-breadcrumb breadcrumb">
<li class="breadcrumb-item"><i class="fa fa-home fa-lg"></i></li>
<li class="breadcrumb-item"><a href="dashboard.php">Home</a></li>
</ul>
</div>
<div class="clearix"></div>
<div class="col-md-12">
<div class="tile">
<h3 class="tile-title">Notification</h3>
<div class="tile-body">
<form class="row" avtion="#" method="POST">
<div class="form-group col-md-3">
<label class="control-label">Content</label>
<input class="form-control" type="text" placeholder="Enter anything to notify" id="notif" name="notific" onkeyup="clearmsg('sp1')"><span id="sp1" style="color:#F00"></span>
TO:<br>
<input type="checkbox" value="teacher" name="check[]" onchange="clearmsg('sp6')">Teacher
<input type="checkbox" value="student" name="check[]" onchange="clearmsg('sp6')">Student<br>
<span id="sp6" style="color:#F00"></span><br>
</div>
<!-- <div class="form-group col-md-3">
<label class="control-label">Date</label>
<input class="form-control" type="date" placeholder="Enter the date">
</div> -->
<div class="form-group col-md-4 align-self-end">
<button class="btn btn-primary" name="notifica" name="submit" onclick="return valid()"><i class="fa fa-fw fa-lg fa-check-circle"></i>Notify</button>
</div>
</form>
</div>
</div> <div>
<a class="btn btn-primary" href="noti_view.php"><!-- <i class="fa fa-fw fa-lg fa-check-circle"></i> -->View Coming notification</a>
</div>
</div>
</div>
</main>
<script type="text/javascript">
function valid()
{
var name = document.getElementById('notif').value.trim();
var qualification = document.getElementsByName('check[]');
if (name=="")
{
document.getElementById('sp1').innerHTML = "Please Add Notification";
return false;
}
//checkbox
var flagc=0;
for(i=0;i<qualification.length;i++)
{
if(qualification[i].checked==true)
{
flagc=1;
break;
}
}
if(flagc==0)
{
document.getElementById('sp6').innerHTML = "Select TO";
return false;
}
function clearmsg(span)
{
document.getElementById(span).innerHTML="";
return true;
}
}
</script>
<?php include 'script.php'; ?>
</body>
</html>