-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
95 lines (83 loc) · 2.77 KB
/
Copy pathindex.php
File metadata and controls
95 lines (83 loc) · 2.77 KB
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
<?
use import\config;
use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
require_once 'config/config.php';
$db = new Config();
$conn = $db->getConnection();
require_once ('./vendor/autoload.php');
include 'helpers/import.php';
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Import Spreadsheet to SQl Database</title>
<link rel="stylesheet" href="css\bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body id="content">
<div class="container">
<div id="response" class="text-center <?php if(!empty($type)) { echo $type . " display-block"; } ?>"><?php if(!empty($message)) { echo $message; } ?></div>
<form action="" method="post" name="frmExcelImport" id="frmExcelImport" class="mt-2" enctype="multipart/form-data">
<div class="row">
<div class="col-md-8 col-sm-12">
<div class="custom-file mb-2">
<input type="file" accept=".xls,.xlsx" name="file" required class="form-control custom-file-input" id="customFile">
<label class="custom-file-label" for="customFile">Choose file</label>
</div>
</div>
<div class=" form-group col-md-4 col-sm-12">
<button type="submit" id="submit" name="import"
class="btn btn-block btn-warning">Import</button>
</div>
</div>
</form>
</div>
<div>
<?php
$sqlSelect = "SELECT * FROM tbl_info";
$result = $db->select($sqlSelect);
if (! empty($result)) {
?>
<table class='tutorial-table'>
<thead>
<tr>
<th>County</th>
<th>Sub county</th>
<th>Name</th>
<th>Ward</th>
<th>village</th>
<th>Id no</th>
<th>Phone</th>
</tr>
</thead>
<?php
foreach ($result as $row) { // ($row = mysqli_fetch_array($result))
?>
<tbody>
<tr>
<td><?php echo $row['county']; ?></td>
<td><?php echo $row['sub_county']; ?></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['ward']; ?></td>
<td><?php echo $row['village']; ?></td>
<td><?php echo $row['id_no']; ?></td>
<td><?php echo $row['phone']; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
</div>
<script src="js\jquery-3.3.1.min.js"></script>
<!-- bootstrap js file -->
<script src="js\bootstrap.min.js"></script>
<script src="js\script.js"></script>
</body>
</html>