-
Notifications
You must be signed in to change notification settings - Fork 0
/
fileUpload.admin.php
94 lines (74 loc) · 3.25 KB
/
fileUpload.admin.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Upload Documents</title>
</head>
<body>
<?php include_once("inc/Header.php"); ?>
<br>
<?php
if(isset($_POST['upload'])){
if (isset($_POST['NIC']) ){
$category=$_POST['category'];
$NIC=$_POST['NIC'];
$description=$_POST['description'];
$file = $_FILES['fileToUpload'];
require_once 'controller/fileupload.ctrl.php';
$fileupload = new fileuploader();
list($message, $status)=$fileupload->uploadFile($file,$category,$NIC,$description);
}
else{
$message='please insert all information.';
$status="info";
}
require_once 'inc/alert.view.php';
$alertView=new alert();
echo $alertView->showAlert($message,$status);
}
?>
<div class="container">
<div class='row'>
<div class="col-sm-3"></div>
<div class="col-sm-6" >
<form action="fileupload.admin.php" method="post" enctype="multipart/form-data" style="border: none;">
<div class="form-group" >
<!--label for="category">Record Category</label-->
<select class="form-control" name="category">
<option value="01">01-Birth Cetificate</option>
<option value="02">02-Salary Reports</option>
<option value="03">03-Marriage Certificate</option>
<option value="04">04-Service Description</option>
<option value="05">05-Vacation Details</option>
<option value="06">06-diploma Certificate</option>
<option value="07">07-Promotion Certificate</option>
<option value="08">08-Income details</option>
<option value="09">09-Childern's Birth Certificates</option>
<option value="10">10-Exam Certificate</option>
<option value="11">11-Transfer Letters</option>
<option value="12">12-Training Letters</option>
<option value="13">13-Loan Details</option>
</select>
</div>
<div class="form-group">
<!--label for="inputdefault">NIC number</label>
<input class="form-control" name="NIC" id="NIC" type="text"-->
<input class="form-control" name="NIC" type="text" placeholder="NIC Number" >
</div>
<div class="form-group">
<!--label for="inputdefault">Description</label>
<input class="form-control" name="description" id="description" type="text"-->
<input class="form-control" name="description" type="text" placeholder="description" >
</div>
<!--label for="myfile">Upload the file (Submit only in pdf form):</label-->
<input type="file" name="fileToUpload" id="fileToUpload" ><br><br>
<button name='upload'type="submit" class="btn btn-success">Upload</button>
</form>
</div>
<div class="col-sm-3"></div>
</div>
</div>
<?php include_once('inc/Footer.php'); ?>
</body>
</html>