| | |
| | | if(@is_array($this->listDef['item'])) { |
| | | foreach($this->listDef['item'] as $i) { |
| | | $field = $i['field']; |
| | | $table = $i['table']; |
| | | // if($_REQUEST[$search_prefix.$field] != '') $sql_where .= " $field ".$i["op"]." '".$i["prefix"].$_REQUEST[$search_prefix.$field].$i["suffix"]."' and"; |
| | | if(isset($_SESSION['search'][$list_name][$search_prefix.$field]) && $_SESSION['search'][$list_name][$search_prefix.$field] != ''){ |
| | | $sql_where .= " $field ".$i['op']." '".$app->db->quote($i['prefix'].$_SESSION['search'][$list_name][$search_prefix.$field].$i['suffix'])."' and"; |
| | | $sql_where .= " ".($table != ''? $table.'.' : $this->listDef['table'].'.')."$field ".$i['op']." '".$app->db->quote($i['prefix'].$_SESSION['search'][$list_name][$search_prefix.$field].$i['suffix'])."' and"; |
| | | } |
| | | } |
| | | } |
| | |
| | | if($this->searchChanged == 1) $_SESSION['search'][$list_name]['page'] = 0; |
| | | |
| | | $sql_von = $app->functions->intval($_SESSION['search'][$list_name]['page'] * $records_per_page); |
| | | $record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM $table WHERE $sql_where"); |
| | | $record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM $table".($app->listform->listDef['additional_tables'] != ''? ','.$app->listform->listDef['additional_tables'] : '')." WHERE $sql_where"); |
| | | $pages = $app->functions->intval(($record_count['anzahl'] - 1) / $records_per_page); |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | break; |
| | | case 'DATETIMETSTAMP': |
| | | if ($record[$key] > 0) { |
| | | // is value int? |
| | | if (preg_match("/^[0-9]+[\.]?[0-9]*$/", $record[$key], $p)) { |
| | | $record[$key] = date($this->lng('conf_format_datetime'), $record[$key]); |
| | | } else { |
| | | $record[$key] = date($this->lng('conf_format_datetime'), strtotime($record[$key])); |
| | | } |
| | | } |
| | | break; |
| | | case 'DATE': |
| | | if ($record[$key] > 0) { |
| | | // is value int? |
| | |
| | | } |
| | | break; |
| | | |
| | | case 'DATETIMETSTAMP': |
| | | if($record[$key] > 0) { |
| | | $record[$key] = date('Y-m-d H:i:s',strtotime($record[$key])); |
| | | } |
| | | break; |
| | | |
| | | case 'DATE': |
| | | if($record[$key] != '' && $record[$key] != '0000-00-00') { |
| | | $record[$key] = $record[$key]; |