-
Notifications
You must be signed in to change notification settings - Fork 0
/
set_rule.php
220 lines (148 loc) · 6.99 KB
/
set_rule.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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<?php
include("db.php");
include("sessionclient.php");
include("saatini.php");
include("function_botlelang.php");
include("fonnte/function_fonnte_lelang.php");
include("fonnte/settings.php");
/*
Ini halaman dashboard manajemen data lelang
untuk setting informasi dan notifikasi Rule peraturan lelan
+===========================================+
: Aplikasi Whatsapp BotLelang dibuat oleh :
: Kukuh TW :
: kukuhtw@gmail.com :
: https://linktr.ee/kukuhtw :
: https://wa.me/628129893706 :
+===========================================+
*/
cek_aktive_not_active($saatini,$link,$mySQLserver,$mySQLdefaultdb,$mySQLuser,$mySQLpassword);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$catatan="";
$mode = isset($_GET['mode']) ? $_GET['mode'] : '';
if ($mode=="") {
$mode = isset($_POST['mode']) ? $_POST['mode'] : '';
}
//echo "<br>mode = ".$mode;
//echo "<br>timestamp_jambuka = ".$timestamp_jambuka. " Jam Buka:".$jambuka;
//echo "<br>timestamp_jamtutup = ".$timestamp_jamtutup. " Jam Tutup:".$jamtutup;;
//echo "<br>timestamp_sekarang = ".$timestamp_sekarang. " saatini:".$saatini;;
$kelipatan = isset($_POST['kelipatan']) ? $_POST['kelipatan'] : '';
$startvalue = isset($_POST['startvalue']) ? $_POST['startvalue'] : '';
if ($mode=="set_rule") {
$edit_rule = isset($_POST['edit_rule']) ? $_POST['edit_rule'] : '';
$edit_waowner = isset($_POST['edit_waowner']) ? $_POST['edit_waowner'] : '';
$edit_rekening = isset($_POST['edit_rekening']) ? $_POST['edit_rekening'] : '';
$bolehproses=1;
if ($bolehproses==1) {
$sql_update = "UPDATE msbot
SET aturan_pemilik=?, waowner=?, rekening_pemilik=?
WHERE botid=?";
$stmt = mysqli_prepare($link, $sql_update);
mysqli_stmt_bind_param($stmt, "sssi", $edit_rule, $edit_waowner, $edit_rekening, $botid);
mysqli_stmt_execute($stmt);
}
if ($bolehproses==0) {
$catatan .= "<h1>Update Gagal !</h1> ";
$catatan .="<h2>".$catatan."</h2>";
// echo "<Br>catatan = ".$catatan;
}
}
?>
<html lang="en">
<?php include("head_register.php") ?>
<body class="bg-dark">
<div class="container">
<div class="card card-register mx-auto mt-5">
<div class="card-header">Entry Group</div>
<div class="card-body">
<?php include("menu.php"); ?>
<?php
$html = "<font color='red' size='1'><h1>".$catatan."</h1></font>";
$html .="<br>";
$sql = "select * from `msbot`
where `botid` ='$botid' ";
//echo "<br>sql = ".$sql;
$options = array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
);
$conn = new PDO("mysql:host=$mySQLserver;dbname=$mySQLdefaultdb", $mySQLuser, $mySQLpassword);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$rt=0;
foreach($conn->query($sql) as $row) {
$rt=$rt+1;
$aturan_pemilik=$row['aturan_pemilik'];
$rekening_pemilik=$row['rekening_pemilik'];
$alamat_pemilik=$row['alamat_pemilik'];
$waowner=$row['waowner'];
$jambuka=$row['jambuka'];
$jamtutup = $row['jamtutup'];
$kelipatan = $row['kelipatan'];
$startvalue = $row['startvalue'];
$isactive = $row['isactive'];
$kelipatan=$row['kelipatan'];
$kelipatan_f = number_format($kelipatan);
$startvalue=$row['startvalue'];
$startvalue_f = number_format($startvalue);
$timestamp_jambuka = strtotime($jambuka);
$timestamp_jamtutup = strtotime($jamtutup);
$timestamp_sekarang = strtotime($saatini);
if ($isactive==1) {
$ket_active="<font color='green'><b>Lelang dalam keadaan AKTIF</b></font>";
}
if ($isactive==0) {
$ket_active="<font color='red'><b>Lelang dalam keadaan TIDAK AKTIF</b></font>";
}
if ($timestamp_sekarang<=$timestamp_jambuka) {
$ket_jam_buka = "Lelang akan dibuka pada ".get_time_forward($timestamp_jambuka);
}
if ($timestamp_sekarang>=$timestamp_jambuka) {
$ket_jam_buka = "Lelang telah dibuka sejak ".get_time_ago($timestamp_jambuka);
}
if ($timestamp_sekarang<=$timestamp_jamtutup) {
$ket_jam_tutup = "Lelang akan ditutup pada ".get_time_forward($timestamp_jamtutup);
}
if ($timestamp_sekarang>=$timestamp_jamtutup) {
$ket_jam_tutup = "Lelang telah ditutup sejak ".get_time_ago($timestamp_jamtutup);
}
$ket_active="";
if ($isactive==1) {
$ket_active="<font color='green'><b>Lelang dalam keadaan AKTIF</b></font>";
}
if ($isactive==0) {
$ket_active="<font color='red'><b>Lelang dalam keadaan TIDAK AKTIF</b></font>";
}
$html ="<br>";
$html ="<br>Status Active : ".$ket_active;
$html .="<form method='POST' action='' >";
$html .="<br><br>";
$html .="<br>Rule ";
$html .="<br>";
$html .="<br><textarea name='edit_rule' rows='20' cols='90'>".$aturan_pemilik."</textarea>";
$html .="<br><br>Rekening<br><br>";
$html .="<textarea name='edit_rekening' rows='10' cols='90'>".$rekening_pemilik."</textarea>";
$html .="<br><br>Whatsapp owner<br><br>";
$html .="<textarea name='edit_waowner' rows='1' cols='20'>".$waowner."</textarea>";
$html .="<input type='hidden' name='mode' value='set_rule'>";
$html .="<br><br><input type='submit' class='btn btn-space btn-primary' name='' value='Update Rule dan Rekening'>";
$html .= "<br></form>";
}
echo $html;
?>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript-->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<script type="text/javascript" src="jquery/jquery-1.8.3.min.js" charset="UTF-8"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/locales/bootstrap-datetimepicker.fr.js" charset="UTF-8"></script>
</body>
</html>