-
Notifications
You must be signed in to change notification settings - Fork 0
/
board.php
2868 lines (2556 loc) · 133 KB
/
board.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
error_reporting(E_ALL);
// ========== Beginning of user-reviseable values ==========================================================================
//
// The following three arrays are threshold values for the List function, and control its highlighting.
// Each array is a comma-separated list of minute values, for, respectively:
//
// Dispatched, Responding, On_scene, Facility en-route, Facility arrive, Clear, Problemend
//
// Elapsed times exceeding these values will appear in the list highlighted in red Note that different
// values apply to incidents as a function of the three incident severities.
//
// These may be revised to suit your operation's needs. Please do so with care - no edits are applied!
//
// ===== Dispatched, Responding, On_scene, Facility en-route, Facility arrive, Clear, Problemend ======
$thresh_n = array(3, 20, 30, 40, 50, 60, 120); // threshold times in minutes - normal incidents
$thresh_m = array(2, 5, 15, 15, 15, 15, 60); // threshold times in minutes - medium-severity incidents
$thresh_h = array(1, 5, 30, 40, 50, 60, 30); // threshold times in minutes - high-severity incidents
// ========================================================================================================
//
// Call board layout values - group percentages followed by individual columnn widths - 11/27/09
//
// ========================================================================================================
$TBL_INC_PERC = 50; // incident group - four columns - 50 percent as default
$TBL_UNIT_PERC = 35; // unit group, includes checkboxes - 35 percent as default
$TBL_CALL_PERC = 10; // call group - three columns - 10 percent as default
// total shd be ~ 100
// column width in characters - use zero to suppress display
$COLS_INCID = 18; // incident name - 18 characters as default
$COLS_OPENED = 0; // date/time opened - 0 characters as default
$COLS_DESCR = 32; // incident description - 32 characters as default
$COLS_ADDR = 32; // address - 32 characters as default
$COLS_UNIT = 15; // unit name
$COLS_ASOF = 9; // call as-of date/time - 9 characters as default
$COLS_USER = 3; // last update by user xxx - 3 characters as default
$COLS_COMMENTS = 8; // run comments - 8 characters as default
// ======== End of user-reviseable values ======================================================================
/*
alert(<?php print __LINE__;?>);
5/23/08 fix to status_val field name
6/4/08 Deletion logic revised to remove timed-based inactive and add explicit deletions
6/26/08 added $doTick to assign view/edit ticket functions by priv level
8/24/08 added htmlentities function to TITLE strings
9/17/08 disallow guest edit to unit status
9/27/08 removed dead code relating to $unit_scr
9/28/08 converted TD hide/show to SPAN, to improve col alignment
10/9/08 show unit status dropdown only one time
11/7/08 incident strikethrough corrections
11/8/08 added checkboxes; correction to unit status update
1/12/09 center added for call frame, accomodate frame operation, do status update in-frame, dollar function added
1/15/09 update assigns with unit_id, added ajax functions, added script-specific CONSTANTs
1/16/08 removed 'delta' in favor of INTERVAL-based SQL, added mailit() for new dispatches
1/17/09 incident strike-through corrections
1/29/09 fixed sql stmt, TBD default comment added
2/12/09 fix select list order
2/18/09 added persistence to 'hide cleared'
2/19/09 'do all clicked buttons' added
2/20/09 show/hide changed to radio button
2/28/09 fixes to CB update
3/1/09 restrict guest updates
3/9/09 bypass email if no addr, set 'dispatched' time
3/25/09 'mailed', 'fetch_assoc' for performance, 'mailed' removed
4/11/09 apply guest checkbox restrictions
4/26/09 changes to list layout per AF, addslashes replaces htmlentities
5/11/09 added $theClass to unit name display, 'available' SELECTED if exists
5/17/09 moved buttons to floating div, with user location adjustment
5/20/09 simplified Reset button handling, hide/show cleared dispatches
5/23/09 fix to table alignment, edit 'select status' handling, bold units, relocate and visible 'times reset'
5/24/09 width fix per AH email
5/28/09 dispatch deletion added, per AF request.
5/25/09 change to sort order
6/6/09 page refresh link added
6/16/09 show_top() added, mail win added
6/19/09 d/r case-independence added
7/27/09 synchronous AJAX call to avoid collisions
9/12/09 table cleanup, ticket descr added
10/6/09 Changed comments form field to textarea and comments field in table to text from varchar
10/6/09 Added Unit to Facility enroute and arrived status, added links button
10/20/09 strip newlines
10/29/09 $_REQUEST to $_POST (original reason unknown)
10/31/09 window height syntax, list window open corrections, is_guest() -> $guest
11/2/09 correction to insert param count
11/4/09 mileage added to add form
11/6/09 removed quote - source ???, removed old id manipulation in function our_reset()
11/27/09 revised default column widths - per AF; removed redundant form
12/13/09 applied filter to 'open assigns' list
3/18/10 added log 'dispatch' entry
4/4/10 status alignment fixed
4/27/10 unit_name correction
4/29/10 added 'Cancel' button
5/7/10 query name changes
6/21/10 - user select board sort order added
Sequence numbering: SELECT a.id, @num := @num + 1 seqno from ticket a, (SELECT @num := 0) d;
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/10/10 address column names disambiguated, path correction
8/29/10 use dispatch status tags per 'disp_stat' setting
9/29/10 use revised mysql2timestamp($m), per JB, do_diff moved to FIP
11/16/10 assign 'as of' correction
12/9/10 in_strike corrections, table width corrections for missing unit data
2/8/11 Revised query line 712 to correct multiple showings of same responder in add assignmenet from callboard .
2/8/11 added multi to line 712 sql
3/15/11 Revisions to support user editable color schemes and day/night mode
4/28/11 handle replaces unit name
5/9/11 add test for existence of dform element
6/10/11 changes for regional capability
4/24/12 Revised SQL station to correct incorrect GROUP BY clause.
6/20/12 applied get_text() to "Units", don't reset 'dispatch' time on reset
10/19/12 mysql setting set, form end moved outside table row
10/20/12 button label correction, generate log entry for each changed assigns event
1/8/2013 function get_disp_cell() added, reload() set true
1/10/2013 function my_gregoriantojd added, gregoriantojd being absent from some config's
7/12/2013 revised for zero frame height in case of frames and no assigns
7/16/2013 corrections applied to do_assgn_reset()
3/21/2015 revised calculating table height
4/7/2015 revised display of closed calls, removed default initial 'show'
4/8/2015 converted to mysql_num_rows()
*/
@session_start();
session_write_close();
require_once('./incs/functions.inc.php'); //7/28/10
$query = "SET @@global.sql_mode= '';"; //10/19/12
$result = mysql_query($query) ;
$from_top = 0; // position of floating div, pixels from top of frame
if($istest) { dump($_POST); }
if((isset($_SESSION['level'])) && ($_SESSION['level'] == $GLOBALS['LEVEL_UNIT']) && (intval(get_variable('restrict_units')) == 1)) {
print "Not Authorized";
exit();
}
function show_top() { // generates the document introduction
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD><TITLE>Tickets - Call Board Module</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"/>
<META HTTP-EQUIV="Expires" CONTENT="0"/>
<META HTTP-EQUIV="Cache-Control" CONTENT="NO-CACHE"/>
<META HTTP-EQUIV="Pragma" CONTENT="NO-CACHE"/>
<META HTTP-EQUIV="Content-Script-Type" CONTENT="application/x-javascript"/>
<META HTTP-EQUIV="Script-date" CONTENT="<?php print date("n/j/y G:i", filemtime(basename(__FILE__)));?>">
<LINK REL=StyleSheet HREF="stylesheet.php?version=<?php print time();?>" TYPE="text/css">
<STYLE>
span.even { background-color: #DEE3E7;}
.odd { background-color: #EFEFEF;}
.plain { background-color: #FFFFFF;}
input.btn { color:#050; font: bold 84% 'trebuchet ms',helvetica,sans-serif; background-color:#DEE3E7; border:1px solid; border-color: #696 #363 #363 #696; }
#BGCOLOR {BACKGROUND-COLOR: #EFEFEF;}
.emph { background-color: #99b2cc;FONT-SIZE: 12px; COLOR: #ffffff; FONT-STYLE: normal; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none }
.emphb { background-color: #99b2cc;FONT-SIZE: 12px; COLOR: #ffffff; FONT-STYLE: normal; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none }
tr.bigeven { background-color: #DEE3E7;line-height: 200% }
td {cursor: pointer; cursor: hand;}
/* Apply mousedown effect only to NON IE browsers */
html>body .hovermenu ul li a:active{ border-style: inset;}
checkbox {border-width: 0px;}
span.ok{font-weight: light; color: gray;}
span.over {font-weight: light; color: red;}
#bar { width: auto; height: auto; background:transparent; z-index: 100; }
* html #bar { /*\*/position: absolute; top: expression((4 + (ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop)) + 'px'); right: expression((30 + (ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft)) + 'px');/**/ }
#foo > #bar { position: fixed; top: 4px; right: 10px; }
td.my_plain {background-color: white; white-space:nowrap;}
tr td {white-space:nowrap;}
</STYLE>
<SCRIPT TYPE="application/x-javascript" SRC="./js/jss.js"></SCRIPT>
<SCRIPT TYPE="application/x-javascript" SRC="./js/misc_function.js"></SCRIPT>
<SCRIPT>
set_fontsizes(1200, 'fullscreen');
function syncAjax(strURL) { // synchronous ajax function
if (window.XMLHttpRequest) {
AJAX=new XMLHttpRequest();
}
else {
AJAX=new ActiveXObject("Microsoft.XMLHTTP");
}
if (AJAX) {
AJAX.open("GET", strURL, false);
AJAX.send(null); // form name
return AJAX.responseText;
}
else {
alert ("197: failed");
return false;
}
} // end function sync Ajax(strURL)
function do_refresh() { // 7/10/10
<?php
if (get_variable('call_board')==2) { // window vs. frame behavior
print "\t\t do_frm_refresh();\n"; // re-size cb frame
}
?>
document.can_Form.submit(); // reload frame or window
} // end function do_refresh()
function do_frm_refresh() { // frame refresh - call board option 2
var temp = parent.document.getElementById('the_frames').getAttribute('rows'); // e.g., '63, 126,*'
var rows = temp.split(",", 4)
var height_in_pix = get_lines().trim();
rows[1] = height_in_pix;
temp = rows.join(",");
parent.document.getElementById('the_frames').setAttribute('rows', temp); // set revised cb frame height
document.nav_form.func.value='board';
document.nav_form.submit(); // refresh it
}
function get_lines(){ // returns pixel count
lines = syncAjax("lines_a.php"); // note synch call - 8/10/10
return lines;
} // end function get_lines()
function $() {
var elements = new Array();
for (var i = 0; i < arguments.length; i++) {
var element = arguments[i];
if (typeof element == 'string') element = document.getElementById(element);
if (arguments.length == 1) return element;
elements.push(element);
}
return elements;
}
function do_hover (the_id) {
CngClass(the_id, 'hover text');
return true;
}
function do_plain (the_id) {
CngClass(the_id, 'plain text');
return true;
}
function CngClass(obj, the_class){
$(obj).className=the_class;
return true;
}
function tween(in_val, min_val, max_val) { // min and max inclusive
if ((in_val >= min_val) && (in_val<= max_val)) return in_val;
else {
// alert(231);
if (in_val >= max_val) return max_val;
if (in_val <= min_val) return min_val;
alert ("err 235");
}
}
function reSizeScr_add(lines) { // 238 -- 5/23/09
var the_height = ((lines * 25)+280);
window.resizeTo(800, tween(the_height, 200, (window.screen.height - 200))); // 10/31/09 - derived via trial/error (more of the latter, mostly)
} // end function re SizeScr_add()
function reSizeScr(lines) { // 244 -- 5/23/09
var the_height = (document.getElementById('call_board').offsetHeight) +150; // 3/21/2015
if(the_height > window.screen.height) {the_height = window.screen.height - 200;}
window.resizeTo((0.98)* window.screen.width, the_height); // 10/31/09 - derived via trial/error (more of the latter, mostly)
} // end function re SizeScr()
function do_add_btn() { // 11/4/09
<?php
if (intval(get_variable('call_board'))==1) {
?>
document.nav_form.func.value='add';
document.nav_form.submit(); // 11/6/09
<?php
} else {
$url = basename(__FILE__) . "?func=add";
?>
newwindow_add = window.open("<?php print $url; ?>", "Email", "titlebar, resizable=1, scrollbars=yes, height=480,width=800,status=no,toolbar=no,menubar=no,location=no, left=50,top=150,screenX=100,screenY=300");
if (isNull(newwindow_add)) {
alert ("This requires popups to be enabled. Please adjust your browser options.");
return;
}
newwindow_add.focus();
<?php
} // end if/else
?>
}
</SCRIPT>
<?php
} // end function show_top()
function my_to_date($in_date) { // date_time format to user's spec
$temp = mysql2timestamp($in_date); // 9/29/10
return (good_date_time($in_date)) ? date(get_variable("date_format"), $temp): ""; //
}
function my_to_date_sh($in_date) { // short date_time string
$temp = mysql2timestamp($in_date); // 9/29/10
return (good_date_time($in_date)) ? date("H:i", $temp): ""; //
}
function my_gregoriantojd ( $da, $mo, $yr) { // 1/10/2013
return strtotime ("{$da} {$mo} {$yr}");
}
$jd_today = my_gregoriantojd (date ("M"), date ("j"), date ("Y")); // julian today - see get_disp_cell() - 1/7/2013
function get_disp_cell($row_element, $form_element, $theClass ) { // returns td cell with disp times or checkbox - 1/8/2013
$can_update = (array_key_exists ('level', $_SESSION) )? ( is_administrator() || is_user()): FALSE; // 1/8/2013
global $jd_today;
if (is_date($row_element)) {
$ttip_str = " onmouseover=\"Tip(' " . my_to_date($row_element) . "')\" onmouseout=\"UnTip()\" ";
$then = strtotime($row_element);
$jd_then = my_gregoriantojd (date ("M", $then), date ("j", $then), date ("Y", $then));
$this_class = ($jd_then == $jd_today )? $theClass: "my_plain";
return "\n\t<TD CLASS='{$this_class}' {$ttip_str}>" . my_to_date_sh($row_element) . "</TD>\n"; // identify as not-today
} else {
$is_dis = ($can_update)? "" : "DISABLED"; // limit to admins, operators
return "\n\t<TD CLASS='{$theClass}'><INPUT TYPE='checkbox' NAME='{$form_element}' {$is_dis} onClick = 'checkbox_clicked()' ></TD>\n";
}
} // end function get_disp_cell()
sleep(1); // wait for possible logout to complete
@session_start();
session_write_close();
if(empty($_SESSION)) { // expired?
show_top();
?>
</HEAD>
<BODY> <!-- <?php print __LINE__; ?> -->
<?php
require_once('./incs/links.inc.php');
$evenodd = array ("even", "odd"); // CLASS names for alternating table row colors
?>
<CENTER><BR><SPAN ID='zzstart' onClick = "Javascript: self.location.href = '<?php print basename(__FILE__); ?>';"><H3>Call board loading ...</H3></span>
</BODY><!-- <?php echo __LINE__;?> -->
</HTML>
<?php
} elseif(is_guest()) {
?>
</HEAD>
<SCRIPT>
function reSizeFrame(lines) {
frame_rows = parent.document.getElementById('the_frames').getAttribute('rows'); // get current configuration
var rows = frame_rows.split(",", 4);
rows[1] = 0; // new cb frame height if no assigns; re-use top
frame_rows = rows.join(",");
parent.document.getElementById('the_frames').setAttribute('rows', frame_rows); // this does the work
} // end function re SizeScr()
</SCRIPT>
<BODY onLoad="reSizeFrame(0);">
<CENTER><BR><SPAN ID='isguest' ><H3>Call board not provided for guest access</H3></span>
</BODY>
</HTML>
<?php
} else {
@session_start();
set_sess_exp(); // update session time
extract($_POST);
// $func = (!(array_key_exists('func', $_REQUEST)))? "board" : $_REQUEST['func']; // array_key_exists ( mixed key, array search )
if (!(array_key_exists('func', $_REQUEST))) {
$func = "board";
$_SESSION['show_hide_cleared'] = "h"; // set button for flip to 'show closed'
} else {
$func = $_REQUEST['func'];
}
show_top();
session_write_close();
$guest = is_guest(); // 10/31/09
$user = is_user(); // 5/11/10
?>
<SCRIPT>
var myuser = "<?php print $_SESSION['user']?$_SESSION['user']: "not";?>";
var mylevel = "<?php print isset($_SESSION['level'])?get_level_text($_SESSION['level']): "na";?>";
var myscript = "<?php print isset($_SESSION['user'])? LessExtension(basename( __FILE__)): "login";?>";
if (!(window.opener==null)){ // 1/12/09
try {
window.opener.parent.frames["upper"].$("whom").innerHTML = myuser;
window.opener.parent.frames["upper"].$("level").innerHTML = mylevel;
window.opener.parent.frames["upper"].$("script").innerHTML = myscript;
}
catch(e) {
}
}
function $() { // 1/12/09
var elements = new Array();
for (var i = 0; i < arguments.length; i++) {
var element = arguments[i];
if (typeof element == 'string')
element = document.getElementById(element);
if (arguments.length == 1)
return element;
elements.push(element);
}
return elements;
}
String.prototype.trim = function () {
return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1");
};
function isNull(val) { // checks var stuff = null;
return val === null;
}
function sendRequest(url,callback,postData) { // ajax function set - 1/15/09
var req = createXMLHTTPObject();
if (!req) return;
var method = (postData) ? "POST" : "GET";
req.open(method,url,false); // synchronous, 7/27/09
if (postData)
req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
req.onreadystatechange = function () {
if (req.readyState != 4) return;
if (req.status != 200 && req.status != 304) {
<?php
if($istest) {print "\t\t\talert('HTTP error ' + req.status + ' " . __LINE__ . "');\n";}
?>
return;
}
callback(req);
}
if (req.readyState == 4) return;
req.send(postData);
}
var XMLHttpFactories = [
function () {return new XMLHttpRequest() },
function () {return new ActiveXObject("Msxml2.XMLHTTP") },
function () {return new ActiveXObject("Msxml3.XMLHTTP") },
function () {return new ActiveXObject("Microsoft.XMLHTTP") }
];
function createXMLHTTPObject() {
var xmlhttp = false;
for (var i=0;i<XMLHttpFactories.length;i++) {
try {
xmlhttp = XMLHttpFactories[i]();
}
catch (e) {
continue;
}
break;
}
return xmlhttp;
}
function editA(id) { // edit assigns
document.nav_form.frm_id.value=id;
<?php
print "\t\tdocument.nav_form.func.value="; // guest priv's = 'read-only'
print ($guest||($user))? "'view';" : "'edit';"; // 5/11/10
?>
document.nav_form.submit();
}
function do_mail_all_win() { // 6/16/09
if(starting) {return;}
starting=true;
newwindow_um=window.open("do_unit_mail.php?the_ticket=doselect", "Email", "titlebar, resizable=1, scrollbars, height=640,width=600,status=0,toolbar=0,menubar=0,location=0, left=50,top=150,screenX=100,screenY=300");
if (isNull(newwindow_um)) {
alert ("This requires popups to be enabled. Please adjust your browser options.");
return;
}
newwindow_um.focus();
starting = false;
}
function viewT(id) { // view ticket
document.T_nav_form.id.value=id;
document.T_nav_form.action='main.php';
document.T_nav_form.submit();
if (!(window.opener==null)){window.opener.focus();}
}
function editT(id) { // edit ticket
document.T_nav_form.id.value=id;
document.T_nav_form.action='edit.php';
document.T_nav_form.submit();
if (!(window.opener==null)){window.opener.focus();}
}
function viewU(id) { // view unit
document.U_nav_form.id.value=id;
document.U_nav_form.submit();
if (!(window.opener==null)){window.opener.focus();}
}
function editU(id) { // edit unit
document.U_edit_form.id.value=id;
document.U_edit_form.submit();
if (!(window.opener==null)){window.opener.focus();}
}
function do_assgn_reset(id, the_form) { // 4/26/09 - 7/16/2013
function our_reset(id, the_form) { // reset dispatch checks
var dis = <?php print ($guest)? "true": "false"; ?>; // disallow guest actions
the_form.res_times.checked = false; // 6/20/12
// the_form.frm_dispatched.disabled = false;
// the_form.frm_dispatched.checked = false;
// the_form.frm_dispatched.disabled = dis;
if ( the_form.frm_responding ) {
the_form.frm_responding.disabled = false;
the_form.frm_responding.checked = false;
the_form.frm_responding.disabled = dis;
}
if ( the_form.frm_on_scene ) {
the_form.frm_on_scene.disabled = false;
the_form.frm_on_scene.checked = false;
the_form.frm_on_scene.disabled = dis;
}
if ( the_form.frm_u2fenr ) {
the_form.frm_u2fenr.disabled = false; //10/6/09 Unit to Facility
the_form.frm_u2fenr.checked = false;
the_form.frm_u2fenr.disabled = dis;
}
if (the_form.frm_u2farr ) {
the_form.frm_u2farr.disabled = false; //10/6/09 Unit to Facility
the_form.frm_u2farr.checked = false;
the_form.frm_u2farr.disabled = dis;
}
if (the_form.frm_clear ) {
the_form.frm_clear.disabled = false;
the_form.frm_clear.checked = false;
the_form.frm_clear.disabled = dis;
}
var url = "assign_res.php";
var postData = "frm_id=" + id; // the post string
sendRequest(url,handleResult,postData) ;
do_refresh();
} // end function do_assgn_reset()
function our_delete(id, the_form) { // delete this dispatch record
$('del_id').style.display='block';
var url = "assign_del.php";
var postData = "frm_id=" + id; // the post string
sendRequest(url,our_wrapup,postData) ;
setTimeout('$(\'del_id\').style.display=\'none\';document.can_Form.submit();', 2000); // show for 2 seconds
} // end function our delete()
function our_wrapup() {
setTimeout('$(\'del_id\').style.display=\'none\';', 2000); // show for 2 seconds
// window.location.reload();
document.can_Form.submit(); // screen refresh/re-size
}
var resp = ""; // 5/28/09
while ((resp.toLowerCase() !="r") && (resp !="d")) { // 6/19/09
resp = prompt("Enter 'r' to Reset dispatch times\nEnter 'd' to Delete this dispatch, or press Cancel.\n", "");
if (isNull(resp)) {the_form.res_times.checked = false; return;} // 5/6/10
else {
switch(resp.toLowerCase()){ // process the input
case "r":
our_reset(id, the_form);
break;
case "d":
if ( confirm ( "Delete this dispatch record?" ) ) { // 7/16/2013
our_delete(id, the_form);
}
break;
default: // user cancelled
the_form.res_times.checked = false;
return;
} // end switch(resp)
} // end while ( ... )
the_form.res_times.checked = false;
}
} // end function do_assgn_reset()
</SCRIPT>
<?php
$guest = is_guest(); // 10/31/09
$user = is_user(); // 10/31/09
switch ($func) {
case 'add': // ==== { ==== first build JS array of existing assigns for dupe prevention
$al_groups = $_SESSION['user_groups'];
if(count($al_groups == 0)) { // catch for errors - no entries in allocates for the user. // 5/30/13
$where2 = "";
} else {
if(array_key_exists('viewed_groups', $_SESSION)) { // 6/10/11
$curr_viewed= explode(",",$_SESSION['viewed_groups']);
}
if(!isset($curr_viewed)) { // 6/10/11
$x=0;
$where2 = "AND (";
foreach($al_groups as $grp) {
$where3 = (count($al_groups) > ($x+1)) ? " OR " : ")";
$where2 .= "`$GLOBALS[mysql_prefix]allocates`.`group` = '{$grp}'";
$where2 .= $where3;
$x++;
}
} else {
$x=0;
$where2 = "AND (";
foreach($curr_viewed as $grp) {
$where3 = (count($curr_viewed) > ($x+1)) ? " OR " : ")";
$where2 .= "`$GLOBALS[mysql_prefix]allocates`.`group` = '{$grp}'";
$where2 .= $where3;
$x++;
}
}
}
$query = "SELECT *, `$GLOBALS[mysql_prefix]ticket`.`id` AS `tick_id`
FROM `$GLOBALS[mysql_prefix]ticket`
LEFT JOIN `$GLOBALS[mysql_prefix]allocates` ON `$GLOBALS[mysql_prefix]ticket`.`id`=`$GLOBALS[mysql_prefix]allocates`.`resource_id`
WHERE (`status` = {$GLOBALS['STATUS_OPEN']} OR `status` = {$GLOBALS['STATUS_SCHEDULED']}) {$where2}
GROUP BY `tick_id` ORDER BY `severity` DESC, `problemstart` ASC "; // highest severity, oldest open
$result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
if (mysql_num_rows($result)==1) { // if a single, do it
$row = mysql_fetch_assoc($result);
?>
<SCRIPT>
function do_post() {
document.temp_Form.frm_ticket_id.value=<?php print $row['tick_id'];?>;
document.temp_Form.submit();
}
setTimeout('do_post()', 1000);
</SCRIPT>
<?php
} else { // if more than one build <SELECT> list
$lines = mysql_num_rows($result);
?>
</HEAD>
<BODY onLoad = "reSizeScr_add(<?php print $lines;?>)"><!-- <?php echo __LINE__ ;?> --><BR /><BR />
<TABLE BORDER=0 ALIGN='center'>
<FORM NAME="add_nav_form" ACTION = "<?php print basename(__FILE__); ?>" METHOD = "post">
<TR CLASS="even"><TH colspan=4 ALIGN="center">Select Incident for Dispatch</TH></TR>
<TR CLASS="odd" VALIGN="baseline">
<TD CLASS="td_label text" ALIGN="right">Incident: </TD>
<TD ALIGN='left' COLSPAN=3>
<SELECT NAME="frm_ticket_sel" onChange = "if (!(this.value=='')) {this.form.frm_ticket_id.value=this.value;this.form.submit();}">
<OPTION VALUE= '' SELECTED>Select</OPTION>
<?php
$inc_ctr = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
$addr = substr($row['street'] . " " . $row['city'] . " " . $row['state'], 0, 24);
$descr = substr($row['scope'] , 0, 24) . " - " . $addr ;
print "\t\t\t<OPTION value='{$row['tick_id']}'> {$descr}</OPTION>\n";
}
?>
</SELECT>
</TD>
</TR>
<?php // 4/29/10
$the_onclick = (get_variable('call_board')==1)? "history.back()": "window.close()";
?>
<TR>
<TD COLSPAN = 4 ALIGN = 'center'>
<BR />
<BR />
<SPAN id='cancel_but' CLASS='plain text' style='float: none; width: 100px; display: inline-block;' onMouseover='do_hover(this.id);' onMouseout='do_plain(this.id);' onClick='<?php print $the_onclick; ?>;'><SPAN STYLE='float: left;'><?php print get_text("Cancel");?></SPAN><IMG STYLE='float: right;' SRC='./images/cancel_small.png' BORDER=0></SPAN>
</TD>
</TR>
</TABLE>
<?php
} // end if/else (mysql_num_rows()==1)
?>
<INPUT TYPE='hidden' NAME='frm_ticket_id' VALUE='' />
<INPUT TYPE='hidden' NAME='func' VALUE='add_b' />
</FORM>
<?php
break; // end case 'add' ==== } ===
case 'add_b': // ==== { ====
extract ($_POST);
$al_groups = $_SESSION['user_groups'];
if(count($al_groups == 0)) { // catch for errors - no entries in allocates for the user. // 5/30/13
$where2 = "WHERE `$GLOBALS[mysql_prefix]allocates`.`type` = 2";
} else {
if(array_key_exists('viewed_groups', $_SESSION)) { // 6/10/11
$curr_viewed= explode(",",$_SESSION['viewed_groups']);
}
if(!isset($curr_viewed)) { // 6/10/11
$x=0;
$where2 = "WHERE (";
foreach($al_groups as $grp) {
$where3 = (count($al_groups) > ($x+1)) ? " OR " : ")";
$where2 .= "`$GLOBALS[mysql_prefix]allocates`.`group` = '{$grp}'";
$where2 .= $where3;
$x++;
}
} else {
$x=0;
$where2 = "WHERE (";
foreach($curr_viewed as $grp) {
$where3 = (count($curr_viewed) > ($x+1)) ? " OR " : ")";
$where2 .= "`$GLOBALS[mysql_prefix]allocates`.`group` = '{$grp}'";
$where2 .= $where3;
$x++;
}
}
$where2 .= "AND `$GLOBALS[mysql_prefix]allocates`.`type` = 2"; // 6/10/11
}
$assigns = array(); // map unit id to ticket id
function get_cd_str ($unit_row, $ticket_id) {
global $assigns;
// dump($assigns);
if ((array_key_exists($unit_row['id'], $assigns))
&& ($assigns[$unit_row['id']] == $ticket_id )) { return " CHECKED DISABLED ";} // this unit, this ticket
if ($unit_row['multi'] == 1) { return "";} // multiple assign allowed
if (array_key_exists($unit_row['id'], $assigns)) { return " DISABLED ";}
else { return "";}
} // end function get_cd_str ()
?>
<SCRIPT>
<?php
print "\t\tassigns = new Array();\n";
$query = "SELECT *,`as_of` AS `as_of` FROM `$GLOBALS[mysql_prefix]assigns` WHERE `clear` IS NULL OR DATE_FORMAT(`clear`,'%y') = '00' ORDER BY `as_of` DESC"; // 12/13/09
$result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
while($row = stripslashes_deep(mysql_fetch_array($result))) {
print "\t\tassigns['" .$row['ticket_id'] .":" . $row['responder_id'] . "']=true;\n"; // build assoc array of ticket:unit pairs
}
?>
function validate_ad(theForm) {
var errmsg="";
if (theForm.frm_unit_id_str.value == "") {errmsg+= "\tSelect one or more units\n";}
if (theForm.frm_comments.value == "") {errmsg+= "\tComments required\n";}
if (!(theForm.frm_miles_strt.value.trim()) =="") { // 11/4/09
if (!(parseInt(theForm.frm_miles_strt.value.trim()) == theForm.frm_miles_strt.value.trim()))
{errmsg+= "\tStart mileage error\n";}
}
if (!(theForm.frm_miles_onsc.value.trim()) =="") { // 11/4/09
if (!(parseInt(theForm.frm_miles_onsc.value.trim()) == theForm.frm_miles_onsc.value.trim()))
{errmsg+= "\tOn scene mileage error\n";}
}
if (!(theForm.frm_miles_end.value.trim()) =="") {
if (!(parseInt(theForm.frm_miles_end.value.trim()) == theForm.frm_miles_end.value.trim()))
{errmsg+= "\tEnd mileage error\n";}
}
if (!(theForm.frm_miles_tot.value.trim()) =="") { // 10/23/12
if (!(parseInt(theForm.frm_miles_tot.value.trim()) == theForm.frm_miles_tot.value.trim()))
{errmsg+= "\tTotal mileage error\n";}
}
if (errmsg!="") {
alert ("Please correct the following and re-submit:\n\n" + errmsg);
return false;
}
else {
theForm.submit();
}
} // end function vali date(theForm)
</SCRIPT>
</HEAD>
<?php
$query = "SELECT * FROM `$GLOBALS[mysql_prefix]responder`
LEFT JOIN `$GLOBALS[mysql_prefix]allocates` ON `$GLOBALS[mysql_prefix]responder`.id=`$GLOBALS[mysql_prefix]allocates`.`resource_id`
{$where2} GROUP BY `$GLOBALS[mysql_prefix]responder`.`id`"; // 2/12/09
$result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
$lines = mysql_num_rows($result);
$query = "SELECT * FROM `$GLOBALS[mysql_prefix]ticket` WHERE `$GLOBALS[mysql_prefix]ticket`.`id` = {$frm_ticket_id}
LIMIT 1"; // see case $func = 'add_b'
$result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
$row = mysql_fetch_array($result);
$latitude = $row['lat'];
$longitude = $row['lng'];
?>
<BODY onLoad = "reSizeScr_add(<?php print $lines;?>)"><!-- <?php echo __LINE__; ?> --><LEFT>
<A NAME='page_top'>
<DIV ID='buttons' style="position:fixed; top:10px; right:2px; height: 300px; width: 150px; overflow-y: auto;">
<TABLE style='width: 100%;'>
<TR>
<TD ALIGN='left'>
<A id='top_but' HREF="#page_top" CLASS='plain text' style='float: left; width: 100px; display: inline-block;' onMouseover='do_hover(this.id);' onMouseout='do_plain(this.id);' ><SPAN STYLE='float: left;'>to top</SPAN><IMG STYLE='float: right;' SRC='./images/up_small.png' BORDER=0></A>
</TD>
</TR>
<TR>
<TD ALIGN='left'>
<A id='bot_but' HREF="#page_bottom" CLASS='plain text' style='float: left; width: 100px; display: inline-block;' onMouseover='do_hover(this.id);' onMouseout='do_plain(this.id);' ><SPAN STYLE='float: left;'>to bottom</SPAN><IMG STYLE='float: right;' SRC='./images/down_small.png' BORDER=0></SPAN></A>
</TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD ALIGN='left'>
<?php
if (get_variable('call_board')==1) {
?>
<SPAN id='ref_but' CLASS='plain text' style='float: left; width: 100px; display: inline-block;' onMouseover='do_hover(this.id);' onMouseout='do_plain(this.id);' onClick="do_refresh();"><SPAN STYLE='float: left;'><?php print get_text("Cancel");?></SPAN><IMG STYLE='float: right;' SRC='./images/cancel_small.png' BORDER=0></SPAN><BR />
<?php
} else {
?>
<SPAN id='ref_but' CLASS='plain text' style='float: left; width: 100px; display: inline-block;' onMouseover='do_hover(this.id);' onMouseout='do_plain(this.id);' onClick="window.close();"><SPAN STYLE='float: left;'><?php print get_text("Cancel");?></SPAN><IMG STYLE='float: right;' SRC='./images/cancel_small.png' BORDER=0></SPAN><BR />
<?php
}
?>
<SPAN id='reset_but' CLASS='plain text' style='left: none; width: 100px; display: inline-block;' onMouseover='do_hover(this.id);' onMouseout='do_plain(this.id);' onClick="Javascript: document.add_Form.frm_unit_id_str.value = ''; document.add_Form.reset();"><SPAN STYLE='float: left;'><?php print get_text("Reset");?></SPAN><IMG STYLE='float: right;' SRC='./images/restore_small.png' BORDER=0></SPAN>
<SPAN id='sub_but' CLASS='plain text' style='width: 100px; display: inline-block; float: left;' onMouseover='do_hover(this.id);' onMouseout='do_plain(this.id);' onClick="validate_ad(document.add_Form);"><SPAN STYLE='float: left;'><?php print get_text("Next");?></SPAN><IMG STYLE='float: right;' SRC='./images/submit_small.png' BORDER=0></SPAN><BR />
</TD>
</TR>
</TABLE>
</DIV> <!-- 3/30/10 -->
<FORM NAME="add_Form" ACTION = "<?php print basename(__FILE__); ?>" METHOD = "post">
<TABLE BORDER=0 STYLE = "border-collapse:collapse; margin-left:32px" CELLSPACING=0 CELLPADDING=0 >
<TR CLASS="even">
<TH colspan=4 ALIGN="center">Assign <?php print get_text("Units");?> to Incident: <?php print $row['scope'];?></TH>
</TR>
<?php
$query = "SELECT * FROM `$GLOBALS[mysql_prefix]assigns`
WHERE `clear` IS NULL OR DATE_FORMAT(`clear`,'%y') = '00'";
$result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename( __FILE__), __LINE__);
while ($row = mysql_fetch_assoc($result)) {
$assigns[$row['responder_id']] = $row['ticket_id'];
}
$capt = get_text("Units") . ":";
$dist_capt = " mi SLD"; // 4/27/10
$query = "SELECT *, `$GLOBALS[mysql_prefix]responder`.`id` AS `unit_id`,
`$GLOBALS[mysql_prefix]responder`.`name` AS `unit_name`,
(((acos(sin(({$latitude}*pi()/180)) * sin((`$GLOBALS[mysql_prefix]responder`.`lat`*pi()/180))+cos(({$latitude}*pi()/180)) * cos((`$GLOBALS[mysql_prefix]responder`.`lat`*pi()/180)) * cos((({$longitude} - `$GLOBALS[mysql_prefix]responder`.`lng`)*pi()/180))))*180/pi())*60*1.1515) AS `distance`
FROM `$GLOBALS[mysql_prefix]responder`
LEFT JOIN `$GLOBALS[mysql_prefix]unit_types` `t` ON ( `$GLOBALS[mysql_prefix]responder`.`type` = t.id )
LEFT JOIN `$GLOBALS[mysql_prefix]allocates` ON `$GLOBALS[mysql_prefix]responder`.id=`$GLOBALS[mysql_prefix]allocates`.`resource_id`
{$where2}
GROUP BY `$GLOBALS[mysql_prefix]responder`.`id`
ORDER BY `distance` ASC, `$GLOBALS[mysql_prefix]responder`.`name` ASC"; // 2/12/09 , 6/10/11
$result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
$i = 0;
while ($row = mysql_fetch_assoc($result)) {
$the_bg_color = $GLOBALS['UNIT_TYPES_BG'][$row['icon']]; // 4/26/10
$the_text_color = $GLOBALS['UNIT_TYPES_TEXT'][$row['icon']];
$distance = ($row['distance']> 5000.0)? "?" : round($row['distance'],1);
$cd_str = get_cd_str ($row, $_POST['frm_ticket_id']);
$em_arr = array();
$temp_arr = array();
$temp_addrs = get_contact_via($row['unit_id']);
foreach($temp_addrs as $val) {
if (is_email($val)) {
array_push($temp_arr, $val);
}
}
$em_arr = array_unique($temp_arr);
$em_addr = implode(",", $em_arr);
?>
<TR CLASS='<?php print $evenodd[($i+1)%2];?>' VALIGN='baseline'>
<TD ALIGN='right' CLASS='td_label'><?php print $capt;?> </TD>
<TD ALIGN='left'>
<INPUT TYPE = 'checkbox' NAME = '_resp<?php print$row['unit_name'];?>' VALUE= '<?php print $row['unit_id'];?>' onClick = 'this.form.frm_unit_id_str.value += "<?php print $row['unit_id'];?>" + ","; this.form.frm_contact_str.value += "<?php print $em_addr;?>"' <?php print $cd_str;?> />
<SPAN STYLE='background-color:<?php print $the_bg_color;?>; opacity: .7; color:<?php print $the_text_color;?>;'><?php print $row['handle'];?></SPAN>
</TD>
<TD ALIGN='left'><?php print $distance;?> <?php print $dist_capt;?></TD>
<TD ALIGN='left'><?php print get_status_sel($row['unit_id'], $row['un_status_id'], "u");?></TD>
</TR>
<?php
$capt = "";
$dist_capt = "";
$i++;
}
?>
<TR CLASS="<?php print $evenodd[($i+1)%2];?>">
<TD CLASS="td_label text" ALIGN="right">Comments: </TD>
<TD ALIGN='left' COLSPAN=3>
<TEXTAREA NAME="frm_comments" COLS="60" ROWS="3" onFocus="Javascript:if (this.value=='TBD') {this.value='';}">TBD</TEXTAREA>
</TD>
</TR>
<TR CLASS='<?php print $evenodd[($i)%2];?>'><TD CLASS="td_label text" ALIGN="right">Mileage:</TD> <!--11/4/09-->
<TD colspan=4 ALIGN='center'>
<SPAN CLASS="td_label text"> Start:</SPAN> <INPUT MAXLENGTH="8" SIZE="8" NAME="frm_miles_strt" VALUE="" TYPE="text" />
<SPAN STYLE = "WIDTH: 60PX; DISPLAY: inline-block"></SPAN>
<SPAN CLASS="td_label text"> On scene:</SPAN> <INPUT MAXLENGTH="8" SIZE="8" NAME="frm_miles_onsc" VALUE="" TYPE="text" />
<SPAN STYLE = "WIDTH: 60PX; DISPLAY: inline-block"></SPAN>
<SPAN CLASS="td_label text">End:</SPAN> <INPUT MAXLENGTH="8" SIZE="8" NAME="frm_miles_end" VALUE="" TYPE="text" />
<SPAN STYLE = "WIDTH: 60PX; DISPLAY: inline-block"></SPAN>
<SPAN CLASS="td_label text">Total:</SPAN> <INPUT MAXLENGTH="8" SIZE="8" NAME="frm_miles_tot" VALUE="" TYPE="text" />
</TD>
</TR>
</TABLE>
<INPUT TYPE='hidden' NAME='func' VALUE= 'add_db' />
<INPUT TYPE='hidden' NAME='frm_ticket_id' VALUE="<?php print $frm_ticket_id;?>" />
<INPUT TYPE='hidden' NAME='frm_unit_id_str' VALUE= "" /> <!-- comma sep'd string of unit id's - 4/23/10 -->
<INPUT TYPE='hidden' NAME='frm_contact_str' VALUE= "" /> <!-- comma sep'd string of contact via's - 4/23/10 -->
<INPUT TYPE='hidden' NAME='frm_by_id' VALUE= "<?php print $_SESSION['user_id'];?>" />
<INPUT TYPE='hidden' NAME='frm_log_it' VALUE='' />
</FORM>
<BR />
<BR />
<A NAME='page_bottom'>
<?php
break; // end case 'add_b' ==== } ===
case 'add_db' : // ==== { ==== id, as_of, status_id, ticket_id, frm_unit_id_str, comment, user_id
function handle_mail($to_str, $ticket_id) { // 6/16/09
global $istest;
$text = "";
$the_msg = mail_it ($to_str, "", $text, $ticket_id, 3, TRUE); // get default msg text
$temp = (explode("\n", $text));
$msg_lines = count($temp);
?>
<SCRIPT>
function handleResult(req) { // the called-back function
<?php
if ($istest) {print "\n\t alert(884);\n";}
?>
} // end function handle Result()
function send_it(addr, msg) { // 12/13/09
function isValidEmail(str) {
return (str.lastIndexOf(".") > 2) && (str.indexOf("@") > 0) && (str.lastIndexOf(".") > (str.indexOf("@")+1)) && (str.indexOf("@") == str.lastIndexOf("@"));
}
sep=outstr=errstr="";
temp = addr.split(','); // comma sep's
for (i=0;i<temp.length;i++) { // build string of valid addresses
if ((temp[i].trim().length>0) && (!(isValidEmail(temp[i].trim())))) {
errstr +="\t" + temp[i].trim()+"\n";
} else {
if (temp[i].trim().length>0) { // OK and not empty?
outstr +=sep + temp[i].trim();
sep = "|"; // note pipe separator
}
}
} // end for ()
if (errstr.length>0) { // errors?
alert("Invalid addresses:\n" +errstr );
return false;
}
if (outstr.length==0) { // empty?
alert("Valid addresses required\n");
return false;
}
var url = "do_send.php"; // ($to_str, $subject_str, $text_str )
var the_to = addr;
var the_subj = escape("New Dispatch");
var the_msg = escape(msg); // the variables
var postData = "to_str=" + the_to +"&subject_str=" + the_subj + "&text_str=" + the_msg; // the post string
sendRequest(url,dummy,postData) ;
return true;
} // end function send it()
function dummy() {
window.close();
}
function ender() {
$('sending').style.display = 'none';
<?php
print "\n\t\t\t\t\t";
print (get_variable('call_board')==1)? "document.add_cont_form.submit();\n" : "window.close();\n";
?>
} // end function ender()
function do_send_it () {
if (send_it(document.add_mail_form.frm_to.value, document.add_mail_form.frm_text.value )) {