/** * function used to apply filters or should I say functions on * anything given * * first a filter must be registered using register_filter * * @param STRING $content or $object on which filters are applied * @param STRING $type type of filter */ function apply_filters($content, $type) { //Get list of filters $filters = get_filters($type); if ($filters) { foreach ($filters as $filter) { if (function_exists($filter['filter'])) { $params = $filter['params']; if ($params) { $content = $filter['filter']($content, $params); } else { $content = $filter['filter']($content); } } } } return $content; }
<?php } ?> </select> <div id="gdesc" style="padding: 4px 10px;"><?php echo security_group_desc_by_access($user['access']); ?> </div><div id="hr"></div> Является членом групп: <?php $groups = new CVCAppendingList(); $groups->Init('groups', 'height=48px;'); $glist = group_list(); for ($i = 0; $i < count($glist); $i++) { $g = $glist[$i]; $groups->AppendItem($g['name'], $g['id']); } $groups->SetItemsUsed(user_get_groups($id)); $groups->Draw(); ?> <div class="formPast"> <button class="submitBtn" type="button" onclick="nav ('.?<?php echo get_filters(); echo $page != '' ? '&page=' . $page : ''; ?> ');">Назад</button> <button class="submitBtn" type="submit">Сохранить</button> </div> </form> <?php formc();
} else { $feed = $_POST['feed']; $message = 'feed updated'; } update_feed($feed, $module, array_keys($_POST['cat'])); header('Location: ' . implode('/', array(WWW_ROOT, 'module', $module, feed_id_encode($feed)))); message($message); return; } $feed = !empty($request_parts[2]) ? feed_id_decode($request_parts[2]) : NULL; $args = array( 'module' => $module, 'filters' => get_filters($module), 'feed' => $feed, 'feed_cats' => get_feed_cats($feed) ); if ($feed) { $args['title'] = module_name($module) . ' ' . feed_id_encode($feed); $args['feed_items'] = get_feed_items($module, $feed); template('module', $args); } else { $args['title'] = module_name($module); template('module', $args); } } http_response_code(404);
function get_table_data($RRN, $lang = '', $limit = '', $filters_string = '', $filters_relations = '') { # 0.0.6 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # gets data from the table # # possible values for $RRN: # *all = to get all the records (pending $limit value) # *info = to know how many records the table contains # {string} = to get the record by its key RRN (ID) # 0.0.4 # //if($RRN!='*all' && $RRN!='*info' && (int)$RRN==0) { return; } # 0.0.4 if ($RRN != '*all' && $RRN != '*info' && $RRN == '') { return; } # 0.0.4 # global $isFilteredData, $_FLD_DEFS, $_T_FLD_DEFS, $_FIELDS, $_T_FIELDS; //var_dump($_FIELDS); //echo '<br>'.$_T_FIELDS; //var_dump($_FLD_DEFS); //echo '<br>'.$_T_FLD_DEFS; //echo '<code><b>get_table_data(</b>'.$RRN.', '.$lang.', '.$limit.', '.$filters_string.'<b>)</b></code><br>'; //return; $sql = 'SELECT '; for ($i = 0; $i < $_T_FIELDS; $i++) { $sql .= '`' . EDIT_TABLE_NAME . '`.`' . $_FIELDS[$i]['Field'] . '` AS r_' . $_FIELDS[$i]['Field'] . ', '; } $sql = substr($sql, 0, -2) . ' ' . 'FROM `' . MAINSITE_DB . '`.`' . EDIT_TABLE_NAME . '` ' . 'WHERE 1=1 '; if (is_numeric($RRN)) { $sql .= 'AND `' . EDIT_TABLE_NAME . '`.`' . EDIT_TABLE_RRN_FIELD . '` = ' . (int) $RRN . ' '; } elseif (is_string($RRN) && $RRN != '*all' && $RRN != '*info') { $key_name = explode('|', EDIT_TABLE_RRN_FIELD); $key_value = explode('|', $RRN); foreach ($key_name as $k => $value) { $sql .= 'AND `' . EDIT_TABLE_NAME . '`.`' . $value . '` = \'' . mysql_real_escape_string($key_value[$k]) . '\' '; } } elseif (strlen($filters_string) > 0) { $filters = get_filters($filters_string); # # 0.0.6: BEG #------------- $tf = count($filters); $filters_rel = get_filters($filters_relations); $sql .= ' AND'; $trf = count($filters_rel); $f = 0; $filter_name_const_inp = array(); $filter_name_const_out = array(); $filter_name_const_inp[] = 'filter_'; $filter_name_const_out[] = ''; $filter_name_dates_inp = array(); $filter_name_dates_out = array(); $filter_name_dates_inp[] = 'from_'; $filter_name_dates_out[] = ''; $filter_name_dates_inp[] = 'to_'; $filter_name_dates_out[] = ''; #------------- # 0.0.6: END # //echo '$filters_string=>'.$filters_string.'<hr>'; //echo '$filters:<br>';var_dump($filters);echo '<hr>'; //echo '$filters_relations=>'.$filters_relations.'<hr>'; //echo '$filters_rel:<br>';var_dump($filters_rel);echo '<hr>'; //echo '$tf=>'.$tf.'<hr>'; // $_SESSION[EDIT_TABLE_NAME.'_filters']['filter_00box'] = $_POST['filter_00box']; // $_SESSION[EDIT_TABLE_NAME.'_filters']['filter_nome'] = $_POST['filter_nome']; // $_SESSION[EDIT_TABLE_NAME.'_filters']['filter_descrizione'] = $_POST['filter_descrizione']; foreach ($filters as $name => $value) { if ($value != '') { $isFilteredData = true; //$sql .= 'AND `'.EDIT_TABLE_NAME.'`.`'.str_replace('filter_', '', $name).'` ' // .'LIKE \''.mysql_real_escape_string(str_replace('*','%',$value)).'\' ' //; //$name = str_replace('filter_', '', $name); # 0.0.6 $name = str_replace($filter_name_const_inp, $filter_name_const_out, $name); # 0.0.6 $value = str_replace('*', '%', $value); $ii = 0; $type = ''; while ($ii < $_T_FIELDS && $type == '') { # let's get the field type # //if($_FIELDS[$ii]['Field']==$name) # 0.0.6 if ($_FIELDS[$ii]['Field'] == str_replace($filter_name_dates_inp, $filter_name_dates_out, $name)) { $type = $_FIELDS[$ii]['Type']; } $ii++; } $field_len_info = table_editor_get_field_len_info($type); # 0.0.6 //echo '$name['.$name.']<br>'; //echo '$value['.$value.']<br>'; //echo '$type['.$type.']<br>'; //var_dump($field_len_info);echo '<hr>'; //var_dump($_SESSION[EDIT_TABLE_NAME.'filters']);echo '<hr>'; //var_dump($_SESSION[EDIT_TABLE_NAME.'_rel_filters']);echo $name. '<hr>'; # # 0.0.6: BEG #------------- $filter_relation = 'AND'; if (isset($filters_rel['_rel_filter_' . $name . '_'])) { $filter_relation = $filters_rel['_rel_filter_' . $name . '_']; //var_dump($filters);echo '<br>'; //var_dump($filters_rel);echo $name.','.$filter_relation.'<hr>'; } $f++; if ($f > 1 && $f == $trf) { $filter_relation = ''; } #------------- # 0.0.6: END # //echo 'rel['.$filters_rel['_rel_filter_'.$name.'_'].']<br>'; //echo '$filter_relation['.$filter_relation.'], $f['.$f.'], tf['.$tf.'], trf['.$trf.']<br>'; if ($field_len_info['dec'] > 0) { # MySQL does not like the comma used as the decimal separator... # $value = str_replace(',', '.', $value); } if ($type == '' || $field_len_info['isSTRING'] == true || $field_len_info['isTEXT'] == true) { //$sql .= 'AND `'.EDIT_TABLE_NAME.'`.`'.$name.'` = \''.mysql_real_escape_string($value).'\' '; # 0.0.6 $string = str_replace('*', '%', $value); //$sql .= 'AND `'.EDIT_TABLE_NAME.'`.`'.$name.'` LIKE \''.mysql_real_escape_string($value).'\' '; # 0.0.6 $sql .= ' `' . EDIT_TABLE_NAME . '`.`' . $name . '` LIKE \'' . mysql_real_escape_string($value) . '\' ' . $filter_relation; # 0.0.6 } else { if ($type == 'date') { # # 0.0.6: BEG #------------- //$ii = 0; //$hasEndDate = ''; //while($ii<$_T_FLD_DEFS && $hasEndDate=='') //{ // # let's get the end date field // # // if($_FLD_DEFS[$ii]['field']==$name && strlen($_FLD_DEFS[$ii]['hasEndDate'])>0) // { // $hasEndDate = $_FLD_DEFS[$ii]['hasEndDate']; // } // $ii++; //} //if($hasEndDate=='') //{ // $sql .= 'AND `'.EDIT_TABLE_NAME.'`.`'.$name.'` <= \''.format_calendar_to_date($value).'\' '; # 0.0.6 //} //else //{ // $sql .= 'AND `'.EDIT_TABLE_NAME.'`.`'.$name.'` >= \''.format_calendar_to_date($value).'\' '; # 0.0.6 //} if (substr($name, 0, 5) == 'from_') { $sql .= ' (`' . EDIT_TABLE_NAME . '`.`' . substr($name, 5) . '` >= \'' . format_calendar_to_date($value) . '\' AND '; } else { if (substr($name, 0, 3) == 'to_') { $sql .= ' `' . EDIT_TABLE_NAME . '`.`' . substr($name, 3) . '` <= \'' . format_calendar_to_date($value) . '\') ' . $filter_relation; } } #------------- # 0.0.6: END # } elseif ($type == 'datetime' || $type == 'timestamp') { //$sql .= 'AND `'.EDIT_TABLE_NAME.'`.`'.$name.'` = \''.format_calendar_to_datetime($value).'\' '; # 0.0.6 $sql .= ' `' . EDIT_TABLE_NAME . '`.`' . $name . '` = \'' . format_calendar_to_datetime($value) . '\' ' . $filter_relation; # 0.0.6 } elseif ((int) $field_len_info['dec'] > 0) { //$sql .= 'AND `'.EDIT_TABLE_NAME.'`.`'.$name.'` = '.$value.' '; # 0.0.6 $sql .= ' `' . EDIT_TABLE_NAME . '`.`' . $name . '` = ' . $value . ' ' . $filter_relation; # 0.0.6 } else { //$sql .= 'AND `'.EDIT_TABLE_NAME.'`.`'.$name.'` = '.(int)$value.' '; # 0.0.6 $sql .= ' `' . EDIT_TABLE_NAME . '`.`' . $name . '` = ' . (int) $value . ' ' . $filter_relation; # 0.0.6 } } } } if (substr($sql, -3) == 'AND') { $sql = substr($sql, 0, -3); } # 0.0.6 if (substr($sql, -2) == 'OR') { $sql = substr($sql, 0, -2); } # 0.0.6 } $sql .= ''; if ($RRN == '*all' && strlen($limit) > 0) { $sql .= 'LIMIT ' . $limit . ' '; } //echo '['.$sql.']<br />'; $sth = db_query($sql, __LINE__, __FILE__); //echo '=>'.$sth[1].'<br />'; if ($RRN == '*info') { return $sth[1]; } if ($sth[1] == 0) { return false; } $row = db_fetch($sth[0], false); return $row; }
} if (!isset($status)) { $status = 1; } if (!isset($sort)) { $sort = 'calldate'; } if (!in_array($sort, array('calldate', 'src', 'dst', 'duration', 'billsec', 'disposition'))) { $sort = 'calldate'; } if ($sort == "calldate") { $sort = 'calldate DESC'; } $aLinkParams = 'index.php?module=' . $sModule . '&page=' . $page . '&sort=calldate&link=1'; //////////***************************************************/////////////// list($cdr_restr, $cs_restr) = get_filters("periods,dates,status,directions,serchbynumber,perpage"); // GET FILTERS AND THEM RESULT if ($posted == 1) { if ($usr_restrictions = get_params_array(0, "cdr_restrictions")) { $usr_restr = ' AND (' . $usr_restrictions[0] . ')'; } else { $usr_restr = ''; } //echo '123'.$cdr_restr . $usr_restr .'456'; $duration_select = values("SELECT COUNT(*) AS c, SUM(duration) AS dur, SUM(billsec) AS bill, AVG(duration) AS avgdur, AVG(billsec) AS avgbill FROM " . $conf_cdr_db . ".cdr WHERE" . $cdr_restr . $usr_restr . " ORDER BY " . $sort); if (count($duration_select) > 0) { $dur_sec = $duration_select[0]['dur']; $avg_dur = $duration_select[0]['avgdur']; $bill_sec = $duration_select[0]['bill']; $avg_bill = $duration_select[0]['avgbill']; $cal_num = $duration_select[0]['c'];
} $sipusers = values("SELECT * FROM " . $conf_realtime_db . ".sipusers WHERE 1 ORDER BY name"); for ($i = 0; $i < count($sipusers); $i++) { if ($sipusers[$i]["name"] == $sipusr) { $sel = ' selected'; } else { $sel = ''; } $add_custom .= '<OPTION value="' . $sipusers[$i]["name"] . '"' . $sel . '>' . $sipusers[$i]["name"] . '</option> '; } $add_custom .= ' </select></td> </tr></table></td> </tr> '; get_filters("periods,dates,perpage", $add_custom); // GET FILTERS AND THEM RESULT list($from, $to) = prepare_dates($fromstatsday, $fromstatsmonth, $fromstatsyear, $tostatsday, $tostatsmonth, $tostatsyear); if (isset($posted)) { if (isset($callerid)) { $query_clid = " AND cdr.src LIKE '%" . $callerid . "%'"; } else { $query_clid = ""; } if (isset($clientname)) { $query_clname = " AND (cl.name LIKE '%" . $clientname . "%' OR cl.contact LIKE '%" . $clientname . "%' OR cl.client_code LIKE '%" . $clientname . "%')"; } else { $query_clname = ""; } $where_query = "WHERE calls.call_date BETWEEN '" . $from . "' AND '" . $to . "'" . $add_sipusr . $query_clid . $query_clname . " AND lastapp != 'Transferred Call' ORDER BY calls.call_date DESC"; $result_set = values("SELECT cl.id AS clid, cl.name AS clname, cl.contact AS clcontact, cl.ttk AS ttk, calls.call_date, calldate, userfield, src, dst AS dest, duration, uniqueid, randdata, disposition, comment, operator FROM " . $conf_statistic_db . ".`calls_ver3` calls LEFT JOIN " . $conf_cdr_db . ".`cdr` cdr ON cdr.uniqueid=calls.unique_id LEFT JOIN " . $conf_statistic_db . ".`clients_ver3` cl ON cl.id=calls.client_id " . $where_query . " LIMIT " . ($page - 1) * $perpage . ", " . $perpage);
<?php require "settings.php"; $OUTPUT = get_filters($_POST); require "template.php"; function get_filters($_POST) { extract($_POST); if (isset($search) and strlen($search) > 0) { $from_date = "{$from_year}-{$from_month}-{$from_day}"; $to_date = "{$to_year}-{$to_month}-{$to_day}"; $view_report = "\n\t\t\t<tr>\n\t\t\t\t<th>Employee Name</th>\n\t\t\t\t<th>Hire Date</th>\n\t\t\t\t<th>Position</th>\n\t\t\t\t<th>Options</th>\n\t\t\t</tr>"; $get_emps = "SELECT * FROM employees WHERE hiredate >= '{$from_date}' AND hiredate <= '{$to_date}' ORDER BY enum, sname"; $run_emps = db_exec($get_emps) or errDie("Unable to get employee number."); if (pg_numrows($run_emps) < 1) { $view_report = "\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td colspan='4'>No Employees Hired Within Selected Dates.</td>\n\t\t\t\t</tr>"; } else { while ($arr = pg_fetch_array($run_emps)) { $view_report .= "\n\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t<td>{$arr['sname']}, {$arr['fnames']}</td>\n\t\t\t\t\t\t<td>{$arr['hiredate']}</td>\n\t\t\t\t\t\t<td>{$arr['designation']}</td>\n\t\t\t\t\t\t<td><a target='_blank' href='admin-employee-edit.php?empnum={$arr['empnum']}'>Edit</a></td>\n\t\t\t\t\t</tr>"; } } } else { $view_report = ""; } $display = "\n\t\t<h4>Employee Appointment Report</h4>\n\t\t<form action='" . SELF . "' method='POST'>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th colspan='2'>Date Range</th>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th>From</th>\n\t\t\t\t<th>To</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>" . mkDateSelect("from", date("Y"), date("m"), "01") . "</td>\n\t\t\t\t<td>" . mkDateSelect("to", date("Y"), date("m"), date("d")) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan='2' align='right'><input type='submit' name='search' value='View'></td>\n\t\t\t</tr>\n\t\t\t<tr><td><br></td></tr>\n\t\t\t{$view_report}\n\t\t</table>\n\t\t</form>"; return $display; }
<tr> <td align="left" bgcolor="#777777"> <font face="verdana" size="1" color="#ffffff"><b> ' . __('Вид диаграммы') . '</b></font> </td> <td align="left" bgcolor="#eeeeee"> <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#eeeeee"><tr><td> <select name="chart_type"> <option value="1"' . ($chart_type == '1' ? ' selected' : '') . '>' . __('Линейная') . '</option> <option value="2"' . ($chart_type == '2' ? ' selected' : '') . '>' . __('Столбцовая') . '</option> </select> </td></tr></table> </td> </tr> '; list($cdr_restr, $cs_restr) = get_filters("periods,dates,hours,status,directions,serchbynumber", $add_custom); // GET FILTERS AND THEM RESULT $all_perc = 0; $all_c_count = 0; $all_time = 0; $avg_time = 0; $calls_all = 0; $sum_calls_all = 0; $sum_calls_picked = 0; $sum_calls_abandoned = 0; if (isset($posted)) { if ($time_intervals == '1') { $group_option = '%d-%m-%Y'; } else { $group_option = '%H'; }
<tr> <td class="bar-search" align="left" bgcolor="#777777"> <font face="verdana" size="1" color="#ffffff"><b> ' . __('Поиск') . '</b></font> </td> <td align="left" bgcolor="#eeeeee"> <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#eeeeee"><tr> <td class="bar-search" align="left"> ' . __('По компании') . ': <input type="text" NAME="companyid" value="' . $companyid . '"> ' . __('По имени клиента') . ': <input type="text" NAME="clientname" value="' . $clientname . '"> ' . __('По номеру') . ': <input type="text" NAME="callerid" value="' . $callerid . '"> ' . __('По коду клиента') . ': <input type="text" NAME="client_code" value="' . $client_code . '"></td> </tr></table></td> </tr> '; get_filters("perpage", $add_custom); // GET FILTERS AND THEM RESULT if ($clientid == 0) { $restr = ''; if ($callerid != '') { $restr .= " AND (main_number LIKE '%" . $callerid . "%' OR phone1 LIKE '%" . $callerid . "%' OR phone2 LIKE '%" . $callerid . "%' OR phone3 LIKE '%" . $callerid . "%' OR fax LIKE '%" . $callerid . "%')"; } if ($companyid != '') { $restr .= " AND name LIKE '%" . $companyid . "%'"; } if ($clientname != '') { $restr .= " AND contact LIKE '%" . $clientname . "%'"; } if ($client_code != '') { $restr .= " AND client_code LIKE '%" . $client_code . "%'"; }
} if (isset($operator)) { $iOperator = (int) $operator; } if (isset($date) and $date != 0) { $sDate = $date; } elseif ($date == 0) { $sDate = ''; } if (!isset($page)) { $page = ''; } $aLinkParams = 'index.php?module=' . $sModule . '&page=' . $page . '&sort=calldate&link=1'; //////////***************************************************/////////////// list($from, $to) = prepare_dates($fromstatsday, $fromstatsmonth, $fromstatsyear, $tostatsday, $tostatsmonth, $tostatsyear); list($cdr_restr, $cs_restr) = get_filters("periods,dates"); // GET FILTERS AND THEM RESULT if ($posted == 1) { $query_date = '&fromstatsday=' . $fromstatsday . '&fromstatsmonth=' . $fromstatsmonth . '&fromstatsyear=' . $fromstatsyear . '&tostatsday=' . $tostatsday . '&tostatsmonth=' . $tostatsmonth . '&tostatsyear=' . $tostatsyear; if (empty($iOperator) or $iOperator == 0) { $operators = values("SELECT * FROM asteriskcdrdb.QueueMember WHERE 1 GROUP BY Name ORDER BY Name"); ?> <center> <br> <TABLE border=0 cellPadding=0 cellSpacing=0 width="90%"> <TBODY> <TR bgColor=#F0F0F0> <TD width="2%" align=center class="tableBodyRight" style="PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px"></TD> <TD width="15%" align=middle class="tableBody" style="PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px"> <center><strong><?php echo __('Оператор');
} $pages = new CVCPagintation(); $pages->Init('', ($group != '' ? 'urlprefix=?group\\=' . $group . ';' : '') . 'bottomPages=false;skiponcepage=true;'); $i = 0; $n = count($list); if ($page != '') { $pageid = '&page=' . $page; } while ($i < $n) { $c = 0; $pageSrc = '<table class="list">' . "\n"; $pageSrc .= '<tr class="h"><th class="n first">№</th><th width="20%">Логин</th><th width="20%">Имя</th><th width="20%">E-Mail</th><th>Уровень доступа</th><th width="48" class="last"> </th></tr>' . "\n"; while ($c < $perPage && $i < $n) { $it = $list[$i]; $d = !user_is_system($it['id']); $pageSrc .= '<tr' . ($i == $n - 1 || $c == $perPage - 1 ? ' class="last"' : '') . '><td class="n">' . ($i + 1) . '.</td>' . '<td><a href=".?action=edit&id=' . $it['id'] . '&' . get_filters() . $pageid . '">' . $it['login'] . '</a></td>' . '<td>' . $it['name'] . '</td><td><a href="mailto:' . $it['email'] . '" title="Отправить письмо">' . $it['email'] . '</a></td>' . '<td>' . security_access_title($it['access']) . '</td>' . '<td align="right">' . stencil_ibtnav('edit.gif', '?action=edit&id=' . $it['id'] . '&' . get_filters() . $pageid, 'Изменить элемент') . stencil_ibtnav($d ? 'cross.gif' : 'cross_d.gif', $d ? '?action=delete&id=' . $it['id'] . '&' . get_filters() . $pageid : '', 'Удалить этот элемент', 'Удалить этот элемент?') . '</td></tr>' . "\n"; $c++; $i++; } $pageSrc .= '</table>' . "\n"; $pages->AppendPage($pageSrc); } $pages->Draw(); } else { info('В этой группе нет пользователей'); } ?> <div class="f"> <form action="." method="POST" onsubmit="update (); return false;" onkeypress="if (event.keyCode==13) update ();"> <b>Критерии выборки:</b> <table width="100%"><tr>
function show_filters_info($report) { if (!$report->getOption('headers_sent')) { return; } $my_filters = get_filters($report->getId()); if (count($my_filters)) { echo '<p class="normal_text">'; } foreach ($my_filters as $f) { if (!$f['value']) { // Value may be provided by $_REQUEST if (isset($_REQUEST['filter_val' . $f['id_filter']])) { // text or number $f['value'] = $_REQUEST['filter_val' . $f['id_filter']]; } elseif (isset_datetime_from_array($_REQUEST, 'filter_val' . $f['id_filter'], 'year_only')) { // Date $f['value'] = get_datetime_from_array($_REQUEST, 'filter_val' . $f['id_filter'], 'year_only'); } elseif (isset_datetime_from_array($_REQUEST, 'filter_val' . $f['id_filter'] . "_start", 'year_only') && isset_datetime_from_array($_REQUEST, 'filter_val' . $f['id_filter'] . "_end", 'year_only')) { // Date interval $f['value'] = get_datetime_from_array($_REQUEST, 'filter_val' . $f['id_filter'] . "_start", 'start'); $f['value'] .= ";"; $f['value'] .= get_datetime_from_array($_REQUEST, 'filter_val' . $f['id_filter'] . "_end", 'end'); } else { // Should never happen $f['value'] = _T('info_not_available'); } } // TODO: If field.type == text and field.value is based on keyword or // list, use translation if known. if ($f['enum_type']) { $enum = explode(":", $f['enum_type']); if ($enum[0] == 'keyword') { if ($enum[2]) { $f['value'] = _Tkw($enum[2], $f['value']); } } elseif ($enum[0] == 'list') { if ($enum[2]) { $f['value'] = _T($enum[2] . $f['value']); } } } // Example: "Follow-up - Start: in 1 Apr 05, 00h00 - 31 Dec 05, 23h59" // or.....: Table - Field: type_filter value echo _T('rep_info_table_' . $f['table_name']) . " - " . _Ti($f['description']) . _T('rep_filter_' . $f['type']) . " "; switch ($f['type']) { case 'date_in': $values = split(";", $f['value']); echo format_date($values[0], 'short') . " - " . format_date($values[1], 'short'); break; case 'date_eq': case 'date_ge': case 'date_gt': case 'date_le': case 'date_lt': echo format_date($f['value'], 'short'); break; default: echo $f['value']; } echo "<br />\n"; } if (count($my_filters)) { echo "</p>\n"; } }