Changeset 52
- Timestamp:
- Jan 4, 2020, 11:59:33 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Global.php
r46 r52 194 194 foreach ($this->rItems as $Item) 195 195 { 196 if (($Item['Type'] == 'String') or ($Item['Type'] == 'Enumeration') )196 if (($Item['Type'] == 'String') or ($Item['Type'] == 'Enumeration') or ($Item['Type'] == 'Boolean')) 197 197 { 198 198 if (!array_key_exists($Item['Name'], $_SESSION)) $_SESSION[$Item['Name']] = ''; … … 213 213 if (array_key_exists($Item['Name'], $_GET) ) $_SESSION[$Item['Name']] = $_GET[$Item['Name']]; 214 214 } else 215 if ( $Item['Type'] == 'Enumeration')215 if (($Item['Type'] == 'Enumeration') or ($Item['Type'] == 'Boolean')) 216 216 { 217 217 if (array_key_exists($Item['Name'], $_GET) ) $_SESSION[$Item['Name']] = $_GET[$Item['Name']]; … … 226 226 } 227 227 } 228 } else { 228 } else 229 { 229 230 $Output .= '<script type="text/javascript">function reloadlist(){ $(\'#meetlist\').load(document.URL + \' #meetlist\');}'. 230 231 ' var load_timer = 100; 231 232 var ltimer = null; 232 233 233 function checkOut(kc,obj){ 234 if(kc==13) $(obj).blur(); 234 function checkOut(kc, obj) 235 { 236 if (kc == 13) $(obj).blur(); 235 237 } 236 function initLTimer(tm){ 237 if(ltimer) clearTimeout(ltimer); 238 ltimer = setTimeout("freloader()",tm); 238 function initLTimer(tm) 239 { 240 if (ltimer) clearTimeout(ltimer); 241 ltimer = setTimeout("freloader()", tm); 239 242 } 240 function stopLTimer(){ 241 if(ltimer) clearTimeout(ltimer); 243 function stopLTimer() 244 { 245 if (ltimer) clearTimeout(ltimer); 242 246 ltimer = null; 243 247 } … … 245 249 var cf = {}; 246 250 247 function setupc(key,val){ 248 //console.log(\'setup-control-\'+key+\' = \'+val); 251 function setupc(key,val) 252 { 253 //console.log(\'setup-control-\' + key + \' = \' + val); 249 254 '; 250 255 $Keys = array(); … … 253 258 if ($Item['Type'] == 'Integer') 254 259 { 255 $Keys[] = 'key ==\''.$Item['Name'].'od\'';256 $Keys[] = 'key ==\''.$Item['Name'].'do\'';260 $Keys[] = 'key == \''.$Item['Name'].'od\''; 261 $Keys[] = 'key == \''.$Item['Name'].'do\''; 257 262 } 258 263 } 259 264 if (count($Keys) > 0) 260 265 { 261 $Output .= 'if ('.implode(' || ', $Keys).') { 262 var ccv = $(\'#\'+key).val(); 263 if(ccv!=val) $(\'#\'+key).val(val==0?\'\':val); 266 $Output .= 'if ('.implode(' || ', $Keys).') 267 { 268 var ccv = $(\'#\' + key).val(); 269 if (ccv != val) $(\'#\' + key).val(val == 0 ? \'\' : val); 264 270 } 265 271 '; … … 269 275 foreach ($this->Items as $Item) 270 276 { 271 if ( $Item['Type'] == 'Enumeration')272 { 273 $Keys[] = 'key ==\''.$Item['Name'].'\'';277 if (($Item['Type'] == 'Enumeration') or ($Item['Type'] == 'Boolean')) 278 { 279 $Keys[] = 'key == \''.$Item['Name'].'\''; 274 280 } 275 281 } 276 282 if (count($Keys) > 0) 277 283 { 278 $Output .= 'if('.implode(' || ', $Keys).') { 279 $(\'.c\'+key).removeClass(\'active\'); 280 $(\'#\'+key+val).addClass(\'active\'); 284 $Output .= 'if ('.implode(' || ', $Keys).') 285 { 286 $(\'.c\' + key).removeClass(\'active\'); 287 $(\'#\' + key + val).addClass(\'active\'); 281 288 } 282 289 '; … … 285 292 } 286 293 287 function upf(key,val,lonreload){ 288 if(key!=\'first\') cf[\'first\']=0; else st(); 289 setupc(key,val); 290 cf[key]=val; 291 if(lonreload) initLTimer(1000); else initLTimer(100); 294 function upf(key, val, lonreload) 295 { 296 if (key != \'first\') cf[\'first\'] = 0; 297 else st(); 298 setupc(key, val); 299 cf[key] = val; 300 if (lonreload) initLTimer(1000); 301 else initLTimer(100); 292 302 } 293 303 294 function freloader(){ 304 function freloader() 305 { 295 306 ltimer = null; 296 var qp = jQuery.param( cf ); 297 $(\'#list_content\').html(\'\'); $(\'#list_loading\').show(); 298 $.get(\''.$Link.'?lvm=seznam&\'+qp,function(data){$(\'#list_loading\').hide();$(\'#list_content\').html(data);}) 307 var qp = jQuery.param(cf); 308 $(\'#list_content\').html(\'\'); 309 $(\'#list_loading\').show(); 310 $.get(\''.$Link.'?lvm=seznam&\' + qp, function(data) 311 { 312 $(\'#list_loading\').hide(); 313 $(\'#list_content\').html(data); 314 }); 299 315 }'. 300 316 '</script> … … 310 326 '</div> '; 311 327 } else 328 if ($Item['Type'] == 'Boolean') 329 { 330 $Output .= '<div class="btn-group ma3">'; 331 $Output .= '<button class="btn btn-filter'; 332 $Output .= ' c'.$Item['Name'].'" onclick="upf(\''.$Item['Name'].'\',cf.'.$Item['Name'].'?0:1)" id="'.$Item['Name'].'1" data-toggle="tooltip" '. 333 'data-placement="top" title="'.$Item['Title'].'"><span>'.$Item['Title'].'</span></button>'; 334 $Output .= '</div>'; 335 } else 312 336 if ($Item['Type'] == 'Enumeration') 313 337 { … … 316 340 foreach ($Item['States'] as $EnumIndex => $EnumItem) 317 341 { 318 $Output .= '<button class="btn btn-filter c'.$Item['Name'].' btn-ico" onclick="upf(\''.$Item['Name'].'\','.$EnumIndex.')" id="'.$Item['Name'].$EnumIndex.'" data-toggle="tooltip" '. 342 $Output .= '<button class="btn btn-filter c'.$Item['Name'].' btn-ico" onclick="upf(\''.$Item['Name'].'\','.$EnumIndex.')" id="'. 343 $Item['Name'].$EnumIndex.'" data-toggle="tooltip" '. 319 344 'data-placement="top" title="'.$EnumItem.'"><span class="icon-'.$EnumIndex.'"></span></button>'; 320 345 } … … 345 370 foreach($this->Items as $Item) 346 371 { 347 if ($Item['Type'] == 'String') 348 { 349 if ($_SESSION[$Item['Name']] != '') 350 $Where .= ' AND ('.$Item['DbName'].' LIKE "%'.$Database->real_escape_string($_SESSION[$Item['Name']]).'%")'; 351 } else 352 if ($Item['Type'] == 'Enumeration') 353 { 354 if ($_SESSION[$Item['Name']] != '') 355 $Where .= ' AND ('.$Item['DbName'].' = '.$Database->real_escape_string($_SESSION[$Item['Name']]).')'; 356 } else 357 if ($Item['Type'] == 'Integer') 358 { 359 if ($_SESSION[$Item['Name'].'od'] != '') 360 $Where .= ' AND ('.$Item['DbName'].' >= '.$Database->real_escape_string($_SESSION[$Item['Name'].'od']).')'; 361 if ($_SESSION[$Item['Name'].'do'] != '') 362 $Where .= ' AND ('.$Item['DbName'].' <= '.$Database->real_escape_string($_SESSION[$Item['Name'].'do']).')'; 372 if ($Item['DbName'] != '') 373 { 374 if ($Item['Type'] == 'String') 375 { 376 if ($_SESSION[$Item['Name']] != '') 377 $Where .= ' AND ('.$Item['DbName'].' LIKE "%'.$Database->real_escape_string($_SESSION[$Item['Name']]).'%")'; 378 } else 379 if ($Item['Type'] == 'Boolean') 380 { 381 if ($_SESSION[$Item['Name']] != '') 382 $Where .= ' AND ('.$Item['DbName'].' = '.$Database->real_escape_string($_SESSION[$Item['Name']]).')'; 383 } else 384 if ($Item['Type'] == 'Enumeration') 385 { 386 if ($_SESSION[$Item['Name']] != '') 387 $Where .= ' AND ('.$Item['DbName'].' = '.$Database->real_escape_string($_SESSION[$Item['Name']]).')'; 388 } else 389 if ($Item['Type'] == 'Integer') 390 { 391 if ($_SESSION[$Item['Name'].'od'] != '') 392 $Where .= ' AND ('.$Item['DbName'].' >= '.$Database->real_escape_string($_SESSION[$Item['Name'].'od']).')'; 393 if ($_SESSION[$Item['Name'].'do'] != '') 394 $Where .= ' AND ('.$Item['DbName'].' <= '.$Database->real_escape_string($_SESSION[$Item['Name'].'do']).')'; 395 } 363 396 } 364 397 } -
trunk/Modules/Event/Event.php
r51 r52 58 58 public $Id; 59 59 public $Database; 60 public $AddedCount; 61 62 function ImportInternal() 63 { 64 } 60 65 61 66 function Import() 62 67 { 63 68 $this->AddedCount = 0; 64 $Output = 'Parsing '.$this->Name.' ('.$this->Id.')...</br>'; 69 $Output = 'Parsing '.$this->Name.' ('.$this->Id.')...'; 70 $this->ImportInternal(); 71 $Output .= 'done.'; 72 if ($this->AddedCount > 0) $Output .= ' '.$this->AddedCount.' new.'; 73 $Output .= '</br>'."\n"; 65 74 return $Output; 66 75 } -
trunk/Modules/Event/EventPage.php
r51 r52 38 38 $Filter = new Filter(); 39 39 $Filter->Items = array( 40 array('Name' => 'past', 'Type' => 'Boolean', 'DbName' => '', 'Title' => 'Proběhlé'), 40 41 array('Name' => 'title', 'Type' => 'String', 'DbName' => 'Title', 'Title' => 'Titulek'), 41 42 array('Name' => 'description', 'Type' => 'String', 'DbName' => 'Description', 'Title' => 'Popis'), 42 array('Name' => 'price', 'Type' => ' String', 'DbName' => 'Price', 'Title' => 'Cena'),43 array('Name' => 'price', 'Type' => 'Integer', 'DbName' => 'Price', 'Title' => 'Cena'), 43 44 array('Name' => 'location', 'Type' => 'String', 'DbName' => 'Location', 'Title' => 'Umístění'), 44 45 array('Name' => 'source', 'Type' => 'String', 'DbName' => 'SourceName', 'Title' => 'Import'), … … 53 54 $Output .= $Filter->GetOutput($this->System->Link('/udalosti/')); 54 55 $Where = $Filter->GetWhere($this->Database); 56 if ($_SESSION['past'] != 1) $Where .= ' AND (TimeFrom > NOW())'; 55 57 56 58 $DbResult = $this->Database->query('SELECT COUNT(*) FROM (SELECT *, '. … … 71 73 array('Name' => '', 'Title' => 'Detail'), 72 74 ); 73 $Order = GetOrderTableHeader($TableColumns, 'TimeFrom', 1);75 $Order = GetOrderTableHeader($TableColumns, 'TimeFrom', 0); 74 76 $Output .= '<table class="WideTable">'; 75 77 $Output .= $Order['Output']; -
trunk/Modules/Event/Import/JoeClub.php
r51 r52 3 3 class EventSourceJoeClub extends EventSource 4 4 { 5 function Import ()5 function ImportInternal() 6 6 { 7 $Output = parent::Import();7 $Output = ''; 8 8 $Content = file_get_contents($this->URL); 9 9 … … 62 62 $Event->Price = trim(str_replace('Kč', '', $Event->Price)); 63 63 if ($Event->Price == 'Zdarma') $Event->Price = 0; 64 if ($Event->Price == '') $Event->Price = 0; 64 65 return $Output; 65 66 }
Note:
See TracChangeset
for help on using the changeset viewer.