예제 #1
0
<?php

if (!defined('BASEPATH')) {
    die('You are not allowed to access this page');
}
if ($_POST) {
    extract(html_entities($_POST));
    $Qry = "UPDATE `order` SET `status`='" . $status . "' WHERE id='" . $id . "'";
    $Res = mysql_query($Qry);
    if (mysql_affected_rows() > 0) {
        $msg = "";
        if ($status == 2) {
            if (sendmail_confirm($id)) {
                $msg .= "dan mengirim email konfirmasi";
            }
        } else {
            if (sendmail_cancel($id)) {
                $msg .= "dan mengirim email konfirmasi";
            }
        }
        $message = "<div class='success'>berhasil mengupdate data order. " . $msg . "</div>";
    } else {
        $message = "<div class='error'>" . mysql_error() . "</div>";
    }
    $_SESSION['msg'] = $message;
    header("Location: index.php?p=addOrder&id=" . $id);
}
$doSql = "SELECT a.*,\n\t\t(SELECT nama_lengkap FROM member WHERE id=a.member_id) `member`\n\t\tFROM `order` a WHERE a.id='" . $_GET['id'] . "'";
$doQry = mysql_query($doSql);
$r = mysql_fetch_array($doQry);
?>
예제 #2
0
<?php

if (!defined('BASEPATH')) {
    die('You are not allowed to access this page');
}
if ($_POST) {
    extract($_POST);
    $qry = "UPDATE konfirmasi \n\t\t\tSET `status`='" . $status . "' \n\t\t\tWHERE id='" . $id . "'";
    $res = mysql_query($qry);
    if (mysql_affected_rows() > 0) {
        if ($status == 2) {
            $qry2 = "UPDATE `order` SET status='2' WHERE id='" . $order_id . "'";
            $res2 = mysql_query($qry2);
            $addMsg = "";
            if (sendmail_confirm($order_id)) {
                $addMsg .= " Konfirmasi telah dikirim";
            }
        }
        $message = "<div class='success'>Pembayaran telah dikonfirmasi" . $addMsg . "..</div>";
    } else {
        $message = "<div class='error'>" . mysql_error() . "</div>";
    }
    //reload page
    $_SESSION['msg'] = $message;
    header("Location: index.php?p=confirm");
}
$doSql = "SELECT a.*, \n\t\t(SELECT b.no_order FROM `order` b WHERE b.id=a.order_id) no_order, \n\t\t(SELECT d.nama_bank FROM bank d WHERE d.id=a.bank_id) `bank`, \n\t\t(SELECT c.nama_lengkap FROM member c WHERE c.id=a.member_id) `member`\n\t\tFROM `konfirmasi` a \n\t\tWHERE a.id='" . $_GET['id'] . "'";
$doQry = mysql_query($doSql);
$r = mysql_fetch_array($doQry);
?>
<span class="page-title">Detail Konfirmasi</span>