Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Issue #28. Check if $row[1] == bolo. If so, change text color to orange
- if ($row[1] == "BOLO")
- {
- echo '<td style="color:orange;">'.$row[1].'</td>';
- echo '<td><!--Leave blank--></td>';
- }
- else
- {
- echo '<td>'.$row[1].'</td>';
- echo '
- <td>';
- getUnitsOnCall($row[0]);
- echo '</td>';
- }
- echo '<td>'.$row[2].'/'.$row[3].'/'.$row[4].'</td>';
- if (isset($_GET['type']) && $_GET['type'] == "responder")
- {
- echo'
- <td>
- <button id="'.$row[0].'" class="btn-link" name="call_details_btn" data-toggle="modal" data-target="#callDetails">Details</button>
- </td>';
- }
- else
- {
- echo'
- <td>
- <button id="'.$row[0].'" class="btn-link" style="color: red;" value="'.$row[0].'" onclick="clearCall('.$row[0].')">Clear</button>
- <button id="'.$row[0].'" class="btn-link" name="call_details_btn" data-toggle="modal" data-target="#callDetails">Details</button>
- <input id="'.$row[0].'" type="submit" name="assign_unit" data-toggle="modal" data-target="#assign" class="btn-link '.$row[0].'" value="Assign"/>
- <input name="uid" name="uid" type="hidden" value="'.$row[0].'"/>
- </td>';
- }
- echo'
- </tr>
- ';
- $counter++;
- }
- echo '
- </tbody>
- </table>
- ';
- }
- mysqli_close($link);
- }
- function getUnitsOnCall($callId)
- {
- $link = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
- if (!$link) {
- die('Could not connect: ' .mysql_error());
- }
- $sql1 = "SELECT * FROM calls_users WHERE call_id = \"$callId\"";
- $result1=mysqli_query($link, $sql1);
- $units = "";
- $num_rows = $result1->num_rows;
- if($num_rows == 0)
- {
- $units = '<span style="color: red;">Unassigned</span>';
- }
- else
- {
- while($row1 = mysqli_fetch_array($result1, MYSQLI_BOTH))
- {
- $units = $units.''.$row1[2].', ';
- }
- }
- echo $units;
- mysqli_close($link);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement