function show() { if (!$this->queryresult) { return false; } while ($therecord = $this->db->fetchArray($this->queryresult)) { if ($therecord["name"] != "base") { echo formatVariable($therecord["displayname"]) . ": v" . $therecord["version"] . "<br />"; } else { echo '<strong>v' . $therecord["version"] . '</strong><br /><br />'; } } //endwhile return true; }
<tbody> <tr><td id="parenDiscount"><?php if ($therecord["discountname"]) { echo "(" . htmlQuotes($therecord["discountname"]) . ")"; } else { echo " "; } ?> </td></tr> <tr><td class="blanks"> </td></tr> <tr><td id="parenTax"> <?php if ($therecord["taxname"] || (int) $therecord["taxpercentage"] != 0) { echo "("; if ($therecord["taxname"]) { echo formatVariable($therecord["taxname"]) . ": "; } echo $therecord["taxpercentage"] . "%)"; } else { echo " "; } ?> </td></tr> <tr><td id="parenShipping"> <?php if ($therecord["shippingmethodid"]) { echo "(" . htmlQuotes($shippingMethods[$therecord["shippingmethodid"]]["name"]) . ")"; } else { echo " "; } ?>
function _getItems() { $querystatement = "\n\t\t\tSELECT\n\t\t\t\t`aritems`.`id`,\n\t\t\t\t`aritems`.`type`,\n\t\t\t\tIF(`invoices`.`id`,`invoices`.`id`,`receipts`.`id`) AS `relatedid`,\n\t\t\t\t`aritems`.`itemdate`,\n\t\t\t\t`aritems`.`amount`,\n\t\t\t\t`aritems`.`amount` - `aritems`.`paid` AS `due`\n\t\t\tFROM\n\t\t\t\t(`aritems` LEFT JOIN `invoices` ON `aritems`.`relatedid` = `invoices`.`uuid`) LEFT JOIN `receipts` ON `aritems`.`relatedid` = `receipts`.`uuid`\n\t\t\tWHERE\n\t\t\t\t`aritems`.`posted` =1\n\t\t\t\tAND `aritems`.`clientid` = '" . mysql_real_escape_string($this->clientrecord["clientid"]) . "'\n\t\t"; if (!$this->showClosed) { $querystatement .= "\n\t\t\t\tAND `aritems`.`status` = 'open'"; } $querystatement .= "\n\t\t\t\tAND `aritems`.itemdate <= '" . dateToString($this->statementDate, "SQL") . "'\n\t\t\tORDER BY\n\t\t\t\t`aritems`.itemdate,\n\t\t\t\t`aritems`.id"; $queryresult = $this->db->query($querystatement); $returnArray = array(); $this->clientTotals = array("docamount" => 0, "current" => 0, "term1" => 0, "term2" => 0, "term3" => 0); while ($therecord = $this->db->fetchArray($queryresult)) { $itemdate = stringToDate($therecord["itemdate"], "SQL"); $therecord["current"] = " "; $therecord["term1"] = " "; $therecord["term2"] = " "; $therecord["term3"] = " "; if ($therecord["type"] != "invoice") { $this->clientTotals["current"] += $therecord["due"]; $therecord["current"] = formatVariable($therecord["due"], "currency"); } else { $daysover = floor(($this->statementDate - $itemdate) / 86400); if ($daysover > TERM3_DAYS) { $this->clientTotals["term3"] += $therecord["due"]; $therecord["term3"] = formatVariable($therecord["due"], "currency"); } elseif ($daysover > TERM2_DAYS) { $this->clientTotals["term2"] += $therecord["due"]; $therecord["term2"] = formatVariable($therecord["due"], "currency"); } elseif ($daysover > TERM1_DAYS) { $this->clientTotals["term1"] += $therecord["due"]; $therecord["term1"] = formatVariable($therecord["due"], "currency"); } else { $this->clientTotals["current"] += $therecord["due"]; $therecord["current"] = formatVariable($therecord["due"], "currency"); } } //endif $therecord["itemdate"] = formatFromSQLDate($therecord["itemdate"]); $this->clientTotals["docamount"] += $therecord["amount"]; $therecord["amount"] = formatVariable($therecord["amount"], "currency"); $therecord["due"] = formatVariable($therecord["due"], "currency"); $returnArray[$therecord["itemdate"] . "-" . $therecord["id"]] = $therecord; } //endwhile if ($this->showPayments != "none") { //add in receipts in laste term1_days $lastDays = dateToString(strtotime("-" . TERM1_DAYS . " days", $this->statementDate), "SQL"); $querystatement = "\n\t\t\t\tSELECT\n\t\t\t\t\tid,\n\t\t\t\t\treceiptdate,\n\t\t\t\t\tamount\n\t\t\t\tFROM\n\t\t\t\t\treceipts\n\t\t\t\tWHERE\n\t\t\t\t\tclientid = '" . mysql_real_escape_string($this->clientrecord["clientid"]) . "'\n\t\t\t"; if ($this->showPayments == "new") { $querystatement .= "\n\t\t\t\tAND receiptdate <= '" . dateToString($this->statementDate, "SQL") . "'\n\t\t\t\tAND receiptdate >= '" . $lastDays . "'"; } $querystatement .= "\n\t\t\t\tAND posted = 1"; $receiptresult = $this->db->query($querystatement); while ($receiptrecord = $this->db->fetchArray($receiptresult)) { $rcptRecord["itemdate"] = formatFromSQLDate($receiptrecord["receiptdate"]); $rcptRecord["type"] = "payment"; $rcptRecord["relatedid"] = " "; $rcptRecord["amount"] = "(" . formatVariable($receiptrecord["amount"], "currency") . ")"; $rcptRecord["current"] = " "; $rcptRecord["term1"] = " "; $rcptRecord["term2"] = " "; $rcptRecord["term3"] = " "; $rcptRecord["due"] = " "; $returnArray[$receiptrecord["receiptdate"] . "-D" . $receiptrecord["id"]] = $rcptRecord; } //endwhile } //end if ksort($returnArray); return $returnArray; }
+-------------------------------------------------------------------------+ */ require_once "include/session.php"; require_once "include/login_include.php"; if (isset($_POST["name"]) && isset($_POST["password"])) { $login = new login($db); $failed = $login->verify($_POST["name"], $_POST["password"]); } else { $failed = ""; $_POST["name"] = ""; } //endif if (isset($_SESSION["userinfo"])) { goURL(DEFAULT_LOAD_PAGE); } $pageTitle = formatVariable(APPLICATION_NAME) . " Log in"; $phpbms->cssIncludes[] = "pages/login.css"; $phpbms->jsIncludes[] = "common/javascript/login.js"; $phpbms->showMenu = false; $phpbms->showFooter = false; include "header.php"; ?> <div id="loginbox" class="bodyline" > <h1><span><?php echo APPLICATION_NAME; ?> </span></h1> <?php if ($failed) {
function display($result) { // This function will spit out a JSON array of records $output = "{totalRecords: " . $this->totalcount . ", resultRecords: ["; while ($therecord = $this->db->fetchArray($result)) { $output .= "{display: '" . str_replace("'", "\\'", formatVariable($therecord["display"], "bbcode")) . "',"; $output .= "value: '" . str_replace("'", "\\'", formatVariable($therecord["value"])) . "',"; $output .= "secondary: '" . str_replace("'", "\\'", formatVariable($therecord["secondary"], "bbcode")) . "',"; $output .= "classname: '" . str_replace("'", "\\'", formatVariable($therecord["classname"])) . "'},"; } //endwhile if ($output != "{totalRecords: " . $this->totalcount . ", resultRecords: [") { $output = substr($output, 0, strlen($output) - 1); } $output .= "] }"; header("Content-type: text/plain"); echo $output; }
function display() { ?> <div class="box widgets" id="<?php echo $this->uuid; ?> "> <div class="widgetOptions" id="<?php echo $this->uuid; ?> Options"> <button type="button" id="<?php echo $this->uuid; ?> RemoveButton" class="graphicButtons buttonMinus widgetRemoves" title="remove widget"><span>remove widget</span></button> </div> <h2 class="widgetTitles"><?php echo formatVariable($this->title); ?> </h2> <?php $this->displayMiddle(); ?> </div> <?php }
</div> <div id="leftSideDiv"> <fieldset> <legend><label for="content">memo</label></legend> <p id="timeStampP"> <button id="timeStampButton" type="button" class="graphicButtons buttonTimeStamp" accesskey="t" title="Add time stamp to memo (Access Key - t)">time stamp</button> </p> <p> <textarea name="content" cols="45" rows="23" id="content"><?php echo htmlQuotes($therecord["content"]); ?> </textarea> <input id = "username" type="hidden" value="<?php echo formatVariable(trim($_SESSION["userinfo"]["firstname"] . " " . $_SESSION["userinfo"]["lastname"])); ?> " /> </p> </fieldset> </div> <div id="repeatDiv"> <div <?php if ($therecord["parentid"]) { echo 'style="display:none;"'; } ?> > <input type="hidden" id="bypass" name="bypass" value=""/>
function _getItems() { $querystatement = "\n\t\t\tSELECT\n\t\t\t\t`aritems`.`id`,\n\t\t\t\t`aritems`.`type`,\n\t\t\t\tIF(`invoices`.`id`,`invoices`.`id`,`receipts`.`id`) AS `relatedid`,\n\t\t\t\t`aritems`.`itemdate`,\n\t\t\t\t`aritems`.`amount`,\n\t\t\t\t`aritems`.`amount` - `paid` AS due\n\t\t\tFROM\n\t\t\t\t(`aritems` LEFT JOIN `invoices` ON `aritems`.`relatedid` = `invoices`.`uuid`) LEFT JOIN `receipts` ON `aritems`.`relatedid` = `receipts`.`uuid`\n\t\t\tWHERE\n\t\t\t\t`aritems`.posted = 1\n\t\t\t\tAND `aritems`.clientid = '" . mysql_real_escape_string($this->clientrecord["clientid"]) . "'\n\t\t"; if (!$this->showClosed) { $querystatement .= "\n\t\t\t\tAND `aritems`.`status` = 'open'"; } $querystatement .= "\n\t\t\t\tAND `aritems`.itemdate <= '" . dateToString($this->statementDate, "SQL") . "'\n\t\t\tORDER BY\n\t\t\t\t`aritems`.itemdate,\n\t\t\t\t`aritems`.id"; $queryresult = $this->db->query($querystatement); $returnArray = array(); $serviceChargeAmount = 0; while ($therecord = $this->db->fetchArray($queryresult)) { if ($therecord["type"] == "service charge") { $serviceChargeAmount += $therecord["due"]; } else { $itemdate = stringToDate($therecord["itemdate"], "SQL"); if ($therecord["type"] != "invoice") { $therecord["dayspd"] = ""; } else { $daysover = floor(($this->statementDate - $itemdate) / 86400) - TERM1_DAYS; if ($daysover + TERM1_DAYS > TERM3_DAYS) { $this->term3Total += $therecord["due"]; } elseif ($daysover + TERM1_DAYS > TERM2_DAYS) { $this->term2Total += $therecord["due"]; } elseif ($daysover > 0) { $this->term1Total += $therecord["due"]; } else { $this->currentTotal += $therecord["due"]; $daysover = ""; } //end if if ($therecord["due"] > 0) { $therecord["dayspd"] = $daysover; } else { $therecord["dayspd"] = "(paid in full)"; } } //endif $keydate = $therecord["itemdate"]; $therecord["itemdate"] = formatFromSQLDate($therecord["itemdate"]); $therecord["amount"] = formatVariable($therecord["amount"], "currency"); $therecord["due"] = formatVariable($therecord["due"], "currency"); $returnArray[$keydate . "-" . $therecord["id"]] = $therecord; } //end if } //endwhile if ($serviceChargeAmount) { $serviceRecord["itemdate"] = dateToString($this->statementDate); $serviceRecord["dayspd"] = ""; $serviceRecord["type"] = "service charges"; $serviceRecord["relatedid"] = ""; $serviceRecord["amount"] = formatVariable($serviceChargeAmount, "currency"); $serviceRecord["due"] = formatVariable($serviceChargeAmount, "currency"); $this->currentTotal += $serviceChargeAmount; $returnArray[dateToString($this->statementDate, "SQL") . "-XXX"] = $serviceRecord; } //endif if ($this->showPayments) { //add in receipts in laste term1_days $lastDays = dateToString(strtotime("-" . TERM1_DAYS . " days", $this->statementDate), "SQL"); $querystatement = "SELECT\n\t\t\t\tid,\n\t\t\t\treceiptdate,\n\t\t\t\tamount\n\t\t\tFROM\n\t\t\t\treceipts\n\t\t\tWHERE\n\t\t\t\tclientid = '" . mysql_real_escape_string($this->clientrecord["clientid"]) . "'\n\t\t\t\tAND receiptdate <= '" . dateToString($this->statementDate, "SQL") . "'\n\t\t\t\tAND receiptdate >= '" . $lastDays . "'\n\t\t\t\tAND posted = 1"; $receiptresult = $this->db->query($querystatement); while ($receiptrecord = $this->db->fetchArray($receiptresult)) { $rcptRecord["itemdate"] = formatFromSQLDate($receiptrecord["receiptdate"]); $rcptRecord["dayspd"] = ""; $rcptRecord["type"] = "payment"; $rcptRecord["relatedid"] = ""; $rcptRecord["amount"] = "(" . formatVariable($receiptrecord["amount"], "currency") . ")"; $rcptRecord["due"] = ""; $returnArray[$receiptrecord["receiptdate"] . "-D" . $receiptrecord["id"]] = $rcptRecord; } //endwhile } //end if ksort($returnArray); return $returnArray; }
function showLineItems($invoiceid, $indent) { $querystatement = "\n\t\t\tSELECT\n\t\t\t\t`products`.`partnumber`,\n\t\t\t\t`products`.`partname`,\n\t\t\t\t`quantity`,\n\t\t\t\t`lineitems`.`unitprice`,\n\t\t\t\t`quantity`*`lineitems`.`unitprice` AS `extended`\n\t\t\tFROM\n\t\t\t\t(`lineitems` LEFT JOIN `products` ON `lineitems`.`productid`=`products`.`uuid`)\n\t\t\tWHERE\n\t\t\t\t`lineitems`.`invoiceid`='" . $invoiceid . "'"; $queryresult = $this->db->query($querystatement); if ($this->db->numRows($queryresult)) { ?> <tr><td class="invoices" style="padding-left:<?php echo $indent + 2; ?> px;"> <table border="0" cellspacing="0" cellpadding="0" id="lineitems"> <tr> <th width="65%" align="left">product</th> <th width="24%" align="right" nowrap="nowrap">price</th> <th width="12%" align="right" nowrap="nowrap">qty.</th> <th width="24%" align="right" nowrap="nowrap">ext.</th> </tr> <?php while ($therecord = $this->db->fetchArray($queryresult)) { ?> <tr> <td><?php echo $therecord["partnumber"]; ?> <?php echo $therecord["partname"]; ?> </td> <td align="right" nowrap="nowrap"><?php echo numberToCurrency($therecord["unitprice"]); ?> </td> <td align="right" nowrap="nowrap"><?php echo formatVariable($therecord["quantity"], "real"); ?> </td> <td align="right" nowrap="nowrap"><?php echo numberToCurrency($therecord["extended"]); ?> </td> </tr> <?php } // endwhile ?> </table></td> <?php for ($i = 1; $i < count($this->selectcolumns); $i++) { echo "<td> </td>"; } ?> </tr><?php } // endif }
function _addTotals() { $pdf =& $this->pdf; $size = 0; foreach ($this->totalsinfo as $column) { switch ($column->fieldname) { case "shipping": case "discountamount": if ($this->invoicerecord[$column->fieldname]) { $size += $column->size; } break; default: $size += $column->size; } } //endswitch $this->totalsinfo[1]->size = $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - $size; $height = 0.5; $nextPos = $pdf->GetY() + $height + 0.125; if (!$this->settings["templateFormatting"]) { $pdf->Rect($pdf->GetX(), $pdf->GetY(), $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, $height); $pdf->setStyle("header"); foreach ($this->totalsinfo as $column) { switch ($column->fieldname) { case "shipping": case "discountamount": if ($this->invoicerecord[$column->fieldname]) { $pdf->Cell($column->size, 0.18, $column->title, 1, 0, $column->align, 1); } break; default: $pdf->Cell($column->size, 0.18, $column->title, 1, 0, $column->align, 1); } } //endswitch } //endif $pdf->setStyle("normal"); $pdf->SetFont("Arial", "B", 10); $pdf->SetXY($pdf->leftmargin, $pdf->GetY() + 0.18 + 0.0625); foreach ($this->totalsinfo as $column) { if ($column->format != "") { $value = formatVariable($this->invoicerecord[$column->fieldname], $column->format); } else { $value = $this->invoicerecord[$column->fieldname]; } switch ($column->fieldname) { case "shipping": case "discountamount": if ($this->invoicerecord[$column->fieldname]) { $pdf->Cell($column->size, 0.18, $value, $pdf->borderDebug, 0, $column->align); } break; default: $pdf->Cell($column->size, 0.18, $value, $pdf->borderDebug, 0, $column->align); } //endswitch } //end foreach $this->totalsinfo[1]->size = 0; $pdf->SetXY($pdf->leftmargin, $nextPos); }
function display($record) { $output = "{"; foreach ($record as $key => $value) { if (!is_array($value)) { $output .= $key . ":'" . str_replace("'", "\\'", formatVariable($value)) . "',"; } else { $output .= $key . ":{"; foreach ($value as $skey => $svalue) { $output .= $skey . ":'" . str_replace("'", "\\'", formatVariable($svalue)) . "',"; } $output = substr($output, 0, strlen($output) - 1); $output .= "},"; } //endif is_array } //endforeach - record $output = substr($output, 0, strlen($output) - 1); $output .= "}"; header("Content-type: text/plain"); echo $output; }
function show($itemslist, $receiptPosted, $receiptid) { $count = 1; foreach ($itemslist as $therecord) { $recID = "i" . $count; if ($therecord["type"] == "invoice") { $tempDate = stringToDate($therecord["itemdate"], "SQL"); $dueDate = dateToString(strtotime(TERM1_DAYS . " days", $tempDate)); } else { $dueDate = " "; } if ($therecord["type"] == "credit" && $therecord["relatedid"] == $receiptid) { $therecord["relatedid"] = ""; $therecord["amount"] = 0; $therecord["aritemid"] = ""; $therecord["invoiceid"] = ""; } if ($receiptPosted) { $docDue = $therecord["amount"] - $therecord["paid"]; } elseif ($therecord["relatedid"]) { $docDue = $therecord["amount"] - $therecord["paid"] - $therecord["applied"] - $therecord["discount"] - $therecord["taxadjustment"]; } else { $docDue = 0; } ?> <tr id="<?php echo $recID; ?> " class="receiptTR"> <td> <input type="hidden" id="<?php echo $recID; ?> ARID" value="<?php echo $therecord["aritemid"]; ?> " /> <input type="hidden" id="<?php echo $recID; ?> RecID" value="<?php echo $therecord["relatedid"]; ?> " /> <input id="<?php echo $recID; ?> DocRef" class="invisibleTextField" readonly="readonly" value="<?php echo $therecord["invoiceid"]; ?> " size="4"/> </td> <td><input id="<?php echo $recID; ?> Type" class="invisibleTextField" readonly="readonly" value="<?php echo $therecord["type"]; ?> " size="12" /></td> <td><input id="<?php echo $recID; ?> DocDate" class="invisibleTextField" readonly="readonly" value="<?php echo formatFromSQLDate($therecord["itemdate"]); ?> " size="9" /></td> <td><input id="<?php echo $recID; ?> DueDate" class="invisibleTextField" readonly="readonly" value="<?php echo $dueDate; ?> " size="9" /></td> <td align="right"> <input type="hidden" id="<?php echo $recID; ?> DocPaid" value="<?php echo $therecord["paid"]; ?> " /> <input id="<?php echo $recID; ?> DocAmount" class="invisibleTextField currency" readonly="readonly" value="<?php echo formatVariable($therecord["amount"], "currency"); ?> " size="10" maxlength="12"/> </td> <td><input id="<?php echo $recID; ?> DocDue" class="invisibleTextField currency dueFields" readonly="readonly" value="<?php echo formatVariable($docDue, "currency"); ?> " size="10" maxlength="12"/></td> <td><input id="<?php echo $recID; ?> Applied" class="currency appliedFields" value="<?php echo formatVariable($therecord["applied"], "currency"); ?> " size="10" maxlength="12"/></td> <td><input id="<?php echo $recID; ?> Discount" class="currency" value="<?php echo formatVariable($therecord["discount"], "currency"); ?> " size="10" maxlength="12"/></td> <td><input id="<?php echo $recID; ?> TaxAdj" class="currency" value="<?php echo formatVariable($therecord["taxadjustment"], "currency"); ?> " size="10" maxlength="12"/></td> <td><button type="button" id="<?php echo $recID; ?> RemoveARItemButton" class="graphicButtons buttonMinus" title="remove item"><span>-</span></button></td> </tr> <?php $count++; } //end foreach }
/** * function showRecords * @param array $recordArray */ function showRecords($recordArray) { global $phpbms; ?> <table border="0" cellpadding="3" cellspacing="0" class="querytable"> <thead> <tr> <th nowrap="nowrap"align="left" width="100%">name</th> <th nowrap="nowrap"align="center">allowed</th> <th nowrap="nowrap"align="center">need select</th> <th nowrap="nowrap"align="left">function name</th> <th nowrap="nowrap"align="left">access</th> <th nowrap="nowrap"align="right">display order</th> <th nowrap="nowrap"> </th> </tr> </thead> <tfoot> <tr class="queryfooter"> <td colspan="7"> </td> </tr> </tfoot> <tbody> <?php if (count($recordArray)) { $row = 1; $other = 4; foreach ($recordArray as $therecord) { $row = $row == 1 ? 2 : 1; if ($therecord["commandtype"] !== $other) { switch ($therecord["commandtype"]) { case 1: $title = "Integrated Features"; break; case 2: $title = "Additional Commands"; break; case 3: $title = "Api Commands"; break; } //end if ?> <tr class="queryGroup"><td colspan="7"><?php echo $title; ?> </td></tr><?php $other = $therecord["commandtype"]; } //end if ?> <tr class="qr<?php echo $row; ?> noselects"> <td nowrap="nowrap" class="important"> <?php if ($therecord["othercommand"]) { echo formatVariable($therecord["option"]); } else { echo formatVariable($therecord["name"]); } ?> </td> <td nowrap="nowrap" align="center"> <?php if ($therecord["othercommand"]) { echo " "; } else { echo formatVariable($therecord["option"], "boolean"); } ?> </td> <td nowrap="nowrap" align="center"> <?php if (!$therecord["othercommand"]) { echo " "; } else { echo formatVariable($therecord["needselect"], "boolean"); } ?> </td> <td nowrap="nowrap" align="center"> <?php if ($therecord["othercommand"]) { echo formatVariable($therecord["displayname"]); } else { echo " "; } ?> </td> <td nowrap="nowrap"> <?php $phpbms->displayRights($therecord["roleid"], $therecord["rolename"]); ?> </td> <td nowrap="nowrap" align="right"> <?php echo $therecord["displayorder"]; ?> </td> <td nowrap="nowrap" valign="top"> <button id="edt<?php echo $therecord["id"]; ?> " type="button" class="graphicButtons buttonEdit"><span>edit</span></button> <button id="del<?php echo $therecord["id"]; ?> " type="button" class="graphicButtons buttonDelete"><span>delete</span></button> </td> </tr> <?php } //endwhile } else { ?> <tr class="norecords"><td colspan="6">No Options Set</td></tr><?php } //end if ?> </tbody> </table> <?php }
function displayMiddle() { $querystatement = "\n SELECT\n SUM((1-(aged1 * aged2 * aged3)) * (amount-paid)) AS current,\n SUM((amount-paid)*aged1*(1-aged2)) AS term1,\n SUM((amount-paid)*aged2*(1-aged3)) AS term2,\n SUM((amount-paid)*aged3) AS term3,\n SUM(amount-paid) AS due\n FROM\n aritems\n WHERE\n `status` = 'open'\n AND posted=1"; $queryresult = $this->db->query($querystatement); $therecord = $this->db->fetchArray($queryresult); ?> <table> <tbody> <tr> <td align="right"><p>current</p></td> <td><p><?php echo formatVariable($therecord["current"], "currency"); ?> </p></td> </tr> <tr> <td align="right"><p><?php echo TERM1_DAYS + 1 . " - " . TERM2_DAYS; ?> </p></td> <td><p><?php echo formatVariable($therecord["term1"], "currency"); ?> </p></td> </tr> <tr> <td align="right"><p><?php echo TERM2_DAYS + 1 . " - " . TERM3_DAYS; ?> </p></td> <td><p><?php echo formatVariable($therecord["term2"], "currency"); ?> </p></td> </tr> <tr> <td align="right"><p><?php echo TERM3_DAYS + 1 . "+"; ?> </p></td> <td><p><?php echo formatVariable($therecord["term3"], "currency"); ?> </p></td> </tr> <tr> <td align="right" class="important"><p>total</p></td> <td class="important"><p><?php echo formatVariable($therecord["due"], "currency"); ?> </p></td> </tr> </tbody> </table> <?php }
function showRecords() { $rownum = 1; $this->db->seek($this->queryresult, 0); //groupings if ($this->showGroupings) { for ($i = 0; $i < count($this->thegroupings); $i++) { $this->thegroupings[$i]["theValue"] = ""; } } while ($therecord = $this->db->fetchArray($this->queryresult)) { // more groupings if ($this->showGroupings) { for ($i = 0; $i < count($this->thegroupings); $i++) { if ($this->thegroupings[$i]["theValue"] != $therecord["_group" . ($i + 1)]) { $this->thegroupings[$i]["theValue"] = $therecord["_group" . ($i + 1)]; ?> <tr class="queryGroup"><td colspan = "<?php echo count($this->thecolumns); ?> " <?php if ($i) { echo 'style = "padding-left:' . $i * 15 . 'px"'; } ?> > <?php if ($this->thegroupings[$i]["displayname"]) { echo htmlQuotes($this->thegroupings[$i]["displayname"] . ": "); } echo $therecord["_group" . ($i + 1)]; ?> </td></tr><?php $rownum = 1; } //endif } //endfor } //endif ?> <tr id="<?php echo $this->uniqueName . ":" . $therecord["theid"]; ?> " class="qr<?php echo $rownum; ?> "><?php if ($rownum == 1) { $rownum++; } else { $rownum = 1; } foreach ($this->thecolumns as $thecolumn) { ?> <td align="<?php echo $thecolumn["align"]; ?> " <?php if (!$thecolumn["wrap"]) { echo "nowrap=\"nowrap\""; } ?> ><?php echo $therecord[$thecolumn["name"]] !== "" ? formatVariable($therecord[$thecolumn["name"]], $thecolumn["format"]) : " "; ?> </td><?php } //endforeach ?> </tr><?php } //endwhile }
/** * function generate * * Creates the main part of the report (table) */ function generate() { $fromFields = "*"; $columns = array(); foreach ($this->settings as $key => $value) { if (strpos($key, "column") === 0) { $pos = substr($key, 6) - 1; $columns[$pos]["field"] = $value; if (isset($this->settings["titleColumn" . ($pos + 1)])) { $columns[$pos]["title"] = $this->settings["titleColumn" . ($pos + 1)]; } else { $columns[$pos]["title"] = ""; } } //endif } //endforeach if (count($columns)) { ksort($columns); $columns = array_reverse($columns); $fromFields = ""; foreach ($columns as $column) { $fromFields .= ", " . $column["field"]; if ($column["title"]) { $fromFields .= " AS `" . $column["title"] . "`"; } $fromFields .= "\n"; } //endforeach $fromFields = substr($fromFields, 1); } //endif if (isset($this->settings["fromTable"])) { $querytable = $this->settings["fromTable"]; } else { $querytable = $this->maintable; } $querystatement = "\n SELECT\n " . $fromFields . "\n FROM\n " . $querytable; $querystatement = $this->assembleSQL($querystatement); $queryresult = $this->db->query($querystatement); $num_fields = $this->db->numFields($queryresult); if (!isset($this->settings["reportTitle"])) { $this->settings["reportTitle"] = $this->displayname; } ob_start(); ?> <div id="container"> <h1><?php echo formatVariable($this->settings["reportTitle"]); ?> </h1> <table id="results"> <thead> <tr> <?php for ($i = 0; $i < $num_fields; $i++) { ?> <th <?php if ($i == $num_fields - 1) { echo 'id="lastHeader"'; } ?> ><?php echo $this->db->fieldName($queryresult, $i); ?> </th> <?php } //end for ?> </tr> </thead> <tbody> <?php while ($therecord = $this->db->fetchArray($queryresult)) { ?> <tr><?php foreach ($therecord as $value) { ?> <td><?php echo formatVariable($value); ?> </td><?php } //end foreach ?> </tr><?php } //endwhile ?> </tbody> </table> </div> <?php $this->reportOutput = ob_get_contents(); ob_end_clean(); }
$has_session_value = isset($serverVarsSession[$name]) && $serverVarsSession[$name] != $value; $row_class = ($odd_row ? ' odd' : ' even') . ($has_session_value ? ' diffSession' : ''); $output .= '<div class="var-row' . $row_class . '">' . '<div class="var-name">'; // To display variable documentation link if (isset($VARIABLE_DOC_LINKS[$name])) { $output .= '<span title="' . htmlspecialchars(str_replace('_', ' ', $name)) . '">'; $output .= PMA_Util::showMySQLDocu($VARIABLE_DOC_LINKS[$name][1], $VARIABLE_DOC_LINKS[$name][1], false, $VARIABLE_DOC_LINKS[$name][2] . '_' . $VARIABLE_DOC_LINKS[$name][0], true); $output .= htmlspecialchars(str_replace('_', ' ', $name)); $output .= '</a>'; $output .= '</span>'; } else { $output .= htmlspecialchars(str_replace('_', ' ', $name)); } $output .= '</div>' . '<div class="var-value value' . (PMA_isSuperuser() ? ' editable' : '') . '"> ' . formatVariable($name, $value) . '</div>' . '<div style="clear:both"></div>' . '</div>'; if ($has_session_value) { $output .= '<div class="var-row' . ($odd_row ? ' odd' : ' even') . '">' . '<div class="var-name session">(' . __('Session value') . ')</div>' . '<div class="var-value value"> ' . formatVariable($name, $serverVarsSession[$name]) . '</div>' . '<div style="clear:both"></div>' . '</div>'; } $odd_row = !$odd_row; } $output .= '</div>'; $response->addHtml($output); /** * Format Variable * * @param string $name variable name * @param numeric $value variable value * * @return formatted string */ function formatVariable($name, $value) {
function display() { if ($this->displayLabel) { $this->showLabel(); } ?> <select id="<?php echo $this->id; ?> " name="<?php echo $this->name; ?> " <?php $this->displayAttributes(); ?> > <option value="" <?php if ($this->value == "") { echo 'selected="selected"'; } ?> >EVERYONE</option> <?php while ($therecord = $this->db->fetchArray($this->queryresult)) { ?> <option value="<?php echo $therecord["uuid"]; ?> " <?php if ($this->value == $therecord["uuid"]) { echo 'selected="selected"'; } ?> ><?php echo formatVariable($therecord["name"]); ?> </option> <?php } //endwhile ?> <option value="Admin" <?php if ($this->value == "Admin") { echo 'selected="selected"'; } ?> >Administrators</option> </select> <?php }
function showAssociations($addressid) { // This function generates a table listing all the records // associated with the address record. $querystatement = "\n\t\t\t\tSELECT\n\t\t\t\t\t`addresstorecord`.`tabledefid`,\n\t\t\t\t\t`addresstorecord`.`recordid`,\n\t\t\t\t\t`addresstorecord`.`primary`,\n\t\t\t\t\t`addresstorecord`.`defaultshipto`\n\t\t\t\tFROM\n\t\t\t\t\t`addresstorecord`\n\t\t\t\tWHERE\n\t\t\t\t\t`addresstorecord`.`addressid` ='" . mysql_real_escape_string($addressid) . "'\n\t\t\t\tORDER BY\n\t\t\t\t\t`addresstorecord`.`tabledefid`\n\t\t\t"; $queryresult = $this->db->query($querystatement); ?> <table class="querytable" cellspacing="0" cellpadding="0" border="0"> <thead> <tr> <th width="30%" align="left" nowrap="nowrap">uuid</th> <th width="70%" align="left">record</th> <th align="center" nowrap="nowrap">primary</th> <th align="center" nowrap="nowrap">default ship to</th> </tr> </thead> <tfoot> <tr class="queryfooter"> <td colspan="4"> </td> </tr> </tfoot> <tbody> <?php $row = 1; while ($therecord = $this->db->fetchArray($queryresult)) { $row = $row == 1 ? 2 : 1; ?> <tr class="qr<?php echo $row; ?> "> <td><?php echo $therecord["recordid"]; ?> </td> <td><?php echo $this->getName($therecord["tabledefid"], $therecord["recordid"]); ?> </td> <td align="center"><?php echo formatVariable($therecord["primary"], "boolean"); ?> </td> <td align="center"><?php echo formatVariable($therecord["defaultshipto"], "boolean"); ?> </td> </tr> <?php } //endwhile - therecord ?> </tbody> </table> <?php }
/** * displays a list of additional categories associated with the product. * * @param array $categoryArray array of category records * */ function displayAdditionalCategories($categoryArray) { ?> <div id="catDiv"> <input type="hidden" id="addcats" name="addcats" value="" /> <input type="hidden" id="catschanged" name="catschanged" value="0" /> <?php $i = 0; foreach ($categoryArray as $therecord) { ?> <div class="moreCats" id="AC<?php echo $i; ?> "> <input type="text" value="<?php echo formatVariable($therecord["name"]); ?> " id="AC-<?php echo $i; ?> " size="30" readonly="readonly"/> <input type="hidden" id="AC-CatId-<?php echo $i; ?> " value="<?php echo $therecord["catid"]; ?> " class="catIDs"/> <button type="button" class="graphicButtons buttonMinus catButtons" title="Remove Category"><span>-</span></button> </div> <?php $i++; } //endwhile ?> </div><?php }
function _showOpenARSelect($clientid, $type) { $queryType = $type; if ($type == "credit") { $queryType = "credit"; } $querystatement = "\n\t\t\t\tSELECT\n\t\t\t\t\t`aritems`.`id`,\n\t\t\t\t\t`aritems`.`uuid`,\n\t\t\t\t\t`aritems`.`amount`,\n\t\t\t\t\t`aritems`.`paid`,\n\t\t\t\t\t`aritems`.`relatedid`,\n\t\t\t\t\t`aritems`.`itemdate`,\n\t\t\t\t\t`invoices`.`id` AS `invoiceid`\n\t\t\t\tFROM\n\t\t\t\t\t`aritems` LEFT JOIN `invoices` ON `aritems`.`relatedid`=`invoices`.`uuid`\n\t\t\t\tWHERE\n\t\t\t\t\t`aritems`.`status` = 'open'\n\t\t\t\t\tAND\n\t\t\t\t\t`aritems`.`clientid` = '" . mysql_real_escape_string($clientid) . "'\n\t\t\t\t\tAND\n\t\t\t\t\t`aritems`.`type` = '" . $queryType . "'\n\t\t\t\t\tAND\n\t\t\t\t\t`aritems`.`posted` = '1'\n\t\t\t\tORDER BY\n\t\t\t"; if ($type == "credit") { $querystatement .= "itemdate"; } else { $querystatement .= "relatedid"; } $queryresult = $this->db->query($querystatement); if ($this->db->numRows($queryresult)) { ?> <select id="newItem<?php echo str_replace(" ", "", ucwords($type)); ?> ARID"> <?php while ($therecord = $this->db->fetchArray($queryresult)) { ?> <option value="<?php echo $therecord["uuid"]; ?> "><?php if ($therecord["invoiceid"]) { echo $therecord["invoiceid"] . ": "; } echo formatFromSQLDate($therecord["itemdate"]) . " "; echo formatVariable($therecord["amount"], "currency"); if ($therecord["paid"] != 0) { echo " (" . formatVariable((double) $therecord["amount"] - (double) $therecord["paid"], "currency") . ")"; } ?> </option><?php } //endwhile ?> </select><?php } else { ?> <p class="disabledtext">No existing open <?php echo $type; ?> AR items found for client.</p><?php } // endif }
function generate() { ob_start(); ?> <h1>Product Sales History</h1> <ul> <li> source:<br /> <?php echo formatVariable($this->dataPrint); ?> </li> <li> date generated:<br /> <?php echo dateToString(mktime()) . " " . timeToString(mktime()); ?> </li> <li> view:<br /> <?php echo $this->view; ?> </li> <li> from:<br /> <?php echo $this->fromDate; ?> </li> <li> to:<br /> <?php echo $this->toDate; ?> </li> </ul> <?php $this->reportOutput = ob_get_contents(); ob_end_clean(); while ($therecord = $this->db->fetchArray($this->productQueryresult)) { $this->reportOutput .= '<h2>' . $therecord["partnumber"] . '<br />' . $therecord["partname"] . '</h2>'; $this->reportOutput .= $this->generateSingleHistory($therecord["uuid"]); } //endwhile }
<tr class="<?php echo $row_class; ?>"> <th class="nowrap"><?php echo htmlspecialchars(str_replace('_', ' ', $name)); ?></th> <td class="value"><?php echo formatVariable($name, $value); ?></td> <td class="value"><?php // To display variable documentation link if (isset($VARIABLE_DOC_LINKS[$name])) { echo PMA_showMySQLDocu($VARIABLE_DOC_LINKS[$name][1], $VARIABLE_DOC_LINKS[$name][1], false, $VARIABLE_DOC_LINKS[$name][2] . '_' . $VARIABLE_DOC_LINKS[$name][0]); } ?></td> <?php if ($has_session_value) { ?> </tr> <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?> "> <td>(<?php echo __('Session value'); ?>)</td> <td class="value"><?php echo formatVariable($name, $serverVarsSession[$name]); ?></td> <td class="value"></td> <?php } ?> </tr> <?php $odd_row = ! $odd_row; } ?> </tbody> </table> <?php function formatVariable($name, $value) { global $VARIABLE_DOC_LINKS;
function displayTransaction($recordsArray, $fieldsArray) { //needs to be changed for more complicated tables if (count($recordsArray) && count($fieldsArray)) { ?> <h2>Import Preview</h2> <div id="transactionDiv"> <table id="transactionTable"> <thead> <tr> <?php foreach ($fieldsArray as $field => $junk) { ?> <th align="left" nowrap="nowrap"><?php echo formatVariable($field); ?> </th><?php } //end foreach $field = NULL; ?> </tr> </thead> <tbody> <?php $i = 1; foreach ($recordsArray as $record) { ?> <tr class="qr<?php echo $i; ?> " ><?php foreach ($fieldsArray as $field => $junk) { ?> <td nowrap="nowrap"><?php echo formatVariable($record[$field]); ?> </td><?php } //end foreach ?> </tr><?php $i = $i == 1 ? 2 : 1; } //end while ?> </tbody> </table> </div> <?php } //end if }
function showSections() { ?> <table id="postSections" cellpadding="0" cellspacing="0" border="0"> <thead> <tr> <th id="ttype">transaction type</th> <th>within<br />range</th> <th>total<br />records</th> </tr> </thead> <tbody> <?php foreach ($this->sections as $sectionName => $section) { ?> <tr><?php $recordsInDateRange = count($section["class"]->getRecordsToPost($this->startdate, $this->enddate)); $totalRecords = count($section["class"]->getRecordsToPost()); if ($recordsInDateRange) { ?> <td><input type="checkbox" id="<?php echo $sectionName; ?> " name="sec<?php echo $sectionName; ?> " value="<?php echo $sectionName; ?> " checked="checked"/><label for="<?php echo $sectionName; ?> "> <?php echo formatVariable($sectionName); ?> </label></td> <td><input type="text" readonly="readonly" value="<?php echo $recordsInDateRange; ?> " size="5"/></td> <?php } else { ?> <td class="non"><input type="checkbox" id="<?php echo $sectionName; ?> " name="sections" value="<?php echo $sectionName; ?> " disabled="disabled" /><label for="<?php echo $sectionName; ?> "> <?php echo formatVariable($sectionName); ?> </label></td> <td><input type="text" disabled="disabled" class="uneditable" value="<?php echo $recordsInDateRange; ?> " size="5"/></td> <?php } //endif ?> <td><input type="text" disabled="disabled" class="uneditable" value="<?php echo $totalRecords; ?> " size="5"/></td> </tr><?php } //endforeach ?> </tbody> </table> <?php }
function displayMiddle() { //Grabbing Database Size $querystatement = "\n\t\tSELECT\n\t\t SUM( data_length + index_length) / 1024 / 1024 AS sizedb\n\t\tFROM\n\t\t information_schema.TABLES\n\t\tWHERE\n\t\t table_schema ='" . MYSQL_DATABASE . "'"; $queryresult = $this->db->query($querystatement); if ($this->db->numRows($queryresult)) { $therecord = $this->db->fetchArray($queryresult); $stats["database size"] = round($therecord["sizedb"], 2) . " MB"; } //end if //Modules Loaded $querystatement = "\n\t\tSELECT\n\t\t COUNT(id) AS thecount\n\t\tFROM\n\t\t modules"; $queryresult = $this->db->query($querystatement); if ($this->db->numRows($queryresult)) { $therecord = $this->db->fetchArray($queryresult); $stats["modules loaded"] = $therecord["thecount"]; } //end if //Active Users $querystatement = "\n\t\tSELECT\n\t\t COUNT(id) AS thecount\n\t\tFROM\n\t\t users\n\t\tWHERE\n\t\t revoked = 0\n\t\t AND portalaccess = 0"; $queryresult = $this->db->query($querystatement); if ($this->db->numRows($queryresult)) { $therecord = $this->db->fetchArray($queryresult); $stats["active users"] = $therecord["thecount"]; } //end if //Errors In System Log $querystatement = "\n\t\tSELECT\n\t\t COUNT(id) AS thecount\n\t\tFROM\n\t\t log\n\t\tWHERE\n\t\t `type` = 'error'"; $queryresult = $this->db->query($querystatement); if ($this->db->numRows($queryresult)) { $therecord = $this->db->fetchArray($queryresult); $stats["logged errors"] = $therecord["thecount"]; } //end if foreach ($stats as $statName => $statValue) { ?> <p><?php echo formatVariable($statName); ?> : <?php echo formatVariable($statValue); ?> </p> <?php } }
/** * display tables drop down for tabledefs * * @param string $fieldname name/id to give the select box * @param string $selectedid tabledef uuid currently selected */ function showTableSelect($fieldname, $selectedid) { $querystatement = "\n SELECT\n uuid,\n displayname\n FROM\n tabledefs\n ORDER\n BY displayname"; $queryresult = $this->db->query($querystatement); ?> <select id="<?php echo $fieldname; ?> " name="<?php echo $fieldname; ?> "><?php while ($therecord = $this->db->fetchArray($queryresult)) { ?> <option value="<?php echo $therecord["uuid"]; ?> " <?php if ($selectedid == $therecord["uuid"]) { echo 'selected="selected"'; } ?> ><?php echo formatVariable($therecord["displayname"]); ?> </option><?php } //endwhile ?> </select><?php }
function display($clientInfo) { $invoiceEditFile = getAddEditFile($this->db, "tbld:62fe599d-c18f-3674-9e54-b62c2d6b1883"); $noteEditFile = getAddEditFile($this->db, "tbld:a4cdd991-cf0a-916f-1240-49428ea1bdd1"); $clientEditFile = getAddEditFile($this->db, "tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083"); ?> <div class="bodyline" id="theDetails"> <div id="rightSideDiv"> <fieldset> <legend>sales</legend> <ul class="recordCommands"> <li class="firstToolbarItem"><a href="#" class="newRecord" onclick="addEditRecord('new','invoice','<?php echo getAddEditFile($this->db, "tbld:62fe599d-c18f-3674-9e54-b62c2d6b1883", "add"); ?> ')" title="new sales order"><span>new</span></a></li> <li><a href="#" id="invoiceedit" class="editRecordDisabled" onclick="addEditRecord('edit','invoice','<?php echo $invoiceEditFile; ?> ')" title="edit"><span>edit</span></a></li> </ul> <div class="recordContainers"> <div id="salesTable" class="smallQueryTableHolder"> <?php if (!count($clientInfo["invoices"])) { ?> <div class="small"><em>no records</em></div> <?php } else { ?> <table border="0" cellpadding="0" cellspacing="0" class="smallQueryTable"> <tr> <th align="left">ID</th> <th align="left">Type</th> <th align="left">Date</th> <th align="right" width="100%">Total</th> </tr> <?php foreach ($clientInfo["invoices"] as $invoicerecord) { if ($invoicerecord["type"] == "VOID") { $invoicerecord["totalti"] = "-----"; } ?> <tr onclick="selectEdit(this,<?php echo $invoicerecord["id"]; ?> ,'invoice')" ondblclick="selectedInvoice=<?php echo $invoicerecord["id"]; ?> ;addEditRecord('edit','invoice','<?php echo $invoiceEditFile; ?> ')"> <td><?php echo $invoicerecord["id"]; ?> </td> <td><?php echo $invoicerecord["type"]; ?> </td> <td nowrap="nowrap"><?php echo formatFromSQLDate($invoicerecord["thedate"]); ?> </td> <td align="right"><?php echo numberToCurrency($invoicerecord["totalti"]); ?> </td> </tr> <?php } ?> </table><?php } ?> </div> </div> </fieldset> <fieldset> <legend>notes</legend> <ul class="recordCommands"> <li class="firstToolbarItem"><a href="#" title="new note" class="newRecord" onclick="addEditRecord('new','note','<?php echo getAddEditFile($this->db, "tbld:a4cdd991-cf0a-916f-1240-49428ea1bdd1", "add"); ?> ')"><span>new</span></a></li> <li><a href="#" title="edit" id="noteedit" class="editRecordDisabled" onclick="addEditRecord('edit','note','<?php echo $noteEditFile; ?> ')"><span>edit</span></a></li> </ul> <div class="recordContainers"> <div id="notesTable" class="smallQueryTableHolder"> <?php if (!count($clientInfo["notes"])) { ?> <div class="small"><em>no records</em></div> <?php } else { ?> <table border="0" cellpadding="0" cellspacing="0" class="smallQueryTable"> <tr> <th align="left">type</th> <th align="left">category</th> <th align="left" width="100%">title</th> <th align="center">done</th> </tr> <?php foreach ($clientInfo["notes"] as $noterecord) { if (strlen($noterecord["subject"]) > 17) { $noterecord["subject"] = substr($noterecord["subject"], 0, 17) . "..."; } if (strlen($noterecord["category"]) > 17) { $noterecord["category"] = substr($noterecord["category"], 0, 17) . "..."; } ?> <tr onclick="selectEdit(this,<?php echo $noterecord["id"]; ?> ,'note')" ondblclick="selectedNote=<?php echo $noterecord["id"]; ?> ;addEditRecord('edit','note','<?php echo $noteEditFile; ?> ')"> <td><?php echo $noterecord["type"]; ?> </td> <td><?php echo $noterecord["category"]; ?> </td> <td><?php echo $noterecord["subject"]; ?> </td> <td align="center"><?php echo booleanFormat($noterecord["completed"]); ?> </td> </tr> <?php } ?> </table><?php } ?> </div> </div> </fieldset> </div> <div id="leftSideDiv"> <fieldset id="crTile" class="fs<?php echo $clientInfo["type"]; ?> "> <h1> <input type="hidden" id="theid" value="<?php echo $clientInfo["id"]; ?> " /> <input type="hidden" id="theuuid" value="<?php echo $clientInfo["uuid"]; ?> " /> <?php if ($clientInfo["company"]) { echo htmlQuotes($clientInfo["company"]); } else { echo htmlQuotes($clientInfo["firstname"] . " " . $clientInfo["lastname"]); } ?> <button id="viewClientButton" type="button" title="view client" class="graphicButtons buttonInfo" onclick="addEditRecord('edit','client','<?php echo $clientEditFile; ?> ')"><span>view client</span></button></h1> <?php if ($clientInfo["company"] && $clientInfo["firstname"] && $clientInfo["lastname"]) { ?> <p id="crName"><?php echo htmlQuotes($clientInfo["firstname"]); ?> <?php echo htmlQuotes($clientInfo["lastname"]); ?> </p><?php } //endif ?> <?php $location = ""; $location .= htmlQuotes($clientInfo["address1"]); if ($clientInfo["address2"]) { $location .= "<br />" . htmlQuotes($clientInfo["address2"]); } if ($clientInfo["city"] || $clientInfo["state"] || $clientInfo["postalcode"]) { $location .= "<br/>" . htmlQuotes($clientInfo["city"]); if ($clientInfo["city"] && $clientInfo["state"]) { $location .= ", "; } $location .= htmlQuotes($clientInfo["state"]); $location .= " " . htmlQuotes($clientInfo["postalcode"]); } //endif if ($clientInfo["country"]) { $location .= "<br />" . htmlQuotes($clientInfo["country"]); } if ($location == "") { $location = "unspecified location"; } ?> <p id="crLocation"><?php echo $location; ?> </p> </fieldset> <fieldset> <legend>Contact</legend> <?php if ($clientInfo["workphone"] || $clientInfo["homephone"] || $clientInfo["mobilephone"] || $clientInfo["otherphone"] || $clientInfo["fax"]) { ?> <p class="RDNames">phone</p> <div class="fauxP RDData"> <ul> <?php if ($clientInfo["workphone"]) { ?> <li><?php echo $clientInfo["workphone"]; ?> (w)</li> <?php } ?> <?php if ($clientInfo["homephone"]) { ?> <li><?php echo $clientInfo["homephone"]; ?> (h)</li> <?php } ?> <?php if ($clientInfo["mobilephone"]) { ?> <li><?php echo $clientInfo["mobilephone"]; ?> (m)</li> <?php } ?> <?php if ($clientInfo["otherphone"]) { ?> <li><?php echo $clientInfo["otherphone"]; ?> (o)</li> <?php } ?> <?php if ($clientInfo["fax"]) { ?> <li><?php echo $clientInfo["fax"]; ?> (fax)</li> <?php } ?> </ul> </div> <?php } ?> <?php if ($clientInfo["email"]) { ?> <p class="RDNames">e-mail</p> <p class="RDData"> <button type="button" class="graphicButtons buttonEmail" onclick="document.location='mailto:<?php echo $clientInfo["email"]; ?> '"><span>send email</span></button> <a href="mailto:<?php echo $clientInfo["email"]; ?> "><?php echo htmlQuotes($clientInfo["email"]); ?> </a> </p> <?php } ?> <?php if ($clientInfo["webaddress"]) { ?> <p class="RDNames">web site</p> <p class="RDData"> <button type="button" class="graphicButtons buttonWWW" onclick="window.open('<?php echo $clientInfo["webaddress"]; ?> ')"><span>visit site</span></button> <a href="<?php echo $clientInfo["webaddress"]; ?> " target="_blank"><?php echo htmlQuotes($clientInfo["webaddress"]); ?> </a> </p> <?php } ?> </fieldset> <fieldset> <legend>Details</legend> <?php if ($clientInfo["becameclient"]) { ?> <p class="RDNames">became client</p> <p class="RDData"> <?php echo formatVariable($clientInfo["becameclient"], "date"); ?> </p> <?php } ?> <?php if ($clientInfo["category"]) { ?> <p class="RDNames">category</p> <p class="RDData"> <?php echo htmlQuotes($clientInfo["category"]); ?> </p> <?php } ?> <?php if ($clientInfo["leadsource"]) { ?> <p class="RDNames">lead source</p> <p class="RDData"> <?php echo htmlQuotes($clientInfo["leadsource"]); ?> </p> <?php } ?> <?php if ($clientInfo["salesmanagerid"]) { global $phpbms; ?> <p class="RDNames">sales person</p> <p class="RDData"> <?php echo htmlQuotes($phpbms->getUserName($clientInfo["salesmanagerid"])); ?> </p> <?php } ?> </fieldset> <?php if ($clientInfo["comments"]) { ?> <fieldset> <legend>memo</legend> <p> <?php echo htmlQuotes($clientInfo["comments"]); ?> </p> </fieldset> <?php } ?> </div> <p id="theclear"> </p> </div> <?php }
| PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | | +-------------------------------------------------------------------------+ */ require_once "../../include/session.php"; require_once "../../include/fields.php"; require_once "include/snapshot_include.php"; //Page details; $headingTitle = formatVariable(trim($_SESSION["userinfo"]["firstname"] . " " . $_SESSION["userinfo"]["lastname"]) . "'s Snapshot"); $pageTitle = APPLICATION_NAME . " - " . $headingTitle; $phpbms->cssIncludes[] = "pages/base/snapshot.css"; $phpbms->jsIncludes[] = "modules/base/javascript/snapshot.js"; $snapshot = new snapshot($db); if (isset($_POST["cmd"])) { $snapshot->process($_POST); } $snapshot->getWidgets(); $phpbms->jsIncludes = $snapshot->merge($phpbms->jsIncludes, "jsIncludes"); $phpbms->cssIncludes = $snapshot->merge($phpbms->cssIncludes, "cssIncludes"); require "header.php"; ?> <div class="bodyline"> <h1><?php
function show() { ?> <table border="0" cellpadding="0" cellspacing="0" class="querytable" id="paymentTable"> <thead> <tr> <th align="left">status</th> <th align="left" nowrap="nowrap">receipt id</th> <th align="left">date</th> <th align="right" width="100%">payment</th> <th align="right">applied</th> <th align="right">discount</th> <th align="right" nowrap="nowrap">tax adj.</th> </tr> </thead> <tfoot> <tr class="queryfooter"> <td colspan="4" align="right">total: <strong><?php echo formatVariable($this->totals["applied"] + $this->totals["discount"] + $this->totals["taxadjustment"], "currency"); ?> </strong> </td> <td align="right"><?php echo formatVariable($this->totals["applied"], "currency"); ?> </td> <td align="right"><?php echo formatVariable($this->totals["discount"], "currency"); ?> </td> <td align="right"><?php echo formatVariable($this->totals["taxadjustment"], "currency"); ?> </td> </tr> </tfoot> <tbody> <?php if ($this->db->numRows($this->queryresult)) { $postedGroup = ""; $row = 1; while ($therecord = $this->db->fetchArray($this->queryresult)) { $row = $row == 1 ? 2 : 1; if ($postedGroup != $therecord["posted"]) { $postedGroup = $therecord["posted"]; $title = $therecord["posted"] == 1 ? "Posted Payments" : "Pending Payments (non-posted)"; ?> <tr class="queryGroup"> <td colspan="7"><?php echo $title; ?> </td> </tr><?php } //end if if (!$therecord["name"]) { $therecord["name"] = "other"; } if ($therecord["id"] == $this->aritem["relatedid"] && $this->aritem["type"] == "credit") { $therecord["applied"] = -1 * $therecord["applied"]; } ?> <tr class="row<?php echo $row; ?> "> <td><?php echo $therecord["status"]; ?> </td> <td><?php echo $therecord["id"]; ?> </td> <td><?php echo formatFromSQLDate($therecord["receiptdate"]); ?> </td> <td align="right"><?php echo $therecord["name"]; ?> </td> <td align="right"><?php echo formatVariable($therecord["applied"], "currency"); ?> </td> <td align="right"><?php echo formatVariable($therecord["discount"], "currency"); ?> </td> <td align="right"><?php echo formatVariable($therecord["taxadjustment"], "currency"); ?> </td> </tr><?php } //end while } else { ?> <tr class="norecords"><td colspan="7" >No payments recorded</td></tr><?php } //endif ?> </tbody> </table><?php }