Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 KB | None | 0 0
  1. if($_GET['call'] == "close")
  2. {
  3. if($_GET['callid'])
  4. {
  5. if($_GET['page'] == 'two')
  6. {
  7. $callid = $_GET['callid'];
  8. $closing = $_POST['closing'];
  9. $query = "SELECT id FROM engaged WHERE callnum = '$callid'";
  10. $getunits = $link->query($query);
  11. $unitsrow = $getunits->fetch_array(MYSQLI_BOTH);
  12.  
  13. var_dump($unitsrow);
  14.  
  15. $doit = $db->prepare("UPDATE incidents SET closing = :closing, closer = :myname, active = 0, archive = 1 WHERE id = :callid");
  16. $doit->bindParam(':callid',$callid);
  17. $doit->bindParam(':myname',$myname);
  18. $doit->bindParam(':closing',$closing);
  19. $doit->execute();
  20.  
  21. $doita = $db->prepare("DELETE FROM engaged WHERE callnum = :callid");
  22. $doita->bindParam(':callid',$callid);
  23. $doita->execute();
  24.  
  25. for($i = 0;$i < count($unitsrow);$i++) {
  26. $doitb = $db->prepare("UPDATE logins SET assigned = '0' WHERE id = :unitnum");
  27. $doitb->bindParam(':unitnum',$unitsrow[$i]);
  28. $doitb->execute();
  29. }
  30.  
  31. echo '<script type="text/javascript">window.location = "supervisor.php?finished=closecall"</script>';
  32. }
  33. else
  34. {
  35. $callid = $_GET['callid'];
  36. $prep = $db->prepare("SELECT * FROM incidents WHERE id = :callid");
  37. $prep->bindParam(':callid',$callid);
  38. $prep->execute();
  39. $prepresult = $prep->fetch();
  40. ?>
  41. <form action="supervisor.php?do=func&call=close&callid=<?echo $_GET['callid'];?>&page=two" method="POST">
  42. <font color="#FF0">You are closing call #: </font><font color="#FFF"><strong><?echo $_GET['callid'];?></font><br />
  43. <font color="#FF0">Incident Type: </font><font color="#FFF"><strong><?echo $prepresult['type'];?></font><br />
  44. <font color="#FF0">Incident Loc : </font><font color="#FFF"><strong><?echo $prepresult['location'];?></font><br /><br />
  45. <font color="#FF0">CLOSING NOTES:</font><br/>
  46. <textarea rows="6" cols="60" name="closing" /></textarea><br />
  47. <input type="submit" value="SUBMIT!">
  48. </form>
  49. <?
  50. }
  51. }
  52. else
  53. {
  54. $callzactive = mysqli_query($link, "SELECT id,priority,type,location FROM incidents WHERE active = 1");
  55. ?>
  56. <font color="#FF0"><strong>SELECT CALL NUMBER</strong></font><br />
  57. <select onChange="window.location.href=this.value">
  58. <option>SELECT</option><?
  59. while($callsactive = mysqli_fetch_array($callzactive))
  60. {
  61. ?>
  62. <option value="supervisor.php?do=func&call=close&callid=<?echo $callsactive['id'];?>"><?echo "#".$callsactive['id']." (".$callsactive['priority'].") ".$callsactive['type']." @ ".$callsactive['location'];?></option>
  63. <?
  64. }
  65. ?></select><?
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement