/** * builds html for type: date * * @param string $name * @param array $opts */ private function getfld_date($name, $opts) { $OUT = ""; $o = $this->getfld_extraopts($opts, "_day"); $OUT .= "<input size='2' type='text' name='{$name}_day' id='{$name}_day' value='{$opts['day']}' {$o} /> "; $o = $this->getfld_extraopts($opts, "_month"); $OUT .= "<input size='2' type='text' name='{$name}_month' id='{$name}_month' value='{$opts['month']}' {$o} /> "; $o = $this->getfld_extraopts($opts, "_year"); $OUT .= "<input size='4' type='text' name='{$name}_year' id='{$name}_year' value='{$opts['year']}' {$o} /> "; $OUT .= mkDateSelectB($name, $opts["array"]); return $OUT; }
function details($_GET) { # get vars extract($_GET); # validate input require_lib("validate"); $v = new validate(); foreach ($invids as $key => $invid) { $v->isOk($invid, "num", 1, 20, "Invalid recuring invoice number."); } # display errors, if any if ($v->isError()) { $err = ""; $errors = $v->getErrors(); foreach ($errors as $e) { $err .= "<li class='err'>" . $e["msg"] . "</li>"; } $confirm .= "<p><input type='button' onClick='JavaScript:history.back();' value='« Correct submission'>"; return $confirm; } $invs = ""; $i = 0; $dids = array(); foreach ($invids as $key => $invid) { # Get recuring invoice info db_connect(); $sql = "SELECT * FROM rnons_invoices WHERE invid = '{$invid}' AND div = '" . USER_DIV . "'"; $invRslt = db_exec($sql) or errDie("Unable to get recuring invoice information"); if (pg_numrows($invRslt) < 1) { return "<i class='err'>Not Found</i>"; } $inv = pg_fetch_array($invRslt); $dids[] = $i; $inv['total'] = sprint($inv['total']); $inv['balance'] = sprint($inv['balance']); # Format date //list($oyear, $omon, $oday) = explode("-", date("Y-m-d")); $invs .= "\n\t\t\t<input type='hidden' name='invids[{$i}]' value='{$inv['invid']}' />\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>RI {$inv['invid']}</td>\n\t\t\t\t<td valign='center' nowrap='t'>\n\t\t\t\t\t" . mkDateSelectA("o", $i) . "\n\t\t\t\t</td>\n\t\t\t\t<td>{$inv['cusname']}</td>\n\t\t\t\t<td align='right'>" . CUR . " {$inv['total']}</td>\n\t\t\t</tr>"; $i++; } $printInv = "\n\t\t<h3>Confirm Non-stock Invoice Process</h3>\n\t\t<script>\n\t\t\tfunction updateAllDates(obj) {\n\t\t\t\talert(obj.value);\n\t\t\t}\n\t\t</script>\n\t\t<form action='nons-rec-invoice-proc.php' method='POST'>\n\t\t\t<input type='hidden' name='key' value='process' />\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<td colspan='6' class='err'>Please Note : This process might take long depending on the number of invoices. It is best to run it overnight.</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td> </td>\n\t\t\t\t<td>" . mkDateSelectB("o", implode(",", $dids), "Select Date for All Invoices") . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th>Invoice No.</th>\n\t\t\t\t<th>Invoice Date</th>\n\t\t\t\t<th>Customer Name</th>\n\t\t\t\t<th>Grand Total</th>\n\t\t\t</tr>\n\t\t\t{$invs}\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td colspan='6' align='right'>Totals Invoices : {$i}</td>\n\t\t\t</tr>\n\t\t\t" . TBL_BR . "\n\t\t\t<tr>\n\t\t\t\t<td colspan='6' align='right'><input type='submit' value='Process >' /></td>\n\t\t\t</tr>\n\t\t\t</form></table>" . mkQuickLinks(ql("rec-nons-invoice-new.php", "New Recurring Non Stock Invoice"), ql("rec-nons-invoice-view.php", "View Recurring Non Stock Invoices")); return $printInv; }