masseuse_schedule.qsrc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. # masseuse_schedule
  2. if $ARGS[0] = 'schedule_reset':
  3. i = 1
  4. if masseuse['shifts_required'] = 5:
  5. :loop_masseuse_sched_part
  6. if masseuse['<<i>>_shift_1'] ! 1:
  7. masseuse['<<i>>_shift_1'] = 0
  8. masseuse['<<i>>_shift_1_taken'] = rand(0,2)
  9. end
  10. if masseuse['<<i>>_shift_2'] ! 1:
  11. masseuse['<<i>>_shift_2'] = 0
  12. masseuse['<<i>>_shift_2_taken'] = rand(0,2)
  13. end
  14. if masseuse['<<i>>_shift_3'] ! 1:
  15. masseuse['<<i>>_shift_3'] = 0
  16. masseuse['<<i>>_shift_3_taken'] = rand(-1,2)
  17. end
  18. i += 1
  19. if i < 8: jump 'loop_masseuse_sched_part'
  20. elseif masseuse['shifts_required'] = 10:
  21. :loop_masseuse_sched_full
  22. if masseuse['<<i>>_shift_1'] ! 1:
  23. masseuse['<<i>>_shift_1'] = 0
  24. masseuse['<<i>>_shift_1_taken'] = rand(-3,2)
  25. end
  26. if masseuse['<<i>>_shift_2'] ! 1:
  27. masseuse['<<i>>_shift_2'] = 0
  28. masseuse['<<i>>_shift_2_taken'] = rand(-3,2)
  29. end
  30. if masseuse['<<i>>_shift_3'] ! 1:
  31. masseuse['<<i>>_shift_3'] = 0
  32. masseuse['<<i>>_shift_3_taken'] = rand(-3,2)
  33. end
  34. i += 1
  35. if i < 8: jump 'loop_masseuse_sched_full'
  36. end
  37. end
  38. if $ARGS[0] = 'start':
  39. act'Finish scheduling':gt'salon','start'
  40. if masseuse['schedule_update'] = 0: masseuse['schedule_update'] = daystart & gs 'masseuse_schedule','schedule_reset'
  41. gs 'stat'
  42. '<Table border=1><TR><TH>Sunday</TH> <TH>Monday</TH> <TH>Tuesday</TH> <TH>Wednesday</TH> <TH>Thursday</TH> <TH>Friday</TH> <TH>Saturday</TH></TR>'
  43. !! ---------------------------------------------- 09:00 Shifts ---------------------------------------------------------------------------------
  44. !! First Sunday Shift
  45. *P '<tr><td>'
  46. if masseuse['7_shift_1'] = 0 and masseuse['7_shift_1_taken'] < 2:
  47. '<a href="exec:masseuse[''7_shift_1''] = 1 & gt''masseuse_schedule'',''start''"> 09:00-13:00 shift</a>'
  48. elseif masseuse['7_shift_1_taken'] = 2:
  49. '09:00-13:00 shift'
  50. '<i>not available</i>'
  51. elseif masseuse['7_shift_1'] = 2:
  52. '09:00-13:00 shift'
  53. '<i>already worked</i>'
  54. else
  55. '09:00-13:00 shift'
  56. '<a href="exec:masseuse[''7_shift_1''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  57. end
  58. '</td><td>'
  59. !! First Monday Shift
  60. if masseuse['1_shift_1'] = 0 and masseuse['1_shift_1_taken'] < 2:
  61. '<a href="exec:masseuse[''1_shift_1''] = 1 & gt''masseuse_schedule'',''start''"> 09:00-13:00 shift</a>'
  62. elseif masseuse['1_shift_1_taken'] = 2:
  63. '09:00-13:00 shift'
  64. '<i>not available</i>'
  65. elseif masseuse['1_shift_1'] = 2:
  66. '09:00-13:00 shift'
  67. '<i>already worked</i>'
  68. else
  69. '09:00-13:00 shift'
  70. '<a href="exec:masseuse[''1_shift_1''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  71. end
  72. '</td><td>'
  73. !! First Tuesday Shift
  74. if masseuse['2_shift_1'] = 0 and masseuse['2_shift_1_taken'] < 2:
  75. '<a href="exec:masseuse[''2_shift_1''] = 1 & gt''masseuse_schedule'',''start''"> 09:00-13:00 shift</a>'
  76. elseif masseuse['2_shift_1_taken'] = 2:
  77. '09:00-13:00 shift'
  78. '<i>not available</i>'
  79. elseif masseuse['2_shift_1'] = 2:
  80. '09:00-13:00 shift'
  81. '<i>already worked</i>'
  82. else
  83. '09:00-13:00 shift'
  84. '<a href="exec:masseuse[''2_shift_1''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  85. end
  86. '</td><td>'
  87. !! First Wednesday Shift
  88. if masseuse['3_shift_1'] = 0 and masseuse['3_shift_1_taken'] < 2:
  89. '<a href="exec:masseuse[''3_shift_1''] = 1 & gt''masseuse_schedule'',''start''"> 09:00-13:00 shift</a>'
  90. elseif masseuse['3_shift_1_taken'] = 2:
  91. '09:00-13:00 shift'
  92. '<i>not available</i>'
  93. elseif masseuse['3_shift_1'] = 2:
  94. '09:00-13:00 shift'
  95. '<i>already worked</i>'
  96. else
  97. '09:00-13:00 shift'
  98. '<a href="exec:masseuse[''3_shift_1''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  99. end
  100. '</td><td>'
  101. !! First Thursday Shift
  102. if masseuse['4_shift_1'] = 0 and masseuse['4_shift_1_taken'] < 2:
  103. '<a href="exec:masseuse[''4_shift_1''] = 1 & gt''masseuse_schedule'',''start''"> 09:00-13:00 shift</a>'
  104. elseif masseuse['4_shift_1_taken'] = 2:
  105. '09:00-13:00 shift'
  106. '<i>not available</i>'
  107. elseif masseuse['4_shift_1'] = 2:
  108. '09:00-13:00 shift'
  109. '<i>already worked</i>'
  110. else
  111. '09:00-13:00 shift'
  112. '<a href="exec:masseuse[''4_shift_1''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  113. end
  114. '</td><td>'
  115. !! First Friday Shift
  116. if masseuse['5_shift_1'] = 0 and masseuse['5_shift_1_taken'] < 2:
  117. '<a href="exec:masseuse[''5_shift_1''] = 1 & gt''masseuse_schedule'',''start''"> 09:00-13:00 shift</a>'
  118. elseif masseuse['5_shift_1_taken'] = 2:
  119. '09:00-13:00 shift'
  120. '<i>not available</i>'
  121. elseif masseuse['5_shift_1'] = 2:
  122. '09:00-13:00 shift'
  123. '<i>already worked</i>'
  124. else
  125. '09:00-13:00 shift'
  126. '<a href="exec:masseuse[''5_shift_1''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  127. end
  128. '</td><td>'
  129. !! First Saturday Shift
  130. if masseuse['6_shift_1'] = 0 and masseuse['6_shift_1_taken'] < 2:
  131. '<a href="exec:masseuse[''6_shift_1''] = 1 & gt''masseuse_schedule'',''start''"> 09:00-13:00 shift</a>'
  132. elseif masseuse['6_shift_1_taken'] = 2:
  133. '09:00-13:00 shift'
  134. '<i>not available</i>'
  135. elseif masseuse['6_shift_1'] = 2:
  136. '09:00-13:00 shift'
  137. '<i>already worked</i>'
  138. else
  139. '09:00-13:00 shift'
  140. '<a href="exec:masseuse[''6_shift_1''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  141. end
  142. '</td></tr>'
  143. !! ---------------------------------------------- 13:00 Shifts ---------------------------------------------------------------------------------
  144. !! Second Sunday Shift
  145. *P '<tr><td>'
  146. if masseuse['7_shift_2'] = 0 and masseuse['7_shift_2_taken'] < 2:
  147. '<a href="exec:masseuse[''7_shift_2''] = 1 & gt''masseuse_schedule'',''start''"> 13:00-17:00 shift</a>'
  148. elseif masseuse['7_shift_2_taken'] = 2:
  149. '13:00-17:00 shift'
  150. '<i>not available</i>'
  151. elseif masseuse['7_shift_2'] = 2:
  152. '13:00-17:00 shift'
  153. '<i>already worked</i>'
  154. else
  155. '13:00-17:00 shift'
  156. '<a href="exec:masseuse[''7_shift_2''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  157. end
  158. '</td><td>'
  159. !! Second Monday Shift
  160. if masseuse['1_shift_2'] = 0 and masseuse['1_shift_2_taken'] < 2:
  161. '<a href="exec:masseuse[''1_shift_2''] = 1 & gt''masseuse_schedule'',''start''"> 13:00-17:00 shift</a>'
  162. elseif masseuse['1_shift_2_taken'] = 2:
  163. '13:00-17:00 shift'
  164. '<i>not available</i>'
  165. elseif masseuse['1_shift_2'] = 2:
  166. '13:00-17:00 shift'
  167. '<i>already worked</i>'
  168. else
  169. '13:00-17:00 shift'
  170. '<a href="exec:masseuse[''1_shift_2''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  171. end
  172. '</td><td>'
  173. !! Second Tuesday Shift
  174. if masseuse['2_shift_2'] = 0 and masseuse['2_shift_2_taken'] < 2:
  175. '<a href="exec:masseuse[''2_shift_2''] = 1 & gt''masseuse_schedule'',''start''"> 13:00-17:00 shift</a>'
  176. elseif masseuse['2_shift_2_taken'] = 2:
  177. '13:00-17:00 shift'
  178. '<i>not available</i>'
  179. elseif masseuse['2_shift_2'] = 2:
  180. '13:00-17:00 shift'
  181. '<i>already worked</i>'
  182. else
  183. '13:00-17:00 shift'
  184. '<a href="exec:masseuse[''2_shift_2''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  185. end
  186. '</td><td>'
  187. !! Second Wednesday Shift
  188. if masseuse['3_shift_2'] = 0 and masseuse['3_shift_2_taken'] < 2:
  189. '<a href="exec:masseuse[''3_shift_2''] = 1 & gt''masseuse_schedule'',''start''"> 13:00-17:00 shift</a>'
  190. elseif masseuse['3_shift_2_taken'] = 2:
  191. '13:00-17:00 shift'
  192. '<i>not available</i>'
  193. elseif masseuse['3_shift_2'] = 2:
  194. '13:00-17:00 shift'
  195. '<i>already worked</i>'
  196. else
  197. '13:00-17:00 shift'
  198. '<a href="exec:masseuse[''3_shift_2''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  199. end
  200. '</td><td>'
  201. !! Second Thursday Shift
  202. if masseuse['4_shift_2'] = 0 and masseuse['4_shift_2_taken'] < 2:
  203. '<a href="exec:masseuse[''4_shift_2''] = 1 & gt''masseuse_schedule'',''start''"> 13:00-17:00 shift</a>'
  204. elseif masseuse['4_shift_2_taken'] = 2:
  205. '13:00-17:00 shift'
  206. '<i>not available</i>'
  207. elseif masseuse['4_shift_2'] = 2:
  208. '13:00-17:00 shift'
  209. '<i>already worked</i>'
  210. else
  211. '13:00-17:00 shift'
  212. '<a href="exec:masseuse[''4_shift_2''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  213. end
  214. '</td><td>'
  215. !! Second Friday Shift
  216. if masseuse['5_shift_2'] = 0 and masseuse['5_shift_2_taken'] < 2:
  217. '<a href="exec:masseuse[''5_shift_2''] = 1 & gt''masseuse_schedule'',''start''"> 13:00-17:00 shift</a>'
  218. elseif masseuse['5_shift_2_taken'] = 2:
  219. '13:00-17:00 shift'
  220. '<i>not available</i>'
  221. elseif masseuse['5_shift_2'] = 2:
  222. '13:00-17:00 shift'
  223. '<i>already worked</i>'
  224. else
  225. '13:00-17:00 shift'
  226. '<a href="exec:masseuse[''5_shift_2''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  227. end
  228. '</td><td>'
  229. !! Second Saturday Shift
  230. if masseuse['6_shift_2'] = 0 and masseuse['6_shift_2_taken'] < 2:
  231. '<a href="exec:masseuse[''6_shift_2''] = 1 & gt''masseuse_schedule'',''start''"> 13:00-17:00 shift</a>'
  232. elseif masseuse['6_shift_2_taken'] = 2:
  233. '13:00-17:00 shift'
  234. '<i>not available</i>'
  235. elseif masseuse['6_shift_2'] = 2:
  236. '13:00-17:00 shift'
  237. '<i>already worked</i>'
  238. else
  239. '13:00-17:00 shift'
  240. '<a href="exec:masseuse[''6_shift_2''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  241. end
  242. '</td></tr>'
  243. !! ---------------------------------------------- 17:00 Shifts ---------------------------------------------------------------------------------
  244. !! Third Sunday Shift
  245. *P '<tr><td>'
  246. if masseuse['7_shift_3'] = 0 and masseuse['7_shift_3_taken'] < 2:
  247. '<a href="exec:masseuse[''7_shift_3''] = 1 & gt''masseuse_schedule'',''start''"> 17:00-21:00 shift</a>'
  248. elseif masseuse['7_shift_3_taken'] = 2:
  249. '17:00-21:00 shift'
  250. '<i>not available</i>'
  251. elseif masseuse['7_shift_3'] = 2:
  252. '17:00-21:00 shift'
  253. '<i>already worked</i>'
  254. else
  255. '17:00-21:00 shift'
  256. '<a href="exec:masseuse[''7_shift_3''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  257. end
  258. '</td><td>'
  259. !! Third Monday Shift
  260. if masseuse['1_shift_3'] = 0 and masseuse['1_shift_3_taken'] < 2:
  261. '<a href="exec:masseuse[''1_shift_3''] = 1 & gt''masseuse_schedule'',''start''"> 17:00-21:00 shift</a>'
  262. elseif masseuse['1_shift_3_taken'] = 2:
  263. '17:00-21:00 shift'
  264. '<i>not available</i>'
  265. elseif masseuse['1_shift_3'] = 2:
  266. '17:00-21:00 shift'
  267. '<i>already worked</i>'
  268. else
  269. '17:00-21:00 shift'
  270. '<a href="exec:masseuse[''1_shift_3''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  271. end
  272. '</td><td>'
  273. !! Third Tuesday Shift
  274. if masseuse['2_shift_3'] = 0 and masseuse['2_shift_3_taken'] < 2:
  275. '<a href="exec:masseuse[''2_shift_3''] = 1 & gt''masseuse_schedule'',''start''"> 17:00-21:00 shift</a>'
  276. elseif masseuse['2_shift_3_taken'] = 2:
  277. '17:00-21:00 shift'
  278. '<i>not available</i>'
  279. elseif masseuse['2_shift_3'] = 2:
  280. '17:00-21:00 shift'
  281. '<i>already worked</i>'
  282. else
  283. '17:00-21:00 shift'
  284. '<a href="exec:masseuse[''2_shift_3''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  285. end
  286. '</td><td>'
  287. !! Third Wednesday Shift
  288. if masseuse['3_shift_3'] = 0 and masseuse['3_shift_3_taken'] < 2:
  289. '<a href="exec:masseuse[''3_shift_3''] = 1 & gt''masseuse_schedule'',''start''"> 17:00-21:00 shift</a>'
  290. elseif masseuse['3_shift_3_taken'] = 2:
  291. '17:00-21:00 shift'
  292. '<i>not available</i>'
  293. elseif masseuse['3_shift_3'] = 2:
  294. '17:00-21:00 shift'
  295. '<i>already worked</i>'
  296. else
  297. '17:00-21:00 shift'
  298. '<a href="exec:masseuse[''3_shift_3''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  299. end
  300. '</td><td>'
  301. !! Third Thursday Shift
  302. if masseuse['4_shift_3'] = 0 and masseuse['4_shift_3_taken'] < 2:
  303. '<a href="exec:masseuse[''4_shift_3''] = 1 & gt''masseuse_schedule'',''start''"> 17:00-21:00 shift</a>'
  304. elseif masseuse['4_shift_3_taken'] = 2:
  305. '17:00-21:00 shift'
  306. '<i>not available</i>'
  307. elseif masseuse['4_shift_3'] = 2:
  308. '17:00-21:00 shift'
  309. '<i>already worked</i>'
  310. else
  311. '17:00-21:00 shift'
  312. '<a href="exec:masseuse[''4_shift_3''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  313. end
  314. '</td><td>'
  315. !! Third Friday Shift
  316. if masseuse['5_shift_3'] = 0 and masseuse['5_shift_3_taken'] < 2:
  317. '<a href="exec:masseuse[''5_shift_3''] = 1 & gt''masseuse_schedule'',''start''"> 17:00-21:00 shift</a>'
  318. elseif masseuse['5_shift_3_taken'] = 2:
  319. '17:00-21:00 shift'
  320. '<i>not available</i>'
  321. elseif masseuse['5_shift_3'] = 2:
  322. '17:00-21:00 shift'
  323. '<i>already worked</i>'
  324. else
  325. '17:00-21:00 shift'
  326. '<a href="exec:masseuse[''5_shift_3''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  327. end
  328. '</td><td>'
  329. !! Third Saturday Shift
  330. if masseuse['6_shift_3'] = 0 and masseuse['6_shift_3_taken'] < 2:
  331. '<a href="exec:masseuse[''6_shift_3''] = 1 & gt''masseuse_schedule'',''start''"> 17:00-21:00 shift</a>'
  332. elseif masseuse['6_shift_3_taken'] = 2:
  333. '17:00-21:00 shift'
  334. '<i>not available</i>'
  335. elseif masseuse['6_shift_3'] = 2:
  336. '17:00-21:00 shift'
  337. '<i>already worked</i>'
  338. else
  339. '17:00-21:00 shift'
  340. '<a href="exec:masseuse[''6_shift_3''] = 0 & gt''masseuse_schedule'',''start''"> Cancel Shift</a>'
  341. end
  342. '</td></tr>'
  343. end
  344. --- masseuse_work ---------------------------------