function showremscfrompgcatid() { $catlist = $this->getPGCategories(); $prodcodes = new products(); $prodcodelist = $prodcodes->getProductCodeList(); display::header(); pgdisplay::remfromcat($prodcodelist, $catlist); }
function editOrder($a, $items, $pageNav) { global $mainframe, $mosConfig_list_limit, $mosConfig_absolute_path; display::header(); $cid = JRequest::getVar('cid', array(0), '', 'array'); $edit = $cid != array(0); $text = $edit ? JText::_('Edit') : JText::_('New'); JToolBarHelper::title(JText::_("SimpleCaddy {$text}"), 'generic.png'); JToolBarHelper::save('save', 'Save'); JToolBarHelper::apply(); if ($edit) { // for existing items the button is renamed `close` JToolBarHelper::cancel('cancel', 'Close'); } else { JToolBarHelper::cancel(); } $cfg = new sc_configuration(); $currency = $cfg->get("currency"); $tsep = $cfg->get("thousand_sep"); $decsep = $cfg->get("decimal_sep"); $decs = $cfg->get("decimals"); $align = $cfg->get("curralign"); // before amount==1 // hardcoded fields from old simplecaddy <1.7 $standardfields = array("name", "email", "address", "codepostal", "city", "telephone", "ipaddress"); $statuses = explode("\n", $cfg->get("ostatus")); ?> <form method="post" name="adminForm" action="index2.php"> <table class="adminform" width="100%"><tr><th class="title"><?php echo JText::_('SC_ORDER'); ?> </th><th><?php echo $a->id; ?> </th></tr> <tr> <td width="185"><?php echo JText::_('SC_DATE'); ?> </td> <td> <?php echo date("d-m-Y H:i:s", $a->orderdt); ?> </td> </tr> <tr> <td width="185"><?php echo JText::_('SC_USERID'); ?> </td> <td><?php echo $a->j_user_id; ?> </td> </tr> <tr> <td width="185"><?php echo JText::_('SC_NAME'); ?> </td> <td><?php echo $a->name; ?> </td> </tr> <tr> <td width="185"><?php echo JText::_('SC_EMAIL'); ?> </td> <td><?php echo "<a href='mailto:{$a->email}'>{$a->email}</a>"; ?> </td> </tr> <tr> <td width="185"><?php echo JText::_('SC_ADDRESS'); ?> </td> <td> <?php echo $a->address; ?> </td> </tr> <tr> <td width="185"><?php echo JText::_('SC_ZIPCODE'); ?> </td> <td> <?php echo $a->codepostal; ?> </td> </tr> <tr> <td width="185"><?php echo JText::_('SC_CITY'); ?> </td> <td> <?php echo $a->city; ?> </td> </tr> <tr> <td width="185"><?php echo JText::_('SC_PHONE'); ?> </td> <td> <?php echo $a->telephone; ?> </td> </tr> <tr> <td width="185"><?php echo JText::_('SC_IP_ADDRESS'); ?> </td> <td> <?php $iplink = ' <a href="http://whois.domaintools.com/' . $a->ipaddress . '" target="_blank" class="scbutton">' . JText::_("SC_CHECKIP") . "</a>"; echo $a->ipaddress; echo $iplink; ?> <input type="hidden" name="ipaddress" value="<?php echo $a->ipaddress; ?> " /> </td> </tr> <tr> <td width="185"><?php echo JText::_('SC_SHIP_REGION'); ?> </td> <td> <?php echo $a->shipRegion; ?> </td> </tr> <tr> <td width="185"><?php echo JText::_('SC_SHIP_COST'); ?> </td> <td> <?php if ($align == 1) { echo $currency . " "; } echo number_format($a->shipCost, $decs, $decsep, $tsep); if ($align == 0) { echo " " . $currency; } ?> </td> </tr> <tr> <td width="185"><?php echo JText::_('SC_SUBTOTAL'); ?> </td> <td> <?php if ($align == 1) { echo $currency . " "; } echo number_format($a->total, $decs, $decsep, $tsep); if ($align == 0) { echo " " . $currency; } ?> </td> </tr> <tr> <td width="185"><?php echo JText::_('SC_TAX'); ?> </td> <td> <?php if ($align == 1) { echo $currency . " "; } echo number_format($a->tax, $decs, $decsep, $tsep); if ($align == 0) { echo " " . $currency; } ?> </td> </tr> <tr> <td width="185"><?php echo JText::_('SC_TOTAL'); ?> </td> <td> <?php if ($align == 1) { echo $currency . " "; } echo number_format($a->total + $a->tax, $decs, $decsep, $tsep); if ($align == 0) { echo " " . $currency; } ?> </td> </tr> <tr> <td width="185"><?php echo JText::_('SC_PAYMENT_ID'); ?> </td> <td> <?php echo $a->ordercode; ?> </td> </tr> <?php if (@$a->customfields) { echo "<tr><th>" . JText::_('Custom fields') . "</th><th> </th></tr>"; $fields = new fields(); $fieldlist = $fields->getPublishedFieldsArray(); $acfields = unserialize($a->customfields); foreach ($fieldlist as $key => $cfield) { if (!in_array($cfield, $standardfields)) { // show only the fields that are not hardcoded if (isset($acfields[$cfield])) { echo "<tr>"; echo "<td width=\"185\">{$cfield}</td>"; echo "<td>" . $acfields[$cfield] . "</td>"; echo "</tr>"; } } } } ?> <tr> <td><a href="index.php?option=com_caddy&action=orders&task=email&oid=<?php echo $a->id; ?> " class="scbutton"><?php echo JText::_('Resend order confirmation email'); ?> </a></td> </tr> <tr> <td width="185"><?php echo JText::_('SC_ORDER_STATUS'); ?> </td> <td> <?php echo "<select name='edtostatus'>"; foreach ($statuses as $status) { $selected = strtolower($a->status) == strtolower(trim($status)) ? " selected" : ""; echo "<option value='" . trim($status) . "' {$selected}>{$status}</option>\n"; } echo "</select>"; ?> </td> </tr> </table> <table class="adminlist" width="100%" cellpadding="4" cellspacing="0" border="0" > <tr><th colspan="7"><?php echo JText::_('SC_DETAILS'); ?> </th></tr> <tr> <th class="title"><?php echo JText::_('SC_CODE'); ?> </th> <th class="title"><?php echo JText::_('SC_QUANTITY'); ?> </th> <th class="title tdright"><?php echo JText::_('SC_PRICE_PER_UNIT'); ?> </th> <th class="title tdright"><?php echo JText::_('SC_TOTAL'); ?> </th> <th class="title"><?php echo JText::_('SC_PRODUCT_NAME'); ?> </th> <th class="title"><?php echo JText::_('SC_PRODUCT_OPTION'); ?> </th> <th class="title"><?php echo JText::_('SC_ACTION'); ?> </th> <th class="title"> </th> </tr> <?php $k = 0; for ($i = 0, $n = count($items); $i < $n; $i++) { $row =& $items[$i]; ?> <tr class="<?php echo "row{$k}"; ?> "> <td width="10%"> <?php echo $row->prodcode; ?> </td> <td width="30"> <?php echo $row->qty; ?> </td> <td width="10%" class="tdright"> <?php echo number_format($row->unitprice, $decs, $decsep, $tsep); ?> </td> <td class="tdright"> <?php echo number_format($row->total, $decs, $decsep, $tsep); ?> </td> <td width="40%"> <?php echo $row->shorttext; ?> </td> <td> <?php echo $row->option; ?> </td> <td> <?php echo "<a class=\"scbutton\" href=\"index2.php?option=com_caddy&action=products&task=decstore&pid={$row->prodcode}&qty={$row->qty}&order={$a->id}\">" . JText::_('SC_DECSTORE') . "</a>"; ?> </td> <td> </td> <?php $k = 1 - $k; } ?> </tr> <?php $field = JRequest::getVar('field', ''); $order = JRequest::getVar('order', ''); ?> </table> <input type="hidden" name="id" value="<?php echo $a->id ? "{$a->id}" : "-1"; ?> "> <input type="hidden" name="option" value="com_caddy" /> <input type="hidden" name="action" value="orders" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="order" value="<?php echo $order; ?> " /> <input type="hidden" name="field" value="<?php echo $field; ?> " /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="hidemainmenu" value="0" /> </form> <?php }
break; case "configuration": switch ($task) { case "saveconfig": $cfgset = JRequest::getvar('cfgset'); JRequest::setvar('task', "configuration"); $cfg = new sc_configuration($cfgset); $cfg->setAll(); $mainframe->redirect("index.php?option=com_caddy&action=configuration&task=show", JText::_("Configuration saved")); case "cancel": $mainframe->redirect("index.php?option=com_caddy&action=configuration&task=show", JText::_("Reverting to previous Configuration")); default: $cfgset = JRequest::getvar('cfgset'); JRequest::setvar('task', "configuration"); $cfg = new sc_configuration($cfgset); display::header(); $cfg->show(); break; } break; case "view_prod": $a = new products(); $alist = $a->getPublishedProducts(); display::view_prod($alist); break; case "about": switch ($task) { default: JRequest::setvar('task', "about"); display::ShowAbout(); break;