function getSubpart($template, $part) { // debug($template, $part); $parts = trimExplode($part, $template); $templatePart = ifsetor($parts[1]); return $templatePart; }
function get_fk_lookups_data($tablename, $fk_lookups) { $lookups_data = array(); $fk_defs = get_foreignkeys($tablename, 'S'); foreach ($fk_defs as $colname => $defs) { // skip foreign keys with more than FKLOOKUP_ENTRIES values if (!isset($GLOBALS['s_tables'][$defs['table']]['count'])) { $GLOBALS['s_tables'][$defs['table']]['count'] = get_table_count($defs['table']); } if ($GLOBALS['s_tables'][$defs['table']]['count'] > FKLOOKUP_ENTRIES) { continue; } $value_field = ifsetor($fk_lookups[$colname], $defs['column']); if ($value_field != $defs['column']) { $value_field = "COALESCE(" . $value_field . ", '')" . " || ' - '" . ' || ' . $defs['column']; } $sql = 'SELECT ' . $defs['column'] . ', ' . $value_field . ' FROM ' . $defs['table'] . ' ORDER BY ' . $value_field . ' ASC'; $res = fbird_query($GLOBALS['dbhandle'], $sql) or ib_error(__FILE__, __LINE__, $sql); $data = array(); while ($row = fbird_fetch_row($res)) { $data[trim($row[0])] = trim($row[1]); } fbird_free_result($res); $lookups_data[$colname] = array('table' => $defs['table'], 'column' => $defs['column'], 'data' => $data); } return $lookups_data; }
function getKey($type, $key) { if ($type == 'user') { return ifsetor($this->uc[$key]); } else { if (session_status() != PHP_SESSION_ACTIVE) { session_start(); } return ifsetor($_SESSION[__CLASS__][$key]); } }
function column_config_form($fk_table, $table, $column) { global $button_strings, $dt_strings; $fk_columns = array(); foreach ($GLOBALS['s_fields'][$fk_table] as $field) { if ($field['type'] == 'BLOB') { continue; } $fk_columns[] = $field['name']; } $pre = ifsetor($GLOBALS['s_cust']['fk_lookups'][$table][$column]); $html = "<table border=\"1\" cellpadding=\"3\" cellspacing=\"0\">\n" . " <tr>\n" . " <th>\n" . ' ' . sprintf($dt_strings['ColConf'], $column) . "\n" . " </th>\n" . " </tr>\n" . " <tr>\n" . " <td>\n" . ' <b>' . $dt_strings['ColFKLook'] . "</b><br>\n" . ' ' . get_selectlist('dt_column_config_fk_column', $fk_columns, $pre, TRUE) . "\n" . " </td>\n" . " </tr>\n" . "</table>\n" . hidden_field('dt_column_config_table', $table) . "\n" . hidden_field('dt_column_config_column', $column) . "\n" . '<input type="submit" name="dt_column_config_save" value="' . $button_strings['Save'] . "\" class=\"bgrp\">\n" . '<input type="button" name="dt_column_config_cancel" onClick="javascript:hide(this.parentNode.id);" value="' . $button_strings['Cancel'] . "\" class=\"bgrp\">\n"; header('Content-Type: text/html;charset=' . $GLOBALS['charset']); echo $html; }
/** * @param Document $document * @return string */ public function render(Document $doc) { //$siteName = app('config')['site']['name']; //$doc->title .= ' '.$siteName.' @ SyDES'; TODO uncomment $this->prepare($doc); $this->fillHead(); $doc->scripts['jquery-1.11'][] = '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js'; $this->fillFooter(); $dummy = ['language' => app('contentLang'), 'head' => implode("\n ", $this->head), 'footer' => implode("\n ", $this->footer), 'meta_title' => '', 'menu_pos' => isset(app('request')->cookie['menu_pos']) ? 'left' : 'top', 'base' => app('base'), 'breadcrumbs' => '', 'form_url' => '', 'sidebar_left' => '', 'content' => '', 'sidebar_right' => '', 'footer_left' => '', 'footer_center' => '', 'skin' => ifsetor(app('request')->cookie['skin'], 'black'), 'col_sm' => 12, 'col_lg' => 12]; if (!empty($this->document->data['sidebar_left'])) { $dummy['col_sm'] = $dummy['col_sm'] - 3; $dummy['col_lg'] = $dummy['col_lg'] - 2; } if (!empty($this->document->data['sidebar_right'])) { $dummy['col_sm'] = $dummy['col_sm'] - 3; $dummy['col_lg'] = $dummy['col_lg'] - 2; } $doc->data['breadcrumbs'] = \HTML::breadcrumb($doc->data['breadcrumbs']); return render(DIR_SYSTEM . '/views/main.php', array_merge($dummy, $doc->data)); }
public function render(Document $doc) { //$this->config = config('front'); TODO uncomment $this->prepare($doc); $this->theme = $theme = app('config')['site']['theme']; $layout = ifsetor($doc->data['layout'], 'page'); app('translator')->setLocale(app('contentLang'))->loadFrom('theme', $theme); $doc->addScript('sydes-front', '/system/assets/js/front.js'); $doc->addStyle('sydes-front', '/system/assets/css/front.css'); $template = $this->getTemplate($theme, $layout); $template = str_replace('{content}', ifsetor($doc->data['content']), $template); $template = $this->compile($template); unset($doc->data['content']); $doc->findMetaTags(); $doc->meta['generator'] = 'SyDES'; foreach ($doc->meta as $name => $content) { $whatName = in_array(substr($name, 0, 3), ['og:', 'fb:', 'al:']) ? 'property' : 'name'; $this->head[] = '<meta ' . $whatName . '="' . $name . '" content="' . $content . '">'; } $this->fillHead(); foreach ($doc->links as $link) { $this->head[] = '<link' . HTML::attr($link) . '>'; } $this->fillFooter(); if (app('user')->isEditor()) { $this->footer[] = $this->getToolbar(); } $toReplace = array_merge($doc->data, ['language' => app('contentLang'), 'head' => implode("\n ", $this->head), 'footer' => implode("\n ", $this->footer), 'year' => date('Y'), 'theme' => 'themes/' . $theme, 'csrf_token' => token(32)]); $find = $replace = []; foreach ($toReplace as $key => $val) { $find[] = '{' . $key . '}'; $replace[] = $val; } $template = str_replace($find, $replace, $template); return preg_replace('!{\\w+}!', '', $template); }
function message_headers_to_xml($headers, $sentorreceived) { $messagexml = ''; foreach ($headers as $messageindex => $headermap) { $subject = ifsetor($headermap['subject'], ''); $imapdate = ifsetor($headermap['date'], ''); $phpdate = strtotime($imapdate); $date = date('Y-m-d H:i:s', $phpdate); $fromstring = ifsetor($headerinfo['from'], ''); $fromparts = extract_address_from_string($fromstring); $fromaddress = $fromparts['address']; $fromdisplay = $fromparts['display']; $sourcefolder = $sentorreceived; $to = ifsetor($headermap["to"], ''); $cc = ifsetor($headermap["cc"], ''); $bcc = ifsetor($headermap["bcc"], ''); $contenttext = ''; $contenthtml = ''; $sourceuid = $messageindex; $messagexml .= "<message>\n"; $messagexml .= make_tag("messageuid", uniqid("", TRUE)); $messagexml .= make_cdatatag("sourceuid", $sourceuid); $messagexml .= make_cdatatag("subject", $subject); $messagexml .= make_cdatatag("fromaddress", $fromaddress); $messagexml .= make_cdatatag("fromdisplay", $fromdisplay); $messagexml .= make_tag("deliverytime", $date); $messagexml .= "<recipients>\n"; $messagexml .= create_header_recipients_xml($to, "to"); $messagexml .= create_header_recipients_xml($cc, "cc"); $messagexml .= create_header_recipients_xml($bcc, "bcc"); $messagexml .= "</recipients>\n"; $messagexml .= make_cdatatag("contenttext", $contenttext); $messagexml .= make_cdatatag("contenthtml", $contenthtml); $messagexml .= make_tag("sourcefolder", $sourcefolder); $messagexml .= "</message>\n"; } return $messagexml; }
<div class="container"> <?php if (!$maintenance_mode) { ?> <div class="page-content"> <h1>Miele Product Registration</h1> <hr /> <?php if (ifsetor($step) === 'customer') { ?> <?php include_once 'forms/customer.php'; ?> <?php } else { if (ifsetor($step) === 'products') { ?> <?php include_once 'forms/products.php'; ?> <?php } else { ?> Not available. <?php } } ?> </div> <?php } else {
function restricted() { if (!app('user')->isAdmin()) { alert(t('error_mastercode_needed'), 'warning'); $to = ifsetor(app('request')->headers['REFERER'], 'admin'); throw new \App\Exception\RedirectException($to); } }
define('TABLE_CARDS', '142_cards'); define('TABLE_PLAYERS_IN_GAMES', '142_players'); define('TABLE_CARDS_IN_GAMES', '142_cards_in_games'); define('MAX_PLAYERS_EVER', 10); require_once 'inc.db_mysql.php'; db_set(db_connect('localhost', 'usager', 'usager', 'games')); // CLEAN UP // #db_delete(TABLE_PLAYERS_IN_GAMES, 'last_online+16 < '.time()); // Two stages for every user: logged in, not logged in // not logged in if (!logincheck()) { if (isset($_POST['username'], $_POST['password'])) { $szMessage = 'FOUT'; $arrUser = db_select(TABLE_PLAYERS, "username = '******'username']) . "' AND password = MD5(CONCAT(id,':" . addslashes($_POST['password']) . "'))"); if (1 == count($arrUser)) { $arrSession = array('hash' => randString(20), 'ip' => ifsetor($_SERVER['REMOTE_ADDR'], ""), 'uid' => $arrUser[0]['id']); db_update(TABLE_PLAYERS, array('hash' => $arrSession['hash']), "id = '" . $arrSession['uid'] . "'"); $_SESSION[SESSION_NAME] = $arrSession; $szMessage = 'INGELOGD'; } header("Location: " . BASEPAGE . "?msg=" . $szMessage); exit; } ?> <html> <head> <title>MPP :: OUT</title> </head> <body style="overflow:auto;" onload="document.forms[0]['username'].focus();">
?> &demo=1">Demo</a></li> <li <?php if (ifsetor($this->page) === 'blog') { echo 'class="current_page_item"'; } ?> ><a href="http://jonaquino.blogspot.com/2009/12/dowlings-wheel-webapp-i-wrote-to-assist.html">Blog</a></li> <li <?php if (ifsetor($this->page) === 'goodies') { echo 'class="current_page_item"'; } ?> ><a href="index.php?controller=help&action=show&id=goodies">Goodies</a></li> <li <?php if (ifsetor($this->page) === 'about') { echo 'class="current_page_item"'; } ?> ><a href="index.php?controller=help&action=show&id=about">About</a></li> <li <?php if (ifsetor($this->page) === 'contact') { echo 'class="current_page_item"'; } ?> ><a href="index.php?controller=help&action=show&id=contact">Contact</a></li> </ul> </div> <div id="page"> <div id="content">
public function forgetpass() { $data['email'] = ifsetor($_POST['email'], ''); $warning = false; if ($this->posted()) { $User = new PRUserModel(); $user = $User->getUser($data['email'], '', true); if ($user) { $newpass = rand(100, 100000); $pass = $data['password']; $this->tpl->assign('login', $data['email']); $this->tpl->assign('pass', $newpass); $newpass = md5($newpass); $language = $_SESSION['ln'] == '2' ? 2 : 3; $this->tpl->assign('language', $language); $messageTpl = $this->tpl->fetch(PROJECT_TEMPLATE_PATH . 'email_forgotpass.tpl'); if ($_SESSION['ln'] == 2) { PRUtil::email($data['email'], PRUtil::TITLE_USER_CHANGEPASS, $messageTpl); } elseif ($_SESSION['ln'] == 3) { PRUtil::email($data['email'], PRUtil::TITLE_USER_CHANGEPASS_ENG, $messageTpl); } $User->updateItems($user['id'], array('password' => $newpass)); //email($data['email'], 'Восстановление паролей на priceguru', $message); $llng = $_SESSION['ln'] == 2 ? 'ru/' : ''; $llng .= $_SESSION['ln'] == 3 ? 'en/' : ''; $_SESSION['passtoemail'] = 1; PRUtil::redirect('/' . $llng . 'passtoemail'); } else { $warning = true; $this->tpl->assign('warning', $warning); } } $this->tpl->assign('data', $data); }
if (!isset($_SESSION)) { session_start(); } ?> <hr /> <h4>Sign up today on Mielestore.com!</h4> <p>Would you like to create an account on our online shop? Confirm your email address and enter a password below.</p> <div class="form-wrapper"> <form name="form_mielestore_create" data-alert="prepend"> <div class="form-group"> <label for="email" class="control-label">Email address</label><br /> <input type="text" name="email" id="email" class="form-control required" placeholder="Email address" value="<?php echo ifsetor($registration['customer']['email']); ?> " /> </div> <div class="row"> <div class="col-md-6 col-sm-6"> <div class="form-group"> <label for="password" class="control-label">Password</label><br /> <input type="password" name="password" id="password" class="form-control required" placeholder="Password" /> </div> </div> <div class="col-md-6 col-sm-6"> <div class="form-group"> <label for="password_confirm" class="control-label">Confirm password</label><br /> <input type="password" name="password_confirm" id="password_confirm" class="form-control required" placeholder="Confirm password" /> </div>
<?php if (!isset($_SESSION)) { session_start(); } include_once 'inc/functions.inc'; // Get registration details $registration = ifsetor($_SESSION['registration']); // Redirect user back to registration process if not yet completed if (!isset($registration['complete'])) { //header('Location: index.php'); } // Set complete flag $complete = true; ?> <!DOCTYPE HTML> <html lang="en"> <head> <title>Miele Product Registration - Thank you!</title> <?php include_once 'templates/head.php'; ?> </head> <body> <div class="container"> <div class="miele-redbar"> <div class="redbar"></div> <img src="<?php echo $GLOBALS['ssl_path_store']; ?>
<title>Example|<?php echo $this->readVarInto(array(1 => array(0 => '->'), 2 => array(0 => 'title'), 3 => array(0 => '', 1 => '')), $this->scope["this"], false); ?> </title> </head> <body> <h1><?php echo $this->readVarInto(array(1 => array(0 => '->'), 2 => array(0 => 'title'), 3 => array(0 => '', 1 => '')), $this->scope["this"], false); ?> </h1> <?php echo $this->readVarInto(array(1 => array(0 => '->'), 2 => array(0 => 'content_1'), 3 => array(0 => '', 1 => '')), $this->scope["this"], false); ?> <?php if (ifsetor(isset($this->scope["oele"]) ? $this->scope["oele"] : null, 0) == ifsetor(isset($this->scope["boele"]) ? $this->scope["boele"] : null, -1)) { ?> Yup! <?php } ?> </body> </html><?php /* end template body */ return $this->buffer . ob_get_clean();
<?php if (!isset($_SESSION)) { session_start(); } include_once '../../inc/functions.inc'; $return = array(); $method = ifsetor($_POST['method']); $data = ifsetor($_POST['data']); if ($method === 'validateSerialNumber') { // Clean serial number $data['serial_number'] = ltrim($data['serial_number'], '0'); // Make sure SN doesn't already exist in session array if (!snExists($data['serial_number'])) { // API call $return = validateSn($data['serial_number']); if ($return['serial_number']) { // Serial number is valid if: // 1. Product data is returned 2. No R account exists if (!$return['r_account']) { if (!isset($_SESSION['registration']['products'])) { $_SESSION['registration']['products'] = array(); } // Run snRules function $product = snRules($return); // Set product purchase date (based on customer entry) $product['date_of_purchase'] = $data['date_of_purchase']; $product['uploaded_file'] = ''; array_push($_SESSION['registration']['products'], $product); // Run Vac Warranty Opt In function $opt_in = $_SESSION['registration']['opt_in'];
public function __construct($logPath, LogAppenderMode $mode = null) { parent::__construct(new StandardLayout(), ifsetor($mode, LogAppenderMode::append())); $this->buffer = new Set(); $this->logPath = $logPath; }
<?php if (!isset($_SESSION)) { session_start(); } include_once '../inc/functions.inc'; $marketshare = getMarketshareProducts(); $products = ifsetor($_SESSION['registration']['products']); $products_label = 'product'; if (isset($products) && count($products) > 1) { $products_label = 'products'; } foreach ($products as $key => $value) { if (isVacuum($value['item_group']) && vacWarrantyEnabled()) { $vac_warranty_opt_in = true; break; } } $business_rules = businessRules(); ?> <?php if (count($products) > 0) { ?> <?php if ($vac_warranty_opt_in === true && !isset($complete)) { ?> <div class="alert alert-info"> <p> <strong><?php
function param($val) { return ifsetor($_REQUEST[$val], false); }
function get_field_default($tablename, $fieldname) { $dsource = get_blob_content('SELECT RDB$DEFAULT_SOURCE' . ' FROM RDB$RELATION_FIELDS' . " WHERE RDB\$FIELD_NAME='" . $fieldname . "'" . " AND RDB\$RELATION_NAME='" . $tablename . "'"); preg_match("/DEFAULT\\s+'?(([^']*)|(\\d*))'?/", $dsource, $matches); $default = ifsetor($matches[1]); return $default; }
$game_config_path = "/etc/zperfmon/"; $per_game_config_path = "/etc/zperfmon/conf.d/"; $core_include = "/var/www/html/zperfmon/include/"; set_include_path(get_include_path() . ":{$game_config_path}:{$per_game_config_path}:{$core_include}"); include_once 'server.cfg'; include_once 'game_config.php'; function ifsetor($a, $k, $d) { if (isset($a[$k])) { return $a[$k]; } return $d; } $game_name = null; $game_name = $_GET['game']; $nochrome = ifsetor($_GET, 'nochrome', 'false'); //echo $game_name; //echo $nochrome; if (preg_match('/^[ ]*$/', $game_name, $matches)) { if ($matches[0]) { //echo "<br>set game name to null</br>"; $game_name = null; } } if (preg_match('/(true)|(false)/', $nochrome, $matches)) { if (!$matches[0]) { $nochrome = null; } } function is_hidden() {
function get_opened_table($name, $title, $url, $curl = '', $cdiv = '') { global $s_fields, $tb_strings, $ptitle_strings; $red_triangle = get_icon_path(DATAPATH, ICON_SIZE) . 'red_triangle.png'; $html = <<<EOT <a href="{$url}" class="dtitle" title="{$ptitle_strings['Close']}"><img src="{$red_triangle}" alt="{$ptitle_strings['Close']}" title="{$ptitle_strings['Close']}" border="0" hspace="7">{$title}</a> <a href="{$curl}" class="act" title="Edit table comment">[C]</a> <div id="{$cdiv}" class="cmt"> </div> <table> <tr> <td width="26"> </td> <td> <table class="table table-bordered"> EOT; $cols = array('Name', 'Type', 'Charset', 'Collate', 'Computed', 'Default', 'NotNull', 'Check', 'Unique', 'Primary', 'Foreign'); $html .= " <tr align=\"left\">\n"; foreach ($cols as $idx) { $html .= ' <th class="detail">' . $tb_strings[$idx] . "</th>\n"; } $html .= " </tr>\n"; foreach ($s_fields[$name] as $field) { $type_str = isset($field['domain']) ? $field['type'] : get_type_string($field); $type_str .= isset($field['lower_bound']) ? '[' . $field['lower_bound'] . ':' . $field['upper_bound'] . ']' : ''; $char_str = isset($field['charset']) ? $field['charset'] : ' '; $coll_str = isset($field['collate']) ? $field['collate'] : ' '; $comp_str = table_column_detail_string(ifsetor($field['comp']), ifsetor($field['csource']), $GLOBALS['s_tables_comp']); $def_str = table_column_detail_string(ifsetor($field['default']), ifsetor($field['dsource']), $GLOBALS['s_tables_def']); $nn_str = isset($field['notnull']) ? $tb_strings['Yes'] : ' '; $check_str = isset($field['check']) ? $tb_strings['Yes'] : ' '; $uniq_str = table_detail_constraint_string(ifsetor($field['unique']), $GLOBALS['s_tables_cnames']); $prim_str = table_detail_constraint_string(ifsetor($field['primary']), $GLOBALS['s_tables_cnames']); $fk_str = table_detail_constraint_string(ifsetor($field['foreign']), $GLOBALS['s_tables_cnames']); $html .= " <tr>\n <td class=\"detail\">{$field['name']}</td>\n\t <td class=\"detail\">{$type_str}</td>\n \t <td class=\"detail\">{$char_str}</td>\n <td align=\"right\" class=\"detail\">{$coll_str}</td>\n <td align=\"center\" class=\"detail\">{$comp_str}</td>\n <td align=\"center\" class=\"detail\">{$def_str}</td>\n <td align=\"center\" class=\"detail\">{$nn_str}</td>\n <td align=\"center\" class=\"detail\">{$check_str}</td>\n <td align=\"center\" class=\"detail\">{$uniq_str}</td>\n <td align=\"center\" class=\"detail\">{$prim_str}</td>\n <td align=\"center\" class=\"detail\">{$fk_str}</td>\n </tr>\n"; } $html .= " </table>\n" . " </td>\n" . " </tr>\n" . " </table>\n"; return $html; }
<strong>Your information</strong><br /> <?php echo ifsetor($customer['firstname']); ?> <?php echo ifsetor($customer['lastname']); ?> <br /> <?php echo ifsetor($customer['street_address']); ?> <br /> <?php echo ifsetor($customer['city']); ?> , <?php echo ifsetor($customer['state']); ?> <?php echo ifsetor($customer['zip']); ?> <br /> <?php if (!isset($complete)) { ?> <a href="?step=customer"><i class="fa fa-pencil"></i> Edit</a><?php } ?> </div> <?php }
function pi_getLL($key, $default = NULL) { return ifsetor($this->LL[$key], $default ?: $key); }
public static function parseAttr($attr_string) { $attr = []; $pattern = '/([\\w-]+)\\s*(=\\s*"([^"]*)")?/'; preg_match_all($pattern, $attr_string, $matches, PREG_SET_ORDER); foreach ($matches as $match) { $name = strtolower($match[1]); $value = ifsetor($match[3], true); switch ($name) { case 'class': $attr[$name] = explode(' ', trim($value)); break; default: $attr[$name] = $value; } } return $attr; }
function save_triggerdefs() { global $s_triggerdefs; $s_triggerdefs['name'] = strtoupper(get_request_data('def_trigger_name')); $s_triggerdefs['table'] = $_POST['def_trigger_table']; $s_triggerdefs['phase'] = $_POST['def_trigger_phase']; $s_triggerdefs['type'] = ifsetor($_POST['def_trigger_type']); $s_triggerdefs['pos'] = $_POST['def_trigger_pos']; $s_triggerdefs['status'] = $_POST['def_trigger_status']; $s_triggerdefs['source'] = get_request_data('def_trigger_source'); }
" class="form-control <?php if (isset($field['required'])) { ?> required<?php } ?> "> <option value="">-- Select --</option> <?php foreach ($field['options'] as $key => $value) { ?> <option value="<?php echo $value['value']; ?> " <?php if ($value['value'] === ifsetor($saved['customer'][$field['name']])) { ?> selected="selected"<?php } ?> ><?php echo $value['label']; ?> </option> <?php } ?> </select> <?php } ?>