Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. //Issue #28. Check if $row[1] == bolo. If so, change text color to orange
  2. if ($row[1] == "BOLO")
  3. {
  4. echo '<td style="color:orange;">'.$row[1].'</td>';
  5. echo '<td><!--Leave blank--></td>';
  6. }
  7. else
  8. {
  9. echo '<td>'.$row[1].'</td>';
  10. echo '
  11. <td>';
  12. getUnitsOnCall($row[0]);
  13. echo '</td>';
  14. }
  15.  
  16.  
  17. echo '<td>'.$row[2].'/'.$row[3].'/'.$row[4].'</td>';
  18.  
  19. if (isset($_GET['type']) && $_GET['type'] == "responder")
  20. {
  21. echo'
  22. <td>
  23. <button id="'.$row[0].'" class="btn-link" name="call_details_btn" data-toggle="modal" data-target="#callDetails">Details</button>
  24. </td>';
  25. }
  26. else
  27. {
  28. echo'
  29. <td>
  30. <button id="'.$row[0].'" class="btn-link" style="color: red;" value="'.$row[0].'" onclick="clearCall('.$row[0].')">Clear</button>
  31. <button id="'.$row[0].'" class="btn-link" name="call_details_btn" data-toggle="modal" data-target="#callDetails">Details</button>
  32. <input id="'.$row[0].'" type="submit" name="assign_unit" data-toggle="modal" data-target="#assign" class="btn-link '.$row[0].'" value="Assign"/>
  33. <input name="uid" name="uid" type="hidden" value="'.$row[0].'"/>
  34. </td>';
  35. }
  36.  
  37. echo'
  38. </tr>
  39. ';
  40. $counter++;
  41. }
  42.  
  43. echo '
  44. </tbody>
  45. </table>
  46. ';
  47.  
  48. }
  49. mysqli_close($link);
  50.  
  51. }
  52.  
  53. function getUnitsOnCall($callId)
  54. {
  55. $link = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
  56.  
  57. if (!$link) {
  58. die('Could not connect: ' .mysql_error());
  59. }
  60.  
  61. $sql1 = "SELECT * FROM calls_users WHERE call_id = \"$callId\"";
  62.  
  63. $result1=mysqli_query($link, $sql1);
  64.  
  65. $units = "";
  66.  
  67. $num_rows = $result1->num_rows;
  68.  
  69. if($num_rows == 0)
  70. {
  71. $units = '<span style="color: red;">Unassigned</span>';
  72. }
  73. else
  74. {
  75. while($row1 = mysqli_fetch_array($result1, MYSQLI_BOTH))
  76. {
  77. $units = $units.''.$row1[2].', ';
  78. }
  79. }
  80.  
  81.  
  82.  
  83. echo $units;
  84.  
  85.  
  86. mysqli_close($link);
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement