Example #1
0
 /**
  * make_search function.
  * 
  * @access private
  * @return void
  */
 private function make_search()
 {
     global $checked;
     global $db;
     global $template_dat;
     global $weiter;
     if (!empty($checked->start_suche)) {
         $checked->start_suche = urlencode($checked->start_suche);
         //Anzahl rausholen
         $url = API_URL . "/api.php?search=" . $checked->start_suche . "&count=1";
         $data = class_divers::http_request_open($url);
         //debug::print_d($data);
         #debug::print_d(json_decode($data,true));
         $weiter->result_anzahl = json_decode($data, true);
         #debug::print_d($weiter->result_anzahl);
         if (!is_numeric($weiter->result_anzahl)) {
             $weiter->result_anzahl = 0;
         }
         if ($weiter->result_anzahl > 0) {
             $template_dat['result_anzahl'] = $weiter->result_anzahl;
             $weiter->weiter_link = './index.php?start_suche=' . $checked->start_suche;
             $weiter->do_weiter("search");
             $weiter->make_html_links();
             $template_dat['api_url'] = API_URL . "/api.php?search=" . $checked->start_suche . "&page=" . $checked->page;
             //Daten bei Api abholen
             $data = class_divers::http_request_open(API_URL . "/api.php?search=" . $checked->start_suche . "&page=" . $checked->page);
             //debug::print_d(json_decode($data,true));
             return json_decode($data, true);
         }
         return false;
     }
 }