本文整理汇总了PHP中require_lib函数的典型用法代码示例。如果您正苦于以下问题:PHP require_lib函数的具体用法?PHP require_lib怎么用?PHP require_lib使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了require_lib函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printStk
function printStk($_POST)
{
# get vars
foreach ($_POST as $key => $value) {
${$key} = $value;
}
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($fday, "num", 1, 2, "Invalid from Date day.");
$v->isOk($fmon, "num", 1, 2, "Invalid from Date month.");
$v->isOk($fyear, "num", 1, 4, "Invalid from Date Year.");
$v->isOk($today, "num", 1, 2, "Invalid to Date day.");
$v->isOk($tomon, "num", 1, 2, "Invalid to Date month.");
$v->isOk($toyear, "num", 1, 4, "Invalid to Date Year.");
# mix dates
$fromdate = $fyear . "-" . $fmon . "-" . $fday;
$todate = $toyear . "-" . $tomon . "-" . $today;
if (!checkdate($fmon, $fday, $fyear)) {
$v->isOk($fromdate, "num", 1, 1, "Invalid from date.");
}
if (!checkdate($tomon, $today, $toyear)) {
$v->isOk($todate, "num", 1, 1, "Invalid to date.");
}
# display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class=err>-" . $e["msg"] . "<br>";
}
return $confirm;
}
# connect to database
db_connect();
// Layout
$report = "\n\t<h3>Non-Stock Sales Report</h3>\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n <tr><th>Invoice no.</th><th>Date</th><th>Vat</th><th>SubTotal</th><th>Total</th></tr>";
# Get all relevant records
db_connect();
$sql = "SELECT * FROM salesrec WHERE edate >= '{$fromdate}' AND edate <= '{$todate}' AND typ = 'non' AND div = '" . USER_DIV . "'";
$recRslt = db_exec($sql) or errDie("Unable to access databse.", SELF);
$i = 0;
$tot = 0;
$totvat = 0;
$totexc = 0;
while ($rec = pg_fetch_array($recRslt)) {
# Calculate profit
$tot += $rec['total'];
$totvat += $rec['vat'];
$excvat = sprint($rec['total'] - $rec['vat']);
$totexc += $excvat;
$report .= "<tr class='" . bg_class() . "'><td>{$rec['invnum']}</td><td>{$rec['edate']}</td><td>" . CUR . " {$rec['vat']}</td><td>" . CUR . " {$excvat}</td><td>" . CUR . " {$rec['total']}</td></tr>";
$i++;
}
$tot = sprint($tot);
$totvat = sprint($totvat);
$totexc = sprint($totexc);
$report .= "<tr class='bg-even'><td colspan=2><b>Totals</b></td><td>" . CUR . " {$totvat}</td><td>" . CUR . " {$totexc}</td><td>" . CUR . " {$tot}</td></tr>\n\t</table>\n <p>\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=15%>\n <tr><td><br></td></tr>\n <tr><th>Quick Links</th></tr>\n\t\t<tr class='bg-odd'><td><a href='sales-reports.php'>Sales Reports</a></td></tr>\n\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t</table>";
return $report;
}
示例2: writeType
function writeType($_POST)
{
# get vars
foreach ($_POST as $key => $value) {
${$key} = $value;
}
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($type, "string", 1, 20, "Invalid report type.");
# display errors, if any
if ($v->isError()) {
$confirmCust = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirmCust .= "<li class=err>" . $e["msg"];
}
$confirmCust .= "<p><input type=button onClick='JavaScript:history.back();' value='« Correct submission'>";
return $confirmCust;
}
# connect to db
db_connect();
# write to db
$sql = "INSERT INTO report_types (type, div) VALUES ('{$type}', '" . USER_DIV . "')";
$typeRslt = db_exec($sql) or errDie("Unable to add report type to database.");
if (pg_cmdtuples($typeRslt) < 1) {
return "Unable to add report type to database.";
}
$writeType = "\n<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width='50%'>\n<tr><th>Report type added to system</th></tr>\n<tr class=datacell><td>New report type has been successfully added to Cubit.</td></tr>\n</table>" . mkQuickLinks(ql("../admin-employee-add.php", "Add Employee"), ql("../admin-employee-view.php", "View Employees"));
return $writeType;
}
示例3: con_data
function con_data($_POST)
{
# get vars
foreach ($_POST as $key => $value) {
${$key} = $value;
}
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($id, "num", 0, 100, "Invalid number.");
# display errors, if any
if ($v->isError()) {
$confirmCust = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirmCust .= "<li class=err>" . $e["msg"];
}
$confirmCust .= "<p><input type=button onClick='JavaScript:history.back();' value='« Correct submission'>";
return $confirmCust;
}
db_conn('cubit');
$Sql = "DELETE FROM cf WHERE id='{$id}' AND div = '" . USER_DIV . "'";
$Rslt = db_exec($Sql) or errDie("Unable to access database.");
$write = "<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width='50%'>\n\t<tr><th>Cash flow budget entry Removed</th></tr>\n\t<tr class=datacell><td>Entry has been deleted from the system.</td></tr>\n\t</table>\n\t<p>\n\t<table border=0 cellpadding='2' cellspacing='1'>\n\t<tr><th>Quick Links</th></tr>\n\t<tr class='bg-odd'><td><a href='cfe-add.php'>New cash flow budget entry</a></td></tr>\n\t<tr class='bg-odd'><td><a href='cfe-view.php'>View cash flow budget entries</a></td></tr>\n\t<script>document.write(getQuicklinkSpecial());</script>\n\t</table>";
return $write;
}
示例4: write
function write($_POST)
{
# get vars
extract($_POST);
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($calloutpid, "num", 1, 50, "Invalid Call Out Person id.");
# display errors, if any
if ($v->isError()) {
$confirmCust = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirmCust .= "<li class=err>" . $e["msg"];
}
$confirmCust .= "<p><input type=button onClick='JavaScript:history.back();' value='« Correct submission'>";
return $confirmCust;
}
# connect to db
db_conn("exten");
# write to db
$sql = "DELETE FROM calloutpeople WHERE calloutpid = '{$calloutpid}' AND div = '" . USER_DIV . "'";
$calloutpRslt = db_exec($sql) or errDie("Unable to remove Sales Person from system.", SELF);
if (pg_cmdtuples($calloutpRslt) < 1) {
return "<li class=err>Unable to remove Call Out Person from database.";
}
$write = "\r\n\t\t\t<table border='0' cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width='50%'>\r\n\t\t\t<tr><th>Call Out Person Removed</th></tr>\r\n\t\t\t\t<tr class=datacell><td>Call Out Person <b>{$calloutp}</b>, has been removed.</td></tr>\r\n\t\t\t</table>\r\n\t\t\t<p>\r\n\t\t\t<table border='0' cellpadding='2' cellspacing='1'>\r\n\t\t\t\t<tr><th>Quick Links</th></tr>\r\n\t\t\t\t<tr class='bg-odd'><td><a href='calloutp-view.php'>View Call Out Persons</a></td></tr>\r\n\t\t\t\t<tr class='bg-odd'><td><a href='../main.php'>Main Menu</a></td></tr>\r\n\t\t\t</table>";
return $write;
}
示例5: write
function write($_POST)
{
# get vars
extract($_POST);
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($calloutp, "string", 1, 255, "Invalid Call Out Person name.");
$v->isOk($telno, "string", 1, 255, "Invalid Call Out Person Contact Number.");
# display errors, if any
if ($v->isError()) {
$confirmCust = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirmCust .= "<li class=err>" . $e["msg"];
}
$confirmCust .= "<p><input type=button onClick='JavaScript:history.back();' value='« Correct submission'>";
return $confirmCust;
}
# connect to db
db_conn("exten");
# write to db
$sql = "INSERT INTO calloutpeople(calloutp,telno,div) VALUES ('{$calloutp}','{$telno}','" . USER_DIV . "')";
$salespRslt = db_exec($sql) or errDie("Unable to add warehouse to system.", SELF);
if (pg_cmdtuples($salespRslt) < 1) {
return "<li class=err>Unable to add Call Out Person to database.";
}
$write = "\r\n\t\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width='50%'>\r\n\t\t\t<tr><th>Call Out Person added to system</th></tr>\r\n\t\t\t<tr class=datacell><td>New Call Out Person <b>{$calloutp}</b>, has been successfully added to the system.</td></tr>\r\n\t\t</table>\r\n\t\t<p>\r\n\t\t<table border=0 cellpadding='2' cellspacing='1'>\r\n\t\t\t<tr><th>Quick Links</th></tr>\r\n\t\t\t<tr class='bg-odd'><td><a href='calloutp-view.php'>View Call Out People</a></td></tr>\r\n\t\t\t<tr class='bg-odd'><td><a href='../callout-new.php'>New Call Out Document</a></td></tr>\r\n\t\t\t<tr class='bg-odd'><td><a href='../main.php'>Main Menu</a></td></tr>\r\n\t\t</table>";
return $write;
}
示例6: login
function login($_POST)
{
global $_SESSION;
extract($_POST);
require_lib("validate");
$v = new validate();
$v->isOk($code, "string", 1, 5, "Invalid company name.");
# Display errors, if any
if ($v->isError()) {
$confirm = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirm .= "<li class='err'>" . $e["msg"] . "</li>";
}
return slctcomp($confirm);
}
# Change code to lowercase
$code = strtolower($code);
if (!db_check("cubit_" . $code)) {
return slctcomp("<li class='err'>Invalid Company. Select another company or<br />\n\t\t\tclick <a href='company-new.php?key=recover'>here</a> to see if Cubit can recover from this error.</li>");
}
# Get Company Name
db_conn("cubit");
$sql = "SELECT name FROM companies WHERE code = '{$code}'";
$compRslt = db_exec($sql) or errDie("Unable to access database.", SELF);
if (pg_numrows($compRslt) < 1) {
$comp['name'] = "";
} else {
$comp = pg_fetch_array($compRslt);
}
$_SESSION["code"] = $code;
$_SESSION["comp"] = $comp['name'];
header("Location: doc-index.php");
}
示例7: write
function write($_POST)
{
# Get vars
foreach ($_POST as $key => $value) {
${$key} = $value;
}
# Validate input
require_lib("validate");
$v = new validate();
$v->isOk($typeref, "string", 0, 255, "Invalid Document type code.");
$v->isOk($typename, "string", 1, 255, "Invalid Document type name.");
# Display errors, if any
if ($v->isError()) {
$confirmCust = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirmCust .= "<li class=err>" . $e["msg"];
}
$confirmCust .= "<p><input type=button onClick='JavaScript:history.back();' value='« Correct submission'>";
return $confirmCust;
}
# Connect to db
db_conn("yr2");
# Write to db
$sql = "INSERT INTO doctypes(typeref, typename, div) VALUES ('{$typeref}', '{$typename}', '" . USER_DIV . "')";
$catRslt = db_exec($sql) or errDie("Unable to add {$typename} to system.", SELF);
if (pg_cmdtuples($catRslt) < 1) {
return "<li class=err>Unable to add {$typename} to database.";
}
$write = "<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width='50%'>\r\n\t<tr><th>Document type added to system</th></tr>\r\n\t<tr class=datacell><td>New Document type <b>{$typename}</b>, has been successfully added to the system.</td></tr>\r\n\t</table>\r\n\t<p>\r\n\t<table border=0 cellpadding='2' cellspacing='1'>\r\n\t<tr><th>Quick Links</th></tr>\r\n\t<tr class='bg-odd'><td><a href='doctype-view.php'>View Document types</a></td></tr>\r\n\t<tr class='bg-odd'><td><a href='../main.php'>Main Menu</a></td></tr>\r\n\t</table>";
return $write;
}
示例8: banktrans
function banktrans($bankacc, $trantype, $date, $name, $details, $cheqnum, $amount, $accinv)
{
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($bankacc, "num", 1, 50, "Invalid Bank Account number.");
$v->isOk($trantype, "string", 1, 50, "Invalid Transaction type.");
$v->isOk($date, "date", 1, 14, "Invalid Bank Transaction date.");
$v->isOk($name, "string", 1, 50, "Invalid Name.");
$v->isOk($details, "string", 0, 255, "Invalid Bank Transacton details.");
$v->isOk($cheqnum, "num", 0, 50, "Invalid Bank Transacton cheque number.");
$v->isOk($amount, "float", 1, 20, "Invalid Bank Transacton Amount.");
$v->isOk($accinv, "num", 1, 20, "Invalid Bank Transaction account involved.");
# display errors, if any
if ($v->isError()) {
$write = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$write .= "<li class=err>" . $e["msg"];
}
$OUTPUT = $write . "<p><input type=button onClick='JavaScript:history.back();' value='« Correct submission'>";
require "../template.php";
}
# date format
$date = explode("-", $date);
$date = $date[2] . "-" . $date[1] . "-" . $date[0];
# record the payment record
db_connect();
$sql = "INSERT INTO cashbook(bankid, trantype, date, name, descript, cheqnum, amount, banked, accinv) VALUES ('{$bankacc}', '{$trantype}', '{$date}', '{$name}', '{$details}', '{$cheqnum}', '{$amount}', 'no', '{$accinv}')";
$Rslt = db_exec($sql) or errDie("Unable to add bank payment to database.", SELF);
}
示例9: write
function write($_POST)
{
# get vars
extract($_POST);
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($whid, "num", 1, 50, "Invalid Store id.");
# display errors, if any
if ($v->isError()) {
$confirmCust = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirmCust .= "<li class='err'>" . $e["msg"] . "</li>";
}
$confirmCust .= "<p><input type='button' onClick='JavaScript:history.back();' value='« Correct submission'>";
return $confirmCust;
}
# connect to db
db_conn("exten");
# write to db
$sql = "DELETE FROM warehouses WHERE whid = '{$whid}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql) or errDie("Unable to remove Store from system.", SELF);
if (pg_cmdtuples($whRslt) < 1) {
return "<li class='err'>Unable to remove Store from database.</li>";
}
$write = "\r\n\t\t\t\t<table " . TMPL_tblDflts . " width='50%'>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Store Removed</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>Store <b>{$whname}</b>, has been removed.</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t\t<p>\r\n\t\t\t\t<table border=0 cellpadding='2' cellspacing='1'>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Quick Links</th>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t\t\t\t<td><a href='whouse-view.php'>View Stores</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 $write;
}
示例10: remAllow
function remAllow($id)
{
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($id, "num", 1, 20, "Invalid allowance ID.");
# display errors, if any
if ($v->isError()) {
$confirmCust = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirmCust .= "<li class=err>" . $e["msg"];
}
$confirmCust .= "<p><input type=button onClick='JavaScript:history.back();' value='« Correct submission'>";
return $confirmCust;
}
# connect to db
db_connect();
# delete from db
$sql = "DELETE FROM allowances WHERE id='{$id}' AND div = '" . USER_DIV . "'";
$allowRslt = db_exec($sql) or errDie("Unable to delete allowance from database.");
if (pg_cmdtuples($allowRslt) < 1) {
return "Unable to delete allowance from database.";
}
$sql = "DELETE FROM empallow WHERE allowid='{$id}'";
$rslt = db_exec($sql) or errDie("Error deleting allowances assigned to employees.");
$writeAllow = "\n<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width='50%'>\n<tr><th>Allowance deleted</th></tr>\n<tr class=datacell><td>Allowance, {$id}, has been successfully deleted.</td></tr>\n</table>" . mkQuickLinks(ql("../admin-employee-add.php", "Add Employee"), ql("../admin-employee-view.php", "View Employees"));
return $writeAllow;
}
示例11: viewsaved
function viewsaved($_POST)
{
# get vars
foreach ($_POST as $key => $value) {
${$key} = $value;
}
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($bankid, "num", 1, 30, "Invalid Bank Account.");
$v->isOk($fday, "num", 1, 2, "Invalid Day for the 'From' date.");
$v->isOk($fmonth, "num", 1, 2, "Invalid month for the 'From' date..");
$v->isOk($fyear, "num", 1, 4, "Invalid year for the 'From' date..");
$v->isOk($lday, "num", 1, 2, "Invalid Day for the 'To' date.");
$v->isOk($lmonth, "num", 1, 2, "Invalid month for the 'To' date..");
$v->isOk($lyear, "num", 1, 4, "Invalid year for the 'To' date..");
# lets mix the date
$from = sprintf("%02.2d", $fday) . "-" . sprintf("%02.2d", $fmonth) . "-" . $fyear;
$to = sprintf("%02.2d", $lday) . "-" . sprintf("%02.2d", $lmonth) . "-" . $lyear;
# 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;
}
# get bank details
$bankRslt = get("cubit", "accname,bankname", "bankacct", "bankid", $bankid);
$bank = pg_fetch_array($bankRslt);
}
示例12: bal
function bal($id)
{
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($id, "num", 1, 20, "Invalid Cash Flow Statement 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
$cf = new dbSelect("save_cashflow", "core", grp(m("cols", "output, date_trunc('day', gentime) as gentime"), m("where", "id='{$id}'")));
$cf->run();
if ($cf->num_rows() < 1) {
return "<center><li> Invalid Cash Flow Statement Number.</li></center>";
}
$stmnt = $cf->fetch_array();
$OUTPUT = base64_decode($stmnt['output']);
if (isset($_GET["xls"])) {
$cftime = preg_replace("/ 00:00.*/", "", $stmnt["gentime"]);
require_lib("xls");
Stream("cashflow-{$cftime}", $OUTPUT);
} else {
require "../tmpl-print.php";
}
}
示例13: writeFringe
function writeFringe()
{
global $_POST;
extract($_POST);
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($fringeben, "string", 1, 100, "Invalid fringe benefit name.");
$v->isOk($type, "string", 1, 15, "Invalid type.");
# display errors, if any
if ($v->isError()) {
$confirmCust = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirmCust .= "<li class=err>" . $e["msg"];
}
$confirmCust .= "<p><input type=button onClick='JavaScript:history.back();' value='« Correct submission'>";
return $confirmCust;
}
# connect to db
db_connect();
# write to db
$sql = "INSERT INTO fringebens(fringeben, type, div)\n\t\t\tVALUES ('{$fringeben}', '{$type}', '" . USER_DIV . "')";
$rslt = db_exec($sql) or errDie("Unable to add Fringe Benefit to database (DBE).");
if (pg_cmdtuples($rslt) < 1) {
return "Unable to add Fringe Benefit to database (CNT).";
}
$OUTPUT = "<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width='50%'>\n\t<tr><th>Fringe Benefit added to system</th></tr>\n\t<tr class=datacell><td>New Fringe Benefit, {$fringeben}, has been successfully added to Cubit.</td></tr>\n\t</table>" . mkQuickLinks(ql("../admin-employee-add.php", "Add Employee"), ql("../admin-employee-view.php", "View Employees"));
return $OUTPUT;
}
示例14: inc
function inc($id)
{
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($id, "num", 1, 20, "Invalid Income Statement 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 income statement
$sql = "SELECT * FROM save_income_stmnt WHERE id = '{$id}' AND div = '" . USER_DIV . "'";
$incRslt = db_exec($sql) or errDie("Unable to retrieve income statement from the Database", SELF);
if (pg_numrows($incRslt) < 1) {
return "<center><li> Invalid Income Statement Number.";
}
$inc = pg_fetch_array($incRslt);
$income = base64_decode($inc['output']);
$OUTPUT = $income;
require "../tmpl-print.php";
}
示例15: remDeduct
function remDeduct($id)
{
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($id, "string", 1, 20, "Invalid reference number.");
# display errors, if any
if ($v->isError()) {
$confirmCust = "";
$errors = $v->getErrors();
foreach ($errors as $e) {
$confirmCust .= "<li class=err>" . $e["msg"];
}
$confirmCust .= "<p><input type=button onClick='JavaScript:history.back();' value='« Correct submission'>";
return $confirmCust;
}
# connect to db
db_connect();
# delete from db
$sql = "DELETE FROM salded WHERE id='{$id}' AND div = '" . USER_DIV . "'";
$salRslt = db_exec($sql) or errDie("Unable to delete salary deduction from database.");
# delete from db
$sql = "DELETE FROM empdeduct WHERE dedid='{$id}' AND div = '" . USER_DIV . "'";
$salRslt = db_exec($sql) or errDie("Unable to delete salary deduction from employee lists.");
$writeDeduct = "\n<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width='50%'>\n<tr><th>Salary deduction deleted</th></tr>\n<tr class=datacell><td>Salary deduction has been successfully deleted.</td></tr>\n</table>" . mkQuickLinks(ql("../admin-employee-add.php", "Add Employee"), ql("../admin-employee-view.php", "View Employees"));
return $writeDeduct;
}