/** * Checks if an email address is valid * * @since 1.0 * @package facileManager * * @param string $address Email address to validate * @return boolean */ function printfmDNSUsersForm($user_module_perms, $module_name) { global $__FM_CONFIG, $fmdb; if (!array_key_exists($module_name, $__FM_CONFIG)) { /** Include module variables */ @(include dirname(__FILE__) . '/variables.inc.php'); } $available_zones_perms = 0; if (isSerialized($user_module_perms)) { $user_module_perms = unserialize($user_module_perms); } $available_zones_perms = isset($user_module_perms[$module_name]['access_specific_zones']) ? $user_module_perms[$module_name]['access_specific_zones'] : 0; /** Get available zones */ $available_zones[0][] = 'All Zones'; $available_zones[0][] = '0'; basicGetList('fm_' . $__FM_CONFIG[$module_name]['prefix'] . 'domains', 'domain_mapping`,`domain_name', 'domain_', 'AND domain_clone_domain_id=0'); if ($fmdb->num_rows) { $results = $fmdb->last_result; for ($i = 0; $i < $fmdb->num_rows; $i++) { $available_zones[$i + 1][] = !function_exists('displayFriendlyDomainName') ? $results[$i]->domain_name : displayFriendlyDomainName($results[$i]->domain_name); $available_zones[$i + 1][] = $results[$i]->domain_id; } } $zones_list = buildSelect("user_caps[{$module_name}][access_specific_zones]", 1, $available_zones, $available_zones_perms, 5, null, true, null, 'wide_select', __('Select one or more zones')); return sprintf(' <tr class="user_permissions"> <th></th> <td><strong>%s</strong><br />%s</td> </tr> ', __('Limit access to the following zones:'), $zones_list); }
function getUserById($id) { $connection = dbConnect(); $options = ['columns' => 'u.id_setor, u.nome, u.email, u.ativo, u.tipo, s.sigla, s.nome as setor', 'join' => [['type' => 'INNER JOIN', 'table' => 'setores s', 'columns' => 's.id = u.id_setor']], 'where' => ['u.id' => $id]]; $sql = buildSelect('usuarios u', $options); $stmt = mysqli_prepare($connection, $sql); mysqli_stmt_bind_param($stmt, 'i', $id); mysqli_stmt_execute($stmt); $resultObject = mysqli_stmt_get_result($stmt); $result = mysqli_fetch_all($resultObject, MYSQLI_ASSOC); mysqli_stmt_close($stmt); dbClose($connection); return $result[0]; }
function getStatusById($id) { $connection = dbConnect(); $options = ['columns' => 'id, status', 'where' => ['id' => $id]]; $sql = buildSelect('status_atividade', $options); $stmt = mysqli_prepare($connection, $sql); mysqli_stmt_bind_param($stmt, 'i', $id); mysqli_stmt_execute($stmt); $resultObject = mysqli_stmt_get_result($stmt); $result = mysqli_fetch_all($resultObject, MYSQLI_ASSOC); mysqli_stmt_close($stmt); dbClose($connection); return $result[0]; }
function getActivitiesById($id) { $connection = dbConnect(); $options = ['columns' => 'a.id, a.id_demandante, a.id_responsavel, a.id_setor, a.id_status, a.descricao, ud.nome as demandante, s.sigla, sa.status, a.titulo, a.data, a.tempo_gasto', 'join' => [['type' => 'INNER JOIN', 'table' => 'setores s', 'columns' => 's.id = a.id_setor'], ['type' => 'INNER JOIN', 'table' => 'status_atividade sa', 'columns' => 'sa.id = a.id_status'], ['type' => 'INNER JOIN', 'table' => 'usuarios ud', 'columns' => 'ud.id = a.id_demandante']], 'where' => ['a.id' => $id]]; $sql = buildSelect('atividades a', $options); $stmt = mysqli_prepare($connection, $sql); mysqli_stmt_bind_param($stmt, 'i', $id); mysqli_stmt_execute($stmt); $resultObject = mysqli_stmt_get_result($stmt); $result = mysqli_fetch_all($resultObject, MYSQLI_ASSOC); mysqli_stmt_close($stmt); dbClose($connection); return $result[0]; }
</tr> <?php } ?> </tbody> </table> <hr/> <table id="sortTable" class="filterTable" cellspacing="0"> <tbody> <tr> <td><label for="sort_field"><?php echo translate('SortBy'); ?> </label><?php echo buildSelect("sort_field", $sort_fields); echo buildSelect("sort_asc", $sort_dirns); ?> </td> <td><label for="limit"><?php echo translate('LimitResultsPre'); ?> </label><input type="text" size="6" id="limit" name="limit" value="<?php echo isset($_REQUEST['limit']) ? validInt($_REQUEST['limit']) : ""; ?> "/><?php echo translate('LimitResultsPost'); ?> </td> </tr> </tbody> </table>
</div> <h2><?php echo $SLANG['Control']; ?> </h2> <div id="headerControl"> <form name="contentForm" id="contentForm" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?> "> <input type="hidden" name="view" value="<?php echo $view; ?> "/> <?php echo buildSelect("mid", $mids, "this.form.submit();"); ?> </form> </div> </div> <div id="content"> <div id="ptzControls" class="ptzControls"> <?php echo ptzControls($monitor); ?> </div> </div> </div> </body> </html>
<th scope="row"><?php echo translate('VideoFormat'); ?> </th> <td><?php echo buildSelect("videoFormat", $videoFormats); ?> </td> </tr> <tr> <th scope="row"><?php echo translate('FrameRate'); ?> </th> <td><?php echo buildSelect("rate", $rates); ?> </td> </tr> <tr> <th scope="row"><?php echo translate('OverwriteExisting'); ?> </th> <td><input type="checkbox" name="overwrite" value="1"<?php if (isset($overwrite)) { ?> checked="checked"<?php } ?> /></td>
</div> <div id="content"> <form name="contentForm" id="contentForm" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?> "> <input type="hidden" name="view" value="none"/> <input type="hidden" name="mid" value="<?php echo $monitor['Id']; ?> "/> <input type="hidden" name="action" value="control"/> <input type="hidden" name="control" value="presetSet"/> <input type="hidden" name="showControls" value="1"/> <p><?php echo buildSelect("preset", $presets, "updateLabel()"); ?> </p> <p><label for="newLabel"><?php echo $SLANG['NewLabel']; ?> </label><input type="text" name="newLabel" id="newLabel" value="" size="16"/></p> <div id="contentButtons"> <input type="submit" value="<?php echo $SLANG['Save']; ?> "/><input type="button" value="<?php echo $SLANG['Cancel']; ?> " onclick="closeWindow()"/> </div>
<?php } ?> </select></td></tr> <tr><td><?php echo translate('DefaultRate'); ?> </td><td><?php echo buildSelect("newMonitor[DefaultRate]", $rates); ?> </td></tr> <tr><td><?php echo translate('DefaultScale'); ?> </td><td><?php echo buildSelect("newMonitor[DefaultScale]", $scales); ?> </td></tr> <?php if (ZM_HAS_V4L && $newMonitor['Type'] == "Local") { ?> <tr><td><?php echo translate('SignalCheckColour'); ?> </td><td><input type="text" name="newMonitor[SignalCheckColour]" value="<?php echo validHtmlStr($newMonitor['SignalCheckColour']); ?> " size="10" onchange="$('SignalCheckSwatch').setStyle( 'backgroundColor', this.value )"/><span id="SignalCheckSwatch" class="swatch" style="background-color: <?php echo $newMonitor['SignalCheckColour']; ?> ;"> </span></td></tr>
/** * Displays the form to add new policy */ function printForm($data = '', $action = 'add', $type = 'rules') { global $__FM_CONFIG; $policy_id = $policy_order_id = 0; $policy_interface = $policy_direction = $policy_time = $policy_comment = $policy_options = null; $policy_services = $policy_source = $policy_destination = $policy_action = null; $source_items = $destination_items = $services_items = null; $policy_source_not = $policy_destination_not = $policy_services_not = null; $ucaction = ucfirst($action); if (!empty($_POST) && !array_key_exists('is_ajax', $_POST)) { if (is_array($_POST)) { extract($_POST); } } elseif (@is_object($data[0])) { extract(get_object_vars($data[0])); } $server_firewall_type = getNameFromID($_POST['server_serial_no'], 'fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'servers', 'server_', 'server_serial_no', 'server_type'); $available_policy_actions = enumMYSQLSelect('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'policies', 'policy_action'); if ($server_firewall_type == 'ipfilter') { array_pop($available_policy_actions); } $policy_interface = buildSelect('policy_interface', 'policy_interface', $this->availableInterfaces($_REQUEST['server_serial_no']), $policy_interface); $policy_direction = buildSelect('policy_direction', 'policy_direction', enumMYSQLSelect('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'policies', 'policy_direction'), $policy_direction, 1); $policy_action = buildSelect('policy_action', 'policy_action', $available_policy_actions, $policy_action, 1); $source_items_assigned = getGroupItems($policy_source); $source_items = buildSelect('source_items', 'source_items', availableGroupItems('object', 'available'), $source_items_assigned, 1, null, true, null, null, __('Select one or more objects')); $destination_items_assigned = getGroupItems($policy_destination); $destination_items = buildSelect('destination_items', 'destination_items', availableGroupItems('object', 'available'), $destination_items_assigned, 1, null, true, null, null, __('Select one or more objects')); $services_items_assigned = getGroupItems($policy_services); $services_items = buildSelect('services_items', 'services_items', availableGroupItems('service', 'available'), $services_items_assigned, 1, null, true, null, null, __('Select one or more services')); $source_not_check = $policy_source_not ? 'checked' : null; $destination_not_check = $policy_destination_not ? 'checked' : null; $service_not_check = $policy_services_not ? 'checked' : null; $popup_title = $action == 'add' ? __('Add Policy') : __('Edit Policy'); $popup_header = buildPopup('header', $popup_title); $popup_footer = buildPopup('footer'); $return_form = <<<FORM \t\t<form name="manage" id="manage" method="post" action="?server_serial_no={$_REQUEST['server_serial_no']}"> \t\t{$popup_header} \t\t\t<input type="hidden" name="action" value="{$action}" /> \t\t\t<input type="hidden" name="policy_id" value="{$policy_id}" /> \t\t\t<input type="hidden" name="policy_order_id" value="{$policy_order_id}" /> \t\t\t<input type="hidden" name="policy_source_not" value="0" /> \t\t\t<input type="hidden" name="policy_destination_not" value="0" /> \t\t\t<input type="hidden" name="policy_services_not" value="0" /> FORM; if ($type == 'rules') { $return_form .= sprintf(' <table class="form-table policy-form"> <tr> <th width="33%" scope="row"><label for="policy_interface">%s</label></th> <td width="67%">%s</td> </tr> <tr> <th width="33%" scope="row"><label for="policy_direction">%s</label></th> <td width="67%">%s</td> </tr> <tr> <th width="33%" scope="row">%s</th> <td width="67%"> <input name="policy_source_not" id="policy_source_not" value="1" type="checkbox" %s /><label for="policy_source_not"><b>%s</b></label> <p class="checkbox_desc">%s</p> %s </td> </tr> <tr> <th width="33%" scope="row">%s</th> <td width="67%"> <input name="policy_destination_not" id="policy_destination_not" value="1" type="checkbox" %s /><label for="policy_destination_not"><b>%s</b></label> <p class="checkbox_desc">%s</p> %s </td> </tr> <tr> <th width="33%" scope="row">%s</th> <td width="67%"> <input name="policy_services_not" id="policy_services_not" value="1" type="checkbox" %s /><label for="policy_services_not"><b>%s</b></label> <p class="checkbox_desc">%s</p> %s </td> </tr>', __('Interface'), $policy_interface, __('Direction'), $policy_direction, __('Source'), $source_not_check, __('not'), __('Use this option to invert the match'), $source_items, __('Destination'), $destination_not_check, __('not'), __('Use this option to invert the match'), $destination_items, __('Services'), $service_not_check, __('not'), __('Use this option to invert the match'), $services_items); if ($server_firewall_type == 'iptables') { $policy_time = buildSelect('policy_time', 'policy_time', $this->availableTimes(), $policy_time); $return_form .= sprintf(' <tr> <th width="33%" scope="row"><label for="policy_time">%s</label></th> <td width="67%">%s</td> </tr>', __('Time Restriction'), $policy_time); } /** Parse options */ $options = null; if ($server_firewall_type == 'pf') { array_pop($__FM_CONFIG['fw']['policy_options']); array_pop($__FM_CONFIG['fw']['policy_options']); } foreach ($__FM_CONFIG['fw']['policy_options'] as $opt => $opt_array) { $checked = $policy_options & $opt_array['bit'] ? 'checked' : null; $options .= '<input name="policy_options[]" id="policy_options[' . $opt_array['bit'] . ']" value="' . $opt_array['bit'] . '" type="checkbox" ' . $checked . ' /><label for="policy_options[' . $opt_array['bit'] . ']">' . $opt_array['desc'] . "</label><br />\n"; } $return_form .= sprintf(' <tr> <th width="33%" scope="row"><label for="policy_action">%s</label></th> <td width="67%">%s</td> </tr> <tr> <th width="33%" scope="row">%s</th> <td width="67%"> %s </td> </tr> <tr> <th width="33%" scope="row"><label for="policy_comment">%s</label></th> <td width="67%"><textarea id="policy_comment" name="policy_comment" rows="4" cols="30">%s</textarea></td> </tr> </table>', __('Action'), $policy_action, __('Options'), $options, __('Comment'), $policy_comment); } $return_form .= <<<FORM \t\t{$popup_footer} \t\t</form> \t\t<script> \t\t\t\$(document).ready(function() { \t\t\t\t\$("#manage select").select2({ \t\t\t\t\twidth: '200px', \t\t\t\t\tminimumResultsForSearch: 10 \t\t\t\t}); \t\t\t}); \t\t</script> FORM; return $return_form; }
<div class="row"> <div class="col-md-2 col-sm-4 col-xs-7"> <?php echo buildSelect('property_city'); ?> <?php echo buildSelect('property_status'); ?> <?php echo buildSelect('locations'); ?> <?php echo buildSelect('property_type'); ?> </div> <div class="col-md-3 col-sm-4 col-xs-7"> <div class="inner-gray-box"> <label for="exampleInputEmail1">Bathroom(Min/Max)</label> <div class="form-group"> <div class="col-md-6 col-sm-6"> <select class="form-control input-sm" name="min_bathroom"> <option value="">Any</option> <option value="-1" selected>Studio</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option>
/** Query search */ if (isset($log_search_query) && !empty($log_search_query)) { $search_sql .= "AND log_data LIKE '%" . sanitize($log_search_query) . "%' "; } $query = "SELECT * FROM fm_logs WHERE account_id IN (0,{$_SESSION['user']['account_id']}) {$search_sql} ORDER BY log_timestamp DESC"; $fmdb->query($query); $log_count = $fmdb->num_rows; $total_pages = ceil($log_count / $_SESSION['user']['record_count']); if ($page > $total_pages) { $page = $total_pages; } $pagination = displayPagination($page, $total_pages); $log_search_module = isset($log_search_module) ? $log_search_module : _('All Modules'); $log_search_user = isset($log_search_user) ? $log_search_user : 0; $module_list = buildSelect('log_search_module', 1, buildModuleList(), $log_search_module, 4, null, true); $user_list = buildSelect('log_search_user', 1, buildUserList(), $log_search_user, 4, null, true); $table_info = array('class' => 'display_results'); $title_array = array(_('Timestamp'), _('Module'), _('User'), array('title' => _('Message'), 'style' => 'width: 50%;')); $header = displayTableHeader($table_info, $title_array); echo printPageHeader($response); printf('<form class="search-form" id="date-range" action="" method="post"> <table class="log_search_form" align="center"> <tbody> <tr> <td>%s</td> <td>%s</td> <td><input name="log_search_date_b" value="%s" type="text" class="datepicker" placeholder="%s" /></td> <td><input name="log_search_date_e" value="%s" type="text" class="datepicker" placeholder="%s" /></td> <td><input type="text" name="log_search_query" value="%s" placeholder="%s" /></td> <td><input value="%s" type="submit" class="button" /></td> </tr>
} } if (canView('Control') && $monitor->Type() == "Local") { ?> <div id="settingsControl"><?php echo makePopupLink('?view=settings&mid=' . $monitor->Id(), 'zmSettings' . $monitor->Id(), 'settings', translate('Settings'), true, 'id="settingsLink"'); ?> </div> <?php } ?> <div id="scaleControl"><?php echo translate('Scale'); ?> : <?php echo buildSelect("scale", $scales, "changeScale( this );"); ?> </div> </div> </div> <div id="imageFeed"> <?php if ($streamMode == "mpeg") { outputVideoStream("liveStream", $streamSrc, reScale($monitor->Width(), $scale), reScale($monitor->Height(), $scale), ZM_MPEG_LIVE_FORMAT, $monitor->Name()); } elseif ($streamMode == "jpeg") { if (canStreamNative()) { outputImageStream("liveStream", $streamSrc, reScale($monitor->Width(), $scale), reScale($monitor->Height(), $scale), $monitor->Name()); } elseif (canStreamApplet()) { outputHelperStream("liveStream", $streamSrc, reScale($monitor->Width(), $scale), reScale($monitor->Height(), $scale), $monitor->Name()); } } else {
<br /> <form method="get" action="<?php bloginfo('url'); ?> /listing-search-results/"> <?php /*$taxonomies = get_object_taxonomies('property'); foreach($taxonomies as $tax){ echo buildSelect($tax); } */ echo buildSelect('property_status'); echo buildSelect('property_type'); echo buildSelect('locations'); echo buildSelect('property_city'); ?> <select name="min_bedroom"> <option value=""> Any</option> <option value="-1"> Studio</option> <option value="1"> 1</option> <option value="2"> 2</option> <option value="5"> 5</option> </select> <select name="max_bedroom"> <option value=""> Any</option> <option value="-1">Studio</option> <option value="1"> 1</option> <option value="2"> 2</option> <option value="3"> 3</option>
/** * Displays the form to add new object */ function printForm($data = '', $action = 'add', $type = 'host') { global $__FM_CONFIG; $object_id = 0; $object_name = $object_address = $object_comment = null; $object_mask = null; $ucaction = ucfirst($action); if (!empty($_POST) && !array_key_exists('is_ajax', $_POST)) { if (is_array($_POST)) { extract($_POST); } } elseif (@is_object($data[0])) { extract(get_object_vars($data[0])); } /** Show/hide divs */ $netmask_option = $type == 'host' ? 'style="display: none;"' : null; $object_name_length = getColumnLength('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'objects', 'object_name'); $object_address_length = getColumnLength('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'objects', 'object_address'); $object_mask_length = getColumnLength('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'objects', 'object_mask'); $object_type = buildSelect('object_type', 'object_type', enumMYSQLSelect('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'objects', 'object_type'), $type, 1); $popup_title = $action == 'add' ? __('Add Object') : __('Edit Object'); $popup_header = buildPopup('header', $popup_title); $popup_footer = buildPopup('footer'); $return_form = sprintf('<form name="manage" id="manage" method="post" action="?type=%s"> %s <input type="hidden" name="action" value="%s" /> <input type="hidden" name="object_id" value="%s" /> <table class="form-table"> <tr> <th width="33%" scope="row"><label for="object_name">%s</label></th> <td width="67%"><input name="object_name" id="object_name" type="text" value="%s" size="40" placeholder="http" maxlength="%s" /></td> </tr> <tr> <th width="33%" scope="row"><label for="object_type">%s</label></th> <td width="67%"> %s </td> </tr> <tr> <th width="33%" scope="row"><label for="object_address">%s</label></th> <td width="67%"><input name="object_address" id="object_address" type="text" value="%s" size="40" placeholder="127.0.0.1" maxlength="%s" /></td> </tr> <tr id="netmask_option" %s> <th width="33%" scope="row"><label for="object_mask">%s</label></th> <td width="67%"><input name="object_mask" id="object_mask" type="text" value="%s" size="40" placeholder="255.255.255.0" maxlength="%s" /></td> </tr> <tr> <th width="33%" scope="row"><label for="object_comment">%s</label></th> <td width="67%"><textarea id="object_comment" name="object_comment" rows="4" cols="30">%s</textarea></td> </tr> </table> %s </form> <script> $(document).ready(function() { $("#manage select").select2({ width: "200px", minimumResultsForSearch: 10 }); }); </script>', $type, $popup_header, $action, $object_id, __('Object Name'), $object_name, $object_name_length, __('Object Type'), $object_type, __('Address'), $object_address, $object_address_length, $netmask_option, __('Netmask'), $object_mask, $object_mask_length, __('Comment'), $object_comment, $popup_footer); return $return_form; }
} function buildSelect($db) { if ($result = mysqli_query($db, "SELECT * FROM users WHERE admin = 0;")) { echo '<select class="form-control" name="users" id="users">'; while ($row = mysqli_fetch_assoc($result)) { echo '<option value="' . $row['id'] . '">' . $row['fullname'] . '</option>'; } echo '</select>'; } } if (isset($_POST['users'])) { $id = mysqli_real_escape_string($db, $_POST['users']); if ($result = mysqli_query($db, "DELETE FROM users WHERE id = '" . $id . "';")) { echo '<div class="alert alert-success">De gebruiker is verwijderd</div>'; } else { echo '<div class=alert alert-danger">De gebruiker werd niet verwijderd..</div>'; } } ?> <form method="post" name="delete"> <div class="form-group"> <label for="users">Gebruikers</label> <?php buildSelect($db); ?> </div> <input type="submit" style="btn btn-submit btn-danger btn-lrg" /> </form>
?> : <?php echo buildSelect('scale', $scales, 'changeScale(this);'); ?> </span> <label for="layout"><?php echo translate('Layout'); ?> :</label><?php echo buildSelect('layout', $layouts, 'selectLayout(this);'); ?> <label for="Host"><?php echo translate('Host'); ?> :</label><?php echo buildSelect("host", $hosts, 'selectHost(this);', $host); ?> </div> </div> <div id="content"> <div id="monitors"> <?php foreach ($monitors as $monitor) { $connkey = $monitor['connKey']; // Minor hack if (!isset($scale)) { $scale = reScale(SCALE_BASE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE); } ?> <div id="monitorFrame<?php echo $monitor['index'];
/** * Displays the form to add/edit logging types */ function printForm($data = '', $action = 'add', $type = 'channel') { global $__FM_CONFIG; $cfg_id = 0; $cfg_name = $cfg_root_dir = $cfg_zones_dir = $cfg_comment = null; $server_serial_no = isset($_REQUEST['request_uri']['server_serial_no']) && (intval($_REQUEST['request_uri']['server_serial_no']) > 0 || $_REQUEST['request_uri']['server_serial_no'][0] == 'g') ? sanitize($_REQUEST['request_uri']['server_serial_no']) : 0; $cfg_data = null; if (!empty($_POST) && !array_key_exists('is_ajax', $_POST)) { if (is_array($_POST)) { extract($_POST); } } elseif (@is_object($data[0])) { extract(get_object_vars($data[0])); } if ($action == 'add') { $popup_title = $type == 'channel' ? __('Add Channel') : __('Add Category'); } else { $popup_title = $type == 'channel' ? __('Edit Channel') : __('Edit Category'); } $popup_header = buildPopup('header', $popup_title); $popup_footer = buildPopup('footer'); $return_form = <<<FORM \t\t\t<form name="manage" id="manage" method="post" action="?type={$type}"> \t\t\t{$popup_header} \t\t\t\t<input type="hidden" name="action" value="{$action}" /> \t\t\t\t<input type="hidden" name="cfg_id" value="{$cfg_id}" /> \t\t\t\t<input type="hidden" name="cfg_type" value="logging" /> \t\t\t\t<input type="hidden" name="sub_type" value="{$type}" /> \t\t\t\t<input type="hidden" name="server_serial_no" value="{$server_serial_no}" /> FORM; if ($type == 'channel') { $dest = $this->getChannel($cfg_id); $cfg_syslog = buildSelect('cfg_syslog', 'cfg_syslog', $__FM_CONFIG['logging']['options']['syslog'], $this->getChannel($cfg_id, 'syslog')); $cfg_destination = buildSelect('cfg_destination', 'cfg_destination', $__FM_CONFIG['logging']['options']['destinations'], $dest, 1); $cfg_severity = buildSelect('severity', 'severity', $__FM_CONFIG['logging']['options']['severity'], $this->getChannel($cfg_id, 'severity')); $cfg_print_category = buildSelect('print-category', 'print-category', $__FM_CONFIG['logging']['options']['print-category'], $this->getChannel($cfg_id, 'print-category')); $cfg_print_severity = buildSelect('print-severity', 'print-severity', $__FM_CONFIG['logging']['options']['print-severity'], $this->getChannel($cfg_id, 'print-severity')); $cfg_print_time = buildSelect('print-time', 'print-time', $__FM_CONFIG['logging']['options']['print-time'], $this->getChannel($cfg_id, 'print-time')); $raw_cfg_file_path = explode(' ', str_replace('"', '', $this->getChannel($cfg_id, 'file'))); $cfg_file_path = $raw_cfg_file_path[0]; $cfg_file_versions = @buildSelect('cfg_file_path[]', 'cfg_file_path[]', $__FM_CONFIG['logging']['options']['file_versions'], $raw_cfg_file_path[array_search('versions', $raw_cfg_file_path) + 1]); $cfg_file_size = isset($raw_cfg_file_path[array_search('size', $raw_cfg_file_path) + 1]) ? substr($raw_cfg_file_path[array_search('size', $raw_cfg_file_path) + 1], 0, -1) : null; $cfg_file_size_spec = @buildSelect('cfg_file_path[]', 'cfg_file_path[]', $__FM_CONFIG['logging']['options']['file_sizes'], substr($raw_cfg_file_path[array_search('size', $raw_cfg_file_path) + 1], -1, 1)); /** Show/hide divs */ if ($dest == 'file' || !$dest) { $fileshow = 'block'; $syslogshow = 'none'; } elseif ($dest == 'syslog') { $fileshow = 'none'; $syslogshow = 'block'; } else { $fileshow = 'none'; $syslogshow = 'none'; } $return_form .= sprintf('<table class="form-table"> <tr> <th width="33%" scope="row"><label for="cfg_name">%s</label></th> <td width="67%"><input name="cfg_name" id="cfg_name" type="text" value="%s" size="40" /></td> </tr> <tr> <th width="33%" scope="row"><label for="cfg_destination">%s</label></th> <td width="67%"> %s <div id="destination_option" style="display: %s"> <input type="text" name="cfg_file_path[]" value="%s" placeholder="/path/to/file" /><br /> versions %s <input type="number" name="cfg_file_path[]" value="%s" style="width: 5em;" onkeydown="return validateNumber(event)" /> %s </div> <div id="syslog_options" style="display: %s">%s</div></td> </tr> </span> <tr> <th width="33%" scope="row"><label for="cfg_severity">%s</label></th> <td width="67%">%s</td> </tr> <tr> <th width="33%" scope="row"><label for="print-category">%s</label></th> <td width="67%">%s</td> </tr> <tr> <th width="33%" scope="row"><label for="print-severity">%s</label></th> <td width="67%">%s</td> </tr> <tr> <th width="33%" scope="row"><label for="print-time">%s</label></th> <td width="67%">%s</td> </tr> <tr> <th width="33%" scope="row"><label for="cfg_comment">%s</label></th> <td width="67%"><textarea id="cfg_comment" name="cfg_comment" rows="4" cols="30">%s</textarea></td> </tr> </table> %s </form> <script> $(document).ready(function() { $("#manage select").select2({ allowClear: true, minimumResultsForSearch: 10 }); }); </script>', __('Channel Name'), $cfg_data, __('Logging Destination'), $cfg_destination, $fileshow, $cfg_file_path, $cfg_file_versions, $cfg_file_size, $cfg_file_size_spec, $syslogshow, $cfg_syslog, __('Severity'), $cfg_severity, __('Print Category (optional)'), $cfg_print_category, __('Print Severity (optional)'), $cfg_print_severity, __('Print Time (optional)'), $cfg_print_time, __('Comment'), $cfg_comment, $popup_footer); } elseif ($type == 'category') { $cfg_name = buildSelect('cfg_name', 'cfg_name', $this->availableCategories($cfg_data), $cfg_data); $cfg_data = buildSelect('cfg_data', 'cfg_data', $this->availableChannels(), $this->getAssocChannels($cfg_id), 4, null, true); $return_form .= sprintf('<table class="form-table"> <tr> <th width="33%" scope="row"><label for="cfg_name">%s</label></th> <td width="67%">%s</td> </tr> <tr> <th width="33%" scope="row"><label for="cfg_data">%s</label></th> <td width="67%">%s</td> </tr> <tr> <th width="33%" scope="row"><label for="cfg_comment">%s</label></th> <td width="67%"><textarea id="cfg_comment" name="cfg_comment" rows="4" cols="30">%s</textarea></td> </tr> </table> %s </form> <script> $(document).ready(function() { $("#manage select").select2({ allowClear: true, width: "235px", minimumResultsForSearch: 10 }); }); </script>', __('Category'), $cfg_name, __('Channels'), $cfg_data, __('Comment'), $cfg_comment, $popup_footer); } else { $return_form = buildPopup('header', _('Error')); $return_form .= sprintf('<h3>%s</h3><p>%s</p>', __('Oops!'), __('Invalid request.')); $return_form .= buildPopup('footer', _('OK'), array('cancel')); } return $return_form; }
echo $SLANG['Montage']; ?> </h2> <div id="headerControl"> <span id="scaleControl"><?php echo $SLANG['Scale']; ?> : <?php echo buildSelect("scale", $scales, "changeScale( this );"); ?> </span> <label for="layout"><?php echo $SLANG['Layout']; ?> :</label><?php echo buildSelect("layout", $layouts, 'selectLayout( this )'); ?> </div> </div> <div id="content"> <div id="monitors"> <?php foreach ($monitors as $monitor) { $connkey = $monitor['connKey']; // Minor hack if (!isset($scale)) { $scale = reScale(SCALE_BASE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE); } ?> <div id="monitorFrame<?php echo $monitor['index'];
<input type="hidden" name="autoDelete" value="<?php echo requestVar('autoDelete'); ?> "/> <?php if (count($filterNames)) { ?> <p> <label for="<?php echo $selectName; ?> "><?php echo translate('SaveAs'); ?> </label><?php echo buildSelect($selectName, $filterNames); ?> <label for="<?php echo $newSelectName; ?> "><?php echo translate('OrEnterNewName'); ?> </label><input type="text" size="32" id="<?php echo $newSelectName; ?> " name="<?php echo $newSelectName; ?> " value="<?php echo requestVar('filterName');
/** * Parses for address_match_element and formats * * @since 1.3.5 * @package fmDNS * * @param string $cfg_name Config name to query * @param string $cfg_data Data to parse/format * @return string Return formated data */ function populateDefTypeDropdown($def_type, $cfg_data, $select_name = 'cfg_data') { global $fmdb, $__FM_CONFIG, $fm_dns_acls; $raw_def_type_array = explode(')', str_replace('(', '', $def_type)); $saved_data = explode(' ', $cfg_data); $i = 0; $dropdown = null; foreach ($raw_def_type_array as $raw_def_type) { $def_type_items = null; if (strlen(trim($raw_def_type))) { $raw_items = explode('|', $raw_def_type); foreach ($raw_items as $item) { $def_type_items[] = trim($item); } $dropdown .= buildSelect($select_name . '[]', $select_name, $def_type_items, $saved_data[$i], 1); } $i++; } return $dropdown; }
?> " size="3" onchange="limitRange( this, 0, 255 )"/> / <input type="text" name="newAlarmRgbG" value="<?php echo $newZone['AlarmRGB'] >> 8 & 0xff; ?> " size="3" onchange="limitRange( this, 0, 255 )"/> / <input type="text" name="newAlarmRgbB" value="<?php echo $newZone['AlarmRGB'] & 0xff; ?> " size="3" onchange="limitRange( this, 0, 255 )"/></td> </tr> <tr> <th scope="row"><?php echo translate('CheckMethod'); ?> </th> <td colspan="2"><?php echo buildSelect("newZone[CheckMethod]", $optCheckMethods, 'applyCheckMethod()'); ?> </td> </tr> <tr> <th scope="row"><?php echo translate('ZoneMinMaxPixelThres'); ?> </th> <td><input type="text" name="newZone[MinPixelThreshold]" value="<?php echo $newZone['MinPixelThreshold']; ?> " size="4" onchange="limitRange( this, 0, 255 )"/></td> <td><input type="text" name="newZone[MaxPixelThreshold]" value="<?php echo $newZone['MaxPixelThreshold']; ?>
<input type="hidden" name="view" value="none"/> <input type="hidden" name="mid" value="<?php echo validNum($_REQUEST['mid']); ?> "/> <p> <?php echo translate('MonitorProbeIntro'); ?> </p> <p> <label for="probe"><?php echo translate('DetectedCameras'); ?> </label><?php echo buildSelect("probe", $cameras, 'configureButtons( this )'); ?> </p> <div id="contentButtons"> <input type="submit" name="saveBtn" value="<?php echo translate('Save'); ?> " onclick="submitCamera( this )" disabled="disabled"/><input type="button" value="<?php echo translate('Cancel'); ?> " onclick="closeWindow()"/> </div> </form> </div> </div> </body>
/** * Displays the form to add new user * * @since 1.0 * @package facileManager */ function printUsersForm($data = '', $action = 'add', $form_bits = array(), $button_text = 'Save', $button_id = 'submit', $action_page = 'admin-users.php', $print_form_head = true, $display_type = 'popup') { global $__FM_CONFIG, $fm_name, $fm_login; $user_id = 0; $user_login = $user_password = $cpassword = null; $ucaction = ucfirst($action); $disabled = isset($_GET['id']) && $_SESSION['user']['id'] == $_GET['id'] ? 'disabled' : null; $button_disabled = null; $user_email = $user_default_module = null; $hidden = $user_perm_form = $return_form_rows = null; $user_force_pwd_change = $user_template_only = null; if (!empty($_POST) && !array_key_exists('is_ajax', $_POST)) { if (is_array($_POST)) { extract($_POST); } } elseif (@is_object($data[0])) { extract(get_object_vars($data[0])); $user_password = null; } $popup_title = $action == 'add' ? __('Add User') : __('Edit User'); $popup_header = buildPopup('header', $popup_title); $popup_footer = buildPopup('footer'); if (in_array('user_login', $form_bits)) { /** Get field length */ $field_length = getColumnLength('fm_users', 'user_login'); $username_form = $action == 'add' ? '<input name="user_login" id="user_login" type="text" value="' . $user_login . '" size="40" maxlength="' . $field_length . '" />' : '<span id="form_username">' . $user_login . '</span>'; $hidden = '<input type="hidden" name="user_id" value="' . $user_id . '" />'; $hidden .= $action != 'add' ? '<input type="hidden" name="user_login" value="' . $user_login . '" />' : null; $return_form_rows .= '<tr> <th width="33%" scope="row"><label for="user_login">' . _('User Login') . '</label></th> <td width="67%">' . $username_form . '</td> </tr>'; } if (in_array('user_email', $form_bits)) { /** Get field length */ $field_length = getColumnLength('fm_users', 'user_login'); $return_form_rows .= '<tr> <th width="33%" scope="row"><label for="user_email">' . _('User Email') . '</label></th> <td width="67%"><input name="user_email" id="user_email" type="email" value="' . $user_email . '" size="32" maxlength="' . $field_length . '" ' . $disabled . ' /></td> </tr>'; } if (in_array('user_auth_method', $form_bits) && getOption('auth_method')) { if (!isset($user_auth_type)) { $user_auth_type = 1; } $auth_method_types = $__FM_CONFIG['options']['auth_method']; if (array_shift($auth_method_types) && count($auth_method_types) > 1) { $return_form_rows .= '<tr> <th width="33%" scope="row"><label for="user_email">' . _('Authentication Method') . '</label></th> <td width="67%">' . buildSelect('user_auth_type', 'user_auth_type', $auth_method_types, $user_auth_type) . '</td> </tr>'; } } if (in_array('user_password', $form_bits) || array_key_exists('user_password', $form_bits)) { if ($action == 'add') { $button_disabled = 'disabled'; } $strength = $GLOBALS['PWD_STRENGTH']; if (array_key_exists('user_password', $form_bits)) { $strength = $form_bits['user_password']; } $return_form_rows .= '<tr class="user_password"> <th width="33%" scope="row"><label for="user_password">' . _('User Password') . '</label></th> <td width="67%"><input name="user_password" id="user_password" type="password" value="" size="40" onkeyup="javascript:checkPasswd(\'user_password\', \'' . $button_id . '\', \'' . $strength . '\');" /></td> </tr> <tr class="user_password"> <th width="33%" scope="row"><label for="cpassword">' . _('Confirm Password') . '</label></th> <td width="67%"><input name="cpassword" id="cpassword" type="password" value="" size="40" onkeyup="javascript:checkPasswd(\'cpassword\', \'' . $button_id . '\', \'' . $strength . '\');" /></td> </tr> <tr class="user_password"> <th width="33%" scope="row">' . _('Password Validity') . '</th> <td width="67%"><div id="passwd_check">' . _('No Password') . '</div></td> </tr> <tr class="pwdhint user_password"> <th width="33%" scope="row">' . _('Hint') . '</th> <td width="67%">' . $__FM_CONFIG['password_hint'][$strength][1] . '</td> </tr>'; } if (in_array('user_module', $form_bits)) { $active_modules = $user_id == $_SESSION['user']['id'] ? getActiveModules(true) : getActiveModules(); $user_module_options = buildSelect('user_default_module', 'user_default_module', $active_modules, $user_default_module); unset($active_modules); $return_form_rows .= '<tr> <th width="33%" scope="row">' . _('Default Module') . '</th> <td width="67%">' . $user_module_options . '</td> </tr>'; } if (in_array('user_options', $form_bits)) { $force_pwd_check = $user_force_pwd_change == 'yes' ? 'checked disabled' : null; $user_template_only_check = $user_template_only == 'yes' ? 'checked' : null; $return_form_rows .= '<tr> <th width="33%" scope="row">' . _('Options') . '</th> <td width="67%"> <input name="user_force_pwd_change" id="user_force_pwd_change" value="yes" type="checkbox" ' . $force_pwd_check . '/><label for="user_force_pwd_change">' . _('Force Password Change at Next Login') . '</label><br /> <input name="user_template_only" id="user_template_only" value="yes" type="checkbox" ' . $user_template_only_check . '/><label for="user_template_only">' . _('Template User') . '</label> </td> </tr>'; } if (in_array('verbose', $form_bits)) { $hidden .= '<input type="hidden" name="verbose" value="0" />' . "\n"; $return_form_rows .= '<tr> <th width="33%" scope="row">' . _('Options') . '</th> <td width="67%"><input name="verbose" id="verbose" type="checkbox" value="1" checked /><label for="verbose">' . _('Verbose Output') . '</label></td> </tr>'; } do { if (in_array('user_perms', $form_bits)) { /** Cannot edit perms of super-admin if logged in user is not a super-admin */ if (userCan($user_id, 'do_everything') && !currentUserCan('do_everything')) { break; } $user_is_super_admin = userCan($user_id, 'do_everything'); $fm_perm_boxes = $perm_boxes = null; $i = 1; $fm_user_caps = getAvailableUserCapabilities(); foreach ($fm_user_caps[$fm_name] as $key => $title) { if ($key != 'do_everything' && $user_is_super_admin) { $checked = null; } else { $checked = userCan($user_id, $key) ? 'checked' : null; } if ($key == 'do_everything') { $title = "<b>{$title}</b>"; } $fm_perm_boxes .= ' <input name="user_caps[' . $fm_name . '][' . $key . ']" id="fm_perm_' . $key . '" type="checkbox" value="1" ' . $checked . '/> <label for="fm_perm_' . $key . '">' . $title . '</label>' . "\n"; /** Display checkboxes three per row */ if ($i == 3) { $fm_perm_boxes .= "<br />\n"; $i = 0; } $i++; } if (!empty($fm_perm_boxes)) { $perm_boxes .= <<<PERM \t\t\t\t<tr id="userperms"> \t\t\t\t\t<th width="33%" scope="row">{$fm_name}</th> \t\t\t\t\t<td width="67%"> \t\t\t\t\t\t<input type="hidden" name="process_user_caps" value="1" /> \t\t\t\t\t\t{$fm_perm_boxes} \t\t\t\t\t</td> \t\t\t\t</tr> PERM; } /** Process module permissions */ $active_modules = getActiveModules(); foreach ($active_modules as $module_name) { $module_perm_boxes = null; $i = 1; if (array_key_exists($module_name, $fm_user_caps)) { foreach ($fm_user_caps[$module_name] as $key => $title) { $checked = userCan($user_id, $key, $module_name) && !$user_is_super_admin ? 'checked' : null; $module_perm_boxes .= ' <input name="user_caps[' . $module_name . '][' . $key . ']" id="fm_perm_' . $module_name . '_' . $key . '" type="checkbox" value="1" ' . $checked . '/> <label for="fm_perm_' . $module_name . '_' . $key . '">' . $title . '</label>' . "\n"; /** Display checkboxes three per row */ if ($i == 3) { $module_perm_boxes .= "<br />\n"; $i = 0; } $i++; } $module_extra_functions = ABSPATH . 'fm-modules' . DIRECTORY_SEPARATOR . $module_name . DIRECTORY_SEPARATOR . 'functions.extra.php'; if (file_exists($module_extra_functions)) { include $module_extra_functions; $function = 'print' . $module_name . 'UsersForm'; if (function_exists($function)) { $module_perm_boxes .= $function(getUserCapabilities($user_id), $module_name); } } } if (!empty($module_perm_boxes)) { $perm_boxes .= <<<PERM \t\t\t\t\t<tr id="userperms"> \t\t\t\t\t\t<th width="33%" scope="row">{$module_name}</th> \t\t\t\t\t\t<td width="67%"> \t\t\t\t\t\t{$module_perm_boxes} \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t PERM; } } if (!empty($perm_boxes)) { $user_perm_form = sprintf('<tr><td colspan="2"><br /><br /><i>%s</i></td></tr>', _('User Permissions')) . $perm_boxes; } } } while (false); $return_form = $print_form_head ? '<form name="manage" id="manage" method="post" action="' . $action_page . '">' . "\n" : null; if ($display_type == 'popup') { $return_form .= $popup_header; } $return_form .= ' <div> <form id="fm_user_profile"> <input type="hidden" name="action" value="' . $action . '" />' . $hidden . ' <table class="form-table" width="495px"> <tr><td colspan="2"><i>' . _('User Details') . '</i></td></tr>' . $return_form_rows . $user_perm_form; $return_form .= '</table></div>'; if ($display_type == 'popup') { $return_form .= ' </div> <div class="popup-footer"> <input type="submit" id="' . $button_id . '" name="submit" value="' . $button_text . '" class="button primary" ' . $button_disabled . '/> <input type="button" value="' . _('Cancel') . '" class="button left" id="cancel_button" /> </div> </form> <script> $(document).ready(function() { $("select").select2({ containerCss: { "min-width": "165px" }, minimumResultsForSearch: -1 }); $("select.wide_select").select2({ width: "300px", minimumResultsForSearch: -1 }); }); </script>'; } return $return_form; }
/** * Builds bulk action menu * * @since 1.1 * @package facileManager * * @return array */ function buildBulkActionMenu($bulk_actions_list = null, $id = 'bulk_action') { if (is_array($bulk_actions_list)) { $bulk_actions[] = null; return buildSelect($id, 'bulk_action', array_merge($bulk_actions, $bulk_actions_list), null, 1, '', false, null, null, _('Bulk Actions')) . '<input type="submit" name="bulk_apply" id="bulk_apply" value="' . _('Apply') . '" class="button" />' . "\n"; } }
<th scope="row"><?php echo $SLANG['FrameRate']; ?> </th> <td><?php echo buildSelect("rate", $rates); ?> </td> </tr> <tr> <th scope="row"><?php echo $SLANG['VideoSize']; ?> </th> <td><?php echo buildSelect("scale", $scales); ?> </td> </tr> <tr> <th scope="row"><?php echo $SLANG['OverwriteExisting']; ?> </th> <td><input type="checkbox" name="overwrite" value="1"<?php if (!empty($_REQUEST['overwrite'])) { ?> checked="checked"<?php } ?> /></td>
</div> <div id="content"> <form name="contentForm" id="contentForm" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?> "> <input type="hidden" name="view" value="none"/> <input type="hidden" name="action" value="donate"/> <p> <?php echo $SLANG['DonateEnticement']; ?> </p> <p> <?php echo buildSelect("option", $options); ?> </p> <div id="contentButtons"> <input type="submit" value="<?php echo $SLANG['Apply']; ?> " onclick="submitForm( this )"> <input type="button" value="<?php echo $SLANG['Close']; ?> " onclick="closeWindow()"> </div> </form> </div> </div>
</tr> </table> </div> <div id="menuBar1"> <div id="scaleControl"><label for="scale"><?php echo translate('Scale'); ?> </label><?php echo buildSelect("scale", $scales, "changeScale();"); ?> </div> <div id="replayControl"><label for="replayMode"><?php echo translate('Replay'); ?> </label><?php echo buildSelect("replayMode", $replayModes, "changeReplayMode();"); ?> </div> <div id="nameControl"> <input type="text" id="eventName" name="eventName" value="<?php echo validHtmlStr($event['Name']); ?> " size="16"/> <input type="button" value="<?php echo translate('Rename'); ?> " onclick="renameEvent()"<?php if (!canEdit('Events')) { ?> disabled="disabled"<?php }
/** * Displays the form to add new server */ function printForm($data = '', $action = 'add') { global $__FM_CONFIG; $server_id = 0; $server_name = $runas = $server_type = $server_update_port = null; $server_update_method = $server_config_file = $server_os = null; $ucaction = ucfirst($action); $server_installed = false; if (!empty($_POST) && !array_key_exists('is_ajax', $_POST)) { if (is_array($_POST)) { extract($_POST); } } elseif (@is_object($data[0])) { extract(get_object_vars($data[0])); } /** Show/hide divs */ if (isset($server_run_as_predefined) && $server_run_as_predefined == 'as defined:') { $runashow = 'block'; } else { $runashow = 'none'; $server_run_as = null; } $server_update_port_style = $server_update_method == 'cron' ? 'style="display: none;"' : 'style="display: block;"'; $disabled = $server_installed == 'yes' ? 'disabled' : null; if ($server_installed == 'yes') { if (strpos($server_update_method, 'http') === false) { $server_update_method_choices = array($server_update_method); } else { $server_update_method_choices = array('http', 'https'); } } else { $server_update_method_choices = enumMYSQLSelect('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'servers', 'server_update_method'); } $available_server_types = $this->getAvailableFirewalls(enumMYSQLSelect('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'servers', 'server_type'), $server_os); $server_type = buildSelect('server_type', 'server_type', $available_server_types, $server_type, 1); $server_update_method = buildSelect('server_update_method', 'server_update_method', $server_update_method_choices, $server_update_method, 1); $popup_title = $action == 'add' ? __('Add Firewall') : __('Edit Firewall'); $popup_header = buildPopup('header', $popup_title); $popup_footer = buildPopup('footer'); $alternative_help = $action == 'add' && getOption('client_auto_register') ? sprintf('<p><b>%s</b> %s</p>', __('Note:'), __('The client installer can automatically generate this entry.')) : null; $server_name_length = getColumnLength('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'servers', 'server_name'); $return_form = sprintf('<form name="manage" id="manage" method="post" action=""> %s <input type="hidden" name="action" value="%s" /> <input type="hidden" name="server_id" value="%d" /> %s <table class="form-table"> <tr> <th width="33%" scope="row"><label for="server_name">%s</label></th> <td width="67%"><input name="server_name" id="server_name" type="text" value="%s" size="40" placeholder="fw1.local" maxlength="%d" /></td> </tr> <tr> <th width="33%" scope="row"><label for="server_type">%s</label></th> <td width="67%">%s</td> </tr> <tr> <th width="33%" scope="row"><label for="server_update_method">%s</label></th> <td width="67%">%s<div id="server_update_port_option" %s><input type="number" name="server_update_port" value="%s" placeholder="80" onkeydown="return validateNumber(event)" maxlength="5" max="65535" /></div></td> </tr> <tr> <th width="33%" scope="row"><label for="server_config_file">%s</label></th> <td width="67%"><input name="server_config_file" id="server_config_file" type="text" value="%s" size="40" /></td> </tr> </table> %s </form> <script> $(document).ready(function() { $("#manage select").select2({ width: "200px", minimumResultsForSearch: 10 }); }); </script>', $popup_header, $action, $server_id, $alternative_help, __('Server Name'), $server_name, $server_name_length, __('Firewall Type'), $server_type, __('Update Method'), $server_update_method, $server_update_port_style, $server_update_port, __('Config File'), $server_config_file, $popup_footer); return $return_form; }
function nicdark_shortcode_advanced_search($atts, $content = null) { $atts = shortcode_atts(array('post_type' => '', 'columns' => '', 'btncolor' => '', 'bginput' => '', 'css_field' => '', 'id' => '', 'autocomplete' => ''), $atts); $str = ''; $idavailablepackages = rand(1, 10000); $posttype = $atts['post_type']; $columns = $atts['columns']; $btncolor = $atts['btncolor']; $bginput = $atts['bginput']; $id = $atts['id']; $css_field = $atts['css_field']; $autocomplete = $atts['autocomplete']; //start translate $nicdark_text_search_date_from = __('From', 'nicdark-shortcodes'); $nicdark_text_search_date_to = __('To', 'nicdark-shortcodes'); $nicdark_text_search_keyword = __('Type Your Destination', 'nicdark-shortcodes'); $nicdark_text_search_submit = __('SEARCH', 'nicdark-shortcodes'); //end translate //find action link $action = get_post_type_archive_link('' . $posttype . ''); $outputdateparam = $posttype != 'courses' ? ' <div id="nicdark_advanced_search_dates" style="box-sizing:border-box; padding: 0px 10px;" class=" nicdark_width100_responsive grid ' . $columns . ' percentage"> <input class="nicdark_activity nicdark_width_percentage49 nicdark_bg_' . $bginput . ' grey medium subtitle nicdark_calendar_range nicdark_calendar_from" placeholder="' . $nicdark_text_search_date_from . '" name="date_from" type="text" value=""> <input style="float:right;" class="nicdark_width_percentage49 nicdark_bg_' . $bginput . ' grey medium subtitle nicdark_calendar_range nicdark_calendar_to" placeholder="' . $nicdark_text_search_date_to . '" name="date_to" type="text" value=""> </div> ' : ''; $str .= '<style type="text/css">' . $css_field . '</style>'; $str .= ' <script type="text/javascript"> /* <![CDATA[ */ var availablePackages = ['; //all packages title $args = array('post_type' => '' . $posttype . '', 'posts_per_page' => -1); $the_query = new WP_Query($args); while ($the_query->have_posts()) { $the_query->the_post(); $title_package = get_the_title(); $str .= '"' . $title_package . '",'; } wp_reset_postdata(); //end all packages title $str .= ' " " ]; /* ]]> */ </script> <form id="' . $id . '" class="nicdark_advanced_search" action="' . $action . '" method="GET"> <div id="nicdark_advanced_search_keyword" style="box-sizing:border-box; padding: 0px 10px;" class=" nicdark_width100_responsive grid ' . $columns . ' percentage"> <input type="hidden" value="true" name="advsearch"> <input type="hidden" value="' . $posttype . '" name="posttype"> <input id="nicdark_autocomplete" class="nicdark_bg_' . $bginput . ' grey medium subtitle" type="text" placeholder="' . $nicdark_text_search_keyword . '" name="keyword" value=""> </div>'; $taxonomies = get_object_taxonomies($posttype); $i = 0; foreach ($taxonomies as $tax) { $str .= '' . buildSelect($tax, $bginput, $columns, $i) . ''; $i = $i + 1; } $str .= '' . $outputdateparam . ' <div id="nicdark_advanced_search_prices" style="box-sizing:border-box; padding: 0px 10px;" class=" nicdark_width100_responsive grid ' . $columns . ' percentage"> <div class="nicdark_margintop30 nicdark_bg_' . $bginput . '2 nicdark_slider_range nicdark_slider_range_' . $btncolor . ' nicdark_activity nicdark_width_percentage49 nicdark_width100_iphonepotr"></div> <div class="nicdark_displayblock_iphonepotr nicdark_displaynone_desktop" style="height: 20px; float:left; width:100%"></div> <input name="price_from_to" style="float:right;" class="nicdark_bg_' . $bginput . ' grey subtitle medium nicdark_slider_amount nicdark_width_percentage49 nicdark_width100_iphonepotr" type="text"> </div> <div id="nicdark_advanced_search_button" style="box-sizing:border-box; padding: 0px 10px;" class=" nicdark_width100_responsive grid ' . $columns . ' percentage"> <input type="submit" value="' . $nicdark_text_search_submit . '" class="nicdark_btn nicdark_btn_filter fullwidth nicdark_bg_' . $btncolor . ' "> </div> <input type="hidden" value="' . $i . '" name="qnt-taxonomies"> </form>'; //start if if ($autocomplete == 1) { function nicdark_add_autocomplete_js() { echo ' <script type="text/javascript"> /* <![CDATA[ */ jQuery(document).ready(function(){ jQuery("#nicdark_autocomplete").autocomplete({ source: availablePackages }); }); /* ]]> */ </script> '; } add_action('wp_footer', 'nicdark_add_autocomplete_js', 100); } //end if return apply_filters('uds_shortcode_out_filter', $str); }