-
Notifications
You must be signed in to change notification settings - Fork 0
/
add-leave.php
58 lines (49 loc) · 1.54 KB
/
add-leave.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
<?php
require_once "importance.php";
?>
<html>
<head>
<title><?php echo CONFIG::SYSTEM_NAME; ?> : New Leave</title>
<?php require_once "inc/head.inc.php"; ?>
</head>
<body>
<?php require_once "inc/header.inc.php"; ?>
<div class='container-fluid'>
<div class='row'>
<div class='col-md-3'><?php require_once "inc/sidebar.inc.php"; ?></div> <!-- this should be a sidebar -->
<div class='col-md-8'>
<div class='content-area'>
<div class='content-header'>
New Leave <small>Request a leave</small>
</div>
<div class='content-body'>
<div class='form-holder'><br /><br />
<?php
$ename = User::get($token,"firstName")." ".User::get($token,"secondName");
$eid = $userId;
$dol = date("d-m-Y");
if(isset($_POST['e-date'])){
$dol = $_POST['e-date'];
$msg = $_POST['e-msg'];
if($dol == "" || $msg == ""){
Messages::error("You must fill in all the fields");
} else {
Leave::send($dol, $token, $msg);
}
}
$form = new Form(3, "post");
$form->init();
$form->textBox("Name", "e-name", "text", "$ename", array("readonly") );
$form->textBox("Id", "e-id", "text", "$eid", array("readonly") );
$form->textBox("Date of leave", "e-date", "date", "$dol", "");
$form->textarea("Message", "e-msg", "" );
$form->close("Send");
?>
</div>
</div><!-- end of the content area -->
</div>
</div><!-- col-md-8 -->
</div>
</div>
</body>
</html>