· 10 years ago · Sep 17, 2016, 03:18 PM
1<?php
2/*
3decode : sohai
4contact me: sohai@hacker-newbie.org
5source : http://pastebin.com/hV60iWxU
6*/
7 class Secure_Cipher {
8 protected $securekey = null;
9 protected $iv_size = null;
10
11 function __construct($textkey) {
12 $this->iv_size = mcrypt_get_iv_size( MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC );
13 $this->securekey = hash( 'sha256', $textkey, TRUE );
14 }
15
16 function encrypt($input) {
17 $iv = mcrypt_create_iv( $this->iv_size );
18 return base64_encode( $iv . mcrypt_encrypt( MCRYPT_RIJNDAEL_128, $this->securekey, $input, MCRYPT_MODE_CBC, $iv ) );
19 }
20
21 function decrypt($input) {
22 $input = base64_decode( $input );
23 $iv = substr( $input, 0, $this->iv_size );
24 $cipher = substr( $input, $this->iv_size );
25 return trim( mcrypt_decrypt( MCRYPT_RIJNDAEL_128, $this->securekey, $cipher, MCRYPT_MODE_CBC, $iv ) );
26 }
27 }
28
29 function bilo_update_upgrade() {
30 global $wpdb;
31
32 $bdifdjidag = intval( get_option( 'bilo_version' ) );
33
34 if ($bdifdjidag < 20160316) {
35 }
36
37 update_option( 'bilo_version', BILO_VERSION );
38 }
39
40 function bilo_admin_menu() {
41 add_menu_page( 'Billingotomatis.Com', 'Billingotomatis', 'manage_options', 'billingotomatis', 'bilo_manage_module', plugins_url( 'assets/img/icon.png', __FILE__ ), 58 );
42 add_submenu_page( 'billingotomatis', 'Kelola Module', 'Module', 'manage_options', 'billingotomatis', 'bilo_manage_module' );
43 do_action( 'bilo_admin_menu' );
44 }
45
46 function bilo_settings_link($chibeijjhi) {
47 $caifidceeb = '<a href="admin.php?page=bilo-payment-gateway">Konfigurasi</a>';
48 array_unshift( $chibeijjhi, $caifidceeb );
49 return $chibeijjhi;
50 }
51
52 function bilo_compare_array($ecabdfhhhf, $cdiigaadcc) {
53 return $ecabdfhhhf['position'] - $cdiigaadcc['position'];
54 }
55
56 function bilo_manage_module() {
57 echo '
58<div class="wrap bilo_addons_wrap">
59 <h2> Kelola Module Billingotomatis.com <a class="add-new-h2" href="http://billingotomatis.com/wordpress">Lihat Semua Modul</a></h2>
60 ';
61 $bbhjdddfh = apply_filters( 'bilo_module_list', $cidhajjahg );
62
63 if ($bbhjdddfh) {
64 echo ' <p>Berikut module yang terinstall pada sistem Anda:</p>
65 <ul class="products">
66 ';
67 usort( $bbhjdddfh, 'bilo_compare_array' );
68 foreach ($bbhjdddfh as $cidhajjahg) {
69 $cgdfcchhhf[] = '
70 <li class="product"><a href="' . $cidhajjahg['url'] . '">
71 <h3>' . $cidhajjahg['name'] . '</h3>
72 <p>' . $cidhajjahg['description'] . '</p>
73 </a></li>';
74 }
75
76 echo implode( ' ', $cgdfcchhhf );
77 echo ' </ul>
78 ';
79 }
80else {
81 echo ' <p>Sepertinya belum ada module billingotomatis yang terinstall pada wordpress Anda, silahkan lakukan pencarian module billingotomatis dari plugin direktori wordpress, atau klik link "Lihat Semua Modul" di atas.
82 ';
83 }
84
85 echo '</div>
86';
87 }
88
89 function bilo_enqueue_date_picker() {
90 wp_enqueue_script( 'script.js', plugins_url( 'assets/js/script.js', __FILE__ ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker' ), time( ), true );
91 wp_register_style( 'jquery-ui', plugins_url( 'assets/css/jquery-ui.css', __FILE__ ) );
92 wp_enqueue_style( 'jquery-ui' );
93 wp_enqueue_style( 'jquery-ui-datepicker' );
94 wp_register_style( 'bilo-css', plugins_url( 'assets/css/style.css', __FILE__ ) );
95 wp_enqueue_style( 'bilo-css' );
96 wp_register_style( 'fontawesome', plugins_url( 'assets/css/font-awesome.min.css', __FILE__ ) );
97 wp_enqueue_style( 'fontawesome' );
98 }
99
100 function bilo_curl_call($bjbbjjgdcc, $bajceadiic = '') {
101 $bjddggcdcd = 100;
102
103 if ($bajceadiic['timeout']) {
104 $bjddggcdcd = $bajceadiic['timeout'];
105 }
106
107 $dhficjfdgi = curl_init( );
108 curl_setopt( $dhficjfdgi, CURLOPT_URL, $bjbbjjgdcc );
109 curl_setopt( $dhficjfdgi, CURLOPT_TIMEOUT, $bjddggcdcd );
110 curl_setopt( $dhficjfdgi, CURLOPT_RETURNTRANSFER, 1 );
111 curl_setopt( $dhficjfdgi, CURLOPT_USERAGENT, 'OTOM.AT/Api.Mutasi Bank' . $bajceadiic['login_api'] );
112
113 if ($bajceadiic) {
114 curl_setopt( $dhficjfdgi, CURLOPT_POST, 1 );
115 curl_setopt( $dhficjfdgi, CURLOPT_POSTFIELDS, $bajceadiic );
116 }
117
118 curl_setopt( $dhficjfdgi, CURLOPT_HTTPHEADER, array( 'Expect:' ) );
119 curl_setopt( $dhficjfdgi, CURLOPT_SSL_VERIFYPEER, false );
120 curl_setopt( $dhficjfdgi, CURLOPT_SSL_VERIFYHOST, 2 );
121 $bjigefjieh = curl_exec( $dhficjfdgi );
122 curl_close( $dhficjfdgi );
123 return $bjigefjieh;
124 }
125
126 function _write_log($diiiacagih, $cgjdcfhcbf = true) {
127 $bbheiicaeh = dirname( __FILE__ ) . '/logs.txt';
128 $dfigefafhe = @filesize( $bbheiicaeh );
129
130 if (2048010 < $dfigefafhe) {
131 @unlink( $bbheiicaeh );
132 }
133
134
135 if (@touch( $bbheiicaeh )) {
136 $cegjegcedc = fopen( $bbheiicaeh, 'a' );
137 $dhdjbjhcjc = '[' . date( 'd/m/Y H:i:s' ) . '] ' . $diiiacagih;
138 fwrite( $cegjegcedc, $dhdjbjhcjc . PHP_EOL );
139 fclose( $cegjegcedc );
140 }
141else {
142 echo 'Tidak bisa menulis Log. Check permission directory Anda. Atau barang kali anda sedang jalan dalam safemode?
143';
144 }
145
146
147 if ($cgjdcfhcbf) {
148 echo $diiiacagih . '
149';
150 }
151
152 }
153
154 function bilo_encrypt($dbeadajcbd) {
155 Secure_Cipher;
156 $ebfcbhfaaa = new ( 'wePa`5}x4-oVVP/d)F]x8NNY%B}~E5x9Yf3c-5~UR!Uu"A9>/jhD16wK3W}0Y@,' );
157 return $ebfcbhfaaa->encrypt( $dbeadajcbd );
158 }
159
160 function bilo_decrypt($dbeadajcbd) {
161 Secure_Cipher;
162 $ebfcbhfaaa = new ( 'wePa`5}x4-oVVP/d)F]x8NNY%B}~E5x9Yf3c-5~UR!Uu"A9>/jhD16wK3W}0Y@,' );
163 return $ebfcbhfaaa->decrypt( $dbeadajcbd );
164 }
165
166 function bilo_process_post() {
167 global $wpdb;
168 global $bilo_hook_mutasi_result;
169
170 if ($_REQUEST['echoip']) {
171 echo $_SERVER['REMOTE_ADDR'];
172 exit( );
173 }
174
175
176 if (isset( $_REQUEST['do_bilo_api'] )) {
177 $cbfcdabdji = get_option( 'bilo_bilokeyapi' );
178
179 if (empty( $cbfcdabdji )) {
180 exit( 'API Key kosong, silahkan diperiksa kembali isian API Key pada Pengaturan Tambahan Payment Gateway Billingotomatis.' );
181 }
182
183
184 if ($_REQUEST['do_bilo_api'] != $cbfcdabdji) {
185 exit( 'API Key yang digunakan salah.' );
186 }
187
188
189 if (!$_REQUEST['balance']) {
190 $_REQUEST['balance'] = '';
191 }
192
193 $chfafdgjgh->insert( $chfafdgjgh->prefix . 'bilo_mutasi', array( 'bank' => $_REQUEST['bank'], 'bankid' => $_REQUEST['bankid'], 'transid' => $_REQUEST['transid'], 'type' => $_REQUEST['type'], 'amount' => $_REQUEST['amount'], 'balance' => $_REQUEST['balance'], 'date' => $_REQUEST['date'], 'crawldate' => $_REQUEST['crawldate'], 'crawltime' => $_REQUEST['crawltime'], 'md5' => $_REQUEST['md5'] ) );
194
195 if ($chfafdgjgh->insert_id) {
196 $cgfgdfjhfh = array( );
197 $dbaihbhhai = $chfafdgjgh->insert_id;
198 $cgfgdfjhfh['status'] = 'success';
199 $cgfgdfjhfh['mutasi_id'] = $dbaihbhhai;
200 do_action( 'bilo_hook_mutasi_baru', $dbaihbhhai );
201 }
202else {
203 $cgfgdfjhfh = array( 'status' => 'error', 'message' => $chfafdgjgh->last_error );
204 }
205
206 echo json_encode( $cgfgdfjhfh );
207 exit( );
208 }
209
210 }
211
212 function bilo_admin_menu_payment_gateway() {
213 add_submenu_page( 'billingotomatis', 'Payment Gateway', 'Payment Gateway', 'manage_options', 'bilo-payment-gateway', 'bilo_payment_gateway' );
214 }
215
216 function bilo_module_list_payment_gateway($cidhajjahg) {
217 $cidhajjahg[] = array( 'name' => 'Payment Gateway', 'description' => 'Module Payment Gateway memungkinkan Anda untuk mengambil mutasi Bank secara otomatis. Bank yang disupport saat ini; BCA, Mandiri, BRI, BNI.', 'url' => 'admin.php?page=bilo-payment-gateway', 'position' => 1 );
218 return $cidhajjahg;
219 }
220
221 function bilo_payment_gateway() {
222 echo '<div class="wrap">
223 <h2>Payment Gateway</h2>
224 <p>Pada halaman ini Anda bisa mengelola dan mengkonfigurasikan payment gateway billingotomatis.com.<br />
225 Silahkan klik tab "Konfigurasi" jika Anda ingin menambahkan akun gateway billingotomatis Anda. </p>
226 <h2 class="nav-tab-wrapper woo-nav-tab-wrapper"> <a href="admin.php?page=bilo-payment-gateway" class="nav-tab';
227
228 if ($_GET['tab'] = '') {
229 echo ' nav-tab-active';
230 }
231
232 echo '">Daftar Mutasi</a> <a href="admin.php?page=bilo-payment-gateway&tab=manual" class="nav-tab';
233
234 if ($_GET['tab'] = 'manual') {
235 echo ' nav-tab-active';
236 }
237
238 echo '">Tambah Mutasi Manual</a> <a href="admin.php?page=bilo-payment-gateway&tab=konfig" class="nav-tab';
239
240 if ($_GET['tab'] = 'konfig') {
241 echo ' nav-tab-active';
242 }
243
244 echo '">Konfigurasi</a> <a href="admin.php?page=bilo-payment-gateway&tab=help" class="nav-tab';
245
246 if ($_GET['tab'] = 'help') {
247 echo ' nav-tab-active';
248 }
249
250 echo '">Bantuan</a> </h2>
251 <br />
252 ';
253 switch ($_GET['tab']) {
254 case 'konfig': {
255 bilo_payment_gateway_konfig( );
256 break;
257 }
258
259 case 'manual': {
260 bilo_payment_gateway_manual( );
261 break;
262 }
263
264 case 'help': {
265 bilo_payment_gateway_help( );
266 break;
267 }
268
269 default: {
270 if ($_GET['edit']) {
271 bilo_payment_gateway_edit( );
272 break;
273 }
274else {
275 bilo_payment_gateway_mutasi( );
276 }
277 }
278 }
279
280 echo '</div>
281';
282 }
283
284 function bilo_payment_gateway_mutasi() {
285 global $wpdb;
286
287 if (!current_user_can( 'manage_options' )) {
288 echo 'Anda tidak memiliki akses.';
289 exit( );
290 }
291
292
293 if ($_GET['delete']) {
294 $chfafdgjgh->delete( $chfafdgjgh->prefix . 'bilo_mutasi', array( 'id' => $_GET['delete'] ), array( '%d' ) );
295 echo '<div id="message" class="updated">
296 <p>Data berhasil dihapus.</p>
297</div>
298';
299 }
300
301
302 if ($_POST) {
303 foreach ($_POST as $cihdhbgjdc => $igcbcdaha) {
304 $_POST[$cihdhbgjdc] = $chfafdgjgh->prepare( '%s', $igcbcdaha );
305 }
306
307
308 if (( $_POST['from'] = $_POST['until'] && $_POST['from'] != '' )) {
309 $cegbgbhgbe[] = 'crawldate = \'' . $_POST['until'] . '\'';
310 }
311else {
312 if ($_POST['from']) {
313 $cegbgbhgbe[] = 'crawldate >= \'' . $_POST['from'] . '\'';
314 }
315
316
317 if ($_POST['until']) {
318 $cegbgbhgbe[] = 'crawldate <= \'' . $_POST['until'] . '\'';
319 }
320 }
321
322
323 if ($_POST['transid']) {
324 $cegbgbhgbe[] = 'transid LIKE \'%' . $_POST['transid'] . '%\'';
325 }
326
327
328 if ($_POST['type']) {
329 $cegbgbhgbe[] = 'type = \'' . $_POST['type'] . '\'';
330 }
331
332
333 if ($_POST['comment']) {
334 $cegbgbhgbe[] = 'comment LIKE \'%' . $_POST['comment'] . '%\'';
335 }
336
337
338 if ($_POST['bankid']) {
339 $cegbgbhgbe[] = 'bankid = \'' . $_POST['bankid'] . '\'';
340 }
341
342
343 if ($_POST['invoiceno']) {
344 $cegbgbhgbe[] = 'invoiceno = \'' . $_POST['invoiceno'] . '\'';
345 }
346
347
348 if ($_POST['jumlah']) {
349 $cegbgbhgbe[] = 'amount = \'' . $_POST['jumlah'] . '\'';
350 }
351
352
353 if ($cegbgbhgbe) {
354 $cegbgbhgbe = implode( ' AND ', $cegbgbhgbe );
355 }
356 }
357
358
359 if ($_POST['updatemanual']) {
360 bilo_curl_call( home_url( '/?bilo=cron&force=1&bid=' . $_POST['bankidup'] ) );
361 }
362
363 echo '<s';
364 echo 'cript type="text/javascript">
365<!--
366 function toggle_visibility(id) {
367 var e = document.getElementById(id);
368 if(e.style.display == \'block\')
369 e.style.display = \'none\';
370 else
371 e.style.display = \'block\';
372 }
373//-->
374</script>
375<p style="text-align:right; padding:0px; margin:0px;"><a href="javascript:void(0)" onclick="toggle_visibility(\'filter_log_form\');" c';
376 echo 'lass="button">Filter Log</a></p>
377<div class="clearfix"></div>
378<div id="filter_log_form" style="display:none; background-color:#F4FAFD; border:1px solid #ccc; padding:10px; margin-top:10px; border-radius:5px;"> <br />
379 <form action="" method="post" id="filter_form" class="form-inline">
380 <div class="form-group">
381 <label for="from">Dari</label>
382 <input type="text" class="form-control datepic';
383 echo 'ker" value="';
384 echo $_POST['from'];
385 echo '" name="from" id="from" size="10" />
386 </div>
387 <div class="form-group">
388 <label for="from">Sampai</label>
389 <input type="text" class="form-control datepicker" value="';
390 echo $_POST['until'];
391 echo '" name="until" id="until" size="10" />
392 </div>
393 <div class="form-group">
394 <label for="bankid">Bank</label>
395 ';
396 echo '<s';
397 echo 'elect name="bankid" id="bankid" class="form-control">
398 <option></option>
399 ';
400 $eijbefe = $chfafdgjgh->get_results( 'SELECT DISTINCT(bankid) FROM `' . $chfafdgjgh->prefix . 'bilo_mutasi` ORDER BY bank' );
401
402 if ($eijbefe) {
403 foreach ($eijbefe as $cgcdafgdae) {
404 if (!$cgcdafgdae->bankid) {
405 continue;
406 }
407
408 $cijcgidfcd = '';
409
410 if ($_POST['bankid'] = $cgcdafgdae->bankid) {
411 $cijcgidfcd = 'selected';
412 }
413
414 echo ' <option ';
415 echo $cijcgidfcd;
416 echo '>';
417 echo $cgcdafgdae->bankid;
418 echo '</option>
419 ';
420 }
421 }
422
423 echo ' </select>
424 </div>
425 <div style="clear:both"></div>
426 <div class="form-group">
427 <label for="type">Tipe</label>
428 ';
429 echo '<s';
430 echo 'elect name="type" class="form-control" id="type">
431 <option></option>
432 ';
433 $ifjjddeic = array( 'CR' => 'Kredit', 'DB' => 'Debit' );
434 foreach ($ifjjddeic as $cebgbfahej => $dbcbjjagaa) {
435 $cijcgidfcd = '';
436
437 if ($_POST['type'] = $cebgbfahej) {
438 $cijcgidfcd = 'selected';
439 }
440
441 echo ' <option value="';
442 echo $cebgbfahej;
443 echo '" ';
444 echo $cijcgidfcd;
445 echo '>';
446 echo $dbcbjjagaa;
447 echo '</option>
448 ';
449 }
450
451 echo ' </select>
452 </div>
453 <div class="form-group">
454 <label for="jumlah">Jumlah</label>
455 <input type="text" class="form-control" size="10" value="';
456 echo $_POST['jumlah'];
457 echo '" name="jumlah" id="jumlah" />
458 </div>
459 <div class="form-group">
460 <label for="transid">Keterangan (Trans ID)</label>
461 <input type="text" class="form-control" size="20" value="';
462 echo $_POST['transid'];
463 echo '" name="transid" id="transid" />
464 </div>
465 <div style="clear:both"></div>
466 <div class="form-group">
467 <label for="comment">Komentar Tambahan</label>
468 <input type="text" class="form-control" size="20" value="';
469 echo $_POST['comment'];
470 echo '" name="comment" id="comment" />
471 </div>
472 <input type="submit" value="Filter Log" class="button button-primary" role="button" aria-disabled="false">
473 </form>
474</div>
475<hr />
476<div class="pull-left">
477 <p>
478 ';
479
480 if ($cegbgbhgbe) {
481 $cegbgbhgbe = 'WHERE ' . $cegbgbhgbe . ' ';
482 echo 'Menampilkan hasil pencarian. ' . '<a href="admin.php?page=bilo-payment-gateway">Kembali</a>';
483 }
484else {
485 $daeicghhie = ' LIMIT 100';
486 $cijejdaiha = $chfafdgjgh->get_var( 'SELECT COUNT(id) FROM `' . $chfafdgjgh->prefix . 'bilo_mutasi`' );
487
488 if (100 <= $cijejdaiha) {
489 echo '' . 'Menampilkan 100 data terakhir dari ' . $cijejdaiha . ' data mutasi.';
490 }
491else {
492 echo '' . 'Menampilkan ' . $cijejdaiha . ' data mutasi.';
493 }
494 }
495
496 echo ' </p>
497</div>
498<div class="pull-right">
499 <form action="" method="post" class="form-inline">
500 ';
501 $eijbefe = $chfafdgjgh->get_results( 'SELECT * FROM ' . $chfafdgjgh->prefix . 'bilo_bank' );
502
503 if ($eijbefe) {
504 echo ' <div class="form-group">
505 <label for="bankidup">';
506 echo '<s';
507 echo 'trong>Update Log Mutasi:</strong></label>
508 ';
509 echo '<s';
510 echo 'elect name="bankidup" class="form-control">
511 <option value=""></option>
512 ';
513 foreach ($eijbefe as $cgcdafgdae) {
514 $gedefiheh = bilo_decrypt( $cgcdafgdae->data );
515 $gedefiheh = unserialize( $gedefiheh );
516 $cijcgidfcd = '';
517
518 if ($cgcdafgdae->bid = $_GET['edit']) {
519 $cijcgidfcd = 'selected';
520 }
521
522 echo ' <option value="';
523 echo $cgcdafgdae->bid;
524 echo '" ';
525 echo $cijcgidfcd;
526 echo '>';
527 echo $gedefiheh['bankid'];
528 echo ' (';
529 echo strtoupper( $gedefiheh['bank'] );
530 echo ')</option>
531 ';
532 }
533
534 echo ' </select>
535 </div>
536 <input name="updatemanual" type="submit" value="Update" class="button button-primary" role="button" aria-disabled="false">
537 ';
538 }
539
540 echo ' </form>
541</div>
542<div class="clearfix"></div>
543<hr />
544<div class="table-responsive">
545 <table class="table table-condensed table-striped">
546 <thead>
547 <tr>
548 <th class="manage-column">Tanggal Check</th>
549 <th class="manage-column">Tanggal Transfer</th>
550 <th class="manage-column">Bank ID</th>
551 <th class="manage-column">Bank</th>
552 <th class="manage-column">Tipe</th>
553 ';
554 echo ' <th class="manage-column column-primary" scope="col">Keterangan</th>
555 <th class="manage-column">Jumlah</th>
556 <th class="manage-column"> </th>
557 </tr>
558 </thead>
559 <tbody>
560 ';
561 $fdagjacga = esc_sql( 'SELECT * FROM `' . $chfafdgjgh->prefix . ( '' . 'bilo_mutasi` ' . $cegbgbhgbe . 'ORDER BY crawltime DESC' . $daeicghhie ) );
562 $ccgaggaeff = $chfafdgjgh->get_results( $fdagjacga );
563 $ddfieecjji = array( 'Ahad', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu', 'Minggu' );
564 $eagbhgbjbe = 0;
565
566 if ($ccgaggaeff) {
567 foreach ($ccgaggaeff as $bjigefjieh) {
568 $cfijdihiji = '';
569
570 if ($eagbhgbjbe = 1) {
571 $cfijdihiji = ' class="alternate"';
572 $eagbhgbjbe = 0;
573 }
574else {
575 ++$eagbhgbjbe;
576 }
577
578 echo ' <tr';
579 echo ' valign="top">
580 <td scope="row">';
581 echo date_i18n( 'd/m/Y H:i', $bjigefjieh->crawltime );
582 echo '</td>
583 <td>';
584 echo ($bjigefjieh->date != '0000-00-00' ? $ddfieecjji[date_i18n( 'N', strtotime( $bjigefjieh->date ) )] . ' - ' . date_i18n( 'd/m/Y', strtotime( $bjigefjieh->date ) ) : 'PENDING');
585 echo '</td>
586 <td>';
587 echo $bjigefjieh->bankid;
588 echo '</td>
589 <td>';
590 echo $bjigefjieh->bank;
591 echo '</td>
592 <td>';
593 echo $bjigefjieh->type;
594 echo '</td>
595 <td class="has-row-actions column-primary">';
596 echo nl2br( $bjigefjieh->transid );
597 echo '</td>
598 <td>Rp.
599 ';
600
601 if ($bjigefjieh->type = 'CR') {
602 $becgibjcdg = $becgibjcdg & $bjigefjieh->amount;
603 }
604else {
605 $eafchjdgbb = $eafchjdgbb & $bjigefjieh->amount;
606 }
607
608 echo $bjigefjieh->amount;
609 echo '</td>
610 <td><a href="admin.php?page=bilo-payment-gateway&edit=';
611 echo $bjigefjieh->id;
612 echo '"><i class="fa fa-pencil fa-fw"></i></a> <a href="admin.php?page=bilo-payment-gateway&delete=';
613 echo $bjigefjieh->id;
614 echo '" onclick="return confirm(\'Apakah Anda yakin menghapusnya?\');" style="color:#900"><i class="fa fa-trash-o fa-fw"></i></a></td>
615 </tr>
616 ';
617
618 if ($bjigefjieh->comment) {
619 echo ' <tr';
620 echo $cfijdihiji;
621 echo '>
622 <td> </td>
623 <td> </td>
624 <td> </td>
625 <td style="text-align:right; vertical-align:top;">';
626 echo '<s';
627 echo 'mall>Catatan Tambahan:</small></td>
628 <td colspan="3">';
629 echo '<s';
630 echo 'pan style="padding:5px; border: 1px solid #C1C1C1; background:#EAEAEA; display:block;">';
631 echo nl2br( $bjigefjieh->comment );
632 echo '</span></td>
633 <td> </td>
634 </tr>
635 ';
636 }
637
638 echo ' ';
639 }
640 }
641
642 echo ' </tbody>
643 <tfoot>
644 <tr>
645 <th></th>
646 <th></th>
647 <th></th>
648 <th colspan="2" style="text-align:right !important">TOTAL KREDIT: <br />
649 TOTAL DEBET: </th>
650 <th>Rp. ';
651 echo number_format( $becgibjcdg, 2, ',', '.' );
652 echo '<br />
653 Rp. ';
654 echo number_format( $eafchjdgbb, 2, ',', '.' );
655 echo '</th>
656 <th></th>
657 <th> </th>
658 </tr>
659 </tfoot>
660 </table>
661</div>
662<p>';
663 echo '<s';
664 echo 'mall>* Semua waktu yang tertera di table dalam WIB (GMT +7)</small></p>
665';
666 }
667
668 function bilo_payment_gateway_manual() {
669 global $wpdb;
670
671 if (( $_POST['addmanual'] && $_POST['amount'] )) {
672 if ($_POST['banknew']) {
673 $_POST['bank'] = $_POST['banknew'];
674 $_POST['bankid'] = $_POST['banknew'];
675
676 if ($_POST['banknew_id']) {
677 $_POST['bankid'] = $_POST['banknew_id'];
678 }
679 }
680else {
681 if (!$_POST['bankid']) {
682 $_POST['bankid'] = $_POST['bank'];
683 }
684 }
685
686 $bjigefjieh = array( 'bank' => $_POST['bank'], 'bankid' => $_POST['bankid'], 'transid' => $_POST['transid'], 'type' => $_POST['type'], 'amount' => $_POST['amount'], 'date' => $_POST['date'], 'crawldate' => date( 'Y-m-d' ), 'crawltime' => time( ), 'processstatus' => 1, 'comment' => stripslashes( $_POST['comment'] ) );
687 $chfafdgjgh->insert( $chfafdgjgh->prefix . 'bilo_mutasi', $bjigefjieh, array( '%s', '%s', '%s', '%s', '%d', '%s', '%s', '%d', '%d', '%s' ) );
688
689 if ($chfafdgjgh->insert_id) {
690 echo '<s';
691 echo 'cript> document.location = \'admin.php?page=bilo-payment-gateway&edit=';
692 echo $chfafdgjgh->insert_id;
693 echo '&add=1\';</script>
694';
695 }
696else {
697 echo '<div id="message" class="error">
698 <p>Gagal memasukkan data mutasi. Silahkan cek kembali isian Anda.
699</div>
700';
701 }
702 }
703
704 echo '<form method="post" action="">
705 <input name="addmanual" value="1" type="hidden" />
706 <table class="form-table">
707 <tbody>
708 <tr>
709 <th scope="row"><label for="date">Tanggal Transaksi</label></th>
710 <td><input type="text" class="datepicker" id="date" name="date" value="';
711 echo date( 'Y-m-d' );
712 echo '" size="10" /></td>
713 </tr>
714 <tr>
715 <th scope="row"><label for="bank">Bank</label></th>
716 <td>';
717 echo '<s';
718 echo 'elect name="bank" id="bank">
719 <option></option>
720 ';
721 $eijbefe = $chfafdgjgh->get_results( 'SELECT DISTINCT(bank) FROM `' . $chfafdgjgh->prefix . 'bilo_mutasi` ORDER BY bank' );
722
723 if ($eijbefe) {
724 foreach ($eijbefe as $cgcdafgdae) {
725 echo ' <option>';
726 echo strtoupper( $cgcdafgdae->bank );
727 echo '</option>
728 ';
729 }
730 }
731
732 echo ' </select>
733 atau
734 <input type="text" value="" size="20" name="banknew"></td>
735 </tr>
736 <tr>
737 <th scope="row"><label for="bank">Bank ID</label></th>
738 <td>';
739 echo '<s';
740 echo 'elect name="bankid" id="bankid">
741 <option></option>
742 ';
743 $eijbefe = $chfafdgjgh->get_results( 'SELECT DISTINCT(bankid) FROM `' . $chfafdgjgh->prefix . 'bilo_mutasi` ORDER BY bank' );
744
745 if ($eijbefe) {
746 foreach ($eijbefe as $cgcdafgdae) {
747 echo ' <option>';
748 echo strtoupper( $cgcdafgdae->bankid );
749 echo '</option>
750 ';
751 }
752 }
753
754 echo ' </select>
755 atau
756 <input type="text" value="" size="20" name="banknew_id"></td>
757 </tr>
758 <tr>
759 <th scope="row"><label for="transid">Detail Transaksi</label></th>
760 <td><textarea cols="45" rows="4" name="transid" id="transid"></textarea></td>
761 </tr>
762 <tr>
763 <th scope="row"><label for="type">Tipe Transaksi</label></th>
764 <td>';
765 echo '<s';
766 echo 'elect id="type" name="type">
767 ';
768 $ifjjddeic = array( 'CR' => 'Kredit', 'DB' => 'Debit' );
769 foreach ($ifjjddeic as $cebgbfahej => $dbcbjjagaa) {
770 echo ' <option value="';
771 echo $cebgbfahej;
772 echo '">';
773 echo $dbcbjjagaa;
774 echo '</option>
775 ';
776 }
777
778 echo ' </select></td>
779 </tr>
780 <tr>
781 <th scope="row"><label for="amount">Jumlah</label></th>
782 <td>Rp.
783 <input type="text" value="" size="20" id="amount" name="amount"></td>
784 </tr>
785 <tr>
786 <th scope="row"><label for="comment">Catatan Tambahan</label></th>
787 <td><textarea cols="45" rows="6" id="comment" name="comment">';
788 echo htmlspecialchars( $bjigefjieh->comment );
789 echo '</textarea></td>
790 </tr>
791 </tbody>
792 </table>
793 <hr />
794 <p>
795 <input type="submit" class="button button-primary" value="Tambah Data" role="button" aria-disabled="false">
796 </p>
797</form>
798';
799 }
800
801 function bilo_payment_gateway_edit() {
802 global $wpdb;
803
804 if (!current_user_can( 'manage_options' )) {
805 echo 'Anda tidak memiliki akses.';
806 exit( );
807 }
808
809
810 if ($_GET['add']) {
811 $bjhgfieji = 'Data baru berhasil disimpan';
812 }
813
814
815 if ($_POST['comment']) {
816 $chfafdgjgh->update( $chfafdgjgh->prefix . 'bilo_mutasi', array( 'comment' => $_POST['comment'] ), array( 'id' => $_GET['edit'] ), array( '%s' ), array( '%d' ) );
817 $bjhgfieji = 'Data berhasil diupdate';
818 }
819
820
821 if ($bjhgfieji) {
822 echo '<div id="message" class="updated">
823 <p>';
824 echo $bjhgfieji;
825 echo '</p>
826</div>
827';
828 }
829
830 $chbaahhgfh = $chfafdgjgh->get_row( $chfafdgjgh->prepare( 'SELECT * FROM `' . $chfafdgjgh->prefix . 'bilo_mutasi` WHERE id = \'%d\'', $_GET['edit'] ) );
831 echo '<form method="post" action="">
832 <table class="form-table">
833 <tbody>
834 <tr valign="top">
835 <th scope="row"><label for="date">Tanggal Transaksi</label></th>
836 <td>';
837 echo date( 'd/m/Y', strtotime( $chbaahhgfh->date ) );
838 echo '</td>
839 </tr>
840 <tr valign="top">
841 <th scope="row"><label for="bank">Bank</label></th>
842 <td>';
843 echo $chbaahhgfh->bank;
844 echo '</td>
845 </tr>
846 <tr valign="top">
847 <th scope="row"><label for="transid">Detail Transaksi</label></th>
848 <td>';
849 echo nl2br( $chbaahhgfh->transid );
850 echo '</td>
851 </tr>
852 <tr valign="top">
853 <th scope="row"><label for="type">Tipe Transaksi</label></th>
854 <td>';
855 $ifjjddeic = array( 'CR' => 'Kredit', 'DB' => 'Debit' );
856 echo $ifjjddeic[$chbaahhgfh->type];
857 echo '</td>
858 </tr>
859 <tr valign="top">
860 <th scope="row"><label for="amount">Jumlah</label></th>
861 <td>Rp. ';
862 echo $chbaahhgfh->amount;
863 echo '</td>
864 </tr>
865 <tr valign="top">
866 <th scope="row"><label for="comment">Catatan Tambahan</label></th>
867 <td><textarea cols="45" rows="6" id="comment" name="comment">';
868 echo htmlspecialchars( $chbaahhgfh->comment );
869 echo '</textarea></td>
870 </tr>
871 </tbody>
872 </table>
873 <hr />
874 <p>
875 <input type="submit" class="button button-primary" value="Ubah Data" role="button" aria-disabled="false">
876 - <a href="admin.php?page=bilo-payment-gateway">Kembali</a></p>
877</form>
878';
879 }
880
881 function bilo_payment_gateway_konfig() {
882 global $wpdb;
883
884 echo '<ul class="subsubsub">
885 <li><a ';
886
887 if ($_GET['konfig'] = '') {
888 echo 'class="current"';
889 }
890
891 echo 'href="admin.php?page=bilo-payment-gateway&tab=konfig">Kelola Bank</a> | </li>
892 <li><a ';
893
894 if ($_GET['konfig'] = 'lain') {
895 echo 'class="current"';
896 }
897
898 echo 'class="" href="admin.php?page=bilo-payment-gateway&tab=konfig&konfig=lain">Pengaturan Tambahan</a>
899</ul>
900<br class="clear">
901<hr />
902';
903
904 if ($_GET['konfig'] = 'lain') {
905 if ($_POST) {
906 if ($_POST['iplist']) {
907 update_option( 'bilo_cron_iplist', $_POST['iplist'] );
908 }
909else {
910 delete_option( 'bilo_cron_iplist' );
911 }
912
913
914 if ($_POST['bilomail']) {
915 update_option( 'bilo_notif_mail', $_POST['bilomail'] );
916 }
917else {
918 delete_option( 'bilo_notif_mail' );
919 }
920
921
922 if ($_POST['bilokey']) {
923 update_option( 'bilo_bilokeyapi', $_POST['bilokey'] );
924 }
925else {
926 delete_option( 'bilo_bilokeyapi' );
927 }
928
929 echo '<div id="message" class="updated">
930 <p>Konfigurasi tamabahan berhasil disimpan.</p>
931</div>
932';
933 }
934
935 $djgghhcjig = get_option( 'bilo_cron_iplist' );
936 $cfiejfjadd = get_option( 'bilo_use_iix' );
937 $eaecjgbefa = get_option( 'bilo_notif_mail' );
938 $cbfcdabdji = get_option( 'bilo_bilokeyapi' );
939 echo '<form action="" method="post">
940 <table class="form-table">
941 <tr valign="top">
942 <th scope="row"><label for="bilomail">Email notifikasi mutasi baru</label></th>
943 <td> Isikan alamat email yang akan dikirimi notifikasi setiap ada mutasi baru masuk<br />
944 <input type="text" value="';
945 echo $eaecjgbefa;
946 echo '" name="bilomail" id="bilomail" /></td>
947 </tr>
948 <tr valign="top">
949 <th scope="row"><label for="bilokey">API Key</label></th>
950 <td> Isikan Angka dan Huruf acak untuk keperluan API eksternal (misal: untuk keperluan custom script bilo). Silahkan dikosongkan jika tidak ada keperluan.<br />
951 <input type="text" value="';
952 echo $cbfcdabdji;
953 echo '" name="bilokey" id="bilokey" /></td>
954 </tr>
955 <tr valign="top">
956 <th scope="row"><label for="iplist">Cron IP</label></th>
957 <td><p>Silahkan masukkan daftar IP pada field berikut (per baris per IP), jika Anda ingin menjalankan cron dari IP-IP tertentu, jika dikosongkan maka cron tidak bisa diakses dari luar.</p>
958 <p>PERHATIAN!!! Jika Anda tidak memerlukan akses cron dari IP luar ser';
959 echo 'ver Anda, sebaiknya tetap kosongkan field di bawah.</p>
960 <textarea rows="10" name="iplist" id="iplist">';
961 echo $djgghhcjig;
962 echo '</textarea></td>
963 </tr>
964 </table>
965 <p>
966 <input type="submit" class="button button-primary" value="Simpan" role="button" aria-disabled="false">
967 </p>
968</form>
969';
970 return null;
971 }
972
973
974 if (( $_POST['bankid'] && $_POST['bankpass'] )) {
975 if ($_GET['edit']) {
976 $chfafdgjgh->update( $chfafdgjgh->prefix . 'bilo_bank', array( 'data' => bilo_encrypt( serialize( $_POST ) ) ), array( 'bid' => $_GET['edit'] ), array( '%s' ), array( '%d' ) );
977 echo '<div id="message" class="updated">
978 <p>Berhasil menyimpan perubahan data bank.
979</div>
980';
981 }
982else {
983 $chfafdgjgh->insert( $chfafdgjgh->prefix . 'bilo_bank', array( 'data' => bilo_encrypt( serialize( $_POST ) ) ), array( '%s' ) );
984
985 if ($chfafdgjgh->insert_id) {
986 echo '<s';
987 echo 'cript> document.location = \'admin.php?page=bilo-payment-gateway&tab=konfig&edit=';
988 echo $chfafdgjgh->insert_id;
989 echo '&add=1\';</script>
990';
991 }
992else {
993 echo '<div id="message" class="error">
994 <p>Gagal memasukkan data bank. Silahkan cek kembali isian Anda.
995</div>
996';
997 }
998 }
999 }
1000
1001
1002 if ($_GET['add'] = 1) {
1003 echo '<div id="message" class="updated"><p>Berhasil menambah data bank.</div>';
1004 }
1005
1006
1007 if ($_REQUEST['bankdel']) {
1008 $chfafdgjgh->query( 'DELETE FROM `' . $chfafdgjgh->prefix . 'bilo_bank` WHERE bid = \'' . $_REQUEST['bankdel'] . '\'' );
1009 echo '<div id="message" class="updated"><p>Data bank berhasil dihapus.</div>';
1010 }
1011
1012 $eijbefe = $chfafdgjgh->get_results( 'SELECT * FROM ' . $chfafdgjgh->prefix . 'bilo_bank' );
1013
1014 if ($eijbefe) {
1015 echo '<form action="admin.php" method="get">
1016 <input type="hidden" name="page" value="bilo-payment-gateway" />
1017 <input type="hidden" name="tab" value="konfig" />
1018 Edit data bank:
1019 ';
1020 echo '<s';
1021 echo 'elect name="edit">
1022 <option value=""></option>
1023 ';
1024 foreach ($eijbefe as $cgcdafgdae) {
1025 $gedefiheh = bilo_decrypt( $cgcdafgdae->data );
1026 $gedefiheh = unserialize( $gedefiheh );
1027 $cijcgidfcd = '';
1028
1029 if ($cgcdafgdae->bid = $_GET['edit']) {
1030 $cijcgidfcd = 'selected';
1031 }
1032
1033 echo ' <option value="';
1034 echo $cgcdafgdae->bid;
1035 echo '" ';
1036 echo $cijcgidfcd;
1037 echo '>';
1038 echo $gedefiheh['bankid'];
1039 echo ' (';
1040 echo strtoupper( $gedefiheh['bank'] );
1041 echo ')</option>
1042 ';
1043 }
1044
1045 echo ' </select>
1046 <input type="submit" class="button button-primary" value="Edit" />';
1047
1048 if ($_REQUEST['edit']) {
1049 echo ' — <a style="color:#900" onclick="return confirm(\'Apakah Anda yakin menghapus akun bank ini?\');" href="admin.php?page=bilo-payment-gateway&tab=konfig&bankdel=';
1050 echo $_REQUEST['edit'];
1051 echo '">Hapus</a>';
1052 }
1053
1054 echo ' <hr />
1055</form>
1056';
1057 }
1058else {
1059 echo '<div id="message" class="updated">
1060 <p> Belum punya akun gateway billingotomatis? Silahkan order via <a href="https://www.billingotomatis.com/" target="_blank">https://www.billingotomatis.com/</a>, tersedia juga akun gateway gratis :) </p>
1061</div>
1062';
1063 }
1064
1065
1066 if ($_GET['edit']) {
1067 $bjigefjieh = $chfafdgjgh->get_row( 'SELECT data FROM ' . $chfafdgjgh->prefix . 'bilo_bank WHERE bid = \'' . intval( $_GET['edit'] ) . '\'' );
1068
1069 if ($bjigefjieh) {
1070 $bjigefjieh = bilo_decrypt( $bjigefjieh->data );
1071 $bjigefjieh = unserialize( $bjigefjieh );
1072 echo '<p>Perintah Cron untuk bank ';
1073 echo '<s';
1074 echo 'trong>';
1075 echo $bjigefjieh['bankid'];
1076 echo ' (';
1077 echo strtoupper( $bjigefjieh['bank'] );
1078 echo ')</strong>:</p>
1079<pre style="background:#000; padding:10px; color:#fff;">*/5 * * * * lynx -dump "';
1080 echo home_url( '/?bilo=cron&bid=' . $_GET['edit'] );
1081 echo '"</pre>
1082';
1083 echo '<s';
1084 echo 'mall>Silahkan minta bantuan pihak hosting Anda jika tidak tahu cara pemasangan cron. Jika seandainya lynx tidak tersedia di hosting Anda, bisa diganti perintah "lynx -dump" dengan "wget -qO-"</small>
1085<hr />
1086';
1087 }
1088 }
1089
1090 echo '<form method="post" action="';
1091
1092 if ($_GET['edit']) {
1093 echo 'admin.php?page=bilo-payment-gateway&tab=konfig&edit=' . $_GET['edit'];
1094 }
1095
1096 echo '" autocomplete="off">
1097 <table class="form-table">
1098 <tbody>
1099 <tr>
1100 <th scope="row"><label for="bank">Bank</label></th>
1101 <td>';
1102 echo '<s';
1103 echo 'elect name="bank" id="bank">
1104 ';
1105 $eijbefe = array( 'bca', 'mandiri', 'bni', 'bri', 'bsm' );
1106 foreach ($eijbefe as $cgcdafgdae) {
1107 $cijcgidfcd = '';
1108
1109 if ($bjigefjieh['bank'] = $cgcdafgdae) {
1110 $cijcgidfcd = 'selected';
1111 }
1112
1113 echo ' <option value="';
1114 echo $cgcdafgdae;
1115 echo '" ';
1116 echo $cijcgidfcd;
1117 echo '>';
1118 echo strtoupper( $cgcdafgdae );
1119 echo '</option>
1120 ';
1121 }
1122
1123 echo ' </select>
1124 <br />
1125 ';
1126 echo '<s';
1127 echo 'mall>Pilih Bank sesuai Akun bank yang akan Anda masukkan.</small>
1128 </tr>
1129 <tr>
1130 <th scope="row"><label for="api_server">API Server</label></th>
1131 <td><input type="text" value="';
1132 echo $bjigefjieh['api_server'];
1133 echo '" size="20" id="api_server" name="api_server">
1134 <br />
1135 ';
1136 echo '<s';
1137 echo 'mall>Isikan server Billingotomatis terkait akun Bank di atas.</small></td>
1138 </tr>
1139 <tr>
1140 <th scope="row"><label for="api_id">API ID</label></th>
1141 <td><input type="text" value="';
1142 echo $bjigefjieh['api_id'];
1143 echo '" size="20" id="api_id" name="api_id">
1144 <br />
1145 ';
1146 echo '<s';
1147 echo 'mall>Isikan API ID Billingotomatis terkait akun Bank di atas.</small></td>
1148 </tr>
1149 <tr>
1150 <th scope="row"><label for="api_key">API Key</label></th>
1151 <td><input type="text" value="';
1152 echo $bjigefjieh['api_key'];
1153 echo '" size="20" id="api_key" name="api_key">
1154 <br />
1155 ';
1156 echo '<s';
1157 echo 'mall>Isikan API Key Billingotomatis terkait akun Bank di atas.</small></td>
1158 </tr>
1159 <tr>
1160 <th scope="row"><label for="bankid">Bank ID</label></th>
1161 <td><input type="text" id="bankid" name="bankid" value="';
1162 echo $bjigefjieh['bankid'];
1163 echo '" size="20" />
1164 <br />
1165 ';
1166 echo '<s';
1167 echo 'mall>Isikan sebagai ID/Pembeda akun Bank Anda, misal: BCA-1,BCA-2.</small></td>
1168 </tr>
1169 <tr>
1170 <th scope="row"><label for="bankpass">Bank Password</label></th>
1171 <td><input type="password" value="';
1172 echo $bjigefjieh['bankpass'];
1173 echo '" size="20" id="bankpass" name="bankpass" autocomplete="off"> <label><input id="bankpass_show" type="checkbox" />Lihat Password</label>
1174 <br />
1175 ';
1176 echo '<s';
1177 echo 'mall>Isi Password Internet Banking Anda.</small></td>
1178 </tr>
1179 <tr>
1180 <th scope="row" width="150"><label for="type">Type Mutasi</label></th>
1181 <td>';
1182 echo '<s';
1183 echo 'elect name="type" id="type">
1184 ';
1185 $dhaaidebgh = array( 'credit' => 'Kredit (Masuk)', 'debit' => 'Debit (Keluar)', 'complete' => 'Semua' );
1186 foreach ($dhaaidebgh as $bajeidefe => $cebgbfahej) {
1187 $cijcgidfcd = '';
1188
1189 if ($bjigefjieh['type'] = $bajeidefe) {
1190 $cijcgidfcd = 'selected';
1191 }
1192
1193 echo ' <option value="';
1194 echo $bajeidefe;
1195 echo '" ';
1196 echo $cijcgidfcd;
1197 echo '>';
1198 echo strtoupper( $cebgbfahej );
1199 echo '</option>
1200 ';
1201 }
1202
1203 echo ' </select>
1204 <br />
1205 ';
1206 echo '<s';
1207 echo 'mall>Pilih type mutasi yang ingin diambil.</small>
1208 </tr>
1209 <tr>
1210 <th scope="row"><label for="disablefrom">Disable Pengecekan Dari Jam</label></th>
1211 <td>';
1212 echo '<s';
1213 echo 'elect name="disablefrom" id="disablefrom">
1214 <option value=""></option>
1215 ';
1216 $begddafdid = 1;
1217
1218 while ($begddafdid < 25) {
1219 $cijcgidfcd = '';
1220
1221 if ($bjigefjieh['disablefrom'] = $begddafdid) {
1222 $cijcgidfcd = 'selected';
1223 }
1224
1225 echo ' <option value="';
1226 echo $begddafdid;
1227 echo '" ';
1228 echo $cijcgidfcd;
1229 echo '>';
1230 echo $begddafdid;
1231 echo '</option>
1232 ';
1233 ++$begddafdid;
1234 }
1235
1236 echo ' </select>
1237 <br />
1238 ';
1239 echo '<s';
1240 echo 'mall>Pilih jika Anda ingin menonaktifkan pengecekan mutasi mulai jam terpilih.</small></td>
1241 </tr>
1242 <tr>
1243 <th scope="row"><label for="disableuntil">Disable Pengecekan Hingga Jam</label></th>
1244 <td>';
1245 echo '<s';
1246 echo 'elect name="disableuntil" id="disableuntil">
1247 <option value=""></option>
1248 ';
1249 $begddafdid = 1;
1250
1251 while ($begddafdid < 25) {
1252 $cijcgidfcd = '';
1253
1254 if ($bjigefjieh['disableuntil'] = $begddafdid) {
1255 $cijcgidfcd = 'selected';
1256 }
1257
1258 echo ' <option value="';
1259 echo $begddafdid;
1260 echo '" ';
1261 echo $cijcgidfcd;
1262 echo '>';
1263 echo $begddafdid;
1264 echo '</option>
1265 ';
1266 ++$begddafdid;
1267 }
1268
1269 echo ' </select>
1270 <br />
1271 ';
1272 echo '<s';
1273 echo 'mall>Pilih jika Anda ingin menonaktifkan pengecekan mutasi hingga jam terpilih.</small></td>
1274 </tr>
1275 <tr>
1276 <th scope="row"><label for="start">x Hari Pengecekan</label></th>
1277 <td><input type="text" value="';
1278 echo $bjigefjieh['start'];
1279 echo '" size="4" name="start" id="start">
1280 <br />
1281 ';
1282 echo '<s';
1283 echo 'mall>Isikan berapa hari kebelakang yang ingin Anda cek, misal: 2, untuk cek 2 hari kebelakang.</small></td>
1284 </tr>
1285 <tr>
1286 <th scope="row">Nonaktifkan Pengecekan</th>
1287 <td><label>
1288 <input name="disable" type="checkbox" value="1"';
1289
1290 if ($bjigefjieh['disable']) {
1291 echo ' checked="checked"';
1292 }
1293
1294 echo '/>
1295 Centang untuk disable cron/pengecekan mutasi</label></td>
1296 </tr>
1297 </tbody>
1298 </table>
1299 <hr />
1300 <p>
1301 <input type="submit" class="button button-primary" value="';
1302 echo ($_GET['edit'] ? 'Edit Data' : 'Tambah Data');
1303 echo '" role="button" aria-disabled="false" onclick="return confirm(\'Anda sudah pastikan semua data benar?\nKesalahan tulis username/password bisa menyebabkan inet banking Anda terblokir.\');">
1304 ';
1305
1306 if ($_GET['edit']) {
1307 echo '- <a href="admin.php?page=bilo-payment-gateway&tab=konfig">Batal</a>';
1308 }
1309
1310 echo ' </p>
1311</form>
1312';
1313 echo '<s';
1314 echo 'cript>
1315jQuery("#bankpass_show").bind(\'click\', function () {
1316 if (jQuery("#bankpass_show").is(\':checked\')) {
1317 jQuery("#bankpass").attr(\'type\', \'text\');
1318 } else {
1319 jQuery("#bankpass").attr(\'type\', \'password\');
1320 }
1321})
1322</script>
1323';
1324 }
1325
1326 function bilo_payment_gateway_help() {
1327 echo '<p>Jika Anda ada pertanyaan atau ingin bantuan support, silahkan kontak http://billingotomatis.com atau kirim email ke info@billingotomatis.com.</p>
1328';
1329 }
1330
1331 function bilo_do_call($beghefhfff) {
1332 global $wpdb;
1333
1334 $cgcdafgdae = $beghefhfff['bank'];
1335 $eaicaghbjg = $beghefhfff['bankid'];
1336 _write_log( $eaicaghbjg . ( '' . ' - Melakukan Pengecekan mutasi bank ' . $cgcdafgdae . ' (' . $eaicaghbjg . ')' ) );
1337
1338 if (!$beghefhfff['api_server']) {
1339 return 'Error: server API kosong';
1340 }
1341
1342 $bjigefjieh = bilo_curl_call( 'https://' . $beghefhfff['api_server'] . '/ibank/' . $cgcdafgdae . '/', $beghefhfff );
1343 $beaiefdfcc = json_decode( $bjigefjieh, true );
1344
1345 if (is_null( $beaiefdfcc )) {
1346 _write_log( $eaicaghbjg . ' - Error: Data Kosong, ini bisa disebabkan karena server Anda tidak berhasil terkoneksi dengan server API.' );
1347 exit( );
1348 }
1349
1350
1351 if ($beaiefdfcc['status'] = 'error') {
1352 _write_log( $eaicaghbjg . ' - Error: ' . $beaiefdfcc['message'] );
1353 exit( );
1354 }
1355
1356 $beaffcaajj = false;
1357
1358 if (( 0 < count( $beaiefdfcc ) && $beaiefdfcc[0]['amount'] != '' )) {
1359 foreach ($beaiefdfcc as $cfaeehiffe) {
1360 $cgcdafgdae = strtoupper( $cfaeehiffe['bank'] );
1361 $dabhifhfhj = strtoupper( $cfaeehiffe['transid'] );
1362 $hfiiejfij = strtoupper( $cfaeehiffe['amount'] );
1363 $behhjhgcia = strtoupper( $cfaeehiffe['crawltime'] );
1364 $dhjghgcjig = strtoupper( $cfaeehiffe['balance'] );
1365 $cefiaaabjh = strtoupper( $cfaeehiffe['date'] );
1366 $cebgbfahej = strtoupper( $cfaeehiffe['type'] );
1367 $daiacafhcc = $cfaeehiffe['md5'];
1368
1369 if ($cefiaaabjh) {
1370 list( $bajjbeddja, $djdciifeff, $ejjghibcf ) = @explode( '/', $cefiaaabjh );
1371 $cefiaaabjh = $ejjghibcf . '-' . $djdciifeff . '-' . $bajjbeddja;
1372 }
1373
1374 $dabhifhfhj = str_replace( '<BR>', '
1375', $dabhifhfhj );
1376 $dabhifhfhj = preg_replace( '/[^A-Za-z0-9\s\s+\.\:\-\/%+\(\)\*\&$\#\!\@;
1377
1378]/', ' ', $dabhifhfhj );
1379 echo $eaicaghbjg . ' ++ ' . str_replace( array( '
1380', '
1381' ), array( '', '' ), $dabhifhfhj ) . ' <br>
1382';
1383 echo ' -- Nilai Transfer: ' . $hfiiejfij . ' <br>
1384';
1385
1386 if ($dhjghgcjig) {
1387 echo ' -- Posisi Saldo: ' . $dhjghgcjig . ' <br>
1388';
1389 }
1390
1391 $chgcehcggg = bilo_log_check( $cfaeehiffe );
1392
1393 if (!$chgcehcggg) {
1394 $beaffcaajj = true;
1395 $chfafdgjgh->query( 'INSERT INTO ' . $chfafdgjgh->prefix . ( '' . 'bilo_mutasi SET
1396 bank = \'' . $cgcdafgdae . '\',
1397 bankid = \'' . $eaicaghbjg . '\',
1398 transid = \'' . $dabhifhfhj . '\',
1399 type = \'' . $cebgbfahej . '\',
1400 amount = \'' . $hfiiejfij . '\',
1401 balance = \'' . $dhjghgcjig . '\',
1402 date = \'' . $cefiaaabjh . '\',
1403 crawldate = \'' ) . date( 'Y-m-d' ) . '\',
1404 crawltime = \'' . time( ) . ( '' . '\',
1405 md5 = \'' . $daiacafhcc . '\'' ) );
1406
1407 if ($chfafdgjgh->insert_id) {
1408 do_action( 'bilo_hook_mutasi_baru', $chfafdgjgh->insert_id );
1409 }
1410 }
1411else {
1412 echo ' -- Transaksi dilewati karena sudah ada (atau yang serupa) di database <br>
1413';
1414 }
1415
1416
1417 if ($cefiaaabjh) {
1418 $chfafdgjgh->update( $chfafdgjgh->prefix . 'bilo_mutasi', array( 'date' => $cefiaaabjh ), array( 'id' => $chgcehcggg ) );
1419 continue;
1420 }
1421 }
1422
1423 do_action( 'bilo_hook_post_process', array( 'bank' => $cgcdafgdae, 'bankid' => $eaicaghbjg ) );
1424 }
1425
1426 $diiiacagih = '' . 'Tidak ditemukan mutasi baru pada pengecekan Bank ' . $cgcdafgdae . ' kali ini.';
1427
1428 if ($beaffcaajj) {
1429 $diiiacagih = '' . 'Ditemukan transaksi baru masuk pada pengecekan Bank ' . $cgcdafgdae . ' kali ini.';
1430 }
1431
1432 _write_log( $eaicaghbjg . ' - ' . $diiiacagih );
1433 }
1434
1435 function bilo_log_check($cfjddjgjfj) {
1436 global $wpdb;
1437
1438 if ($cfjddjgjfj['md5']) {
1439 $bgchedibic = $chfafdgjgh->get_row( 'SELECT `id` FROM `' . $chfafdgjgh->prefix . 'bilo_mutasi` WHERE bank = \'' . $cfjddjgjfj['bank'] . '\' AND md5 = \'' . $cfjddjgjfj['md5'] . '\'' );
1440 }
1441else {
1442 if ($cfjddjgjfj['balance']) {
1443 $cegbgbhgbe[] = 'balance = \'' . $cfjddjgjfj['balance'] . '\'';
1444 }
1445
1446
1447 if (strtoupper( $cgcdafgdae ) = 'MANDIRI') {
1448 $cegbgbhgbe[] = 'date = \'' . $cfjddjgjfj['date'] . '\'';
1449 }
1450
1451
1452 if ($cegbgbhgbe) {
1453 $cegbgbhgbe = implode( ' AND ', $cegbgbhgbe );
1454 }
1455
1456 $bgchedibic = $chfafdgjgh->get_row( 'SELECT `id` FROM `' . $chfafdgjgh->prefix . 'bilo_mutasi` WHERE bank = \'' . $cfjddjgjfj['bank'] . '\' AND bankid = \'' . $cfjddjgjfj['bankid'] . '\' AND transid = \'' . $cfjddjgjfj['transid'] . '\' AND type = \'' . $cfjddjgjfj['type'] . '\' AND amount = \'' . $cfjddjgjfj['amount'] . '\'' . $cegbgbhgbe );
1457 }
1458
1459
1460 if ($bgchedibic) {
1461 return $bgchedibic->id;
1462 }
1463
1464 return false;
1465 }
1466
1467 function bilo_run_cron() {
1468 global $wpdb;
1469
1470 if (( empty( $_GET['bid'] ) && $_GET['bilo'] != 'cron' )) {
1471 return null;
1472 }
1473
1474 date_default_timezone_set( 'Asia/Jakarta' );
1475 $ecejdgbaec = bilo_curl_call( home_url( '/?echoip=1' ) );
1476
1477 if ($ecejdgbaec) {
1478 $djgghhcjig[] = $ecejdgbaec;
1479 }
1480
1481 $fibgdiaaf = get_option( 'bilo_cron_iplist' );
1482 $cdaicejbjj = @explode( '
1483', $fibgdiaaf );
1484
1485 if (is_array( $cdaicejbjj )) {
1486 foreach ($cdaicejbjj as $cedghfcjhf) {
1487 $djgghhcjig[] = trim( $cedghfcjhf );
1488 }
1489 }
1490
1491
1492 if (( ( !empty( $_SERVER['REMOTE_ADDR'] ) && !@in_array( $_SERVER['REMOTE_ADDR'], $djgghhcjig ) ) && !empty( $_SERVER['REMOTE_ADDR'] ) )) {
1493 exit( 'Maaf Anda (' . $_SERVER['REMOTE_ADDR'] . ') tidak mempunyai hak untuk mengakses halaman ini.' );
1494 }
1495
1496 $cgcdafgdae = $chfafdgjgh->get_row( 'SELECT data FROM ' . $chfafdgjgh->prefix . 'bilo_bank WHERE bid = \'' . intval( $_GET['bid'] ) . '\'' );
1497
1498 if (!$cgcdafgdae) {
1499 exit( 'Data bank tidak ditemukan...' );
1500 }
1501
1502 $cgcdafgdae = bilo_decrypt( $cgcdafgdae->data );
1503 $bjjfjdecgc = unserialize( $cgcdafgdae );
1504
1505 if ($bjjfjdecgc['disable'] = 1) {
1506 exit( 'Anda menonaktifkan pengecekan akun bank ' . $bjjfjdecgc['bankid'] . ' (' . $bjjfjdecgc['bank'] . ')' );
1507 }
1508
1509 $bjjfjdecgc['disablefrom'] = ($bjjfjdecgc['disablefrom'] = '' ? 0 - 1 : $bjjfjdecgc['disablefrom']);
1510 $bjjfjdecgc['disableuntil'] = ($bjjfjdecgc['disableuntil'] = '' ? 0 - 1 : $bjjfjdecgc['disableuntil']);
1511 $bjjfjdecgc['disableuntil'] = ($bjjfjdecgc['disableuntil'] = 24 ? 0 : $bjjfjdecgc['disableuntil']);
1512
1513 if (( ( $bjjfjdecgc['disablefrom'] != 0 - 1 && $bjjfjdecgc['disableuntil'] != 0 - 1 ) && !$_REQUEST['force'] )) {
1514 $dihhcdaeag = date( 'G' );
1515
1516 if (( $bjjfjdecgc['disablefrom'] <= $dihhcdaeag || $dihhcdaeag < $bjjfjdecgc['disableuntil'] )) {
1517 exit( 'Pengecekan tidak dilakukan dari jam: ' . $bjjfjdecgc['disablefrom'] . ' hingga ' . $bjjfjdecgc['disableuntil'] . '' );
1518 }
1519 }
1520
1521 $bhdjgchhbj = $bjjfjdecgc['start'];
1522
1523 if (intval( $bhdjgchhbj ) < 1) {
1524 $bhdjgchhbj = 2;
1525 }
1526
1527 $bhdjgchhbj = date( 'Y-m-d', strtotime( '' . '-' . $bhdjgchhbj . ' days' ) );
1528 $beghefhfff = array( 'api_server' => $bjjfjdecgc['api_server'], 'api_id' => $bjjfjdecgc['api_id'], 'api_key' => $bjjfjdecgc['api_key'], 'ibank_password' => $bjjfjdecgc['bankpass'], 'bank' => $bjjfjdecgc['bank'], 'bankid' => $bjjfjdecgc['bankid'], 'tipe_mutasi' => $bjjfjdecgc['type'], 'tanggal_mulai' => $bhdjgchhbj );
1529 bilo_do_call( $beghefhfff );
1530 exit( );
1531 }
1532
1533
1534 if (!defined( 'ABSPATH' )) {
1535 exit( );
1536 }
1537
1538 $bilo_hook_mutasi_result = array( );
1539
1540 if (!function_exists( 'bilo_plugin_activation' )) {
1541 function bilo_plugin_activation() {
1542 global $wpdb;
1543
1544 $chfafdgjgh->query( 'CREATE TABLE IF NOT EXISTS `' . $chfafdgjgh->prefix . 'bilo_mutasi` (
1545 `id` int(11) NOT NULL AUTO_INCREMENT,
1546 `bank` varchar(16) NOT NULL,
1547 `bankid` varchar(16) NOT NULL,
1548 `transid` text NOT NULL,
1549 `type` varchar(2) NOT NULL,
1550 `amount` varchar(100) NOT NULL,
1551 `balance` varchar(100) NOT NULL,
1552 `date` date NOT NULL,
1553 `crawldate` date NOT NULL,
1554 `crawltime` int(11) NOT NULL,
1555 `processstatus` int(1) NOT NULL,
1556 `comment` text NOT NULL,
1557 `md5` varchar(32) NOT NULL,
1558 PRIMARY KEY (`id`)
1559)' );
1560 $chfafdgjgh->query( 'CREATE TABLE IF NOT EXISTS `' . $chfafdgjgh->prefix . 'bilo_unik` (
1561 `unikid` int(11) NOT NULL,
1562 `jumlah` varchar(30) NOT NULL,
1563 `time` int(11) NOT NULL,
1564 `module` varchar(30) NOT NULL,
1565 `process` int(1) NOT NULL,
1566 PRIMARY KEY (`unikid`)
1567)' );
1568 $chfafdgjgh->query( 'CREATE TABLE IF NOT EXISTS `' . $chfafdgjgh->prefix . 'bilo_bank` (
1569 `bid` int(3) NOT NULL AUTO_INCREMENT,
1570 `data` text NOT NULL,
1571 PRIMARY KEY (`bid`)
1572)' );
1573 }
1574
1575 register_activation_hook( dirname( __FILE__ ) . '/billingotomatis.php', 'bilo_plugin_activation' );
1576 }
1577
1578 add_action( 'plugins_loaded', 'bilo_update_upgrade' );
1579 add_action( 'admin_menu', 'bilo_admin_menu' );
1580 $plugin = plugin_basename( dirname( __FILE__ ) . '/billingotomatis.php' );
1581 add_filter( '' . 'plugin_action_links_' . $plugin, 'bilo_settings_link' );
1582 add_action( 'admin_enqueue_scripts', 'bilo_enqueue_date_picker' );
1583 add_action( 'init', 'bilo_process_post', 100 );
1584 add_action( 'bilo_admin_menu', 'bilo_admin_menu_payment_gateway' );
1585 add_filter( 'bilo_module_list', 'bilo_module_list_payment_gateway' );
1586 add_action( 'init', 'bilo_run_cron', 100 );
1587?>