public static function getReservationById($id)
 {
     $connection = DBUtil::connectDB();
     $result = mysql_query("select * from reservation where id={$id}", $connection);
     $reservations = [];
     while ($row = mysql_fetch_array($result)) {
         $r['customerId'] = $row['customer_id'];
         $r['consumeSet'] = ConsumeSetDBUtil::getSetById($row['consume_set_id']);
         $r['club'] = ClubDBUtil::getClubById($row['club_id']);
         $r['status'] = $row['status'];
         $r['id'] = $row['id'];
         $reservations[] = $r;
     }
     mysql_close();
     return $reservations;
 }
示例#2
0
 public static function getActivityById($activityId)
 {
     $con = DBUtil::connectDB();
     $result = mysql_query("SELECT * FROM activity where id={$activityId}", $con);
     $activities = [];
     while ($row = mysql_fetch_array($result)) {
         $r['title'] = $row['title'];
         $r['images'] = json_decode($row['images']);
         $r['content'] = $row['content'];
         $r['valid_time_start'] = $row['valid_time_start'];
         $r['valid_time_end'] = $row['valid_time_end'];
         $r['publish_time'] = $row['publish_time'];
         $r['user_ids'] = json_decode($row['user_ids']);
         $r['club'] = ClubDBUtil::getClubById($row['club_id']);
         $activities[] = $r;
     }
     mysql_close();
     return $activities;
 }
示例#3
0
 public function getClubs($longitude, $latitude, $range = 10)
 {
     return ClubDBUtil::getClubs($longitude, $latitude, $range);
 }