function get_backup_file_combo() { global $path_to_root, $Ajax; $ar_files = array(); default_focus('backups'); $dh = opendir(BACKUP_PATH); while (($file = readdir($dh)) !== false) { $ar_files[] = $file; } closedir($dh); rsort($ar_files); $opt_files = ""; foreach ($ar_files as $file) { if (preg_match("/.sql(.zip|.gz)?\$/", $file)) { $opt_files .= "<option value='{$file}'>{$file}</option>"; } } $selector = "<select name='backups' size=2 style='height:160px;min-width:230px'>{$opt_files}</select>"; $Ajax->addUpdate('backups', "_backups_sel", $selector); $selector = "<span id='_backups_sel'>" . $selector . "</span>\n"; return $selector; }
function hyperlink_params_separate($target, $label, $params, $center = false) { $id = default_focus(); $pars = access_string($label); // if ($center) // echo "<br><center>"; $controlAsString = "<a target='_blank' id='{$id}' href='{$target}?{$params}' {$pars['1']}>{$pars['0']}</a>\n"; View::get()->addControl(View::controlFromRenderedString(View::CONTROL_LINK, '', $controlAsString)); // if ($center) // echo "</center>"; }
function textarea_cells($label, $name, $value, $cols, $rows, $title = null, $params = "") { global $Ajax; default_focus($name); if ($value == null) { $value = !isset($_POST[$name]) ? "" : $_POST[$name]; } $controlAsString = "<textarea class='form-control' name='{$name}' cols='{$cols}' rows='{$rows}'" . ($title ? " title='{$title}'" : '') . ">{$value}</textarea></td>\n"; View::get()->addControl(View::controlFromRenderedString(View::CONTROL_TEXTAREA, $label, $controlAsString)); $Ajax->addUpdate($name, $name, $value); }
function get_backup_file_combo() { global $path_to_root; $ar_files = array(); default_focus('cmb_backups'); $dh = opendir(BACKUP_PATH); while (($file = readdir($dh)) !== false) { $ar_files[] = $file; } closedir($dh); rsort($ar_files); $opt_files = ""; foreach ($ar_files as $file) { if (strpos($file, ".sql") || strpos($file, ".sql")) { $opt_files .= "<option value='{$file}'>{$file}</option>"; } } return "<select name='cmb_backups' size=2 style='height:160;width:230'>{$opt_files}</select>"; }
function pos_list_row($label, $name, $selected_id = null, $spec_option = false, $submit_on_change = false) { View::get()->layoutHintRow(); $sql = "SELECT id, pos_name, inactive FROM " . TB_PREF . "sales_pos"; default_focus($name); $controls = combo_input($name, $selected_id, $sql, 'id', 'pos_name', array('select_submit' => $submit_on_change, 'async' => true, 'spec_option' => $spec_option, 'spec_id' => -1, 'order' => array('pos_name'))); View::get()->addComboControls($label, $controls); }