scrum.php 737 B

1234567891011121314151617181920212223
  1. <?php
  2. require_once(realpath(dirname(__FILE__)).'/config.php');
  3. require_once(PATH_PHP.'database.php');
  4. function scrums($id){
  5. $arr = array();
  6. if($res = query("SELECT s.id,s.title,s.description,u.name as user FROM `scrums` s JOIN `users` u ON u.id = s.u_id WHERE s.p_id='%d' ORDER BY s.title DESC",array($id))){
  7. while($row = $res->fetch_assoc()){
  8. array_push($arr,$row);
  9. }
  10. }
  11. return $arr;
  12. }
  13. function scrumObj($id){
  14. if($res = query("SELECT s.id,s.title,s.description,u.name as user FROM `scrums` s JOIN `users` u ON u.id = s.u_id WHERE s.id='%d'",array($id))){
  15. if($res->num_rows == 1){
  16. $scrum = $res->fetch_assoc();
  17. $scrum['user'] = userObj($scrum['user']);
  18. return $scrum;
  19. }
  20. }
  21. return false;
  22. }
  23. ?>