# masseuse_schedule if $ARGS[0] = 'schedule_reset': masseuse['new_job_week'] = daystart + (8 - week) if masseuse['shifts_required'] = 5: masseuse['7_shift_1_taken'] = rand(0,2) masseuse['7_shift_2_taken'] = rand(0,2) masseuse['7_shift_3_taken'] = rand(0,2) masseuse['6_shift_1_taken'] = rand(0,2) masseuse['6_shift_2_taken'] = rand(0,2) masseuse['6_shift_3_taken'] = rand(0,2) masseuse['5_shift_1_taken'] = rand(0,2) masseuse['5_shift_2_taken'] = rand(0,2) masseuse['5_shift_3_taken'] = rand(0,2) masseuse['4_shift_1_taken'] = rand(0,2) masseuse['4_shift_2_taken'] = rand(0,2) masseuse['4_shift_3_taken'] = rand(0,2) masseuse['3_shift_1_taken'] = rand(0,2) masseuse['3_shift_2_taken'] = rand(0,2) masseuse['3_shift_3_taken'] = rand(0,2) masseuse['2_shift_1_taken'] = rand(0,2) masseuse['2_shift_2_taken'] = rand(0,2) masseuse['2_shift_3_taken'] = rand(0,2) masseuse['1_shift_1_taken'] = rand(0,2) masseuse['1_shift_2_taken'] = rand(0,2) masseuse['1_shift_3_taken'] = rand(0,2) elseif masseuse['shifts_required'] = 10: masseuse['7_shift_1_taken'] = rand(-3,2) masseuse['7_shift_2_taken'] = rand(-3,2) masseuse['7_shift_3_taken'] = rand(-3,2) masseuse['6_shift_1_taken'] = rand(-3,2) masseuse['6_shift_2_taken'] = rand(-3,2) masseuse['6_shift_3_taken'] = rand(-3,2) masseuse['5_shift_1_taken'] = rand(-3,2) masseuse['5_shift_2_taken'] = rand(-3,2) masseuse['5_shift_3_taken'] = rand(-3,2) masseuse['4_shift_1_taken'] = rand(-3,2) masseuse['4_shift_2_taken'] = rand(-3,2) masseuse['4_shift_3_taken'] = rand(-3,2) masseuse['3_shift_1_taken'] = rand(-3,2) masseuse['3_shift_2_taken'] = rand(-3,2) masseuse['3_shift_3_taken'] = rand(-3,2) masseuse['2_shift_1_taken'] = rand(-3,2) masseuse['2_shift_2_taken'] = rand(-3,2) masseuse['2_shift_3_taken'] = rand(-3,2) masseuse['1_shift_1_taken'] = rand(-3,2) masseuse['1_shift_2_taken'] = rand(-3,2) masseuse['1_shift_3_taken'] = rand(-3,2) end gt'masseuse_schedule','start' end if $ARGS[0] = 'start': act'Finish scheduling':gt'salon','start' if masseuse['new_job_week'] <= daystart: gt'masseuse_schedule','schedule_reset' '
Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday |
---|---|---|---|---|---|---|
' if masseuse['7_shift_1'] = 0 and masseuse['7_shift_1_taken'] < 2: ' 09:00-13:00 shift' elseif masseuse['7_shift_1_taken'] = 2: '09:00-13:00 shift' 'not available' else '09:00-13:00 shift' ' Cancel Shift' end ' | ' !! First Monday Shift if masseuse['1_shift_1'] = 0 and masseuse['1_shift_1_taken'] < 2: ' 09:00-13:00 shift' elseif masseuse['1_shift_1_taken'] = 2: '09:00-13:00 shift' 'not available' else '09:00-13:00 shift' ' Cancel Shift' end ' | ' !! First Tuesday Shift if masseuse['2_shift_1'] = 0 and masseuse['2_shift_1_taken'] < 2: ' 09:00-13:00 shift' elseif masseuse['2_shift_1_taken'] = 2: '09:00-13:00 shift' 'not available' else '09:00-13:00 shift' ' Cancel Shift' end ' | ' !! First Wednesday Shift if masseuse['3_shift_1'] = 0 and masseuse['3_shift_1_taken'] < 2: ' 09:00-13:00 shift' elseif masseuse['3_shift_1_taken'] = 2: '09:00-13:00 shift' 'not available' else '09:00-13:00 shift' ' Cancel Shift' end ' | ' !! First Thursday Shift if masseuse['4_shift_1'] = 0 and masseuse['4_shift_1_taken'] < 2: ' 09:00-13:00 shift' elseif masseuse['4_shift_1_taken'] = 2: '09:00-13:00 shift' 'not available' else '09:00-13:00 shift' ' Cancel Shift' end ' | ' !! First Friday Shift if masseuse['5_shift_1'] = 0 and masseuse['5_shift_1_taken'] < 2: ' 09:00-13:00 shift' elseif masseuse['5_shift_1_taken'] = 2: '09:00-13:00 shift' 'not available' else '09:00-13:00 shift' ' Cancel Shift' end ' | ' !! First Saturday Shift if masseuse['6_shift_1'] = 0 and masseuse['6_shift_1_taken'] < 2: ' 09:00-13:00 shift' elseif masseuse['6_shift_1_taken'] = 2: '09:00-13:00 shift' 'not available' else '09:00-13:00 shift' ' Cancel Shift' end ' |
' if masseuse['7_shift_2'] = 0 and masseuse['7_shift_2_taken'] < 2: ' 13:00-17:00 shift' elseif masseuse['7_shift_2_taken'] = 2: '13:00-17:00 shift' 'not available' else '13:00-17:00 shift' ' Cancel Shift' end ' | ' !! Second Monday Shift if masseuse['1_shift_2'] = 0 and masseuse['1_shift_2_taken'] < 2: ' 13:00-17:00 shift' elseif masseuse['1_shift_2_taken'] = 2: '13:00-17:00 shift' 'not available' else '13:00-17:00 shift' ' Cancel Shift' end ' | ' !! Second Tuesday Shift if masseuse['2_shift_2'] = 0 and masseuse['2_shift_2_taken'] < 2: ' 13:00-17:00 shift' elseif masseuse['2_shift_2_taken'] = 2: '13:00-17:00 shift' 'not available' else '13:00-17:00 shift' ' Cancel Shift' end ' | ' !! Second Wednesday Shift if masseuse['3_shift_2'] = 0 and masseuse['3_shift_2_taken'] < 2: ' 13:00-17:00 shift' elseif masseuse['3_shift_2_taken'] = 2: '13:00-17:00 shift' 'not available' else '13:00-17:00 shift' ' Cancel Shift' end ' | ' !! Second Thursday Shift if masseuse['4_shift_2'] = 0 and masseuse['4_shift_2_taken'] < 2: ' 13:00-17:00 shift' elseif masseuse['4_shift_2_taken'] = 2: '13:00-17:00 shift' 'not available' else '13:00-17:00 shift' ' Cancel Shift' end ' | ' !! Second Friday Shift if masseuse['5_shift_2'] = 0 and masseuse['5_shift_2_taken'] < 2: ' 13:00-17:00 shift' elseif masseuse['5_shift_2_taken'] = 2: '13:00-17:00 shift' 'not available' else '13:00-17:00 shift' ' Cancel Shift' end ' | ' !! Second Saturday Shift if masseuse['6_shift_2'] = 0 and masseuse['6_shift_2_taken'] < 2: ' 13:00-17:00 shift' elseif masseuse['6_shift_2_taken'] = 2: '13:00-17:00 shift' 'not available' else '09:00-13:00 shift' ' Cancel Shift' end ' |
' if masseuse['7_shift_3'] = 0 and masseuse['7_shift_3_taken'] < 2: ' 17:00-21:00 shift' elseif masseuse['7_shift_3_taken'] = 2: '17:00-21:00 shift' 'not available' else '17:00-21:00 shift' ' Cancel Shift' end ' | ' !! Third Monday Shift if masseuse['1_shift_3'] = 0 and masseuse['1_shift_3_taken'] < 2: ' 17:00-21:00 shift' elseif masseuse['1_shift_3_taken'] = 2: '17:00-21:00 shift' 'not available' else '17:00-21:00 shift' ' Cancel Shift' end ' | ' !! Third Tuesday Shift if masseuse['2_shift_3'] = 0 and masseuse['2_shift_3_taken'] < 2: ' 17:00-21:00 shift' elseif masseuse['2_shift_3_taken'] = 2: '17:00-21:00 shift' 'not available' else '17:00-21:00 shift' ' Cancel Shift' end ' | ' !! Third Wednesday Shift if masseuse['3_shift_3'] = 0 and masseuse['3_shift_3_taken'] < 2: ' 17:00-21:00 shift' elseif masseuse['3_shift_3_taken'] = 2: '17:00-21:00 shift' 'not available' else '17:00-21:00 shift' ' Cancel Shift' end ' | ' !! Third Thursday Shift if masseuse['4_shift_3'] = 0 and masseuse['4_shift_3_taken'] < 2: ' 17:00-21:00 shift' elseif masseuse['4_shift_3_taken'] = 2: '17:00-21:00 shift' 'not available' else '17:00-21:00 shift' ' Cancel Shift' end ' | ' !! Third Friday Shift if masseuse['5_shift_3'] = 0 and masseuse['5_shift_3_taken'] < 2: ' 17:00-21:00 shift' elseif masseuse['5_shift_3_taken'] = 2: '17:00-21:00 shift' 'not available' else '17:00-21:00 shift' ' Cancel Shift' end ' | ' !! Third Saturday Shift if masseuse['6_shift_3'] = 0 and masseuse['6_shift_3_taken'] < 2: ' 17:00-21:00 shift' elseif masseuse['6_shift_3_taken'] = 2: '17:00-21:00 shift' 'not available' else '17:00-21:00 shift' ' Cancel Shift' end ' |