<?php require_once 'header.inc.php'; if (!isset($_SESSION['member_id'])) { echo "<meta http-equiv='refresh' content='0;url=index.php'>"; exit; } // include_once 'backend/config/autoload.inc.php'; use classes as cls; $member = new cls\member(); ?> <div class="clearfix"></div> <div class="content"> <h2 class="title">เพิ่มเครดิต</h2> <div class="table-responsive"> <form action="#" method="POST" class="form-horizontal"> <div class="col-md-12"> <div class="form-group"> <label for="" class="control-label col-md-3">เลือก Credit Packet *</label> <div class="col-md-9"> <select name="credit_pack" id="credit_pack" class="form-control" required> <option value="">---เลือก Credit Packet---</option> <option value="500">Credit Packet 500</option> <option value="1000">Credit Packet 1,000 free 50</option> <option value="2000">Credit Packet 2,000 free 100</option> <option value="5000">Credit Packet 5,000 free 300</option> <option value="10000">Credit Packet 10,000 free 700</option> <option value="50000">Credit Packet 50,000 free 4,000</option> </select> </div> </div>
<?php session_start(); include_once 'config/autoload.inc.php'; use classes as cls; $member = new cls\member(); //echo print_r($_POST); if ($member->admin_login($_POST)) { print 1; } else { print 0; }
<?php session_start(); include_once '../backend/config/autoload.inc.php'; use classes as cls; if (isset($_POST)) { $member = new cls\member(); $member->member_id = $_POST['member_id']; if ($member->update_confirm_credit($_POST)) { print 1; } else { print 0; } }
<?php // สำหรับการสมัครผ่าน facebook account session_start(); include_once 'config/autoload.inc.php'; use classes as cls; use config as cfg; $json = $_POST['obj']; $data = json_decode($json, true); $db = new cfg\database(); $member = new cls\member(); if ($member->register($data)) { if ($_SESSION['count_facebook_id']) { print 'done'; // facebook id ได้ลงทะเบียนกับระบบแล้ว } else { print 'new'; // เป็นสมาชิกใหม่ให้กรอกข้อมูลเพิ่มเติม } } else { print 'failed'; }
<?php session_start(); include_once 'config/autoload.inc.php'; use classes as cls; $member = new cls\member(); if ($member->login($_POST)) { print 1; } else { print 0; }
<?php session_start(); include_once 'config/autoload.inc.php'; use classes as cls; $member = new cls\member(); if ($_POST['status'] == "insert") { // สมัครแบบปกติ print_r($_POST); if ($member->new_register($_POST)) { print 1; } else { print 0; } } else { // สมัครผ่าน facebook account if ($member->update_member($_POST)) { print 1; } else { print 0; } }
<?php require_once 'header.inc.php'; use classes as cls; if (!isset($_SESSION['member_id']) || !isset($_GET['invoice_id'])) { echo "<meta http-equiv='refresh' content='0;url=index.php'>"; exit; } else { $member = new cls\member(); $data = array(); $data = $member->get_credit_by_invoice_id($_GET['invoice_id']); // print_r($data); if (count($data) == 0) { echo "<meta http-equiv='refresh' content='0;url=index.php'>"; exit; } /* Array ( [invoice_id] => 00002 [package] => Credit Packet 1,000 free 50 [credit] => 1000 [free] => 50 [bank_to] => [bank_transfer] => [date_transfer] => 0000-00-00 [time_transfer] => 00:00:00 [date_added] => 2016-01-15 23:02:53 [status] => pending [member_id] => 4 [manager_id] =>
<?php session_start(); include_once 'config/autoload.inc.php'; use classes as cls; $member = new cls\member(); $member->member_id = $_SESSION['member_id']; // POST // - packet // - credit // - free $data = $member->set_credit($_POST); if ($data != 0) { print $data; } else { print 0; }
<?php session_start(); if (!isset($_SESSION['member_id'])) { echo "<meta http-equiv='refresh' content='0;url=index.php'>"; exit; } require_once 'backend/config/autoload.inc.php'; if (!isset($_GET['invoice_id'])) { echo "<meta http-equiv='refresh' content='0;url=frm-add-credit.php'>"; exit; } require_once 'backend/config/autoload.inc.php'; use classes as cls; $member = new cls\member(); $invoice_id = base64_decode($_GET['invoice_id']); // Convert invoice_id from base64 to normal data $member->member_id = $_SESSION['member_id']; if ($member->cancel_credit($invoice_id)) { echo "<meta http-equiv='refresh' content='0;url=frm-add-credit.php'>"; exit; }
<?php session_start(); if (!isset($_SESSION['member_id']) || !isset($_POST['data'])) { echo "<meta http-equiv='refresh' content='0;url=index.php'>"; exit; } require_once 'config/autoload.inc.php'; use classes as cls; $order = new cls\order(); $member = new cls\member(); $product = new cls\product(); $data = json_decode($_POST['data'], 1); $rows = $data[0]['value']; $new_data = array(); foreach ($data as $key => $value) { $new_data[$value['name']] = $value['value']; } /* Array ( [txt_amount1] => 1 [hidden_rows] => 2 [slc_size1] => s [txt_detail1] => aaa [txt_address1] => bbb [txt_amount2] => 1 [slc_size2] => m [txt_detail2] => ccc [txt_address2] => ddd )
<?php require_once 'header.inc.php'; include_once '../backend/config/autoload.inc.php'; use classes as cls; $member = new cls\member(); ?> <div class="container"> <h1>รายการการชำระค่าซื้อเครดิต</h1> <div class="table-responsive"> <table class="table"> <thead> <tr> <th>#</th> <th>Invoice</th> <th>Credit Packet</th> <th>ราคา</th> <th>วันที่ทำรายการ</th> <th>วันที่แจ้งชำระ</th> <th>วัน เวลา ที่ทำการชำระ</th> <th>ดูรายละเอียด</th> </tr> </thead> <tbody> <?php $data = array(); $data = $member->get_list_credit_no_confirm(); //print_r($data); $i = 1; if (isset($data)) {
<?php session_start(); require_once 'config/autoload.inc.php'; use classes as cls; $member = new cls\member(); $data = array(); $data = json_decode($_POST['data'], 1); $new_data = array(); foreach ($data as $key => $value) { $new_data[$value['name']] = $value['value']; } $member->member_id = $_SESSION['member_id']; if ($member->transfer_credit($new_data)) { print 1; } else { print 0; } // print_r($new_data); /* Array ( [packet] => Credit Packet 500 [bank_to] => 2 [total] => 12222 [hidden-credit] => 500 [bank_transfer] => SCB [date_transfer] => 2016-12-31 [time_transfer] => 00:59 ) */