-
Notifications
You must be signed in to change notification settings - Fork 0
/
banner.php
1323 lines (1185 loc) · 53 KB
/
banner.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
/*
5/25/11 initial release
7/2/11 corrections to include filled data as hiddens
7/3/11 added 2 fields to schema
7/30/11 table renamed
5/22/13 Totally revised for google maps API V3
*/
if ( !defined( 'E_DEPRECATED' ) ) { define( 'E_DEPRECATED',8192 );} // 11/8/09
error_reporting (E_ALL ^ E_DEPRECATED);
require_once('incs/functions.inc.php');
$tablename = "{$GLOBALS['mysql_prefix']}mmarkup"; // 7/30/11
@session_start();
session_write_close();
do_login(basename(__FILE__));
extract ($_POST);
$_type = "t"; // text/banner
$by = empty($_SESSION)? 0: $_SESSION['user_id'];
$from = $_SERVER['REMOTE_ADDR'];
$now = mysql_format_date(time() - (intval(get_variable('delta_mins')*60))); // 6/20/10
if (array_key_exists("id", $_POST) && (!(empty($_POST['id'])))) {
$query = "SELECT *, UNIX_TIMESTAMP(_on) AS `_on` FROM `{$tablename}` WHERE `id` = {$_POST['id']}"; // 1/27/09
$result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(),basename( __FILE__), __LINE__);
if (mysql_num_rows ($result) > 0) {
$row = stripslashes_deep(mysql_fetch_assoc($result));
extract ($row);
$points_ary = array();
$points = explode (";", $line_data);
for ($i = 0; $i<count($points); $i++) {
array_push($points_ary, $points[$i]);
}
}
}
?>
<!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 Banner 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="12/15/10 3:55"> <!-- 7/7/09 -->
<LINK REL=StyleSheet HREF="stylesheet.php?version=<?php print time();?>" TYPE="text/css">
<STYLE>
/* comment */
A:hover {text-decoration: underline; color: red;}
TH:hover {text-decoration: underline; color: red;}
td.mylink:hover {background-color: rgb(255, 255, 255); }
INPUT.button {background-color: rgb(255, 255, 255); }
input.text:focus, textarea:focus {background-color: lightyellow; color:black;}
tr {height: 30px; }
tr.front {height: 18px; }
.style1 {background-color:transparent;font-weight:bold;border:0px black solid;white-space:nowrap; font-size : 1.5em; font-family:"arial"; opacity: 0.75; font-style:italic}
</STYLE>
<SCRIPT SRC="./js/jscolor/jscolor.js" type="application/x-javascript"></SCRIPT>
<?php
if ($_SESSION['internet']) {
$api_key = get_variable('gmaps_api_key');
$key_str = (strlen($api_key) == 39)? "key={$api_key}&" : false;
if($key_str) {
if($https) {
?>
<script src="https://maps.google.com/maps/api/js?<?php print $key_str;?>"></script>
<script src="./js/Google.js"></script>
<?php
} else {
?>
<script src="http://maps.google.com/maps/api/js?<?php print $key_str;?>"></script>
<script src="./js/Google.js"></script>
<?php
}
}
}
?>
<SCRIPT SRC="./js/usng.js" TYPE="application/x-javascript"></SCRIPT> <!-- 8/23/08 -->
<SCRIPT SRC="./js/lat_lng.js" TYPE="application/x-javascript"></SCRIPT> <!-- 11/8/11 -->
<SCRIPT SRC="./js/geotools2.js" TYPE="application/x-javascript"></SCRIPT> <!-- 11/8/11 -->
<SCRIPT SRC="./js/osgb.js" TYPE="application/x-javascript"></SCRIPT> <!-- 11/8/11 -->
<SCRIPT SRC='./js/graticule_V3.js' type='application/x-javascript'></SCRIPT>
<SCRIPT SRC='./js/misc_function.js' type='application/x-javascript'></SCRIPT> <!-- 4/14/10 -->
<SCRIPT SRC="./js/domready.js" TYPE="application/x-javascript" ></script>
<SCRIPT SRC="./js/gmaps_v3_init.js" TYPE="application/x-javascript" ></script>
<SCRIPT src = "./js/elabel_v3.js"></SCRIPT>
<SCRIPT>
var map; // note global
var comma = ",";
var semic = ";";
var label;
function $() { // 12/20/08
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 hex_OK (instr) {
return (/^(#[A-F0-9]{6})$/i.test(instr));
}
function add_hash(in_str) { // prepend # if absent
return (in_str.substr(0,1)=="#")? in_str : "#" + in_str;
}
function do_checked(theForm) {
$('fill_tr').style.display = '';
theForm.frm_filled.value = 1;
theForm.frm_filled_n.checked = false;
theForm.frm_filled_y.checked = true;
}
function do_un_checked(theForm) {
$('fill_tr').style.display = "none"; // hide input row
theForm.frm_filled.value = 0;
theForm.frm_filled_n.checked = true;
theForm.frm_filled_y.checked = false;
}
function drawCircle(lat, lng, radius, strokeColor, strokeWidth, strokeOpacity, fillColor, fillOpacity) {
var d2r = Math.PI/180;
var r2d = 180/Math.PI;
var Clat = radius * 0.014483;
var Clng = Clat/Math.cos(lat * d2r);
var Cpoints = [];
for (var i=0; i < 33; i++) {
var theta = Math.PI * (i/16);
Cy = lat + (Clat * Math.sin(theta));
Cx = lng + (Clng * Math.cos(theta));
var P = new google.maps.LatLng(Cy,Cx);
Cpoints.push(P);
}
if (draw_circle != null) {
draw_circle.setMap(null);
}
draw_circle = new google.maps.Circle({
center: new google.maps.LatLng(lat,lng),
map: map,
fillColor: fillColor,
fillOpacity: fillOpacity,
strokeColor: strokeColor,
strokeOpacity: strokeOpacity,
strokeWeight: strokeWidth,
editable: true
});
draw_circle.setRadius(radius*5000);
google.maps.event.addListener(draw_circle, 'radius_changed', function() {
new_radius = draw_circle.getRadius()/5000;
document.c.circ_radius.value = new_radius;
});
google.maps.event.addListener(draw_circle, 'center_changed', function() {
new_center = draw_circle.getCenter();
var temp = document.c.frm_line_data.value.split(semic, 2);
document.c.frm_line_data.value = new_center.lat().toFixed(6) + comma + new_center.lng().toFixed(6) + semic + temp[1] ;
});
draw_circle.setMap(map);
}
function drawBanner(point, html, text, font_size, color, name) { // Create the banner
var invisibleIcon = new google.maps.MarkerImage("./markers/markerTransparent.png");
map.setCenter(point, 8);
var the_color = (typeof color == 'undefined')? "#000000" : color ; // default to black
if (label != null) {
label.setMap(null);
}
label = new ELabel({
latlng: point,
label: html,
offset: new google.maps.Size(-8, 4),
opacity: 100,
theSize: font_size + "px",
theColor:add_hash(the_color),
overlap: true,
clicktarget: false
});
label.setMap(map);
var marker = new google.maps.Marker(point,invisibleIcon); // Create an invisible google.maps.Marker
marker.setMap(map);
} // end function draw Banner()
function JSfnCheckInput(myform, mybutton, test) { // reject empty form elements
var errmsg = "";
if (myform.frm_name.value.trim()=="") {errmsg+= "\tDescription is required\n";}
if (myform.frm_ident.value.trim()=="") {errmsg+= "\tIdent is required\n";}
if (myform.frm_line_cat_id.value ==0) {errmsg+= "\tCategory selection is required\n";}
var temp = myform.frm_line_data.value.split(",", 2);
if (!(temp.length == 2)) {errmsg+= "\tMap center is required\n";}
if (myform.frm_line_color.value.trim()=="") {errmsg+= "\tColor is required\n";}
if (myform.frm_line_width.value.trim()=="") {errmsg+= "\tWidth is required\n";}
if (myform.circ_radius.value.trim()=="") {errmsg+= "\tBanner text is required\n";};
if (!((myform.box_use_with_bm.checked) ||
(myform.box_use_with_r.checked) ||
(myform.box_use_with_f.checked) ||
(myform.box_use_with_u_ex.checked) ||
(myform.box_use_with_u_rf.checked) )) {errmsg+= "\tAt least one 'Apply to ...' is required\n";}
if (errmsg!="") {
$(mybutton).disabled = false;
alert ("Please correct the following and re-submit:\n\n" + errmsg);
return false;
}
else { // test?
if (!(typeof test == 'undefined' )) { // display for review/approval
return;
}
myform.frm_use_with_bm.value=(myform.box_use_with_bm.checked)? 1: 0;
myform.frm_use_with_r.value=(myform.box_use_with_r.checked)? 1: 0;
myform.frm_use_with_f.value=(myform.box_use_with_f.checked)? 1: 0;
myform.frm_use_with_u_ex.value=(myform.box_use_with_u_ex.checked)? 1: 0;
myform.frm_use_with_u_rf.value=(myform.box_use_with_u_rf.checked)? 1: 0;
var comma = ",";
var semic = ";";
var temp = myform.frm_line_data.value.split(semic, 2);
myform.frm_line_data.value = temp[0] + semic + myform.circ_radius.value.trim();
myform.submit();
} // end if/else errormsg
} // end function JSfn CheckInput
<?php
if (!(empty($_POST))) {
?>
function do_display(the_type) {
switch (the_type) {
case "p": // poly
points.length = 0;
for (i = 0; i < markers.length; i++) {
points.push(markers[i].getLatLng());
}
theForm = (document.u)? document.u : document.c ;
if (theForm.frm_filled.value == 1) { // Polygon mode - filled
points.push(markers[0].getLatLng());
poly = new google.maps.Polygon({
paths: points,
strokeColor: "#ff0000",
strokeOpacity: .9,
strokeWeight: 2,
fillColor: "#ff0000",
fillOpacity: .2
});
}
else { // Polyline mode - not filled
var poly = new google.maps.Polygon({
paths: points,
strokeColor: "#ff0000",
strokeOpacity: .9,
strokeWeight: 2
});
var length = poly.getLength()/1000;
}
polyline.setMap(map);
break; // end poly
case "c": // circle
theForm = (document.u)? document.u : document.c ;
var temp = theForm.frm_line_data.value;
var temp = theForm.frm_line_data.value.split(semic);
var coords = temp[0].split(comma);
var lat = parseFloat(coords[0]);
var lng = parseFloat(coords[1]);
var radius = parseFloat(theForm.circ_radius.value);
strokeColor = theForm.frm_line_color.value;
strokeWidth = parseInt(theForm.frm_line_width.value);
strokeOpacity = parseFloat(theForm.frm_line_opacity.value);
fillColor = (theForm.frm_filled.value = 0)? 0: theForm.frm_fill_color.value;
fillOpacity = (theForm.frm_filled.value = 0)? 0: parseFloat(theForm.frm_fill_opacity.value);
drawCircle(lat, lng, radius, add_hash(strokeColor), strokeWidth, strokeOpacity, add_hash(fillColor), fillOpacity); // 324
break;
case "t": // text
var theForm = (document.c)? document.c : document.u ;
var html = text = theForm.circ_radius.value.trim();
var temp = theForm.frm_line_data.value.trim().split(semic, 2);
var coords = temp[0].split(comma);
var thepoint = new google.maps.LatLng(coords[0], coords[1]); // for each ticket
drawBanner(thepoint,html,text, theForm.frm_line_width.value.trim(), theForm.frm_line_color.value.trim() ) ; // (point, html, text, font_size, color)
break;
} // end switch()
} // end function do_display()
<?php
} // end if (!(empty($_POST)))
?>
var map, poly; // Global variables
var count = 0;
var points = new Array();
var markers = new Array();
var icon_url ="./markers/";
function to_string (in_array) {
var sep = ""; // separator
var out_str = "";
for (i=0;i<in_array.length;i++) {
temp = in_array[i].join(","); // comma-separate the coords
out_str += (sep + temp);
sep="\t"; // tab-separate the points
}
}
function leftClick(point) {
var icon = "./our_icons/sm_red.png"; // green
// Make markers draggable
var marker = new google.maps.Marker({
position:point,
icon:icon,
draggable: true,
bouncy:false,
dragCrossMove:true
});
marker.setMap(map);
}
function toggleMode() {
if(markers.length > 1) drawOverlay();
}
function drawOverlay(){ // edit function - input is markers array
var lineMode = true; // Check mode
if (poly) { map.removeOverlay(poly); }
points.length = 0;
for (i = 0; i < markers.length; i++) {
points.push(markers[i].getLatLng());
}
if (lineMode) { // Polyline mode
poly = new google.maps.Polygon({
paths: points,
strokeColor: "#ff0000",
strokeOpacity: .9,
strokeWeight: 2
});
var length = poly.getLength()/1000;
var unit = " km";
}
else { // Polygon mode
points.push(markers[0].getLatLng());
poly = new google.maps.Polygon({
paths: points,
strokeColor: "#ff0000",
strokeOpacity: .9,
strokeWeight: 2,
fillColor: "#ff0000",
fillOpacity: .2
});
}
poly.setMap(map);
}
function clearMap() { // Clear current map and reset globals
label.setMap(null);
marker.setMap(null);
points.length = 0;
markers.length = 0;
count = 0;
}
function to_view(id) { // invoke switch case 'u' for selected id
document.to_view_form.id.value = id;
document.to_view_form.submit();
}
function buildMap_l() { // 'list' version
var container = document.getElementById("map");
var myLatlng = new google.maps.LatLng(<?php print get_variable('def_lat');?>, <?php print get_variable('def_lng');?>);
var mapOptions = {
zoom: <?php print get_variable('def_zoom');?>,
center: myLatlng,
panControl: true,
zoomControl: true,
scaleControl: true,
mapTypeId: google.maps.MapTypeId.<?php echo get_maptype_str(); ?>
}
var map = new google.maps.Map($('map_canvas'), mapOptions); // 481
var bounds = new google.maps.LatLngBounds(); // Initialize bounds for the map
var points = new Array();
<?php
$query = "SELECT * FROM `{$tablename}` WHERE `line_type` = 'c'";
$result = mysql_query($query)or do_error($query,$query, mysql_error(), basename(__FILE__), __LINE__);
$empty = TRUE;
//
while ($row = stripslashes_deep(mysql_fetch_assoc($result))){
$empty = FALSE;
extract ($row);
$name = $row['line_name'];
$use_w_bm = ($use_with_bm==1) ? "CHECKED" : ""; // checkbox settings
$use_w_r = ($use_with_r==1) ? "CHECKED" : "";
$use_w_f = ($use_with_f==1) ? "CHECKED" : "";
$use_w_u_ex = ($use_with_u_ex==1) ? "CHECKED" : "";
$use_w_u_ex = ($use_with_u_rf==1) ? "CHECKED" : "";
switch ($row['line_type']) {
case "p": // poly
$points = explode (";", $line_data);
echo "\n\tvar points = new Array();\n";
for ($i = 0; $i<count($points); $i++) {
$coords = explode (",", $points[$i]);
?>
var thepoint = new google.maps.LatLng(parseFloat({$coords[0]}) , parseFloat({$coords[1]}));
bounds.extend(thepoint);
points.push(thepoint);
<?php } // end for ($i = 0 ... )
if ((intval($filled) == 1) && (count($points) > 2)) {?>
var polyline = new google.maps.Polygon({
paths: points,
strokeColor: add_hash("<?php print $line_color;?>"),
strokeOpacity: <?php print $line_opacity;?>,
strokeWeight: <?php print $line_width;?>,
fillColor: add_hash("<?php print $fill_color;?>"),
fillOpacity: <?php print $fill_opacity;?>
});
<?php } else {?>
var polyline = new google.maps.Polygon({
paths: points,
strokeColor: add_hash("<?php print $line_color;?>"),
strokeOpacity: <?php print $line_opacity;?>,
strokeWeight: <?php print $line_width;?>
});
<?php } ?>
map.addOverlay(polyline);
<?php
break;
case "c": // circle
// dump($row);
$temp = explode (";", $line_data);
$radius = $temp[1];
$coords = explode (",", $temp[0]);
$lat = $coords[0];
$lng = $coords[1];
echo "\n drawCircle({$lat}, {$lng}, {$radius}, add_hash('{$line_color}'), {$line_width}, {$line_opacity}, add_hash('{$fill_color}'), {$fill_opacity}); // 472\n";
?>
// alert(<?php echo __LINE__;?>);
<?php
break;
case "t": // banner
// dump($row);
$temp = explode (";", $line_data);
$banner = $temp[1];
$coords = explode (",", $temp[0]);
echo "\n var point = new google.maps.LatLng(parseFloat({$coords[0]}) , parseFloat({$coords[1]}));\n";
$the_banner = htmlentities($banner, ENT_QUOTES);
$the_width = intval( trim($line_width), 10); // font size
echo "\n drawBanner( point, '{$the_banner}', '{$the_banner}', {$the_width}, add_hash('{$line_color}'));\n";
break;
} // end switch
} // end while ()
unset($query, $result);
?>
map.setCenter(new google.maps.LatLng(<?php echo get_variable('def_lat'); ?>, <?php echo get_variable('def_lng'); ?>), <?php echo (get_variable('def_zoom')-4); ?>);
// map.addControl(new GLargeMapControl3D()); // Zoom control
// map.addMapType(G_PHYSICAL_MAP);
// var hierarchy = new GHierarchicalMapTypeControl(); // Create a hierarchical map type control
// hierarchy.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Labels", true); // make Hybrid the Satellite default
// map.addControl(hierarchy); // add the control to the map
// map.addControl(new GScaleControl()); // Scale bar
} // end function buildMap_l()
<?php
$func = (has_admin())? "u": "r";
?>
function to_p(the_id) { // poly
document.navform.id.value = the_id;
document.navform._func.value = "<?php echo $func;?>";
document.navform.action = "<?php echo basename(__FILE__);?>";
document.navform.submit();
}
function to_c(the_id) { // circle
document.navform.id.value = the_id;
document.navform._func.value = "<?php echo $func;?>";
document.navform.action = "circle.php";
document.navform.submit();
}
function to_t(the_id) { // text/banner
document.navform.id.value = the_id;
document.navform._func.value = "<?php echo $func;?>";
document.navform.action = "banner.php";
document.navform.submit();
}
function to_k(the_id) { // kml
document.navform.id.value = the_id;
document.navform._func.value = "<?php echo $func;?>";
document.navform.action = "kml.php";
document.navform.submit();
}
</SCRIPT>
</HEAD>
<?php
switch ($_POST["_func"]) {
case "l": // list
?>
<BODY onLoad = "buildMap_l()" > <!-- <?php echo basename(__FILE__); ?> -->
<SCRIPT TYPE='application/x-javascript' src='./js/wz_tooltip.js'></SCRIPT>
<TABLE ID = 'outer' ALIGN='center' BORDER = 0 STYLE = 'margin-left:20px;margin-top:20px;'>
<TR CLASS='even'><TH colspan=2>Lines and Boundaries</TH></TR>
<TR VALIGN='top'><TD>
<TABLE ALIGN='center' ID = 'sidebar_tbl'>
<?php
$line_types = array("p" => "Poly", "c" =>"Circle", "t" =>"Banner");
$query = "SELECT *, UNIX_TIMESTAMP(_on) AS `_on` FROM `{$tablename}` WHERE `line_type` = 'c'"; // 1/27/09
$result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(),basename( __FILE__), __LINE__);
if (mysql_num_rows($result)==0) {
print "<TR CLASS = 'odd'><TH COLSPAN=99>No data</TH></TR>\n";
}
else {
print "<TR STYLE = 'height:8px;'><TD COLSPAN=99 ALIGN='center'><I>Click to view/edit</I></TD></TR>";
print "<TR CLASS = 'odd' STYLE = 'height:16px;'><TD ALIGN='left'><B> Name</B></TD>
<TD><B>Type </B></TD>
<TD><B> Visible </B></TD>
<TD onmouseout=\"UnTip()\" onmouseover=\"Tip('Apply to base map');\"><B> BM </B></TD>
<TD onmouseout=\"UnTip()\" onmouseover=\"Tip('Apply to regions');\"><B> R </B></TD>
<TD onmouseout=\"UnTip()\" onmouseover=\"Tip('Apply to facilities');\"><B> F </B></TD>
<TD onmouseout=\"UnTip()\" onmouseover=\"Tip('Apply to units - Exclusion zone');\"><B> EX </B></TD>
<TD onmouseout=\"UnTip()\" onmouseover=\"Tip('Apply to units - Ringfence');\"><B> RF </B></TD>
<TD><B> As of</B></TD></TR>\n";
$i = 0;
$targets = array( "p" =>"to_p", "c" => "to_c", "t" => "to_t", "k" => "to_k");
while($row = stripslashes_deep(mysql_fetch_assoc($result))) {
extract ($row);
$visible = (intval($row['line_status'])==0)? "<IMG SRC = './markers/checked.png' BORDER=0 />" : "";
$to_func = "{$targets[$row['line_type']]}({$row['id']})";
print "<TR CLASS = '{$evenodd[$i%2]} front ' onClick = '{$to_func}'>
<TD ALIGN='left'>{$row['line_name']} </TD>
<TD ALIGN='left'>{$line_types[$row['line_type']]}</TD>
<TD ALIGN='center'>{$visible}</TD>
<TD ALIGN='center'>{$use_with_bm}</TD>
<TD ALIGN='center'>{$use_with_r}</TD>
<TD ALIGN='center'>{$use_with_f}</TD>
<TD ALIGN='center'>{$use_with_u_ex}</TD>
<TD ALIGN='center'>{$use_with_u_rf}</TD>
<TD ALIGN='right'> " . format_date($row['_on']) . "</TD></TR>\n";
$i++;
}
} // end if/else (mysql_num_rows($result)==0)
?>
<TR CLASS = 'odd'><TD COLSPAN=99 ALIGN='center' STYLE = 'white-space:nowrap;'><BR />
<INPUT TYPE="button" VALUE="Add new =>" >
<INPUT TYPE = 'button' VALUE = "Polygon" onClick = "document.new_form._type.value='p'; document.new_form.submit();"/>
<INPUT TYPE = 'button' VALUE = "Circle" onClick = "location.href='circle.php'"/>
<INPUT TYPE = 'button' VALUE = "Banner" onClick = "location.href='banner.php'"/>
</TD>
</TR></TABLE>
</TD>
<TD ID = 'map_td'>
<DIV id="map" STYLE = "margin-left:8px; width:<?php print get_variable('map_width');?>px; height:<?php print get_variable('map_height');?>px;" ></DIV>
</TD>
</TR></TABLE>
<FORM NAME = 'new_form' METHOD = 'post' ACTION = '<?php print basename(__FILE__);?>'>
<INPUT TYPE= 'hidden' NAME = '_func' VALUE = 'c'>
<INPUT TYPE= 'hidden' NAME = '_type' VALUE = ''>
</FORM>
<FORM NAME = 'to_view_form' METHOD = 'post' ACTION = '<?php print basename(__FILE__);?>'>
<INPUT TYPE= 'hidden' NAME = '_func' VALUE = 'r'>
<INPUT TYPE= 'hidden' NAME = 'id' VALUE = ''>
</FORM>
<?php
break;
case "c": // create
?>
<SCRIPT>
var icon_file = {
url: "./markers/yellow.png",
size: new google.maps.Size(16, 28),
origin: new google.maps.Point(0,0),
anchor: new google.maps.Point(8, 28)
};
var shadow = {
url: "./markers/sm_shadow.png",
size: new google.maps.Size(22, 20),
origin: new google.maps.Point(0,0),
anchor: new google.maps.Point(8, 28)
};
function call_back (in_obj){ // callback function - from gmaps_v3_init()
// do_lat(parseFloat(in_obj.lat)); // set form values
// do_lng(parseFloat(in_obj.lng));
// do_ngs();
}
// 2114 - Add/Edit common
var map = gmaps_v3_init(call_back, 'map_canvas',
<?php echo get_variable('def_lat');?>,
<?php echo get_variable('def_lng');?>,
<?php echo get_variable('def_zoom');?>,
icon_file,
<?php echo get_variable('maptype');?>,
false);
function buildMap_c() { // 'create' version
var container = document.getElementById("map_canvas");
var myLatlng = new google.maps.LatLng(<?php print get_variable('def_lat');?>, <?php print get_variable('def_lng');?>);
var mapOptions = {
zoom: <?php print get_variable('def_zoom');?>,
center: myLatlng,
panControl: true,
zoomControl: true,
scaleControl: true,
mapTypeId: google.maps.MapTypeId.<?php echo get_maptype_str(); ?>
}
map = new google.maps.Map($('map_canvas'), mapOptions); // 481
map.setCenter(new google.maps.LatLng(<?php echo get_variable('def_lat'); ?>, <?php echo get_variable('def_lng'); ?>), <?php echo get_variable('def_zoom'); ?>);
var bounds = new google.maps.LatLngBounds(); // Initialize bounds for the map
google.maps.event.addListener(map, 'click', function(event) {
var thePos = event.latLng;
var thelat = thePos.lat().toFixed(6);
var thelng = thePos.lng().toFixed(6);
var the_banner = document.c.circ_radius.value.trim();
var thecolor = document.c.frm_line_color.value;
var thewidth = document.c.frm_line_width.value;
if (thePos) {
var the_line_data = thelat + ", " + thelng;
document.c.frm_line_data.value = the_line_data;
drawBanner(thePos, the_banner, the_banner, thewidth, add_hash(thecolor));
} // end if (thePos)
else {
alert(<?php echo __LINE__;?>);
}
}); // end GEvent.add Listener()
} // end function buildMap_c()
function do_checked(the_Form) {
the_Form.frm_filled.value = 1;
the_Form.frm_filled_n.checked = false;
the_Form.frm_filled_y.checked = true;
}
function do_un_checked(the_Form) {
try {
the_Form.frm_filled.value = 0; // undefined for c and t
the_Form.frm_filled_n.checked = true;
the_Form.frm_filled_y.checked = false;
}
catch(err) {
// disregard
}
}
</SCRIPT>
<BODY onLoad = "buildMap_c();" >
<?php
print (array_key_exists("caption", $_POST))? "<H3>{$_POST['caption']}</H3>" : "";
$type_ary = array( "p" =>"Polygon", "c" => "Circle", "t" => "Banner", "k" => "kml");
$capt_ary = array( "p" =>"click map - drag icons", "c" => "Click map and enter form values", "t" => "Click map and enter form values", "k" => "kml");
$line_ary = array( "p" =>"Line", "c" =>"Circle", "t" =>"Text", "k" => "kml");
$query = "SELECT * FROM `$GLOBALS[mysql_prefix]mmarkup_cats` ORDER BY `category` ASC";
$result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(),basename( __FILE__), __LINE__);
$cats_sel = "<SELECT NAME = 'frm_cat_list' onChange = 'this.form.frm_line_cat_id.value = this.options[this.selectedIndex].value;'>\n";
$cats_sel .= "<OPTION VALUE=0 SELECTED >Select</OPTION>\n";
while ($row = mysql_fetch_assoc($result)) {
$cats_sel .= "<OPTION VALUE=\"{$row['id']}\">" . shorten($row['category'], 30) . "</OPTION>\n";
}
$cats_sel .= "</SELECT>\n";
?>
<FORM NAME="c" METHOD="post" ACTION="<?php print basename(__FILE__); ?>">
<TABLE BORDER="0" ALIGN="center" ID = 'outer' STYLE = 'margin-left:20px;margin-top:20px;'><TR VALIGN='top'><TD>
<TABLE BORDER="0" ALIGN="center">
<TR CLASS="even" VALIGN="top" >
<TD COLSPAN="2" ALIGN="CENTER"><FONT SIZE="+1">New <?php echo $type_ary[$_type];?></FONT><BR /><BR />
<FONT SIZE = 'normal'><EM><?php echo $capt_ary[$_type];?></EM></FONT></TD>
</TR>
<TR CLASS="odd" VALIGN="top" >
<TD COLSPAN="2" ALIGN="CENTER"> </TD>
</TR>
<TR VALIGN="baseline" CLASS="odd">
<TD CLASS="td_label" ALIGN="left">Description:</TD>
<TD><INPUT MAXLENGTH="32" SIZE="32" type="text" NAME="frm_name" VALUE="" onChange = "this.value.trim();" />
<SPAN STYLE = 'margin-left:20px' CLASS="td_label" >Visible » </SPAN>
<SPAN STYLE = 'margin-left:10px'>Yes » <INPUT TYPE='radio' NAME = 'rb_line_is_vis' onClick = "document.c.rb_line_not_vis.checked = false;document.c.frm_line_status.value=0" CHECKED /></SPAN>
<SPAN STYLE = 'margin-left:20px'>No » <INPUT TYPE='radio' NAME = 'rb_line_not_vis' onClick = "document.c.rb_line_is_vis.checked = false;document.c.frm_line_status.value=1" /></SPAN>
</TD></TR>
<TR VALIGN="baseline" CLASS="even">
<TD CLASS="td_label" ALIGN="left">Ident:</TD>
<TD ALIGN="left"><INPUT MAXLENGTH="10" SIZE="10" type="text" NAME="frm_ident" VALUE="" onChange = "this.value.trim();" />
<SPAN STYLE = 'margin-left:20px' CLASS="td_label">Category: » </SPAN><?php echo $cats_sel;?></TD>
</TR>
<TR VALIGN="baseline" CLASS="odd"><TD CLASS="td_label" ALIGN="left">Apply to:</TD>
<TD ALIGN='left' CLASS="td_label" STYLE = 'white-space:nowrap;' >
<SPAN STYLE="margin-left: 20px;border:1px; width:20%">Base Map » <INPUT TYPE= "checkbox" NAME="box_use_with_bm" onClick = "this.form.frm_use_with_bm.value=1"/></SPAN>
<SPAN STYLE="border:1px; width:20%"> <?php print get_text("Regions");?> » <INPUT TYPE= "checkbox" NAME="box_use_with_r" onClick = "this.form.frm_use_with_r.value=1"/></SPAN>
<SPAN STYLE="border:1px; width:20%"> Facilities » <INPUT TYPE= "checkbox" NAME="box_use_with_f" onClick = "this.form.frm_use_with_f.value=1"/></SPAN>
<SPAN STYLE="border:1px; width:20%"> Unit Exclusion Zone » <INPUT TYPE= "checkbox" NAME="box_use_with_u_ex" onClick = "this.form.frm_use_with_u_ex.value=1"/></SPAN>
<SPAN STYLE="border:1px; width:20%"> Unit Ringfence » <INPUT TYPE= "checkbox" NAME="box_use_with_u_rf" onClick = "this.form.frm_use_with_u_rf.value=1"/></SPAN>
</TD>
</TR>
<TR VALIGN="baseline" CLASS="even"><TD CLASS="td_label" ALIGN="left"><?php echo $line_ary[$_type];?>:</TD>
<TD ALIGN="left"><SPAN CLASS="td_label" STYLE= "margin-left:20px" >
Color » <INPUT MAXLENGTH="8" SIZE="8" type="text" NAME="frm_line_color" VALUE="#FF0000" class="color" />
<!-- Opacity » <INPUT MAXLENGTH=3 SIZE=3 TYPE= "text" NAME="frm_line_opacity" VALUE="0.5" /> -->
Size » <INPUT MAXLENGTH=2 SIZE=2 TYPE= "text" NAME="frm_line_width" VALUE="16" /> (px)
</SPAN></TD>
</TR>
<TR VALIGN="baseline" CLASS="odd" ID = 'fill_cb_tr' >
<TD CLASS="td_label" ALIGN="left">Banner text: </TD>
<TD ALIGN="left"><INPUT NAME = 'circ_radius' VALUE= '' TYPE = 'text' SIZE = 64 MAXLENGTH = 64 />
</TD>
</TR>
<TR VALIGN="baseline" CLASS="even" ID = 'fill_tr' STYLE = 'display:none' >
<TD CLASS="td_label" ALIGN="left">Fill:</TD>
<TD ALIGN="left"><SPAN CLASS="td_label" STYLE= "margin-left:20px" >
Color » <INPUT MAXLENGTH="8" SIZE="8" type="text" NAME="frm_fill_color" VALUE="#FF0000" class="color" />
Opacity » <INPUT MAXLENGTH=3 SIZE=3 TYPE= "text" NAME="frm_fill_opacity" VALUE="0.5" />
</SPAN>
</TD>
</TR>
<TR VALIGN="baseline"CLASS="odd"><TD COLSPAN="2" ALIGN="center" STYLE = 'white-space:nowrap;'>
<INPUT TYPE='hidden' NAME = '_func' VALUE='cp' />
<INPUT TYPE='hidden' NAME = 'frm_line_status' VALUE='0' />
<INPUT TYPE='hidden' NAME = 'frm_line_cat_id' VALUE='0' />
<INPUT TYPE='hidden' NAME = 'frm_line_type' VALUE='<?php echo $_type;?>' />
<INPUT TYPE='hidden' NAME = 'frm_line_data' VALUE='' />
<INPUT TYPE='hidden' NAME = 'frm_filled' VALUE='0' />
<INPUT TYPE='hidden' NAME = 'frm_use_with_bm' VALUE='0' />
<INPUT TYPE='hidden' NAME = 'frm_use_with_r' VALUE='0' />
<INPUT TYPE='hidden' NAME = 'frm_use_with_f' VALUE='0' />
<INPUT TYPE='hidden' NAME = 'frm_use_with_u_ex' VALUE='0' />
<INPUT TYPE='hidden' NAME = 'frm_use_with_u_rf' VALUE='0' />
<INPUT TYPE="button" VALUE="Cancel" STYLE = 'width:auto;' onClick = "document.canform.submit();"/>
<INPUT TYPE="button" VALUE="Reset" STYLE = 'width:auto; margin-left:40px;' onClick = "do_un_checked();this.form.reset(); clearMap();buildMap_c();"/>
<INPUT TYPE="button" NAME="sub_but" VALUE="Next" STYLE = 'width:120px; margin-left:40px;' onclick="this.disabled=true; JSfnCheckInput(this.form, this);"/>
<INPUT TYPE="button" VALUE="Test" onClick = "JSfnCheckInput(this.form, this, true);" STYLE = 'margin-left:20px' />
</TD></TR>
<TR><TD COLSPAN=3> </TD></TR>
</FORM>
</TD></TR></TABLE>
</TD><TD>
<DIV id="map_canvas" STYLE = "margin-left:8px; width:<?php print get_variable('map_width');?>px; height:<?php print get_variable('map_height');?>px;" ></DIV>
</TD></TR></TABLE>
<CENTER>
<?php
break; // end case "c"
case "cp": // 'create' process
// dump($_POST);
$filled = (trim($_POST['frm_line_type']) == "t")? "NULL" : quote_smart(trim($_POST['frm_filled'])) ;
$fill_color = (trim($_POST['frm_line_type']) == "t")? "NULL" : quote_smart(trim($_POST['frm_fill_color'])) ;
$fill_opacity = (trim($_POST['frm_line_type']) == "t")? "NULL" : quote_smart(trim($_POST['frm_fill_opacity'])) ;
// dump($fill_opacity);
$query = "INSERT INTO `{$tablename}` (`line_name`, `line_ident`, `line_cat_id`, `line_status`, `line_type`, `line_data`, `use_with_bm`, `use_with_r`, `use_with_f`, `use_with_u_ex`, `use_with_u_rf`, `line_color`, `line_opacity`, `filled`, `fill_color`, `fill_opacity`,`line_width`,
`_by`, `_from`, `_on`)
VALUES (" .
quote_smart(trim($_POST['frm_name'])) ."," .
quote_smart(trim($_POST['frm_ident'])) ."," .
quote_smart(trim($_POST['frm_line_cat_id'])) ."," .
quote_smart(trim($_POST['frm_line_status'])) ."," .
quote_smart(trim($_POST['frm_line_type'])) ."," .
quote_smart(trim($_POST['frm_line_data'])) ."," .
quote_smart(trim($_POST['frm_use_with_bm'])) ."," .
quote_smart(trim($_POST['frm_use_with_r'])) ."," .
quote_smart(trim($_POST['frm_use_with_f'])) ."," .
quote_smart(trim($_POST['frm_use_with_u_ex'])) ."," .
quote_smart(trim($_POST['frm_use_with_u_rf'])) ."," .
quote_smart(trim($_POST['frm_line_color'])) ."," .
"NULL," .
$filled ."," .
$fill_color ."," .
$fill_opacity ."," .
quote_smart(trim($_POST['frm_line_width'])) ."," .
quote_smart($by) ."," .
quote_smart($from) ."," .
quote_smart(trim($now)) . ")" ;
snap(__LINE__, $query);
$result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(),basename( __FILE__), __LINE__);
$insert_id = mysql_insert_id();
// $where = basename(__FILE__);
// header("Location:{$where}");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML><HEAD><TITLE><?php echo basename(__FILE__);?></TITLE></HEAD>
<BODY onload = 'document.dummy.submit();'>
<FORM NAME='dummy' METHOD = 'post' ACTION = '<?php echo basename(__FILE__);?>'>
<INPUT TYPE = 'hidden' NAME = '_func' VALUE = 'r' />
<INPUT TYPE = 'hidden' NAME = 'id' VALUE = '<?php echo $insert_id;?>' />
</FORM></BODY></HTML>
<?php
break; // end case "cp"
case "u":
case "r": // similar - use common structure
$dis = ($_func == "r") ? "DISABLED" : "";
$capt = ($_func == "r") ? "" : "Revise";
?>
<SCRIPT>
function do_delete(id_val) {
if (confirm("Really, really DELETE this boundary?")) {
document.navform._func.value="dp";
document.navform.id.value=id_val;
document.navform.submit();
}
else {
return false;
}
} // end function do delete()
function add_marker( point) {
semic = ";"; // separator
count++;
var marker = new google.maps.Marker({
position:point,
icon:base_icon,
draggable:true,
bouncy:false,
dragCrossMove:true,
title: "Point " + count,
map: map
});
marker.setMap(map);
marker.content = count;
markers.push(marker);
google.maps.event.addListener(marker, "drag", function() {
});
google.maps.event.addListener(marker, "click", function() {
for(var n = 0; n < markers.length; n++) { // Find out which marker to remove
if(markers[n] == marker) {
markers[n].setMap(null)
break;
}
}
markers.splice(n, 1); // Shorten array of markers and adjust counter
if(markers.length == 0) {
count = 0;
}
else {
count = markers[markers.length-1].content;
markers[n].setMap(map)
}
});
drawOverlay();
} // end function add marker()
function buildMap_r() { // 'view' version
var container = document.getElementById("map_canvas");
var myLatlng = new google.maps.LatLng(<?php print get_variable('def_lat');?>, <?php print get_variable('def_lng');?>);
var mapOptions = {
zoom: <?php print get_variable('def_zoom');?>,
center: myLatlng,
panControl: true,
zoomControl: true,
scaleControl: true,
mapTypeId: google.maps.MapTypeId.<?php echo get_maptype_str(); ?>
}
map = new google.maps.Map($('map_canvas'), mapOptions); // 481
map.setCenter(new google.maps.LatLng(<?php echo get_variable('def_lat'); ?>, <?php echo get_variable('def_lng'); ?>), <?php echo get_variable('def_zoom'); ?>);
var bounds = new google.maps.LatLngBounds(); // Initialize bounds for the map
var points = new Array();
<?php
$query = "SELECT * FROM `{$tablename}` WHERE `id`='{$_POST['id']}' LIMIT 1";
$result = mysql_query($query)or do_error($query,$query, mysql_error(), basename(__FILE__), __LINE__);
$row = stripslashes_deep(mysql_fetch_assoc($result));
extract ($row);
$name = $row['line_name'];
$use_w_bm = ($use_with_bm==1) ? "CHECKED" : ""; // checkbox settings
$use_w_r = ($use_with_r==1) ? "CHECKED" : "";
$use_w_f = ($use_with_f==1) ? "CHECKED" : "";
$use_w_u_ex = ($use_with_u_ex==1) ? "CHECKED" : "";
$use_w_u_rf = ($use_with_u_rf==1) ? "CHECKED" : "";
// ___________________________________________________________________________
switch ($row['line_type']) {
case "p": // poly
$points = explode (";", $line_data);
echo "\n\tvar points = new Array();\n";
for ($i = 0; $i<count($points); $i++) {
$coords = explode (",", $points[$i]);
?>
var thepoint = new google.maps.LatLng(parseFloat({$coords[0]}) , parseFloat({$coords[1]}));
bounds.extend(thepoint);
points.push(thepoint);
<?php } // end for ($i = 0 ... )
if ((intval($filled) == 1) && (count($points) > 2)) {?>
var polyline = new google.maps.Polygon({
paths: points,
strokeColor: add_hash("<?php echo $line_color;?>"),
strokeOpacity: <?php echo $line_opacity;?>,
strokeWeight: <?php echo $line_width;?>,
fillColor: add_hash("<?php echo $fill_color;?>"),
fillOpacity: <?php echo $fill_opacity;?>
});
<?php } else {?>
var polyline = new google.maps.Polygon({
paths: points,
strokeColor: add_hash("<?php echo $line_color;?>"),
strokeOpacity: <?php echo $line_opacity;?>,
strokeWeight: <?php echo $line_width;?>
});
<?php
}
?>
polyline.setMap(map);
<?php
break;
case "c": // circle
$temp = explode (";", $line_data);
$radius = $temp[1];
$coords = explode (",", $temp[0]);
$lat = $coords[0];
$lng = $coords[1];
$fill_opacity = (intval($filled) == 0)? 0 : $fill_opacity;
echo "\n drawCircle({$lat}, {$lng}, {$radius}, add_hash('{$line_color}'), {$line_width}, {$line_opacity}, add_hash('{$fill_color}'), {$fill_opacity}); // 934\n";
break;
case "t": // banner
$temp = explode (";", $line_data);
$banner = $temp[1];
$coords = explode (",", $temp[0]);
echo "\n var point = new google.maps.LatLng(parseFloat({$coords[0]}) , parseFloat({$coords[1]}));\n";
$the_banner = htmlentities($banner, ENT_QUOTES);
$the_width = intval( trim($line_width), 10); // font size
echo "\n drawBanner( point, '{$the_banner}', '{$the_banner}', {$the_width}, add_hash('{$line_color}'));\n";
break;
} // end switch
?>
map.setCenter(new google.maps.LatLng(<?php echo $coords[0];?>, <?php echo $coords[1];?>), <?php echo (get_variable('def_zoom')-4); ?>);
google.maps.event.addListener(map, "click", leftClick); // Add click event listener
} // end function buildMap_r()
function fillfields() {
var temp = document.u.frm_line_data.value.trim().split(";", 2);
document.u.circ_radius.value = temp[1].trim();
}
function fillmap() {
<?php
if (isset($row)) {
$temp = explode (";", $line_data);
$banner = $temp[1];
$coords = explode (",", $temp[0]);
$the_banner = htmlentities($banner, ENT_QUOTES);
$the_width = intval( trim($line_width), 10); // font size
?>
var point = new google.maps.LatLng(parseFloat(<?php print $coords[0];?>) , parseFloat(<?php print $coords[1];?>));
drawBanner( point, '<?php print $the_banner;?>', '<?php print $the_banner;?>', <?php print $the_width;?>, add_hash('<?php print $line_color;?>'));
<?php
}