本文整理汇总了PHP中bg_class函数的典型用法代码示例。如果您正苦于以下问题:PHP bg_class函数的具体用法?PHP bg_class怎么用?PHP bg_class使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bg_class函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_range
function get_range($err = "")
{
$blocked_range_from = getCSetting("BLOCKED_FROM");
$blocked_range_to = getCSetting("BLOCKED_TO");
if (!isset($blocked_range_from) or strlen($blocked_range_from) < 1) {
$blocked_range_from = date("Y-m-d");
}
if (!isset($blocked_range_to) or strlen($blocked_range_to) < 1) {
$blocked_range_to = date("Y-m-d");
}
$from_arr = explode("-", $blocked_range_from);
$to_arr = explode("-", $blocked_range_to);
$from_year = $from_arr[0];
$from_month = $from_arr[1];
$from_day = $from_arr[2];
$to_year = $to_arr[0];
$to_month = $to_arr[1];
$to_day = $to_arr[2];
// $from_year = substr ($blocked_range_from,0,4);
// $from_month = substr ($blocked_range_from,5,2);
// $from_day = substr ($blocked_range_from,8,2);
//
// $to_year = substr ($blocked_range_to,0,4);
// $to_month = substr ($blocked_range_to,5,2);
// $to_day = substr ($blocked_range_to,8,2);
$display = "\n\t\t<h4>Set Date Range to Block Transactions In</h4>\n\t\t{$err}\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'>\n\t\t\t<tr>\n\t\t\t\t<th colspan='2'>Date Range</th>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th>From Date</th>\n\t\t\t\t<th>To Date</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>" . mkDateSelect("from", $from_year, $from_month, $from_day) . "</td>\n\t\t\t\t<td>" . mkDateSelect("to", $to_year, $to_month, $to_day) . "</td>\n\t\t\t</tr>\n\t\t\t" . TBL_BR . "\n\t\t\t<tr>\n\t\t\t\t<td align='right' colspan='2'><input type='submit' value='Save Setting'></td>\n\t\t\t</tr>\n\t\t</form>\n\t\t</table>";
return $display;
}
示例2: display
function display()
{
$sql = "SELECT * FROM cubit.stock ORDER BY stkcod ASC";
$stock_rslt = db_exec($sql) or errDie("Unable to retrieve stock.");
$stock_out = "";
while ($stock_data = pg_fetch_array($stock_rslt)) {
// Retrieve units on order
$sql = "SELECT sum(qty) FROM cubit.sorders_items WHERE stkid='{$stock_data['stkid']}'";
$order_rslt = db_exec($sql) or errDie("Unable to retrieve orders.");
$order_qty = pg_fetch_result($order_rslt, 0);
if (empty($stock_data["minlvl"])) {
continue;
}
if (empty($order_qty)) {
$order_qty = 0;
}
$units = $stock_data["units"] - $order_qty;
$required = abs($units - $stock_data["minlvl"]);
// We're not required to purchase this item
if ($units > $stock_data["minlvl"]) {
continue;
}
$stock_out .= "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>{$stock_data['stkcod']}</td>\n\t\t\t\t<td>{$stock_data['stkdes']}</td>\n\t\t\t\t<td align='center'>" . sprint3($stock_data['units']) . "</td>\n\t\t\t\t<td align='center'>" . sprint3($order_qty) . "</td>\n\t\t\t\t<td align='center'>" . sprint3($stock_data['minlvl']) . "</td>\n\t\t\t\t<td align='center'><b>" . sprint3($required) . "</b></td>\n\t\t\t\t<td><a href='purchase-new.php'>Purchase</a></td>\n\t\t\t</tr>";
}
if (empty($stock_out)) {
$stock_out = "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='7'>No items required for purchase.</td>\n\t\t\t</tr>";
}
$OUTPUT = "\n\t\t<center>\n\t\t<h3>Required Purchases</h3>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Stock Code</th>\n\t\t\t\t<th>Stock Description</th>\n\t\t\t\t<th>Current Units</th>\n\t\t\t\t<th>Units on Order</th>\n\t\t\t\t<th>Minimum Level</th>\n\t\t\t\t<th>Minimum Required</th>\n\t\t\t\t<th>Options</th>\n\t\t\t</tr>\n\t\t\t{$stock_out}\n\t\t</table>\n\t\t</center>";
return $OUTPUT;
}
示例3: enter
function enter($err)
{
global $_GET;
extract($_GET);
$fields["privilege_owner"] = "";
$fields["privilege"] = "";
foreach ($fields as $key => $value) {
if (!isset(${$key})) {
${$key} = $value;
}
}
db_conn("cubit");
$sql = "SELECT username FROM users ORDER BY username";
$rslt = db_exec($sql) or errDie("Error reading user list.");
$users = array();
$users["0"] = "SELECT USER";
while ($row = pg_fetch_array($rslt)) {
$users[$row["username"]] = $row["username"];
}
$select_user = extlib_cpsel("privilege_owner", $users, $privilege_owner);
$select_privilege = "\r\n\t\t<select name=privilege>\r\n\t\t\t<option value='R' " . ($privilege == "R" ? "selected" : "") . ">Read</option>\r\n\t\t\t<option value='W' " . ($privilege == "W" ? "selected" : "") . ">Write</option>\r\n\t\t</select>";
$OUTPUT = "\r\n\t<h3>Diary Privileges</h3>\r\n\t{$err}\r\n\t<form method=post action='" . SELF . "'>\r\n\t<input type=hidden name=key value=write>\r\n\t<table cellpadding='2' cellspacing='0' class='shtable'>\r\n\t<tr>\r\n\t\t<th colspan=3>Details</th>\r\n\t</tr>\r\n\t<tr class='bg-odd'>\r\n\t\t<td>{$select_user}</td>\r\n\t\t<td colspan=2>{$select_privilege}</td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<th>Username</th>\r\n\t\t<th>Privilege</th>\r\n\t\t<th>Del</th>\r\n\t</tr>";
db_conn("cubit");
$sql = "SELECT * FROM diary_privileges WHERE diary_owner='" . USER_NAME . "'";
$rslt = db_exec($sql) or errDie("Error reading diary privileges.");
$i = 1;
while ($row = pg_fetch_array($rslt)) {
$OUTPUT .= "\r\n\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t<td>{$row['priv_owner']}</td>\r\n\t\t\t<td>{$row['privilege']}</td>\r\n\t\t\t<td><input type=checkbox name='del[{$row['id']}]'></td>\r\n\t\t</tr>";
}
$OUTPUT .= "\r\n\t</table>\r\n\t<p></p>\r\n\t<input type=submit value='Update'>\r\n\t</form>";
return $OUTPUT;
}
示例4: slctOpt
function slctOpt($errors = "")
{
global $_POST;
extract($_POST);
$fields = array();
$fields["budname"] = "Financial Budget";
foreach ($fields as $var_name => $value) {
if (!isset(${$var_name})) {
${$var_name} = $value;
}
}
global $BUDFOR, $TYPES, $PERIODS;
global $MONPRD, $PRDMON;
$typesel = extlib_mksel("budtype", $TYPES);
$fromprdsel = extlib_cpsel("fromprd", $PERIODS, $PRDMON[1]);
$toprdsel = extlib_cpsel("toprd", $PERIODS, $PRDMON[12]);
if ($budname == "Financial Budget") {
$bud_fin = "checked";
$bud_spec = "";
} else {
$bud_fin = "";
$bud_spec = "checked";
}
// Options Layout
$Opts = "<center>\n\t<h3> New Monthly Budget</h3>\n\t<form action='" . SELF . "' method=post name=form>\n\t<input type=hidden name=key value=details>\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' align=center>\n\t<tr>\n\t\t<td>{$errors}</td>\n\t</tr>\n\t<tr>\n\t\t<th colspan=3>Details</th>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Budget</td>\n\t\t<td>\n\t\t\t<input type='radio' name='budname' value='Financial Budget' {$bud_fin}>Financial Budget<b> | </b>\n\t\t\t<input type='radio' name='budname' value='Special Budget' {$bud_spec}>Special Budget\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan='3'><hr /></td>\n\t</tr>\n\t<tr>\n\t\t<th colspan=3>Create Budget</th>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Budget For</td>\n\t\t<td>\n\t\t\t<input type=radio name=budfor value=cost>Cost Centers \n\t\t\t<input type=radio name=budfor value=acc checked=yes>Accounts\n\t\t</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Budget Type</td>\n\t\t<td>{$typesel}</td>\n\t</tr>\n\t<tr class='" . bg_class() . "'>\n\t\t<td>Budget Period</td>\n\t\t<td>{$fromprdsel} to {$toprdsel}</td>\n\t</tr>";
if (PYR_DB) {
$Opts .= "<tr class='" . bg_class() . "'>\n\t\t\t<td>Use Previous Year Figures</td>\n\t\t\t<td><input type='checkbox' name='import' /></td>\n\t\t</tr>\n\t\t" . TBL_BR . "\n\t\t<tr>\n\t\t\t<th colspan='3'>'Use Previous Year Figures' Options</th>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan='3' class='err'>This option is only used to create a budget for accounts,\n\t\t\t\tnot Cost Centers.</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>Increase Percentage</td>\n\t\t\t<td>\n\t\t\t\t<input type='text' name='incperc' size='3' value='0' /> %\n\t\t\t\t<span class='err'>Use negative value for decrease.</span>\n\t\t\t</td>\n\t\t</tr>";
}
$Opts .= "\n\t" . TBL_BR . "\n\t<tr>\n\t\t<td align=right><input type=button value='« Back' onClick='javascript:history.back()'></td>\n\t\t<td align=right><input type=submit value='Continue »'></td>\n\t</tr>\n\t</table>\n\t</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='budget-view.php'>View Budgets</td></tr>\n\t\t<tr class='bg-odd'><td align=center><a href='../main.php'>Main Menu</td></tr>\n\t</table>";
return $Opts;
}
示例5: 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 = "{$from_year}-{$from_month}-{$from_day}";
$to_date = "{$to_year}-{$to_month}-{$to_day}";
$sql = "\n\tSELECT invnum, cash, cheque, credit, sdate, cusname\n\tFROM cubit.nons_invoices\n\tWHERE sdate BETWEEN '{$from_date}' AND '{$to_date}' AND hire_invnum!='0'";
$inv_rslt = db_exec($sql) or errDie("Unable to retrieve invoices.");
$total_cash = 0;
$total_cheque = 0;
$total_credit = 0;
$inv_out = "";
while ($inv_data = pg_fetch_array($inv_rslt)) {
$inv_out .= "\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>{$inv_data['sdate']}</td>\n\t\t\t<td align='center'>{$inv_data['invnum']}</td>\n\t\t\t<td>{$inv_data['cusname']}</td>\n\t\t\t<td align='right'>" . sprint($inv_data["cash"]) . "</td>\n\t\t\t<td align='right'>" . sprint($inv_data["cheque"]) . "</td>\n\t\t\t<td align='right'>" . sprint($inv_data["credit"]) . "</td>\n\t\t</tr>";
$total_cash += $inv_data["cash"];
$total_cheque += $inv_data["cheque"];
$total_credit += $inv_data["credit"];
}
if (empty($inv_out)) {
$inv_out = "\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td colspan='6'><li>No results found.</li></td>\n\t\t</tr>";
}
$OUTPUT = "\n\t<center>\n\t<h3>Daily Hire Cashup Report</h3>\n\t<form method='post' action='" . SELF . "'>\n\t<table " . TMPL_tblDflts . ">\n\t\t<tr>\n\t\t\t<th colspan='4'>Date Range</th>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>" . mkDateSelect("from", $from_year, $from_month, $from_day) . "</td>\n\t\t\t<td> <b>To</b> </td>\n\t\t\t<td>" . mkDateSelect("to", $to_year, $to_month, $to_day) . "</td>\n\t\t\t<td><input type='submit' value='Select' /></td>\n\t\t</tr>\n\t</table>\n\t</form>\n\t<table " . TMPL_tblDflts . ">\n\t\t<tr>\n\t\t\t<th>Date</th>\n\t\t\t<th>Invoice No</th>\n\t\t\t<th>Customer</th>\n\t\t\t<th>Cash</th>\n\t\t\t<th>Cheque</th>\n\t\t\t<th>Credit Card</th>\n\t\t</tr>\n\t\t{$inv_out}\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td colspan='3'><b>Total</b></td>\n\t\t\t<td align='right'><b>" . sprint($total_cash) . "</b></td>\n\t\t\t<td align='right'><b>" . sprint($total_cheque) . "</b></td>\n\t\t\t<td align='right'><b>" . sprint($total_credit) . "</b></td>\n\t</table>\n\t</center>";
return $OUTPUT;
}
示例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;
}
示例7: select
function select($_POST)
{
# get vars
foreach ($_POST as $key => $value) {
${$key} = $value;
}
# Set uppercase
$ALPHA = strtoupper($alpha);
# Connect to database
db_connect();
# Query server for customer info
$sql = "SELECT * FROM customers WHERE cusname LIKE '{$alpha}%' OR cusname LIKE '{$ALPHA}%' ORDER BY cusname";
$prnCustRslt = db_exec($sql) or errDie("Unable to view customers");
$numrows = pg_numrows($prnCustRslt);
if ($numrows < 1) {
return "<li class=err>No customer names starting with <b>{$ALPHA}</b> in database.";
}
$select = "<h4>Select a customer</h4>\r\n\t\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width='50%'>\r\n\t\t<tr><th>Customer no.</th><th>Customer name</th></tr>";
// display customers to choose from
for ($i = 0; $i < $numrows; $i++) {
$myCust = pg_fetch_array($prnCustRslt);
$select .= "<tr class='" . bg_class() . "'><td align=center>{$myCust['cusnum']}</td><td align=center><a href='quote-new.php?cusnum={$myCust['cusnum']}'>{$myCust['cusname']}</a></td></tr>";
}
$select .= "</table>\r\n\t\t<p>\r\n\t\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=100>\r\n\t\t\t<tr><th>Quick Links</th></tr>\r\n\t\t\t<tr bgcolor='#88BBFF'><td><a href='customers-new.php'>New Customer</a></td></tr>\r\n\t\t\t<script>document.write(getQuicklinkSpecial());</script>\r\n\t\t\t<tr bgcolor='#88BBFF'><td><a href='main.php'>Main Menu</a></td></tr>\r\n\t\t</table>";
return $select;
}
示例8: 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;
}
示例9: display
function display()
{
extract($_REQUEST);
if (user_is_admin(USER_ID)) {
$user_id = $_REQUEST["user_id"];
} else {
$user_id = USER_ID;
}
// Retrieve user information
$sql = "SELECT * FROM cubit.users WHERE userid='{$user_id}'";
$user_rslt = db_exec($sql) or errDie("Unable to retrieve user.");
$user_data = pg_fetch_array($user_rslt);
define("SECONDS_IN_7_DAYS", 604800);
$seven_days = date("Y-m-d", time() + SECONDS_IN_7_DAYS);
// Retrieve orders for expired orders and orders that will expire within
// 7 days
$sql = "SELECT * FROM cubit.sorders\n\t\t\tWHERE ddate<'{$seven_days}' AND accepted='n' AND done='y'\n\t\t\t\tAND username='{$user_data['username']}'\n\t\t\tORDER BY ddate DESC";
$sorder_rslt = db_exec($sql) or errDie("Unable to retrieve sales orders.");
$sorder_out = "";
while ($sorder_data = pg_fetch_array($sorder_rslt)) {
$sorder_out .= "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>{$sorder_data['ddate']}</td>\n\t\t\t\t<td>{$sorder_data['odate']}</td>\n\t\t\t\t<td>{$sorder_data['cusname']} {$sorder_data['surname']}</td>\n\t\t\t\t<td>{$sorder_data['ordno']}</td>\n\t\t\t\t<td>{$sorder_data['cusname']}</td>\n\t\t\t\t<td>" . CUR . "{$sorder_data['discount']}</td>\n\t\t\t\t<td>" . CUR . "{$sorder_data['total']}</td>\n\t\t\t</tr>";
}
if (empty($sorder_out)) {
$sorder_out = "\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td colspan='7'>No items found</td>\n\t\t</tr>";
}
$OUTPUT = "\n\t\t<center>\n\t\t<h3>Sales Orders Past Due/Delivery Date</h3>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Due Date</th>\n\t\t\t\t<th>Sales Order Date</th>\n\t\t\t\t<th>Customer</th>\n\t\t\t\t<th>Sales Order No</th>\n\t\t\t\t<th>Customer Order No</th>\n\t\t\t\t<th>Discount</th>\n\t\t\t\t<th>Total</th>\n\t\t\t</tr>\n\t\t\t{$sorder_out}\n\t\t</table>\n\t\t</center>";
return $OUTPUT;
}
示例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";
}
示例11: 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;
}
示例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;
}
示例13: 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;
}
示例14: 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;
}
示例15: posttake_display
function posttake_display()
{
extract($_REQUEST);
$fields = array();
$fields["page"] = 1;
extract($fields, EXTR_SKIP);
$sql = "\n\t\tSELECT stock.stkid, stock.whid, stkcod, stkdes, bar, adjusted, qty \n\t\tFROM cubit.stock_take \n\t\t\tLEFT JOIN cubit.stock ON stock_take.stkid=stock.stkid \n\t\tWHERE page='{$page}' AND (adjusted='0' OR adjusted IS NULL) \n\t\tORDER BY stkcod ASC, whid";
$stock_rslt = db_exec($sql) or errDie("Unable to retrieve stock.");
$stock_out = "";
while ($stock_data = pg_fetch_array($stock_rslt)) {
db_conn("exten");
$get_wh = "SELECT whname FROM warehouses WHERE whid = '{$stock_data['whid']}' LIMIT 1";
$run_wh = db_exec($get_wh) or errDie("Unable to get warehouse information.");
if (pg_numrows($run_wh) < 1) {
$whname = "Default";
} else {
$whname = trim(pg_fetch_result($run_wh, 0, 0));
}
$stock_out .= "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>{$stock_data['bar']}</td>\n\t\t\t\t<td>{$whname}</td>\n\t\t\t\t<td>{$stock_data['stkcod']}</td>\n\t\t\t\t<td>{$stock_data['stkdes']}</td>\n\t\t\t\t<td align='center'><input type='text' name='qty[{$stock_data['stkid']}]' value='{$stock_data['qty']}' size='3' style='text-align: center' /></td>\n\t\t\t\t<td><input type='submit' name='update[{$stock_data['stkid']}]' value='OK' /></td>\n\t\t\t</tr>";
}
if (empty($stock_out)) {
$stock_out = "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='5'>No results found.</td>\n\t\t\t</tr>";
}
$OUTPUT = "\n\t\t<center>\n\t\t<h3>Stock Take</h3>\n\t\t<form method='POST' action='" . SELF . "'>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th colspan='2'>Page</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td><input type='text' name='page' value='{$page}' size='3' style='font-weight: bold; text-align: center' /></td>\n\t\t\t\t<td><input type='submit' value='OK' /></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>\n\t\t<form method='POST' action='" . SELF . "'>\n\t\t\t<input type='hidden' name='key' value='take_update' />\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Barcode</th>\n\t\t\t\t<th>Store</th>\n\t\t\t\t<th>Stock Code</th>\n\t\t\t\t<th>Stock Description</th>\n\t\t\t\t<th>Quantity</th>\n\t\t\t\t<th> </th>\n\t\t\t</tr>\n\t\t\t{$stock_out}\n\t\t</table>\n\t\t<input type='submit' name='button[adjustments]' value='Adjustments' />\n\t\t</form>\n\t\t</center>";
return $OUTPUT;
}