masseuse_schedule.qsrc 12 KB

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