本文整理汇总了PHP中isDisabled函数的典型用法代码示例。如果您正苦于以下问题:PHP isDisabled函数的具体用法?PHP isDisabled怎么用?PHP isDisabled使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isDisabled函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: slctacc
function slctacc($_POST)
{
# Get vars
extract($_POST);
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($lname, "string", 1, 255, "Invalid Ledger Name.");
$v->isOk($dtaccid, "num", 1, 50, "Invalid Account to be Debited.");
$v->isOk($ctaccid, "num", 1, 50, "Invalid Account to be Credited.");
$v->isOk($chrgvat, "string", 1, 4, "Invalid charge vat option.");
$v->isOk($numtran, "num", 1, 20, "Invalid Number on entries.");
$v->isOk($dateopt, "string", 1, 10, "Invalid date entry option.");
$v->isOk($desopt, "string", 1, 5, "Invalid Description option.");
if ($desopt == 'once') {
$v->isOk($descript, "string", 1, 255, "Invalid Description.");
} else {
$v->isOk($descript, "string", 0, 255, "Invalid Description.");
}
$v->isOk($refopt, "string", 1, 5, "Invalid Reference number option.");
if ($refopt == 'once') {
$v->isOk($refnum, "string", 1, 255, "Invalid Reference number.");
} else {
$v->isOk($refnum, "string", 0, 255, "Invalid Reference number.");
}
# display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class='err'>" . $e["msg"] . "</li>";
}
return error($_POST, $confirm);
#$confirm .= "<p><input type=button onClick='JavaScript:history.back();' value='« Correct submission'>";
#return $confirm;
}
# uppercase first letter of name
$lname = ucfirst($lname);
# Account numbers
$dtaccRs = get("core", "*", "accounts", "accid", $dtaccid);
$dtacc = pg_fetch_array($dtaccRs);
$ctaccRs = get("core", "*", "accounts", "accid", $ctaccid);
$ctacc = pg_fetch_array($ctaccRs);
db_conn("core");
$vatacc = "<select name='vataccid'>";
$sql = "SELECT * FROM accounts WHERE div = '" . USER_DIV . "' ORDER BY accname ASC";
$accRslt = db_exec($sql);
if (pg_numrows($accRslt) < 1) {
return "<li>There are No accounts in Cubit.</li>";
}
while ($acc = pg_fetch_array($accRslt)) {
# Check Disable
if (isDisabled($acc['accid'])) {
continue;
}
$vatacc .= "<option value='{$acc['accid']}'>{$acc['topacc']}/{$acc['accnum']} - {$acc['accname']}</option>";
}
$vatacc .= "</select>";
// Details
$slctacc = "\r\n\t\t<center>\r\n\t\t<h3> New High Speed Input Ledger </h3>\r\n\t\t<h2>Select Vat Accounts</h2>\r\n\t\t<form action='" . SELF . "' method='POST' name='form'>\r\n\t\t\t<input type='hidden' name='key' value='details'>\r\n\t\t\t<input type='hidden' name='lname' value='{$lname}'>\r\n\t\t\t<input type='hidden' name='dtaccid' value='{$dtaccid}'>\r\n\t\t\t<input type='hidden' name='ctaccid' value='{$ctaccid}'>\r\n\t\t\t<input type='hidden' name='chrgvat' value='{$chrgvat}'>\r\n\t\t\t<input type='hidden' name='numtran' value='{$numtran}'>\r\n\t\t\t<input type='hidden' name='dateopt' value='{$dateopt}'>\r\n\t\t\t<input type='hidden' name='descript' value='{$descript}'>\r\n\t\t\t<input type='hidden' name='desopt' value='{$desopt}'>\r\n\t\t\t<input type='hidden' name='refnum' value='{$refnum}'>\r\n\t\t\t<input type='hidden' name='refopt' value='{$refopt}'>\r\n\t\t<table " . TMPL_tblDflts . " align='center'>\r\n\t\t\t<tr>\r\n\t\t\t\t<th>Option</th>\r\n\t\t\t\t<th>Value</th>\r\n\t\t\t</tr>\r\n\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t<td>Ledger Name</td>\r\n\t\t\t\t<td>{$lname}</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t<td valign='top'>Vat Deductable Account</td>\r\n\t\t\t\t<td><input type='radio' name='vatdedacc' value='{$dtaccid}' checked='yes'>{$dtacc['topacc']}/{$dtacc['accnum']} - {$dtacc['accname']}<br><input type='radio' name='vatdedacc' value='{$ctaccid}'>{$ctacc['topacc']}/{$ctacc['accnum']} - {$ctacc['accname']}</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t<td>Vat Account</td>\r\n\t\t\t\t<td>{$vatacc}</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t<td>Vat Inclusive </td>\r\n\t\t\t\t<td><input type='radio' size='20' name='vatinc' value='yes' checked='yes'>Yes(Amount Includes Vat) <input type='radio' size='20' name='vatinc' value='no'>No(Add Vat to Amount)</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 align='right'><input type='button' value='« Back' onClick='javascript:history.back()'></td>\r\n\t\t\t\t<td align='right'><input type='submit' value='Continue »'></td>\r\n\t\t\t</tr>\r\n\t\t</table>\r\n\t\t</form>\r\n\t\t<p>\r\n\t\t<table border=0 cellpadding='2' cellspacing='1' width=15%>\r\n\t\t\t<tr>\r\n\t\t\t\t<th>Quick Links</th>\r\n\t\t\t</tr>\r\n\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t<td align='center'><a href='ledger-view.php'>View High Speed Input Ledgers</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t<td align='center'><a href='../main.php'>Main Menu</td>\r\n\t\t\t</tr>\r\n\t\t</table>";
return $slctacc;
}
示例2: add
function add()
{
extract($_REQUEST);
$qry = new dbSelect("batch_cashbook", "cubit", grp(m("where", wgrp(m("cashid", "{$id}")))));
$qry->run();
if ($qry->num_rows() <= 0) {
invalid_use("Invalid batch cashbook entry.");
}
$bcb = $qry->fetch_array();
if ($bcb["chrgvat"] == "exc") {
$bcb["amount"] -= $bcb["vat"];
}
extract($bcb, EXTR_SKIP);
core_connect();
$accs = qryAccounts();
if ($accs->num_rows() <= 0) {
$glacc = "There are no Income accounts in Cubit.";
}
$glacc = "<select name='accinv'>";
while ($acc = $accs->fetch_array()) {
if (isDisabled($acc['accid'])) {
continue;
}
if ($accinv == $acc['accid']) {
$sel = "selected";
} else {
$sel = "";
}
$glacc .= "<option value='{$acc['accid']}' {$sel}>{$acc['accname']}</option>";
}
$glacc .= "</select>";
$OUT = "\n\t\t\t\t<h3>Edit Bank Receipt</h3>\n\t\t\t\t<table " . TMPL_tblDflts . " width='100%'>\n\t\t\t\t<form action='" . SELF . "' method='POST' name='form'>\n\t\t\t\t\t<input type='hidden' name='key' value='confirm'>\n\t\t\t\t\t<input type='hidden' name='id' value='{$id}'>\n\t\t\t\t\t<input type='hidden' name='vat' value='{$bcb['vat']}' />\n\t\t\t\t\t<input type='hidden' name='orig_vatcode' value='{$bcb['vatcode']}' />\n\t\t\t\t\t<input type='hidden' name='orig_chrgvat' value='{$bcb['chrgvat']}' />\n\t\t\t\t\t<input type='hidden' name='orig_amount' value='{$bcb['amount']}' />\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>Field</th>\n\t\t\t\t\t\t<th>Value</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t<td>Bank Account</td>\n\t\t\t\t\t\t<td valign='center'>\n\t\t\t\t\t\t\t<select name='bankid'>";
db_connect();
$qry->setTable("bankacct", "cubit");
$qry->setOpt(grp(m("where", "btype!='int' AND div='" . USER_DIV . "'")));
$qry->run();
if ($qry->num_rows() <= 0) {
return "<li class='err'> There are no accounts held at the selected Bank.\n\t\t\t<p><input type='button' onClick='JavaScript:history.back();' value='« Correct Selection'>";
}
while ($acc = $qry->fetch_array()) {
if (isset($bankid) && $bankid == $acc['bankid']) {
$sel = "selected";
} else {
$sel = "";
}
$OUT .= "<option value='{$acc['bankid']}' {$sel}>{$acc['accname']} - {$acc['bankname']} ({$acc['acctype']})</option>";
}
if (!isset($name)) {
$name = "";
$descript = "";
$cheqnum = "";
$amount = "";
$chrgvat = "";
}
db_conn('cubit');
$Sl = "SELECT * FROM vatcodes ORDER BY code";
$Ri = db_exec($Sl) or errDie("Unable to get vat codes");
$Vatcodes = "\n\t\t\t<select name='vatcode'>\n\t\t\t\t<option value='0'>Select</option>";
$vacs = qryVatcode();
$Vatcodes = db_mksel($vacs, "vatcode", $vatcode, "#id", "#code", "0:Select");
list($o_year, $o_month, $o_day) = explode('-', $date);
$sel1 = "";
$sel2 = "";
$sel3 = "";
if ($chrgvat == "inc") {
$sel1 = "checked=yes";
} else {
if ($chrgvat == "exc") {
$sel2 = "checked=yes";
} else {
if ($chrgvat == "nov") {
$sel3 = "checked=yes";
} else {
$sel1 = "checked=yes";
}
}
}
$OUT .= "\n\t\t</select>\n\t\t</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Date</td>\n\t\t<td>\n\t\t\t" . mkDateSelect("o", $o_year, $o_month, $o_day) . "\n\t\t</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Received from</td>\n\t\t<td valign='center'><input size='20' name='name' value='{$name}'></td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Description</td>\n\t\t<td valign='center'><textarea col='18' rows='3' name='descript'>{$descript}</textarea></td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Reference</td>\n\t\t<td valign='center'><input size='20' name='reference' value='{$reference}'></td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Cheque Number</td>\n\t\t<td valign='center'><input size='20' name='cheqnum' value='{$cheqnum}'></td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Amount</td>\n\t\t<td valign='center'>" . CUR . " <input type='text' size='10' name='amount' value='" . sprint($amount) . "'></td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>VAT </td>\n\t\t<td>\n\t\t\t<input type='radio' name='chrgvat' value='inc' {$sel1}>Inclusive \n\t\t\t<input type='radio' name='chrgvat' value='exc' {$sel2}>Exclusive \n\t\t\t<input type='radio' name='chrgvat' value='nov' {$sel3}>No VAT\n\t\t</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>VAT Code</td>\n\t\t<td>{$Vatcodes}</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td valign='top'>Select Contra Account</td>\n\t\t<td>{$glacc}</td>\n\t</tr>\n\t<tr>\n\t\t<td> </td>\n\t\t<td valign='center' align='right'><input type='submit' value='Confirm »'></td>\n\t</tr>\n\t</table>";
# main table (layout with menu)
$OUT .= mkQuickLinks();
return $OUT;
}
示例3: slctacc
function slctacc($_GET)
{
extract($_GET);
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($cusnum, "num", 1, 50, "Invalid customer id.");
# display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class='err'>-" . $e["msg"] . "</li>";
}
return $confirm;
}
# refnum
$refnum = getrefnum();
# Select customer
db_connect();
$sql = "SELECT * FROM customers WHERE cusnum = '{$cusnum}' AND div = '" . USER_DIV . "'";
$custRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
if (pg_numrows($custRslt) < 1) {
return "<li> Invalid Customer ID.</li>";
} else {
$cust = pg_fetch_array($custRslt);
}
# Accounts drop down
core_connect();
$accounts = "<select name='accid'>";
$sql = "SELECT * FROM accounts WHERE div = '" . USER_DIV . "' ORDER BY accname ASC";
$accRslt = db_exec($sql);
if (pg_numrows($accRslt) < 1) {
return "<li>There are No accounts in Cubit.</li>";
}
while ($acc = pg_fetch_array($accRslt)) {
$sel = "";
if (isset($cacc)) {
if ($cacc == $acc['accid']) {
$sel = "selected";
}
}
# Check Disable
if (isDisabled($acc['accid'])) {
continue;
}
$accounts .= "<option value='{$acc['accid']}' {$sel}>{$acc['accname']}</option>";
}
$accounts .= "</select>";
$entd = "";
$entc = "checked=yes";
if (isset($tran)) {
if ($tran == "dt") {
$entd = "checked=yes";
$entc = "";
}
}
// Accounts (debit)
$view = "\n\t\t\t<h3> Journal transaction </h3>\n\t\t\t<form action='" . SELF . "' method='POST' name='form'>\n\t\t\t\t<input type='hidden' name='key' value='details'>\n\t\t\t\t<input type='hidden' name='cusnum' value='{$cusnum}'>\n\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t<tr>\n\t\t\t\t\t<th>Field</th>\n\t\t\t\t\t<th>Value</th>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Account Number</td>\n\t\t\t\t\t<td>{$cust['accno']}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Customer</td>\n\t\t\t\t\t<td>{$cust['cusname']} {$cust['surname']}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Date</td>\n\t\t\t\t\t<td>" . mkDateSelect("date") . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Reference Number</td>\n\t\t\t\t\t<td><input type='text' size='10' name='refnum' value='" . $refnum++ . "'></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Entry Type</td>\n\t\t\t\t\t<td><input type='radio' name='entry' value='DT' {$entd}> Debit | <input type='radio' name='entry' value='CT' {$entc}>Credit</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td rowspan='2'>Cotra Account</td>\n\t\t\t\t\t<td>{$accounts} <input name='details' type='submit' value='Enter Details'></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<!-- Rowspan -->\n\t\t\t\t\t<td><input type='text' name='accnum' size='20'> <input type='submit' value='Enter Details'></td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<p>\n\t\t\t<input type='button' value='Go Back' onClick='javascript:history.back();'>\n\t\t\t</form>\n\t\t\t<table border='0' cellpadding='2' cellspacing='1' width='15%'>\n\t\t\t\t" . TBL_BR . "\n\t\t\t\t<tr>\n\t\t\t\t\t<th>Quick Links</th>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td align='center'><a href='trans-new.php'>Journal Transactions</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td align='center'><a href='../customers-view.php'>View Customers</a></td>\n\t\t\t\t</tr>\n\t\t\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t\t\t</table>";
return $view;
}
示例4: enter2
function enter2($_POST)
{
extract($_POST);
$description = safe($description);
$pn = safe($pn);
$type = safe($type);
$action = safe($action);
if ($action == "Customer Payment" && $pn == "-") {
return "<li class='err'>You cannot have a 'Payment from customer' on your statement for a negative amount.</li>" . enter($_POST);
}
if ($action == "Supplier Payment" && $pn == "+") {
return "<li class='err'>You cannot have a 'Payment to supplier' on your statement for a positive amount.</li>" . enter($_POST);
}
if ($action == "Insert into cashbook") {
$details = "\r\n\t\t\t<select name='account'>\r\n\t\t\t\t<option value=''>Select Account</option>";
db_conn('core');
$Sl = "SELECT * FROM accounts WHERE div = '" . USER_DIV . "' ORDER BY accname";
$Rl = db_exec($Sl) or errDie("Unable to get account data.");
if (pg_numrows($Rl) < 1) {
return "<li>There are No accounts in Cubit.";
}
while ($ad = pg_fetch_array($Rl)) {
if (isDisabled($ad['accid'])) {
continue;
}
$details .= "<option value='{$ad['accid']}'>{$ad['accname']}</option>";
}
$details .= "</select>";
} elseif ($action == "Customer Payment") {
db_conn('cubit');
$Sl = "SELECT cusnum,surname FROM customers WHERE div='" . USER_DIV . "' AND location='loc' ORDER BY surname";
$Rl = db_exec($Sl) or errDie("Unable to get customers.");
$details = "\r\n\t\t\t<select name='account'>\r\n\t\t\t\t<option value='0'>Select Customer</option>";
while ($cd = pg_fetch_array($Rl)) {
$details .= "<option value='{$cd['cusnum']}'>{$cd['surname']}</option>";
}
$details .= "</select>";
} elseif ($action == "Supplier Payment") {
db_conn('cubit');
$Sl = "SELECT supid,supname FROM suppliers WHERE div='" . USER_DIV . "' AND location='loc' ORDER BY supname";
$Rl = db_exec($Sl) or errDie("Unable to get suppliers.");
$details = "\r\n\t\t\t<select name='account'>\r\n\t\t\t\t<option value=0>Select Supplier</option>";
while ($cd = pg_fetch_array($Rl)) {
$details .= "<option value='{$cd['supid']}'>{$cd['supname']}</option>";
}
$details .= "</select>";
} elseif ($action == "Ignore") {
$details = "<input type=hidden name=account value=0>";
} elseif ($action == "Delete") {
$details = "<input type=hidden name=account value=0>";
}
$out = "\r\n\t\t<h3>Add statement description details</h3>\r\n\t\t<table " . TMPL_tblDflts . ">\r\n\t\t<form action='" . SELF . "' method='POST'>\r\n\t\t\t<input type='hidden' name='key' value='confirm'>\r\n\t\t\t<input type='hidden' name='description' value='{$description}'>\r\n\t\t\t<input type='hidden' name='pn' value='{$pn}'>\r\n\t\t\t<input type='hidden' name='type' value='{$type}'>\r\n\t\t\t<input type='hidden' name='action' value='{$action}'>\r\n\t\t\t<tr>\r\n\t\t\t\t<th colspan='2'>Details</th>\r\n\t\t\t</tr>\r\n\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t<td>Description</td>\r\n\t\t\t\t<td>{$description}</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t<td>+/-</td>\r\n\t\t\t\t<td>{$pn}</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t<td>Type</td>\r\n\t\t\t\t<td>{$type}</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t<td>Action</td>\r\n\t\t\t\t<td>{$action}</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t<td>Action Details</td>\r\n\t\t\t\t<td>{$details}</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' align='right'><input type='submit' value='Confirm »'></td>\r\n\t\t\t</tr>\r\n\t\t</form>\r\n\t\t</table>";
return $out;
}
示例5: details
function details($_POST, $error = "")
{
# get vars
extract($_POST);
# Validate input
require_lib("validate");
$v = new validate();
$v->isOk($purid, "num", 1, 20, "Invalid Non-Stock Order number.");
# display errors, if any
if ($v->isError()) {
$errors = $v->getErrors();
foreach ($errors as $e) {
$error .= "<li class='err'>{$e['msg']}</li>";
}
$confirm = "{$error}<p><input type='button' onClick='JavaScript:history.back();' value='« Correct submission'>";
return $confirm;
}
$prd += 0;
# 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 "<li class='err'>purchase Not Found</li>";
}
$pur = pg_fetch_array($purRslt);
# check if Order has been printed
# currency
$currs = getSymbol($pur['fcid']);
$curr = $currs['symbol'];
$currsel = "{$currs['symbol']} - {$currs['descrip']}";
/* --- Start Drop Downs --- */
# format date
list($pyear, $pmon, $pday) = explode("-", $pur['pdate']);
list($dyear, $dmon, $dday) = explode("-", $pur['ddate']);
$stkacc = "<select name='stkacc[]'>";
core_connect();
$sql = "SELECT * FROM accounts WHERE div = '" . USER_DIV . "' ORDER BY accname ASC";
$accRslt = db_exec($sql);
if (pg_numrows($accRslt) < 1) {
return "<li>There are No accounts in Cubit.";
}
while ($acc = pg_fetch_array($accRslt)) {
# Check Disable
if (isDisabled($acc['accid'])) {
continue;
}
$stkacc .= "<option value='{$acc['accid']}'>{$acc['topacc']}/{$acc['accnum']} - {$acc['accname']}</option>";
}
$stkacc .= "</select>";
# get selected supplier info
db_connect();
$sql = "SELECT * FROM suppliers WHERE supid = '{$pur['supid']}' AND div = '" . USER_DIV . "'";
$supRslt = db_exec($sql) or errDie("Unable to get supplier");
if (pg_numrows($supRslt) < 1) {
$error = "<li class='err'> Supplier not Found.</li>";
$confirm .= "{$error}<p><input type='button' onClick='JavaScript:history.back();' value='« Correct submission'>";
return $confirm;
}
$sup = pg_fetch_array($supRslt);
/* --- End Drop Downs --- */
/* --- 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 RETURNED</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 *, (qty - rqty) as qty FROM nons_purint_items WHERE purid = '{$purid}' AND (qty - rqty) > 0 AND div = '" . USER_DIV . "'";
$stkdRslt = db_exec($sql);
while ($stkd = pg_fetch_array($stkdRslt)) {
$stkacc = "<input type='hidden' name='stkacc[]' value='{$stkd['accid']}'>";
# 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><input type='hidden' name='ids[]' value='{$stkd['id']}'>{$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><input type='hidden' name='qts[]' value='{$stkd['qty']}'><input type='text' size='5' name='qtys[]' value='{$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>{$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\t{$stkacc}\n\t\t\t\t\t\t\t</tr>";
}
$products .= "</table>";
/* --- End Products Display --- */
/* -- Final Layout -- */
$details = "\n\t\t\t\t\t<center>\n\t\t\t\t\t<h3>Return International Non-Stock Order</h3>\n\t\t\t\t\t<form action='" . SELF . "' method='POST' name='form'>\n\t\t\t\t\t\t<input type='hidden' name='key' value='confirm'>\n\t\t\t\t\t\t<input type='hidden' name='purid' value='{$purid}'>\n\t\t\t\t\t\t<input type='hidden' name='prd' value='{$prd}'>\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>Account</td>\n\t\t\t\t\t\t\t\t\t\t<td>{$sup['supno']}</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</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<input type='hidden' name='refno' size='10' value='{$pur['refno']}'>\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} 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<input type='hidden' size='2' name='dday' maxlength='2' value='{$dday}'>\n\t\t\t\t\t\t\t\t\t<input type='hidden' size='2' name='dmon' maxlength='2' value='{$dmon}'>\n\t\t\t\t\t\t\t\t\t<input type='hidden' size='4' name='dyear' maxlength='4' value='{$dyear}'>\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<p>\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='25%'>Quick Links</th>\n\t\t\t\t\t\t\t\t\t\t<th width='25%'>Remarks</th>\n\t\t\t\t\t\t\t\t\t\t<td rowspan='5' valign='top' width='50%'>{$error}</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' nowrap>{$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' nowrap>{$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' nowrap>{$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' nowrap>{$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\t<tr>\n\t\t\t\t\t\t\t<td align='right'><input type='submit' name='upBtn' value='Confirm'></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;
}
示例6: isDisabled
$clr = 'green';
$hint = 'aktif';
$icon = 'checkmark';
} else {
//tidak aktif
$clr = 'red';
$hint = 'tidak aktif';
$icon = 'blocked';
}
// <td align="center">'.getFieldArr('id_departemen','kon_logindepartemen','id_login',$res['id_login']).'</td>
$out .= '<tr>
<td align="center">' . $res['nama'] . '</td>
<td align="center">' . $res['username'] . '</td>
<td align="center">' . $res['level'] . '</td>
<td align="center">
<button ' . isDisabled('user', 'u') . ' onclick="aktifkan(' . $res['id_login'] . ');" class="fg-white bg-' . $clr . '" data-hint="' . $hint . '"><i class="icon-' . $icon . '"></i></button>
</td>
' . $btn . '
</tr>';
// $nox++;
}
} else {
#kosong
$out .= '<tr align="center">
<td colspan=9 ><span style="color:red;text-align:center;">
... data tidak ditemukan...</span></td></tr>';
}
#link paging
$out .= '<tr class="info"><td colspan=9>' . $obj->anchors . '</td></tr>';
$out .= '<tr class="info"><td colspan=9>' . $obj->total . '</td></tr>';
break;
示例7: slctacc
function slctacc($_GET, $err = "")
{
extract($_GET);
if (!isset($refnu)) {
$refnum = getrefnum();
}
# Select customer
db_connect();
$get_cust = "SELECT * FROM customers WHERE blocked = 'no'";
$run_cust = db_exec($get_cust) or errDie("Unable to get customers information.");
if (pg_numrows($run_cust) < 1) {
return "No Valid Customers Found.";
}
$cust_drop = "<select name='cusnum'>";
while ($carr = pg_fetch_array($run_cust)) {
if (isset($cusnum) and $cusnum == $carr['cusnum']) {
$cust_drop .= "<option value='{$carr['cusnum']}' selected>{$carr['accno']} {$carr['surname']}</option>";
} else {
$cust_drop .= "<option value='{$carr['cusnum']}'>{$carr['accno']} {$carr['surname']}</option>";
}
}
$cust_drop .= "</select>";
# Accounts drop down
core_connect();
$accounts = "<select name='accid'>";
$sql = "SELECT * FROM accounts WHERE div = '" . USER_DIV . "' ORDER BY accname ASC";
$accRslt = db_exec($sql);
if (pg_numrows($accRslt) < 1) {
return "<li>There are No accounts in Cubit.</li>";
}
while ($acc = pg_fetch_array($accRslt)) {
$sel = "";
if (isset($cacc)) {
if ($cacc == $acc['accid']) {
$sel = "selected";
}
}
# Check Disable
if (isDisabled($acc['accid'])) {
continue;
}
$accounts .= "<option value='{$acc['accid']}' {$sel}>{$acc['accname']}</option>";
}
$accounts .= "</select>";
$entd = "";
$entc = "checked=yes";
if (isset($tran)) {
if ($tran == "dt") {
$entd = "checked=yes";
$entc = "";
}
}
if (!isset($ct_year)) {
$ct_year = date("Y");
$ct_month = date("m");
$ct_day = date("d");
}
db_connect();
$get_batch = "SELECT * FROM cust_trans_batch ORDER BY proc_date, cusnum";
$run_batch = db_exec($get_batch) or errDie("Unable to get batch customer transaction information.");
if (pg_numrows($run_batch) < 1) {
$show_batch_listing = "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='9'>No entries Found.</td>\n\t\t\t</tr>";
} else {
$show_batch_listing = "";
while ($barr = pg_fetch_array($run_batch)) {
db_connect();
$get_cust = "SELECT accno, surname FROM customers WHERE cusnum = '{$barr['cusnum']}' LIMIT 1";
$run_cust = db_exec($get_cust) or errDie("Unable to get customer information.");
$showcusnum = "(" . pg_fetch_result($run_cust, 0, 0) . ") " . pg_fetch_result($run_cust, 0, 1);
if (isset($barr['chrg_vat']) and $barr['chrg_vat'] != "0") {
$get_vatcode = "SELECT vat_amount FROM vatcodes WHERE id = '{$barr['vatcode']}' LIMIT 1";
$run_vatcode = db_exec($get_vatcode) or errDie("Unable to get vat code information.");
if (pg_numrows($run_vatcode) < 1) {
#vatcode not found ....
return "<li class='err'>Unable to get vat code information.</li>";
}
$vd = pg_fetch_array($run_vatcode);
if ($barr['chrg_vat'] == "inc") {
$vatamt = sprint($barr['amount'] * ($vd['vat_amount'] / (100 + $vd['vat_amount'])));
$showamount = sprint($barr['amount'] - $vatamt);
$showvat = sprint($vatamt) . " (Inclusive)";
} else {
$showamount = sprint($barr['amount']);
$vatamt = $barr['amount'] / 100 * $vd['vat_amount'];
$showvat = sprint($vatamt) . " (Exclusive)";
}
} else {
#vat not set
$showamount = sprint($barr['amount']);
$showvat = CUR . " " . sprint(0) . " (No VAT)";
}
core_connect();
$get_acc = "SELECT accname FROM accounts WHERE accid = '{$barr['contra_account']}' LIMIT 1";
$run_acc = db_exec($get_acc) or errDie("Unable to get account information.");
$showaccount = pg_fetch_result($run_acc, 0, 0);
$show_batch_listing .= "\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>{$showcusnum}</td>\n\t\t\t\t\t<td>{$barr['proc_date']}</td>\n\t\t\t\t\t<td>{$barr['ref_num']}</td>\n\t\t\t\t\t<td>{$barr['entry_type']}</td>\n\t\t\t\t\t<td>{$showaccount}</td>\n\t\t\t\t\t<td>{$showamount}</td>\n\t\t\t\t\t<td>{$showvat}</td>\n\t\t\t\t\t<td><input type='checkbox' name='rem_trans[{$barr['id']}]' value='yes'></td>\n\t\t\t\t\t<td><input type='checkbox' name='proc_trans[{$barr['id']}]' value='yes' checked='yes'></td>\n\t\t\t\t</tr>";
$totamount += $showamount;
$totvatamt += $showvat;
}
$show_batch_listing .= "\n\t\t\t<tr>\n\t\t\t\t<td colspan='3'></td>\n\t\t\t\t<th colspan='2'>TOTALS:</td>\n\t\t\t\t<td nowrap class='" . bg_class() . "'>" . CUR . " {$totamount}</td>\n\t\t\t\t<td nowrap class='" . bg_class() . "'>" . CUR . " {$totvatamt}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan='3'></td>\n\t\t\t\t<th colspan='2'>TOTAL INC VAT</th>\n\t\t\t\t<td nowrap class='" . bg_class() . "' colspan='2'>" . CUR . " " . sprint($totamount + $totvatamt) . "</td>\n\t\t\t</tr>\n\t\t\t<tr><td><br></td></tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan='9' align='right'><input type='submit' name='remove_entries' value='Remove Selected'></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan='9' align='right'><input type='submit' name='process_batch' value='Process Selected Entries'></td>\n\t\t\t</tr>";
//.........这里部分代码省略.........
示例8: slctVatacc
function slctVatacc($_POST, $err = "")
{
extract($_POST);
if (isset($back)) {
if (isset($details)) {
return $confirm . "</li>" . details($_POST);
} else {
return $confirm . "</li>" . details2($_POST);
}
}
require_lib("validate");
$v = new validate();
$v->isOk($ctaccid, "num", 1, 50, "Invalid Account to be Credited.");
$v->isOk($dtaccid, "num", 1, 50, "Invalid Account to be Debited.");
$v->isOk($refnum, "num", 1, 10, "Invalid Reference number.");
$v->isOk($amount, "float", 1, 20, "Invalid Amount.");
$v->isOk($details, "string", 0, 255, "Invalid Details.");
$v->isOk($author, "string", 1, 30, "Invalid Authorising person name.");
$v->isOk($chrgvat, "string", 1, 4, "Invalid charge vat option.");
$v->isOk($date, "date", 1, 1, "Invalid date.");
if ($v->isError()) {
$err = $v->genErrors();
if (isset($details)) {
return details($_POST, $err);
} else {
return details2($_POST, $err);
}
}
if (!isset($vatinc)) {
$vatinc = "";
$vatdedacc = "";
$vataccid = 0;
}
if ($vatdedacc == "{$ctaccid}") {
$dsel1 = "";
$dsel2 = "checked=yes";
} else {
$dsel1 = "checked=yes";
$dsel2 = "";
}
if ($vatinc == "no") {
$vatsel1 = "";
$vatsel2 = "checked=yes";
} else {
$vatsel2 = "";
$vatsel1 = "checked=yes";
}
# Account numbers
$dtaccRs = get("core", "*", "accounts", "accid", $dtaccid);
$dtacc = pg_fetch_array($dtaccRs);
$ctaccRs = get("core", "*", "accounts", "accid", $ctaccid);
$ctacc = pg_fetch_array($ctaccRs);
db_conn('core');
$vatacc = "<select name='vataccid'>";
$sql = "SELECT * FROM accounts WHERE div = '" . USER_DIV . "' ORDER BY accname ASC";
$accRslt = db_exec($sql);
if (pg_numrows($accRslt) < 1) {
return "<li>There are No accounts in Cubit.</li>";
}
while ($acc = pg_fetch_array($accRslt)) {
# Check Disable
if (isDisabled($acc['accid'])) {
continue;
}
if ($vataccid == $acc['accid']) {
$sel = "selected";
} else {
$sel = "";
}
$vatacc .= "<option value='{$acc['accid']}' {$sel}>{$acc['topacc']}/{$acc['accnum']} - {$acc['accname']}</option>";
}
$vatacc .= "</select>";
db_conn('cubit');
if (!isset($vatcode)) {
$Sl = "SELECT * FROM vatcodes WHERE del='Yes'";
$Ri = db_exec($Sl) or errDie("Unable to get data.");
$vd = pg_fetch_array($Ri);
$vatcode = $vd['id'];
}
if (!isset($vatcode)) {
$vatcode = 0;
}
$Sl = "SELECT * FROM vatcodes ORDER BY code";
$Ri = db_exec($Sl) or errDie("Unable to get vat codes");
$Vatcodes = "<select name='vatcode'>";
while ($vd = pg_fetch_array($Ri)) {
if ($vd['id'] == $vatcode) {
$sel = "selected";
} else {
$sel = "";
}
$Vatcodes .= "<option value='{$vd['id']}' {$sel}>{$vd['code']}</option>";
}
$Vatcodes .= "</select>";
// Details
$slctacc = "\n\t\t\t\t\t<center>\n\t\t\t\t\t<h3>Journal Transaction VAT Details</h3>\n\t\t\t\t\t<h4>Select VAT Accounts</h4>\n\t\t\t\t\t<form action='" . SELF . "' method='POST' name='form'>\n\t\t\t\t\t\t<input type='hidden' name='key' value='confirm' />\n\t\t\t\t\t\t<input type='hidden' name='dtaccid' value='{$dtaccid}' />\n\t\t\t\t\t\t<input type='hidden' name='ctaccid' value='{$ctaccid}' />\n\t\t\t\t\t\t<input type='hidden' name='dtaccname' value='{$dtacc['accname']}' />\n\t\t\t\t\t\t<input type='hidden' name='ctaccname' value='{$ctacc['accname']}' />\n\t\t\t\t\t\t<input type='hidden' name='date' value='{$date}' />\n\t\t\t\t\t\t<input type='hidden' name='refnum' value='{$refnum}' />\n\t\t\t\t\t\t<input type='hidden' name='amount' value='{$amount}' />\n\t\t\t\t\t\t<input type='hidden' name='details' value='{$details}' />\n\t\t\t\t\t\t<input type='hidden' name='author' value='{$author}' />\n\t\t\t\t\t\t<input type='hidden' name='chrgvat' value='{$chrgvat}' />\n\t\t\t\t\t\t<input type='hidden' name='jr_day' value='{$jr_day}' />\n\t\t\t\t\t\t<input type='hidden' name='jr_month' value='{$jr_month}' />\n\t\t\t\t\t\t<input type='hidden' name='jr_year' value='{$jr_year}' />\n\t\t\t\t\t\t<input type='hidden' name='vat' value='' />\n\t\t\t\t \t<table " . TMPL_tblDflts . " width='500'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td width='50%'><h3>Debit</h3></td>\n\t\t\t\t\t\t\t<td width='50%'><h3>Credit</h3></td>\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>{$dtacc['topacc']}/{$dtacc['accnum']} - {$dtacc['accname']}</td>\n\t\t\t\t\t\t\t<td>{$ctacc['topacc']}/{$ctacc['accnum']} - {$ctacc['accname']}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t" . TBL_BR . "\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td valign='top'>VAT Deductable Account</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type='radio' name='vatdedacc' value='{$dtaccid}' {$dsel1} />{$dtacc['topacc']}/{$dtacc['accnum']} - {$dtacc['accname']}<br />\n\t\t\t\t\t\t\t\t<input type='radio' name='vatdedacc' value='{$ctaccid}' {$dsel2} />{$ctacc['topacc']}/{$ctacc['accnum']} - {$ctacc['accname']}\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 class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td>VAT Account</td>\n\t\t\t\t\t\t\t<td>{$vatacc}</td>\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>VAT Inclusive </td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type='radio' size='20' name='vatinc' value='yes' {$vatsel1} />Yes (Amount Includes VAT) \n\t\t\t\t\t\t\t\t<input type='radio' size='20' name='vatinc' value='no' {$vatsel2} />No(Add VAT to Amount)\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 class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td>VAT Code</td>\n\t\t\t\t\t\t\t<td>{$Vatcodes}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t" . TBL_BR . "\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><input type='submit' name='back' value='« Correction'></td>\n\t\t\t\t\t\t\t<td align='right'><input type='submit' value='Confirm »'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t\t</form>" . mkQuickLinks(ql("../reporting/index-reports.php", "Financials"), ql("../core/trans-new.php", "Journal Transactions"));
return $slctacc;
}
示例9: slctVatacc
function slctVatacc($_POST)
{
// Sanity Checking
# Get vars
foreach ($_POST as $key => $value) {
${$key} = $value;
}
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($ctaccid, "num", 1, 50, "Invalid Account to be Credited.");
$v->isOk($dtaccid, "num", 1, 50, "Invalid Account to be Debited.");
$v->isOk($refnum, "num", 1, 10, "Invalid Reference number.");
$v->isOk($amount, "float", 1, 20, "Invalid Amount.");
$v->isOk($details, "string", 0, 255, "Invalid Details.");
$v->isOk($author, "string", 1, 30, "Invalid Authorising person name.");
$v->isOk($chrgvat, "string", 1, 4, "Invalid charge vat option.");
$datea = explode("-", $date);
if (count($datea) == 3) {
if (!checkdate($datea[1], $datea[0], $datea[2])) {
$v->isOk($date, "num", 1, 1, "Invalid date.");
}
} else {
$v->isOk($date, "num", 1, 1, "Invalid date.");
}
# display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class=err>" . $e["msg"];
}
$confirm .= "<p><input type=button onClick='JavaScript:history.back();' value='« Correct submission'>";
return $confirm;
}
# Account numbers
$dtaccRs = get("core", "*", "accounts", "accid", $dtaccid);
$dtacc = pg_fetch_array($dtaccRs);
$ctaccRs = get("core", "*", "accounts", "accid", $ctaccid);
$ctacc = pg_fetch_array($ctaccRs);
$vatacc = "<select name='vataccid'>";
$sql = "SELECT * FROM accounts WHERE div = '" . USER_DIV . "' ORDER BY accname ASC";
$accRslt = db_exec($sql);
if (pg_numrows($accRslt) < 1) {
return "<li>There are No accounts in Cubit.";
}
while ($acc = pg_fetch_array($accRslt)) {
# Check Disable
if (isDisabled($acc['accid'])) {
continue;
}
$vatacc .= "<option value='{$acc['accid']}'>{$acc['topacc']}/{$acc['accnum']} - {$acc['accname']}</option>";
}
$vatacc .= "</select>";
// Details
$slctacc = "<center><h3>Journal Transaction VAT Details</h3>\n\t<h4>Select VAT Accounts</h4>\n\t<form action='" . SELF . "' method=post name=form>\n\t<input type=hidden name=key value=confirm>\n\t<input type=hidden name='dtaccid' value='{$dtaccid}'>\n\t<input type=hidden name='ctaccid' value='{$ctaccid}'>\n\t<input type=hidden name=dtaccname value='{$dtacc['accname']}'>\n\t<input type=hidden name=ctaccname value='{$ctacc['accname']}'>\n\t<input type=hidden name=date value='{$date}'>\n\t<input type=hidden name=refnum value='{$refnum}'>\n\t<input type=hidden name=amount value='{$amount}'>\n\t<input type=hidden name=details value='{$details}'>\n\t<input type=hidden name=author value='{$author}'>\n\t<input type=hidden name=chrgvat value='{$chrgvat}'>\n \t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' align=center width=500>\n\t<tr><td width=50%><h3>Debit</h3></td><td width=50%><h3>Credit</h3></td></tr>\n <tr class='bg-odd'><td>{$dtacc['topacc']}/{$dtacc['accnum']} - {$dtacc['accname']}</td><td>{$ctacc['topacc']}/{$ctacc['accnum']} - {$ctacc['accname']}</td></tr>\n\t<tr><td><br></td></tr>\n\t<tr class='bg-even'><td valign=top>VAT Deductable Account</td><td><input type=radio name=vatdedacc value='{$dtaccid}' checked=yes>{$dtacc['topacc']}/{$dtacc['accnum']} - {$dtacc['accname']}<br><input type=radio name=vatdedacc value='{$ctaccid}'>{$ctacc['topacc']}/{$ctacc['accnum']} - {$ctacc['accname']}</td></tr>\n\t<tr class='bg-odd'><td>VAT Account</td><td>{$vatacc}</td></tr>\n\t<tr class='bg-even'><td>VAT Inclusive </td><td><input type=radio size=20 name=vatinc value=yes checked=yes>Yes(Amount Includes VAT) <input type=radio size=20 name=vatinc value=no>No(Add VAT to Amount)</td></tr>\n\t<tr><td><br></td></tr>\n\t<tr><td align=right><input type=button value='« Back' onClick='javascript:history.back()'></td><td align=right><input type=submit value='Continue »'></td></tr>\n\t</table></form>\n\t<p>\n\t<table border=0 cellpadding='2' cellspacing='1' width=15%>\n\t\t<tr><th>Quick Links</th></tr>\n\t\t<tr class='bg-odd'><td align=center><a href='ledger-view.php'>View High Speed Input Ledgers</td></tr>\n\t\t<tr class='bg-odd'><td align=center><a href='../main.php'>Main Menu</td></tr>\n\t</table>";
return $slctacc;
}
示例10: while
$curKat = '';
while ($res = mysql_fetch_assoc($result)) {
if ($res['kategorirekening'] != $curKat) {
$ss = 'SELECT replid,nama,RPAD(kode,6,0)kode from keu_kategorirekening where replid=' . $res['kategorirekening'];
$ee = mysql_query($ss);
$rr = mysql_fetch_assoc($ee);
$out .= '<tr class="bg-lightTeal">
<td align="right"><b>' . $rr['kode'] . '</b></td>
<td colspan="3"><b>' . $rr['nama'] . '</b></td>
</tr>';
}
$btn = '<td align="center">
<button data-hint="ubah" ' . isDisabled($menu, 'u') . ' class="button" onclick="viewFR(' . $res['replid'] . ');">
<i class="icon-pencil on-left"></i>
</button>
<button data-hint="hapus" ' . isDisabled($menu, 'd') . ' class="button" onclick="del(' . $res['replid'] . ');">
<i class="icon-remove on-left"></i>
</button>
</td>';
$out .= '<tr>
<td class="text-right">' . $res['kode'] . '</td>
<td>' . $res['nama'] . '</td>
<td>' . $res['keterangan'] . '</td>
' . $btn . '
</tr>';
$curKat = $res['kategorirekening'];
$nox++;
}
} else {
#kosong
$out .= '<tr align="center">
示例11: confirm
function confirm($_POST)
{
# Get vars
extract($_POST);
if (isset($back)) {
return number($_POST);
}
$blocked_date_from = getCSetting("BLOCKED_FROM");
$blocked_date_to = getCSetting("BLOCKED_TO");
# validate input
require_lib("validate");
$v = new validate();
foreach ($amount as $key => $value) {
if ($amount[$key] > 0) {
if (isDisabled($ctaccid[$key])) {
return custconfirm($_POST);
}
if (isDisabled($dtaccid[$key])) {
return custconfirm($_POST);
}
$v->isOk($ctaccid[$key], "num", 1, 50, "Invalid Account to be Credited.[{$key}]");
$v->isOk($dtaccid[$key], "num", 1, 50, "Invalid Account to be Debited.[{$key}]");
$v->isOk($refnum[$key], "num", 1, 10, "Invalid Reference number.[{$key}]");
$v->isOk($amount[$key], "float", 1, 20, "Invalid Amount.[{$key}]");
$v->isOk($descript[$key], "string", 0, 255, "Invalid Details.[{$key}]");
$date[$key] = $date_day[$key] . "-" . $date_month[$key] . "-" . $date_year[$key];
if (!checkdate($date_month[$key], $date_day[$key], $date_year[$key])) {
$v->isOk($date[$key], "num", 1, 1, "Invalid date.");
}
// if ($amount[$key] <= 0){
// return slctacc($_POST,"<li class='err'>Invalid Amount To Process.</li>");
// }
if (strtotime($date[$key]) >= strtotime($blocked_date_from) and strtotime($date[$key]) <= strtotime($blocked_date_to) and !user_is_admin(USER_ID)) {
return "<li class='err'>Period Range Is Blocked. Only an administrator can process entries within this period.</li>";
}
}
}
# display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class='err'>" . $e["msg"] . "</li>";
}
$confirm .= "<p><input type='button' onClick='JavaScript:history.back();' value='« Correct submission'>";
return slctacc($_POST, $confirm);
}
# accnums
foreach ($amount as $key => $value) {
if ($amount[$key] > 0) {
# get account to be debited
$dtaccRs = get("core", "*", "accounts", "accid", $dtaccid[$key]);
if (pg_numrows($dtaccRs) < 1) {
return "<li> Accounts to be debited does not exist.</li>";
}
$dtacc[$key] = pg_fetch_array($dtaccRs);
# get account to be credited
$ctaccRs = get("core", "*", "accounts", "accid", $ctaccid[$key]);
if (pg_numrows($ctaccRs) < 1) {
return "<li> Accounts to be credited does not exist.</li>";
}
$ctacc[$key] = pg_fetch_array($ctaccRs);
}
}
$confirm = "\n\t\t<center>\n\t\t<h3>Multiple Journal transactions</h3>\n\t\t<h4>Confirm entry</h4>\n\t\t<form action='" . SELF . "' method='POST'>\n\t\t\t<input type='hidden' name='key' value='write'>\n\t\t\t<input type='hidden' name='vby' value='{$vby}'>\n\t\t\t<input type='hidden' name='tnum' value='{$tnum}'>\n\t\t<table " . TMPL_tblDflts . " width='700'>\n\t\t\t<tr>\n\t\t\t\t<th>Date</th>\n\t\t\t\t<th>Ref num</th>\n\t\t\t\t<th>Debit</th>\n\t\t\t\t<th>Credit</th>\n\t\t\t\t<th>Amount</th>\n\t\t\t\t<th>Description</th>\n\t\t\t</tr>";
$trans = "";
foreach ($amount as $key => $value) {
if ($amount[$key] > 0) {
$trans .= "\n\t\t\t\t<tr bgcolor=" . bgcolorg() . ">\n\t\t\t\t\t<input type='hidden' name='date_day[]' value='{$date_day[$key]}'>\n\t\t\t\t\t<input type='hidden' name='date_month[]' value='{$date_month[$key]}'>\n\t\t\t\t\t<input type='hidden' name='date_year[]' value='{$date_year[$key]}'>\n\t\t\t\t\t<td><input type='hidden' size='10' name='date[]' value='{$date[$key]}'>{$date[$key]}</td>\n\t\t\t\t\t<td><input type='hidden' size='10' name='refnum[]' value='{$refnum[$key]}'>{$refnum[$key]}</td>\n\t\t\t\t\t<td valign='center'><input type='hidden' name='dtaccid[]' value='" . $dtacc[$key]['accid'] . "'>" . $dtacc[$key]['accname'] . "</td>\n\t\t\t\t\t<td valign='center'><input type='hidden' name='ctaccid[]' value='" . $ctacc[$key]['accid'] . "'>" . $ctacc[$key]['accname'] . "</td>\n\t\t\t\t\t<td><input type='hidden' name='amount[]' value='{$amount[$key]}'>" . CUR . " {$amount[$key]}</td>\n\t\t\t\t\t<td><input type='hidden' name='descript[]' value ='{$descript[$key]}'>{$descript[$key]}</td>\n\t\t\t\t</tr>";
}
}
if (strlen($trans) < 5) {
return slctacc($_POST, "<li class='err'>Please enter full transaction details.</li><br>");
}
$confirm .= "\n\t\t\t{$trans}\n\t\t\t<tr><td><br></td></tr>\n\t\t\t<tr>\n\t\t\t\t<td><input type='submit' name='back' value='« Correction'></td>\n\t\t\t\t<td align='right' colspan='4'><input type='submit' value='Write »'></td>\n\t\t\t</tr>\n\t\t</form>\n\t\t</table>\n\t\t<table border='0' cellpadding='2' cellspacing='1' width='15%'>\n\t\t\t<tr><td><br></td></tr>\n\t\t\t<tr>\n\t\t\t\t<th>Quick Links</th>\n\t\t\t</tr>\n\t\t\t<tr class='datacell'>\n\t\t\t\t<td align='center'><a href='../reporting/index-reports.php'>Financials</a></td>\n\t\t\t</tr>\n\t\t\t<tr class='datacell'>\n\t\t\t\t<td align='center'><a href='trans-new.php'>Journal Transactions</td>\n\t\t\t</tr>\n\t\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t\t</table>";
return $confirm;
}
示例12: error
function error($_POST, $err = "")
{
# get vars
extract($_POST);
core_connect();
$sql = "SELECT * FROM accounts WHERE div = '" . USER_DIV . "' ORDER BY accname ASC";
$accRslt = db_exec($sql);
if (pg_numrows($accRslt) < 1) {
return "<li> ERROR : There are no accounts in the category selected.</li>";
}
$accnts = "<select name='accid'>";
while ($acc = pg_fetch_array($accRslt)) {
# Check Disable
if (isDisabled($acc['accid'])) {
continue;
}
$sel = "";
if ($acc['accid'] == $accid) {
$sel = "selected";
}
$accnts .= "<option value='{$acc['accid']}' {$sel}>{$acc['accname']}</option>";
}
$accnts .= "</select>";
# check available funds
$cashacc = gethook("accnum", "bankacc", "name", "Petty Cash");
core_connect();
$sql = "SELECT (debit - credit) as bal FROM trial_bal WHERE accid = '{$cashacc}' AND div = '" . USER_DIV . "'";
$accbRslt = db_exec($sql);
if (pg_numrows($accbRslt) < 1) {
return "<li class='err'> Petty Cash Account not found.</li>";
}
$accb = pg_fetch_array($accbRslt);
$accb['bal'] = sprint($accb['bal']);
# mourn if the is no money
if ($accb['bal'] < 1) {
return "<li> There are no Petty Cash funds available.</li>";
}
# Keep the charge vat option stable
if ($chrgvat == "inc") {
$chin = "checked=yes";
$chex = "";
$chno = "";
} elseif ($chrgvat == "exc") {
$chin = "";
$chex = "checked=yes";
$chno = "";
} else {
$chin = "";
$chex = "";
$chno = "checked=yes";
}
db_conn('cubit');
$Sl = "SELECT * FROM vatcodes ORDER BY code";
$Ri = db_exec($Sl) or errDie("Unable to get vat codes");
$Vatcodes = "<select name='vatcode'>\r\n\t<option value='0'>Select</option>";
while ($vd = pg_fetch_array($Ri)) {
if ($vd['del'] == "Yes" || $vatcode == $vd["id"]) {
$sel = "selected";
} else {
$sel = "";
}
$Vatcodes .= "<option value='{$vd['id']}' {$sel}>{$vd['code']}</option>";
}
$Vatcodes .= "</select>";
// Layout
$add = "\r\n\t\t\t\t<h3>Edit Petty Cash Requisistion</h3>\r\n\t\t\t\t<table " . TMPL_tblDflts . " width='300'>\r\n\t\t\t\t<form action='" . SELF . "' method='POST' name='form'>\r\n\t\t\t\t\t<input type='hidden' name='key' value='confirm'>\r\n\t\t\t\t\t<input type='hidden' name='cashid' value='{$cashid}'>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan='2'>{$err}</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Field</th>\r\n\t\t\t\t\t\t<th>Value</th>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t<td>Date</td>\r\n\t\t\t\t\t\t<td>" . mkDateSelect("date", $date_year, $date_month, $date_day) . "</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t<td>Paid to</td>\r\n\t\t\t\t\t\t<td valign='center'><input size='20' name='name' value='{$name}'></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t<td>Details</td>\r\n\t\t\t\t\t\t<td valign='center'><textarea cols='18' rows='2' name='det'>{$det}</textarea></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t<td>Available Funds</td>\r\n\t\t\t\t\t\t<td><input type='hidden' name='bal' value='{$accb['bal']}'>" . CUR . " {$accb['bal']}</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t<td>Amount</td>\r\n\t\t\t\t\t\t<td valign='center'>" . CUR . " <input type='text' size='10' name='amount' value='{$amount}'></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t<td>VAT Inclusive</td>\r\n\t\t\t\t\t\t<td valign='center'>\r\n\t\t\t\t\t\t\tYes <input type='radio' size='7' name='chrgvat' value='inc' {$chin}>\r\n\t\t\t\t\t\t\tNo <input type='radio' size='7' name='chrgvat' value='exc' {$chex}>\r\n\t\t\t\t\t\t\tNo VAT <input type='radio' size='7' name='chrgvat' value='nov' {$chno}>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t<td>VAT Code</td>\r\n\t\t\t\t\t\t<td>{$Vatcodes}</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t<td>Account Paid to</td>\r\n\t\t\t\t\t\t<td>{$accnts}</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td><br></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td></td>\r\n\t\t\t\t\t\t<td valign='center' colspan='2' align='right'><input type='submit' value='Confirm »'></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 " . TMPL_tblDflts . " width='15%'>\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 class='" . bg_class() . "'>\r\n\t\t\t\t\t\t<td><a href='pettycashbook-view.php'>View Petty Cash Requisitions</a></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr class='" . bg_class() . "'>\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</table>";
return $add;
}
示例13: confirm_actions
function confirm_actions($_POST)
{
extract($_POST);
if (!isset($bankid)) {
return enter_actions($_POST);
}
if (!isset($next)) {
return enter_actions($_POST);
}
$bankid += 0;
db_conn('cubit');
$Sl = "SELECT * FROM bankacct WHERE bankid='{$bankid}'";
$Ri = db_exec($Sl) or errDie("unable to get data.");
if (pg_num_rows($Ri) < 1) {
return enter_actions($_POST);
}
$bd = pg_fetch_array($Ri);
/*
db_conn('core');
$Sl="SELECT accid FROM accounts WHERE accname='Bank Charges' AND div = '".USER_DIV."' AND acctype='E'";
$Rl=db_exec($Sl) or errDie("Unable to get account data.");
if(pg_numrows($Rl) > 0){
$ad=pg_fetch_array($Rl);
$bc=$ad['accid'];
} else {
$bc=0;
}
$Sl="SELECT accid FROM accounts WHERE accname='Interest Paid' AND div = '".USER_DIV."' AND acctype='E'";
$Rl=db_exec($Sl) or errDie("Unable to get account data.");
if(pg_numrows($Rl) > 0){
$ad=pg_fetch_array($Rl);
$ip=$ad['accid'];
} else {
$ip=0;
}
$Sl="SELECT accid FROM accounts WHERE accname='Travel Expenses' AND div = '".USER_DIV."' AND acctype='E'";
$Rl=db_exec($Sl) or errDie("Unable to get account data.");
if(pg_numrows($Rl) > 0){
$ad=pg_fetch_array($Rl);
$te=$ad['accid'];
} else {
$te=0;
}
*/
$i = 0;
db_conn('cubit');
$Sl = "SELECT * FROM statement_settings";
$Ri = db_exec($Sl) or errDie("Unable to get settings.");
$sd = pg_fetch_array($Ri);
if ($sd['ad'] == "num") {
$num = true;
$ord = "ORDER BY topacc,accnum";
} else {
$num = false;
$ord = "ORDER BY accname";
}
$Sl = "SELECT * FROM statement_data WHERE account='{$bankid}' ORDER BY date";
$Ri = db_exec($Sl) or errDie("unable to get data.");
$out = "\n\t\t<h3>Please select the action you want to take.({$bd['bankname']} - {$bd['accname']})</h3>\n\t\t<li class='err'>Please note: Payments are in red.</li>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t<form action='" . SELF . "' method='POST'>\n\t\t\t<input type='hidden' name='key' value='confirm_actions2'>\n\t\t\t<input type='hidden' name='bankid' value='{$bankid}'>\n\t\t\t<tr>\n\t\t\t\t<th>Date</th>\n\t\t\t\t<th>Amount</th>\n\t\t\t\t<th>Description</th>\n\t\t\t\t<th>From/To</th>\n\t\t\t\t<th>VAT Inc</th>\n\t\t\t\t<th>Vat Code</th>\n\t\t\t\t<th>Contra Account/Action</th>\n\t\t\t\t<th>Cheque</th>\n\t\t\t</tr>";
while ($data = pg_fetch_array($Ri)) {
$vatcode_drop = "<input type='hidden' name='vatcode[]' value=''>";
extract($data);
$vch = "";
if ($amount > 0) {
$trantype = "deposit";
} else {
$trantype = "withdrawal";
}
$pamount = sprint(abs($amount));
$cheqnum = $contra;
$cheqnum += 0;
$action = $actions[$id];
if ($action == "0") {
return enter_actions($_POST, "<li class='err'>Please Select An Option For All Accounts</li>");
}
if ($action == "c" || $action == "cr") {
if ($bank == "Standard Bank" && ($ex2 == "##" || $description == "OVERDRAFT LEDGER FEE")) {
$vch = "checked";
}
db_conn('core');
$Accounts = "\n\t\t\t\t<select name='accounts[{$id}]'>\n\t\t\t\t\t<option value='0'>Select Account</option>";
$Sl = "SELECT * FROM accounts WHERE div = '" . USER_DIV . "' {$ord}";
$Rl = db_exec($Sl) or errDie("Unable to get account data.");
if (pg_numrows($Rl) < 1) {
return "<li>There are No accounts in Cubit.</li>";
}
$hook = isrefa($description, $contra);
if ($hook == 0) {
$hook = isaref($pamount, $description, $contra, $trantype);
}
if (isset($accounts[$id])) {
$hook = $accounts[$id];
}
while ($acc = pg_fetch_array($Rl)) {
if (isDisabled($acc['accid'])) {
continue;
}
//.........这里部分代码省略.........
示例14: slctVatAcc
function slctVatAcc($_POST)
{
# Get vars
extract($_POST);
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($ctaccid, "num", 1, 50, "Invalid Account to be Credited.");
$v->isOk($dtaccid, "num", 1, 50, "Invalid Account to be Debited.");
$v->isOk($refnum, "num", 1, 10, "Invalid Reference number.");
$v->isOk($amount, "float", 1, 20, "Invalid Amount.");
$v->isOk($details, "string", 0, 255, "Invalid Details.");
$v->isOk($author, "string", 1, 30, "Invalid Authorising person name.");
$datea = explode("-", $date);
if (count($datea) == 3) {
if (!checkdate($datea[1], $datea[0], $datea[2])) {
$v->isOk($date, "num", 1, 1, "Invalid date.");
}
} else {
$v->isOk($date, "num", 1, 1, "Invalid date.");
}
# display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class='err'>" . $e["msg"] . "</li>";
}
return details($_POST, $confirm);
}
# account numbers
$dtaccRs = get("core", "*", "accounts", "accid", $dtaccid);
$dtacc = pg_fetch_array($dtaccRs);
$ctaccRs = get("core", "*", "accounts", "accid", $ctaccid);
$ctacc = pg_fetch_array($ctaccRs);
db_conn('core');
$vatacc = "<select name='vataccid'>";
$sql = "SELECT * FROM accounts WHERE div = '" . USER_DIV . "' ORDER BY accname ASC";
$accRslt = db_exec($sql);
if (pg_numrows($accRslt) < 1) {
return "<li>There are No accounts in Cubit.</li>";
}
while ($acc = pg_fetch_array($accRslt)) {
# Check Disable
if (isDisabled($acc['accid'])) {
continue;
}
$vatacc .= "<option value='{$acc['accid']}'>{$acc['topacc']}/{$acc['accnum']} - {$acc['accname']}</option>";
}
$vatacc .= "</select>";
db_conn('cubit');
if (!isset($vatcode)) {
$Sl = "SELECT * FROM vatcodes WHERE del='Yes'";
$Ri = db_exec($Sl) or errDie("Unable to get data.");
$vd = pg_fetch_array($Ri);
$vatcode = $vd['id'];
}
if (!isset($vatcode)) {
$vatcode = 0;
}
$Sl = "SELECT * FROM vatcodes ORDER BY code";
$Ri = db_exec($Sl) or errDie("Unable to get vat codes");
$Vatcodes = "<select name='vatcode'>";
while ($vd = pg_fetch_array($Ri)) {
if ($vd['id'] == $vatcode) {
$sel = "selected";
} else {
$sel = "";
}
$Vatcodes .= "<option value='{$vd['id']}' {$sel}>{$vd['code']}</option>";
}
$Vatcodes .= "</select>";
// Details
$slctacc = "\n\t\t<center>\n\t\t<h3> Record Recurring Transaction </h3>\n\t\t<h2>Select VAT Accounts</h2>\n\t\t<form action='" . SELF . "' method='POST' name='form'>\n\t\t\t<input type='hidden' name='key' value='confirm'>\n\t\t\t<input type='hidden' name='dtaccid' value='{$dtaccid}'>\n\t\t\t<input type='hidden' name='ctaccid' value='{$ctaccid}'>\n\t\t\t<input type='hidden' name='date' value='{$date}'>\n\t\t\t<input type='hidden' name='refnum' value='{$refnum}'>\n\t\t\t<input type='hidden' name='amount' value='{$amount}'>\n\t\t\t<input type='hidden' name='chrgvat' value='{$chrgvat}'>\n\t\t\t<input type='hidden' name='details' value='{$details}'>\n\t\t\t<input type='hidden' name='author' value='{$author}'>\n\t\t<table " . TMPL_tblDflts . " align='center'>\n\t\t\t<tr>\n\t\t\t\t<th>Option</th>\n\t\t\t\t<th>Value</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td valign='top'>VAT Deductable Account</td>\n\t\t\t\t<td><input type='radio' name='vatdedacc' value='{$dtaccid}' checked='yes'>{$dtacc['topacc']}/{$dtacc['accnum']} - {$dtacc['accname']}<br><input type='radio' name='vatdedacc' value='{$ctaccid}'>{$ctacc['topacc']}/{$ctacc['accnum']} - {$ctacc['accname']}</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>VAT Account</td>\n\t\t\t\t<td>{$vatacc}</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>VAT Inclusive </td>\n\t\t\t\t<td><input type='radio' size='20' name='vatinc' value='yes' checked='yes'>Yes(Amount Includes VAT) <input type='radio' size='20' name='vatinc' value='no'>No(Add VAT to Amount)</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>VAT Code</td>\n\t\t\t\t<td>{$Vatcodes}</td>\n\t\t\t</tr>\n\t\t\t<tr><td><br></td></tr>\n\t\t\t<tr>\n\t\t\t\t<td align='right'><input type='button' value='« Back' onClick='javascript:history.back()'></td>\n\t\t\t\t<td align='right'><input type='submit' value='Continue »'></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>\n\t\t<p>\n\t\t<table border=0 cellpadding='2' cellspacing='1' width=15%>\n\t\t\t<tr>\n\t\t\t\t<th>Quick Links</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td align='center'><a href='../reporting/index-reports.php'>Financials</a></td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td align='center'><a href='ledger-view.php'>View High Speed Input Ledgers</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td align='center'><a href='../main.php'>Main Menu</td>\n\t\t\t</tr>\n\t\t</table>";
return $slctacc;
}
示例15: add
//.........这里部分代码省略.........
$reference = $arr['reference'];
}
#########################################################################
######################[ Clear Vars ]########################
$accs_arr = explode("|", $arr['accids']);
$new_accs_arr = array();
foreach ($accs_arr as $temp) {
if (strlen($temp) > 0) {
$new_accs_arr[] = $temp;
}
}
$amounts_arr = explode("|", $arr['amounts']);
$new_amounts_arr = array();
foreach ($amounts_arr as $temp) {
if (strlen($temp) > 0) {
$new_amounts_arr[] = $temp;
}
}
$vatcodes_arr = explode("|", $arr['vatcodes']);
$new_vatcodes_arr = array();
foreach ($vatcodes_arr as $temp) {
if (strlen($temp) > 0) {
$new_vatcodes_arr[] = $temp;
}
}
$chrgvats_arr = explode("|", $arr['chrgvats']);
$new_chrgvats_arr = array();
foreach ($chrgvats_arr as $temp) {
if (strlen($temp) > 0) {
$new_chrgvats_arr[] = $temp;
}
}
###########################################################
# compose accounts list
$accounts = "";
for ($i = 0; $i < $lnum; $i++) {
switch ($new_chrgvats_arr[$i]) {
case "nov":
$chexc = "";
$chinc = "";
$chnov = "checked=yes";
break;
case "inc":
$chexc = "";
$chinc = "checked=yes";
$chnov = "";
break;
case "exc":
$chexc = "checked=yes";
$chinc = "";
$chnov = "";
break;
default:
$chexc = "";
$chinc = "";
$chnov = "checked=yes";
break;
}
# Accounts Drop down selections
core_connect();
$sql = "SELECT * FROM accounts WHERE div = '" . USER_DIV . "' ORDER BY accname ASC";
$accRslt = db_exec($sql);
if (pg_numrows($accRslt) < 1) {
$glacc = "<li>There are no Income accounts yet in Cubit.";
}
$glacc = "<select name='accinv[]' style='width: 167'>";
while ($acc = pg_fetch_array($accRslt)) {
# Check Disable
if (isDisabled($acc['accid'])) {
continue;
}
$sel = $acc['accid'] == $new_accs_arr[$i] ? "selected" : "";
$glacc .= "<option value='{$acc['accid']}' {$sel}>{$acc['accname']}</option>";
}
$glacc .= "</select>";
db_conn('cubit');
$Sl = "SELECT * FROM vatcodes ORDER BY code";
$Ri = db_exec($Sl) or errDie("cant get vat data.");
$vats = "<select name=vatcode[]>\n\t\t\t<option value='0'>Select VAT Code</option>";
// var_dump($new_vat_arr);
while ($vd = pg_fetch_array($Ri)) {
if ($vd['id'] == $new_vatcodes_arr[$i]) {
$sel = "selected";
} else {
$sel = "";
}
$vats .= "<option value='{$vd['id']}' {$sel}>{$vd['code']}</option>";
}
$vats .= "</select>";
$new_amounts_arr[$i] = sprint($new_amounts_arr[$i]);
$accounts .= "\n\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t<td>{$glacc}</td>\n\t\t\t\t\t\t<td align='center'>" . CUR . " <input type='text' size='8' name='accamt[]' value='{$new_amounts_arr[$i]}'></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type='radio' name='chrgvat[{$i}]' value='inc' {$chinc}>Inclusive \n\t\t\t\t\t\t\t<input type='radio' name='chrgvat[{$i}]' value='exc' {$chexc}>Exclusive \n\t\t\t\t\t\t\t<input type='radio' name='chrgvat[{$i}]' value='nov' {$chnov}>No VAT\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>{$vats}</td>\n\t\t\t\t\t</tr>";
}
if (!isset($errata)) {
$errata = "";
}
// $amount = sprint ($amount);
// Layout
$add = "\n\t\t\t<h3>New Bank Payment</h3>\n\t\t\t{$errata}\n\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<form action='" . SELF . "' method='POST' name='form'>\n\t\t\t\t<input type='hidden' name='key' value='confirm'>\n\t\t\t\t<input type='hidden' name='id' value='{$id}'>\n\t\t\t\t<input type='hidden' name='lnum' value='{$lnum}'>\n\t\t\t\t<input type='hidden' name='amount' value='{$amount}'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan='2'></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>Field</th>\n\t\t\t\t\t<th>Value</th>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Bank Account</td>\n\t\t\t\t\t<td>{$banks}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Date</td>\n\t\t\t\t\t<td>" . mkDateSelect("date", $date_year, $date_month, $date_day) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Paid to</td>\n\t\t\t\t\t<td valign='center'><input size='20' name='name' value='{$name}'></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Description</td>\n\t\t\t\t\t<td valign='center'><textarea col='20' rows='5' name='descript'>{$descript}</textarea></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Reference</td>\n\t\t\t\t\t<td valign='center'><input size='25' name='reference' value='{$reference}'></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Cheque Number</td>\n\t\t\t\t\t<td valign='center'><input size='20' name='cheqnum' value='{$cheqnum}'></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Amount</td>\n\t\t\t\t\t<td valign='center'>" . CUR . " {$amount}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr><td><br></td></tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td colspan='2'>Select Accounts Involved</td>\n\t\t\t\t<tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>Account</th>\n\t\t\t\t\t<th>Amount</th>\n\t\t\t\t\t<th>VAT</th>\n\t\t\t\t\t<th>VAT Code</th>\n\t\t\t\t</tr>\n\t\t\t\t{$accounts}\n\t\t\t\t<tr><td><br></td></tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><input type='submit' name='back' value='« Correction'></td>\n\t\t\t\t\t<td valign='center' align='right'><input type='submit' value='Confirm »'></td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<p>\n\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t<tr>\n\t\t\t\t\t<th>Quick Links</th>\n\t\t\t\t</tr>\n\t\t\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t\t\t</table>";
return $add;
}