<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Admin Section Login</title>

<link href="style.css" rel="stylesheet">

</head>

<body>

<div id="form-wrapper">

<?php

require_once 'include/user.php';

$db = new User();

$token = $db->getRegisteredToken();
?>

</style>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<script>

$(function(){

$("textarea").val("");

});

function isEmptyTextBox(){

var msgLength = $.trim($("textarea").val()).length;

if(msgLength == 0){

alert("Text box must not be empty");

return false;

}else{

return true;

}

}

</script>

<p id="logo"><img src="images/gs-2.png" alt="logo" height="150" width="150" /></p>

<br/>
<br/>
<br/>

<h2>GestStudent Notification (Php Web Server) </h2>


<form method="post" action="servertodatabase.php" onsubmit="return isEmptyTextBox()">

<input type="hidden" id="user_id" name="token" value="<?php echo $token ? $token : 0 ?>">
<select name="sujet">
  <option value="Sujet non défini">Choisir le sujet du message</option>
  <option value="Informations divers">Informations divers</option>
  <option value="Insertion de notes">Insertion de notes</option>
  <option value="Résultats disponible">Résultats disponibles</option>
</select>

<textarea cols="70" rows="12" name="message" cols="45" placeholder="Message via Firebase Cloud Messaging"></textarea> <br/>

<input id="button-send" type="submit" value="Send Notification" />

</form>

</div>

</body>

</html>