Skip to content

Instantly share code, notes, and snippets.

@gnh1201
Created April 13, 2019 06:07
Show Gist options
  • Save gnh1201/be943c0a348a9ef992698d1f167064e7 to your computer and use it in GitHub Desktop.
Save gnh1201/be943c0a348a9ef992698d1f167064e7 to your computer and use it in GitHub Desktop.
orderdetail.php (Example of resaonbleframework)
<?php
$id = get_requested_value("id");
$method = get_requested_value("method");
$data = array();
// get order detail
$bind = array(
"orderNum" => $id,
);
$sql = get_bind_to_sql_select("ndk_po_order", $bind, array(
"fieldnames" => array(
"orderNum",
"bDate",
"agencyNm"
),
));
$detail = exec_db_fetch($sql, $bind);
// get order items
$bind = array(
"orderNum" => $id,
);
$sql = get_bind_to_sql_select("ndk_po_cart", $bind, array(
"fieldnames" => array(
"item_cd",
"item_nm"
),
));
$items = exec_db_fetch_all($sql, $bind);
// export to data
$data['method'] = $method;
$data['detail'] = $detail;
$data['items'] = $items;
// rendering view
if($method == "ajax") {
renderView("order/view_orderdetail", $data);
} else {
renderView("templates/mincss/header", $data);
renderView("order/view_orderdetail", $data);
renderView("templates/mincss/footer", $data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment