function loginOverride($coreUserInfo) { $uid = $coreUserInfo["Result"]["Uid"]; $backEndUid = getSingleData("select Uid from BackEndUser where Uid = {$uid}"); if ($backEndUid) { printResultByMessage("", 0); } else { session_destroy(); printResultByMessage("用戶名或密碼錯誤", 100); } }
</tr> {/foreach} </tbody> </table> <table id="tableid" style="float: left;margin-top: 15px;display:block;display:inline-block;width: 100px;" class="table table-striped table-responsive table-bordered"> <tbody class="pagingTest" style="width: 100px;"> {foreach:$registerArray as $key => $value} <tr> <td>{$value['OrderId']}</td> </tr> <tr> <td> <?php $storeid = $value['StoreId']; $sql = "SELECT StoreName FROM GasStore WHERE StoreId ='{$storeid}'"; $res = getSingleData($sql); echo $res; ?> </td> </tr> {/foreach} </tbody> </table> <div style="float: left;width: 700px;height: 80%;"> <div style="width: 100%;text-align: center;font-size: 20px;"> ID: {$value['OrderId']}   规格: 50KG </div> <div id="cylinder2Id" style="min-width:700px;height:400px;"></div>
<?php include_once 'function.php'; include_once '../include/template.php'; $uid = $_GET["uid"]; $info = $_GET["info"]; $name = getSingleData("SELECT UserName FROM Customer WHERE Uid = '{$uid}'"); $email = getSingleData("SELECT Email FROM Customer WHERE Uid='{$uid}'"); $phonenum = getSingleData("SELECT PhoneNumber FROM Customer WHERE Uid='{$uid}'"); if ($info == 1) { $table = "Customer"; $tableInfo = array("Table" => $table, "Field" => array("CustomerAddress" => '客户住址', "UserName" => "客户名称", "PhoneNumber" => "电话号码", "CustomerBuy" => '客户购桶数')); $fields = ""; foreach ($tableInfo["Field"] as $key => $value) { if ($fields == "") { $fields = $key; } else { $fields = $fields . ',' . $key; } } connectDB($backStageDataBaseName); $registerArray = getData('SELECT ' . $fields . ' FROM ' . $tableInfo['Table'] . ' WHERE Uid = ' . $uid); } if ($info == 2) { $table = "GasOrder"; $tableInfo = array("Table" => $table, "Field" => array("MerchantOrderNo" => '订单ID', "OrderTime" => "下单时间", "OrderDelivery,OrderComplete" => "订单状态", "OrderAmount" => "订单金额", "OrderAddress" => "地址")); $fields = ""; foreach ($tableInfo["Field"] as $key => $value) { if ($fields == "") { $fields = $key; } else {
if ($value["Ten"] != 0) { echo " " . '10KG—' . $value["Ten"] . "<br>"; } if ($value["Four"] != 0) { echo " " . '4KG—' . $value["Four"] . "<br>"; } ?> </td> <td style="width:50px;"><?php echo $value["OrderAmount"]; ?> </td> <td style="width:50px;"> <?php $storeid = getSingleData("SELECT StoreName FROM GasStore WHERE StoreId = '{$value['StoreId']}'"); echo $storeid; ?> </td> <td> <?php if ($value["OrderComplete"] == '0') { ?> <?php if ($value["OrderDelivery"] == '0') { ?> 未开始 <?php } ?> <?php
if ($value["Ten"] != 0) { echo " " . '10KG—' . $value["Ten"] . "<br>"; } if ($value["Four"] != 0) { echo " " . '4KG—' . $value["Four"] . "<br>"; } ?> </td> <td>{$value["OrderAddress"]}</td> <td>{$value["UserName"]}</td> <td>{$value["PhoneNumber"]}</td> <td> <?php $Gid = $value["GasmanId"]; $res = getSingleData("select EmployeeName from Employee where Uid = '{$Gid}'"); echo $res; ?> </td> <td> {if: $value["OrderComplete"] == '0'} {if: $value["OrderDelivery"] == '0'} 未开始 {/if} {if: $value["OrderDelivery"] == '1'} 已经接单 {/if} {if: $value["OrderDelivery"] == '2'} 开始配送 {/if}
mysql_query ($strHeadSPB) or die("UPDATE HEAD_SP failed!! \n Please contact PT. Priatman "); $strDetSPB = "UPDATE detail_spb set is_po = 1 , fld00=$suppID , fld01= $poID, fld02 = '$rallyPO', update_datetime=now(), update_user='******' where spb_no = '$noReq' and flags=1"; mysql_query($strDetSPB) or die("UPDATE DET_SP failed!! \n Please contact PT. Priatman "); $rallyPO = trim($nextPONO) ; } }else{ //die(print "$noPO :: $noReq :: $lastNO :: $items :: $dbPO :: $flags :: $suppID :: 4else"); //die($flags); //$countFetch = getSingleData("SELECT COUNT(ID) FROM purchase_orderdetail where fld01=$supp_id and no_po = $noPO and request_no='$noReq'"); $items = $_POST['param']; if(empty($noPO)){$noPO = $_POST['pono'];} if(empty($noReq)){$noReq = $_POST['no_req'];} if(empty($suppID)){$suppID = $_POST['posupplier'];} if(empty($poID)){$poID = $_POST['idPO'];} $strSQLCheck = "select count(id) from purchase_orderdetail where no_po = '$noPO' and fld01=$suppID and no_spb='$noReq'"; $dbItems = getSingleData($strSQLCheck); if($items<>$dbItems) {$items=$dbItems;} print($items); for($i=1;$i<=$items;$i++){ $toDBID = $_POST['po_detid'.$i]; $toDBCount = 0; $toDBDetSatuan = $_POST['txtSat'.$i]; $toDBDetHarga = $_POST['txtHarga'.$i]; $toDBDetQty = $_POST['txtQty'.$i]; $toDBDetDisc = $_POST['txtDisc'.$i]; $toDBDetADisc = $_POST['txtADisc'.$i]; $toDBDetSubtotal = $_POST['txtSubtotal'.$i]; $toDBexpDate = $_POST['txtExpDate'.$i]; $toDBCount = ($toDBDetHarga * $toDBDetQty); $toDBDetADisc = (($toDBDetDisc/100)*$toDBDetHarga); $toDBCount -= $toDBDetADisc;
} else { $condition = "where {$searchKey} like '%" . addslashes($searchValue) . "%'"; } } } break; } } } if (get("filter")) { if ($condition == "") { $condition .= "where "; } $condition .= get("filter") . "='" . addslashes(get("filtervalue")) . "'"; } $rowCount = getSingleData("select count(*) as Count from {$tableName} {$condition}"); $maxPageCount = ceil($rowCount / $perPageCount); if (isset($_GET["curpage"])) { $curPage = get("curpage"); if ($curPage >= $maxPageCount) { $curPage = $maxPageCount; } else { if ($curPage <= 1) { $curPage = 1; } } } else { $curPage = 1; } if ($maxPageCount == 0) { $curPage = 0;
<?php include_once '../include/template.php'; include_once 'function.php'; connectDB($backStageDataBaseName); $uid = $_GET["uid"]; $blocked = getSingleData("SELECT Blocked FROM Employee WHERE Uid='{$uid}'"); ?> <html> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script type="text/javascript" src="js/jquery-2.1.4.min.js"></script> <script type="text/javascript" src="js/highchart/highcharts.js"></script> <script type="text/javascript" src="js/highchart/exporting.js"></script> <script src="js/bootstrap.min.js" type="text/javascript"></script> <link href="css/bootstrap.min.css" rel="stylesheet"> <style> .adddiv { float: left; width: 100%; height: 50px; font-size: 20px; margin-left: 20px; } .addinfolabel { width: 100%; float: left; margin-top: 30px; } .addinput { font-size: 15px;
$resQ = mysql_query($strSql) or die (mysql_error()); $resQ1 = mysql_fetch_array($resQ); // print ('this is reqstok ' . $reqstok .'<br /> <br />'); if (!empty($id)) { $query=mysql_query("SELECT * FROM detail_spb WHERE spb_no = '$spb_no' and barang_id='$id'") or die (mysql_error()); $rest=mysql_fetch_array($query); // print_r ($rest); if (!$rest) { print ("true ... <br />"); $queryGo = "INSERT INTO detail_spb (spb_no, barang_id, req_stock, harga, subtotal, status_approval, is_po, flags, created_datetime, created_user, update_datetime, update_user) VALUES ('$spb_no', '$id','$reqstok',$harga,$subtotal, 'PR',0,1, now(), '$userLoged', now(),'$userLoged')"; print($queryGo . '<br />'); $resQ = mysql_query($queryGo) or die ('insert detail_spb' . mysql_error()); $upd = mysql_query("update req_pembelian set no_req = '$spb_no', jml = '$reqstok', aktivasi =2 where kd_barang = '$kd' and aktivasi = 1") or die (mysql_error() . 'update req_pembelian'); $get = getSingleData("select sum(b.subtotal) from head_spb a inner join detail_spb b on a.spb_no = b.spb_no "); $goH = mysql_query("update head_spb set fld10='$get' where spb_no='$spb_no' "); } } // print (' :: ' . $id . ' :: <br />'); // print_r ($resQ1 ); } } //die(); // echo "<meta http-equiv='refresh' content='0;url=home.php?hal=content/list_spb'>"; echo "<meta http-equiv='refresh' content='0;url=home.php?hal=content/list_spb_grid'>"; ?>
<?php /** *@filesource == get LOWEST Price * "select po_no, barang_id, no_batch, supp_id, price_now, price_po, po_date, date_sub(po_date,interval 3 month) as po_t from set_harga * where po_date between date_sub(curdate(), interval 3 month) and curdate() and * barang_id =[REPLACE THIS] group by no_batch order by price_po desc LIMIT 1" * * */ $idSPB = $_POST['stream']; //die($idSPB); if ($idSPB == 0){ echo "<meta http-equiv='refresh' content='0;url=home.php?hal=content/list_spb_man' /> "; // header("Location: home.php?hal=content/list_spb_man"); }else{ $spb_no = getSingleData("select spb_no from head_spb where id = $idSPB") ; $tahun = date("y"); //$qp= mysql_query("SELECT * FROM mr WHERE LAST_INSERT_ID(param_no) ORDER BY id DESC LIMIT 1"); $qp = mysql_query("SELECT * FROM mr WHERE type='PO'"); $rp = mysql_fetch_array($qp); $lastNO = $rp['full_no']; $isUse = $rp['in_use']; $tgl = substr($lastNO,8,2); if ($tgl == $tahun) { $count = $rp['next_no']; if ((empty($isUse))||($isUse==1)){ $no_req = getNextNo('PO', 'content/list_spb'); }else{ $count = 1; $no_req = resetNo('PO','content/list_spb');
function getNo($type){ $strSQL = "SELECT full_no from mr where type = '$type'"; $ret = getSingleData($strSQL); return ($ret); }
/****************************/ /* GET POSTED VARIABLES */ /**************************/ $noPO = $_POST[no_po]; $noReq = $_POST[no_req]; $tglPO = $_POST[tgl_req]; $param = $_POST[param]; $flags = $_POST[flags]; /** * flags * 1 = insert * 2 = update * 3 = cancel */ $getDbPO = getSingleData("Select * from purchase_order where po_no ='$noPO'"); if ((!empty($getDbPO)) || ($getDbPO="")){ if ($flags == 2 ){ /* UPDATE */ } elseif($flags==3){ /* DELETE */ } }else{ if ($flags==1){ /* INSERT */ $strSQL = "insert into head_spb( po_no, tgl_po, request_no, id_supplier, is_approved, po_approved_by, btb_no, total_price, percent_discount, discount_amount, after_discount, ppn_amount, grand_total, total_items, remark, is_revisi, usr_revisi, tgl_revisi, usr_cancel, tgl_cancel,
}else{ $poRetNo = getNextNo('RPO','action/po_receive_go'); $poNoRet = getNextNo('PO', 'action/po_receive_go'); $strSQLGet = "SELECT * FROM purchase_orderdetail WHERE id=$detID"; $fetchTmp = execSQLReturn($strSQLGet); $rtrPONO = $fetchTmp['no_po']; $rtrNoReq = $fetchTmp['no_spb']; $rtrSuppID = $fetchTmp['fld01']; $rtrQty = $fetchTmp['qty_po']; $rtrHarga = $fetchTmp['harga_po']; $rtrDisc = $fetchTmp['discount']; $rtrADisc = $fetchTmp['amount_discount']; $rtrSubTot = $fetchTmp['subtotal']; $rtrBarID = $fetchTmp['barang_id']; $strGetMs = "Select kd_barang from ms_barang where id= $rtrBarID"; $rtrBarName= getSingleData($strGetMs); $remarks = "Item Retur: $rtrBarName \n Retur No: $poRetNo"; $strSQLUpd = "UPDATE purchase_order SET remark='$remarks', fld03='$poRetNo', fld04= now(), updated_datetime=now(), updated_user='******' where po_no = '$rtrONO' and request_no= '$rtrNoReq' and id_supplier= $rtrSuppID "; $strSQLGo = "UPDATE purchase_orderdetail SET f_revisi=1 where id=$detID"; $strSQlPut = "INSERT INTO purchase_order( po_no, tgl_po, request_no, id_supplier, flags, created_datetime, created_user, updated_datetime, updated_user )VALUES ( '$poNoRet', now(),'$poRetNo', $rtrSuppID, 3, now(),'$userLoged',now(),'$userLoged')";
include_once 'function.php'; $uid = $_GET["uid"]; $tabid = $_GET["tabid"]; $menuid = $_GET["menuid"]; //1为用户表 if ($tabid == 1) { $name = getSingleData("SELECT UserName FROM Customer WHERE Uid = '{$uid}'"); $email = getSingleData("SELECT Email FROM Customer WHERE Uid='{$uid}'"); $phonenum = getSingleData("SELECT PhoneNumber FROM Customer WHERE Uid='{$uid}'"); } //2为送货员表 if ($tabid == 2) { $name = getSingleData("SELECT UserName FROM Employee WHERE Uid = '{$uid}'"); $email = getSingleData("SELECT Email FROM Employee WHERE Uid='{$uid}'"); $phonenum = getSingleData("SELECT PhoneNumber FROM Employee WHERE Uid='{$uid}'"); } if ($tabid == 3) { } ?> <html> <?php include template("header.php"); ?> <script src="js/bootstrap.min.js" type="text/javascript"></script> <!-- <link href="js/bootstrap.min.js">--> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet" type="text/css" />
var timeout = setTimeout(function () { $("#submit").val("登录中..."); }, 1500); $.post("action.php", { 'Action': "Login", 'UserNameOrEmailOrPhoneNumber': username, 'Password': password, 'VCode': vcode }, function (data) { // alert(data); var jsonData = eval("(" + data + ")"); if (jsonData.ErrorCode == 0) { <?php $authority = getSingleData("SELECT Authority FROM BackEndUser WHERE Name = '{$_POST['UserNameOrEmailOrPhoneNumber']}'"); session_start(); $_SESSION["authority"] = $authority; ?> window.location.href = "index.php"; } else { switchAnother(); clearTimeout(timeout); $("#submit").val("登 录"); $("#notice").html(jsonData.ErrorMessage); $("#notice").css("color", "red"); $(".loginpanel").css("height", "200px"); } });