| @@ 155-181 (lines=27) @@ | ||
| 152 | return false; |
|
| 153 | } |
|
| 154 | ||
| 155 | public function register_for_futsal($team_name, $contact_number, $team) { |
|
| 156 | $this->DB->contest->begin_transaction(MYSQLI_TRANS_START_READ_WRITE); |
|
| 157 | $stmt = $this->db_lib->prepared_execute( |
|
| 158 | $this->DB->contest, |
|
| 159 | "INSERT INTO `futsal_teams` |
|
| 160 | (`team_name`, `contact_number`) VALUES (?, ?)", |
|
| 161 | "ss", |
|
| 162 | [$team_name, $contact_number] |
|
| 163 | ); |
|
| 164 | if (!$stmt) { |
|
| 165 | return false; |
|
| 166 | } |
|
| 167 | $team_id = $this->DB->contest->insert_id; |
|
| 168 | foreach ($team as $nick) { |
|
| 169 | $stmt = $this->db_lib->prepared_execute( |
|
| 170 | $this->DB->contest, |
|
| 171 | "INSERT INTO `futsal_participants` |
|
| 172 | (`team_id`, `nick`) VALUES (?, ?)", |
|
| 173 | "is", |
|
| 174 | [$team_id, $nick] |
|
| 175 | ); |
|
| 176 | if (!$stmt) { |
|
| 177 | return false; |
|
| 178 | } |
|
| 179 | } |
|
| 180 | return $this->DB->contest->commit(); |
|
| 181 | } |
|
| 182 | ||
| 183 | /* |
|
| 184 | |--------------------------------------------------------------------------- |
|
| @@ 488-514 (lines=27) @@ | ||
| 485 | return false; |
|
| 486 | } |
|
| 487 | ||
| 488 | public function register_for_artuino($team_name, $contact_number, $team) { |
|
| 489 | $this->DB->contest->begin_transaction(MYSQLI_TRANS_START_READ_WRITE); |
|
| 490 | $stmt = $this->db_lib->prepared_execute( |
|
| 491 | $this->DB->contest, |
|
| 492 | "INSERT INTO `artuino_teams` |
|
| 493 | (`team_name`, `contact_number`) VALUES (?, ?)", |
|
| 494 | "ss", |
|
| 495 | [$team_name, $contact_number] |
|
| 496 | ); |
|
| 497 | if (!$stmt) { |
|
| 498 | return false; |
|
| 499 | } |
|
| 500 | $team_id = $this->DB->contest->insert_id; |
|
| 501 | foreach ($team as $nick) { |
|
| 502 | $stmt = $this->db_lib->prepared_execute( |
|
| 503 | $this->DB->contest, |
|
| 504 | "INSERT INTO `artuino_participants` |
|
| 505 | (`team_id`, `nick`) VALUES (?, ?)", |
|
| 506 | "is", |
|
| 507 | [$team_id, $nick] |
|
| 508 | ); |
|
| 509 | if (!$stmt) { |
|
| 510 | return false; |
|
| 511 | } |
|
| 512 | } |
|
| 513 | return $this->DB->contest->commit(); |
|
| 514 | } |
|
| 515 | ||
| 516 | public function artuino_payment_success($payment_id, $team_id, $status, $payment_data) { |
|
| 517 | $stmt = $this->db_lib->prepared_execute( |
|