本文整理汇总了PHP中errDie函数的典型用法代码示例。如果您正苦于以下问题:PHP errDie函数的具体用法?PHP errDie怎么用?PHP errDie使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了errDie函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: printInv
function printInv()
{
# Set up table to display in
$printCallout = "\r\n\t<h3>View Call Out Documents For Invoicing.</h3>\r\n\t<table border='0' cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t<tr><th>Department</th><th>Call Out Person</th><th>Job No.</th><th>Service Date</th><th>Customer Name</th><th colspan='6'>Options</th></tr>";
# connect to database
db_connect();
# Query server
$i = 0;
$sql = "SELECT * FROM callout_docs WHERE accepted != 'c' AND done = 'y' AND div = '" . USER_DIV . "' AND invoiced != 'yes' ORDER BY calloutid DESC";
$calloutRslt = db_exec($sql) or errDie("Unable to retrieve call out documents from database.");
if (pg_numrows($calloutRslt) < 1) {
$printCallout = "<li>No previous call out documents.";
} else {
while ($callout = pg_fetch_array($calloutRslt)) {
# format date
$callout['odate'] = explode("-", $callout['odate']);
$callout['odate'] = $callout['odate'][2] . "-" . $callout['odate'][1] . "-" . $callout['odate'][0];
#check if this doc has been uploaded
$get_doc = "SELECT * FROM callout_docs_scanned WHERE calloutid = '{$callout['calloutid']}' AND div = '" . USER_DIV . "'";
$run_doc = db_exec($get_doc) or errDie("Unable to get call out document information");
if (pg_numrows($run_doc) < 1) {
$uploaddoc = "<td colspan='2'><a href='callout-uploaddoc.php?calloutid={$callout['calloutid']}'>Upload Scanned Document</a></td>";
} else {
$uploaddoc = "<td><a href='callout-uploaddoc.php?calloutid={$callout['calloutid']}'>Change Uploaded Document</a></td><td><a href='images/callout-showdoc.php?calloutid={$callout['calloutid']}'>View Document</a></td>";
}
$printCallout .= "\r\n\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t<td>{$callout['deptname']}</td>\r\n\t\t\t\t\t<td>{$callout['calloutp']}</td>\r\n\t\t\t\t\t<td>{$callout['calloutid']}</td>\r\n\t\t\t\t\t<td align=center>{$callout['odate']}</td>\r\n\t\t\t\t\t<td>{$callout['cusname']} {$callout['surname']}</td>\r\n\t\t\t\t\t<td><a href='callout-new.php?calloutid={$callout['calloutid']}&cont=true&letters=&done='>Edit</a></td>\r\n\t\t\t\t\t<td><a href='callout-cancel.php?calloutid={$callout['calloutid']}'>Cancel</a></td>\r\n\t\t\t\t\t<td><a href='callout-print.php?calloutid={$callout['calloutid']}' target='_blank'>Print</a></td>\r\n\t\t\t\t\t{$uploaddoc}\r\n\t\t\t\t\t<td><a href='callout-invoiced.php?calloutid={$callout['calloutid']}'>Complete (Invoiced)</a></td>\r\n\t\t\t\t</tr>";
$i++;
}
}
// Layout
$printCallout .= "\r\n\t\t\t</table>\r\n\t\t\t<p>\r\n\t\t\t<table border='0' cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t\t\t\t<tr><td><br></td></tr>\r\n\t\t\t\t<tr><th>Quick Links</th></tr>\r\n\t\t\t\t<tr class='datacell'><td align='center'><a href='cust-credit-stockinv.php'>New Invoice</a></td></tr>\r\n\t\t\t\t<tr class='datacell'><td align='center'><a href='callout-new.php'>New Call Out Document</td></tr>\r\n\t\t\t\t<tr class='datacell'><td align='center'><a href='main.php'>Main Menu</td></tr>\r\n\t\t\t</table>";
return $printCallout;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:33,代码来源:callout-view.php
示例2: printGrp
function printGrp()
{
# Set up table to display in
$printGrp = "\r\n <h3>Asset Groups</h3>\r\n <table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n <tr><th>Group</th><th>Cost Account</th><th>Accumulated Depreciation Account</th><th>Depreciation Account</th><th colspan=2>Options</th></tr>";
# connect to database
db_connect();
# Query server
$i = 0;
$sql = "SELECT * FROM assetgrp WHERE div = '" . USER_DIV . "' ORDER BY grpname ASC";
$GrpRslt = db_exec($sql) or errDie("Unable to retrieve Asset Groups from database.");
if (pg_numrows($GrpRslt) < 1) {
return "\r\n\t\t\t\t<li> There are no Assets Groups in Cubit.</li><br>" . mkQuickLinks(ql("assetgrp-new.php", "Add Asset Group"), ql("assetgrp-view.php", "View Asset Groups"));
}
while ($Grp = pg_fetch_array($GrpRslt)) {
# get ledger account name(cost)
core_connect();
$sql = "SELECT accname FROM accounts WHERE accid = '{$Grp['costacc']}' AND div = '" . USER_DIV . "'";
$accRslt = db_exec($sql);
$acccost = pg_fetch_array($accRslt);
# get ledger account name(accum dep)
$sql = "SELECT accname FROM accounts WHERE accid = '{$Grp['accdacc']}' AND div = '" . USER_DIV . "'";
$accRslt = db_exec($sql);
$acdacc = pg_fetch_array($accRslt);
# get ledger account name(dep)
$sql = "SELECT accname FROM accounts WHERE accid = '{$Grp['depacc']}' AND div = '" . USER_DIV . "'";
$accRslt = db_exec($sql);
$accdep = pg_fetch_array($accRslt);
# alternate bgcolor
$printGrp .= "<tr class='" . bg_class() . "'><td>{$Grp['grpname']}</td><td>{$acccost['accname']}</td><td>{$acdacc['accname']}</td><td>{$accdep['accname']}</td><td><a href='assetgrp-edit.php?grpid={$Grp['grpid']}'>Edit</a></td>";
$printGrp .= "<td><a href='assetgrp-rem.php?grpid={$Grp['grpid']}'>Remove</a></td></tr>";
$i++;
}
$printGrp .= "</table>\r\n <p>\r\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=15%>\r\n <tr><td><br></td></tr>\r\n <tr><th>Quick Links</th></tr>\r\n\t\t<tr class='bg-odd'><td><a href='assetgrp-new.php'>Add Asset Group</a></td></tr>\r\n\t\t<script>document.write(getQuicklinkSpecial());</script>\r\n\t</table>";
return $printGrp;
}
开发者ID:kumarsivarajan,项目名称:accounting-123,代码行数:35,代码来源:assetgrp-view.php
示例3: slctacc
function slctacc()
{
# from period
$prds = "<select name=prd>";
db_conn(YR_DB);
$sql = "SELECT * FROM info WHERE prdname !=''";
$prdRslt = db_exec($sql);
if (pg_numrows($prdRslt) < 1) {
return "<li class=err>ERROR : There are no periods set for the current year";
}
while ($prd = pg_fetch_array($prdRslt)) {
if ($prd['prddb'] == PRD_DB) {
$sel = "selected";
} else {
$sel = "";
}
$prds .= "<option value='{$prd['prddb']}' {$sel}>{$prd['prdname']}</option>";
}
$prds .= "</select>";
db_connect();
$sql = "SELECT * FROM customers WHERE div = '" . USER_DIV . "' ORDER BY cusnum ASC";
$cusRslt = db_exec($sql) or errDie("Could not retrieve Customers Information from the Database.", SELF);
if (pg_numrows($cusRslt) < 1) {
return "<li class=err> There are no Customers in Cubit.";
}
$custs = "<select name=cusnums[] multiple size=10>";
while ($cus = pg_fetch_array($cusRslt)) {
$custs .= "<option value='{$cus['cusnum']}'>{$cus['cusname']} {$cus['surname']}</option>";
}
$custs .= "</select>";
$slctacc = "\n\t<p>\n\t<h3>Debtors Ledger</h3>\n\t<h4>Select Options</h4>\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n\t<form action='" . SELF . "' method=post>\n\t<input type=hidden name=key value=viewtran>\n\t<tr><th>Field</th><th>Value</th></tr>\n\t<tr class='bg-even'><td valign=top>Customers</td><td><input type=radio name=accnt value=slct checked=yes>Selected Accounts | <input type=radio name=accnt value=all>All Accounts</td></tr>\n\t<tr class='bg-odd'><td valign=top>Select Customer(s)</td><td>{$custs}</td></tr>\n\t<tr class='bg-even'><td>Select period</td><td>{$prds}</td></tr>\n\t<tr class='bg-odd'><td>Order By</td><td>Transaction Date<input type=radio name=t checked value='t'>System Date<input type=radio name=t value='s'></td></tr>\n\t<tr><td><br></td></tr>\n\t<tr><td></td><td align=right><input type=submit value='Continue »'></td></tr>\n\t</table>\n\t<p>\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=25%>\n\t\t<tr><td><br></td></tr>\n\t\t<tr><th>Quick Links</th></tr>\n\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t</table>";
return $slctacc;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:33,代码来源:cust-ledger-xls.php
示例4: stock_is_blocked
function stock_is_blocked($stkid)
{
$sql = "SELECT blocked FROM cubit.stock WHERE stkid='{$stkid}'";
$stock_rslt = db_exec($sql) or errDie("Unable to check if stock is blocked.");
$blocked = pg_fetch_result($stock_rslt, 0);
return $blocked;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:7,代码来源:stock.lib.php
示例5: 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
示例6: display
function display()
{
extract($_REQUEST);
$fields = array();
$fields["from_year"] = date("Y");
$fields["from_month"] = date("m");
$fields["from_day"] = "01";
$fields["to_year"] = date("Y");
$fields["to_month"] = date("m");
$fields["to_day"] = date("d");
extract($fields, EXTR_SKIP);
$from_date = "{$from_year}-{$from_month}-{$from_day}";
$to_date = "{$to_year}-{$to_month}-{$to_day}";
$sql = "SELECT assets.id, assets.des AS asset_des, asset_svdates.svdate,\r\n\t\t\t\tasset_svdates.des AS sv_des\r\n\t\t\tFROM cubit.asset_svdates\r\n\t\t\t\tLEFT JOIN cubit.assets\r\n\t\t\t\t\tON asset_svdates.asset_id=assets.id\r\n\t\t\tWHERE asset_svdates.svdate BETWEEN '{$from_date}' AND '{$to_date}'";
$sv_rslt = db_exec($sql) or errDie("Unable to retrieve asset services.");
$service_out = "";
while ($sv_data = pg_fetch_array($sv_rslt)) {
if (empty($sv_data["id"])) {
continue;
}
$service_out .= "\r\n\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t<td>{$sv_data['asset_des']}</td>\r\n\t\t\t<td>" . getSerial($sv_data["id"]) . "</td>\r\n\t\t\t<td>{$sv_data['sv_des']}</td>\r\n\t\t\t<td>{$sv_data['svdate']}</td>\r\n\t\t</tr>";
}
if (empty($service_out)) {
$service_out = "<tr class='" . bg_class() . "'>\r\n\t\t\t<td colspan='4'><li>No results found</li></td>\r\n\t\t</tr>";
}
$OUTPUT = "<center>\r\n\t<h3>Service Report</h3>\r\n\t<form method='post' action='" . SELF . "'>\r\n\t<table " . TMPL_tblDflts . ">\r\n\t\t<tr>\r\n\t\t\t<th colspan='4'>Date Range</th>\r\n\t\t</tr>\r\n\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t<td>" . mkDateSelect("from", $from_year, $from_month, $from_day) . "</td>\r\n\t\t\t<td> <b>To</b> </td>\r\n\t\t\t<td>" . mkDateSelect("to", $to_year, $to_month, $to_day) . "</td>\r\n\t\t\t<td>\r\n\t\t\t\t<input type='submit' value='Select' style='font-weight: bold' />\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t</table>\r\n\t</form>\r\n\t<table " . TMPL_tblDflts . ">\r\n\t\t<tr>\r\n\t\t\t<th>Asset</th>\r\n\t\t\t<th>Serial</th>\r\n\t\t\t<th>Service Description</th>\r\n\t\t\t<th>Service Date</th>\r\n\t\t</tr>\r\n\t\t{$service_out}\r\n\t</table>";
return $OUTPUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:28,代码来源:service_report.php
示例7: confirm
function confirm($catid)
{
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($catid, "num", 1, 50, "Invalid stock category id.");
# display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class=err>-" . $e["msg"] . "<br>";
}
return $confirm;
}
# Select Stock
db_connect();
$sql = "SELECT * FROM stockcat WHERE catid = '{$catid}' AND div = '" . USER_DIV . "'";
$catRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
if (pg_numrows($catRslt) < 1) {
return "<li> Invalid Stock ID.";
} else {
$cat = pg_fetch_array($catRslt);
}
# get stock vars
foreach ($cat as $key => $value) {
${$key} = $value;
}
// Layout
$confirm = "<h3>Stock Category</h3>\n\t\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n\t\t\t<tr><th width=40%>Field</th><th width=60%>Value</th></tr>\n\t\t\t<tr class='bg-odd'><td>Category Code</td><td>{$catcod}</td></tr>\n\t\t\t<tr class='bg-even'><td>Category Name</td></td><td>{$cat}</td></tr>\n\t\t\t<tr class='bg-odd'><td valign=top>Description</td><td><pre>{$descript}</pre></td></tr>\n\t\t</table>\n\t\t<p>\n\t\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=100>\n\t\t\t<tr><th>Quick Links</th></tr>\n\t\t\t<tr class='bg-odd'><td><a href='stockcat-edit.php?catid={$catid}'>Edit</a></td></tr>\n\t\t\t<tr class='bg-even'><td><a href='stockcat-view.php'>View Stock Category</a></td></tr>\n\t\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t\t</table>";
return $confirm;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:32,代码来源:stockcat-det.php
示例8: printDep
function printDep()
{
# Set up table to display in
$printDep = "\n\t\t<h3>View Employee Departments</h3>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Department</th>\n\t\t\t\t<th colspan='2'>Options</th>\n\t\t\t</tr>";
# connect to database
db_connect();
# Query server
$i = 0;
$sql = "SELECT * FROM departments ORDER BY department ASC";
$depRslt = db_exec($sql) or errDie("Unable to retrieve employee departments from database.");
if (pg_numrows($depRslt) < 1) {
return "<li>There are no employee departments in Cubit.</li>";
}
while ($dep = pg_fetch_array($depRslt)) {
$printDep .= "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td align='center'>{$dep['department']}</td>\n\t\t\t\t<td><a href='empdepartment-edit.php?id={$dep['id']}'>Edit</a></td>";
$sql = "SELECT * FROM employees WHERE department='{$dep['id']}'";
$depRslt = db_exec($sql) or ereDie("Unable to retrieve employee departments from database.");
if (pg_numrows($depRslt) < 1) {
$printDep .= "<td><a href='empdepartment-rem.php?id={$dep['id']}'>Remove</a></td></tr>";
} else {
$printDep .= "</tr>";
}
$i++;
}
$printDep .= "\n\t\t</table>\n\t\t<p>\n\t\t<table " . TMPL_tblDflts . " 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='" . bg_class() . "'>\n\t\t\t\t<td><a href='empdepartment-add.php'>Add Employee Department</a></td>\n\t\t\t</tr>\n\t\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t\t</table>";
return $printDep;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:27,代码来源:empdepartment-view.php
示例9: show_branches
function show_branches($active_search = FALSE)
{
db_connect();
$get_branches = "SELECT * FROM branches_data ORDER BY branch_name";
$run_branches = db_exec($get_branches) or errDie("Unable to get branch information.");
if (pg_numrows($run_branches) < 1) {
$listing = "\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td colspan='7'>No Branches Found.</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t";
} else {
$listing = "";
while ($barr = pg_fetch_array($run_branches)) {
if ($active_search == FALSE) {
$status = "Unknown";
} else {
if ($connect_test = @fsockopen("{$barr['branch_ip']}", 80, $errno, $errstr, 4)) {
#online ...
$status = "Online";
} else {
$status = "Offline";
}
}
$get_username = "SELECT username FROM users WHERE userid = '{$barr['branch_localuser']}' LIMIT 1";
$run_username = db_exec($get_username) or errDie("Unable to get user information.");
if (pg_numrows($run_username) < 1) {
}
$listing .= "\n\t\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t\t<td>{$barr['branch_name']}</td>\n\t\t\t\t\t\t\t\t<td>" . nl2br($barr['branch_desc']) . "</td>\n\t\t\t\t\t\t\t\t<td>{$barr['branch_username']}</td>\n\t\t\t\t\t\t\t\t<td>{$barr['branch_contact']}</td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td>{$barr['branch_ip']}</td>\n\t\t\t\t\t\t\t\t<td>{$status}</td>\n\t\t\t\t\t\t\t\t<td><a href='branches-rem.php?bid={$barr['id']}'>Remove</a></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t";
}
}
$display = "\n\t\t\t\t\t<h3>Current Branches on Cubit</h3>\n\t\t\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t\t<form action='" . SELF . "' method='POST'>\n\t\t\t\t\t\t<input type='hidden' name='key' value='confirm'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>Branch Name</th>\n\t\t\t\t\t\t\t<th>Branch Description</th>\n\t\t\t\t\t\t\t<th>Branch Username</th>\n\t\t\t\t\t\t\t<th>Branch Contact</th>\n\t\t\t\t\t\t\t<th>Local Username</th>\n\t\t\t\t\t\t\t<th>Branch IP</th>\n\t\t\t\t\t\t\t<th>Status</th>\n\t\t\t\t\t\t\t<th>Remove</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t{$listing}\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><input type='submit' value='Update Status'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</form>\n\t\t\t\t\t</table>\n\t\t\t\t";
return $display;
}
开发者ID:kumarsivarajan,项目名称:accounting-123,代码行数:30,代码来源:branches-view.php
示例10: printcheq
function printcheq()
{
// Set up table to display in
$OUTPUT = "<h3>View Cheque Records</h3>\r\n <table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n <form action='../bank/bank-bankall.php' method=post>\r\n <tr><th>Bank Name</th><th>Account Name</th><th>Date</th><th>Paid to/Received from</th><th>Description</th><th>Transaction Type</th><th>Amount</th><th>Account paid<br>/received from</th></tr>";
// Connect to database
db_Connect();
$sql = "SELECT * FROM cashbook WHERE cheqnum > 0 and banked='no' AND div = '" . USER_DIV . "' ORDER BY date DESC";
$accntRslt = db_exec($sql) or errDie("ERROR: Unable to retrieve bank cheqque transaction details from database.", SELF);
$numrows = pg_numrows($accntRslt);
if ($numrows < 1) {
$OUTPUT = "<li class=err> There are no outstanding bank cheque Records yet in Cubit.";
require "../template.php";
}
# display all bank cheques
for ($i = 0; $i < $numrows; $i++) {
$accnt = pg_fetch_array($accntRslt, $i);
# get account name for account involved
$accRslt = get("core", "accname", "accounts", "accid", $accnt['accinv']);
$acc = pg_fetch_array($accRslt);
# get account name for bank account
db_connect();
$sql = "SELECT accname,bankname FROM bankacct WHERE bankid= '{$accnt['bankid']}' AND div = '" . USER_DIV . "'";
$bankRslt = db_exec($sql);
$bank = pg_fetch_array($bankRslt);
$OUTPUT .= "<tr class='" . bg_class() . "'><td>{$bank['bankname']}</td><td align=center>{$bank['accname']}</td><td align=center>{$accnt['date']}</td><td align=center>{$accnt['name']}</td><td>{$accnt['descript']}</td><td align=center>{$accnt['trantype']}</td><td align=center>" . CUR . " {$accnt['amount']}<td align=center>{$acc['accname']}</td></td>";
if ($accnt['banked'] == "no") {
$OUTPUT .= "<td><input type=checkbox name='bank[]' value='{$accnt['cashid']}'> <a href='../bank/bank-bank.php?cashid={$accnt['cashid']}'>Bank</td><td><a href='../bank/cheq-cancel.php?cashid={$accnt['cashid']}'>Cancel</td></tr>";
} else {
$OUTPUT .= "</tr>";
}
}
$OUTPUT .= "<tr><td colspan=8><br></td><td colspan=2><input type=submit value='Bank all selected'></td></tr></form></table>";
// all template to display the info and die
require "../template.php";
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:35,代码来源:out-cheq.php
示例11: archive
function archive($_GET)
{
extract($_GET);
$id += 0;
db_conn('crm');
$Sl = "SELECT * FROM crms WHERE userid='" . USER_ID . "'";
$Ri = db_exec($Sl) or errDie("Unable to get data from system.");
if (pg_num_rows($Ri) < 1) {
return "Invalid.";
}
$crmdata = pg_fetch_array($Ri);
$teams = explode("|", $crmdata['teams']);
$Sl = "SELECT * FROM tokens WHERE id='{$id}'";
$Ri = db_exec($Sl) or errDie("Unable to get query.");
if (pg_num_rows($Ri) < 1) {
return "Invalid query.";
}
$tokendata = pg_fetch_array($Ri);
if (!in_array($tokendata['teamid'], $teams)) {
return "Declined.";
}
$Sl = "SELECT * FROM token_actions WHERE token='{$id}'";
$Ri = db_exec($Sl) or errDie("Unable to get actions from db.");
while ($data = pg_fetch_array($Ri)) {
$Sl = "INSERT INTO archived_actions (token,action,donedate,donetime,doneby,donebyid)\r\n\t\tVALUES ('{$id}','{$data['action']}','{$data['donedate']}','{$data['donetime']}','{$data['doneby']}','{$data['donebyid']}')";
$Ro = db_exec($Sl) or errDie("Unable to archive action.");
}
$Sl = "DELETE FROM token_actions WHERE token='{$id}'";
$Rl = db_exec($Sl) or errDie("Unable to delete actions.");
$OUTPUT = "<script> window.opener.parent.mainframe.location.reload(); window.close(); </script>";
return $OUTPUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:32,代码来源:tokens-action-archive.php
示例12: display
function display()
{
extract($_REQUEST);
$fields = array();
$fields["from_year"] = date("Y");
$fields["from_month"] = date("m");
$fields["from_day"] = "01";
$fields["to_year"] = date("Y");
$fields["to_month"] = date("m");
$fields["to_day"] = date("d");
extract($fields, EXTR_SKIP);
$from_date = "{$from_year}-{$from_month}-{$from_day}";
$to_date = "{$to_year}-{$to_month}-{$to_day}";
$sql = "SELECT invid, invnum, customers.surname, hire_invid,\r\n\t\t\t\textract('epoch' FROM reprint_invoices.odate) AS e_date\r\n\t\t\t\tFROM hire.reprint_invoices\r\n\t\t\t\t\tLEFT JOIN cubit.customers\r\n\t\t\t\t\t\tON reprint_invoices.cusnum=customers.cusnum\r\n\t\t\tWHERE reprint_invoices.odate BETWEEN '{$from_date}' AND '{$to_date}'\r\n\t\t\tORDER BY invnum DESC";
$reprint_rslt = db_exec($sql) or errDie("Unable to retrieve reprints.");
$reprint_out = "";
while ($reprint_data = pg_fetch_array($reprint_rslt)) {
if (!$reprint_data["invnum"]) {
continue;
}
$reprint_out .= "<tr class='" . bg_class() . "'>\r\n\t\t\t<td>H{$reprint_data['invnum']}" . rrev($reprint_data["invid"]) . "</td>\r\n\t\t\t<td>{$reprint_data['surname']}</td>\r\n\t\t\t<td>" . date("d-m-Y", $reprint_data["e_date"]) . "</td>\r\n\t\t\t<td>\r\n\t\t\t\t<a href='javascript:printer" . "(\"hire/hire_note_reprint.php?invid={$reprint_data['invid']}\")'>\r\n\t\t\t\t\tReprint\r\n\t\t\t\t</a>\r\n\t\t\t</td>\r\n\t\t</tr>";
}
if (empty($reprint_out)) {
$reprint_out = "\r\n\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t<td colspan='4'><li>No results found.</li></td>\r\n\t\t</tr>";
}
$OUTPUT = "<center>\r\n\t<h3>View Hire Note Reprints</h3>\r\n\t<form method='post' action='" . SELF . "'>\r\n\t<table " . TMPL_tblDflts . ">\r\n\t\t<tr><th colspan='4'>Date Range</th></tr>\r\n\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t<td>" . mkDateSelect("from", $from_year, $from_month, $from_day) . "</td>\r\n\t\t\t<td> <b>To</b> </td>\r\n\t\t\t<td>" . mkDateSelect("to", $to_year, $to_month, $to_day) . "</td>\r\n\t\t\t<td>\r\n\t\t\t\t<input type='submit' value='Select' style='font-weight: bold' />\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t</table>\r\n\t</form>\r\n\t<table " . TMPL_tblDflts . ">\r\n\t\t<tr>\r\n\t\t\t<th>Hire No</th>\r\n\t\t\t<th>Customer</th>\r\n\t\t\t<th>Date</th>\r\n\t\t\t<th>Reprint</th>\r\n\t\t</tr>\r\n\t\t{$reprint_out}\r\n\t</table>";
return $OUTPUT;
}
开发者ID:kumarsivarajan,项目名称:accounting-123,代码行数:28,代码来源:hire_view_reprint.php
示例13: update
function update()
{
extract($_REQUEST);
pglib_transaction("BEGIN");
if (isset($rem)) {
foreach ($rem as $type_id => $accid) {
$sql = "DELETE FROM cubit.ratio_account_owners\n\t\t\t\t\tWHERE type_id='{$type_id}' AND accid='{$accid}'";
db_exec($sql) or errDie("Unable to remove entries.");
}
}
if (isset($account)) {
foreach ($account as $type_id => $accid) {
if ($accid) {
$sql = "SELECT id FROM cubit.ratio_account_owners\n\t\t\t\t\t\tWHERE type_id='{$type_id}' AND accid='{$accid}'";
$own_rslt = db_exec($sql) or errDie("Unable to retrieve owners.");
if (!pg_num_rows($own_rslt)) {
$sql = "INSERT INTO cubit.ratio_account_owners (type_id, accid)\n\t\t\t\t\t\t\tVALUES ('{$type_id}', '{$accid}')";
db_exec($sql) or errDie("Unable to add new entries.");
}
}
}
}
pglib_transaction("COMMIT");
return display();
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:25,代码来源:ratio_settings.php
示例14: display
function display()
{
extract($_REQUEST);
$fields = array();
$fields["from_year"] = date("Y");
$fields["from_month"] = date("m");
$fields["from_day"] = date("d");
$fields["to_year"] = date("Y");
$fields["to_month"] = date("m");
$fields["to_day"] = date("d");
extract($fields, EXTR_SKIP);
$from_date = dateFmt($from_year, $from_month, $from_day);
$to_date = dateFmt($to_year, $to_month, $to_day);
// Retrieve hires
$sql = "\r\n\tSELECT *,\r\n\t\t(SELECT username FROM cubit.users WHERE userid=user_id) AS username,\r\n\t\t(SELECT surname FROM cubit.customers WHERE cusnum=cust_id) AS surname,\r\n\t\t(SELECT cusname FROM cubit.customers WHERE cusnum=cust_id) AS cusname,\r\n\t\t(SELECT EXTRACT('EPOCH' FROM from_time)) AS e_from,\r\n\t\t(SELECT EXTRACT('EPOCH' FROM to_time)) AS e_to\r\n\tFROM hire.hires\r\n\tWHERE from_time BETWEEN '{$from_date} 00:00:00' AND '{$to_date} 23:59:59' OR\r\n\t\tto_time BETWEEN '{$from_date} 00:00:00' AND '{$to_date} 23:59:59'\r\n\tORDER BY e_from ASC";
$hire_rslt = db_exec($sql) or errDie("Unable to retrieve hires.");
$hire_out = "";
while ($hire_data = pg_fetch_array($hire_rslt)) {
$time = date("d-m-Y G:i:s", $hire_data["e_from"]);
$hire_out .= "<tr class='" . bg_class() . "'>\r\n\t\t\t<td>{$time}</td>\r\n\t\t\t<td>{$hire_data['inv_id']}</td>\r\n\t\t\t<td>{$hire_data['username']}</td>\r\n\t\t\t<td>\r\n\t\t\t\t<a href='../cust-det.php?cusnum={$hire_data['cust_id']}'>\r\n\t\t\t\t\t{$hire_data['cusname']} {$hire_data['surname']}\r\n\t\t\t\t</a>\r\n\t\t\t</td>\r\n\t\t</tr>";
}
if (empty($hire_out)) {
$hire_out = "<tr class='" . bg_class() . "'>\r\n\t\t\t<td colspan='4'><li>No items found for this date range</li></td>\r\n\t\t</tr>";
}
if (empty($invoice_out)) {
$invoice_out = "<tr class='" . bg_class() . "'>\r\n\t\t\t<td colspan='4'><li>No items found for this date range</li></td>\r\n\t\t</tr>";
}
$OUTPUT = "<center>\r\n\t<h3>Daily Report</h3>\r\n\t<form method='post' action='" . SELF . "'>\r\n\t<table " . TMPL_tblDflts . ">\r\n\t\t<tr>\r\n\t\t\t<th colspan='4'>Date Range</th>\r\n\t\t</tr>\r\n\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t<td>" . mkDateSelect("from", $from_year, $from_month, $from_day) . "</td>\r\n\t\t\t<td><b> To </b></td>\r\n\t\t\t<td>" . mkDateSelect("to", $to_year, $to_month, $to_day) . "</td>\r\n\t\t\t<td><input type='submit' value='Select' /></td>\r\n\t\t</tr>\r\n\t</table>\r\n\t</form>\r\n\t<p></p>\r\n\t<table " . TMPL_tblDflts . ">\r\n\t\t<tr>\r\n\t\t\t<th colspan='4' style='font-size: 16px'>HIRES</th>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<th>Time</th>\r\n\t\t\t<th>Invoice No</th>\r\n\t\t\t<th>Sales Person</th>\r\n\t\t\t<th>Customer</th>\r\n\t\t</tr>\r\n\t\t{$hire_out}\r\n\t\t<tr>\r\n\t\t\t<th colspan='4' style='font-size: 16px'>INVOICES</th>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<th>Time</th>\r\n\t\t\t<th>Invoice No</th>\r\n\t\t\t<th>Sales Person</th>\r\n\t\t\t<th>Customer</th>\r\n\t\t</tr>\r\n\t\t{$invoice_out}\r\n\t</table>\r\n\t</center>";
return $OUTPUT;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:30,代码来源:daily_report.php
示例15: show_image
function show_image($_POST)
{
extract($_POST);
if (!isset($picid)) {
return "";
}
db_connect();
$get_img = "SELECT type,ident_id FROM display_images WHERE id = '{$picid}' LIMIT 1";
$run_img = db_exec($get_img) or errDie("Unable to get image information.");
if (pg_numrows($run_img) < 1) {
#image not found ??
$previous = "";
$next = "";
} else {
$arr = pg_fetch_array($run_img);
$previous = "";
$next = "";
#check for any additional images for this member
#get prev button
$get_other = "SELECT id FROM display_images WHERE type = '{$arr['type']}' AND ident_id = '{$arr['ident_id']}' AND id < '{$picid}' ORDER BY id desc LIMIT 1";
$run_other = db_exec($get_other) or errDie("Unable to get images information.");
if (pg_numrows($run_other) > 0) {
$previous = "<input type='button' onCLick=\"document.location='view_image.php?picid=" . pg_fetch_result($run_other, 0, 0) . "'\" value='Previous'>";
}
$get_other = "SELECT id FROM display_images WHERE type = '{$arr['type']}' AND ident_id = '{$arr['ident_id']}' AND id > '{$picid}' LIMIT 1";
$run_other = db_exec($get_other) or errDie("Unable to get images information.");
if (pg_numrows($run_other) > 0) {
$next = "<input type='button' onCLick=\"document.location='view_image.php?picid=" . pg_fetch_result($run_other, 0, 0) . "'\" value='Next'>";
}
}
$buttons = "<tr height='20%' valign='bottom'><td width='40%' align='right'>{$previous}</td><td>{$next}</td></tr>";
$display = "\n\t\t\t\t\t<table " . TMPL_tblDflts . " height='95%' width='100%'>\n\t\t\t\t\t\t<tr height='80%'>\n\t\t\t\t\t\t\t<td colspan='2'><img src='show_dimg.php?picid={$picid}' width='160' height='185' border='1'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t{$buttons}\n\t\t\t\t\t</table>\n\t\t\t\t";
return $display;
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:34,代码来源:view_image.php
示例16: bal
function bal($id)
{
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($id, "num", 1, 20, "Invalid Trial Balance number.");
# display errors, if any
if ($v->isError()) {
$theseErrors = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$theseErrors .= "<li class=err>" . $e["msg"];
}
$theseErrors .= "<p><input type=button onClick='JavaScript:history.back();' value='« Correct submission'>";
return $theseErrors;
}
# connect to core DB
core_connect();
# get the Trial Balance
$sql = "SELECT * FROM save_trial_bal WHERE id = '{$id}' AND div = '" . USER_DIV . "'";
$balRslt = db_exec($sql) or errDie("Unable to retrieve Trial Balance from the Database", SELF);
if (pg_numrows($balRslt) < 1) {
return "<center><li> Invalid Trial Balance Number.";
}
$bal = pg_fetch_array($balRslt);
$balance = base64_decode($bal['output']);
$OUTPUT = $balance;
include "temp.xls.php";
Stream("TB", $OUTPUT);
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:30,代码来源:tb-xls.php
示例17: remove
function remove($_POST)
{
extract($_POST);
$id += 0;
db_conn('crm');
$Sl = "SELECT * FROM tokens WHERE id='{$id}'";
$Ry = db_exec($Sl) or errDie("Unable to get data from system.");
if (pg_numrows($Ry) < 1) {
return "Invalid query.";
}
$data = pg_fetch_array($Ry);
$Sl = "SELECT * FROM token_actions WHERE token='{$id}'";
$Rs = db_exec($Sl) or errDie("Unable to get data from system.");
$Sl = "SELECT * FROM archived_actions WHERE token='{$id}'";
$Ri = db_exec($Sl) or errDie("Unable to get data from system.");
$Sl = "INSERT INTO closedtokens (tid,userid,username,teamid,cat,catid,openby,opendate,lastdate,csct,csc,name,accnum,\r\n\tcon,tel,cell,fax,email,address,sub,notes,closedate,closeby,closebyid)\r\n\tVALUES ('{$id}','{$data['userid']}','{$data['username']}','{$data['teamid']}','{$data['cat']}','{$data['catid']}','{$data['openby']}',\r\n\t'{$data['opendate']}','{$data['lastdate']}','{$data['csct']}','{$data['csc']}','{$data['name']}','{$data['accnum']}','{$data['con']}',\r\n\t'{$data['tel']}','{$data['cell']}','{$data['fax']}','{$data['email']}','{$data['address']}','{$data['sub']}','{$data['notes']}',\r\n\t'" . date("Y-m-d") . "','" . USER_NAME . "','" . USER_ID . "')";
$Ry = db_exec($Sl) or errDie("Unable to insert query record.");
while ($adata = pg_fetch_array($Rs)) {
$Sl = "INSERT INTO closed_token_actions (token,action,donedate,donetime,doneby,donebyid)\r\n\t\tVALUES ('{$id}','{$adata['action']}','{$adata['donedate']}','{$adata['donetime']}','{$adata['doneby']}','{$adata['donebyid']}')";
$Ry = db_exec($Sl) or errDie(
|
请发表评论