-
Notifications
You must be signed in to change notification settings - Fork 0
/
controller.php
45 lines (41 loc) · 908 Bytes
/
controller.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
<?php include("login.php");?>
<?php
include ("database.php");
if(isset($_POST['btn_permintaanbrg'])) {
/*echo "<pre>";
print_r($_SESSION['data']);
print_r($_POST);
exit;*/
$data = $_SESSION['data'];
$tbl="tb_permintaanbrg";
$i = 0;
$database = new database;
foreach ($data as $key => $v) {
$request = array('',
$v[1],
$v[2],
$v[3],
$_POST['jml'][$i],
$v[5],
'',
'',
''
);
echo "<pre>";
$i++;
$add_data = $database->insert($tbl, $request);
}
unset($_SESSION['data']);
if($add_data == true){
echo "<script type='text/javascript'>".
"alert('Permintaan Telah Berhasil dikirim');".
"window.location = 'home.php';".
"</script> ";
} else {
echo "<script type='text/javascript'>".
"alert('Permintaan Gagal');".
"window.location = 'home.php';".
"</script> ";
}
}
?>