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.

971 lines
45 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
12 months ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 months ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 months ago
​
​
​
​
​
​
12 months ago
​
​
​
​
​
​
12 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
  1. <?php
  2. //Important!! Saving this file with Unix EOL type
  3. function createModuleBackground( $Layout, $CornerID, $Title ){
  4. $SVG['C'][0]=<<<DATA_BIUNDARY
  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="0" 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="50%" y="410" width="50%" height="290" fill="#C0C0C0" />
  36. <rect x="0" y="0" width="100%" height="290" fill="#404040" />
  37. <rect x="50%" y="450" width="50%" height="15" fill="url(#stripe)"/>
  38. <rect x="0" y="300" width="100%" height="100" fill="url(#railway)" />
  39. <rect x="0" y="410" width="50%" height="290" fill="#404040"/>
  40. <rect x="0" y="0" width="50%" height="100%" fill="url(#left_wall)"/>
  41. <text class=\"passive_area_text\" x=\"25%\" y=\"25%\">{$Title}</text>
  42. </svg>
  43. DATA_BIUNDARY;
  44. $SVG['C'][1]=<<<DATA_BIUNDARY
  45. <svg viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
  46. <defs>
  47. <pattern id="railway" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  48. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  49. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  50. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  51. </pattern>
  52. <pattern id="stair_1m" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  53. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  54. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  55. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  56. </pattern>
  57. <pattern id="stripe" x="0" y="0" width="30" height="15" patternUnits="userSpaceOnUse">
  58. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  59. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  60. </pattern>
  61. <pattern id="stripe2" x="0" y="-5" width="30" height="15" patternUnits="userSpaceOnUse">
  62. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  63. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  64. </pattern>
  65. <linearGradient id="left_wall">
  66. <stop offset="0%" style="stop-color: #000; stop-opacity: 1.0"/>
  67. <stop offset="100%" style="stop-color: #000; stop-opacity: 0"/>
  68. </linearGradient>
  69. <linearGradient id="right_wall">
  70. <stop offset="0%" style="stop-color: #000; stop-opacity: 0"/>
  71. <stop offset="100%" style="stop-color: #000; stop-opacity: 1.0"/>
  72. </linearGradient>
  73. </defs>
  74. <rect x="0" y="0" width="100%" height="100%" fill="#808080" />
  75. <rect x="0" y="410" width="50%" height="290" fill="#C0C0C0" />
  76. <rect x="0" y="0" width="100%" height="290" fill="#404040" />
  77. <rect x="0" y="450" width="50%" height="15" fill="url(#stripe)"/>
  78. <rect x="0" y="300" width="100%" height="100" fill="url(#railway)" />
  79. <rect x="50%" y="410" width="50%" height="290" fill="#404040"/>
  80. <rect x="50%" y="0" width="50%" height="100%" fill="url(#right_wall)"/>
  81. <text class=\"passive_area_text\" x=\"75%\" y=\"25%\">{$Title}</text>
  82. </svg>
  83. DATA_BIUNDARY;
  84. $SVG['C'][2]=<<<DATA_BIUNDARY
  85. <svg viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
  86. <defs>
  87. <pattern id="railway" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  88. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  89. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  90. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  91. </pattern>
  92. <pattern id="stair_1m" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  93. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  94. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  95. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  96. </pattern>
  97. <pattern id="stripe" x="0" y="0" width="30" height="15" patternUnits="userSpaceOnUse">
  98. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  99. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  100. </pattern>
  101. <pattern id="stripe2" x="0" y="-5" width="30" height="15" patternUnits="userSpaceOnUse">
  102. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  103. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  104. </pattern>
  105. <linearGradient id="left_wall">
  106. <stop offset="0%" style="stop-color: #000; stop-opacity: 1.0"/>
  107. <stop offset="100%" style="stop-color: #000; stop-opacity: 0"/>
  108. </linearGradient>
  109. <linearGradient id="right_wall">
  110. <stop offset="0%" style="stop-color: #000; stop-opacity: 0"/>
  111. <stop offset="100%" style="stop-color: #000; stop-opacity: 1.0"/>
  112. </linearGradient>
  113. </defs>
  114. <rect x="0" y="0" width="100%" height="100%" fill="#808080" />
  115. <rect x="0" y="0" width="50%" height="290" fill="#C0C0C0" />
  116. <rect x="0" y="410" width="100%" height="290" fill="#404040" />
  117. <rect x="0" y="240" width="50%" height="15" fill="url(#stripe)"/>
  118. <rect x="0" y="300" width="100%" height="100" fill="url(#railway)" />
  119. <rect x="50%" y="0" width="50%" height="290" fill="#404040"/>
  120. <rect x="50%" y="0" width="50%" height="100%" fill="url(#right_wall)"/>
  121. <text class=\"passive_area_text\" x=\"75%\" y=\"25%\">{$Title}</text>
  122. </svg>
  123. DATA_BIUNDARY;
  124. $SVG['C'][3]=<<<DATA_BIUNDARY
  125. <svg viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
  126. <defs>
  127. <pattern id="railway" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  128. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  129. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  130. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  131. </pattern>
  132. <pattern id="stair_1m" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  133. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  134. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  135. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  136. </pattern>
  137. <pattern id="stripe" x="0" y="0" width="30" height="15" patternUnits="userSpaceOnUse">
  138. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  139. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  140. </pattern>
  141. <pattern id="stripe2" x="0" y="-5" width="30" height="15" patternUnits="userSpaceOnUse">
  142. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  143. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  144. </pattern>
  145. <linearGradient id="left_wall">
  146. <stop offset="0%" style="stop-color: #000; stop-opacity: 1.0"/>
  147. <stop offset="100%" style="stop-color: #000; stop-opacity: 0"/>
  148. </linearGradient>
  149. <linearGradient id="right_wall">
  150. <stop offset="0%" style="stop-color: #000; stop-opacity: 0"/>
  151. <stop offset="100%" style="stop-color: #000; stop-opacity: 1.0"/>
  152. </linearGradient>
  153. </defs>
  154. <rect x="0" y="0" width="100%" height="100%" fill="#808080" />
  155. <rect x="50%" y="0" width="50%" height="290" fill="#C0C0C0" />
  156. <rect x="0" y="410" width="100%" height="290" fill="#404040" />
  157. <rect x="50%" y="240" width="50%" height="15" fill="url(#stripe)"/>
  158. <rect x="0" y="300" width="100%" height="100" fill="url(#railway)" />
  159. <rect x="0" y="0" width="50%" height="290" fill="#404040"/>
  160. <rect x="0" y="0" width="50%" height="100%" fill="url(#left_wall)"/>
  161. <text class=\"passive_area_text\" x=\"25%\" y=\"25%\">{$Title}</text>
  162. </svg>
  163. DATA_BIUNDARY;
  164. return str_ireplace( "\n",'',$SVG[$Layout][$CornerID] );
  165. };
  166. function createTrackBackground( $Layout, $Side, $LTitle, $RTitle ){
  167. $SVG['C']['U']=<<<DATA_BIUNDARY
  168. <svg id="svgTrackMap" viewBox="0 0 1920 200" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
  169. <defs>
  170. <pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse">
  171. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  172. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  173. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  174. </pattern>
  175. <pattern id="stair_1m" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  176. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  177. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  178. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  179. </pattern>
  180. <pattern id="stripe" x="0" y="5" width="30" height="15" patternUnits="userSpaceOnUse">
  181. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  182. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  183. </pattern>
  184. <pattern id="stripe2" x="0" y="-5" width="30" height="15" patternUnits="userSpaceOnUse">
  185. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  186. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  187. </pattern>
  188. <linearGradient id="left_wall">
  189. <stop offset="0%" style="stop-color: #000; stop-opacity: 1.0"/>
  190. <stop offset="100%" style="stop-color: #000; stop-opacity: 0"/>
  191. </linearGradient>
  192. <linearGradient id="right_wall">
  193. <stop offset="0%" style="stop-color: #000; stop-opacity: 0"/>
  194. <stop offset="100%" style="stop-color: #000; stop-opacity: 1.0"/>
  195. </linearGradient>
  196. </defs>
  197. <rect x="0" y="0" width="100%" height="100%" fill="#808080" />
  198. <rect x="0" y="155" width="100%" height="45" fill="#404040"/>
  199. <rect x="0" y="0" width="100%" height="45" fill="#404040" />
  200. <rect x="25%" y="0" width="50%" height="45" fill="#C0C0C0" />
  201. <rect x="25%" y="20" width="50%" height="15" fill="url(#stripe)"/>
  202. <rect x="0" y="50" width="100%" height="100" fill="url(#railway)" />
  203. <rect x="0" y="0" width="25%" height="100%" fill="url(#left_wall)"/>
  204. <rect x="75%" y="0" width="25%" height="100%" fill="url(#right_wall)"/>
  205. <text id="scheme_anch" class=\"track_area_text\" x=\"15%\" y=\"50%\">{$LTitle}</text>
  206. <text class=\"track_area_text\" x=\"85%\" y=\"50%\">{$RTitle}</text>
  207. </svg>
  208. DATA_BIUNDARY;
  209. $SVG['C']['B']=<<<DATA_BIUNDARY
  210. <svg id="svgTrackMap" viewBox="0 0 1920 200" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
  211. <defs>
  212. <pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse">
  213. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  214. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  215. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  216. </pattern>
  217. <pattern id="stair_1m" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  218. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  219. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  220. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  221. </pattern>
  222. <pattern id="stripe" x="0" y="5" width="30" height="15" patternUnits="userSpaceOnUse">
  223. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  224. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  225. </pattern>
  226. <pattern id="stripe2" x="0" y="-5" width="30" height="15" patternUnits="userSpaceOnUse">
  227. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  228. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  229. </pattern>
  230. <linearGradient id="left_wall">
  231. <stop offset="0%" style="stop-color: #000; stop-opacity: 1.0"/>
  232. <stop offset="100%" style="stop-color: #000; stop-opacity: 0"/>
  233. </linearGradient>
  234. <linearGradient id="right_wall">
  235. <stop offset="0%" style="stop-color: #000; stop-opacity: 0"/>
  236. <stop offset="100%" style="stop-color: #000; stop-opacity: 1.0"/>
  237. </linearGradient>
  238. </defs>
  239. <rect x="0" y="0" width="100%" height="100%" fill="#808080" />
  240. <rect x="0" y="155" width="100%" height="45" fill="#404040"/>
  241. <rect x="0" y="0" width="100%" height="45" fill="#404040" />
  242. <rect x="25%" y="0" width="50%" height="45" fill="#C0C0C0" />
  243. <rect x="25%" y="20" width="50%" height="15" fill="url(#stripe)"/>
  244. <rect x="0" y="50" width="100%" height="100" fill="url(#railway)" />
  245. <rect x="0" y="0" width="25%" height="100%" fill="url(#left_wall)"/>
  246. <rect x="75%" y="0" width="25%" height="100%" fill="url(#right_wall)"/>
  247. <text id="scheme_anch" class=\"track_area_text\" x=\"15%\" y=\"50%\">{$LTitle}</text>
  248. <text class=\"track_area_text\" x=\"85%\" y=\"50%\">{$RTitle}</text>
  249. </svg>
  250. DATA_BIUNDARY;
  251. $SVG['E']['U']=<<<DATA_BIUNDARY
  252. <svg viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
  253. <defs>
  254. <pattern id="railway" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  255. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  256. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  257. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  258. </pattern>
  259. <pattern id="stair_1m" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  260. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  261. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  262. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  263. </pattern>
  264. <pattern id="stripe" x="0" y="0" width="30" height="15" patternUnits="userSpaceOnUse">
  265. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  266. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  267. </pattern>
  268. <pattern id="stripe2" x="0" y="-5" width="30" height="15" patternUnits="userSpaceOnUse">
  269. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  270. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  271. </pattern>
  272. <linearGradient id="left_wall">
  273. <stop offset="0%" style="stop-color: #000; stop-opacity: 1.0"/>
  274. <stop offset="100%" style="stop-color: #000; stop-opacity: 0"/>
  275. </linearGradient>
  276. <linearGradient id="right_wall">
  277. <stop offset="0%" style="stop-color: #000; stop-opacity: 0"/>
  278. <stop offset="100%" style="stop-color: #000; stop-opacity: 1.0"/>
  279. </linearGradient>
  280. </defs>
  281. <rect x="0" y="0" width="100%" height="100%" fill="#808080" />
  282. <rect x="0" y="0" width="50%" height="290" fill="#C0C0C0" />
  283. <rect x="0" y="410" width="100%" height="290" fill="#404040" />
  284. <rect x="0" y="240" width="50%" height="15" fill="url(#stripe)"/>
  285. <rect x="0" y="300" width="100%" height="100" fill="url(#railway)" />
  286. <rect x="50%" y="0" width="50%" height="290" fill="#404040"/>
  287. <rect x="50%" y="0" width="50%" height="100%" fill="url(#right_wall)"/>
  288. <text class=\"passive_area_text\" x=\"75%\" y=\"25%\">{$Title}</text>
  289. </svg>
  290. DATA_BIUNDARY;
  291. $SVG['E']['B']=<<<DATA_BIUNDARY
  292. <svg viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
  293. <defs>
  294. <pattern id="railway" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  295. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  296. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  297. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  298. </pattern>
  299. <pattern id="stair_1m" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  300. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  301. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  302. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  303. </pattern>
  304. <pattern id="stripe" x="0" y="0" width="30" height="15" patternUnits="userSpaceOnUse">
  305. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  306. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  307. </pattern>
  308. <pattern id="stripe2" x="0" y="-5" width="30" height="15" patternUnits="userSpaceOnUse">
  309. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  310. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  311. </pattern>
  312. <linearGradient id="left_wall">
  313. <stop offset="0%" style="stop-color: #000; stop-opacity: 1.0"/>
  314. <stop offset="100%" style="stop-color: #000; stop-opacity: 0"/>
  315. </linearGradient>
  316. <linearGradient id="right_wall">
  317. <stop offset="0%" style="stop-color: #000; stop-opacity: 0"/>
  318. <stop offset="100%" style="stop-color: #000; stop-opacity: 1.0"/>
  319. </linearGradient>
  320. </defs>
  321. <rect x="0" y="0" width="100%" height="100%" fill="#808080" />
  322. <rect x="50%" y="0" width="50%" height="290" fill="#C0C0C0" />
  323. <rect x="0" y="410" width="100%" height="290" fill="#404040" />
  324. <rect x="50%" y="240" width="50%" height="15" fill="url(#stripe)"/>
  325. <rect x="0" y="300" width="100%" height="100" fill="url(#railway)" />
  326. <rect x="0" y="0" width="50%" height="290" fill="#404040"/>
  327. <rect x="0" y="0" width="50%" height="100%" fill="url(#left_wall)"/>
  328. <text class=\"passive_area_text\" x=\"25%\" y=\"25%\">{$Title}</text>
  329. </svg>
  330. DATA_BIUNDARY;
  331. return str_ireplace( "\n",'',$SVG[$Layout][$Side] );
  332. };
  333. function createPlatformBackground( $Layout, $pid=0, $Modules=array() ){
  334. $SVG['C']=<<<DATA_BOUNDARY
  335. <svg id="svgTrackMap" viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
  336. <defs>
  337. <pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse">
  338. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  339. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  340. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  341. </pattern>
  342. <pattern id="stair_1m" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  343. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  344. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  345. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  346. </pattern>
  347. <pattern id="stripe" x="0" y="0" width="30" height="15" patternUnits="userSpaceOnUse">
  348. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  349. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  350. </pattern>
  351. <pattern id="stripe2" x="0" y="-5" width="30" height="15" patternUnits="userSpaceOnUse">
  352. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  353. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  354. </pattern>
  355. <linearGradient id="left_wall">
  356. <stop offset="0%" style="stop-color: #000; stop-opacity: 1.0"/>
  357. <stop offset="100%" style="stop-color: #000; stop-opacity: 0"/>
  358. </linearGradient>
  359. <linearGradient id="right_wall">
  360. <stop offset="0%" style="stop-color: #000; stop-opacity: 0"/>
  361. <stop offset="100%" style="stop-color: #000; stop-opacity: 1.0"/>
  362. </linearGradient>
  363. </defs>
  364. <rect x="0" y="0" width="100%" height="100%" fill="#808080" />
  365. <rect x="0" y="0" width="100%" height="40" fill="#C0C0C0" />
  366. <rect x="0" y="660" width="100%" height="40" fill="#C0C0C0" />
  367. <rect x="270" y="160" width="1380" height="380" fill="#C0C0C0" />
  368. <rect x="270" y="180" width="1380" height="15" fill="url(#stripe)"/>
  369. <rect x="270" y="505" width="1380" height="15" fill="url(#stripe2)"/>
  370. <rect x="0" y="50" width="100%" height="100" fill="url(#railway)" />
  371. <rect x="0" y="550" width="100%" height="100" fill="url(#railway)" />
  372. <rect x="0" y="0" width="270" height="100%" fill="url(#left_wall)"/>
  373. <rect x="1650" y="0" width="270" height="100%" fill="url(#right_wall)"/>
  374. %%%AREA%1%%%
  375. %%%AREA%2%%%
  376. %%%AREA%3%%%
  377. %%%AREA%4%%%
  378. </svg>
  379. DATA_BOUNDARY;
  380. $SVG['E']=<<<DATA_BOUNDARY
  381. <svg id="svgTrackMap" viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
  382. <defs>
  383. <pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse">
  384. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  385. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  386. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  387. </pattern>
  388. <pattern id="railway2" x="0" y="30" width="50" height="100" patternUnits="userSpaceOnUse">
  389. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  390. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  391. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  392. </pattern>
  393. <pattern id="stair_1m" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  394. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  395. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  396. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  397. </pattern>
  398. <pattern id="stripe" x="0" y="0" width="30" height="15" patternUnits="userSpaceOnUse">
  399. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  400. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  401. </pattern>
  402. <pattern id="stripe2" x="0" y="-10" width="30" height="15" patternUnits="userSpaceOnUse">
  403. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  404. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  405. </pattern>
  406. <linearGradient id="left_wall">
  407. <stop offset="0%" style="stop-color: #000; stop-opacity: 1.0"/>
  408. <stop offset="100%" style="stop-color: #000; stop-opacity: 0"/>
  409. </linearGradient>
  410. <linearGradient id="right_wall">
  411. <stop offset="0%" style="stop-color: #000; stop-opacity: 0"/>
  412. <stop offset="100%" style="stop-color: #000; stop-opacity: 1.0"/>
  413. </linearGradient>
  414. </defs>
  415. <rect x="0" y="0" width="100%" height="100%" fill="#808080" />
  416. <rect x="0" y="0" width="100%" height="40" fill="#C0C0C0" />
  417. <rect x="0" y="660" width="100%" height="40" fill="#C0C0C0" />
  418. <rect x="270" y="0" width="1380" height="220" fill="#C0C0C0" />
  419. <rect x="270" y="460" width="1380" height="220" fill="#C0C0C0" />
  420. <rect x="270" y="180" width="1380" height="15" fill="url(#stripe)"/>
  421. <rect x="270" y="485" width="1380" height="15" fill="url(#stripe2)"/>
  422. <rect x="0" y="230" width="100%" height="100" fill="url(#railway2)" />
  423. <rect x="0" y="350" width="100%" height="100" fill="url(#railway)" />
  424. <rect x="0" y="0" width="270" height="100%" fill="url(#left_wall)"/>
  425. <rect x="1650" y="0" width="270" height="100%" fill="url(#right_wall)"/>
  426. %%%AREA%1%%%
  427. %%%AREA%2%%%
  428. %%%AREA%3%%%
  429. %%%AREA%4%%%
  430. </svg>
  431. DATA_BOUNDARY;
  432. if( isset( $Modules[0] ) ){
  433. $as =($Modules[0]['status'])?'active_area':'passive_area';
  434. $RPL = "<g class=\"svg_area_group\" onclick=\"loadModuleView({$pid},{$Modules[0]['id']});\"><text class=\"passive_area_text\" x=\"25%\" y=\"25%\">{$Modules[0]['name']}</text><rect class=\"{$as}\" x=\"0\" y=\"0\" width=\"50%\" height=\"50%\" fill-opacity=\"0.5\" stroke=\"none\"/></g>";
  435. $SVG[$Layout] = str_ireplace("%%%AREA%1%%%",$RPL,$SVG[$Layout]);
  436. } else {
  437. $SVG[$Layout] = str_ireplace("%%%AREA%1%%%",'',$SVG[$Layout]);
  438. };
  439. if( isset( $Modules[1] ) ){
  440. $as =($Modules[1]['status'])?'active_area':'passive_area';
  441. $RPL = "<g class=\"svg_area_group\" onclick=\"loadModuleView({$pid},{$Modules[1]['id']});\"><text class=\"passive_area_text\" x=\"75%\" y=\"25%\">{$Modules[1]['name']}</text><rect class=\"{$as}\" x=\"50%\" y=\"0\" width=\"50%\" height=\"50%\" fill-opacity=\"0.5\" stroke=\"none\"/></g>";
  442. $SVG[$Layout] = str_ireplace("%%%AREA%2%%%",$RPL,$SVG[$Layout]);
  443. } else {
  444. $SVG[$Layout] = str_ireplace("%%%AREA%2%%%",'',$SVG[$Layout]);
  445. };
  446. if( isset( $Modules[2] ) ){
  447. $as =($Modules[2]['status'])?'active_area':'passive_area';
  448. $RPL = "<g class=\"svg_area_group\" onclick=\"loadModuleView({$pid},{$Modules[2]['id']});\"><text class=\"passive_area_text\" x=\"25%\" y=\"75%\">{$Modules[2]['name']}</text><rect class=\"{$as}\" x=\"0\" y=\"50%\" width=\"50%\" height=\"50%\" fill-opacity=\"0.5\" stroke=\"none\"/></g>";
  449. $SVG[$Layout] = str_ireplace("%%%AREA%3%%%",$RPL,$SVG[$Layout]);
  450. } else {
  451. $SVG[$Layout] = str_ireplace("%%%AREA%3%%%",'',$SVG[$Layout]);
  452. };
  453. if( isset( $Modules[3] ) ){
  454. $as =($Modules[3]['status'])?'active_area':'passive_area';
  455. $RPL = "<g class=\"svg_area_group\" onclick=\"loadModuleView({$pid},{$Modules[3]['id']});\"><text class=\"passive_area_text\" x=\"75%\" y=\"75%\">{$Modules[3]['name']}</text><rect class=\"{$as}\" x=\"50%\" y=\"50%\" width=\"50%\" height=\"50%\" fill-opacity=\"0.5\" stroke=\"none\"/></g>";
  456. $SVG[$Layout] = str_ireplace("%%%AREA%4%%%",$RPL,$SVG[$Layout]);
  457. } else {
  458. $SVG[$Layout] = str_ireplace("%%%AREA%4%%%",'',$SVG[$Layout]);
  459. };
  460. return str_ireplace("\n",'',$SVG[$Layout]);
  461. };
  462. function createPlatformAnimation( $PLayout, $PNames=array(), $Colors=array() ){
  463. $SVG['C']=<<<jjdgfjjdfh
  464. <svg id="svgTrackMap" viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
  465. <defs>
  466. <pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse">
  467. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  468. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  469. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  470. </pattern>
  471. <pattern id="stair_1m" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  472. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  473. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  474. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  475. </pattern>
  476. <pattern id="stripe" x="0" y="0" width="30" height="15" patternUnits="userSpaceOnUse">
  477. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  478. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  479. </pattern>
  480. <pattern id="stripe2" x="0" y="-5" width="30" height="15" patternUnits="userSpaceOnUse">
  481. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  482. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  483. </pattern>
  484. <linearGradient id="left_wall">
  485. <stop offset="0%" style="stop-color: #000; stop-opacity: 1.0"/>
  486. <stop offset="100%" style="stop-color: #000; stop-opacity: 0"/>
  487. </linearGradient>
  488. <linearGradient id="right_wall">
  489. <stop offset="0%" style="stop-color: #000; stop-opacity: 0"/>
  490. <stop offset="100%" style="stop-color: #000; stop-opacity: 1.0"/>
  491. </linearGradient>
  492. </defs>
  493. <rect x="0" y="0" width="100%" height="100%" fill="#808080" />
  494. <rect x="0" y="0" width="100%" height="40" fill="#C0C0C0" />
  495. <rect x="0" y="660" width="100%" height="40" fill="#C0C0C0" />
  496. <rect x="270" y="160" width="1380" height="380" fill="#C0C0C0" />
  497. <rect x="270" y="180" width="1380" height="15" fill="url(#stripe)"/>
  498. <rect x="270" y="505" width="1380" height="15" fill="url(#stripe2)"/>
  499. <rect x="0" y="50" width="100%" height="100" fill="url(#railway)" />
  500. <rect x="0" y="550" width="100%" height="100" fill="url(#railway)" />
  501. %%ANIMATION%%
  502. <rect x="0" y="0" width="270" height="100%" fill="url(#left_wall)"/>
  503. <rect x="1650" y="0" width="270" height="100%" fill="url(#right_wall)"/>
  504. </svg>
  505. jjdgfjjdfh;
  506. $SVG['E']=<<<khksdhfiwer
  507. <svg id="svgTrackMap" viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
  508. <defs>
  509. <pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse">
  510. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  511. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  512. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  513. </pattern>
  514. <pattern id="railway2" x="0" y="30" width="50" height="100" patternUnits="userSpaceOnUse">
  515. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  516. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  517. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  518. </pattern>
  519. <pattern id="stair_1m" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
  520. <rect x="20" y="5" width="10" height="90" fill="#000000" />
  521. <rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
  522. <rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
  523. </pattern>
  524. <pattern id="stripe" x="0" y="0" width="30" height="15" patternUnits="userSpaceOnUse">
  525. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  526. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  527. </pattern>
  528. <pattern id="stripe2" x="0" y="-10" width="30" height="15" patternUnits="userSpaceOnUse">
  529. <rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
  530. <polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
  531. </pattern>
  532. <linearGradient id="left_wall">
  533. <stop offset="0%" style="stop-color: #000; stop-opacity: 1.0"/>
  534. <stop offset="100%" style="stop-color: #000; stop-opacity: 0"/>
  535. </linearGradient>
  536. <linearGradient id="right_wall">
  537. <stop offset="0%" style="stop-color: #000; stop-opacity: 0"/>
  538. <stop offset="100%" style="stop-color: #000; stop-opacity: 1.0"/>
  539. </linearGradient>
  540. </defs>
  541. <rect x="0" y="0" width="100%" height="100%" fill="#808080" />
  542. <rect x="0" y="0" width="100%" height="40" fill="#C0C0C0" />
  543. <rect x="0" y="660" width="100%" height="40" fill="#C0C0C0" />
  544. <rect x="270" y="0" width="1380" height="220" fill="#C0C0C0" />
  545. <rect x="270" y="460" width="1380" height="220" fill="#C0C0C0" />
  546. <rect x="270" y="180" width="1380" height="15" fill="url(#stripe)"/>
  547. <rect x="270" y="485" width="1380" height="15" fill="url(#stripe2)"/>
  548. <rect x="0" y="230" width="100%" height="100" fill="url(#railway2)" />
  549. <rect x="0" y="350" width="100%" height="100" fill="url(#railway)" />
  550. %%ANIMATION%%
  551. <rect x="0" y="0" width="270" height="100%" fill="url(#left_wall)"/>
  552. <rect x="1650" y="0" width="270" height="100%" fill="url(#right_wall)"/>
  553. </svg>
  554. khksdhfiwer;
  555. //Parameters - Start Point, Station Stop, End Point, Motion Duration, move to station, station stop, move from station
  556. $SVG_ANI_PARAMS['L']=array( 2210, 290,-700, 11, 2, 6, 3 ); // L -> to the left R -> To the right movement
  557. $SVG_ANI_PARAMS['R']=array( -1920, 930,1920, 12, 3, 6, 2 ); // Not Same duration makes animation Lifelike
  558. $SVG_ANI['C']=<<<ksdhjfkhkie
  559. <rect x="2210" y="50" rx="10" width="700" height="100" style="fill:%%COLOR%%;">
  560. <animate dur="%%TOTA%%s" attributeName="x" calcMode="linear" values="%%ACORDS%%" keyTimes= "%%ATIMES%%" repeatCount="indefinite"/>
  561. <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"/>
  562. </rect>
  563. <rect x="-1290" y="550" rx="10" width="700" height="100" style="fill:%%COLOR%%;">
  564. <animate begin="8s" dur="%%TOTB%%s" attributeName="x" calcMode="linear" values="%%BCORDS%%" keyTimes= "%%BTIMES%%" repeatCount="indefinite"/>
  565. <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"/>
  566. </rect>
  567. ksdhjfkhkie;
  568. $SVG_ANI['E']=<<<ksjdhfksdhf
  569. <rect x="2210" y="230" rx="10" width="700" height="100" style="fill:%%COLOR%%;">
  570. <animate dur="%%TOTA%%s" attributeName="x" calcMode="linear" values="%%ACORDS%%" keyTimes= "%%ATIMES%%" repeatCount="indefinite"/>
  571. <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"/>
  572. </rect>
  573. <rect x="-1290" y="350" rx="10" width="700" height="100" style="fill:%%COLOR%%;">
  574. <animate begin="8s" dur="%%TOTB%%s" attributeName="x" calcMode="linear" values="%%BCORDS%%" keyTimes= "%%BTIMES%%" repeatCount="indefinite"/>
  575. <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"/>
  576. </rect>
  577. ksjdhfksdhf;
  578. if( $LC = count( $Colors ) ){
  579. switch( $PLayout ){
  580. case 'A': $P_B = $P_A = $SVG_ANI_PARAMS['L'];break;
  581. case 'B': $P_B = $P_A = $SVG_ANI_PARAMS['R'];break; // UK-JAP
  582. case 'C': $P_A = $SVG_ANI_PARAMS['L']; $P_B = $SVG_ANI_PARAMS['R'];break;
  583. case 'D': $P_A = $SVG_ANI_PARAMS['R']; $P_B = $SVG_ANI_PARAMS['L'];break; // UK-JAP
  584. case 'E': $P_A = $SVG_ANI_PARAMS['L']; $P_B = $SVG_ANI_PARAMS['R'];break;
  585. case 'F': $P_A = $SVG_ANI_PARAMS['R']; $P_B = $SVG_ANI_PARAMS['L'];break; // UK-JAP
  586. };
  587. $TOTAL_DURATION_A = $P_A[3]*$LC;
  588. $TOTAL_DURATION_B = $P_B[3]*$LC;
  589. $ATPL = $SVG_ANI[$PLayout];
  590. $CT = 1/$LC;
  591. $TS_A = $P_A[4]/$P_A[3];
  592. $SS_A = ($P_A[4]+$P_A[5])/$P_A[3];
  593. $FS_A = ($P_A[4]+$P_A[5]+$P_A[6])/$P_A[3];
  594. $TS_B = $P_B[4]/$P_B[3];
  595. $SS_B = ($P_B[4]+$P_B[5])/$P_B[3];
  596. $FS_B = ($P_B[4]+$P_B[5]+$P_B[6])/$P_B[3];
  597. // Stop start stop-end
  598. $T_A = array($TS_A/$LC, $SS_A/$LC, $FS_A/$LC);
  599. $T_B = array($TS_B/$LC, $SS_B/$LC, $FS_B/$LC);
  600. $ANI = array();
  601. $idx = 0;
  602. foreach( $Colors as $CC ){
  603. $BT = $idx*$CT;
  604. $P_A_COORDS = $P_A[0].";".$P_A[0].";".$P_A[1].";".$P_A[1].";".$P_A[2].";".$P_A[2];
  605. $P_B_COORDS = $P_B[0].";".$P_B[0].";".$P_B[1].";".$P_B[1].";".$P_B[2].";".$P_B[2];
  606. $P_A_TIMING = "0;".$BT.";".($BT+$T_A[0]).";".($BT+$T_A[1]).";".($BT+$T_A[2]).";1";
  607. $P_B_TIMING = "0;".$BT.";".($BT+$T_B[0]).";".($BT+$T_B[1]).";".($BT+$T_B[2]).";1";
  608. $ANI[$idx] = str_ireplace('%%COLOR%%',$CC,$SVG_ANI[$PLayout] );//Load template
  609. $ANI[$idx] = str_ireplace('%%ACORDS%%',$P_A_COORDS,$ANI[$idx]);
  610. $ANI[$idx] = str_ireplace('%%ATIMES%%',$P_A_TIMING,$ANI[$idx]);
  611. $ANI[$idx] = str_ireplace('%%BCORDS%%',$P_B_COORDS,$ANI[$idx]);
  612. $ANI[$idx] = str_ireplace('%%BTIMES%%',$P_B_TIMING,$ANI[$idx]);
  613. $ANI[$idx] = str_ireplace('%%TOTA%%',$TOTAL_DURATION_A,$ANI[$idx]);
  614. $ANI[$idx] = str_ireplace('%%DTOTA%%',$TOTAL_DURATION_A*2,$ANI[$idx]);
  615. $ANI[$idx] = str_ireplace('%%TOTB%%',$TOTAL_DURATION_B,$ANI[$idx]);
  616. $ANI[$idx] = str_ireplace('%%DTOTB%%',$TOTAL_DURATION_B*2,$ANI[$idx]);
  617. $idx++;
  618. }
  619. $SVG[$PLayout]=str_ireplace('%%ANIMATION%%', implode( '', $ANI ),$SVG[$PLayout]);
  620. } else {
  621. $SVG[$PLayout]=str_ireplace('%%ANIMATION%%','',$SVG[$PLayout]);
  622. };
  623. $Output = str_ireplace("\n",'',$SVG[$PLayout]);
  624. return $Output;
  625. };
  626. function getPlatformLineInfo( $PID ){
  627. global $DATABASE;
  628. $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`";
  629. $R = $DATABASE->Query( $QS );
  630. //get station index for each line
  631. $idx = 0;
  632. foreach( $R as $T ){
  633. $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']}";
  634. $Z = $DATABASE->Query( $QS );
  635. if( count( $Z ) ) {
  636. $R[$idx]['index']=$Z[0]['index'];
  637. $R[$idx]['station_id']=$Z[0]['station_id'];
  638. } else {
  639. $R[$idx]['index']= 0;
  640. $R[$idx]['station_id']= 0;
  641. };
  642. $idx++;
  643. };
  644. return $R;
  645. };
  646. function getPlatformInfo( $PID ){
  647. global $DATABASE;
  648. $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`";
  649. $R = $DATABASE->Query( $QS );
  650. //get station index for each line
  651. $idx = 0;
  652. $P_PARTS = array();
  653. $P_pidx = -1;
  654. $P_CSID = 0;
  655. $N_PARTS = array();
  656. $N_pidx = -1;
  657. $N_CSID = 0;
  658. foreach( $R as $T ){
  659. $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']}";
  660. $Z = $DATABASE->Query( $QS );
  661. if( count( $Z ) ) {
  662. $R[$idx]['index']=$Z[0]['index'];
  663. $R[$idx]['station_id']=$Z[0]['station_id'];
  664. } else {
  665. $R[$idx]['index']= 0;
  666. $R[$idx]['station_id']= 0;
  667. };
  668. // Have Index
  669. if( $R[$idx]['index'] ){
  670. $NSI = getLineStationInfo( $R[$idx]['id'], $R[$idx]['index']-1 );
  671. if( count( $NSI ) ){
  672. if( $N_CSID != $NSI['id'] ){
  673. $N_CSID = $NSI['id'];
  674. $N_pidx++;
  675. };
  676. $N_PARTS[$N_pidx]['name']=$NSI['name'];
  677. $N_PARTS[$N_pidx]['id']=$NSI['id'];
  678. $N_PARTS[$N_pidx]['colors'][]=$T['color'];
  679. };
  680. $NSI = getLineStationInfo( $R[$idx]['id'], $R[$idx]['index']+1 );
  681. if( count( $NSI ) ){
  682. if( $P_CSID != $NSI['id'] ){
  683. $P_CSID = $NSI['id'];
  684. $P_pidx++;
  685. };
  686. $P_PARTS[$P_pidx]['name']=$NSI['name'];
  687. $P_PARTS[$N_pidx]['id']=$NSI['id'];
  688. $P_PARTS[$P_pidx]['colors'][]=$T['color'];
  689. };
  690. };
  691. $idx++;
  692. };
  693. $R['INFO_COUNT'] = count( $R );
  694. $R['NEXT_IS_MULTI']=( count( $N_PARTS ) > 1 );
  695. $R['NEXT'] = array();
  696. foreach( $N_PARTS as $P ){
  697. $CZ['name']=$P['name'];
  698. $CZ['id'] = $P['id'];
  699. if( ( $CC = count( $P['colors'] ) ) > 1 ){
  700. $CP = 100 / $CC;
  701. $COMAP = array();
  702. for( $ix = 0; $ix < $CC; $ix++ ){
  703. $SPO= intval( $ix * $CP );
  704. $NPO= intval( ( $ix+1 ) * $CP ) - 1;
  705. if( $SPO < 2 ){
  706. $COMAP[] = "#{$P['colors'][$ix]}, #{$P['colors'][$ix]} {$NPO}%";
  707. } else if( $SPO > 90 ){
  708. $COMAP[] = "#{$P['colors'][$ix]} {$SPO}%, #{$P['colors'][$ix]}";
  709. } else {
  710. $COMAP[] = "#{$P['colors'][$ix]} {$SPO}%, #{$P['colors'][$ix]} {$NPO}%";
  711. };
  712. };
  713. $GRADIENT = implode( ',', $COMAP );//writing-mode: vertical-lr;text-orientation: upright;
  714. $CZ['bg_style']="background-image: linear-gradient({$GRADIENT});";
  715. } else {
  716. $CZ['bg_style']="background-color:#{$P['colors'][0]};";
  717. };
  718. $R['NEXT'][]=$CZ;
  719. };
  720. $R['PREV_IS_MULTI']=( count( $P_PARTS ) > 1 );
  721. $R['PREV'] = array();
  722. foreach( $P_PARTS as $P ){
  723. $CZ['name']=$P['name'];
  724. $CZ['id'] = $P['id'];
  725. if( ( $CC = count( $P['colors'] ) ) > 1 ){
  726. $CP = 100 / $CC;
  727. $COMAP = array();
  728. for( $ix = 0; $ix < $CC; $ix++ ){
  729. $SPO= intval( $ix * $CP );
  730. $NPO= intval( ( $ix+1 ) * $CP ) - 1;
  731. if( $SPO < 2 ){
  732. $COMAP[] = "#{$P['colors'][$ix]}, #{$P['colors'][$ix]} {$NPO}%";
  733. } else if( $SPO > 90 ){
  734. $COMAP[] = "#{$P['colors'][$ix]} {$SPO}%, #{$P['colors'][$ix]}";
  735. } else {
  736. $COMAP[] = "#{$P['colors'][$ix]} {$SPO}%, #{$P['colors'][$ix]} {$NPO}%";
  737. };
  738. };
  739. $GRADIENT = implode( ',', $COMAP );//writing-mode: vertical-lr;text-orientation: upright;
  740. $CZ['bg_style']="background-image: linear-gradient({$GRADIENT});";
  741. } else {
  742. $CZ['bg_style']="background-color:#{$P['colors'][0]};";
  743. };
  744. $R['PREV'][]=$CZ;
  745. };
  746. return $R;
  747. };
  748. function getLineStationInfo( $LID, $IDX ){
  749. global $DATABASE;
  750. $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}";
  751. $RZ = $DATABASE->Query( $QS );
  752. $INFO = array();
  753. if( count( $RZ ) ) $INFO = $RZ[0];
  754. return $INFO;
  755. }
  756. function createPlatformStationBlock( $PID, $D ){
  757. $PINFO = getPlatformLineInfo( $PID );
  758. $PARTS = array();
  759. $pidx = -1;
  760. $CSID = 0;
  761. if( $D < 0 ){
  762. $R_P = "</td><td class=\"ar_to_right\">&nbsp;</td></tr></table>";
  763. $L_P = "<table border=0 width=\"100%\"><tr><td align=\"right\">";
  764. } else {
  765. $R_P = "</td></tr></table>";
  766. $L_P = "<table border=0 width=\"100%\"><tr><td class=\"ar_to_left\">&nbsp;</td><td align=\"left\">";
  767. };
  768. foreach( $PINFO as $II ){
  769. // If has more stations on the line
  770. //if( $II['index'] > 1 ) {
  771. $SI = getLineStationInfo( $II['id'], $II['index'] + $D );
  772. if( count( $SI ) ){
  773. if( $CSID != $SI['id'] ){
  774. $CSID = $SI['id'];
  775. $pidx++;
  776. };
  777. $PARTS[$pidx]['name']=$SI['name'];
  778. $PARTS[$pidx]['colors'][]=$II['color'];
  779. };
  780. //};
  781. };
  782. $Output = '';
  783. foreach( $PARTS as $P ){
  784. if( ( $CC = count( $P['colors'] ) ) > 1 ){
  785. $CP = 100 / $CC;
  786. $COMAP = array();
  787. for( $ix = 0; $ix < $CC; $ix++ ){
  788. $SPO= intval( $ix * $CP );
  789. $NPO= intval( ( $ix+1 ) * $CP ) - 1;
  790. if( $SPO < 2 ){
  791. $COMAP[] = "#{$P['colors'][$ix]}, #{$P['colors'][$ix]} {$NPO}%";
  792. } else if( $SPO > 90 ){
  793. $COMAP[] = "#{$P['colors'][$ix]} {$SPO}%, #{$P['colors'][$ix]}";
  794. } else {
  795. $COMAP[] = "#{$P['colors'][$ix]} {$SPO}%, #{$P['colors'][$ix]} {$NPO}%";
  796. };
  797. };
  798. $GRADIENT = implode( ',', $COMAP );//writing-mode: vertical-lr;text-orientation: upright;
  799. $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>";
  800. } else {
  801. $Output .= "<td class=\"setEd_infoPanel\" style=\"color:#fff;font-weight:bold;background-color:#{$P['colors'][0]};\">{$L_P}{$P['name']}{$R_P}</td>";
  802. };
  803. };
  804. return $Output;
  805. };
  806. function getModleOnlineStatus( $MID ){
  807. global $DATABASE;
  808. $QS = "SELECT `status`,`ts`,`SID` FROM `mem_online_cloud` WHERE `object_id`={$MID} AND `object_type`=2";
  809. $RV = $DATABASE->Query( $QS, false );
  810. if( count( $RV ) ) return $RV[0];
  811. return array();
  812. }
  813. function cmaera(){
  814. };
  815. function getStationName( $id ){
  816. global $DATABASE;
  817. if( $id ){
  818. $QS = "SELECT `name` FROM `metro_stations` WHERE `id`={$id}";
  819. $RV = $DATABASE->Query( $QS, false );
  820. if( count( $RV ) ) return $RV[0]['name'];
  821. };
  822. return '';
  823. };
  824. function getTrackName( $id ){
  825. global $DATABASE;
  826. if( $id ){
  827. $QS = "SELECT `name` FROM `metro_tracks` WHERE `id`={$id}";
  828. $RV = $DATABASE->Query( $QS, false );
  829. if( count( $RV ) ) return $RV[0]['name'];
  830. };
  831. return '';
  832. };
  833. function getModuleName( $id ){
  834. global $DATABASE;
  835. if( $id ){
  836. $QS = "SELECT `name` FROM `metro_modules` WHERE `id`={$id}";
  837. $RV = $DATABASE->Query( $QS, false );
  838. if( count( $RV ) ) return $RV[0]['name'];
  839. };
  840. return '';
  841. };
  842. function getPlatformName( $id ){
  843. global $DATABASE;
  844. if( $id ){
  845. $QS = "SELECT `name` FROM `metro_platforms` WHERE `id`={$id}";
  846. $RV = $DATABASE->Query( $QS, false );
  847. if( count( $RV ) ) return $RV[0]['name'];
  848. };
  849. return '';
  850. };
  851. function getOnlineStatus( $mid ){
  852. global $DATABASE;
  853. if( $mid ){
  854. $CTS = time() - 3; // 3 seconds lag
  855. $QS = "SELECT `status` FROM `mem_online_cloud` WHERE `object_id` = {$mid} AND `object_type`=10 AND `ts`>={$CTS}";
  856. $RV = $DATABASE->Query( $QS, false );
  857. if( count( $RV ) ) return intval( $RV[0]['status'] );
  858. };
  859. return false;
  860. };
  861. function createTopLabel( $Station, $Platform, $Lines, $Track="", $color_class="" ){
  862. if( $Track!=''){
  863. $TR_INS=<<<DATA_BOUNDARY
  864. <td rowspan=3 valign="middle" align="center" class="top_track_lbl">{$Track}</td>
  865. DATA_BOUNDARY;
  866. } else {
  867. $TR_INS = '';
  868. }
  869. $AA=<<<DATA_BOUNDARY
  870. <table border=0 width="100%" class="setEd_infoPanelX {$color_class}">
  871. <tr>
  872. <td valign="middle" align="left" style="max-width: 20em; padding-left:30px;font-size: 22px; font-weight: bold;">{$Station}</td><td id="trx_status_cell" rowspan=3 valign="middle" align="center" class="top_status_hidden"><span id="trx_status_txt" class="static_status_text">STATUS</span></td>{$TR_INS}
  873. </tr>
  874. <tr>
  875. <td valign="middle" align="left" style="padding-left:30px;font-size: 16px; font-weight: bold;">{$Platform}</td>
  876. </tr>
  877. <tr>
  878. <td valign="middle" align="left" style="padding-left:30px;font-size: 16px; font-weight: bold;">{$Lines}</td>
  879. </tr>
  880. </table>
  881. DATA_BOUNDARY;
  882. return "{ xtype:'panel', border: false, frame: false, html: '". str_ireplace( "\n",'', $AA )."'}";
  883. };
  884. function createChopLabel( $line1, $line2, $Lines, $Track="", $color_class="", $oncli="", $atds="", $id ='' ){
  885. if( $Track!=''){
  886. $TR_INS=<<<DATA_BOUNDARY
  887. <td rowspan=3 valign="middle" align="center" style="width: 200px; border-radius: 5px; font-size: 44px; font-weight: bold; color: white; background-color: black;">{$Track}</td>
  888. DATA_BOUNDARY;
  889. } else {
  890. $TR_INS = '';
  891. };
  892. if( $atds!= "" ){
  893. if( is_array( $atds ) ){
  894. $ADDTD='<td rowspan=3 width="150px">&nbsp;</td>';
  895. foreach( $atds as $A ) $ADDTD.='<td rowspan=3>'.$A.'</td>';
  896. } else {
  897. $ADDTD='<td rowspan=3 width="150px">&nbsp;</td><td rowspan=3>'.$atds.'</td>';
  898. };
  899. } else {
  900. $ADDTD='';
  901. };
  902. if( $oncli!=''){
  903. $ACTION ='onclick="'.$oncli.';"';
  904. } else {
  905. $ACTION ='';
  906. };
  907. $AA=<<<DATA_BOUNDARY
  908. <table {$id} border=0 width="100%" class="sideInfo_item {$color_class}" {$ACTION}>
  909. <tr>
  910. <td valign="middle" align="left" style="max-width: 20em; padding-left:30px;font-size: 16px; font-weight: bold;">{$line1}</td>{$TR_INS}{$ADDTD}
  911. </tr>
  912. <tr>
  913. <td valign="middle" align="left" style="padding-left:30px;font-size: 12px; font-weight: bold;">{$line2}</td>
  914. </tr>
  915. <tr>
  916. <td valign="middle" align="left" style="padding-left:30px;font-size: 12px; font-weight: bold;">{$Lines}</td>
  917. </tr>
  918. </table>
  919. DATA_BOUNDARY;
  920. return "{ xtype:'panel', border: false, frame: false, html: '". str_ireplace( "\n",'', $AA )."'}";
  921. };
  922. ?>