-
Notifications
You must be signed in to change notification settings - Fork 6
/
assigns_t.php
78 lines (68 loc) · 2.79 KB
/
assigns_t.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* @package assigns_t.php
* @author John Doe <[email protected]>
* @since 2009-01-15
* @version 2013-09-10
*/
/*
1/15/09 initial release
1/20/09 added $frm_tick, $frm_unit
1/21/09 added frm_id as info param
2/1/09 corrections to logging
7/28/10 Added inclusion of startup.inc.php for checking of network status and setting of file name variables to support no-maps versions of scripts.
8/28/10 frm_u2fenr and frm_u2farr added
9/1/10 set unit 'updated' time
9/10/13 Added auto responder status capability
*/
error_reporting(E_ALL);
@session_start();
require_once($_SESSION['fip']); //7/28/10
$vals_ary = explode("%", $_POST['frm_vals']); // example: "frm_id=17&frm_vals=frm_dispatched%frm_responding%frm_clear"
$frm_id = $_POST['frm_id'];
$frm_tick = $_POST['frm_tick'];
$frm_unit = $_POST['frm_unit'];
$now = mysql_format_date(time() - (get_variable('delta_mins')*60));
$date_part="";
if (in_array("frm_dispatched",$vals_ary)) { // accommodate multiples
$date_part .= "`dispatched` = " . quote_smart($now) . ", ";
do_log($GLOBALS['LOG_CALL_DISP'], $frm_tick, $frm_unit, $frm_id); // 1/21/09
$disp_status = 1;
}
if (in_array("frm_responding",$vals_ary)) {
$date_part .= "`responding` = " . quote_smart($now) . ", ";
do_log($GLOBALS['LOG_CALL_RESP'], $frm_tick, $frm_unit, $frm_id);
$disp_status = 2;
}
if (in_array("frm_on_scene",$vals_ary)) {
$date_part .= "`on_scene` = ". quote_smart($now) . ", "; // 2/1/09
do_log($GLOBALS['LOG_CALL_ONSCN'], $frm_tick, $frm_unit, $frm_id);
$disp_status = 3;
}
if (in_array("frm_u2fenr",$vals_ary)) { // 8/28/10
$date_part .= "`u2fenr` = " . quote_smart($now) . ", ";
do_log($GLOBALS['LOG_CALL_U2FENR'], $frm_tick, $frm_unit, $frm_id);
$disp_status = 4;
}
if (in_array("frm_u2farr",$vals_ary)) {
$date_part .= "`u2farr` = " . quote_smart($now) . ", ";
do_log($GLOBALS['LOG_CALL_U2FARR'], $frm_tick, $frm_unit, $frm_id);
$disp_status = 5;
}
if (in_array("frm_clear",$vals_ary)) {
$date_part .= "`clear` = " . quote_smart($now) . ", ";
do_log($GLOBALS['LOG_CALL_CLR'], $frm_tick, $frm_unit, $frm_id);
$disp_status = 6;
}
$date_part .= substr($date_part, 0, -2); //drop terminal separator pair
$query = "UPDATE `$GLOBALS[mysql_prefix]assigns` SET `as_of`= " . quote_smart($now) .", " . $date_part ;
$query .= " WHERE `id` = " .$_POST['frm_id'] . " LIMIT 1";
//snap(basename( __FILE__), $query);
$result = mysql_query($query) or do_error($query,'',mysql_error(), basename( __FILE__), __LINE__);
set_u_updated ($_POST['frm_id']); // set unit 'updated' time - 9/1/10
$use_status_update = get_variable("use_disp_autostat");
// 8/22/13 - Update unit status to reflect dispatch status
if ($use_status_update == "1") {
auto_disp_status($disp_status, $frm_unit);
}
?>