Advertisement
Guest User

Untitled

a guest
Oct 26th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Model;
  4.  
  5. class Booking extends \BaseModel
  6. {
  7. function check($Resource) {
  8.  
  9. $lsQuery = "SELECT
  10. active
  11. FROM
  12. {$this->table[0]}
  13. WHERE
  14. {$this->table[0]}.date = '$Resource->date'
  15. AND
  16. {$this->table[0]}.year = '$Resource->year'
  17. AND
  18. {$this->table[0]}.month = '$Resource->month'
  19. AND
  20. {$this->table[0]}.day = '$Resource->day'
  21. AND
  22. {$this->table[0]}.time = '$Resource->time'
  23. ";
  24.  
  25. return $this->singleQuery($lsQuery);
  26.  
  27. }
  28. }
  29.  
  30.  
  31.  
  32.  
  33. if($this->Cortex->Booking->check() === 1) {
  34.  
  35. } else {
  36. $this->Cortex->Calendar->_message[] = "Din bokning är nu registrerad!";
  37. $this->Cortex->Log->add("Din bokning är nu registrerad!");
  38. $this->Cortex->Booking->insert();
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement