Ejemplo n.º 1
0
<?php

if (@$_POST['submit']) {
    //collecting userinfo
    $pId = formItemValidation($_POST['pId']);
    $cName = formItemValidation($_POST['cName']);
    $cContactNumber = formItemValidation($_POST['cContactNumber']);
    $cAddress = formItemValidation($_POST['cAddress']);
    $pQuantity = formItemValidation($_POST['pQuantity']);
    //current time now
    $nowTime = date("Y-m-d H:i:s");
    //geenrate invoice number
    $invNum = generateInvoiceId(8);
    //logged in user ID
    $loggedInUser = $_SESSION['cId'];
    $qry = mysql_query("INSERT INTO customer VALUES(\n                                        '',\n                                        '" . $invNum . "',\n                                        '" . $cName . "',\n                                        '" . $cContactNumber . "',\n                                        '" . $cAddress . "',\n                                        '" . $pId . "',\n                                        '" . $pQuantity . "',\n                                        '" . $nowTime . "'\n                                        \n                                        \n                    )") or die(mysql_error());
    if ($qry) {
        $insertSuccess = 1;
    } else {
        $insertError = 1;
    }
}
?>






       <div id="page-wrapper">
            <div class="row">
Ejemplo n.º 2
0
<?php

include '../autoloadfunctions.php';
echo generateInvoiceId(8);