Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1573 lines
47 KiB

​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
3 years ago
​
​
​
​
4 years ago
3 years ago
4 years ago
​
​
​
​
3 years ago
4 years ago
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
3 years ago
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
3 years ago
4 years ago
​
​
​
​
3 years ago
4 years ago
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
4 years ago
3 years ago
4 years ago
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
4 years ago
​
​
​
​
​
3 years ago
4 years ago
​
​
3 years ago
4 years ago
​
​
​
​
3 years ago
​
4 years ago
​
3 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
4 years ago
3 years ago
4 years ago
​
4 years ago
​
​
​
​
​
3 years ago
​
3 years ago
​
​
​
​
​
​
​
​
4 years ago
3 years ago
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var map = null;
  3. var selectedMarker = null;
  4. var timelineObj = null;
  5. var tlGroups = new vis.DataSet();
  6. var tlItems = new vis.DataSet();
  7. var selecredActiveSourceFilter = 0;
  8. var rep_store_id = 0;
  9. var rep_array = new Array();
  10. var rep_store = new Ext.data.JsonStore({
  11. autoDestroy: false,
  12. storeId: 'log_store',
  13. //idIndex: 0,
  14. idProperty: 'id',
  15. fields: [
  16. {name: 'id', type: 'int' },
  17. {name: 'node_id', type: 'int' },
  18. {name: 'node_name', type: 'string' },
  19. {name: 'dts', type: 'string'},
  20. {name: 'ts', type: 'int'},
  21. {name: 'ms', type: 'string'},
  22. {name: 'type', type: 'int'},
  23. {name: 'range', type: 'string'},
  24. {name: 'az', type: 'string'},
  25. {name: 'el', type: 'string'},
  26. {name: 'r', type: 'int'},
  27. {name: 'width', type: 'int'},
  28. {name: 'video_id',type: 'int'}
  29. //{name: 'lat', type: 'float'},
  30. //{name: 'lon', type: 'float'},
  31. //{name: 'alt', type: 'float'},
  32. //{name: 'area', type: 'float'},
  33. //{name: 'video', type: 'string'},
  34. //{name: 'v_cpoint', type: 'int'}
  35. ]
  36. });
  37. function rep_sn_Renderer( value, meta, record ){
  38. //Must be set according to events
  39. var kaka = record.data.node_id % 3;
  40. return '<div class="log_line_' + kaka + '">'+value+'</div>';
  41. };
  42. function rep_et_Renderer( value, meta, record ){
  43. var kaka = record.data.node_id % 3;
  44. switch( value ){
  45. case 6: ov = 'Device Enters Into Study Mode'; break;
  46. case 7: ov = 'Device Is BUSY'; break;
  47. case 8: ov = 'Flip Complete'; break;
  48. case 9: ov = 'Scan Complete'; break;
  49. case 12: ov = 'Black 2D Target'; break;
  50. case 13: ov = 'White 2D Target'; break;
  51. case 36: ov = 'Region Of Interest'; break;
  52. case 39: ov = '[Train Filter] Check Target'; break;
  53. case 40: ov = '[Train Filter] Upper Sensor Detection'; break;
  54. case 41: ov = '[Train Filter] Bottom Sensor Detection'; break;
  55. case 42: ov = '[Train Filter] Train Detected'; break;
  56. case 43: ov = '[Train Filter] Train Updated'; break;
  57. case 44: ov = '[Train Filter] Suspicious Activity'; break;
  58. case 45: ov = '[Train Filter] Suspicious NACK'; break;
  59. case 46: ov = '[Train Filter] Regular Detection'; break;
  60. case 47: ov = '[Train Filter] Detection Disabled'; break;
  61. case 48: ov = '[Train Filter] Suspicious Detection'; break;
  62. case 49: ov = '[Train Filter] Differential Detection'; break;
  63. case 52: ov = 'Event Started'; break;
  64. case 53: ov = 'Event Ended'; break;
  65. case 54: ov = 'Event Closed Manual'; break;
  66. case 55: ov = 'Connected'; break;
  67. case 56: ov = 'Disconnection'; break;
  68. case 57: ov = 'Communication Jamed'; break;
  69. case 58: ov = 'Video Framerate Decreased'; break;
  70. case 59: ov = 'Video Framerate Increased'; break;
  71. default: ov = 'Event ['+value+']';
  72. };
  73. return '<div class="log_line_' + kaka + '">'+ov+'</div>';
  74. };
  75. var rep_ColModel_ops = {
  76. columns: [
  77. {header: "Time", width: 100, fixed: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'dts' },
  78. {header: "Source", width: 100, renderer: rep_sn_Renderer, align: 'left', css: 'vertical-align: middle;', dataIndex: 'node_name' },
  79. {header: "Type", width: 180, renderer: rep_et_Renderer, fixed: false, align: 'center', css: 'vertical-align: middle;', dataIndex: 'type' },
  80. {header: "Range", width: 100, dataIndex: 'range' },
  81. {header: "Azimuth", width: 100, dataIndex: 'az' },
  82. {header: "Width", width: 100, dataIndex: 'width' },
  83. ],
  84. defaults: {
  85. sortable: false,
  86. fixed: true,
  87. menuDisabled: true,
  88. width: 100
  89. }
  90. };
  91. var cRowSelected = -1;
  92. var rep_SelModel_ops = {
  93. singleSelect: true,
  94. listeners: {
  95. rowselect: function(sm, row, rec ) {
  96. cRowSelected = row;
  97. loadEventData( rec.data );
  98. //alert( rec.data.id );
  99. //loadEventProperties( rec.data );
  100. //SelectedEvent = rec.data.id;
  101. //alert( SelectedEvent );
  102. //var CB = Ext.getCmp('con_to_src');
  103. //CB.enable();
  104. //selectedArchiveRecord = rec;
  105. //if( rec.data.bk_type!=3 ){
  106. //
  107. //} else {
  108. //
  109. //};
  110. }
  111. }
  112. };
  113. var selectedMarkerIcon = L.icon({
  114. iconUrl: '/style/assets/cursor.png',
  115. iconSize: [32, 32],
  116. iconAnchor: [16, 16]//,
  117. //popupAnchor: [-3, -76],
  118. //shadowUrl: 'my-icon-shadow.png',
  119. //shadowSize: [68, 95],
  120. //shadowAnchor: [22, 94]
  121. });
  122. selectedMarker = L.marker([SiteLat, SiteLon], { draggable: false, icon: selectedMarkerIcon } );
  123. var tlOptions = {
  124. groupOrder: 'content', // groupOrder can be a property name or a sorting function
  125. stack: true,
  126. showCurrentTime: true,
  127. //verticalScroll: true,
  128. //zoomKey: 'ctrlKey',
  129. minHeight: 308,
  130. maxHeight: 308
  131. };
  132. var tlLoadLocker = false;
  133. var tlLastTS = 0;
  134. var tlInterval = null;
  135. var tlMonitoring = false;
  136. // Calendar
  137. var CurrentDate=(new Date())/1000;
  138. var today=new Date();
  139. var SY=1900+today.getYear();
  140. var SMO=today.getMonth()+1;
  141. var SD=today.getDate();
  142. var SelectedDay = SD;
  143. var Dates = new Array();
  144. function CheckDate(D){
  145. for(j_index=0;j_index<Dates.length;j_index++){
  146. if (Dates[j_index]==D)return true;
  147. };
  148. return false;
  149. };
  150. function ShiftBAK(){
  151. CurrentDate=CurrentDate-24*3600*GetMonthLength(CurrentDate);
  152. BuildCalendar();
  153. SMO = GetMonthNum(CurrentDate);
  154. SY = GetYear(CurrentDate);
  155. if( SD > GetMonthLength(CurrentDate) ) SD = GetMonthLength(CurrentDate);
  156. loadCalendarDates();
  157. };
  158. function ShiftFWD(){
  159. CurrentDate=CurrentDate+24*3600*GetMonthLength(CurrentDate);
  160. BuildCalendar();
  161. SMO = GetMonthNum(CurrentDate);
  162. SY = GetYear(CurrentDate);
  163. if( SD > GetMonthLength(CurrentDate) ) SD = GetMonthLength(CurrentDate);
  164. loadCalendarDates();
  165. };
  166. function GetMonthName(UTS){ // Unix Time Stamp
  167. var MoNames= new Array();
  168. MoNames[0]='January';
  169. MoNames[1]='February';
  170. MoNames[2]='March';
  171. MoNames[3]='April';
  172. MoNames[4]='May';
  173. MoNames[5]='June';
  174. MoNames[6]='July';
  175. MoNames[7]='August';
  176. MoNames[8]='September';
  177. MoNames[9]='October';
  178. MoNames[10]='November';
  179. MoNames[11]='December';
  180. CDate=new Date();
  181. CDate.setTime(UTS*1000);
  182. CMo=CDate.getMonth();
  183. return MoNames[CMo];
  184. };
  185. function GetMonthShift(UTS){ // Unix Time Stamp
  186. CDate=new Date();
  187. CDate.setTime(UTS*1000);
  188. CDate.setTime((UTS-(CDate.getDate()-1)*86400)*1000);
  189. return CDate.getDay();
  190. };
  191. function GetMonthLength(UTS){ // Unix Time Stamp
  192. CDate=new Date();
  193. CDate.setTime(UTS*1000);
  194. CD=CDate.getDate();
  195. RetVal=31;
  196. CDate.setTime((UTS+(31-CD)*86400)*1000);
  197. if ( CDate.getDate()==31) return RetVal;
  198. RetVal=30;
  199. CDate.setTime((UTS+(30-CD)*86400)*1000);
  200. if ( CDate.getDate()==30) return RetVal;
  201. RetVal=29;
  202. CDate.setTime((UTS+(29-CD)*86400)*1000);
  203. if ( CDate.getDate()==29) return RetVal;
  204. RetVal=28;
  205. CDate.setTime((UTS+(28-CD)*86400)*1000);
  206. if ( CDate.getDate()==28) return RetVal;
  207. return -1;
  208. };
  209. function GetMonthNum(UTS){ // Unix Time Stamp
  210. CDate=new Date();
  211. CDate.setTime(UTS*1000);
  212. return CDate.getMonth()+1;
  213. };
  214. function GetYear(UTS){ // Unix Time Stamp
  215. CDate=new Date();
  216. CDate.setTime(UTS*1000);
  217. y=CDate.getYear();
  218. if (y<100)y+=2000;
  219. if (y<200)y+=1900;
  220. return y;
  221. };
  222. function GetDay(UTS){ // Unix Time Stamp
  223. CDate=new Date();
  224. CDate.setTime(UTS*1000);
  225. y=CDate.getDate();
  226. return y;
  227. };
  228. function selectDate( m, d ){
  229. SY = GetYear(CurrentDate);
  230. SMO = m;
  231. SD = d;
  232. SelectedDay = SD;
  233. getData( 'arch' );
  234. };
  235. function BuildCalendar( ){
  236. Msh=GetMonthShift(CurrentDate);
  237. Mnm=GetMonthName(CurrentDate);
  238. Mln=GetMonthLength(CurrentDate);
  239. Mid=GetMonthNum(CurrentDate);
  240. Mye=GetYear(CurrentDate);
  241. InDTA='<table cellpadding="2" cellspacing="0"><tr height="19px"><td valign="middle"><a href="#" onclick="ShiftBAK();"><img src="/style/img/calendar/l_cal_b.gif"></a></td><td colspan="5" class="CalendarMN" align="center">'+Mnm+' '+Mye+'</td><td><a href="#" onclick="ShiftFWD();"><img border=0 src="/style/img/calendar/r_cal_b.gif"></a></td></tr>';
  242. InDTA+='<tr><td class="CalendarWT" align="center">Su</td><td class="CalendarWT" align="center">Mo</td><td class="CalendarWT" align="center">Tu</td><td class="CalendarWT" align="center">We</td><td class="CalendarWT" align="center">Th</td><td class="CalendarWT" align="center">Fr</td><td class="CalendarWT" align="center">Sa</td></tr>';
  243. InDTA+='<tr>';
  244. for(index=0;index<Msh;index++){
  245. InDTA+='<td style="padding: 1px"><div id="disabled" class="calendar_t">&nbsp;</div></td>';
  246. };
  247. for(;index<(Mln+Msh);index++){
  248. if( CheckDate(index-Msh+1) ){
  249. //InDTA+='<td style="padding: 1px"><div id="ds'+Mid.toString()+(index-Msh+1).toString()+'" onclick="selectDate('+Mid.toString()+','+(index-Msh+1).toString()+');" href="#" title="'+(index-Msh+1).toString()+'" class="CalendarDE">'+(index-Msh+1).toString()+'</a></td>';
  250. if( SD == index ){
  251. InDTA+='<td style="padding: 1px"><div id="selected_day" onclick="selectDate('+Mid.toString()+','+(index-Msh+1).toString()+');" title="Selected" class="calendar_t">'+(index-Msh+1).toString()+'</div></td>';
  252. } else {
  253. InDTA+='<td style="padding: 1px"><div id="have_data_day" onclick="selectDate('+Mid.toString()+','+(index-Msh+1).toString()+');" title="Have Events" class="calendar_t">'+(index-Msh+1).toString()+'</div></td>';
  254. };
  255. } else {
  256. if( SD == index ){
  257. InDTA+='<td style="padding: 1px"><div id="selected_day" class="calendar_t" title="Selected">'+(index-Msh+1).toString()+'</a></td>';
  258. } else {
  259. InDTA+='<td style="padding: 1px"><div id="no_data_day" class="calendar_t" title="No Events">'+(index-Msh+1).toString()+'</a></td>';
  260. };
  261. };
  262. if ((index+1)%7==0){
  263. InDTA+='</tr><tr>';
  264. };
  265. };
  266. for(;(index)%7!=0;index++){
  267. InDTA+='<td style="padding: 1px"><div id="disabled" class="calendar_t">&nbsp;</div></td>';
  268. };
  269. InDTA+='</tr></table>';
  270. tab=document.getElementById('calendar_TD');
  271. tab.innerHTML=InDTA;
  272. };
  273. function loadCalendarDates(){
  274. ReportSelectionMode = 0;
  275. Ext.MessageBox.wait("<?=$Labels->GetLabel('_Loading_Calo_');?>","<?=$Labels->GetLabel('_Please_Wait_');?>",{
  276. width: '100%',
  277. hidden: true,
  278. progress: true,
  279. closable: false
  280. });
  281. ReportLayoutLoadded = false;
  282. Ext.Ajax.request({
  283. url: '/lib/controller/getEventDates.php',
  284. params: {
  285. NID: selecredActiveSourceFilter,
  286. UID: <?=$UserID;?>,
  287. SID: '<?=$Session;?>',
  288. SYE: SY,
  289. SMO: SMO
  290. },
  291. success: function( response, opts ){
  292. Ext.MessageBox.hide();
  293. var data = Ext.decode( response.responseText );
  294. if( data.status == 'ok' ){
  295. Dates = data.days;
  296. BuildCalendar();
  297. //for( var i = 0; i < data.days.length; i++ ){
  298. //
  299. //};
  300. };
  301. },
  302. failure: function( response, opts ) {
  303. Ext.MessageBox.hide();
  304. }
  305. });
  306. };
  307. var eventsListStore = new Ext.data.JsonStore({
  308. root: 'log',
  309. totalProperty: 'totalCount',
  310. idProperty: 'id',
  311. remoteSort: true,
  312. fields: [{
  313. name: 'id',
  314. type: 'int'
  315. },{
  316. name: 'date',
  317. type: 'string'
  318. },{
  319. name: 'time',
  320. type: 'string'
  321. },{
  322. name: 'device',
  323. type: 'string'
  324. },{
  325. name: 'event',
  326. type: 'int'
  327. },{
  328. name: 'data',
  329. type: 'string',
  330. },{
  331. name: 'has_target',
  332. type: 'boolean'
  333. },{
  334. name: 'has_geo',
  335. type: 'boolean'
  336. },{
  337. name: 'has_images',
  338. type: 'boolean'
  339. },{
  340. name: 'images',
  341. type: 'Array'
  342. },{
  343. name: 'dev_type',
  344. type: 'int'
  345. },{
  346. name: 'geo',
  347. type: 'object'
  348. }] /*,
  349. proxy : new Ext.data.HttpProxy({
  350. method: 'POST',
  351. prettyUrls: false,
  352. url: '/lib/controller/getEventRecords.php',
  353. headers: {
  354. UID: <?=$UserID;?>,
  355. SID: '<?=$Session;?>',
  356. NID: 1
  357. }
  358. })*/
  359. });
  360. var SelectedEvent = 0;
  361. var EventPanelWindow = null;
  362. function showEventPanel(){
  363. if( EventPanelWindow == null ){
  364. EventPanelWindow = new Ext.Window({
  365. modal: true,
  366. title: '<?=$Labels->GetLabel("_EVENT_VIEWER_");?>',
  367. width: winW*0.66,
  368. height: winH*0.66,
  369. layout: 'fit',
  370. closeAction: 'hide',
  371. items:[{
  372. title: 'Cameras',
  373. html:'koko',
  374. autoScroll: true,
  375. height: 320
  376. },{
  377. html: 'koko22',
  378. height: 320
  379. }]
  380. });
  381. };
  382. EventPanelWindow .show();
  383. };
  384. function ModeRenderer(val){
  385. var p1, p2, p3;
  386. if( ( val & 1 ) == 1 ){
  387. p1 = '<img src="/style/img/cam_cap3.png" alt="Video Source">';
  388. } else {
  389. p1 = '<img src="/style/img/cam_cap0.png" alt="NO Video Source">';
  390. };
  391. if( ( val & 2 ) == 2 ){
  392. p2 = '<img src="/style/img/cam_cap2.png" alt="Audio Source">';
  393. } else {
  394. p2 = '<img src="/style/img/cam_cap0.png" alt="NO Audio Source">';
  395. };
  396. if( ( val & 4 ) == 4 ){
  397. p3 = '<img src="/style/img/cam_cap1.png" alt="PTZ Control">';
  398. } else {
  399. p3 = '<img src="/style/img/cam_cap0.png" alt="NO PTZ Control">';
  400. };
  401. return p1+p2+p3;
  402. };
  403. function LocRenderer( val ){
  404. if( val ){
  405. return '<img src="/style/icons/icons/accept.png" alt="Location" />';
  406. };
  407. return '<img src="/style/icons/icons/bullet_white.png" alt="NO Location" />';
  408. };
  409. function PicRenderer( val ){
  410. if( val ){
  411. return '<img src="/style/icons/icons/camera_link.png"/>';
  412. };
  413. return '<img src="/style/icons/icons/bullet_white.png"/>';
  414. };
  415. function EvtTypeRenderer( val ){
  416. switch( val ){
  417. case 6: return 'Device Enters Into Study Mode';
  418. case 7: return 'Device Is BUSY';
  419. case 8: return 'Flip Complete';
  420. case 9: return 'Scan Complete';
  421. case 10:
  422. case 11:
  423. case 12:
  424. case 13:
  425. case 14: return 'Target';
  426. case 36: return 'Region Of Interest';
  427. default: return 'Event ['+val+']';
  428. };
  429. };
  430. var eventsListColModel_ops = {
  431. columns: [
  432. {header: "ID", width: 100, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
  433. {header: "Date",width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'date' },
  434. {header: "Time", width: 80, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'time' },
  435. {header: "Device", width: 80, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'device' },
  436. {header: "Event", width: 120, sortable: false, dataIndex: 'event', renderer: EvtTypeRenderer },
  437. {header: "Info", width: 200, sortable: false, dataindex: 'data' },
  438. {header: "", width: 25, sortable: false, dataIndex: 'has_geo', renderer: LocRenderer },
  439. {header: "", width: 25, sortable: false, dataIndex: 'has_images', renderer: PicRenderer }
  440. ],
  441. defaults: {
  442. sortable: true,
  443. menuDisabled: true,
  444. width: 100
  445. },
  446. listeners: {
  447. hiddenchange: function(cm, colIndex, hidden) {
  448. //saveConfig(colIndex, hidden);
  449. }
  450. }
  451. };
  452. var SelectedRow = -1;
  453. var eventsListSelModel_ops = {
  454. singleSelect: true,
  455. listeners: {
  456. rowselect: function(sm, row, rec ) {
  457. loadEventProperties( rec.data );
  458. SelectedEvent = rec.data.id;
  459. SelectedRow = row;
  460. //alert( SelectedEvent );
  461. //var CB = Ext.getCmp('con_to_src');
  462. //CB.enable();
  463. }
  464. }
  465. };
  466. function loadTimeLineGroups( NID ){
  467. Ext.Ajax.request({
  468. url: '/lib/controller/getTimeLineGroups.php',
  469. params: {
  470. NID: NID,
  471. UID: <?=$UserID;?>,
  472. SID: '<?=$Session;?>'
  473. },
  474. success: function( response, opts ){
  475. // If the response is JSON, you have to decode it
  476. var data = Ext.decode(response.responseText);
  477. //for(var i = 0; i < data.length; i++) {
  478. //tlGroups.add(data[i]);
  479. //};
  480. tlGroups.update( data );
  481. loadTimeLineItems( SelectedSite );
  482. tlInterval = window.setInterval( loadTimeLineItems, 333, SelectedSite );
  483. },
  484. failure: function( response, opts ) {
  485. //Ext.fly('some_div').update('Fail!');
  486. }/*,
  487. callback: function(options,success,response){
  488. // use this if you need to perform your own success/failure checking
  489. }*/
  490. });
  491. };
  492. function clickDeviceSelector( id ){
  493. var rr = document.getElementById(id+'_div');
  494. if( selecredActiveSourceFilter != id ){
  495. if( selecredActiveSourceFilter > 0 ){
  496. var oo = document.getElementById( selecredActiveSourceFilter + '_div');
  497. oo.classList.remove( "cardDeviceSourceSelected" );
  498. oo.classList.add( "cardDeviceSource" );
  499. };
  500. rr.classList.remove( "cardDeviceSource" );
  501. rr.classList.add( "cardDeviceSourceSelected" );
  502. selecredActiveSourceFilter = id;
  503. turnOffAllGzButThis( selecredActiveSourceFilter );
  504. } else {
  505. selecredActiveSourceFilter = 0;
  506. rr.classList.remove( "cardDeviceSourceSelected" );
  507. rr.classList.add( "cardDeviceSource" );
  508. turnAllGzOn();
  509. var tPanel = Ext.getCmp('prop_content');
  510. tPanel.remove(0);
  511. tPanel.add( {
  512. title: 'Event Information',
  513. border: false,
  514. frame: false,
  515. collapsible: false,
  516. draggable: false,
  517. html: '<p align="center">Select an Event from TimeLine to See Information</p>'
  518. } );
  519. tPanel.doLayout();
  520. };
  521. };
  522. function loadEventPropertiesByID( id ){
  523. var d = eventsListStore.findExact( 'id', id );
  524. if( d > -1 ) {
  525. var EventRec = eventsListStore.getAt( d );
  526. loadEventProperties( EventRec.data );
  527. };
  528. };
  529. function loadEventProperties( EventRec ){
  530. var tPanel = Ext.getCmp('prop_content');
  531. tPanel.removeAll();// remove( 0 );
  532. var tt = '';
  533. if( selectedMarker!= null ){
  534. selectedMarker.remove();
  535. //map.removeLayer( selectedMarker );
  536. if( EventRec.has_geo ){
  537. tt = ''+EventRec.geo.lat+' '+EventRec.geo.lon;
  538. selectedMarker.setLatLng([EventRec.geo.lat, EventRec.geo.lon]);
  539. selectedMarker.addTo( map );
  540. };
  541. };
  542. tPanel.add( {
  543. title: 'Event Details',
  544. html: '<center><img src="/style/assets/'+EventRec.dev_type+'_node.png" /><p>' + EventRec.device+'</p>'+tt+'</center>'
  545. } );
  546. if( EventRec.has_images ){
  547. for( var i=0; i < EventRec.images.length; i++ ){
  548. tPanel.add( {
  549. frame: false,
  550. html: '<img width="100%" src="/lib/controller/getPicture.php?PID='+EventRec.images[i]+'" data-enlargeable000 ondblclick="fullScreen(\'img-'+EventRec.id+'\');" style="cursor: zoom-in" id="img-'+EventRec.id+'"/>'
  551. });
  552. };
  553. };
  554. tPanel.doLayout();
  555. };
  556. var VideoLinks = [];
  557. var VideoPlayer = null;
  558. var cEventTSS = 0;
  559. var cEventETS = 0;
  560. function stop_mjpeg( a ){
  561. if( VideoPlayer != null ){
  562. var tt = document.getElementById( a );
  563. if( tt != undefined ){
  564. //tt.removeAttribute( 'onclick' );
  565. tt.classList.remove('stop_button');
  566. tt.classList.add('play_button');
  567. tt.setAttribute( 'onclick', "cont_mjpeg('"+a+"');" );
  568. };
  569. VideoPlayer.pause();
  570. };
  571. };
  572. function cont_mjpeg( a ){
  573. if( VideoPlayer != null ){
  574. var tt = document.getElementById( a );
  575. if( tt != undefined ){
  576. tt.classList.remove('play_button');
  577. tt.classList.add('stop_button');
  578. tt.setAttribute( 'onclick', "stop_mjpeg('"+a+"');" );
  579. };
  580. VideoPlayer.play();
  581. };
  582. };
  583. function setpos_mjpeg( v ){
  584. if( VideoPlayer != null ){
  585. VideoPlayer.play( v );
  586. };
  587. };
  588. function setpos_s_mjpeg( v ){
  589. if( VideoPlayer != null ){
  590. VideoPlayer.play( v );
  591. };
  592. };
  593. function loadEventData( record ){
  594. ReportSelectionMode = 3; // Just One Event
  595. cEventTSS = record.ts+record.ms/1000;
  596. clearAllRadars();
  597. if( record.type == 13 || record.type == 14 || record.type == 36 ){
  598. markEventOnRadar( record.node_id, record.az, record.r );
  599. };
  600. if( record.video_id > 0 ){
  601. showVideo();
  602. Ext.Ajax.request({
  603. url: '/lib/controller/getVideoInfo.php',
  604. params: {
  605. UID: <?=$UserID;?>,
  606. SID: '<?=$Session;?>',
  607. TS: record.ts,
  608. VID: record.video_id
  609. },
  610. success: function( response, opts ){
  611. var data = Ext.decode(response.responseText);
  612. var t = Ext.getCmp('db_download_video');
  613. if( t != undefined ){
  614. t.toggle( true, true );
  615. t.enable();
  616. }
  617. var video_t = document.getElementById( 'video-'+data.node_id );
  618. if( video_t != undefined ){
  619. if( cRowSelected+1 < rep_array.length ) {
  620. var ddd = rep_array[cRowSelected+1];
  621. cEventETS = ( ddd.ts + ddd.ms/1000 ) - ( data.uts+data.uts_ms/1000 );
  622. } else {
  623. cEventETS = 0;
  624. };
  625. var tVL = '/lib/controller/data/reports/'+data.base+'/'+data.md5+'.'+data.ext;
  626. if( tVL != VideoLinks[data.node_id] ){
  627. VideoLinks[data.node_id] = tVL;
  628. //alert( tVL );
  629. switch( data.ext ){
  630. case 'mp4':{
  631. ctype = 'video/mp4';
  632. VideoPlayer = videojs( video_t );
  633. VideoPlayer.src({
  634. type: ctype,
  635. fps: data.fps,
  636. src: VideoLinks[data.node_id]
  637. });
  638. VideoPlayer.poster('/style/assets/no-signal.png');
  639. var CT = cEventTSS - ( data.uts+data.uts_ms/1000 );
  640. VideoPlayer.currentTime( CT );
  641. VideoPlayer.play();
  642. break;
  643. };
  644. case 'mjpeg':{
  645. ctype = 'video/x-motion-jpeg';
  646. //var mjpegUrl = "http://127.0.0.1/web/Images/Stream/somevideo.mjpeg";
  647. var fps = data.fps;
  648. var autoloop = true;
  649. $( video_t ).clipchamp_mjpeg_player( VideoLinks[data.node_id] , fps, autoloop,
  650. function( wrapperElement, playerInterface ) {
  651. //playerInterface.finish();
  652. VideoPlayer = playerInterface;
  653. $( wrapperElement ).dblclick(function(){
  654. //playerInterface.finish();
  655. fullScreen( wrapperElement.id );
  656. });
  657. });
  658. break;
  659. };
  660. };
  661. };
  662. };
  663. }
  664. });
  665. } else {
  666. var t = Ext.getCmp('db_download_video');
  667. if( t != undefined ){
  668. alert("ZagZag");
  669. t.toggle( false, true );
  670. t.disable();
  671. }
  672. //var video_t = document.getElementById( 'video-'+record.node_id );
  673. if( VideoPlayer != null ){
  674. //VideoPlayer.dispose();
  675. //VideoPlayer = null;
  676. VideoPlayer.pause();
  677. VideoPlayer.poster('/style/assets/no-signal.png');
  678. VideoPlayer.posterImage.show();
  679. };
  680. };
  681. };
  682. function clearAllRadars(){
  683. for( i=1; i< 1000; i++ ){
  684. var csvg = document.getElementById( 'draw_svgr_' + i );
  685. if( csvg!= undefined ){
  686. var roi = csvg.getElementById( "roi" );
  687. if( roi != null ) csvg.removeChild( roi );
  688. };
  689. };
  690. };
  691. function markEventOnRadar( rid, az, range ){
  692. var csvg = document.getElementById( 'draw_svgr_' + rid );
  693. if( csvg!= undefined ){
  694. var roi = csvg.getElementById( "roi" );
  695. if( roi != null ) csvg.removeChild( roi );
  696. var bBox = csvg.getBBox();
  697. var max = 2048;
  698. switch( drawZoomLevels[rid] ){
  699. case 50: max = 1024; break;
  700. case 25: max = 512; break;
  701. case 12: max = 256; break;
  702. };
  703. if( range < max ){
  704. var ak = 2.0*Math.PI/360;
  705. var ok = 1.0/35;
  706. var rk = bBox.width / ( max * 2 );
  707. var cpx = bBox.width / 2.0;
  708. var cpy = bBox.height / 2.0;
  709. x = cpx + rk * range * Math.cos( az*ak );
  710. y = cpy - rk * range * Math.sin( az*ak );
  711. var cc = document.createElementNS('http://www.w3.org/2000/svg', "circle");
  712. var rz = bBox.width / csvg.clientWidth;
  713. cc.setAttributeNS(null, "cx", x );
  714. cc.setAttributeNS(null, "cy", y );
  715. cc.setAttributeNS(null, "r", ""+(6*rz)+"" );
  716. cc.setAttributeNS(null, "stroke", "#800000" );
  717. cc.setAttributeNS(null, "stroke-width", ""+(2*rz)+"" );
  718. cc.setAttributeNS(null, "stroke-opacity", ""+(1.0));
  719. cc.setAttributeNS(null, "fill", "#ff0000" );
  720. cc.setAttributeNS(null, "fill-opacity", ""+(1.0));
  721. cc.setAttributeNS(null, "id", "roi" );
  722. csvg.appendChild( cc );
  723. };
  724. };
  725. };
  726. function getData( Mode, ST = 0, ET = 0, SR = 0, DR = 0 ){
  727. if( tlLoadLocker ) return;
  728. tlLoadLocker = true;
  729. if( Mode == 'arch' ){
  730. Ext.MessageBox.wait("Loading Data","Please Wait",{
  731. width: '100%',
  732. hidden: true,
  733. animate: true,
  734. progress: true,
  735. closable: false
  736. });
  737. };
  738. Ext.Ajax.request({
  739. url: '/lib/controller/getEventRecords.php',
  740. params: {
  741. SITE: <?=$SiteID;?>,
  742. UID: <?=$UserID;?>,
  743. SID: '<?=$Session;?>',
  744. MODE: Mode,
  745. FIL: selecredActiveSourceFilter,
  746. SDA: SD,
  747. SMO: SMO,
  748. SYE: SY,
  749. STM: ST,
  750. ETM: ET,
  751. STR: SR,
  752. DIR: DR
  753. },
  754. success: function( response, opts ){
  755. tlLoadLocker = false;
  756. var data = Ext.decode(response.responseText);
  757. if( data.updateFROMTO ){
  758. Ext.getCmp('STimeFROM').setValue( data.STT );
  759. Ext.getCmp('STimeTO').setValue( data.ENT );
  760. if( data.SLD > 0 ){
  761. SMO = GetMonthNum(data.SLD);
  762. SY = GetYear(data.SLD);
  763. SD = GetDay(data.SLD);
  764. BuildCalendar();
  765. };
  766. };
  767. eventsListStore.loadData( data, false );
  768. if( Mode == 'arch' ){
  769. showEventsOnMap( data, true );
  770. Ext.MessageBox.hide();
  771. if( DR > 0 ){
  772. Ext.getCmp('evtArchLog').getView().focusRow( eventsListStore.getCount() - 1 );
  773. Ext.getCmp('evtArchLog').getSelectionModel().selectLastRow();
  774. };
  775. if( DR < 0 ){
  776. Ext.getCmp('evtArchLog').getView().focusRow( 0 );
  777. Ext.getCmp('evtArchLog').getSelectionModel().selectFirstRow();
  778. };
  779. } else {
  780. showEventsOnMap( data, false );
  781. //LoadMapEventsZ( Mode );
  782. };
  783. },
  784. failure: failureAJAXFunction
  785. });
  786. };
  787. function loadArchive(){
  788. if( tlInterval!= null ){
  789. window.clearInterval( tlInterval );
  790. tlInterval = null;
  791. timelineObj = null;
  792. };
  793. setUserContent( 2 );
  794. var tPanel = Ext.getCmp('main_portal');
  795. tPanel.removeAll( true );
  796. Ext.getCmp('main_content').setTitle( 'Events Archive' );
  797. tPanel.add({
  798. columnWidth: 0.83,
  799. frame: false,
  800. border: false,
  801. items: [{
  802. title: 'Site Map',
  803. frame: false,
  804. border: false,
  805. layout: 'vbox',
  806. layoutConfig: {
  807. align : 'stretch',
  808. pack : 'start',
  809. },
  810. height: PanelH-300,
  811. items:[{
  812. height: PanelH-325,
  813. flex: 1,
  814. frame: false,
  815. border: false,
  816. layout: 'fit',
  817. items:{
  818. id: 'event_map',
  819. html: '&nbsp;'
  820. }
  821. }]
  822. },{
  823. frame: false,
  824. border: false,
  825. collapsible: false,
  826. draggable: false,
  827. layout: 'hbox',
  828. items:[{
  829. layout: 'form',
  830. title: 'Date/Time',
  831. width: 200,
  832. frame: true,
  833. border: false,
  834. labelAlign: 'right',
  835. labelWidth: 50,
  836. defaults: { width: 80},
  837. items: [{
  838. xtype: 'combo',
  839. id: 'STimeFROM',
  840. fieldLabel: 'From',
  841. editable: false,
  842. typeAhead: true,
  843. triggerAction: 'all',
  844. width: 120,
  845. lazyRender:true,
  846. mode: 'local',
  847. store: new Ext.data.ArrayStore({
  848. id: 0,
  849. fields: ['ss', 'displayText' ],
  850. data: [<?php
  851. $zuzu = array();
  852. for( $i = 0; $i < 24; $i++) if( $i < 10 ) $zuzu[] = '['.($i*3600).',\'0'.$i.':00\']'; else $zuzu[] = '['.($i*3600).',\''.$i.':00\']';
  853. echo implode( ',', $zuzu ); ?>]
  854. }),
  855. valueField: 'ss',
  856. displayField: 'displayText'
  857. },{
  858. xtype: 'combo',
  859. id: 'STimeTO',
  860. fieldLabel: 'Till',
  861. editable: false,
  862. typeAhead: true,
  863. triggerAction: 'all',
  864. width: 120,
  865. lazyRender:true,
  866. mode: 'local',
  867. store: new Ext.data.ArrayStore({
  868. id: 0,
  869. fields: ['ss', 'displayText' ],
  870. data: [<?php
  871. $zuzu = array();
  872. for( $i = 1; $i < 25; $i++) if( $i < 10 ) $zuzu[] = '['.($i*3600).',\'0'.$i.':00\']'; else $zuzu[] = '['.($i*3600).',\''.$i.':00\']';
  873. echo implode( ',', $zuzu ); ?>]
  874. }),
  875. valueField: 'ss',
  876. displayField: 'displayText'
  877. }],
  878. html: '<table width="100%"><tr><td id="calendar_TD" align="center"></td></tr></table>',
  879. buttons: [{
  880. xtype: 'button',
  881. text: 'Display History',
  882. handler: function(){
  883. var STU = Ext.getCmp('STimeFROM').getValue();
  884. var ETU = Ext.getCmp('STimeTO').getValue();
  885. getData( 'arch', STU, ETU );
  886. }
  887. }]
  888. },{
  889. title: 'Event Log',
  890. frame: false,
  891. height: 303,
  892. id: 'evtArchLog',
  893. xtype: 'grid',
  894. ds: eventsListStore,
  895. cm: new Ext.grid.ColumnModel( eventsListColModel_ops ),
  896. sm: new Ext.grid.RowSelectionModel( eventsListSelModel_ops ),
  897. listeners:{
  898. keydown: function( e ) {
  899. if( e.getKey() == e.UP ){
  900. if( SelectedRow == 0 ){
  901. var id = eventsListStore.getAt( 0 ).id;
  902. getData( 'arch', 0, 0, id, 1 );
  903. };
  904. };
  905. if( e.getKey() == e.DOWN ){
  906. if( SelectedRow == ( eventsListStore.getCount() - 1 ) ){
  907. var id = eventsListStore.getAt( SelectedRow ).id;
  908. getData( 'arch', 0, 0, id, -1 );
  909. Ext.getCmp('evtArchLog').getSelectionModel().selectFirstRow();
  910. Ext.getCmp('evtArchLog').focus( false, true );
  911. };
  912. };
  913. }
  914. }
  915. }]
  916. }]
  917. });
  918. tPanel.add({
  919. columnWidth: 0.17,
  920. frame: true,
  921. title: 'Event Information',
  922. id: 'prop_content',
  923. border: false,
  924. items: [{
  925. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  926. }]
  927. });
  928. tPanel.doLayout();
  929. /*
  930. Ext.getCmp('evtLog').getEl().set({tabindex: "0"});
  931. Ext.getCmp('evtLog').getEl().addKeyMap({
  932. eventName: "keyup",
  933. binding: [{
  934. key: Ext.EventObject.SPACE,
  935. fn: function(){ alert("Space key pressed"); }
  936. },{
  937. key: [Ext.EventObject.LEFT, Ext.EventObject.RIGHT],
  938. shift: true,
  939. fn: function(){ alert("Left or right pressed while pressing shift"); }
  940. }]
  941. });
  942. */
  943. //BuildCalendar();
  944. loadCalendarDates();
  945. map = L.map('event_map',{
  946. attributionControl: true,
  947. //preferCanvas: true,
  948. zoomControl: true,
  949. center: [SiteLat, SiteLon],
  950. /*zoomControl: false,
  951. zoom: 17,
  952. minZoom: 17,
  953. maxZoom: 17,*/
  954. keyboard: false
  955. }).setView([SiteLat, SiteLon], 17);
  956. //L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("<b><?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?></b>");
  957. var mapLayers = [];
  958. /*mapLayers["Bing"] = new BingLayer('https://t{s}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/{q}?it=A,G,L&shading=hill', {
  959. subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
  960. attribution: '&copy; <a href="https://bing.com/maps" target="_blank">Bing Maps</a>',
  961. detectRetina: true
  962. });*/
  963. mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  964. attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
  965. maxNativeZoom: 18,
  966. maxZoom: 24,
  967. })
  968. // https://leaflet-extras.github.io/leaflet-providers/preview/
  969. mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
  970. attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012',
  971. maxZoom: 19
  972. });
  973. mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
  974. attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
  975. maxZoom: 19
  976. });
  977. mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
  978. attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community',
  979. maxZoom: 24
  980. });
  981. mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
  982. attribution: 'Map data &copy; <a href="https://openstreetmap.org" target="_blank">OpenStreetMap</a> contributors',
  983. maxZoom: 19
  984. });
  985. mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
  986. attribution: 'Kartendaten: &copy; <a href="https://openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>-Mitwirkende, SRTM | Kartendarstellung: &copy; <a href="http://opentopomap.org/" target="_blank">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/" target="_blank">CC-BY-SA</a>) ',
  987. maxZoom: 19
  988. });
  989. /*
  990. mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  991. attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
  992. maxZoom: 22
  993. });
  994. mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  995. attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
  996. maxZoom: 22
  997. });
  998. mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  999. attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
  1000. maxZoom: 22
  1001. });
  1002. */
  1003. var baseMaps = {
  1004. "MyMap": mapLayers["MyMap"],
  1005. "OpenStreetMap": mapLayers["OpenStreetMap"],
  1006. "OpenTopoMap": mapLayers["OpenTopoMap"],
  1007. "EsriSat": mapLayers["EsriSat"],
  1008. "EsriStreet": mapLayers["EsriStreet"],
  1009. "EsriTopo": mapLayers["EsriTopo"],
  1010. //"Bing": mapLayers["Bing"],
  1011. //"OSM-Cycle": mapLayers["Cycle"],
  1012. //"Landscape": mapLayers["Landscape"],
  1013. //"Outdoor": mapLayers["Outdoor"],
  1014. };
  1015. L.control.layers( baseMaps ).addTo(map);
  1016. mapLayers["MyMap"].addTo(map);
  1017. /*L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  1018. attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
  1019. maxNativeZoom: 18,
  1020. maxZoom: 24,
  1021. }).addTo(map); */
  1022. //loadTimeLineGroups( selectedSite );
  1023. loadMapZones( SelectedSite );
  1024. getData( 'arch' );
  1025. //eventsListStore.load({params:{start:0, limit:50, src: 'arch', fil: selecredActiveSourceFilter }});
  1026. };
  1027. function loadMonitoring(){
  1028. if( tlInterval!= null ){
  1029. window.clearInterval( tlInterval );
  1030. tlInterval = null;
  1031. timelineObj = null;
  1032. };
  1033. setUserContent( 1 );
  1034. var tPanel = Ext.getCmp('main_portal');
  1035. tPanel.removeAll( true );
  1036. Ext.getCmp('main_content').setTitle( 'Events Monitoring' );
  1037. tPanel.add({
  1038. columnWidth: 0.83,
  1039. frame: false,
  1040. border: false,
  1041. items: [{
  1042. title: '<?=$Labels->getLabel('_MAP_MONITORING_');?>',
  1043. frame: false,
  1044. border: false,
  1045. collapsible: false,
  1046. draggable: false,
  1047. layout: 'vbox',
  1048. layoutConfig: {
  1049. align : 'stretch',
  1050. pack : 'start',
  1051. },
  1052. height: PanelH-300,
  1053. items:[{
  1054. height: PanelH-325,
  1055. flex: 1,
  1056. frame: false,
  1057. border: false,
  1058. layout: 'fit',
  1059. items:{
  1060. id: 'event_map',
  1061. html: '&nbsp;'
  1062. }
  1063. }]
  1064. },{
  1065. frame: false,
  1066. border: true,
  1067. collapsible: false,
  1068. draggable: false,
  1069. layout: 'hbox',
  1070. items:[{
  1071. title: 'Alarm Sources',
  1072. xtype: 'panel',
  1073. border: false,
  1074. frame: false,
  1075. collapsible: false,
  1076. draggable: false,
  1077. id: 'sources_panel',
  1078. width: 160,
  1079. autoScroll: 'auto',
  1080. height: 303
  1081. },{
  1082. title: 'Event Log',
  1083. height: 303,
  1084. xtype: 'grid',
  1085. border: false,
  1086. frame: false,
  1087. collapsible: false,
  1088. draggable: false,
  1089. ds: eventsListStore,
  1090. cm: new Ext.grid.ColumnModel( eventsListColModel_ops ),
  1091. sm: new Ext.grid.RowSelectionModel( eventsListSelModel_ops ),
  1092. bbar: [{
  1093. text: 'Clear',
  1094. handler: function(){
  1095. Ext.Ajax.request({
  1096. url: '/lib/controller/clearEventCloud.php',
  1097. params: {
  1098. UID: <?=$UserID;?>,
  1099. SID: '<?=$Session;?>'
  1100. },
  1101. success: function( response, opts ){
  1102. },
  1103. failure: function( response, opts ) {
  1104. }
  1105. });
  1106. }
  1107. }]
  1108. }]
  1109. }]
  1110. });
  1111. tPanel.add({
  1112. columnWidth: 0.17,
  1113. title: 'Event Information',
  1114. frame: true,
  1115. id: 'prop_content',
  1116. border: false,
  1117. items: [{
  1118. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  1119. }]
  1120. });
  1121. tPanel.doLayout();
  1122. map = L.map('event_map',{
  1123. attributionControl: true,
  1124. //preferCanvas: true,
  1125. zoomControl: true,
  1126. center: [SiteLat, SiteLon],
  1127. /*zoomControl: false,
  1128. zoom: 17,
  1129. minZoom: 17,
  1130. maxZoom: 17,*/
  1131. keyboard: false
  1132. }).setView([SiteLat, SiteLon], 17);
  1133. //L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("<b><?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?></b>");
  1134. var mapLayers = [];
  1135. /*mapLayers["Bing"] = new BingLayer('https://t{s}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/{q}?it=A,G,L&shading=hill', {
  1136. subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
  1137. attribution: '&copy; <a href="https://bing.com/maps" target="_blank">Bing Maps</a>',
  1138. detectRetina: true
  1139. });*/
  1140. mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  1141. attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
  1142. maxNativeZoom: 18,
  1143. maxZoom: 24,
  1144. })
  1145. // https://leaflet-extras.github.io/leaflet-providers/preview/
  1146. mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
  1147. attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012',
  1148. maxZoom: 19
  1149. });
  1150. mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
  1151. attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
  1152. maxZoom: 19
  1153. });
  1154. mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
  1155. attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community',
  1156. maxZoom: 24
  1157. });
  1158. mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
  1159. attribution: 'Map data &copy; <a href="https://openstreetmap.org" target="_blank">OpenStreetMap</a> contributors',
  1160. maxZoom: 19
  1161. });
  1162. mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
  1163. attribution: 'Kartendaten: &copy; <a href="https://openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>-Mitwirkende, SRTM | Kartendarstellung: &copy; <a href="http://opentopomap.org/" target="_blank">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/" target="_blank">CC-BY-SA</a>) ',
  1164. maxZoom: 19
  1165. });
  1166. /*
  1167. mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  1168. attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
  1169. maxZoom: 22
  1170. });
  1171. mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  1172. attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
  1173. maxZoom: 22
  1174. });
  1175. mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
  1176. attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
  1177. maxZoom: 22
  1178. });
  1179. */
  1180. var baseMaps = {
  1181. "MyMap": mapLayers["MyMap"],
  1182. "OpenStreetMap": mapLayers["OpenStreetMap"],
  1183. "OpenTopoMap": mapLayers["OpenTopoMap"],
  1184. "EsriSat": mapLayers["EsriSat"],
  1185. "EsriStreet": mapLayers["EsriStreet"],
  1186. "EsriTopo": mapLayers["EsriTopo"],
  1187. //"Bing": mapLayers["Bing"],
  1188. //"OSM-Cycle": mapLayers["Cycle"],
  1189. //"Landscape": mapLayers["Landscape"],
  1190. //"Outdoor": mapLayers["Outdoor"],
  1191. };
  1192. L.control.layers( baseMaps ).addTo(map);
  1193. mapLayers["MyMap"].addTo(map);
  1194. /*L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  1195. attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
  1196. maxNativeZoom: 18,
  1197. maxZoom: 24,
  1198. }).addTo(map); */
  1199. loadMapZones( SelectedSite );
  1200. tlInterval = window.setInterval( getData, 333, 'live' );
  1201. };
  1202. function loadOnlineMonitoring(devID){
  1203. if( tlInterval!= null ){
  1204. window.clearInterval( tlInterval );
  1205. tlInterval = null;
  1206. timelineObj = null;
  1207. };
  1208. var tPanel = Ext.getCmp('main_content');
  1209. tPanel.removeAll( true );
  1210. tPanel.add({
  1211. html: 'Device Monitoring '+devID
  1212. });
  1213. tPanel.doLayout();
  1214. };
  1215. function shutImg( img, a = '' ){
  1216. if( a == '' ){
  1217. img.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEAAAAALAAAAAABAAEAAAI=;';
  1218. } else {
  1219. img.src = a;
  1220. };
  1221. };
  1222. var ReportMask = null;
  1223. var ReportLayoutLoadded = false;
  1224. var ReportSelectionMode = 0; //All
  1225. function loadReportSegment( ts, bid, eid ){
  1226. if( !ReportLayoutLoadded ){
  1227. ReportMask = new Ext.LoadMask(Ext.getCmp('main_content').getEl(), {msg:"Please wait..."});
  1228. ReportMask.show();
  1229. Ext.Ajax.request({
  1230. url: '/lib/controller/getReportLayout.php',
  1231. params: {
  1232. UID: <?=$UserID;?>,
  1233. SID: '<?=$Session;?>'//,
  1234. //BID: nid,
  1235. //EID: evt_ts
  1236. },
  1237. success: function(response, opts ){
  1238. var data = Ext.decode( response.responseText );
  1239. var tPanel = Ext.getCmp('main_content');
  1240. tPanel.removeAll(true);
  1241. Ext.getCmp('main_content').add({
  1242. xtype: 'portal',
  1243. id: 'segment_portal',
  1244. frame: false,
  1245. border: false,
  1246. items:{
  1247. html: ''
  1248. },
  1249. listeners:{
  1250. drop: function( a ){
  1251. updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
  1252. }
  1253. }
  1254. });
  1255. Ext.getCmp('main_content').doLayout();
  1256. tPanel = Ext.getCmp('segment_portal');
  1257. //nodeDashboardStatuses = new Array();
  1258. for( i=0; i < data.length; i++) tPanel.add( data[i] );
  1259. tPanel.doLayout();
  1260. ReportMask.hide();
  1261. ReportLayoutLoadded = true;
  1262. loadReportData( ts, bid, eid );
  1263. },
  1264. error: function(){
  1265. ReportMask.hide();
  1266. }
  1267. });
  1268. } else {
  1269. loadReportData( ts, bid, eid );
  1270. };
  1271. };
  1272. function loadReportData( ts, bid, eid ){
  1273. ReportSelectionMode = 2; // Session Selected
  1274. Ext.Ajax.request({
  1275. url: '/lib/controller/getHistoryEvents.php',
  1276. params: {
  1277. UID: <?=$UserID;?>,
  1278. SID: '<?=$Session;?>',
  1279. TS: ts,
  1280. BID: bid,
  1281. EID: eid,
  1282. },
  1283. success: function(response, opts ){
  1284. hideVideo();
  1285. var data = Ext.decode( response.responseText );
  1286. if( data.log != undefined ){
  1287. if( data.log.length ){
  1288. rep_store_id = data.log[0].id;
  1289. rep_array = data.log;//.concat( rep_array );
  1290. //if( log_array.length > 32 ){
  1291. // log_array = log_array.slice( 0, 31 );
  1292. //};
  1293. rep_store.removeAll();
  1294. rep_store.loadData( rep_array );
  1295. };
  1296. } else {
  1297. alert('No Log');
  1298. // clear the log
  1299. //log_store.removeAll();
  1300. };
  1301. }
  1302. });
  1303. };
  1304. function loadReportDayTree( ts ){
  1305. ReportSelectionMode = 1;//Day Selected
  1306. ReportMask = new Ext.LoadMask(Ext.getCmp('left_side_menu').getEl(), {msg:"Please wait..."});
  1307. ReportMask.show();
  1308. Ext.Ajax.request({
  1309. url: '/lib/controller/getHistoryDay.php',
  1310. params: {
  1311. UID: <?=$UserID;?>,
  1312. SID: '<?=$Session;?>',
  1313. DTS: ts
  1314. },
  1315. success: function(response, opts ){
  1316. var data = Ext.decode( response.responseText );
  1317. var sPanel = Ext.getCmp('left_side_menu');
  1318. sPanel.removeAll( true );
  1319. sPanel.add({
  1320. xtype: 'panel',
  1321. layout: 'vbox',
  1322. frame: true,
  1323. border: false,
  1324. items:[{
  1325. xtype: 'spacer',
  1326. height: 3
  1327. },{
  1328. html: '<p class="cur_date">'+( new Date( ts * 1000)).toLocaleDateString()+'</p><p class="cur_sessions">'+data.sessions+'</p><p class="cur_events">'+data.events+'</p><p class="cur_videos">'+data.videos+'</p>',
  1329. frame: false,
  1330. width: '100%',
  1331. border: false
  1332. },{
  1333. xtype: 'spacer',
  1334. height: 5
  1335. },{
  1336. xtype: 'treepanel',
  1337. autoScroll: true,
  1338. width: '100%',
  1339. <?php if( $CUser->Data['access'] > 3 ){ ?>
  1340. height: PanelH-260,
  1341. <?php } else { ?>
  1342. height: PanelH-209,
  1343. <?php }; ?>
  1344. border: true,
  1345. frame: true,
  1346. loader: new Ext.tree.TreeLoader(),
  1347. rootVisible: false,
  1348. root: new Ext.tree.AsyncTreeNode( data ),
  1349. listeners: {
  1350. click: function(n) {
  1351. if( n.attributes.leaf ){
  1352. Ext.getCmp('chu_adate').show();
  1353. sPanel.doLayout();
  1354. loadReportSegment( ts, n.attributes.bid, n.attributes.eid );
  1355. //Ext.Msg.alert('Navigation Tree Click', 'You clicked: "' + n.attributes.ts + '"');
  1356. };
  1357. }
  1358. }
  1359. },{
  1360. xtype: 'spacer',
  1361. height: 10
  1362. },{
  1363. xtype: 'button',
  1364. id: 'chu_adate',
  1365. text: 'Show Dates',
  1366. hidden: true,
  1367. width: '100%',
  1368. iconCls: 'reports_dates_btn',
  1369. scale: 'large',
  1370. handler: function(){
  1371. Ext.getCmp('chu_adate').hide();
  1372. initReportsView();
  1373. }
  1374. <?php if( $CUser->Data['access'] > 3 ){ ?>
  1375. },{
  1376. xtype: 'spacer',
  1377. height: 10
  1378. },{
  1379. xtype: 'button',
  1380. width: '100%',
  1381. scale: 'large',
  1382. iconCls: 'reports_delete_btn',
  1383. text: 'Delete Selected',
  1384. handler: function(){
  1385. }
  1386. <?php }; ?>
  1387. }]
  1388. });
  1389. sPanel.doLayout();
  1390. ReportMask.hide();
  1391. }
  1392. });
  1393. };
  1394. function hideVideo(){
  1395. var juja = undefined;
  1396. for( i = 1; i++; i < 1000 ){
  1397. var juja = document.getElementById( 'video-'+i );
  1398. if( juja != undefined ) break;
  1399. };
  1400. if( juja != undefined ) juja.style.display = "none";
  1401. };
  1402. function showVideo(){
  1403. var juja = undefined;
  1404. for( i = 1; i++; i < 1000 ){
  1405. var juja = document.getElementById( 'video-'+i );
  1406. if( juja != undefined ) break;
  1407. };
  1408. if( juja != undefined ) juja.style.display = "block";
  1409. };
  1410. function initReportsView(){
  1411. ReportSelectionMode = 0; // All History
  1412. if( tlInterval!= null ){
  1413. window.clearInterval( tlInterval );
  1414. tlInterval = null;
  1415. timelineObj = null;
  1416. };
  1417. ReportLayoutLoadded = false;
  1418. var tPanel = Ext.getCmp('main_content');
  1419. var sPanel = Ext.getCmp('left_side_menu');
  1420. tPanel.removeAll( true );
  1421. sPanel.removeAll( true );
  1422. tPanel.add({
  1423. xtype: 'panel',
  1424. height: PanelH+15,
  1425. html: '<div id="activity_ph"></div>',
  1426. listeners:{
  1427. afterrender: function(){
  1428. ReportMask = new Ext.LoadMask(Ext.getCmp('main_content').getEl(), {msg:"Please wait..."});
  1429. ReportMask.show();
  1430. var jj = (PanelW - 230)/55;
  1431. changeStyleSheet('amap-empty-day','{width: '+jj+'px; height: '+jj+'px;}');
  1432. changeStyleSheet('amap-week-day','{width: '+jj+'px; height: '+jj+'px;}');
  1433. changeStyleSheet('amap-week-name','{width: '+jj+'px; height: '+jj+'px;}');
  1434. Ext.Ajax.request({
  1435. url: '/lib/controller/getHistoryDates.php',
  1436. params: {
  1437. UID: <?=$UserID;?>,
  1438. SID: '<?=$Session;?>'
  1439. },
  1440. success: function(response, opts ){
  1441. var data = Ext.decode( response.responseText );
  1442. var activityMap = new ActivityMap( data, {
  1443. id: "dji-volume-map",
  1444. parent: '#activity_ph',
  1445. showTitle: false,
  1446. showYears: true,
  1447. width: 100,
  1448. hue: 1,
  1449. fit: true,
  1450. compact: true,
  1451. timeColumn: "t",
  1452. valueColumn: "v"
  1453. });
  1454. activityMap.render();
  1455. ReportMask.hide();
  1456. }
  1457. });
  1458. }
  1459. }
  1460. });
  1461. tPanel.doLayout();
  1462. sPanel.add({
  1463. xtype: 'panel',
  1464. frame: true,
  1465. border: false,
  1466. items: [{
  1467. html: '<div class="setEd_infoPanel" id="NANA"><?=$Labels->GetLabel('_PLS_SEL_CAL_DATE_');?></div>',
  1468. <?php if( $CUser->Data['access'] > 3 ){ ?>
  1469. height: PanelH - 70
  1470. },{
  1471. xtype: 'button',
  1472. width: '100%',
  1473. scale: 'large',
  1474. iconCls: 'reports_delete_btn',
  1475. text: 'Clear All History'
  1476. <?php } else { ?>
  1477. height: PanelH - 30
  1478. <?php }; ?>
  1479. }]
  1480. });
  1481. sPanel.doLayout();
  1482. };