Esempio n. 1
0
 public function scrape()
 {
     if (isset($_POST['url'])) {
         $booking = new BookingClass();
         $movies = $booking->index();
         $ret = '<h1>Följande filmer hittades</h1>';
         $ret .= '<ul>';
         foreach ($movies as $movie) {
             $ret .= "<li> Filmen {$movie['title']} klockan {$movie['time']} på {$movie['day']}\n                     <a href='?day={$movie['day']}&time={$movie['time']}&title={$movie['title']} '>Välj denna dag och Boka Bord</a>\n                    </li>";
         }
         $ret .= '</ul>';
         return $ret;
     }
 }
Esempio n. 2
0
 } else {
     if ($resource[4] == "BookingClass") {
         if (isset($resource[5]) && $resource[5] != "" && isset($resource[6]) && $resource[6] != "" && is_numeric($resource[6])) {
             $results = array();
             if ($method == "PUT") {
                 if ($resource[5] == "entry") {
                     //[5] => entry
                     //$date = json_decode($_SERVER['QUERY_STRING'], true);
                     $dt = date('Y-m-d H:i:s');
                     $results['bookingclass'] = BookingClass::updateEntry($resource[6], $dt);
                 } else {
                     if ($resource[5] == "exit") {
                         //[5] => entry
                         //$date = json_decode($_SERVER['QUERY_STRING'], true);
                         $dt = date('Y-m-d H:i:s');
                         $results['bookingclass'] = BookingClass::updateExit($resource[6], $dt);
                     } else {
                         echo json_encode(array('error' => 'true', 'error_message' => 'Error in updating attendance entry.'));
                     }
                 }
             }
             $row = $results['bookingclass'];
             if ($row) {
                 echo json_encode($row);
             } else {
                 echo json_encode(array('error' => 'true', 'error_message' => 'Error in updating attendance entry.'));
             }
         } else {
             echo json_encode(array('error' => 'true', 'error_message' => 'Error in updating attendance entry.'));
         }
     }