private function getUserList() { $authLevel = 0; if (isAdmin()) { $authLevel = 2; } elseif (isTeacher()) { $authLevel = 1; } elseif (isStudent()) { $this->kickOut(); } //Get list of usernames. $users = $this->users->getUsers($authLevel); if (count($users) < 1) { addWarning(getTxt('SorryNoUsers')); } $option_block = ""; foreach ($users as $row) { $users = $row["username"]; $option_block .= "<option value={$users}>{$users}</option>"; } return $option_block; }
function doSystemChecks() { // Do system checking. if (version_compare(phpversion(), "5.2.1", "<")) { addError(kPHPVersion, sprintf(_('This version of PHPDevShell only supports PHP version %s and later. You are currently running version %s.'), '5.2.1', phpversion())); } if (check_apache() == false) { addWarning(kApache, _('You are not running Apache as your web server. This version of PHPDevShell does not officially support non-Apache driven webservers.')); } if (check_mysql() == false) { addError(kMYSQL, _('The MySQL extension for PHP is missing. The installation script will be unable to continue')); } if (check_gettext() == false) { addError(kGETTEXT, _('The gettext extension for PHP is missing. The installation script will be unable to continue')); } global $errors; return count($errors) == 0; }
// Get all lots that we want to issue warnings about. These are lots // expired, soon to expire, or with insufficient quantity for selling. $ires = sqlStatement("SELECT * " . "FROM drug_inventory WHERE " . "drug_id = '{$drug_id}' AND " . "on_hand > 0 AND " . "destroy_date IS NULL AND ( " . "on_hand < '{$min_sale}' OR " . "expiration IS NOT NULL AND expiration < DATE_ADD(NOW(), INTERVAL 30 DAY) " . ") ORDER BY lot_number"); // Generate warnings associated with individual lots. while ($irow = sqlFetchArray($ires)) { $lotno = $irow['lot_number']; if ($irow['on_hand'] < $min_sale) { addWarning(htmlspecialchars(xl('Lot') . " '{$lotno}' " . xl('quantity seems unusable'))); } if (!empty($irow['expiration'])) { $expdays = (int) ((strtotime($irow['expiration']) - time()) / (60 * 60 * 24)); if ($expdays <= 0) { addWarning(htmlspecialchars(xl('Lot') . " '{$lotno}' " . xl('has expired'))); } else { if ($expdays <= 30) { addWarning(htmlspecialchars(xl('Lot') . " '{$lotno}' " . xl('expires in') . " {$expdays} " . xl('days'))); } } } } echo " <tr class='detail' bgcolor='{$bgcolor}'>\n"; echo " <td>" . htmlentities($row['name']) . "</td>\n"; echo " <td>" . htmlentities($row['ndc_number']) . "</td>\n"; echo " <td>" . generate_display_field(array('data_type' => '1', 'list_id' => 'drug_form'), $row['form']) . "</td>\n"; echo " <td align='right'>" . $row['on_hand'] . "</td>\n"; echo " <td align='right'>" . $row['reorder_point'] . "</td>\n"; echo " <td align='right'>{$monthly}</td>\n"; echo " <td align='right'>{$stock_months}</td>\n"; echo " <td style='color:red'>{$warnings}</td>\n"; echo " </tr>\n"; }
<?php $timeStart = microtime(true); session_start(); require_once $_SESSION['File_Root'] . '/Kernel/Include.php'; require_once $_SESSION['File_Root'] . '/HTML/Header.php'; require_once 'Functions/SQL.php'; redirectToLogin($accountID, $linkRoot); redirectToBattle($verifyBattle, $linkRoot); hasModerator($accountAccess); $playerID = htmlspecialchars(addslashes($_POST['playerID'])); $warningType = htmlspecialchars(addslashes($_POST['warningType'])); $warningMessage = htmlspecialchars(addslashes($_POST['warningMessage'])); addWarning($bdd, $playerID, $accountID, $warningType, $warningMessage); ?> <?php echo $mwarning6; ?> <br> <form method="POST" action="index.php"> <input class="btn btn-success" type="submit" value="Ok"> </form> <br/> <?php require_once $_SESSION['File_Root'] . '/HTML/Footer.php';
/** * Get phpDocumentor settings from command-line or web interface */ function readCommandLineSettings() { global $_phpDocumentor_setting, $interface, $_phpDocumentor_RIC_files; // subscribe $render class to $parse class events if (!isset($_phpDocumentor_setting['junk'])) { $_phpDocumentor_setting['junk'] = ''; } if (!isset($_phpDocumentor_setting['title'])) { $_phpDocumentor_setting['title'] = 'Generated Documentation'; } $temp_title = $_phpDocumentor_setting['title']; $this->render = new phpDocumentor_IntermediateParser($temp_title); if (isset($_phpDocumentor_setting['help']) || $_phpDocumentor_setting['junk'] == "-h" || $_phpDocumentor_setting['junk'] == "--help") { echo $this->setup->displayHelpMsg(); die; } // set to parse hidden files $this->hidden = isset($_phpDocumentor_setting['hidden']) ? decideOnOrOff($_phpDocumentor_setting['hidden']) : false; // set to parse through symlinks $this->ignoresymlinks = isset($_phpDocumentor_setting['ignoresymlinks']) ? decideOnOrOff($_phpDocumentor_setting['ignoresymlinks']) : false; // set to parse elements marked private with @access private $this->render->setParsePrivate(isset($_phpDocumentor_setting['parseprivate']) ? decideOnOrOff($_phpDocumentor_setting['parseprivate']) : false); // set to print warnings when undocumented elements are spotted $this->render->setUndocumentedElementWarningsMode(isset($_phpDocumentor_setting['undocumentedelements']) ? decideOnOrOff($_phpDocumentor_setting['undocumentedelements']) : false); if (isset($_phpDocumentor_setting['ignoretags'])) { $ignoretags = explode(',', $_phpDocumentor_setting['ignoretags']); $ignoretags = array_map('trim', $ignoretags); $tags = array(); foreach ($ignoretags as $tag) { if (!in_array($tag, array('@global', '@access', '@package', '@ignore', '@name', '@param', '@return', '@staticvar', '@var'))) { $tags[] = $tag; } } $_phpDocumentor_setting['ignoretags'] = $tags; } if (isset($_phpDocumentor_setting['readmeinstallchangelog'])) { $_phpDocumentor_setting['readmeinstallchangelog'] = explode(',', str_replace(' ', '', $_phpDocumentor_setting['readmeinstallchangelog'])); $rics = array(); foreach ($_phpDocumentor_setting['readmeinstallchangelog'] as $ric) { $rics[] = strtoupper(trim($ric)); } $_phpDocumentor_RIC_files = $rics; } if (isset($_phpDocumentor_setting['javadocdesc']) && $_phpDocumentor_setting['javadocdesc'] == 'on') { $this->parse->eventHandlers[PARSER_EVENT_DOCBLOCK] = 'JavaDochandleDocblock'; } if (tokenizer_ext) { if (isset($_phpDocumentor_setting['sourcecode']) && $_phpDocumentor_setting['sourcecode'] == 'on') { $_phpDocumentor_setting['sourcecode'] = true; } else { $_phpDocumentor_setting['sourcecode'] = false; } } else { if (isset($_phpDocumentor_setting['sourcecode']) && $_phpDocumentor_setting['sourcecode'] == 'on') { addWarning(PDERROR_SOURCECODE_IGNORED); } $_phpDocumentor_setting['sourcecode'] = false; } if (isset($_phpDocumentor_setting['converterparams'])) { $_phpDocumentor_setting['converterparams'] = explode($_phpDocumentor_setting['converterparams']); foreach ($_phpDocumentor_setting['converterparams'] as $i => $p) { $_phpDocumentor_setting['converterparams'][$i] = trim($p); } } if (isset($_phpDocumentor_setting['customtags']) && !empty($_phpDocumentor_setting['customtags'])) { $c = explode(',', $_phpDocumentor_setting['customtags']); for ($i = 0; $i < count($c); $i++) { $GLOBALS['_phpDocumentor_tags_allowed'][] = trim($c[$i]); } } if (isset($_phpDocumentor_setting['pear'])) { if ($_phpDocumentor_setting['pear'] === 'off') { $_phpDocumentor_setting['pear'] = false; } if ($_phpDocumentor_setting['pear'] === 'on') { $_phpDocumentor_setting['pear'] = true; } } if (!isset($_phpDocumentor_setting['pear'])) { $_phpDocumentor_setting['pear'] = false; } // set to change the default package name from "default" to whatever you want if (isset($_phpDocumentor_setting['defaultpackagename'])) { $GLOBALS['phpDocumentor_DefaultPackageName'] = trim($_phpDocumentor_setting['defaultpackagename']); } // set to change the default category name from "default" to whatever you want if (isset($_phpDocumentor_setting['defaultcategoryname'])) { $GLOBALS['phpDocumentor_DefaultCategoryName'] = trim($_phpDocumentor_setting['defaultcategoryname']); } // set the mode (quiet or verbose) $this->render->setQuietMode(isset($_phpDocumentor_setting['quiet']) ? decideOnOrOff($_phpDocumentor_setting['quiet']) : false); // Setup the different classes if (isset($_phpDocumentor_setting['templatebase'])) { $GLOBALS['_phpDocumentor_template_base'] = trim($_phpDocumentor_setting['templatebase']); $this->render->setTemplateBase($GLOBALS['_phpDocumentor_template_base']); } if (isset($_phpDocumentor_setting['target']) && !empty($_phpDocumentor_setting['target'])) { $this->render->setTargetDir(trim($_phpDocumentor_setting['target'])); } else { echo "a target directory must be specified\n try phpdoc -h\n"; die; } if (!empty($_phpDocumentor_setting['packageoutput'])) { $this->packages = explode(",", trim($_phpDocumentor_setting['packageoutput'])); foreach ($this->packages as $p => $v) { $this->packages[$p] = trim($v); } } if (!empty($_phpDocumentor_setting['filename'])) { $this->files = trim($_phpDocumentor_setting['filename']); } if (!empty($_phpDocumentor_setting['directory'])) { $this->dirs = trim($_phpDocumentor_setting['directory']); } }
// Get all lots that we want to issue warnings about. These are lots // expired, soon to expire, or with insufficient quantity for selling. $ires = sqlStatement("SELECT * " . "FROM drug_inventory WHERE " . "drug_id = '{$drug_id}' AND " . "on_hand > 0 AND " . "destroy_date IS NULL AND ( " . "on_hand < '{$min_sale}' OR " . "expiration IS NOT NULL AND expiration < DATE_ADD(NOW(), INTERVAL 30 DAY) " . ") ORDER BY lot_number"); // Generate warnings associated with individual lots. while ($irow = sqlFetchArray($ires)) { $lotno = $irow['lot_number']; if ($irow['on_hand'] < $min_sale) { addWarning(xl('Lot') . " '{$lotno}' " . xl('quantity seems unusable')); } if (!empty($irow['expiration'])) { $expdays = (int) ((strtotime($irow['expiration']) - time()) / (60 * 60 * 24)); if ($expdays <= 0) { addWarning(xl('Lot') . " '{$lotno}' " . xl('has expired')); } else { if ($expdays <= 30) { addWarning(xl('Lot') . " '{$lotno}' " . xl('expires in') . " {$expdays} " . xl('days')); } } } } echo " <tr class='detail' bgcolor='{$bgcolor}'>\n"; echo " <td>" . htmlentities($row['name']) . "</td>\n"; echo " <td>" . htmlentities($row['ndc_number']) . "</td>\n"; echo " <td>" . generate_display_field(array('data_type' => '1', 'list_id' => 'drug_form'), $row['form']) . "</td>\n"; echo " <td align='right'>" . $row['on_hand'] . "</td>\n"; echo " <td align='right'>" . $row['reorder_point'] . "</td>\n"; echo " <td align='right'>{$monthly}</td>\n"; echo " <td align='right'>{$stock_months}</td>\n"; echo " <td style='color:red'>{$warnings}</td>\n"; echo " </tr>\n"; }