<th>ราคาเคดิต</th> <th>จำนวนซื้อ</th> <th>รวม (บาท)</th> <th>วันที่ทำรายการ</th> <th>สถานะ</th> </tr> </thead> <tbody> <?php $i = 1; $product->member_id = $_SESSION['member_id']; $data_product = array(); // echo UPLOAD; foreach ($data_detail as $key => $value) { $product->product_id = $value['product_id']; $data_product = $product->get_product_by_product_id('confirmed'); ?> <tr> <td scope=row> <?php echo $i; ?> </td> <td><img class="img-rounded" src="<?php echo UPLOAD; ?> /member_<?php echo $_SESSION['member_id']; ?> /<?php echo $data_product['product_mockup'];
<?php require_once 'header.inc.php'; if (!isset($_SESSION['member_id']) || !isset($_GET['product_id'])) { echo "<meta http-equiv='refresh' content='0;url=list-product.php'>"; exit; } // require_once 'backend/config/autoload.inc.php'; use classes as cls; $product = new cls\product(); $order = new cls\order(); $product->product_id = $_GET['product_id']; $product->member_id = $_SESSION['member_id']; $data = $product->get_product_by_product_id('all'); if ($data === false) { echo "<meta http-equiv='refresh' content='0;url=list-product.php'>"; exit; } if (count($data) == 0) { echo "<meta http-equiv='refresh' content='0;url=list-product.php'>"; exit; } $order->product_id = $_GET['product_id']; $count_order = $order->count_order_by_product_id(); ?> <div class="content"> <br /> <div class="col-md-6"> <img src="uploads/member_<?php echo $_SESSION['member_id'] . DS . $data['product_mockup']; ?>
[hidden_rows] => 2 [slc_size1] => s [txt_detail1] => aaa [txt_address1] => bbb [txt_amount2] => 1 [slc_size2] => m [txt_detail2] => ccc [txt_address2] => ddd ) */ $order->member_id = $_SESSION['member_id']; $order->product_id = $data[1]['value']; $product->member_id = $_SESSION['member_id']; $product->product_id = $data[1]['value']; $total = 0; $confirm_price = $product->get_product_by_product_id('confirmed')['confirm_price']; for ($i = 1; $i <= $rows; $i++) { /* คำนวณราคาต่อรายการ */ $price = $confirm_price * $new_data['txt_amount' . $i]; $total += $price; // ราคา total ในตาราง orders } // ถ้า credit ไม่พอ จบการทำงาน if ($total > $_SESSION['credit_balance']) { print 'out of credit'; exit; } $order->typeofpay = $_POST['typeofpay']; if ($order->set_order()) { for ($i = 1; $i <= $rows; $i++) { $order->amount = $new_data['txt_amount' . $i];