Changeset 629 for trunk/search.php
- Timestamp:
- Dec 2, 2004, 1:45:57 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/search.php
r621 r629 36 36 if (isset($_POST['submit'])) 37 37 { 38 if ($_POST['search_ keywords'] &&39 !preg_match('/^\s*$/', $_POST['search_ keywords']))38 if ($_POST['search_allwords'] && 39 !preg_match('/^\s*$/', $_POST['search_allwords'])) 40 40 { 41 41 $local_search = array(); 42 $search_keywords = $_POST['search_ keywords'];42 $search_keywords = $_POST['search_allwords']; 43 43 $drop_char_match = array('-', '^', '$', ';', '#', '&', '(', ')', '<', '>', 44 44 '`', '\'', '"', '|', ',', '@', '_', '?', '%', '~', '.', '[', ']', '{', '}', … … 52 52 $words = preg_split('#\s+#', $search_keywords); 53 53 $words = array_unique($words); 54 $search['fields'][' keywords'] = array();55 $search['fields'][' keywords']['words'] =$words;56 $search['fields'][' keywords']['mode']= $_POST['mode'];54 $search['fields']['allwords'] = array(); 55 $search['fields']['allwords']['words'] =$words; 56 $search['fields']['allwords']['mode']= $_POST['mode']; 57 57 } 58 58 … … 83 83 // duration 84 84 $search_duration = 0; 85 if ( !empty($date) && !empty( $_POST['duration_day']) ) 86 { 87 $search['fields'][$type_date]['mode'] = $_POST['duration_day']; 85 if ( !empty($date) && !empty( $_POST['end_year']) ) 86 { 87 $end_date = $_POST['end_year'].'.'.$_POST['end_month'].'.'.$_POST['end_day']; 88 $search['fields'][$type_date]['mode'] = $end_date; 88 89 } 89 90 } … … 140 141 $start_month .= '</select>'; 141 142 142 // year list 143 $start_year = '<select name="start_year">'; 144 $start_year .= '<option value="0"> ---- </option>'; 145 $begin_year = date('Y', time())-10; 146 for ($i = $begin_year; $i <= date('Y', time()); $i++) 147 { 148 $start_year .= '<option value="' . $i . '">' . $i . '</option>'; 149 } 150 $start_year .= '</select>'; 151 143 // day list 144 $end_day = '<select name="end_day">'; 145 for ($i=0; $i <= 31; $i++) 146 { 147 $end_day .= '<option value="' . $i . '" >' . ( ($i == 0) ? ' -- ' : str_pad($i, 2, '0', STR_PAD_LEFT) ) . '</option>'; 148 } 149 $end_day .= '</select>'; 150 151 // month list 152 $end_month = '<select name="end_month">'; 153 $end_month .= '<option value="0"> ------------ </option>'; 154 for ($i=1; $i <= 12; $i++) 155 { 156 $end_month .= '<option value="' . $i . '">' . $lang['month'][$i] . '</option>'; 157 } 158 $end_month .= '</select>'; 152 159 153 160 // … … 179 186 'L_TODAY' => $lang['today'], 180 187 'L_SEARCH_DATE_FROM'=>$lang['search_date_from'], 181 'L_SEARCH_D URATION'=>$lang['search_duration'],188 'L_SEARCH_DATE_TO'=>$lang['search_date_to'], 182 189 'L_DAYS'=>$lang['days'], 183 190 'L_MONTH'=>$lang['w_month'], … … 192 199 'TODAY_MONTH' => date('m', time()), 193 200 'TODAY_YEAR' => date('Y', time()), 194 'S_CALENDAR_YEAR' => $start_year, 201 'E_CALENDAR_MONTH' => $end_month, 202 'E_CALENDAR_DAY' => $end_day, 195 203 'S_CALENDAR_MONTH' => $start_month, 196 204 'S_CALENDAR_DAY' => $start_day,
Note: See TracChangeset
for help on using the changeset viewer.