<?php session_start(); include '../../connect/function_include.php'; $con = connect_db(); if ($_POST['barcode'] != '') { $result = getTable_where('products', 'p_barcode', $_POST['barcode'], $con); $r = assoc_get($result); if ($r['p_amount'] >= $_POST['amount']) { $_SESSION['salePD'][] = array('p_barcode' => $r['p_barcode'], 'p_name' => $r['p_name'], 'p_selling_price' => $r['p_selling_price'], 'amount' => $_POST['amount']); sort($_SESSION['salePD']); echo json_encode($_SESSION['salePD']); } else { echo json_encode(array('p_id' => 'fail')); } }
<?php $con = connect_db(); $result = getTable_where('admin_user', 'am_id', $_GET['id'], $con); $r = assoc_get($result); ?> <div class="panel panel-defautl"> <div class="panel-heading">เพิ่มข้อมูลพนักงาน</div> <div class="panel-body"> <form class="form-horizontal" action="index.php?module=system_staff&action=update_staff" method="POST"> <div class="form-group"> <label for="username" class="col-sm-2 control-label">Username : </label> <div class="col-sm-10"> <input type="hidden" value="<?php echo $r['am_id']; ?> " name="id"> <input type="text" class="form-control" name="u[am_username]" id="username" value="<?php echo $r['am_username']; ?> "> </div> </div> <div class="form-group"> <label for="password" class="col-sm-2 control-label">Password : </label> <div class="col-sm-10"> <input type="password" class="form-control" name="u[am_password]" id="password" value="<?php echo $r['am_password']; ?> "> </div>
<?php $con = connect_db(); $rs_pd = getTable_where('products', 'p_id', $_GET['id'], $con); $p = assoc_get($rs_pd); ?> <div class="panel panel-default"> <div class="panel-heading">เพิ่มสินค้า</div> <div class="panel-body"> <form class="form-horizontal" action="index.php?system=3&module=system_products&action=update_products" method="post"> <input type="hidden" name="id" value="<?php echo $p['p_id']; ?> "> <div class="form-group"> <label for="" class="col-sm-3 control-label">ชื่อสินค้า</label> <div class="col-sm-5"> <input type="text" name="pd[p_name]" class="form-control" value="<?php echo $p['p_name']; ?> " placeholder="ชื่อสินค้า"> </div> </div> <div class="form-group"> <?php $rs = getTable('type_product', $con); ?> <label for="" class="col-sm-3 control-label">ประเภทสินค้า</label> <div class="col-sm-5"> <select name="pd[tp_id]" class="form-control" id=""> <?php
<div class="panel-heading">แบบฟอร์มเพิ่มใบแจ้งซ่อม</div> <div class="panel-body"> <table class="table table-bordered table-data" id=""> <thead> <tr> <th class="text-center">เลขบัตรประชาชน</th> <th class="text-center">ชื่อ-นามสกุล</th> <th class="text-center">เบอร์โทรศัพท์</th> <th class="text-center">อีเมลล์</th> <th></th> </tr> </thead> <tbody> <?php $con = connect_db(); $result = getTable_where("customer_fix", "c_status", "1", $con); while ($r = assoc_get($result)) { ?> <tr> <td align="center"><?php echo $r['c_cradid']; ?> </td> <td><?php echo $r['c_flname']; ?> </td> <td><?php echo $r['c_phone']; ?> </td>
<?php $con = connect_db(); $barcode = $_POST['barcode']; $result = getTable_where('products', 'p_barcode', $barcode, $con); $r = assoc_get($result); if ($r['p_amount'] >= $_POST['amount']) { if (empty($_SESSION['sale_product'])) { $_SESSION['sale_product'][] = array('p_barcode' => $r['p_barcode'], 'p_name' => $r['p_name'], 'p_price' => $r['p_selling_price'], 'p_amount' => $_POST['amount']); $message = ''; } else { $success = 'fail'; for ($i = 0; $i < count($_SESSION['sale_product']); $i++) { if ($_SESSION['sale_product'][$i]['p_barcode'] == $barcode) { if ($r['p_amount'] > $_SESSION['sale_product'][$i]['p_amount'] + $_POST['amount']) { $_SESSION['sale_product'][$i]['p_amount'] = $_SESSION['sale_product'][$i]['p_amount'] + $_POST['amount']; } else { $message = 'สินค้าไม่พอให้บริการ'; } $success = 'success'; } } if ($success != 'success') { $_SESSION['sale_product'][] = array('p_barcode' => $r['p_barcode'], 'p_name' => $r['p_name'], 'p_price' => $r['p_selling_price'], 'p_amount' => $_POST['amount']); } } } else { $message = 'สินค้าไม่มีให้บริการ'; } header('Location: index.php?module=system_pos&action=pos_page&alert=' . urlencode($message)); exit;
<tr> <td>ชื่อร้านที่รับเครม</td> <td colspan="3"> PS Supply </td> </tr> </table> <div class="table-pd-claim"> <table class="table table-bordered" id="table-claim"> <tr> <th>รหัสบาร์โค้ด</th> <th>ชื่อสินค้า</th> <th>จำนวน</th> </tr> <?php $result_pd = getTable_where('product_claim', 'cl_id', $r['cl_id'], $con); while ($r_pd = assoc_get($result_pd)) { ?> <tr> <td><?php echo $r_pd['pc_barcode']; ?> </td> <td> <?php foreach ($data as $val) { if ($val['p_barcode'] == $r_pd['pc_barcode']) { echo $val['p_name']; } } ?>
<?php include '../../connect/function_include.php'; $con = connect_db(); $result = getTable_where('repair_tb', 'rp_id', $_POST['id'], $con); $r = assoc_get($result); echo json_encode($r);
<?php $con = connect_db(); $result_customer = getTable_where("customer_fix", "c_id", $_GET['id'], $con); $r_customer = assoc_get($result_customer); $result_repair = getTable_where("repair_tb", "c_id", $_GET['id'], $con); ?> <div class="panel panel-default"> <div class="panel-heading">รายละเอียดลูกค้า</div> <div class="panel-body"> <table class="table table-bordered"> <tr> <td style="width:10%">ชื่อ - นามสกุล</td> <td><?php echo $r_customer['c_flname']; ?> </td> </tr> <tr> <td style="width:10%">เบอร์โทรศัพท์</td> <td><?php echo $r_customer['c_phone']; ?> </td> </tr> </table> <table class="table table-bordered"> <tr> <th>ลำดับ</th> <th>รหัสใบแจ้งซ่อม</th>
<?php $con = connect_db(); $rs_sr = getTable_where('send_repair', 'sr_id', $_GET['id'], $con); $r_sr = assoc_get($rs_sr); $rs_rp = getTable_where('repair_tb', 'rp_id', $r_sr['rp_id'], $con); $r_rp = assoc_get($rs_rp); ?> <div class="panel panel-default"> <div class="panel-heading">รายละเอียดใบส่งซ่อม</div> <div class="panel-body"> <table class="table table-bordered"> <tr> <td width="20%">รหัสใบส่งซ่อม</td> <td><?php echo $r_sr['sr_id']; ?> </td> </tr> <tr> <td>ชื่อร้านที่ส่งซ่อม</td> <td><?php echo $r_sr['sr_company']; ?> </td> </tr> <tr> <td>รหัสใบแจ้งซ่อม</td> <td><?php echo $r_rp['rp_id']; ?>
<?php $con = connect_db(); $customer = $_POST['customer']; $result = get_query("SELECT count(c_id) AS cntid FROM customer_fix WHERE c_phone='{$customer['c_phone']}'", $con); $rs = assoc_get($result); if ($rs['cntid'] <= 0) { insert_table('customer_fix', $customer, $con); $result = getTable_where('customer_fix', 'c_phone', $customer['c_phone'], $con); $rsNewCustomer = assoc_get($result); $repair = $_POST['rp']; $repair['c_id'] = $rsNewCustomer['c_id']; $repair['rp_datekey'] = date("Y-m-d H:i:s"); insert_table('repair_tb', $repair, $con); } else { $result = getTable_where('customer_fix', 'c_phone', $customer['c_phone'], $con); $rsNewCustomer = assoc_get($result); $repair = $_POST['rp']; $repair['c_id'] = $rsNewCustomer['c_id']; $repair['rp_datekey'] = date("Y-m-d H:i:s"); //dieArray($repair); insert_table('repair_tb', $repair, $con); } close_db($con); ?> <script> alert('เพิ่มข้อมูลเรียบร้อยแล้ว'); window.location='index.php?module=system_repair&action=list_repair'; </script>
</td> </tr> </tbody> </table> </div> <table id="table-data" class="display" border="1" cellspacing="0" width="100%"> <thead> <tr> <th>รหัส</th> <th>วันที่ซ่อม</th> <th></th> </tr> </thead> <tbody> <?php $rs_rp = getTable_where('repair', 'c_id', $r['c_id'], $con); while ($r_rp = assoc_get($rs_rp)) { ?> <tr> <td align="center"><?php echo $r_rp['rp_id']; ?> </td> <td align="center"><?php echo formatDateThaiFromDatatime($r_rp['rp_datetime']); ?> </td> <td><a href="index.php?module=control&action=detail_repair&id=<?php echo $r_rp['rp_id']; ?> " class="btn btn-success" title="ใบแจ้งซ่อมที่ <?php
<?php $con = connect_db(); $rs = getTable_where('customer_fix', 'c_status', '1', $con); //$r = assoc_get($rs); //dieArray($r); ?> <div class="panel panel-default"> <div class="panel-heading">รายการลูกค้าระบบซ่อม <!-- <a href="?system=1&module=control&action=form_insert_customer_fix" class="btn btn-success pull-right">เพิ่มลูกค้า</a> <div class="clearfix"></div>--> </div> <div class="panel-body"> <table id="table-data" class="display table-data" border="1" cellspacing="0" width="100%"> <thead> <tr> <th class="text-center" style="width:10%">รหัส</th> <th class="text-center">ชื่อลูกค้า</th> <th class="text-center" style="width:10%">สถานะ</th> <th style="width:15%"></th> </tr> </thead> <tbody> <?php while ($r = assoc_get($rs)) { ?> <tr> <td><?php echo $r['c_id']; ?> </td>
<?php $con = connect_db(); $query_rp = getTable_where_and('repair_tb', 'rp_status=1 OR rp_status=2', $con); $query_sr = getTable_where('send_repair', 'sr_id', $_GET['id'], $con); $r_sr = assoc_get($query_sr); ?> <div class="panel panel-default"> <div class="panel-heading"><a href="index.php?module=system_repair&action=list_send_repair">ใบส่งซ่อม</a> > แก้ไข้ใบส่งซ่อม</div> <div class="panel-body"> <form action="index.php?module=system_repair&action=update_send_repair" method="POST" class="form-horizontal" id="myform"> <input type="hidden" value="<?php echo $_GET['id']; ?> " name="sr_id"> <div class="form-group"> <label for="sendrepair" class="col-sm-2 control-label">ร้านที่ส่งซ่อม</label> <div class="col-sm-5"> <input type="text" class="form-control" name="send[sr_company]" value="<?php echo $r_sr['sr_company']; ?> " placeholder="ร้านที่ส่งซ่อม"> </div> </div> <div class="form-group"> <label for="sendrepair" class="col-sm-2 control-label">เบอร์โทรศัพท์</label> <div class="col-sm-5"> <input type="text" class="form-control" name="send[sr_phone]" id="phone" value="<?php echo $r_sr['sr_phone']; ?> " placeholder="เบอร์โทรศัพท์">
<?php $repair = getTable_where('repair', 'rp_id', $_GET['id'], $con); $type_tr = getTable('type_repair', $con); $rs_r = assoc_get($repair); $customer = getTable_where('customer_fix', 'c_id', $rs_r['c_id'], $con); $rs_cus = assoc_get($customer); $arr_rp = unserialize($rs_r['rp_item']); $arr_sw = unserialize($rs_r['rp_software']); //dieArray($arr_sw); while ($rs_type = assoc_get($type_tr)) { if ($rs_type['tr_id'] == $rs_r['tr_id']) { $pd = $rs_type['tr_name']; } } ?> <div class="height-report" style="padding-top:10px"> <div class="container"> <div class="title-report col-md-12"><?php echo $name_report; ?> <span class="pull-right"> สำหรับลูกค้า</span></div> <table class="table table-bordered height-table"> <tr> <td colspan="3"> <span>พีเอส ซัพพลาย</span><span class="pull-right">เลขที่ <?php echo $rs_r['rp_id']; ?> </span><br> <span>อาคารคอมพิวเตอร์พลาซ่า ห้อง A12</span> <br> <span>312 ถ.มณีนพรัตน์ ต.ศรีภูมิ อ.เมือง จ.เชียงใหม่ 50200</span><span class="pull-right">วันที่ <?php
<?php $con = connect_db(); $rs = getTable_where('customer_fix', 'c_id', $_GET['id'], $con); $r = assoc_get($rs); ?> <div class="panel panel-default"> <div class="panel-heading">แก้ไขข้อมูลลูกค้าระบบซ่อม</div> <div class="panel-body"> <form class="form-horizontal" action="index.php?system=1&module=control&action=update_customer_fix" method="post"> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">ชื่อ-นามสกุล</label> <div class="col-sm-5"> <input type="hidden" value="<?php echo $_GET['id']; ?> " name="id"> <input type="text" class="form-control" name="fix[c_flname]" placeholder="ชื่อ-นามสกุล" value="<?php echo $r['c_flname']; ?> " required autofocus> </div> </div> <div class="form-group"> <label for="inputPassword3" class="col-sm-2 control-label">ที่อยู่</label> <div class="col-sm-5"> <textarea name="fix[c_address]" class="form-control" rows="5" placeholder="ที่อยู่" required><?php echo $r['c_address']; ?> </textarea> </div>
<?php $con = connect_db(); $rs = getTable_where('customer_quote', 'q_id', $_GET['id'], $con); $r = assoc_get($rs); ?> <div class="container"> <div class="row"> <div class="col-md-10"> <P><b>ร้าน พีเอส ซัพพลาย อาคารคอมพิวเตอร์พลาซ่า ห้อง A12</b></P> <P><b>312 ถ.มณีนพรัตน์ ต.ศรีภูมิ อ.เมือง จ.เชียงใหม่ 50200</b></P> <P><b>TEL: 094-607-1991 FAX: 053-405399</b></P> </div> <div class="col-md-2"> <table class="table table-bordered"> <tr> <th style="background: #FFFFFF; color:#000000;">Quotation<br>ใบเสนอราคา</th> </tr> </table> </div> </div> <div class="row"> <div class="col-md-12"> <table class="table table-bordered"> <tr> <td style="width:55%"> <form class="form-inline"> <div class="form-group"> <p><b>ชื่อผู้ติดต่อ </b> <span style="margin-left:99px"><?php echo $r['q_name']; ?>
<div class="clearfix"></div> </div> <div class="panel-body"> <table class="table table-bordered table-data"> <thead> <tr> <th style="width:10%; text-align:center;">#</th> <th style="width:50%; text-align:center;">ชื่อ-นามสกุล</th> <th style="width:20%; text-align:center;">ประเภทผู้ใช้งาน</th> <th style="width:10%; text-align:center;">สถานะ</th> <th style="width:10%"></th> </tr> </thead> <tbody> <?php $result = getTable_where('admin_user', 'am_status', '1', $con); $i = 1; while ($r = assoc_get($result)) { ?> <tr> <td align="center"><?php echo $i; ?> </td> <td><?php echo $r['am_flname']; ?> </td> <td align="center"><?php echo $r['am_level'] == '1' ? 'Super admin' : 'Admin'; ?>