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.

366 lines
16 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. //Important!! Saving this file with Unix EOL type
  3. function createPlatformAnimation( $PLayout, $PNames=array(), $Colors=array() ){
  4. $SVG['C']=<<<jjdgfjjdfh
  5. <svg viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
  6. <defs>
  7. <pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse">
  8. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  9. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  10. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  11. </pattern>
  12. <pattern id="stair_1m" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  13. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  14. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  15. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  16. </pattern>
  17. <pattern id="stripe" x="0" y="0" width="30" height="15" patternUnits="userSpaceOnUse">
  18. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  19. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  20. </pattern>
  21. <pattern id="stripe2" x="0" y="-5" width="30" height="15" patternUnits="userSpaceOnUse">
  22. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  23. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  24. </pattern>
  25. <linearGradient id="left_wall">
  26. <stop offset="0%" style="stop-color: #000; stop-opacity: 1.0"/>
  27. <stop offset="100%" style="stop-color: #000; stop-opacity: 0"/>
  28. </linearGradient>
  29. <linearGradient id="right_wall">
  30. <stop offset="0%" style="stop-color: #000; stop-opacity: 0"/>
  31. <stop offset="100%" style="stop-color: #000; stop-opacity: 1.0"/>
  32. </linearGradient>
  33. </defs>
  34. <rect x="0" y="0" width="100%" height="100%" fill="#808080" />
  35. <rect x="0" y="0" width="100%" height="40" fill="#C0C0C0" />
  36. <rect x="0" y="660" width="100%" height="40" fill="#C0C0C0" />
  37. <rect x="270" y="160" width="1380" height="380" fill="#C0C0C0" />
  38. <rect x="270" y="180" width="1380" height="15" fill="url(#stripe)"/>
  39. <rect x="270" y="505" width="1380" height="15" fill="url(#stripe2)"/>
  40. <rect x="0" y="50" width="100%" height="100" fill="url(#railway)" />
  41. <rect x="0" y="550" width="100%" height="100" fill="url(#railway)" />
  42. %%ANIMATION%%
  43. <rect x="0" y="0" width="270" height="100%" fill="url(#left_wall)"/>
  44. <rect x="1650" y="0" width="270" height="100%" fill="url(#right_wall)"/>
  45. </svg>
  46. jjdgfjjdfh;
  47. $SVG['E']=<<<khksdhfiwer
  48. <svg viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
  49. <defs>
  50. <pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse">
  51. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  52. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  53. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  54. </pattern>
  55. <pattern id="railway2" x="0" y="30" width="50" height="100" patternUnits="userSpaceOnUse">
  56. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  57. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  58. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  59. </pattern>
  60. <pattern id="stair_1m" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  61. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  62. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  63. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  64. </pattern>
  65. <pattern id="stripe" x="0" y="0" width="30" height="15" patternUnits="userSpaceOnUse">
  66. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  67. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  68. </pattern>
  69. <pattern id="stripe2" x="0" y="-10" width="30" height="15" patternUnits="userSpaceOnUse">
  70. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  71. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  72. </pattern>
  73. <linearGradient id="left_wall">
  74. <stop offset="0%" style="stop-color: #000; stop-opacity: 1.0"/>
  75. <stop offset="100%" style="stop-color: #000; stop-opacity: 0"/>
  76. </linearGradient>
  77. <linearGradient id="right_wall">
  78. <stop offset="0%" style="stop-color: #000; stop-opacity: 0"/>
  79. <stop offset="100%" style="stop-color: #000; stop-opacity: 1.0"/>
  80. </linearGradient>
  81. </defs>
  82. <rect x="0" y="0" width="100%" height="100%" fill="#808080" />
  83. <rect x="0" y="0" width="100%" height="40" fill="#C0C0C0" />
  84. <rect x="0" y="660" width="100%" height="40" fill="#C0C0C0" />
  85. <rect x="270" y="0" width="1380" height="220" fill="#C0C0C0" />
  86. <rect x="270" y="460" width="1380" height="220" fill="#C0C0C0" />
  87. <rect x="270" y="180" width="1380" height="15" fill="url(#stripe)"/>
  88. <rect x="270" y="485" width="1380" height="15" fill="url(#stripe2)"/>
  89. <rect x="0" y="230" width="100%" height="100" fill="url(#railway2)" />
  90. <rect x="0" y="350" width="100%" height="100" fill="url(#railway)" />
  91. %%ANIMATION%%
  92. <rect x="0" y="0" width="270" height="100%" fill="url(#left_wall)"/>
  93. <rect x="1650" y="0" width="270" height="100%" fill="url(#right_wall)"/>
  94. </svg>
  95. khksdhfiwer;
  96. //Parameters - Start Point, Station Stop, End Point, Motion Duration, move to station, station stop, move from station
  97. $SVG_ANI_PARAMS['L']=array( 2210, 290,-700, 11, 2, 6, 3 ); // L -> to the left R -> To the right movement
  98. $SVG_ANI_PARAMS['R']=array( -1920, 930,1920, 12, 3, 6, 2 ); // Not Same duration makes animation Lifelike
  99. $SVG_ANI['C']=<<<ksdhjfkhkie
  100. <rect x="2210" y="50" rx="10" width="700" height="100" style="fill:%%COLOR%%;">
  101. <animate dur="%%TOTA%%s" attributeName="x" calcMode="linear" values="%%ACORDS%%" keyTimes= "%%ATIMES%%" repeatCount="indefinite"/>
  102. <animate dur="%%DTOTA%%s" attributeName="opacity" fsrom="1" teo="0" calcMode="linear" values="1;1;0;0" keyTimes= "0;0.49;0.50;1" repeatCount="indefinite"/>
  103. </rect>
  104. <rect x="-1290" y="550" rx="10" width="700" height="100" style="fill:%%COLOR%%;">
  105. <animate begin="8s" dur="%%TOTB%%s" attributeName="x" calcMode="linear" values="%%BCORDS%%" keyTimes= "%%BTIMES%%" repeatCount="indefinite"/>
  106. <animate begin="8s" dur="%%DTOTB%%s" attributeName="opacity" fsrom="1" teo="0" calcMode="linear" values="1;1;0;0" keyTimes= "0;0.49;0.50;1" repeatCount="indefinite"/>
  107. </rect>
  108. ksdhjfkhkie;
  109. $SVG_ANI['E']=<<<ksjdhfksdhf
  110. <rect x="2210" y="230" rx="10" width="700" height="100" style="fill:%%COLOR%%;">
  111. <animate dur="%%TOTA%%s" attributeName="x" calcMode="linear" values="%%ACORDS%%" keyTimes= "%%ATIMES%%" repeatCount="indefinite"/>
  112. <animate dur="%%DTOTA%%s" attributeName="opacity" fsrom="1" teo="0" calcMode="linear" values="1;1;0;0" keyTimes= "0;0.49;0.50;1" repeatCount="indefinite"/>
  113. </rect>
  114. <rect x="-1290" y="350" rx="10" width="700" height="100" style="fill:%%COLOR%%;">
  115. <animate begin="8s" dur="%%TOTB%%s" attributeName="x" calcMode="linear" values="%%BCORDS%%" keyTimes= "%%BTIMES%%" repeatCount="indefinite"/>
  116. <animate begin="8s" dur="%%DTOTB%%s" attributeName="opacity" fsrom="1" teo="0" calcMode="linear" values="1;1;0;0" keyTimes= "0;0.49;0.50;1" repeatCount="indefinite"/>
  117. </rect>
  118. ksjdhfksdhf;
  119. if( $LC = count( $Colors ) ){
  120. switch( $PLayout ){
  121. case 'A': $P_B = $P_A = $SVG_ANI_PARAMS['L'];break;
  122. case 'B': $P_B = $P_A = $SVG_ANI_PARAMS['R'];break; // UK-JAP
  123. case 'C': $P_A = $SVG_ANI_PARAMS['L']; $P_B = $SVG_ANI_PARAMS['R'];break;
  124. case 'D': $P_A = $SVG_ANI_PARAMS['R']; $P_B = $SVG_ANI_PARAMS['L'];break; // UK-JAP
  125. case 'E': $P_A = $SVG_ANI_PARAMS['L']; $P_B = $SVG_ANI_PARAMS['R'];break;
  126. case 'F': $P_A = $SVG_ANI_PARAMS['R']; $P_B = $SVG_ANI_PARAMS['L'];break; // UK-JAP
  127. };
  128. $TOTAL_DURATION_A = $P_A[3]*$LC;
  129. $TOTAL_DURATION_B = $P_B[3]*$LC;
  130. $ATPL = $SVG_ANI[$PLayout];
  131. $CT = 1/$LC;
  132. $TS_A = $P_A[4]/$P_A[3];
  133. $SS_A = ($P_A[4]+$P_A[5])/$P_A[3];
  134. $FS_A = ($P_A[4]+$P_A[5]+$P_A[6])/$P_A[3];
  135. $TS_B = $P_B[4]/$P_B[3];
  136. $SS_B = ($P_B[4]+$P_B[5])/$P_B[3];
  137. $FS_B = ($P_B[4]+$P_B[5]+$P_B[6])/$P_B[3];
  138. // Stop start stop-end
  139. $T_A = array($TS_A/$LC, $SS_A/$LC, $FS_A/$LC);
  140. $T_B = array($TS_B/$LC, $SS_B/$LC, $FS_B/$LC);
  141. $ANI = array();
  142. $idx = 0;
  143. foreach( $Colors as $CC ){
  144. $BT = $idx*$CT;
  145. $P_A_COORDS = $P_A[0].";".$P_A[0].";".$P_A[1].";".$P_A[1].";".$P_A[2].";".$P_A[2];
  146. $P_B_COORDS = $P_B[0].";".$P_B[0].";".$P_B[1].";".$P_B[1].";".$P_B[2].";".$P_B[2];
  147. $P_A_TIMING = "0;".$BT.";".($BT+$T_A[0]).";".($BT+$T_A[1]).";".($BT+$T_A[2]).";1";
  148. $P_B_TIMING = "0;".$BT.";".($BT+$T_B[0]).";".($BT+$T_B[1]).";".($BT+$T_B[2]).";1";
  149. $ANI[$idx] = str_ireplace('%%COLOR%%',$CC,$SVG_ANI[$PLayout] );//Load template
  150. $ANI[$idx] = str_ireplace('%%ACORDS%%',$P_A_COORDS,$ANI[$idx]);
  151. $ANI[$idx] = str_ireplace('%%ATIMES%%',$P_A_TIMING,$ANI[$idx]);
  152. $ANI[$idx] = str_ireplace('%%BCORDS%%',$P_B_COORDS,$ANI[$idx]);
  153. $ANI[$idx] = str_ireplace('%%BTIMES%%',$P_B_TIMING,$ANI[$idx]);
  154. $ANI[$idx] = str_ireplace('%%TOTA%%',$TOTAL_DURATION_A,$ANI[$idx]);
  155. $ANI[$idx] = str_ireplace('%%DTOTA%%',$TOTAL_DURATION_A*2,$ANI[$idx]);
  156. $ANI[$idx] = str_ireplace('%%TOTB%%',$TOTAL_DURATION_B,$ANI[$idx]);
  157. $ANI[$idx] = str_ireplace('%%DTOTB%%',$TOTAL_DURATION_B*2,$ANI[$idx]);
  158. $idx++;
  159. }
  160. $SVG[$PLayout]=str_ireplace('%%ANIMATION%%', implode( '', $ANI ),$SVG[$PLayout]);
  161. } else {
  162. $SVG[$PLayout]=str_ireplace('%%ANIMATION%%','',$SVG[$PLayout]);
  163. };
  164. $Output = str_ireplace("\n",'',$SVG[$PLayout]);
  165. return $Output;
  166. };
  167. function getPlatformLineInfo( $PID ){
  168. global $DATABASE;
  169. $QS = "SELECT `ln`.`id`,`ln`.`short`,`ln`.`color` FROM `metro_lines` `ln` LEFT JOIN `metro_platforms_2_lines` `sl` ON ( `ln`.`id`=`sl`.`line_id` ) WHERE `sl`.`platform_id`={$PID} ORDER BY `ln`.`short`";
  170. $R = $DATABASE->Query( $QS );
  171. //get station index for each line
  172. $idx = 0;
  173. foreach( $R as $T ){
  174. $QS = "SELECT `sl`.`station_id`, `sl`.`index` FROM `metro_stations_2_lines` `sl` LEFT JOIN `metro_platforms` `mp` ON ( `mp`.`station_id` = `sl`.`station_id` ) WHERE `mp`.`id`={$PID} AND `sl`.`line_id`={$T['id']}";
  175. $Z = $DATABASE->Query( $QS );
  176. if( count( $Z ) ) {
  177. $R[$idx]['index']=$Z[0]['index'];
  178. $R[$idx]['station_id']=$Z[0]['station_id'];
  179. } else {
  180. $R[$idx]['index']= 0;
  181. $R[$idx]['station_id']= 0;
  182. };
  183. $idx++;
  184. };
  185. return $R;
  186. };
  187. function getPlatformInfo( $PID ){
  188. global $DATABASE;
  189. $QS = "SELECT `ln`.`id`,`ln`.`short`,`ln`.`color` FROM `metro_lines` `ln` LEFT JOIN `metro_platforms_2_lines` `sl` ON ( `ln`.`id`=`sl`.`line_id` ) WHERE `sl`.`platform_id`={$PID} ORDER BY `ln`.`short`";
  190. $R = $DATABASE->Query( $QS );
  191. //get station index for each line
  192. $idx = 0;
  193. $P_PARTS = array();
  194. $P_pidx = -1;
  195. $P_CSID = 0;
  196. $N_PARTS = array();
  197. $N_pidx = -1;
  198. $N_CSID = 0;
  199. foreach( $R as $T ){
  200. $QS = "SELECT `sl`.`station_id`, `sl`.`index` FROM `metro_stations_2_lines` `sl` LEFT JOIN `metro_platforms` `mp` ON ( `mp`.`station_id` = `sl`.`station_id` ) WHERE `mp`.`id`={$PID} AND `sl`.`line_id`={$T['id']}";
  201. $Z = $DATABASE->Query( $QS );
  202. if( count( $Z ) ) {
  203. $R[$idx]['index']=$Z[0]['index'];
  204. $R[$idx]['station_id']=$Z[0]['station_id'];
  205. } else {
  206. $R[$idx]['index']= 0;
  207. $R[$idx]['station_id']= 0;
  208. };
  209. // Have Index
  210. if( $R[$idx]['index'] ){
  211. $NSI = getLineStationInfo( $R[$idx]['id'], $R[$idx]['index']-1 );
  212. if( count( $NSI ) ){
  213. if( $N_CSID != $NSI['id'] ){
  214. $N_CSID = $NSI['id'];
  215. $N_pidx++;
  216. };
  217. $N_PARTS[$N_pidx]['name']=$NSI['name'];
  218. $N_PARTS[$N_pidx]['colors'][]=$T['color'];
  219. };
  220. $NSI = getLineStationInfo( $R[$idx]['id'], $R[$idx]['index']+1 );
  221. if( count( $NSI ) ){
  222. if( $P_CSID != $NSI['id'] ){
  223. $P_CSID = $NSI['id'];
  224. $P_pidx++;
  225. };
  226. $P_PARTS[$P_pidx]['name']=$NSI['name'];
  227. $P_PARTS[$P_pidx]['colors'][]=$T['color'];
  228. };
  229. };
  230. $idx++;
  231. };
  232. $R['INFO_COUNT'] = count( $R );
  233. $R['NEXT_IS_MULTI']=( count( $N_PARTS ) > 1 );
  234. $R['NEXT'] = array();
  235. foreach( $N_PARTS as $P ){
  236. $CZ['name']=$P['name'];
  237. if( ( $CC = count( $P['colors'] ) ) > 1 ){
  238. $CP = 100 / $CC;
  239. $COMAP = array();
  240. for( $ix = 0; $ix < $CC; $ix++ ){
  241. $SPO= intval( $ix * $CP );
  242. $NPO= intval( ( $ix+1 ) * $CP ) - 1;
  243. if( $SPO < 2 ){
  244. $COMAP[] = "#{$P['colors'][$ix]}, #{$P['colors'][$ix]} {$NPO}%";
  245. } else if( $SPO > 90 ){
  246. $COMAP[] = "#{$P['colors'][$ix]} {$SPO}%, #{$P['colors'][$ix]}";
  247. } else {
  248. $COMAP[] = "#{$P['colors'][$ix]} {$SPO}%, #{$P['colors'][$ix]} {$NPO}%";
  249. };
  250. };
  251. $GRADIENT = implode( ',', $COMAP );//writing-mode: vertical-lr;text-orientation: upright;
  252. $CZ['bg_style']="background-image: linear-gradient({$GRADIENT});";
  253. } else {
  254. $CZ['bg_style']="background-color:#{$P['colors'][0]};";
  255. };
  256. $R['NEXT'][]=$CZ;
  257. };
  258. $R['PREV_IS_MULTI']=( count( $P_PARTS ) > 1 );
  259. $R['PREV'] = array();
  260. foreach( $P_PARTS as $P ){
  261. $CZ['name']=$P['name'];
  262. if( ( $CC = count( $P['colors'] ) ) > 1 ){
  263. $CP = 100 / $CC;
  264. $COMAP = array();
  265. for( $ix = 0; $ix < $CC; $ix++ ){
  266. $SPO= intval( $ix * $CP );
  267. $NPO= intval( ( $ix+1 ) * $CP ) - 1;
  268. if( $SPO < 2 ){
  269. $COMAP[] = "#{$P['colors'][$ix]}, #{$P['colors'][$ix]} {$NPO}%";
  270. } else if( $SPO > 90 ){
  271. $COMAP[] = "#{$P['colors'][$ix]} {$SPO}%, #{$P['colors'][$ix]}";
  272. } else {
  273. $COMAP[] = "#{$P['colors'][$ix]} {$SPO}%, #{$P['colors'][$ix]} {$NPO}%";
  274. };
  275. };
  276. $GRADIENT = implode( ',', $COMAP );//writing-mode: vertical-lr;text-orientation: upright;
  277. $CZ['bg_style']="background-image: linear-gradient({$GRADIENT});";
  278. } else {
  279. $CZ['bg_style']="background-color:#{$P['colors'][0]};";
  280. };
  281. $R['PREV'][]=$CZ;
  282. };
  283. return $R;
  284. };
  285. function getLineStationInfo( $LID, $IDX ){
  286. global $DATABASE;
  287. $QS = "SELECT `st`.`id`, `st`.`name` FROM `metro_stations` `st` LEFT JOIN `metro_stations_2_lines` `sl` ON ( `st`.`id`=`sl`.`station_id` ) WHERE `sl`.`line_id`={$LID} AND `sl`.`index`={$IDX}";
  288. $RZ = $DATABASE->Query( $QS );
  289. $INFO = array();
  290. if( count( $RZ ) ) $INFO = $RZ[0];
  291. return $INFO;
  292. }
  293. function createPlatformStationBlock( $PID, $D ){
  294. $PINFO = getPlatformLineInfo( $PID );
  295. $PARTS = array();
  296. $pidx = -1;
  297. $CSID = 0;
  298. if( $D < 0 ){
  299. $R_P = "</td><td class=\"ar_to_right\">&nbsp;</td></tr></table>";
  300. $L_P = "<table border=0 width=\"100%\"><tr><td align=\"right\">";
  301. } else {
  302. $R_P = "</td></tr></table>";
  303. $L_P = "<table border=0 width=\"100%\"><tr><td class=\"ar_to_left\">&nbsp;</td><td align=\"left\">";
  304. };
  305. foreach( $PINFO as $II ){
  306. // If has more stations on the line
  307. //if( $II['index'] > 1 ) {
  308. $SI = getLineStationInfo( $II['id'], $II['index'] + $D );
  309. if( count( $SI ) ){
  310. if( $CSID != $SI['id'] ){
  311. $CSID = $SI['id'];
  312. $pidx++;
  313. };
  314. $PARTS[$pidx]['name']=$SI['name'];
  315. $PARTS[$pidx]['colors'][]=$II['color'];
  316. };
  317. //};
  318. };
  319. $Output = '';
  320. foreach( $PARTS as $P ){
  321. if( ( $CC = count( $P['colors'] ) ) > 1 ){
  322. $CP = 100 / $CC;
  323. $COMAP = array();
  324. for( $ix = 0; $ix < $CC; $ix++ ){
  325. $SPO= intval( $ix * $CP );
  326. $NPO= intval( ( $ix+1 ) * $CP ) - 1;
  327. if( $SPO < 2 ){
  328. $COMAP[] = "#{$P['colors'][$ix]}, #{$P['colors'][$ix]} {$NPO}%";
  329. } else if( $SPO > 90 ){
  330. $COMAP[] = "#{$P['colors'][$ix]} {$SPO}%, #{$P['colors'][$ix]}";
  331. } else {
  332. $COMAP[] = "#{$P['colors'][$ix]} {$SPO}%, #{$P['colors'][$ix]} {$NPO}%";
  333. };
  334. };
  335. $GRADIENT = implode( ',', $COMAP );//writing-mode: vertical-lr;text-orientation: upright;
  336. $Output .= "<td width=\"100%\" class=\"setEd_infoPanel\" style=\"overflow: hidden; padding: 4px; color:#fff; font-weight: bold; background-image: linear-gradient({$GRADIENT});\">{$L_P}{$P['name']}{$R_P}</td>";
  337. } else {
  338. $Output .= "<td class=\"setEd_infoPanel\" style=\"color:#fff;font-weight:bold;background-color:#{$P['colors'][0]};\">{$L_P}{$P['name']}{$R_P}</td>";
  339. };
  340. };
  341. return $Output;
  342. };
  343. function getModleOnlineStatus( $MID ){
  344. global $DATABASE;
  345. $QS = "SELECT `status`,`ts`,`SID` FROM `mem_online_cloud` WHERE `object_id`={$MID} AND `object_type`=2";
  346. $RV = $DATABASE->Query( $QS, false );
  347. if( count( $RV ) ) return $RV[0];
  348. return array();
  349. }
  350. ?>