• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getNewNum函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getNewNum函数的典型用法代码示例。如果您正苦于以下问题:PHP getNewNum函数的具体用法?PHP getNewNum怎么用?PHP getNewNum使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getNewNum函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: rtrim

if ($num_po_dtl > 0) {
    $nArrItems = rtrim($nArrItems, "|");
}
if (isset($_POST['update'])) {
    $difference = $_POST['difference'];
    $paymentterm = $_POST['payment_terms'];
    $item = explode(":", $_POST['txtItemsArr']);
    $price = explode(":", $_POST['txtPricesArr']);
    $discount = str_replace(",", "", $_POST['discount']);
    $subtotal = str_replace(",", "", $_POST['subtotal']);
    $vat = str_replace(",", "", $_POST['vat']);
    $totalamount = str_replace(",", "", $_POST['total_amount']);
    switch ($_POST['status']) {
        case 1:
            //UPDATE
            $rrrefno = getNewNum('RECEIVING_REPORT');
            $rr_mst = "INSERT INTO tbl_rr_mst(rr_reference_no,rr_date,po_reference_no,received_by,received_date,discount,sub_total,vat,total_amount)\n\t\t\t\t\t\t\t\t\tVALUES('{$rrrefno}','{$today}','{$id}','{$_SESSION['username']}','{$today}','{$discount}',\n\t\t\t\t\t\t\t\t\t\t\t'{$subtotal}',\n\t\t\t\t\t\t\t\t\t\t\t'{$vat}',\n\t\t\t\t\t\t\t\t\t\t\t'{$totalamount}')";
            $res = mysql_query($rr_mst) or die("SAVING RR " . mysql_error());
            $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'RECEIVING_REPORT' ";
            mysql_query($update_controlno);
            $cnt = 1;
            $ttlrrqty = 0;
            for ($i = 0; $i < count($item); $i++) {
                $itemcode = $item[$i];
                $itemprice = $price[$i];
                $qty = $_POST['txt' . $itemcode];
                $ttlrrqty += $qty;
                // $sql_item = "SELECT * FROM tbl_items WHERE item_code = '$itemcode'";
                $sql_item = "SELECT tbl_items.item_code,tbl_items.item_description,tbl_parts.part_onhand AS onhand,'parts' AS item_type\n\t\t\t\t\t\t\t\t\t\tFROM tbl_items\n\t\t\t\t\t\t\t\t\t\t\tJOIN tbl_parts ON tbl_parts.item_code = tbl_items.item_code\n\t\t\t\t\t\t\t\t\t\tWHERE tbl_items.item_code = '{$itemcode}'\n\n\t\t\t\t\t\t\t\t\t\tUNION\n\n\t\t\t\t\t\t\t\t\t\tSELECT tbl_items.item_code,tbl_items.item_description,tbl_material.material_onhand AS onhand,'material' AS item_type\n\t\t\t\t\t\t\t\t\t\tFROM tbl_items\n\t\t\t\t\t\t\t\t\t\t\tJOIN tbl_material ON tbl_material.item_code = tbl_items.item_code\n\t\t\t\t\t\t\t\t\t\tWHERE tbl_items.item_code = '{$itemcode}'\n\n\t\t\t\t\t\t\t\t\t\tUNION\n\n\t\t\t\t\t\t\t\t\t\tSELECT tbl_items.item_code,tbl_items.item_description,tbl_accessory.access_onhand AS onhand,'lubricants' AS item_type\n\t\t\t\t\t\t\t\t\t\tFROM tbl_items\n\t\t\t\t\t\t\t\t\t\t\tJOIN tbl_accessory ON tbl_accessory.item_code = tbl_items.item_code\n\t\t\t\t\t\t\t\t\t\tWHERE tbl_items.item_code = '{$itemcode}'";
                $qry_item = mysql_query($sql_item);
                while ($row = mysql_fetch_array($qry_item)) {
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:rr_edit.php


示例2: str_replace

        break;
    case 1:
        $payment = "payment_id = 'PAY00000003'";
        break;
    case 2:
        $payment = "payment_id = 'PAY00000004'";
        break;
    default:
        break;
}
$qrybillingdtl = "SELECT * FROM v_for_billing_detail WHERE customer_id = '{$custid}' AND {$payment}";
$resbillingdtl = $dbo->query($qrybillingdtl);
if (isset($_POST['billed']) && !empty($_POST['billed']) && $_POST['billed'] == 1) {
    $total_amnt = str_replace(",", "", $_POST['txtGrandTotal']);
    $sql = null;
    $newrefno = getNewNum('BILLING');
    $sql3 = null;
    foreach ($_REQUEST['chkworefno'] as $val) {
        $sql1 = null;
        $sql2 = null;
        $val = explode("#", $val);
        $wo = $val[0];
        $amnt = $val[1];
        $sql1 = "INSERT INTO tbl_billing(wo_refno,billing_refno,billing_date,total_amount)\n\t\t\t\t\tVALUES('{$wo}','{$newrefno}','{$today}','{$amnt}'); ";
        $sql2 = "UPDATE tbl_service_master SET trans_status = '6' WHERE wo_refno = '{$wo}'; ";
        mysql_query($sql1);
        mysql_query($sql2);
    }
    $sql3 = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'BILLING'; ";
    $res = mysql_query($sql3);
    if (!$res) {
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:billing_details.php


示例3: session_start

<?php

require_once "conf/db_connection.php";
require_once "functions.php";
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['save'])) {
    $package = $_POST['package'];
    $newnum = getNewNum('PACKAGE');
    $employee_insert = "INSERT INTO tbl_package_master (package_id,package_name,created_by,created_date) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $package . "',\n\t\t'" . $_SESSION['username'] . "',\n\t\t'" . $today . "')";
    $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'PACKAGE' ";
    $res = mysql_query($employee_insert) or die("INSERT EMPLOYEE " . mysql_error());
    if (!$res) {
        echo '<script>alert("There has been an error on saving your package profile! Please double check all the data and save.");</script>';
    } else {
        mysql_query($update_controlno);
        echo '<script>alert("Package profile successfully saved.");</script>';
    }
    echo '<script>window.location="package_list.php";</script>';
}
?>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style/cal.css" />
<link rel="stylesheet" type="text/css" href="style/forms.css" />  
</script>

</head>
<body>
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:package_add.php


示例4: session_start

require_once "functions.php";
if (!isset($_SESSION)) {
    session_start();
}
$qry_items = "SELECT * FROM v_items WHERE status = '1' ORDER BY item_description";
$result_items = $dbo->query($qry_items);
if (isset($_POST['save'])) {
    $parts = strtoupper($_POST['parts']);
    $parts_discount = str_replace(",", "", $_POST['parts_discount']);
    $part_srp = str_replace(",", "", $_POST['part_srp']);
    $part_onhand = $_POST['part_onhand'];
    $parts_lowstock = $_POST['parts_lowstock'];
    $partstatus = $_POST['partstatus'];
    $new_price_date = date("Y-m-d h:i:s");
    $item_code = $_POST['item_code'];
    $newnum = getNewNum('PARTS');
    $parts_insert = "INSERT INTO tbl_parts (parts_id, parts, parts_discount, part_srp, part_onhand, parts_lowstock, partstatus, part_created, new_price_date,item_code) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $parts . "',\n\t\t'" . $parts_discount . "',\n\t\t'" . $part_srp . "',\n\t\t'" . $part_onhand . "',\n\t\t'" . $parts_lowstock . "',\n\t\t'" . $partstatus . "',\n\t\t'" . $today . "',\n\t\t'" . $new_price_date . "',\n\t\t'" . $item_code . "')";
    $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'PARTS' ";
    $res = mysql_query($parts_insert) or die("INSERT PARTS " . mysql_error());
    if (!$res) {
        echo '<script>alert("There has been an error on saving your parts! Please double check all the data and save.");</script>';
    } else {
        mysql_query($update_controlno);
        echo '<script>alert("Parts successfully saved.");</script>';
    }
    echo '<script>window.location="parts_list.php";</script>';
}
?>
<html>
<head>
<title></title>
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:parts_add.php


示例5: session_id

$ses_id = session_id();
require_once "conf/db_connection.php";
require_once "functions.php";
if (isset($_POST['save']) && !empty($_POST['save']) && $_POST['save'] == 1) {
    $customerid = $_POST['customer_id'];
    $vehicleid = $_POST['plateno'];
    $payment = $_POST['paymentmode'];
    $remarks = $_POST['txtremarks'];
    $subtotal = trim(str_replace(",", "", $_POST['subtotal']));
    $discount = trim(str_replace(",", "", $_POST['discount']));
    $discounted_price = trim(str_replace(",", "", $_POST['discounted_price']));
    $vat = $_POST['vat'];
    $total_amount = trim(str_replace(",", "", $_POST['totalamount']));
    $qrytempestimate = "SELECT * FROM v_temp_estimate WHERE ses_id = '{$ses_id}'";
    $restempestimate = $dbo->query($qrytempestimate);
    $estimate_refno = getNewNum('ESTIMATEREFNO');
    $sql = null;
    $sql .= "INSERT INTO tbl_service_master\n\t\t\t(estimate_refno,transaction_date,customer_id,vehicle_id,payment_id,subtotal_amount,discount,discounted_price,vat,total_amount,created_by,remarks)\n\t\t\tVALUES('{$estimate_refno}','{$today}','{$customerid}','{$vehicleid}','{$payment}','{$subtotal}','{$discount}','{$discounted_price}','{$vat}','{$total_amount}','{$ses_UserID}','{$remarks}'); ";
    foreach ($restempestimate as $rowtempestimate) {
        $sql .= "INSERT INTO tbl_service_detail\n\t\t\t\t(estimate_refno,type,id,amount)\n\t\t\t\tVALUES('{$estimate_refno}','{$rowtempestimate['type']}','{$rowtempestimate['id']}','{$rowtempestimate['rate']}'); ";
    }
    $sql .= "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'ESTIMATEREFNO'; ";
    $sql .= "DELETE FROM tbl_temp_estimate WHERE ses_id = '{$ses_id}'; ";
    $qry = $dbo->query($sql);
    if (!$qry) {
        echo '<script>alert("There has been an error on saving your service! Please double check all the data and save.");</script>';
    } else {
        echo '<script>alert("Service successfully saved.");</script>';
    }
    echo '<script>window.location="estimate.php";</script>';
}
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:po_receiving.php


示例6: foreach

 $subtotal = $_POST['subtotal'];
 $discount = $_POST['discount'];
 $vat = $_POST['vat'];
 $discounted_price = $_POST['discounted_price'];
 $total_amount = $_POST['totalamount'];
 $remarks = $_POST['remarks'];
 $file = $_FILES['txtattachment']['name'];
 $qry = null;
 $getqryservice = "SELECT * FROM v_service_master WHERE estimate_refno = '{$estimaterefno}'";
 $getresservice = $dbo->query($getqryservice);
 foreach ($getresservice as $rowresservice) {
     $worefno = $rowresservice['wo_refno'];
 }
 $getqrytemppodetail = "SELECT * FROM v_temp_po_detail WHERE ses_id = '{$ses_id}'";
 $getrestemppodetail = $dbo->query($getqrytemppodetail);
 $new_refno = getNewNum('PURCHASEORDER');
 if (!empty($file)) {
     $upload_path = 'attachments/';
     $ext = substr($file, strpos($file, '.'), strlen($file) - 1);
     $attachment = $new_refno . $ext;
     move_uploaded_file($_FILES['txtattachment']['tmp_name'], $upload_path . $attachment);
 }
 $qry .= "INSERT INTO tbl_po_master(estimate_refno,wo_refno,po_refno,attachment,transaction_date,payment_id,subtotal_amount,discount,discounted_price,vat,total_amount,remarks,created_by)\n\t\t\t\tVALUES('{$estimaterefno}','{$worefno}','{$new_refno}','{$attachment}','{$today}','{$payment}','{$subtotal}','{$discount}','{$discounted_price}','12','{$total_amount}','{$remarks}','asdf'); ";
 foreach ($getrestemppodetail as $rowTEMPPODETAIL) {
     $qry .= "INSERT INTO tbl_po_detail(po_refno,type,description,amount)\n\t\t\t\t\tVALUES('{$new_refno}','{$rowTEMPPODETAIL['type']}','{$rowTEMPPODETAIL['description']}','{$rowTEMPPODETAIL['amount']}'); ";
 }
 $qry .= "UPDATE tbl_service_master SET po_refno = '{$new_refno}' WHERE estimate_refno = '{$estimaterefno}'; ";
 $qry .= "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'PURCHASEORDER'; ";
 $qry .= "DELETE FROM tbl_temp_po_detail WHERE ses_id = '{$ses_id}'; ";
 $res = $dbo->query($qry);
 $msg = "created";
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:po_receiving_add.php


示例7: v_service_master

    }
    if (!empty($estimateno)) {
        $where .= " AND estimate_refno LIKE '{$estimateno}%'";
    }
    $qryservices = new v_service_master();
    $resservices = $dbo->query($qryservices->Query($where));
}
if (isset($_POST['option']) && !empty($_POST['option']) && $_POST['option'] == 1) {
    $cntERNo = count($_POST['chkEstimateRefNo']);
    if ($cntERNo > 0) {
        switch ($_POST['opt']) {
            case 1:
                $cnt = 1;
                $qry = null;
                foreach ($_REQUEST['chkEstimateRefNo'] as $val) {
                    $new_refno = getNewNum('WORKORDER', $cnt);
                    $qry .= "UPDATE tbl_service_master SET wo_refno = '{$new_refno}', trans_status = '1' WHERE estimate_refno = '{$val}'; ";
                    $cnt++;
                }
                $qry .= "UPDATE tbl_controlno SET lastseqno = (lastseqno + {$cnt}) WHERE control_type = 'WORKORDER'; ";
                $res = $dbo->query($qry);
                $msg = "approved";
                break;
            case 2:
                $qry = null;
                foreach ($_REQUEST['chkEstimateRefNo'] as $val) {
                    $qry .= "UPDATE tbl_service_master SET trans_status = '2' WHERE estimate_refno = '{$val}'; ";
                }
                $res = $dbo->query($qry);
                $msg = "disapproved";
                break;
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:estimate_for_approval.php


示例8: session_start

<?php

require_once "conf/db_connection.php";
require_once "functions.php";
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['save'])) {
    $desc = $_POST['description'];
    $newnum = getNewNum('PAYMENT_TERM');
    $payment_term_insert = "INSERT INTO tbl_payment_term (payment_term_code,description,created_date) VALUES \n\t \t('" . $newnum . "',\n\t \t'" . $desc . "',\n\t \t'" . $today . "')";
    $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'PAYMENT_TERM' ";
    $res = mysql_query($payment_term_insert) or die("INSERT PAYMENT TERM " . mysql_error());
    if (!$res) {
        echo '<script>alert("There has been an error on saving your payment term! Please double check all the data and save.");</script>';
    } else {
        mysql_query($update_controlno);
        echo '<script>alert("Payment term successfully saved.");</script>';
    }
    echo '<script>window.location="payment_term_list.php";</script>';
}
?>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style/cal.css" />
<link rel="stylesheet" type="text/css" href="style/forms.css" />  
</head>
<body>
	<form method="post" name="payment_term_form" class="form" onsubmit="return ValidateMe();">
	<fieldset form="form_payment_term" name="form_payment_term">
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:payment_term_add.php


示例9: trim

 $serial = $_POST['serial'];
 $remarks = $_POST['txtremarks'];
 $payment = $_POST['paymentmode'];
 $subtotal = trim(str_replace(",", "", $_POST['subtotal']));
 $discount = trim(str_replace(",", "", $_POST['discount']));
 $discounted_price = trim(str_replace(",", "", $_POST['discounted_price']));
 $vat = $_POST['vat'];
 $total_amount = trim(str_replace(",", "", $_POST['totalamount']));
 if ($_POST['txtrecommendation']) {
     $recommendation = $_POST['txtrecommendation'];
 } else {
     $recommendation = null;
 }
 $qrytempestimate = "SELECT * FROM v_temp_estimate WHERE ses_id = '{$ses_id}'";
 $restempestimate = $dbo->query($qrytempestimate);
 $oe_no = getNewNum('ONLINE_ESTIMATE');
 $sql = null;
 $sql .= "INSERT INTO tbl_online_estimate_master\n\t\t\t(oe_id,transaction_date,customer,address,contactno,emailaddress,plateno,year,make,model,color,variant,engineno,chassisno,serialno,remarks,recommendation,payment_id,subtotal_amount,discount,discounted_price,vat,total_amount)\n\t\t\tVALUES('{$oe_no}','{$today}','{$customer}','{$address}','{$contactno}','{$emailaddress}','{$plateno}','{$year}','{$make}','{$model}','{$color}','{$variant}','{$engine}','{$chassis}','{$serial}','{$remarks}','{$recommendation}','{$payment}','{$subtotal}','{$discount}','{$discounted_price}','{$vat}','{$total_amount}'); ";
 foreach ($restempestimate as $rowtempestimate) {
     $sql .= "INSERT INTO tbl_online_estimate_detail\n\t\t\t\t(oe_id,type,id,amount)\n\t\t\t\tVALUES('{$oe_no}','{$rowtempestimate['type']}','{$rowtempestimate['id']}','{$rowtempestimate['rate']}'); ";
 }
 $sql .= "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'ONLINE_ESTIMATE'; ";
 $sql .= "DELETE FROM tbl_temp_estimate WHERE ses_id = '{$ses_id}'; ";
 $qry = $dbo->query($sql);
 if (!$qry) {
     echo '<script>alert("There has been an error on saving your service! Please double check all the data and save.");</script>';
 } else {
     echo '<script>alert("Service successfully saved. Please print a copy, this will serve as your reference.");</script>';
 }
 echo '<script>window.open("online_estimate_print.php?oe_id=' . $oe_no . '");</script>';
 // echo '<script>window.location="estimate_add1.php";</script>';
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:estimate_add1.php


示例10: session_start

require_once "conf/db_connection.php";
require_once "functions.php";
if (!isset($_SESSION)) {
    session_start();
}
$qry_items = "SELECT * FROM v_items WHERE status = '1' ORDER BY item_description";
$result_items = $dbo->query($qry_items);
if (isset($_POST['save'])) {
    $accessory = strtoupper($_POST['accessory']);
    $access_disc = str_replace(",", "", $_POST['access_disc']);
    $access_srp = str_replace(",", "", $_POST['access_srp']);
    $access_onhand = $_POST['access_onhand'];
    $access_low = $_POST['access_low'];
    $access_status = $_POST['access_status'];
    $item_code = $_POST['item_code'];
    $newnum = getNewNum('ACCESSORY');
    $accessory_insert = "INSERT INTO tbl_accessory (accessory_id, accessory, access_disc, access_srp, access_onhand, access_low, access_status, access_created, item_code) VALUES \n\t\t('" . $newnum . "',\n\t\t'" . $accessory . "',\n\t\t'" . $access_disc . "',\n\t\t'" . $access_srp . "',\n\t\t'" . $access_onhand . "',\n\t\t'" . $access_low . "',\n\t\t'" . $access_status . "',\n\t\t'" . $today . "',\n\t\t'" . $item_code . "')";
    $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'ACCESSORY' ";
    $res = mysql_query($accessory_insert) or die("INSERT ACCESSORY " . mysql_error());
    if (!$res) {
        echo '<script>alert("There has been an error on saving your accessory! Please double check all the data and save.");</script>';
    } else {
        mysql_query($update_controlno);
        echo '<script>alert("Accessory successfully saved.");</script>';
    }
    echo '<script>window.location="accessory_list.php";</script>';
}
?>
<html>
<head>
<title></title>
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:accessory_add.php


示例11: session_start

<?php

require_once "conf/db_connection.php";
require_once "functions.php";
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['save'])) {
    $make = strtoupper($_POST['make']);
    $make_rate = str_replace(",", "", $_POST['make_rate']);
    $newnum = getNewNum('MAKE');
    $make_insert = "INSERT INTO tbl_make (make_id, make, make_rate, make_created) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $make . "',\n\t\t'" . $make_rate . "',\n\t\t'" . $today . "')";
    $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'MAKE' ";
    $res = mysql_query($make_insert) or die("INSERT MAKE " . mysql_error());
    if (!$res) {
        echo '<script>alert("There has been an error on saving your make! Please double check all the data and save.");</script>';
    } else {
        mysql_query($update_controlno);
        echo '<script>alert("Make successfully saved.");</script>';
    }
    echo '<script>window.location="make_list.php";</script>';
}
?>
<html>
<head>
<title></title>

<link rel="stylesheet" type="text/css" href="style/cal.css" />
<link rel="stylesheet" type="text/css" href="style/forms.css" />  
</script>
开发者ID:alladinxApp,项目名称:qsms,代码行数:30,代码来源:make_add.php


示例12: session_start

<?php

require_once "conf/db_connection.php";
require_once "functions.php";
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['save'])) {
    $idle_name = strtoupper($_POST['idle_name']);
    $newnum = getNewNum('IDLE');
    $idle_insert = "INSERT INTO tbl_idle (idle_id, idle_name, idle_created) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $idle_name . "',\n\t\t'" . $today . "')";
    $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'IDLE' ";
    $res = mysql_query($idle_insert) or die("INSERT IDLE " . mysql_error());
    if (!$res) {
        echo '<script>alert("There has been an error on saving your idle! Please double check all the data and save.");</script>';
    } else {
        mysql_query($update_controlno);
        echo '<script>alert("Idle successfully saved.");</script>';
    }
    echo '<script>window.location="idle_list.php";</script>';
}
?>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style/cal.css" />
<link rel="stylesheet" type="text/css" href="style/forms.css" />  

</head>
<body>
	<form method="post" name="color_form" class="form" onSubmit="return ValidateMe();">
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:idle_add.php


示例13: session_start

<?php

require_once "conf/db_connection.php";
require_once "functions.php";
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['save'])) {
    $wocat = strtoupper($_POST['wocat']);
    $newnum = getNewNum('WOCATEGORY');
    $wocat_insert = "INSERT INTO tbl_wocat (wocat_id, wocat, wocat_created) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $wocat . "',\n\t\t'" . $today . "')";
    $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'WOCATEGORY' ";
    $res = mysql_query($wocat_insert) or die("INSERT WOCAT " . mysql_error());
    if (!$res) {
        echo '<script>alert("There has been an error on saving your work order category! Please double check all the data and save.");</script>';
    } else {
        mysql_query($update_controlno);
        echo '<script>alert("Work order category successfully saved.");</script>';
    }
    echo '<script>window.location="wocategory_list.php";</script>';
}
?>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style/cal.css" />
<link rel="stylesheet" type="text/css" href="style/forms.css" />  
</head>
<body>
	<form method="post" name="wocat_form" class="form" onSubmit="return ValidateMe();">
	<fieldset form="form_wocat" name="form_wocat">
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:wocategory_add.php


示例14: session_start

<?php

require_once "conf/db_connection.php";
require_once "functions.php";
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['save'])) {
    $color = strtoupper($_POST['color']);
    $newnum = getNewNum('COLOR');
    $color_insert = "INSERT INTO tbl_color (color_id,color,color_created) VALUES\n\t\t('{$newnum}','{$color}','{$today}') ";
    $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'COLOR' ";
    $res = mysql_query($color_insert) or die("INSERT COLOR " . mysql_error());
    if (!$res) {
        echo '<script>alert("There has been an error on saving your color! Please double check all the data and save.");</script>';
    } else {
        mysql_query($update_controlno);
        echo '<script>alert("Color successfully saved.");</script>';
    }
    echo '<script>window.location="color_list.php";</script>';
}
?>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style/cal.css" />
<link rel="stylesheet" type="text/css" href="style/forms.css" />  
</script>
</head>
<body>
	<form method="post" name="color_form" class="form" onSubmit="return ValidateMe();">
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:color_add.php


示例15: session_start

<?php

require_once "conf/db_connection.php";
require_once "functions.php";
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['save'])) {
    $desc = $_POST['description'];
    $newnum = getNewNum('ITEM_TYPE');
    $item_type_insert = "INSERT INTO tbl_item_type (item_type_code,description,created_date) VALUES \n\t \t('" . $newnum . "',\n\t \t'" . $desc . "',\n\t \t'" . $today . "')";
    $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'ITEM_TYPE' ";
    $res = mysql_query($item_type_insert) or die("INSERT ITEM TYPE " . mysql_error());
    if (!$res) {
        echo '<script>alert("There has been an error on saving your Item Type! Please double check all the data and save.");</script>';
    } else {
        mysql_query($update_controlno);
        echo '<script>alert("Item Type successfully saved.");</script>';
    }
    echo '<script>window.location="item_type_list.php";</script>';
}
?>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style/cal.css" />
<link rel="stylesheet" type="text/css" href="style/forms.css" />  
</head>
<body>
	<form method="post" name="item_type_form" class="form" onsubmit="return ValidateMe();">
	<fieldset form="form_item_type" name="form_item_type">
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:item_type_add.php


示例16: str_replace

$qry_payterms = "SELECT * FROM v_payment_term WHERE status = '1'";
$result_payterms = $dbo->query($qry_payterms);
$qry_items = "SELECT * FROM v_items WHERE status = '1'";
$result_items = $dbo->query($qry_items);
if (isset($_POST['save'])) {
    $supplier = $_POST['supplier'];
    $deliverto = $_POST['deliver_to'];
    $deliveryaddress = $_POST['delivery_address'];
    $special = $_POST['special'];
    $paymentterms = $_POST['payment_terms'];
    $discount = str_replace(",", "", $_POST['discount']);
    $subtotal = str_replace(",", "", $_POST['subtotal']);
    $vat = str_replace(",", "", $_POST['vat']);
    $totalamount = str_replace(",", "", $_POST['total_amount']);
    $item = explode("|", $_POST['arrItems']);
    $newnum = getNewNum('PURCHASE_ORDER');
    $po_mst_insert = "INSERT INTO tbl_po_mst (po_reference_no,po_date,supplier_code,deliver_to,delivery_address,payment_code,discount,sub_total,vat,total_amount,special_instruction,created_date,created_by) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $today . "',\n\t\t'" . $supplier . "',\n\t\t'" . $deliverto . "',\n\t\t'" . $deliveryaddress . "',\n\t\t'" . $paymentterms . "',\n\t\t'" . $discount . "',\n\t\t'" . $subtotal . "',\n\t\t'" . $vat . "',\n\t\t'" . $totalamount . "',\n\t\t'" . $special . "',\n\t\t'" . $today . "',\n\t\t'" . $_SESSION['username'] . "')";
    $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'PURCHASE_ORDER' ";
    $res = mysql_query($po_mst_insert) or die("INSERT PO " . mysql_error());
    if (!$res) {
        echo '<script>alert("There has been an error on saving your RO! Please double check all the data and save.");</script>';
    } else {
        $cnt = 1;
        for ($i = 0; $i < count($item); $i++) {
            $val = explode(":", $item[$i]);
            $qry_dtl = mysql_query("INSERT INTO tbl_po_dtl(po_reference_no,item_code,price,quantity,seqno) VALUES\n\t\t\t\t\t('" . $newnum . "',\n\t\t\t\t\t'" . $val[0] . "',\n\t\t\t\t\t'" . $val[4] . "',\n\t\t\t\t\t'" . $val[5] . "',\n\t\t\t\t\t'" . $cnt . "')");
            $cnt++;
        }
        mysql_query($update_controlno);
        echo '<script>alert("PO successfully saved.");</script>';
    }
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:po_add.php


示例17: session_start

<?php

require_once "conf/db_connection.php";
require_once "functions.php";
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['save'])) {
    $employee = strtoupper($_POST['employee']);
    $position = $_POST['position'];
    $image = $_FILES['emp_image']['name'];
    $newnum = getNewNum('EMPLOYEE');
    if (!empty($image)) {
        $upload_path = 'images/employees/';
        $ext = substr($image, strpos($image, '.'), strlen($image) - 1);
        if (file_exists($upload_path . $image)) {
            unlink($upload_path . $image);
        }
        $img = $newnum . $ext;
        move_uploaded_file($_FILES['emp_image']['tmp_name'], $upload_path . $img);
    } else {
        $img = 'no-image.png';
    }
    $employee_insert = "INSERT INTO tbl_employee (emp_id,employee,position, emp_image, emp_created) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $employee . "',\n\t\t'" . $position . "',\n\t\t'" . $img . "',\n\t\t'" . $today . "')";
    $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'EMPLOYEE' ";
    $res = mysql_query($employee_insert) or die("INSERT EMPLOYEE " . mysql_error());
    if (!$res) {
        echo '<script>alert("There has been an error on saving your employee profile! Please double check all the data and save.");</script>';
    } else {
        mysql_query($update_controlno);
        echo '<script>alert("Employee profile successfully saved.");</script>';
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:employee_add.php


示例18: foreach

$nArrItems = null;
foreach ($result_rr_dtl as $row) {
    $itemcode = $row['item_code'];
    $itemdesc = $row['item_description'];
    $itemuom = $row['UOM'];
    $itemuomdesc = $row['UOM_desc'];
    $itemprice = $row['price'];
    $itemqty = $row['quantity'];
    $itemrrttl = $row['rr_total'];
    $nArrItems .= $itemcode . ":" . $itemdesc . ":" . $itemuom . ":" . $itemuomdesc . ":" . $itemprice . ":" . $itemqty . ":" . $itemrrttl . "|";
}
if ($num_rr_dtl > 0) {
    $nArrItems = rtrim($nArrItems, "|");
}
if (isset($_POST['update'])) {
    $newnum = getNewNum('RR_POSTING');
    $po_mst_upd = "UPDATE tbl_po_mst \n\t\t\tSET rr_post_reference_no = '{$newnum}'\n\t\t\t\t,rr_post_date = '{$today}'\n\t\t\t\t,posted_by = '{$_SESSION['username']}'\n\t\t\tWHERE po_reference_no = '{$id}' ";
    $rr_mst_upd = "UPDATE tbl_rr_mst \n\t\t\tSET rr_post_reference_no = '{$newnum}'\n\t\t\t\t,rr_post_date = '{$today}'\n\t\t\t\t,posted_by = '{$_SESSION['username']}'\n\t\t\t\t,status = '1'\n\t\t\tWHERE po_reference_no = '{$id}' ";
    $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'RR_POSTING' ";
    $res = mysql_query($po_mst_upd) or die("UPDATE Posting " . mysql_error());
    mysql_query($rr_mst_upd);
    if (!$res) {
        echo '<script>alert("There has been an error on posting your RR! Please double check all the data and save.");</script>';
    } else {
        mysql_query($update_controlno);
        echo '<script>alert("RR successfully posted.");</script>';
    }
    echo '<script>window.location="rr_posting_edit.php?id=' . $id . '";</script>';
}
?>
<html>
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:rr_posting_edit.php


示例19: session_start

session_start();
require_once "conf/db_connection.php";
require_once "functions.php";
$worefno = $_GET['worefno'];
$getempqry = new v_service_master();
$getempres = $dbo->query($getempqry->Query("WHERE wo_refno = '{$worefno}'"));
foreach ($getempres as $rowEMP) {
    $empid = $rowEMP['emp_id'];
    $estimaterefno = $rowEMP['estimate_refno'];
    if ($rowEMP['po_refno'] != '0') {
        $po_refno = $rowEMP['po_refno'];
    } else {
        $po_refno = '0';
    }
}
$billing_refno = getNewNum('BILLING');
$check_date = dateFormat($today, "Y-m-d H:i");
$qry = null;
$qry .= "UPDATE tbl_jobclock_checkin_checkout SET check_out = '{$check_date}' WHERE wo_refno = '{$worefno}'; ";
$qry .= "UPDATE tbl_jobclock_master SET job_end = '{$today}', job_status = '2' WHERE wo_refno = '{$worefno}'; ";
$qry .= "UPDATE tbl_service_master SET trans_status = '5' WHERE wo_refno = '{$worefno}'; ";
$qry .= "UPDATE tbl_po_master SET trans_status = '2' WHERE wo_refno = '{$worefno}'; ";
$res = $dbo->query($qry);
// GET DATA OF JOBCLOCK MASTER
$qryidletimehistorymst = "SELECT * FROM v_jobclock_master WHERE wo_refno = '{$worefno}'";
$residletimehistorymst = mysql_query($qryidletimehistorymst);
while ($row = mysql_fetch_array($residletimehistorymst)) {
    $jobstatus = $row['job_status'];
    $jobstart = $row['job_start'];
    $jobend = $row['job_end'];
}
开发者ID:alladinxApp,项目名称:qsms,代码行数:31,代码来源:divJobStop.php


示例20: session_start

<?php

require_once "conf/db_connection.php";
require_once "functions.php";
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['save'])) {
    $model = strtoupper($_POST['model']);
    $variant = $_POST['model'];
    $variantdesc = $_POST['variantdesc'];
    $newnum = getNewNum('MODEL');
    $model_insert = "INSERT INTO tbl_model (model_id, model, variant, variantdesc, model_created) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $model . "',\n\t\t'" . $variant . "',\n\t\t'" . $variantdesc . "',\n\t\t'" . $today . "')";
    $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'MODEL' ";
    $res = mysql_query($model_insert) or die("INSERT MODEL " . mysql_error());
    if (!$res) {
        echo '<script>alert("There has been an error on saving your model! Please double check all the data and save.");</script>';
    } else {
        mysql_query($update_controlno);
        echo '<script>alert("Model successfully saved.");</script>';
    }
    echo '<script>window.location="model_list.php";</script>';
}
?>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style/cal.css" />
<link rel="stylesheet" type="text/css" href="style/forms.css" />  
</script>
开发者ID:alladinxApp,项目名称:qsms,代码行数:30,代码来源:model_add.php



注:本文中的getNewNum函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getNews函数代码示例发布时间:2022-05-15
下一篇:
PHP getNew函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap