-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault-book.php
More file actions
130 lines (90 loc) · 3.81 KB
/
Copy pathdefault-book.php
File metadata and controls
130 lines (90 loc) · 3.81 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
include("connect/connect.php");
if(isset($_GET['id'])){
$b_id = $_GET['id'];
$sql = "SELECT * FROM book WHERE b_id = '$b_id'";
$result = mysqli_query($conn,$sql);
$row = mysqli_fetch_array($result);
$return_date = $row['b_date'];
$today = date('Y-m-d');
$pay = 0;
$day_late_qty = 0;
if($today > $return_date){
$time_today = strtotime($today);
$time_return = strtotime($return_date);
$day_late_qty = ($time_today - $time_return) / ( 60 * 60 * 24 );
$pay = ceil($day_late_qty) *5;
echo '<br>';
echo '<div class="col-xl-12 text-center text-indigo">';
echo $pay;
echo '</div>';
}
else{
echo 'no price';
$sql = "UPDATE book
SET s_id = '0',
b_date = '0'
WHERE b_id = '$b_id'
";
$result = mysqli_query($conn,$sql);
if($result){
header("location:../result-book.php?status=1");
}else{
header("location:../result-book.php?status=2");
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<?php
include_once("component/header.php");
?>
<body class="s1" >
<script type="text/javascript">
/*
//onload show modal script ชุดนี้โหลดมาตรงๆ ไม่มีหน่วงเวลานะ
$(document).ready(function(){
$("#myModal").modal('show');
});
*/
//เรีกยก modal ออกมาแสดง
var show = function(){
$('#myModal').modal('show');
};
/* กำหนดเวลาหลังเปิดหน้าเว็บ ว่าจะให้แสดงหลังโหลดหน้าเว็บแล้วกี่วินาที เช่น 2000 = 2 วิ */
$(window).load(function(){
var timer = window.setTimeout(show,2000);
});
</script>
</head>
<body>
<!-- title -->
<div class="container">
<div class="row">
<div class="col-md-12">
<h2 align="center"> devbanban.com </h2>
</div>
</div>
</div>
<!-- modal -->
<div id="myModal" class="modal fade">
<div class="modal-dialog modal-sm"> <!-- กำหนดขนาดของ modal เพิ่มได้นะครับ เช่น xs, sm, md, lg -->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"> devbanban.com </h4>
</div>
<div class="modal-body">
<p>ข้อความ..... </p>
เนื้อหา, รุปภาพ ฯลฯ
หรือเอาไปประยุกต์ใช้กับอะไรก็ได้ครับ
<br>
</div>
</div>
</div>
<?php
include_once("component/jslink.php");
?>
</body>
</html>