Files
studiobeve.no/application/views/admin/includes/update-worker-form.php
T
Astral04andClaude Sonnet 4.6 b8f4f67b23 Add visual worker calendar and floating lunch break system
- Monthly calendar grid per worker with colour-coded day status
- Override types: vacation, sick, custom hours, other, day-off
- Date-range override support via modal
- Floating 30-min lunch break: finds slot closest to preferred time
  within configurable window, adapts to existing bookings
- Lunch break only applies for shifts >= 6 hours
- Lunch slot shown in admin calendar; blocked in booking availability
- DB migrations: absence_type/note on worker_schedule_overrides,
  lunch_window_start/end/preferred_time on workers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 13:34:58 +01:00

82 lines
4.9 KiB
PHP
Executable File

<div class="mainContentContainer" style="top:100px">
<div class="pageTitle"><?php echo $pageTitle;?></div>
<form method="post" action="<?php echo base_url();?>workers/worker-process" enctype="multipart/form-data">
<input type="hidden" name ="worker_id" value="<?php echo $selectedItem->worker_id;?>">
<div class="formRow">
<label class="formTitle">Név</label>
<input type="text" class="formInputBox" name="worker_name" value="<?php echo $selectedItem->worker_name;?>">
</div>
<div class="formRow">
<img src="<?php echo SITEURL.'assets/img/workers/'.$selectedItem->worker_profile_img;?>" width="100px">
</div>
<div class="formRow">
<label class="formTitle">Profilkép</label>
<input type="file" class="formInputBox" name="worker_img">
</div>
<div class="formRow">
<label class="formTitle">Leírás</label>
<input type="text" class="formInputBox" name="worker_info" value="<?php echo $selectedItem->worker_info;?>">
</div>
<div class="formRow">
<label class="formTitle">Beauty</label>
<select class="formDropdownBox" style="padding:0;" name="is_beauty">
<option value="1" <?php echo $selectedItem->is_beauty?'selected':'';?>>igen</option>
<option value="0" <?php echo !$selectedItem->is_beauty?'selected':'';?>>nem</option>
</select>
</div>
<div class="formRow">
<label class="formTitle">Barber</label>
<select class="formDropdownBox" style="padding:0;" name="is_barber">
<option value="1" <?php echo $selectedItem->is_barber?'selected':'';?>>igen</option>
<option value="0" <?php echo !$selectedItem->is_barber?'selected':'';?>>nem</option>
</select>
</div>
<div class="formRow">
<label class="formTitle">Szolgáltatás kategória</label>
<select class="formDropdownBox" style="padding:0;" name="service_category_id">
<?php
if(!empty($serviceCategories)){
foreach($serviceCategories as $serviceCategoryItem){
echo '<option value="'.$serviceCategoryItem->service_category_id.'" '.($selectedItem->service_category_id == $serviceCategoryItem->service_category_id?' selected':'').'>'.$serviceCategoryItem->serv_cat_name.'</option>';
}
}
?>
</select>
</div>
<div class="formRow">
<label class="formTitle">Aktív</label>
<select class="formDropdownBox" style="padding:0;" name="is_active">
<option value="1" <?php echo $selectedItem->is_active?'selected':'';?>>igen</option>
<option value="0" <?php echo !$selectedItem->is_active?'selected':'';?>>nem</option>
</select>
</div>
<div class="formRow">
<label class="formTitle">Ebédszünet ablak kezdete</label>
<input type="text" class="formInputBox" name="lunch_window_start" value="<?php echo isset($selectedItem->lunch_window_start) ? substr($selectedItem->lunch_window_start, 0, 5) : ''; ?>" placeholder="HH:MM (pl. 11:00)" pattern="[0-2][0-9]:[0-5][0-9]" inputmode="numeric">
</div>
<div class="formRow">
<label class="formTitle">Ebédszünet ablak vége</label>
<input type="text" class="formInputBox" name="lunch_window_end" value="<?php echo isset($selectedItem->lunch_window_end) ? substr($selectedItem->lunch_window_end, 0, 5) : ''; ?>" placeholder="HH:MM (pl. 14:00)" pattern="[0-2][0-9]:[0-5][0-9]" inputmode="numeric">
</div>
<div class="formRow">
<label class="formTitle">Ebédszünet preferált időpont</label>
<input type="text" class="formInputBox" name="lunch_preferred_time" value="<?php echo isset($selectedItem->lunch_preferred_time) ? substr($selectedItem->lunch_preferred_time, 0, 5) : ''; ?>" placeholder="HH:MM (pl. 12:00)" pattern="[0-2][0-9]:[0-5][0-9]" inputmode="numeric">
</div>
<div class="formRow">
<label class="formTitle">Google Calendar ID</label>
<input type="text" class="formInputBox" name="google_calendar_id" value="<?php echo isset($selectedItem->google_calendar_id) ? $selectedItem->google_calendar_id : '';?>">
</div>
<div class="formRow">
<label class="formTitle">ntfy Topic</label>
<input type="text" class="formInputBox" name="ntfy_topic" value="<?php echo isset($selectedItem->ntfy_topic) ? $selectedItem->ntfy_topic : '';?>">
</div>
<div class="formRow">
<input type="submit" class="submitButton" name="updateWorker" value="Módosítás">
<a href="<?php echo base_url();?>workers" class="cancelButton">Mégsem</a>
</div>
</form>
</div>