function body_content() { $this->add_onload_command("selectSubmit('#ddQKselect', '#qmform');\n"); $this->add_onload_command('$(\'#ddQKselect\').focus()'); echo "<div class=\"baseHeight\" style=\"border: solid 1px black;\">"; echo "<form id=\"qmform\" action=\"" . $_SERVER["PHP_SELF"] . "\" \n method=\"post\" onsubmit=\"return false;\">"; /** Where can the menu be found? */ $my_menu = array(); if (is_array(CoreLocal::get('qmNumber'))) { /** Calling code provided the menu array via session data */ $my_menu = CoreLocal::get('qmNumber'); } else { /** New way: Get menu options from QuickLookups table */ $db = Database::pDataConnect(); if ($db->table_exists('QuickLookups')) { $model = new QuickLookupsModel($db); $model->lookupSet(CoreLocal::get('qmNumber')); foreach ($model->find(array('sequence', 'label')) as $obj) { $my_menu[$obj->label()] = $obj->action(); } } if (count($my_menu) == 0 && file_exists(realpath(dirname(__FILE__) . "/quickmenus/" . CoreLocal::get("qmNumber") . ".php"))) { /** Old way: Menu is defined in a PHP file */ include realpath(dirname(__FILE__) . "/quickmenus/" . CoreLocal::get("qmNumber") . ".php"); } } echo '<br /><br />'; echo '<select name="ddQKselect" id="ddQKselect" style="width:380px;" size="10" onblur="$(\'#ddQKselect\').focus();" >'; $i = 1; foreach ($my_menu as $label => $value) { printf('<option value="%s" %s>%d. %s</option>', $value, $i == 1 ? 'selected' : '', $i, $label); $i++; } echo '</select>'; $this->add_onload_command("qmNumberPress();\n"); echo "<input type=\"hidden\" value=\"0\" name=\"clear\" id=\"doClear\" />"; echo FormLib::tokenField(); echo "</form>"; echo "</div>"; }
function body_content() { $stem = MiscLib::baseURL() . 'graphics/'; ?> <div class="baseHeight"> <div class="centeredDisplay colored rounded"> <span class="larger"><?php echo _("administrative tasks"); ?> </span> <br /> <form id="selectform" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?> "> <?php if (CoreLocal::get('touchscreen')) { ?> <button type="button" class="pos-button coloredArea" onclick="scrollDown('#selectlist');"> <img src="<?php echo $stem; ?> down.png" width="16" height="16" /> </button> <?php } ?> <select name="selectlist" id="selectlist" onblur="$('#selectlist').focus();"> <option value=''><?php echo _("Select a Task"); ?> <option value='SUSPEND'>1. <?php echo _("Suspend Transaction"); ?> <option value='RESUME'>2. <?php echo _("Resume Transaction"); ?> <?php if (CoreLocal::get('SecurityTR') != 30 || $this->security >= 30) { ?> <option value='TR'>3. <?php echo _("Tender Report"); ?> <?php } ?> <?php if ($this->security >= 30) { ?> <option value='OTR'>4. <?php echo _("Any Tender Report"); ?> <option value='UNDO'><?php echo _('Undo Transaction'); ?> <?php } ?> </select> <?php if (CoreLocal::get('touchscreen')) { ?> <button type="button" class="pos-button coloredArea" onclick="scrollUp('#selectlist');"> <img src="<?php echo $stem; ?> up.png" width="16" height="16" /> </button> <?php } ?> <?php echo FormLib::tokenField(); ?> <div class="smaller"> <?php echo _("use arrow keys to navigate"); ?> </div> <p> <button class="pos-button" type="submit">Select [enter]</button> <button class="pos-button" type="submit" onclick="$('#selectlist').val('');"> Cancel [clear] </button> </p> </div> </form> </div> <?php $this->add_onload_command("\$('#selectlist').focus();"); $this->add_onload_command("selectSubmit('#selectlist', '#selectform')\n"); }