<!-- main area -->
<div class="main-content">
    <div class="page-title">
        <div class="title">Shift</div>
        <div class="sub-title">Edit Shift</div>
    </div>
    <div class="card bg-white">
        <div class="card-header">
            <?php if (isset($message)) : ?>
                <div class="alert alert-success"><?php echo $message; ?></div>
            <?php endif ?>
            <?php if (isset($error)) : ?>
                <div class="alert alert-danger"><?php echo $error; ?></div>
            <?php endif ?>
        </div>
        <div class="card-block">
            <?php
            $attributes = array('name' => 'formEdit', 'id' => 'formEdit', 'class' => 'form-validation');
            echo form_open_multipart('', $attributes);
            ?>
            
            <!-- Shift Name -->
            <div class="form-group">
                <label for="shiftName">Shift Name</label>
                <input type="text" name="name" id="shiftName" value="<?php echo isset($shift) && $shift !== null ? $shift->name : ''; ?>" class="form-control" required>
            </div>
            
            <!-- Shift Description -->
            <div class="form-group">
                <label for="shiftDescription">Description</label>
                <input type="text" id="shiftDescription" name="description" value="<?php echo isset($shift) && $shift !== null ? $shift->description : ''; ?>" class="form-control" required>
            </div>
            
            <!-- Shift Start Time -->
            <div class="form-group">
                <label for="shiftStart">Start Time</label>
                <input type="time" id="shiftStart" name="start_time" value="<?php echo isset($shift) && $shift !== null ? $shift->start_time : ''; ?>" class="form-control" required>
            </div>
            
            <!-- Shift End Time -->
            <div class="form-group">
                <label for="shiftEnd">End Time</label>
                <input type="time" id="shiftEnd" name="end_time" value="<?php echo isset($shift) && $shift !== null ? $shift->end_time : ''; ?>" class="form-control" required>
            </div>
            
            <!-- Is Trash (checkbox or dropdown) -->
           <!--  <div class="form-group">
                <label for="isTrash">Is Trash</label>
                <select name="is_trash" id="isTrash" class="form-control" required>
                    <option value="0" <?php echo isset($shift) && $shift->is_trash == 0 ? 'selected' : ''; ?>>No</option>
                    <option value="1" <?php echo isset($shift) && $shift->is_trash == 1 ? 'selected' : ''; ?>>Yes</option>
                </select>
            </div> -->
            
            <!-- Submit and Reset buttons -->
            <div class="form-group">
                <button type="submit" class="btn btn-primary m-r">Submit</button>
                <button type="reset" class="btn btn-default">Reset</button>
            </div>
            
            <?php echo form_close(); ?>
        </div>
    </div>
</div>
<!-- /main area -->
