JezK
Edit File: createconfirm.php
<?php global $wpdb; global $oketheme; $tb_confirm = $wpdb->prefix . 'konfirmasi'; if(isset($_POST['submitted'])) { // Checking ID $txn_id = $_POST['txn_id']; $txn_count = $wpdb->get_var(" SELECT COUNT(*) FROM $tb_confirm WHERE txn_id LIKE '$txn_id' "); if ($txn_count != '0') { $checkError = '<li>Terjadi pengulangan submit data, data sebelumnya telah terkirim.</li>'; $checkErrorEn = '<li>There was a repetition of submit data, previous data has been sent.</li>'; $hasError = true; } // Check Captcha if ($oketheme['captcha_act'] == 'php') { if(empty($_SESSION['captcha_code']) || strcasecmp($_SESSION['captcha_code'], $_POST['captcha_code']) != 0) { $captchaError = '<li>Kode keamanan/antispam salah atau belum diisi.</li>'; $captchaErrorEn = '<li>The security / antispam code is incorrect or not filled in.</li>'; $hasError = true; } } else if ($oketheme['captcha_act'] == 'gr') { $captcha = $_POST['g-recaptcha-response']; $ip = $_SERVER['REMOTE_ADDR']; $secretkey = $oketheme['gr_secretkey']; $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretkey."&response=".$captcha."&remoteip=".$ip); $responseKeys = json_decode($response,true); if(intval($responseKeys["success"]) !== 1) { $captchaError = '<li>Antispam belum terverifikasi.</li>'; $captchaErrorEn = '<li>Antispam unverified.</li>'; $hasError = true; } } // Jika tidak ada error if(!isset($hasError)) { // Konfirmasi $invoice = $_POST['invoice']; $tgl_transfer = $_POST['tgl_transfer']; $nominal = str_replace(".","",$_POST['jmlh_transfer']); $jmlh_transfer = number_format($nominal,0,',','.'); $rekening = explode('|', $_POST['rek_tujuan']); $rek_tujuan = $rekening[0]; $imgcode = $rekening[1]; // Customer $nama_cust = $_POST['nama_cust']; $hp_cust = $_POST['hp_cust']; $email_cust = $_POST['email_cust']; $pesan_cust = $_POST['pesan_cust']; // Lain2 $timestamp = current_time('mysql'); $etime = current_time('d M Y h:i a'); // Insert to database $sql = $wpdb->insert( $tb_confirm, array( // Customer 'nama_cust' => $nama_cust, 'hp_cust' => $hp_cust, 'email_cust' => $email_cust, 'pesan_cust' => $pesan_cust, // Confirm Detail 'invoice' => $invoice, 'txn_id' => $txn_id, 'tgl_transfer' => $tgl_transfer, 'jmlh_transfer' => $jmlh_transfer, 'rek_tujuan' => $rek_tujuan, 'imgcode' => $imgcode, 'status' => 'unverified', 'etime' => $etime, 'time' => $timestamp, ) ); if ($sql) { // kirim notifikasi pesanan include(get_template_directory().'/functions/notifikasi/pay-confirm.php'); // set data terkirim $dataSent = true; } } } ?>