当前位置: 首页>>代码示例>>PHP>>正文


PHP validate::isOk方法代码示例

本文整理汇总了PHP中validate::isOk方法的典型用法代码示例。如果您正苦于以下问题:PHP validate::isOk方法的具体用法?PHP validate::isOk怎么用?PHP validate::isOk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在validate的用法示例。


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

示例1: printStk

function printStk($_POST)
{
    # get vars
    foreach ($_POST as $key => $value) {
        ${$key} = $value;
    }
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($fday, "num", 1, 2, "Invalid from Date day.");
    $v->isOk($fmon, "num", 1, 2, "Invalid from Date month.");
    $v->isOk($fyear, "num", 1, 4, "Invalid from Date Year.");
    $v->isOk($today, "num", 1, 2, "Invalid to Date day.");
    $v->isOk($tomon, "num", 1, 2, "Invalid to Date month.");
    $v->isOk($toyear, "num", 1, 4, "Invalid to Date Year.");
    # mix dates
    $fromdate = $fyear . "-" . $fmon . "-" . $fday;
    $todate = $toyear . "-" . $tomon . "-" . $today;
    if (!checkdate($fmon, $fday, $fyear)) {
        $v->isOk($fromdate, "num", 1, 1, "Invalid from date.");
    }
    if (!checkdate($tomon, $today, $toyear)) {
        $v->isOk($todate, "num", 1, 1, "Invalid to date.");
    }
    # display errors, if any
    if ($v->isError()) {
        $confirm = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $confirm .= "<li class=err>-" . $e["msg"] . "<br>";
        }
        return $confirm;
    }
    # connect to database
    db_connect();
    // Layout
    $report = "\n\t<h3>Non-Stock Sales Report</h3>\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n    <tr><th>Invoice no.</th><th>Date</th><th>Vat</th><th>SubTotal</th><th>Total</th></tr>";
    # Get all relevant records
    db_connect();
    $sql = "SELECT * FROM salesrec WHERE edate >= '{$fromdate}' AND edate <= '{$todate}' AND typ = 'non' AND div = '" . USER_DIV . "'";
    $recRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
    $i = 0;
    $tot = 0;
    $totvat = 0;
    $totexc = 0;
    while ($rec = pg_fetch_array($recRslt)) {
        # Calculate profit
        $tot += $rec['total'];
        $totvat += $rec['vat'];
        $excvat = sprint($rec['total'] - $rec['vat']);
        $totexc += $excvat;
        $report .= "<tr class='" . bg_class() . "'><td>{$rec['invnum']}</td><td>{$rec['edate']}</td><td>" . CUR . " {$rec['vat']}</td><td>" . CUR . " {$excvat}</td><td>" . CUR . " {$rec['total']}</td></tr>";
        $i++;
    }
    $tot = sprint($tot);
    $totvat = sprint($totvat);
    $totexc = sprint($totexc);
    $report .= "<tr class='bg-even'><td colspan=2><b>Totals</b></td><td>" . CUR . " {$totvat}</td><td>" . CUR . " {$totexc}</td><td>" . CUR . " {$tot}</td></tr>\n\t</table>\n    <p>\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=15%>\n        <tr><td><br></td></tr>\n        <tr><th>Quick Links</th></tr>\n\t\t<tr class='bg-odd'><td><a href='sales-reports.php'>Sales Reports</a></td></tr>\n\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t</table>";
    return $report;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:60,代码来源:nons-sales.php

示例2: write_details

function write_details($_POST)
{
    extract($_POST);
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($branch_ip, "url", 1, 50, "Invalid Branch IP.");
    $v->isOk($branch_company, "url", 4, 4, "Invalid Branch Company Code.");
    $v->isOk($branch_username, "string", 1, 50, "Invalid Branch Username.");
    //	$v->isOk ($branch_password, "url", 1, 50, "Invalid Branch Password.");
    //	$v->isOk ($branch_passwordconfirm, "url", 1, 50, "Invalid Branch Password.");
    //	$v->isOk ($branch_ip, "url", 1, 50, "Invalid Branch IP.");
    if ($branch_password != $branch_passwordconfirm) {
        $v->addError($branch_password, "Passwords do not match.");
    }
    # display errors, if any
    if ($v->isError()) {
        $confirmCust = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $confirmCust .= "<li class='err'>" . $e["msg"] . "</li>";
        }
        return get_details($_POST, $confirmCust);
    }
    db_connect();
    $add_sql = "\n\t\tINSERT INTO branches_data (\n\t\t\tbranch_name, branch_desc, branch_contact, branch_ip, \n\t\t\tdate_added, last_online, branch_username, branch_password, \n\t\t\tlast_login_from, branch_localuser, branch_company\n\t\t) VALUES (\n\t\t\t'{$branch_name}', '{$branch_desc}', '{$branch_contact}', '{$branch_ip}', \n\t\t\t'now', '1990-01-01', '{$branch_username}', md5('{$branch_password}'), \n\t\t\t'1990-01-01', '{$branch_localuser}', '{$branch_company}'\n\t\t)";
    $run_add = pg_exec($add_sql) or errDie("Unable to add branch information.");
    $display = "\n\t\t\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>Branch Added</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td>Branch Has Been Added.</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t";
    return $display;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:30,代码来源:branches-add.php

示例3: writeFringe

function writeFringe()
{
    global $_POST;
    extract($_POST);
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($fringeben, "string", 1, 100, "Invalid fringe benefit name.");
    $v->isOk($type, "string", 1, 15, "Invalid type.");
    # display errors, if any
    if ($v->isError()) {
        $confirmCust = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $confirmCust .= "<li class=err>" . $e["msg"];
        }
        $confirmCust .= "<p><input type=button onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        return $confirmCust;
    }
    # connect to db
    db_connect();
    # write to db
    $sql = "INSERT INTO fringebens(fringeben, type, div)\n\t\t\tVALUES ('{$fringeben}', '{$type}', '" . USER_DIV . "')";
    $rslt = db_exec($sql) or errDie("Unable to add Fringe Benefit to database (DBE).");
    if (pg_cmdtuples($rslt) < 1) {
        return "Unable to add Fringe Benefit to database (CNT).";
    }
    $OUTPUT = "<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width='50%'>\n\t<tr><th>Fringe Benefit added to system</th></tr>\n\t<tr class=datacell><td>New Fringe Benefit, {$fringeben}, has been successfully added to Cubit.</td></tr>\n\t</table>" . mkQuickLinks(ql("../admin-employee-add.php", "Add Employee"), ql("../admin-employee-view.php", "View Employees"));
    return $OUTPUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:30,代码来源:fringeben-add.php

示例4: write

function write($_POST)
{
    # get vars
    foreach ($_POST as $key => $value) {
        ${$key} = $value;
    }
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($cusnum, "num", 1, 10, "Invalid Customer Number.");
    $v->isOk($editid, "num", 1, 10, "Invalid Customer ID.");
    # display errors, if any
    if ($v->isError()) {
        $confirmCust = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $confirmCust .= "<li class=err>" . $e["msg"];
        }
        $confirmCust .= "<p><input type=button onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        return $confirmCust;
    }
    db_conn("cubit");
    $insert_sql = "DELETE FROM customer_branches WHERE cusnum = '{$cusnum}' AND div = '" . USER_DIV . "' AND id = '{$editid}'";
    $run_insert = db_exec($insert_sql);
    return "<script>\n\t\t\twindow.close ();\n\t\t</script>";
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:26,代码来源:cust-branch-del.php

示例5: view

function view()
{
    extract($_GET);
    require_lib("validate");
    $v = new validate();
    $v->isOk($empnum, "num", 1, 20, "Invalid employee number.");
    $v->isOk($id, "num", 1, 20, "Invalid payslip number.");
    if ($v->isError()) {
        $confirmCust = $v->genErrors() . "<br><input type='button' onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        return $confirmCust;
    }
    if (($emp = qryEmployee($empnum, "*")) === false) {
        $emp = qryLEmployee($empnum, "*");
    }
    if (isset($rev)) {
        $tbl = "salr";
    } else {
        $tbl = "salpaid";
    }
    $sql = "SELECT * FROM cubit.{$tbl} WHERE empnum='{$empnum}' AND id = '{$id}' AND div = '" . USER_DIV . "'";
    $rslt = db_exec($sql) or errDie("Unable to read employee salary details from Cubit.");
    if (pg_numrows($rslt) < 1) {
        return "<li>Employee payment not found.</li>";
    }
    $pay = pg_fetch_array($rslt);
    # Calculate gross salary from nettpay
    $gross = $pay['salary'] - $pay['totallow'] - $pay['comm'] + $pay['totded'] + $pay['uif'] + $pay['paye'] + $pay['loanins'];
    vsprint($gross);
    # Layout
    $slip = "\n\t<table " . TMPL_tblDflts . ">\n\t<tr>\n\t\t<td align='right'><font size='3' color='white'><b>Employee: </b></font></td>\n\t\t<td align='left'><b>{$emp['empnum']}</b></td>\n\t\t<td align='right'><font size='3' color='white'><b>Name: </b></font></td>\n\t\t<td align='left'><b>{$emp['fnames']}</b></td>\n\t\t<td align='right'><font size='3' color='white'><b>Surname: </b></font></td>\n\t\t<td align='left'><b>{$emp['sname']}</b></td>\n\t</tr>\n\t" . TBL_BR . "\n\t</table>\n\t<table " . TMPL_tblDflts . ">\n\t<tr>\n\t\t<th>Description</th>\n\t\t<th>Amount</th>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Gross Basic salary</td>\n\t\t<td align='center'>" . CUR . " {$gross}</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Commission</td>\n\t\t<td align='center'>" . CUR . " {$pay['comm']}</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Low or interest-free loan</td>\n\t\t<td align='center'>" . CUR . " {$pay['loanins']}</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Interest rate charged by company</td>\n\t\t<td align='center'>{$emp['loanint']} %</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Deductions</td>\n\t\t<td align='center'>" . CUR . " {$pay['totded']}</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>UIF</td>\n\t\t<td align='center'>" . CUR . " {$pay['uif']}</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>PAYE</td>\n\t\t<td align='center'>" . CUR . " {$pay['paye']}</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Allowances</td>\n\t\t<td align='center'>" . CUR . " {$pay['totallow']}</td>\n\t</tr>\n\t" . TBL_BR . "\n\t<tr class='" . bg_class() . "'>\n\t\t<td><h3>Nett Income</h3></td>\n\t\t<td align='center'><b>" . CUR . " {$pay['salary']}</b></td>\n\t</tr>\n\t</table>" . mkQuickLinks(ql("../admin-employee-add.php", "Add Employee"));
    return $slip;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:32,代码来源:payslip-view.php

示例6: write

function write($_POST)
{
    # get vars
    extract($_POST);
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($calloutp, "string", 1, 255, "Invalid Call Out Person name.");
    $v->isOk($telno, "string", 1, 255, "Invalid Call Out Person Contact Number.");
    # display errors, if any
    if ($v->isError()) {
        $confirmCust = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $confirmCust .= "<li class=err>" . $e["msg"];
        }
        $confirmCust .= "<p><input type=button onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        return $confirmCust;
    }
    # connect to db
    db_conn("exten");
    # write to db
    $sql = "INSERT INTO calloutpeople(calloutp,telno,div) VALUES ('{$calloutp}','{$telno}','" . USER_DIV . "')";
    $salespRslt = db_exec($sql) or errDie("Unable to add warehouse to system.", SELF);
    if (pg_cmdtuples($salespRslt) < 1) {
        return "<li class=err>Unable to add Call Out Person to database.";
    }
    $write = "\r\n\t\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width='50%'>\r\n\t\t\t<tr><th>Call Out Person added to system</th></tr>\r\n\t\t\t<tr class=datacell><td>New Call Out Person <b>{$calloutp}</b>, has been successfully added to the system.</td></tr>\r\n\t\t</table>\r\n\t\t<p>\r\n\t\t<table border=0 cellpadding='2' cellspacing='1'>\r\n\t\t\t<tr><th>Quick Links</th></tr>\r\n\t\t\t<tr class='bg-odd'><td><a href='calloutp-view.php'>View Call Out People</a></td></tr>\r\n\t\t\t<tr class='bg-odd'><td><a href='../callout-new.php'>New Call Out Document</a></td></tr>\r\n\t\t\t<tr class='bg-odd'><td><a href='../main.php'>Main Menu</a></td></tr>\r\n\t\t</table>";
    return $write;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:30,代码来源:calloutp-add.php

示例7: con_data

function con_data($_POST)
{
    # get vars
    foreach ($_POST as $key => $value) {
        ${$key} = $value;
    }
    //confirm inserted data
    # validate input
    require_lib("validate");
    $v = new validate();
    # Limit field lengths as per database settings
    $v->isOk($grpname, "string", 0, 15, "Invalid  group name.");
    $v->isOk($unit, "string", 1, 15, "Invalid group unit.");
    # display errors, if any
    if ($v->isError()) {
        $theseErrors = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $theseErrors .= "<li class=err>" . $e["msg"] . "</li>";
        }
        $theseErrors .= "<p><input type=button onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        return $theseErrors;
    }
    $con_data = "<h3>Confirm Group Details</h3>\r\n\t\t<table cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t\t<form action='" . SELF . "' method=post>\r\n\t\t<input type=hidden name=key value='write'>\r\n\t\t<input type=hidden name=grpname value='{$grpname}'>\r\n\t\t<input type=hidden name=unit value='{$unit}'>\r\n\t\t<input type=hidden name=id  value='{$id}'>\r\n\t\t\r\n\t\t<tr><th colspan=2>Group Details</th></tr>\r\n\t\t<tr class='bg-odd'><td>Group Name</td><td align=center>{$grpname}</td></tr>\r\n\t\t<tr class='bg-odd'><td>Document type</td><td align=center>{$unit}</td></tr>\r\n\t\t<tr><td colspan=2 align=left><input type=submit value='Write &raquo;'></td></tr>\r\n\t</form>\r\n\t</table>";
    return $con_data;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:26,代码来源:grpedit.php

示例8: details

function details($_GET)
{
    # get vars
    extract($_GET);
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($prd, "num", 1, 20, "Invalid Period.");
    $v->isOk($purid, "num", 1, 20, "Invalid Order number.");
    # display errors, if any
    if ($v->isError()) {
        $err = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $err .= "<li class='err'>" . $e["msg"] . "</li>";
        }
        $confirm .= "<p><input type='button' onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        return $confirm;
    }
    # Get Order info
    db_conn($prd);
    $sql = "SELECT * FROM nons_purch_int WHERE purid = '{$purid}' AND div = '" . USER_DIV . "'";
    $purRslt = db_exec($sql) or errDie("Unable to get Order information");
    if (pg_numrows($purRslt) < 1) {
        return "<i class='err'>Not Found</i>";
    }
    $pur = pg_fetch_array($purRslt);
    # Currency
    $currs = getSymbol($pur['fcid']);
    $curr = $currs['symbol'];
    $currsel = "{$currs['symbol']} - {$currs['descrip']}";
    /* --- Start Products Display --- */
    # Products layout
    $products = "\n\t\t\t\t\t<table " . TMPL_tblDflts . " width='100%'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>ITEM NUMBER</th>\n\t\t\t\t\t\t\t<th>DESCRIPTION</th>\n\t\t\t\t\t\t\t<th>QTY</th>\n\t\t\t\t\t\t\t<th colspan='2'>UNIT PRICE</th>\n\t\t\t\t\t\t\t<th colspan='2'>DUTY</th>\n\t\t\t\t\t\t\t<th>LINE TOTAL</th>\n\t\t\t\t\t\t<tr>";
    # get selected stock in this Order
    db_conn($prd);
    $sql = "SELECT * FROM nons_purint_items  WHERE purid = '{$purid}' AND div = '" . USER_DIV . "'";
    $stkdRslt = db_exec($sql);
    while ($stkd = pg_fetch_array($stkdRslt)) {
        # put in product
        $products .= "\n\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t<td>{$stkd['cod']}</td>\n\t\t\t\t\t\t\t\t<td>{$stkd['des']}</td>\n\t\t\t\t\t\t\t\t<td>{$stkd['qty']}</td>\n\t\t\t\t\t\t\t\t<td nowrap>{$pur['curr']} {$stkd['cunitcost']} or </td>\n\t\t\t\t\t\t\t\t<td nowrap>" . CUR . " {$stkd['unitcost']}</td>\n\t\t\t\t\t\t\t\t<td nowrap>{$pur['curr']} {$stkd['duty']} or </td>\n\t\t\t\t\t\t\t\t<td>{$stkd['dutyp']}%</td>\n\t\t\t\t\t\t\t\t<td nowrap>{$pur['curr']} {$stkd['amt']}</td>\n\t\t\t\t\t\t\t</tr>";
    }
    $products .= "</table>";
    /* --- End Products Display --- */
    /* --- Start Some calculations --- */
    # Get subtotal
    $SUBTOT = sprint($pur['subtot']);
    # Get Total
    $TOTAL = sprint($pur['total']);
    # Get tax
    $tax = sprint($pur['tax']);
    /* --- End Some calculations --- */
    # format date
    list($pyear, $pmon, $pday) = explode("-", $pur['pdate']);
    list($dyear, $dmon, $dday) = explode("-", $pur['ddate']);
    /* -- Final Layout -- */
    $details = "\n\t\t\t\t\t<center>\n\t\t\t\t\t<h3>International Non-Stock Order Details</h3>\n\t\t\t\t\t<table " . TMPL_tblDflts . " width='95%'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td valign='top'>\n\t\t\t\t\t\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<th colspan='2'> Supplier Details </th>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<td>Supplier</td>\n\t\t\t\t\t\t\t\t\t\t<td valign='center'>{$pur['supplier']}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<td>Supplier Address</td>\n\t\t\t\t\t\t\t\t\t\t<td valign='center'><pre>{$pur['supaddr']}</pre></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td valign='top' align='right'>\n\t\t\t\t\t\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<th colspan='2'> Non-Stock Order Details </th>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<td>Non-Stock Order No.</td>\n\t\t\t\t\t\t\t\t\t\t<td valign='center'>{$pur['purnum']}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<td>Order No.</td>\n\t\t\t\t\t\t\t\t\t\t<td valign='center'>{$pur['ordernum']}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<td>Terms</td>\n\t\t\t\t\t\t\t\t\t\t<td valign='center'>{$pur['terms']} Days</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<td>Date</td>\n\t\t\t\t\t\t\t\t\t\t<td valign='center'>{$pday}-{$pmon}-{$pyear}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<td>Foreign Currency</td>\n\t\t\t\t\t\t\t\t\t\t<td valign='center'>{$currsel} &nbsp;&nbsp;Exchange rate {$pur['curr']} {$pur['xrate']}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<td>Tax</td>\n\t\t\t\t\t\t\t\t\t\t<td valign='center'>{$pur['curr']} {$pur['tax']}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<td>Shipping Charges</td>\n\t\t\t\t\t\t\t\t\t\t<td valign='center'>{$pur['curr']} {$pur['shipchrg']}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<td>Delivery Date</td>\n\t\t\t\t\t\t\t\t\t\t<td valign='center'>{$dday}-{$dmon}-{$dyear}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td><br></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan='2'>{$products}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<th width='40%'>Quick Links</th>\n\t\t\t\t\t\t\t\t\t\t<th width='45%'>Remarks</th>\n\t\t\t\t\t\t\t\t\t\t<td rowspan='5' valign='top' width='15%'><br></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class='" . bg_class() . "'><a href='nons-purch-int-new.php'>New International Non-Stock Order</a></td>\n\t\t\t\t\t\t\t\t\t\t<td class='" . bg_class() . "' rowspan='4' align='center' valign='top'>" . nl2br($pur['remarks']) . "</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<td><a href='nons-purch-int-view.php'>View International Non-Stock Orders</a></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td align='right'>\n\t\t\t\t\t\t\t\t<table " . TMPL_tblDflts . " width='80%'>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<td>SUBTOTAL</td>\n\t\t\t\t\t\t\t\t\t\t<td align='right'>{$pur['curr']} {$pur['subtot']}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<td>Delivery Charges</td>\n\t\t\t\t\t\t\t\t\t\t<td align='right'>{$pur['curr']} {$pur['shipping']}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<td>Tax </td>\n\t\t\t\t\t\t\t\t\t\t<td align='right'>{$pur['curr']} {$pur['tax']}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t\t\t<th>GRAND TOTAL</th>\n\t\t\t\t\t\t\t\t\t\t<td align='right'>{$pur['curr']} {$pur['total']}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t\t</form>\n\t\t\t\t\t</center>";
    return $details;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:59,代码来源:nons-purch-int-det-prd.php

示例9: settings

function settings()
{
    extract($_POST);
    db_conn('cubit');
    $err = "";
    $save = false;
    if (isset($from)) {
        $save = true;
        require_lib("validate");
        $v = new validate();
        $v->isOk($sig, "string", 0, 255, "Invalid signature.");
        $v->isOk($from, "email", 1, 255, "Invalid from e-mail address.");
        $v->isOk($reply, "email", 0, 255, "Invalid reply e-mail address.");
        $v->isOk($host, "string", 1, 255, "Invalid smtp server. You need to fill in the SMTP HOST field, you can get this from your ISP.<br>\n\t\t\t\tExamples: smtp.saix.net OR smtp.mweb.co.za");
        if ($v->isError()) {
            $err = $v->genErrors();
        } else {
            $sig = remval($sig);
            $from = remval($from);
            $reply = remval($reply);
            $host = remval($host);
            $Sl = "SELECT * FROM esettings";
            $Ri = db_exec($Sl);
            if (pg_num_rows($Ri) < 1) {
                $Sl = "INSERT INTO esettings(sig,fromname,reply,smtp_host,smtp_auth,smtp_user,smtp_pass) VALUES\n\t\t\t\t('{$sig}','{$from}','{$reply}','{$host}','0','','')";
                $Ri = db_exec($Sl);
            } else {
                $Sl = "UPDATE esettings SET sig='{$sig}',fromname='{$from}',reply='{$reply}',smtp_host='{$host}'";
                $Ri = db_exec($Sl);
            }
            r2sListRestore("emailsettings");
        }
    }
    $Sl = "SELECT * FROM esettings";
    $Ri = db_exec($Sl);
    $sd = pg_fetch_array($Ri);
    if (!$save) {
        $ex = "<li class=err>Please set your email settings & then click 'Update'</li>";
    } else {
        $ex = "<li class=err>Email settings saved</li>";
    }
    if (pg_num_rows($Ri) < 1) {
        $sd['sig'] = "";
        $sd['fromname'] = "";
        $sd['reply'] = "";
        $sd['smtp_host'] = "smtp.saix.net";
        $exx = "<li class=err>These are default settings. If these settings do not work, contact your ISP for correct details.</li>";
    } else {
        $exx = "";
    }
    $sd = array_merge($sd, $_POST);
    if (!isset($retdata)) {
        $retdata = "";
    }
    $out = "<h3>Email Settings</h3>\n\t{$exx}\n\t{$ex}\n\t<br />\n\t{$err}\n\t<table " . TMPL_tblDflts . ">\n\t<form action='" . SELF . "' method=post>\n\t{$retdata}\n\t<tr>\n\t\t<th colspan='2'>Settings</th>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td align='center' colspan='2'><b>An asterisk (" . REQ . ") symbol marks required fields.</b></td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Signature</td>\n\t\t<td><input type='text' size='25' name='sig' value='{$sd['sig']}'></td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>" . REQ . " From E-mail Address</td>\n\t\t<td><input type='text' size='25' name='from' value='{$sd['fromname']}'></td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Reply To E-mail Address</td>\n\t\t<td><input type='text' size='25' name='reply' value='{$sd['reply']}'></td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>" . REQ . " SMTP Server</td>\n\t\t<td><input type='text' size='25' name='host' value='{$sd['smtp_host']}'></td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align=right><input type=submit value='Update &raquo;'></td>\n\t</tr>\n\t</form>\n\t</table>\n\t<p>\n\t<table boder=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n\t<tr><th>Quick Links</th></tr>\n\t<tr class='bg-odd'><td><a href='main.php'>Main Menu</a></td></tr>\n\t</table>";
    return $out;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:57,代码来源:email-settings.php

示例10: details

function details($_GET)
{
    # get vars
    extract($_GET);
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($purid, "num", 1, 20, "Invalid Non-Stock Order number.");
    $v->isOk($prd, "num", 1, 20, "Invalid period Database number.");
    # display errors, if any
    if ($v->isError()) {
        $err = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $err .= "<li class='err'>" . $e["msg"] . "</li>";
        }
        $confirm .= "<p><input type='button' onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        return $confirm;
    }
    # Get Non-Stock Order info
    db_conn($prd);
    $sql = "SELECT * FROM nons_purchases WHERE purid = '{$purid}' AND div = '" . USER_DIV . "'";
    $purRslt = db_exec($sql) or errDie("Unable to get Non-Stock Order information");
    if (pg_numrows($purRslt) < 1) {
        return "<i class='err'>Purchase Not Found </i>";
    }
    $pur = pg_fetch_array($purRslt);
    # Products layout
    $products = "\r\n\t\t<table " . TMPL_tblDflts . " width='100%'>\r\n\t\t\t<tr>\r\n\t\t\t\t<th>ITEM NUMBER</th>\r\n\t\t\t\t<th>DESCRIPTION</th>\r\n\t\t\t\t<th>QTY</th>\r\n\t\t\t\t<th>UNIT PRICE</th>\r\n\t\t\t\t<th>DELIVERY DATE</th>\r\n\t\t\t\t<th>AMOUNT</th>\r\n\t\t\t<tr>";
    # get selected stock in this Non-Stock Order
    db_conn($prd);
    $sql = "SELECT * FROM nons_pur_items  WHERE purid = '{$purid}' AND div = '" . USER_DIV . "'";
    $stkdRslt = db_exec($sql);
    while ($stkd = pg_fetch_array($stkdRslt)) {
        # format date
        list($dyear, $dmon, $dday) = explode("-", $stkd['ddate']);
        $products .= "\r\n\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t<td>{$stkd['cod']}</td>\r\n\t\t\t\t<td>{$stkd['des']}</td>\r\n\t\t\t\t<td>{$stkd['qty']}</td>\r\n\t\t\t\t<td nowrap>" . CUR . " {$stkd['unitcost']}</td>\r\n\t\t\t\t<td>{$dday}-{$dmon}-{$dyear}</td>\r\n\t\t\t\t<td nowrap>" . CUR . " {$stkd['amt']}</td>\r\n\t\t\t</tr>";
    }
    $products .= "</table>";
    /* --- Start Some calculations --- */
    # Get subtotal
    $SUBTOT = sprint($pur['subtot']);
    # Get Total
    $TOTAL = sprint($pur['total']);
    # Get vat
    $VAT = sprint($pur['vat']);
    /* --- End Some calculations --- */
    # Format date
    list($pyear, $pmon, $pday) = explode("-", $pur['pdate']);
    /* -- Final Layout -- */
    $details = "\r\n\t\t<center>\r\n\t\t<h3>Received Non-Stock Order Details</h3>\r\n\t\t<table " . TMPL_tblDflts . " width='95%'>\r\n\t\t\t<tr>\r\n\t\t\t\t<td valign='top'>\r\n\t\t\t\t\t<table " . TMPL_tblDflts . ">\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<th colspan='2'> Supplier Details </th>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<td>Supplier</td>\r\n\t\t\t\t\t\t\t<td valign='center'>{$pur['supplier']}</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<td>Supplier Address</td>\r\n\t\t\t\t\t\t\t<td valign='center'><pre>{$pur['supaddr']}</pre></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td valign='top' align='right'>\r\n\t\t\t\t\t<table " . TMPL_tblDflts . ">\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<th colspan='2'> Non-Stock Order Details </th>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<td>Purchase No.</td>\r\n\t\t\t\t\t\t\t<td valign='center'>{$pur['purnum']}</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<td>Supplier Inv.</td>\r\n\t\t\t\t\t\t\t<td valign='center'>{$pur['supinv']}</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<td>Delivery Ref No.</td>\r\n\t\t\t\t\t\t\t<td valign='center'>{$pur['refno']}</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<td>Terms</td>\r\n\t\t\t\t\t\t\t<td valign='center'>{$pur['terms']} Days</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<td>Date</td>\r\n\t\t\t\t\t\t\t<td valign='center'>{$pday}-{$pmon}-{$pyear}</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<td>VAT Inclusive</td>\r\n\t\t\t\t\t\t\t<td valign='center'>{$pur['vatinc']}</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<td>Delivery Charges</td>\r\n\t\t\t\t\t\t\t<td valign='center' nowrap>" . CUR . " {$pur['shipchrg']}</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr><td><br></td></tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan='2'>{$products}</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t<table " . TMPL_tblDflts . ">\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<th width='40%'>Quick Links</th>\r\n\t\t\t\t\t\t\t<th width='45%'>Remarks</th>\r\n\t\t\t\t\t\t\t<td rowspan='5' valign='top' width='15%'><br></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class='" . bg_class() . "'><a href='nons-purchase-new.php'>New Non-Stock Order</a></td>\r\n\t\t\t\t\t\t\t<td class='" . bg_class() . "' rowspan='4' align='center' valign='top'>" . nl2br($pur['remarks']) . "</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<td><a href='nons-purchase-view.php'>View Non-Stock Orders</a></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<td><a href='main.php'>Main Menu</a></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td align='right'>\r\n\t\t\t\t\t<table " . TMPL_tblDflts . " width='80%'>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<td>SUBTOTAL</td>\r\n\t\t\t\t\t\t\t<td align='right' nowrap>" . CUR . " {$pur['subtot']}</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<td>Delivery Charges</td>\r\n\t\t\t\t\t\t\t<td align='right' nowrap>" . CUR . " {$pur['shipping']}</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<td>VAT @ " . TAX_VAT . " %</td>\r\n\t\t\t\t\t\t\t<td align='right' nowrap>" . CUR . " {$pur['vat']}</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t\t<th>GRAND TOTAL</th>\r\n\t\t\t\t\t\t\t<td align='right' nowrap>" . CUR . " {$pur['total']}</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t</table>\r\n\t\t</form>\r\n\t\t</center>";
    return $details;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:53,代码来源:nons-purch-det-prd.php

示例11: printLea

function printLea($_POST)
{
    # get vars
    extract($_POST);
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($f_day, "num", 1, 2, "Invalid from Date day.");
    $v->isOk($f_month, "num", 1, 2, "Invalid from Date month.");
    $v->isOk($f_year, "num", 1, 4, "Invalid from Date Year.");
    $v->isOk($to_day, "num", 1, 2, "Invalid to Date day.");
    $v->isOk($to_month, "num", 1, 2, "Invalid to Date month.");
    $v->isOk($to_year, "num", 1, 4, "Invalid to Date Year.");
    # mix dates
    $fromdate = $f_year . "-" . $f_month . "-" . $f_day;
    $todate = $to_year . "-" . $to_month . "-" . $to_day;
    $v->isOk($fromdate, "date", 1, 1, "Invalid from date.");
    $v->isOk($todate, "date", 1, 1, "Invalid to date.");
    if ($v->isError()) {
        $err = $v->genErrors();
        return $err;
    }
    if (isset($empnum)) {
        $OUTPUT = genslip($empnum, $fromdate, $todate);
    } else {
        $OUTPUT = "";
        $qry = new dbSelect("employees", "cubit", grp(m("cols", "empnum"), m("where", "div='" . USER_DIV . "'")));
        $qry->run();
        while ($row = $qry->fetch_array()) {
            $OUTPUT .= paged(genslip($row["empnum"], $fromdate, $todate));
        }
    }
    require "../tmpl-print.php";
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:34,代码来源:irp5-data.php

示例12: banktrans

function banktrans($bankacc, $trantype, $date, $name, $details, $cheqnum, $amount, $accinv)
{
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($bankacc, "num", 1, 50, "Invalid Bank Account number.");
    $v->isOk($trantype, "string", 1, 50, "Invalid Transaction type.");
    $v->isOk($date, "date", 1, 14, "Invalid Bank Transaction date.");
    $v->isOk($name, "string", 1, 50, "Invalid Name.");
    $v->isOk($details, "string", 0, 255, "Invalid Bank Transacton details.");
    $v->isOk($cheqnum, "num", 0, 50, "Invalid Bank Transacton cheque number.");
    $v->isOk($amount, "float", 1, 20, "Invalid Bank Transacton Amount.");
    $v->isOk($accinv, "num", 1, 20, "Invalid Bank Transaction account involved.");
    # display errors, if any
    if ($v->isError()) {
        $write = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $write .= "<li class=err>" . $e["msg"];
        }
        $OUTPUT = $write . "<p><input type=button onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        require "../template.php";
    }
    # date format
    $date = explode("-", $date);
    $date = $date[2] . "-" . $date[1] . "-" . $date[0];
    # record the payment record
    db_connect();
    $sql = "INSERT INTO cashbook(bankid, trantype, date, name, descript, cheqnum, amount, banked, accinv) VALUES ('{$bankacc}', '{$trantype}', '{$date}', '{$name}', '{$details}', '{$cheqnum}', '{$amount}', 'no', '{$accinv}')";
    $Rslt = db_exec($sql) or errDie("Unable to add bank payment to database.", SELF);
}
开发者ID:kumarsivarajan,项目名称:accounting-123,代码行数:31,代码来源:bank-writetrans.php

示例13: write

function write($_POST)
{
    # get vars
    extract($_POST);
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($min, "num", 1, 9, "Invalid minimum amount.");
    $v->isOk($max, "num", 1, 9, "Invalid maximum amount.");
    $v->isOk($percentage, "float", 1, 6, "Invalid interest percentage.");
    # display errors, if any
    if ($v->isError()) {
        $confirmCust = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $confirmCust .= "<li class='err'>" . $e["msg"];
        }
        $confirmCust .= "<p><input type='button' onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        return $confirmCust;
    }
    # connect to db
    db_connect();
    # add PAYE to db
    $sql = "INSERT INTO intbracs (min, max, percentage) VALUES ('{$min}', '{$max}', '{$percentage}')";
    $pRslt = db_exec($sql) or errDie("Unable to add Interest bracket to database.", SELF);
    $write = "\r\n\t\t\t\t<table " . TMPL_tblDflts . " width='50%'>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Interest bracket added to database</th>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr class='datacell'>\r\n\t\t\t\t\t\t<td>New Interest bracket has been successfully added to Cubit.</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t\t<p>\r\n\t\t\t\t<table border=0 cellpadding='2' cellspacing='1'>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Quick Links</th>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr bgcolor='#88BBFF'>\r\n\t\t\t\t\t\t<td><a href='intbrac-view.php'>View Interest Brackets</a></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr bgcolor='#88BBFF'>\r\n\t\t\t\t\t\t<td><a href='main.php'>Main Menu</a></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tr>";
    return $write;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:28,代码来源:intbrac-add.php

示例14: details

function details($_GET)
{
    # get vars
    foreach ($_GET as $key => $value) {
        ${$key} = $value;
    }
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($invid, "num", 1, 20, "Invalid purchase number.");
    # display errors, if any
    if ($v->isError()) {
        $err = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $err .= "<li class=err>" . $e["msg"];
        }
        $confirm .= "<p><input type=button onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        return $confirm;
    }
    # Get purchase info
    db_connect();
    $sql = "SELECT * FROM nons_invoices WHERE invid = '{$invid}' AND div = '" . USER_DIV . "'";
    $invRslt = db_exec($sql) or errDie("Unable to get invoices information");
    if (pg_numrows($invRslt) < 1) {
        return "<i class=err>Not Found</i>";
    }
    $inv = pg_fetch_array($invRslt);
    $currs = getSymbol($inv['fcid']);
    /* --- Start Products Display --- */
    # Products layout
    $products = "\n\t<table cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' border=0 width=100%>\n\t<tr>\n\t\t<th width='5%'>#</th>\n\t\t<th width='65%'>DESCRIPTION</th>\n\t\t<th width='10%'>QTY</th>\n\t\t<th width='10%' colspan=2>UNIT PRICE</th>\n\t\t<th width='10%'>AMOUNT</th>\n\t<tr>";
    # get selected stock in this purchase
    db_connect();
    $sql = "SELECT * FROM nons_inv_items  WHERE invid = '{$invid}' AND div = '" . USER_DIV . "'";
    $stkdRslt = db_exec($sql);
    $i = 0;
    while ($stkd = pg_fetch_array($stkdRslt)) {
        $i++;
        # put in product
        $products .= "<tr class='bg-odd'>\n\t\t\t<td align=center>{$i}</td>\n\t\t\t<td>{$stkd['description']}</td>\n\t\t\t<td>{$stkd['qty']}</td>\n\t\t\t<td>" . CUR . " {$stkd['cunitcost']}</td>\n\t\t\t<td>{$inv['currency']} {$stkd['unitcost']}</td>\n\t\t\t<td>{$inv['currency']} {$stkd['amt']}</td>\n\t\t</tr>";
    }
    $products .= "</table>";
    /* --- Start Some calculations --- */
    # Get subtotal
    $SUBTOT = sprint($inv['subtot']);
    # Get Total
    $TOTAL = sprint($inv['total']);
    # Get vat
    $VAT = sprint($inv['vat']);
    /* --- End Some calculations --- */
    # format date
    list($syear, $smon, $sday) = explode("-", $inv['sdate']);
    if ($inv['invnum'] == 0) {
        $inv['invnum'] = $inv['invid'];
    }
    /* -- Final Layout -- */
    $details = "<center><h3>Non-Stock Invoice Details</h3>\n\t<table cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' border=0 width=95%>\n\t<tr><td valign=top>\n\t\t<table cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' border=0>\n\t\t\t<tr><th colspan=2> Customer Details </th></tr>\n\t\t\t<tr class='bg-odd'><td>Customer</td><td valign=center>{$inv['cusname']}</td></tr>\n\t\t\t<tr class='bg-even'><td>Customer Address</td><td valign=center><pre>{$inv['cusaddr']}</pre></td></tr>\n\t\t\t<tr class='bg-odd'><td>Customer Vat Number</td><td valign=center>{$inv['cusvatno']}</td></tr>\n\t\t\t<tr class='bg-even'><td>Customer Order number</td><td valign=center>{$inv['cordno']}</td></tr>\n\t\t</table>\n\t</td><td valign=top align=right>\n\t\t<table cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' border=0>\n\t\t\t<tr><th colspan=2> Non-Stock Invoice Details </th></tr>\n\t\t\t<tr class='bg-odd'><td>Non-Stock Invoice No.</td><td valign=center>{$inv['invnum']}</td></tr>\n\t\t\t<tr class='bg-even'><td>Proforma Inv No.</td><td valign=center>{$inv['docref']}</td></tr>\n\t\t\t<tr class='bg-odd'><td>Date</td><td valign=center>{$sday}-{$smon}-{$syear}</td></tr>\n\t\t\t<tr class='bg-even'><td>Foreign Currency</td><td valign=center>{$currs['symbol']} - {$currs['name']} &nbsp;&nbsp;Exchange rate " . CUR . " {$inv['xrate']}</td></tr>\n\t\t\t<tr class='bg-odd'><td>VAT Inclusive</td><td valign=center>{$inv['chrgvat']}</td></tr>\n\t\t</table>\n\t</td></tr>\n\t<tr><td><br></td></tr>\n\t<tr><td colspan=2>\n\t{$products}\n\t</td></tr>\n\t<tr><td>\n\t\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n\t\t\t<tr><th width=40%>Quick Links</th><th width=45%>Remarks</th><td rowspan=5 valign=top width=15%><br></td></tr>\n\t\t\t<tr><td class='bg-odd'><a href='nons-invoice-new.php'>New Non-Stock Invoices</a></td><td class='bg-odd' rowspan=4 align=center valign=top>" . nl2br($inv['remarks']) . "</td></tr>\n\t\t\t<tr class='bg-odd'><td><a href='nons-invoice-view.php'>View Non-Stock Invoices</a></td></tr>\n\t\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t\t</table>\n\t</td><td align=right>\n\t\t<table cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' border=0 width=80%>\n\t\t\t<tr class='bg-odd'><td>SUBTOTAL</td><td align=right>{$inv['currency']} {$inv['subtot']}</td></tr>\n\t\t\t<tr class='bg-odd'><td>VAT @ " . TAX_VAT . " %</td><td align=right>{$inv['currency']} {$inv['vat']}</td></tr>\n\t\t\t<tr class='bg-even'><th>GRAND TOTAL</th><td align=right>{$inv['currency']} {$inv['total']}</td></tr>\n\t\t</table>\n\t</td></tr>\n\t</table></form>\n\t</center>";
    return $details;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:60,代码来源:nons-intinvoice-det.php

示例15: login

function login($_POST)
{
    global $_SESSION;
    extract($_POST);
    require_lib("validate");
    $v = new validate();
    $v->isOk($code, "string", 1, 5, "Invalid company name.");
    # Display errors, if any
    if ($v->isError()) {
        $confirm = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $confirm .= "<li class='err'>" . $e["msg"] . "</li>";
        }
        return slctcomp($confirm);
    }
    # Change code to lowercase
    $code = strtolower($code);
    if (!db_check("cubit_" . $code)) {
        return slctcomp("<li class='err'>Invalid Company. Select another company or<br />\n\t\t\tclick <a href='company-new.php?key=recover'>here</a> to see if Cubit can recover from this error.</li>");
    }
    # Get Company Name
    db_conn("cubit");
    $sql = "SELECT name FROM companies WHERE code = '{$code}'";
    $compRslt = db_exec($sql) or errDie("Unable to access database.", SELF);
    if (pg_numrows($compRslt) < 1) {
        $comp['name'] = "";
    } else {
        $comp = pg_fetch_array($compRslt);
    }
    $_SESSION["code"] = $code;
    $_SESSION["comp"] = $comp['name'];
    header("Location: doc-index.php");
}
开发者ID:kumarsivarajan,项目名称:accounting-123,代码行数:34,代码来源:complogin.php


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