本文整理汇总了PHP中mkDateSelect函数的典型用法代码示例。如果您正苦于以下问题:PHP mkDateSelect函数的具体用法?PHP mkDateSelect怎么用?PHP mkDateSelect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mkDateSelect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: slct
function slct()
{
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.</li>";
}
$Prds = "<select name='prd'>";
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();
$supplier_drop = "<select name='supplier'>";
$supplier_drop .= "<option value='0'>All Suppliers</option>";
$get_supps = "SELECT * FROM suppliers WHERE blocked IS NULL or blocked != 'yes' ORDER BY supname";
$run_supps = db_exec($get_supps) or errDie("Unable to get supplier information");
if (pg_numrows($run_supps) > 0) {
while ($sarr = pg_fetch_array($run_supps)) {
$supplier_drop .= "<option value='{$sarr['supid']}'>{$sarr['supname']}</option>";
}
}
$supplier_drop .= "</select>";
//layout
$slct = "\n\t\t<h3>View Returned Stock Orders</h3>\n\t\t<table " . TMPL_tblDflts . " width='500'>\n\t\t<form action='" . SELF . "' method='POST' name='form'>\n\t\t\t<input type='hidden' name='key' value='view'>\n\t\t\t<tr>\n\t\t\t\t<th colspan='2'>By Date Range</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td align='center' colspan='2' nowrap>\n\t\t\t\t\t" . mkDateSelect("from", date("Y"), date("m"), "01") . "\n\t\t\t\t\t TO \n\t\t\t\t\t" . mkDateSelect("to") . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th>Supplier(s)</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td align='center'>{$supplier_drop}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan='2' align='right'><input type='submit' value='Search'></td>\n\t\t\t</tr>\n\t\t</form>\n\t\t</table>\n\t\t<p>\n\t\t<p>\n\t\t<table border=0 cellpadding='2' cellspacing='1'>\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='purchase-new.php'>New Purchase</a></td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td><a href='purchase-view.php'>View Purchases</a></td>\n\t\t\t</tr>\n\t\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t\t</table>";
return $slct;
}
示例2: enter
function enter($errors = "")
{
extract($_REQUEST);
$fields = array();
$fields["asset_id"] = 0;
$fields["ex_year"] = date("Y");
$fields["ex_month"] = date("m");
$fields["ex_day"] = date("d");
$fields["description"] = "";
$fields["notes"] = "";
$fields["qty"] = 1;
extract($fields, EXTR_SKIP);
// Create asset dropdown
$sql = "SELECT id, des, serial FROM cubit.assets ORDER BY des ASC";
$asset_rslt = db_exec($sql) or errDie("Unable to retrieve assets.");
$asset_sel = "<select name='asset_id' style='width='100%'>";
while ($asset_data = pg_fetch_array($asset_rslt)) {
if (!isOurs($asset_data["id"]) || isHired($asset_data["id"], date("Y-m-d"))) {
continue;
}
if ($asset_id == $asset_data["id"]) {
$sel = "selected='selected'";
} else {
$sel = "";
}
$asset_sel .= "\r\n\t\t<option value='{$asset_data['id']}' {$sel}>\r\n\t\t\t({$asset_data['serial']}) {$asset_data['des']}\r\n\t\t</option>";
}
$asset_sel .= "</select>";
$OUTPUT = "<h3>Book Asset to Workshop</h3>\r\n\t<form method='post' action='" . SELF . "'>\r\n\t<input type='hidden' name='key' value='confirm' />\r\n\t<input type='hidden' name='qty' value='{$qty}' />\r\n\t<table " . TMPL_tblDflts . ">\r\n\t\t<tr>\r\n\t\t\t<td colspan='2'>{$errors}</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<th colspan='2'>Details</th>\r\n\t\t</tr>\r\n\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t<td>Asset</td>\r\n\t\t\t<td>{$asset_sel}</td>\r\n\t\t</tr>\r\n\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t<td>Expected Back Date</td>\r\n\t\t\t<td>" . mkDateSelect("ex", $ex_year, $ex_month, $ex_day) . "</td>\r\n\t\t</tr>\r\n\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t<td>Description</td>\r\n\t\t\t<td><input type='text' name='description' value='{$description}' /></td>\r\n\t\t</tr>\r\n\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t<td>Notes</td>\r\n\t\t\t<td><textarea name='notes' rows='5' cols='20'>{$notes}</textarea></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan='2' align='right'>\r\n\t\t\t\t<input type='submit' value='Write »' />\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t</table>\r\n\t</form>";
return $OUTPUT;
}
示例3: confirm_emp
function confirm_emp($_GET, $err = "")
{
extract($_GET);
$empnum += 0;
db_connect();
# get employee info to edit
$sql = "SELECT * FROM employees WHERE empnum='{$empnum}' AND div = '" . USER_DIV . "'";
$empRslt = db_exec($sql) or errDie("Unable to select employee info from database.");
if (pg_numrows($empRslt) < 1) {
return "Invalid emp number.";
}
$myEmpl = pg_fetch_array($empRslt);
if ($myEmpl['resident'] == "t") {
$myEmpl['resident'] = "Yes";
} else {
$myEmpl['resident'] = "No";
}
if ($myEmpl['sex'] == "M") {
$myEmpl['sex'] = "Male";
} else {
$myEmpl['sex'] = "Female";
}
# Set up table & form
$confirmEmp = "\n\t\t<h3>Confirm Remove Employee</h3>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t{$err}\n\t\t<form action='" . SELF . "' method='POST'>\n\t\t\t<input type='hidden' name='key' value='confirm_rem'>\n\t\t\t<input type='hidden' name='empnum' value='{$myEmpl['empnum']}'>\n\t\t\t<tr>\n\t\t\t\t<td valign='top'>\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 colspan='2'>Employee Details</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>Surname</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['sname']}</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>First Names</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['fnames']}</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>Sex</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['sex']}</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>Marital Status</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['marital']}</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>Resident</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['resident']}</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>Hire Date</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['hiredate']}</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>Telephone No</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['telno']}</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>E-mail</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['email']}</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>Basic Salary</td>\n\t\t\t\t\t\t\t<td valign='center'>" . CUR . " {$myEmpl['basic_sal']}</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>Pay Type</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['paytype']}</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>Bank Name</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['bankname']}</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>Branch Code</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['bankcode']}</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>Bank Account Type</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['bankacctype']}</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>Bank Account No</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['bankaccno']}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t\t<td valign='top'>\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 colspan='2'>Employee Details</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>Residential Address</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['res1']}</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><br></td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['res2']}</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><br></td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['res3']}</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><br></td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['res4']}</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>Postal Address</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['pos1']}</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><br></td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['pos2']}</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>Postal Code</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['pcode']}</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<th colspan='2'>Friend Not Living With Employee</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>Surname</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['contsname']}</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>First Names</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['contfnames']}</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>Residential Address</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['contres1']}</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><br></td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['contres2']}</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><br></td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['contres3']}</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>Telephone No</td>\n\t\t\t\t\t\t\t<td valign='center'>{$myEmpl['conttelno']}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</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<th colspan='2'>Details</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>Reason for Leaving</td>\n\t\t\t\t<td><input type='text' size='20' name='reason'></td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>Date</td>\n\t\t\t\t<td>" . mkDateSelect("date") . "</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<th colspan='2'>Select one or more of the following</th>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th colspan='2'>Employee Initiated:</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='dissat_payben' value='yes'> Dissatisfaction with Pay or Benefits</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='dissat_jobcon' value='yes'> Dissatisfaction with Job Content</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='dissat_env' value='yes'> Dissatisfaction with Working Environment</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='emigration' value='yes'> Emigration</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='incom_supman' value='yes'> Incompatibility with Supervisor or Manager</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='incom_orgcul' value='yes'> Incompatibility with Organisational Culture</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='incom_collea' value='yes'> Incompatibility with Colleagues</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='lack_perdev' value='yes'> Lack of Personal Development Opportunities</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='lack_caradv' value='yes'> Lack of Career Advancement Oppertunities</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='lack_recogn' value='yes'> Lack of Recognition</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='lack_culsen' value='yes'> Lack of Cultural Sensitivity</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='self_empl' value='yes'> Self Employment</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='unsuit_locorg' value='yes'> Unsuitable Geographic Location of Organisation</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th colspan='2'>Employer Instigated:</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='redundantretrench' value='yes'> Redundancy or Retrenchment</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='dismissmisconduct' value='yes'> Dismissal or Misconduct</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='incapablepoorperc' value='yes'> Incapacity or Poor Performance</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='negosettle' value='yes'> Negotiated Settlement</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='desertion' value='yes'> Desertion</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th colspan='2'>Unavoidable Separations:</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='death' value='yes'> Death</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='retirement' value='yes'> Retirement</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='illhealth' value='yes'> Ill Health</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='pregnan' value='yes'> Pregnancy</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='famcircums' value='yes'> Family Circumstances</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><input type='checkbox' name='intercomptrans' value='yes'> Inter Company or Group Transfer</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<th colspan='2'>Details</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2'><textarea name='description' rows='5' cols='65'></textarea></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td><br></td>\n\t\t\t\t<td align='right'><input type='submit' value='Confirm »'></td>\n\t\t\t</tr>\n\t\t</form>\n\t\t</table>" . mkQuickLinks(ql("../admin-employee-add.php", "Add Employee"), ql("../admin-employee-view.php", "View Employees"));
return $confirmEmp;
}
示例4: 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 = "\n\t\tSELECT invnum, cusname, odate, timestamp\n\t\tFROM cubit.invoices\n\t\tLEFT JOIN cubit.pslip_dispatched\n\t\t\tON invoices.invid=pslip_dispatched.invid\n\t\tWHERE signed='0' AND dispatched='1' AND (timestamp BETWEEN '{$from_date} 0:00:00' AND '{$to_date} 23:59:59')\n\t\tORDER BY invnum DESC";
$inv_rslt = db_exec($sql) or errDie("Unable to retrieve invoices.");
$inv_out = "";
while ($inv_data = pg_fetch_array($inv_rslt)) {
$inv_out .= "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>{$inv_data['timestamp']}</td>\n\t\t\t\t<td>{$inv_data['invnum']}</td>\n\t\t\t\t<td>{$inv_data['cusname']}</td>\n\t\t\t\t<td>{$inv_data['odate']}</td>\n\t\t\t</tr>";
}
if (empty($inv_out)) {
$inv_out = "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='4'><li>No results found</li></td>\n\t\t\t</tr>";
}
$OUTPUT = "\n\t\t<center>\n\t\t<h3>Unsigned Invoices Report</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='4'>Date Range</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> <b>To</b> </td>\n\t\t\t\t<td>" . mkDateSelect("to", $to_year, $to_month, $to_day) . "</td>\n\t\t\t\t<td><input type='submit' value='Select' /></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Time</th>\n\t\t\t\t<th>Invoice No</th>\n\t\t\t\t<th>Customer</th>\n\t\t\t\t<th>Invoice Date</th>\n\t\t\t</tr>\n\t\t\t{$inv_out}\n\t\t</table>\n\t\t</center>";
return $OUTPUT;
}
示例5: slct
function slct($_GET)
{
# get vars
extract($_GET);
# validate input
require_lib("validate");
$v = new validate();
$v->isOk($supid, "num", 1, 20, "Invalid supplier number.");
# display errors, if any
$err = "";
if ($v->isError()) {
$errors = $v->getErrors();
foreach ($errors as $e) {
$err .= "<li class='err'>" . $e["msg"] . "</li>";
}
return $err;
}
# Get selected supplier info
db_connect();
$sql = "SELECT * FROM suppliers WHERE supid = '{$supid}' AND div = '" . USER_DIV . "'";
$suppRslt = db_exec($sql) or errDie("Unable to view Suppleir");
if (pg_numrows($suppRslt) < 1) {
return "<li class='err'>Invalid supplier Number.</li>";
}
$supp = pg_fetch_array($suppRslt);
//layout
$slct = "\r\n\t\t<h3>Supplier Reconciliation Statement<h3>\r\n\t\t<table " . TMPL_tblDflts . " width='580'>\r\n\t\t<form action='" . SELF . "' method='POST' name='form'>\r\n\t\t\t<input type='hidden' name='key' value='view'>\r\n\t\t\t<input type='hidden' name='supid' value='{$supid}'>\r\n\t\t\t<tr>\r\n\t\t\t\t<th>Supplier</th>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td class='" . bg_class() . "'>{$supp['supname']}</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<th>By Date Range</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'>\r\n\t\t\t\t\t" . mkDateSelect("from", date("Y"), date("m"), "01") . "\r\n\t\t\t\t\t TO \r\n\t\t\t\t\t" . mkDateSelect("to") . "\r\n\t\t\t\t</td>\r\n\t\t\t\t<td valign='bottom'><input type='submit' value='Search'></td>\r\n\t\t\t</tr>\r\n\t\t</form>\r\n\t\t</table>\r\n\t\t<p>\r\n\t\t<input type='button' value='[X] Close' onClick='javascript:parent.window.close();'>";
return $slct;
}
示例6: display
function display()
{
extract($_REQUEST);
$fields = array();
$fields["from_year"] = date("Y");
$fields["from_month"] = "01";
$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 timestamp, stkcod, stkdes, qty\n\t\t\tFROM cubit.stock_take_report\n\t\t\t\tLEFT JOIN cubit.stock ON stock_take_report.stkid=stock.stkid\n\t\t\tWHERE timestamp BETWEEN '{$from_date} 0:00:00' AND '{$to_date} 23:59:59'\n\t\t\tORDER BY timestamp, stkcod DESC";
$stktake_rslt = db_exec($sql) or errDie("Unable to retrieve report.");
$stock_take_ar = array();
while ($stktake_data = pg_fetch_array($stktake_rslt)) {
$stock_take_ar[$stktake_data["timestamp"]][] = "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>{$stktake_data['stkcod']}</td>\n\t\t\t\t<td>{$stktake_data['stkdes']}</td>\n\t\t\t\t<td>{$stktake_data['qty']}</td>\n\t\t\t</tr>";
}
$stock_take_out = "";
foreach ($stock_take_ar as $timestamp => $lv2) {
$stock_take_out = "\n\t\t<h3>{$timestamp}</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>Qty</th>\n\t\t\t</tr>";
foreach ($lv2 as $out) {
$stock_take_out .= $out;
}
$stock_take_out .= "\n\t\t</table>";
}
$OUTPUT = "\n\t<center>\n\t<h3>Stock Take 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{$stock_take_out}\n\t</center>";
return $OUTPUT;
}
示例7: 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;
}
示例8: 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 = "\n\tSELECT ordno, cordno, total FROM cubit.dispatch_scans\n\t\tLEFT JOIN cubit.sorders ON dispatch_scans.sordid=sorders.sordid\n\tWHERE timestamp BETWEEN '{$from_date} 0:00:00' AND '{$to_date} 23:59:59'\n\t\tAND duplicate='0'";
$dispatch_rslt = db_exec($sql) or errDie("Unable to retrieve scans.");
$report_out = "";
while ($dispatch_data = pg_fetch_array($dispatch_rslt)) {
$report_out .= "\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>{$dispatch_data['ordno']}</td>\n\t\t\t<td> </td>\n\t\t\t<td>{$dispatch_data['cordno']}</td>\n\t\t\t<td>{$dispatch_data['total']}</td>\n\t\t\t<td> </td>\n\t\t\t<td> </td>\n\t\t\t<td> </td>\n\t\t</tr>";
}
if (empty($report_out)) {
$report_out .= "\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td colspan='8'><li>No results found</li></td>\n\t\t</tr>";
}
$OUTPUT = "\n\t<h3>Dispatch 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>Order No.</th>\n\t\t\t<th>Invoice No.</th>\n\t\t\t<th>Customer Order No.</th>\n\t\t\t<th>Amount</th>\n\t\t\t<th>Date Dispatch</th>\n\t\t\t<th>How Dispatched</th>\n\t\t\t<th>Other Dispatch Information</th>\n\t\t</tr>\n\t\t{$report_out}\n\t</table>";
return $OUTPUT;
}
示例9: 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 = "\n\tSELECT id, stock.stkcod, stock.stkdes, qty, cost_per_unit, (qty*cost_per_unit) AS total,\n\t\textract('epoch' FROM timestamp) AS e_time\n\tFROM cubit.manu_hist_main\n\t\tLEFT JOIN cubit.stock ON manu_hist_main.stkid=stock.stkid\n\tWHERE timestamp BETWEEN '{$from_date} 0:00:00' AND '{$to_date} 23:59:59'\n\tORDER BY timestamp DESC";
$main_rslt = db_exec($sql) or errDie("Unable to retrieve main items.");
$hist_out = "";
while ($main_data = pg_fetch_array($main_rslt)) {
$hist_out .= "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td><b>" . date("d-m-Y", $main_data["e_time"]) . "</b></td>\n\t\t\t\t<td><b>({$main_data['stkcod']}) {$main_data['stkdes']}</b></td>\n\t\t\t\t<td align='center'><b>{$main_data['qty']}</b></td>\n\t\t\t\t<td align='right'><b>" . sprint($main_data["cost_per_unit"]) . "</b></td>\n\t\t\t\t<td align='right'><b>" . sprint($main_data["total"]) . "</b></td>\n\t\t\t</tr>";
$sql = "\n\t\tSELECT stkcod, stkdes, qty, cost_per_unit, (qty*cost_per_unit) AS total\n\t\tFROM cubit.manu_hist_sub\n\t\t\tLEFT JOIN cubit.stock ON manu_hist_sub.stkid=stock.stkid\n\t\tWHERE main_id='{$main_data['id']}'\n\t\tORDER BY timestamp ASC";
$sub_rslt = db_exec($sql) or errDie("Unable to retrieve sub items.");
while ($sub_data = pg_fetch_array($sub_rslt)) {
$hist_out .= "\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td> </td>\n\t\t\t\t\t<td>({$sub_data['stkcod']}) {$sub_data['stkdes']}</td>\n\t\t\t\t\t<td align='center'>{$sub_data['qty']}</td>\n\t\t\t\t\t<td align='right'>" . sprint($sub_data["cost_per_unit"]) . "</td>\n\t\t\t\t\t<td align='right'>" . sprint($sub_data["total"]) . "</td>\n\t\t\t\t</tr>";
}
}
if (empty($hist_out)) {
$hist_out = "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='5'><li>No results found.</li></td>\n\t\t\t</tr>";
}
$OUTPUT = "\n\t\t<center>\n\t\t<h3>Manufacturing Cost Report</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='4'>Date Range</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> <b>To</b> </td>\n\t\t\t\t<td>" . mkDateSelect("to", $to_year, $to_month, $to_day) . "</td>\n\t\t\t\t<td><input type='submit' value='Select' style='font-weight:bold' /></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Date</th>\n\t\t\t\t<th>Stock</th>\n\t\t\t\t<th>Qty</th>\n\t\t\t\t<th>Cost per Unit</th>\n\t\t\t\t<th>Total</th>\n\t\t\t</tr>\n\t\t\t{$hist_out}\n\t\t</table>\n\t\t</center>";
return $OUTPUT;
}
示例10: 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);
$OUTPUT = "<center>\r\n\t<h3>Equipment to be Returned</h3>\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='Continue' style='text-weight: bold' />\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t</table>";
// Retrieve equipment to be returned
$sql = "SELECT *,\r\n\t\t\t\t(SELECT des FROM cubit.assets WHERE id=asset_id) AS des,\r\n\t\t\t\t(SELECT serial FROM cubit.assets WHERE id=asset_id) AS serial\r\n\t\t\tFROM hire.hire_invitems\r\n\t\t\tORDER BY des ASC";
$items_rslt = db_exec($sql) or errDie("Unable to retrieve items.");
$items_out = "";
while ($items_data = pg_fetch_array($items_rslt)) {
$sql = "SELECT * FROM hire.hire_invoices WHERE invid='{$items_data['invid']}'";
$inv_rslt = db_exec($sql) or errDie("Unable to retrieve invoice.");
$inv_data = pg_fetch_array($inv_rslt);
$sql = "SELECT * FROM cubit.customers WHERE cusnum='{$inv_data['cusnum']}'";
$cust_rslt = db_exec($sql) or errDie("Unable to retrieve customer.");
$cust_data = pg_fetch_array($cust_rslt);
if (!hiredDate($items_data["id"])) {
continue;
}
$items_out .= "<tr class='" . bg_class() . "'>\r\n\t\t\t<td>" . hiredDate($items_data["id"]) . "</td>\r\n\t\t\t<td>" . returnDate($items_data["id"]) . "</td>\r\n\t\t\t<td>{$items_data['des']}</td>\r\n\t\t\t<td>" . getSerial($items_data["asset_id"]) . "</td>\r\n\t\t\t<td>{$items_data['qty']}</td>\r\n\t\t\t<td>{$cust_data['surname']} {$cust_data['cusname']}</td>\r\n\t\t\t<td>\r\n\t\t\t\t<a href='hire-invoice-new.php?invid={$items_data['invid']}'>\r\n\t\t\t\t\tView Hire\r\n\t\t\t\t</a>\r\n\t\t\t</td>\r\n\t\t</tr>";
}
$OUTPUT .= "<p></p>\r\n\t<table " . TMPL_tblDflts . ">\r\n\t\t<tr>\r\n\t\t\t<th>Hired</th>\r\n\t\t\t<th>To Be Returned</th>\r\n\t\t\t<th>Plant</th>\r\n\t\t\t<th>Serial</th>\r\n\t\t\t<th>Qty</th>\r\n\t\t\t<th>Customer</th>\r\n\t\t\t<th>Options</th>\r\n\t\t</tr>\r\n\t\t{$items_out}\r\n\t</table>\r\n\t</center>";
return $OUTPUT;
}
示例11: 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, des, description, service_description,\r\n\t\t\t\textract('epoch' FROM timestamp) AS e_time\r\n\t\t\tFROM hire.service_history\r\n\t\t\t\tLEFT JOIN cubit.assets ON service_history.asset_id=assets.id\r\n\t\t\tWHERE timestamp BETWEEN '{$from_date} 0:00:00' AND '{$to_date} 23:59:59'";
$hist_rslt = db_exec($sql) or errDie("Unable to retrieve service history.");
$hist_out = "";
while ($hist_data = pg_fetch_array($hist_rslt)) {
$hist_out .= "\r\n\t\t<tr class='" . bg_class() . "'>\r\n\t\t\t<td>" . date("d-m-Y G:i:s", $hist_data["e_time"]) . "</td>\r\n\t\t\t<td>{$hist_data['des']}</td>\r\n\t\t\t<td>" . getSerial($hist_data["id"]) . "</td>\r\n\t\t\t<td>{$hist_data['service_description']}</td>\r\n\t\t</tr>";
}
if (empty($hist_out)) {
$hist_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>Service History Report</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><input type='submit' value='Select' style='font-weight:bold' /></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>Date/Time</th>\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</tr>\r\n\t\t{$hist_out}\r\n\t</table>";
return $OUTPUT;
}
示例12: slct
function slct()
{
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</li>";
}
$Prds = "<select name='prd' style='width: 100%'>";
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 surname 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.</li>";
}
$custs = "<select name='cusnum' style='width: 100%'>";
while ($cus = pg_fetch_array($cusRslt)) {
$custs .= "<option value='{$cus['cusnum']}'>{$cus['cusname']} {$cus['surname']}</option>";
}
$custs .= "</select>";
//layout
$slct = "\n\t\t<h3>View Paid Invoices<h3>\n\t\t<table " . TMPL_tblDflts . " width='500'>\n\t\t<form action='" . SELF . "' method='POST' name='form'>\n\t\t\t<input type='hidden' name='key' value='view'>\n\t\t\t<tr>\n\t\t\t\t<th colspan='2'>By Date Range</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2' nowrap>\n\t\t\t\t\t" . mkDateSelect("from", date("Y"), date("m"), "01") . "\n\t\t\t\t\t TO \n\t\t\t\t\t" . mkDateSelect("to") . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>Select Customer</td>\n\t\t\t\t<td>{$custs}</td>\n\t\t\t\t<td><input type='submit' value='Search'></td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='2' align='center'>OR</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>Input customer account number</td>\n\t\t\t\t<td><input type='text' name='accnum' size='10'></td>\n\t\t\t\t<td valign='bottom'><input type='submit' value='View'></td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>All Customers</td>\n\t\t\t\t<td><input type='submit' name='all' value='List All »'></td>\n\t\t\t</tr>\n\t\t</form>\n\t\t</table>\n\t\t<p>\n\t\t<table border='0' cellpadding='2' cellspacing='1'>\n\t\t\t<tr>\n\t\t\t\t<th>Quick Links</th>\n\t\t\t</tr>\n\t\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t\t</table>";
return $slct;
}
示例13: slctacc
function slctacc($err = "")
{
extract($_POST);
db_conn(PRD_DB);
if (!isset($refnum)) {
$refnum = getrefnum();
}
// if (empty($jr_year)) {
// explodeDate(false, $jr_year, $jr_month, $jr_day);
// }
if (empty($dtaccid)) {
$dtaccid = false;
}
if (empty($ctaccid)) {
$ctaccid = false;
}
/** REFNUM **/
//Select Account <input align='right' type='button' onClick=\"popupSized('acc-new2.php?update_parent=yes','accounts','700','400');\" value='Add Account'>
if (!isset($yr_day)) {
$trans_date_setting = getCSetting("USE_TRANSACTION_DATE");
if (isset($trans_date_setting) and $trans_date_setting == "yes") {
$trans_date_value = getCSetting("TRANSACTION_DATE");
$date_arr = explode("-", $trans_date_value);
$jr_year = $date_arr[0];
$jr_month = $date_arr[1];
$jr_day = $date_arr[2];
} else {
$jr_year = date("Y");
$jr_month = date("m");
$jr_day = date("d");
}
}
$view = "\n\t\t<center>\n\t\t<h3> Journal transaction </h3>\n\t\t{$err}\n\t\t<form action='" . SELF . "' method='POST' name='form'>\n\t\t\t<input type='hidden' name='key' value='details' />\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Field</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>Date</td>\n\t\t\t\t<td>" . mkDateSelect("jr", $jr_year, $jr_month, $jr_day) . "</td>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>Reference Number</td>\n\t\t\t\t<td><input type='text' size='10' name='refnum' value='" . $refnum++ . "'></td>\n\t\t\t</tr>\n\t\t\t" . TBL_BR . "\n\t\t\t<tr>\n\t\t\t\t<td align='center'>\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<td><h4>Debit</h4></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<th>Select Account <input align='right' type='button' onClick=\"window.open('acc-new2.php?update_parent=yes','accounts','width=700, height=400');\" value='New Account'></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 valign='center'>" . mkAccSelect("dtaccid", $dtaccid) . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t\t<td align='center'>\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<td><h4>Credit</h4></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<th>Select Account <input align='right' type='button' onClick=\"window.open('acc-new2.php?update_parent=yes','accounts','width=700, height=400');\" value='New Account'></th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr bgcolor='" . bgcolorc(0) . "'>\n\t\t\t\t\t\t\t<td valign='center'>" . mkAccSelect("ctaccid", $ctaccid) . "</td>\n\t\t\t\t\t\t\t<td><input name='details' type='submit' value='Enter Details >'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<br />\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<td align='center'>\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<td><h4>Debit</h4></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<th>Account number</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr bgcolor='" . bgcolorc(0) . "'>\n\t\t\t\t\t\t\t<td valign='center'><input type='text' name='dtaccnum' size='20'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t\t<td align='center'>\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<td><h4>Credit</h4></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<th>Account number</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr bgcolor='" . bgcolorc(0) . "'>\n\t\t\t\t\t\t\t<td valign='center'><input type='text' name='ctaccnum' size='20'></td>\n\t\t\t\t\t\t\t<td><input type='submit' value='Enter Details >'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<br />\n\t\t</form>" . mkQuickLinks(ql("../reporting/index-reports.php", "Financials"), ql("../core/acc-new2.php", "Add New Account"), ql("trans-new.php", "Journal Transactions"));
return $view;
}
示例14: 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}";
if (isset($id)) {
$where = "AND doc_id='{$id}'";
} else {
$where = "";
}
$sql = "SELECT *,extract('epoch' FROM timestamp) AS e_time FROM cubit.document_movement\n\tWHERE (timestamp BETWEEN '{$from_date} 00:00:00' AND '{$to_date} 23:59:59') {$where} ORDER BY timestamp DESC";
$dm_rslt = db_exec($sql) or errDie("Unable to retrieve document movement");
$dm_out = "";
while ($dm_data = pg_fetch_array($dm_rslt)) {
$bgcolor = bgcolorg();
$dm_out .= "<tr class='" . bg_class() . "'>\n\t\t\t<td>" . date("d-m-Y G:i:s", $dm_data["e_time"]) . "</td>\n\t\t\t<td>{$dm_data['doc_id']}</td>\n\t\t\t<td>{$dm_data['project']}</td>\n\t\t\t<td>{$dm_data['area']}</td>\n\t\t\t<td>{$dm_data['discipline']}</td>\n\t\t\t<td>{$dm_data['doc_type']}</td>\n\t\t\t<td>{$dm_data['revision']}</td>\n\t\t\t<td>{$dm_data['drawing_num']}</td>\n\t\t\t<td>{$dm_data['sheet_num']}</td>\n\t\t\t<td>{$dm_data['title']}</td>\n\t\t\t<td>{$dm_data['location']}</td>\n\t\t\t<td>{$dm_data['contract']}</td>\n\t\t\t<td>{$dm_data['contractor']}</td>\n\t\t\t<td>{$dm_data['code']}</td>\n\t\t\t<td>{$dm_data['issue_for']}</td>\n\t\t\t<td>{$dm_data['qs']}</td>\n\t\t\t<td>{$dm_data['status']}</td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td colspan='20'>{$dm_data['movement_description']}</td>\n\t\t</tr>";
}
if (empty($dm_out)) {
$dm_out = "<tr class='" . bg_class() . "'>\n\t\t\t<td colspan='20'><li>No results found.</li></td>\n\t\t</tr>";
}
$OUTPUT = "<center>\n\t<h3>Document Movement 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>Time</th>\n\t\t\t<th>Record Number</th>\n\t\t\t<th>Project</th>\n\t\t\t<th>Area</th>\n\t\t\t<th>Discipline</th>\n\t\t\t<th>Document Type</th>\n\t\t\t<th>Revision</th>\n\t\t\t<th>Drawing Number</th>\n\t\t\t<th>Sheet Number</th>\n\t\t\t<th>Title</th>\n\t\t\t<th>Location</th>\n\t\t\t<th>Contract</th>\n\t\t\t<th>Contractor</th>\n\t\t\t<th>Code</th>\n\t\t\t<th>Issue For</th>\n\t\t\t<th>QS</th>\n\t\t\t<th>Status</th>\n\t\t</tr>\n\t\t{$dm_out}\n\t</table>";
return $OUTPUT;
}
示例15: 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;
}