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.

957 lines
44 KiB

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