<?php $__env->startSection('css'); ?>
<link rel="stylesheet" href="<?php echo e(asset('css/bootstrap-select.min.css')); ?>">
<link rel="stylesheet" href="<?php echo e(asset('css/bootstrap-datepicker.min.css')); ?>">
<link rel="stylesheet" href="<?php echo e(asset('css/icheck-bootstrap.min.css')); ?>">
<link rel="stylesheet" href="https://earthchie.github.io/jquery.Thailand.js/jquery.Thailand.js/dist/jquery.Thailand.min.css">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="container-fluid pt-3">
    <form action="<?php echo e(route('teacher.update', $teacher->id)); ?>"
            novalidate class="<?php echo e(($errors->any()) ? 'was-validated' : 'needs-validation'); ?>"
            method="post"
    >
    <?php echo csrf_field(); ?>
    <?php echo method_field('PUT'); ?>
        <div class="row">
            <div class="col-12">
                <div class="card card-outline card-success">
                    <div class="card-header">
                        <h3 class="card-title">ข้อมูลผู้สอน</h3>
                    </div>
                    <div class="card-body">
                        <div class="row">
                            <div class="col-sm-12 col-md-2">
                                <div class="form-group">
                                    <label for="title">คำนำหน้า <span class="text-red">*</span></label>
                                    <select id="title" name="title" class="selectpicker show-menu-arrow form-control" required>
                                      <option value="นาย" <?php if($teacher->title == "นาย"): ?> selected <?php endif; ?>>นาย</option>
                                      <option value="นาง" <?php if($teacher->title == "นาง"): ?> selected <?php endif; ?>>นาง</option>
                                      <option value="นางสาว" <?php if($teacher->title == "นางสาว"): ?> selected <?php endif; ?>>นางสาว</option>
                                    </select>
                                    <?php $__errorArgs = ['gender'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-sm-12 col-md-4">
                                <div class="form-group">
                                    <label for="firstname">ชื่อ <span class="text-red">*</span></label>
                                    <input type="text" class="form-control" id="firstname" name="firstname" value="<?php echo e($teacher->firstname); ?>" placeholder="ชื่อ" required>
                                    <?php $__errorArgs = ['lastnfirstnameame'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-sm-12 col-md-4">
                                <div class="form-group">
                                    <label for="lastname">นามสกุล <span class="text-red">*</span></label>
                                    <input type="text" class="form-control" id="lastname" name="lastname" value="<?php echo e($teacher->lastname); ?>" placeholder="นามสกุล" required>
                                    <?php $__errorArgs = ['lastname'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-sm-12 col-md-2">
                                <div class="form-group">
                                    <label for="nickname">ชื่อเล่น</label>
                                    <input type="text" class="form-control" id="nickname" name="nickname" value="<?php echo e($teacher->nickname); ?>" placeholder="ชื่อเล่น" >
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-12 col-md-3">
                                <div class="form-group">
                                    <label for="idCard">เลขที่บัตรประาชาชน <span class="text-red">*</span></label>
                                    <input type="text" class="form-control" id="idCard" name="idCard" placeholder="เลขที่บัตรประาชาชน" value="<?php echo e($teacher->idcard); ?>" required>
                                    <?php $__errorArgs = ['idCard'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-sm-12 col-md-3">
                                <div class="form-group">
                                    <label for="birthdate">วันเกิด <span class="text-red">*</span></label>
                                    <div class="input-group mb-3">
                                        <input type="hidden" value="<?php echo e($teacher->birthdate); ?>" id="birthdateValue" >
                                        <input type="text" class="form-control" id="birthdate" name="birthdate" placeholder="วันเกิด" autocomplete="off"  required>
                                        <div class="input-group-append">
                                            <span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
                                        </div>
                                    </div>
                                    <?php $__errorArgs = ['birthdate'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-sm-12 col-md-6">
                                <div class="form-group">
                                    <label for="address">ที่อยู่</label>
                                    <input type="text" id="address" name="address" class="form-control" value="<?php echo e($teacher->address); ?>" placeholder="ที่อยู่">
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-12 col-md-4">
                                <div class="form-group">
                                    <label for="district">ตำบล / แขวง</label>
                                    <input type="text" name="district" id="district" class="form-control" value="<?php echo e($teacher->district); ?>" placeholder="ตำบล / แขวง">
                                </div>
                            </div>
                            <div class="col-sm-12 col-md-4">
                                <div class="form-group">
                                    <label for="amphoe">อำเภอ / เขต</label>
                                    <input type="text" name="amphoe" id="amphoe" class="form-control" value="<?php echo e($teacher->amphoe); ?>" placeholder="อำเภอ / เขต">
                                </div>
                            </div>
                            <div class="col-sm-12 col-md-4">
                                <div class="form-group">
                                    <label for="province">จังหวัด</label>
                                    <input type="text" name="province" id="province" class="form-control" value="<?php echo e($teacher->province); ?>" placeholder="จังหวัด">
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-12 col-md-3">
                                <div class="form-group">
                                    <label for="phone1">หมายเลขโทรศัพท์ 1 <span class="text-red">*</span></label>
                                    <input type="number" name="phone1" id="phone1" class="form-control" value="<?php echo e($teacher->phone_1); ?>" placeholder="หมายเลขโทรศัพท์" required>
                                    <?php $__errorArgs = ['phone1'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-sm-12 col-md-3">
                                <div class="form-group">
                                    <label for="phone2">หมายเลขโทรศัพท์ 2</label>
                                    <input type="number" name="phone2" id="phone2" class="form-control" value="<?php echo e($teacher->phone_2); ?>" placeholder="หมายเลขโทรศัพท์">
                                </div>
                            </div>
                            <div class="col-sm-12 col-md-6">
                                <div class="form-group">
                                    <label>ประเภท <span class="text-red">*</span></label>
                                    <div>
                                        <div class="icheck-nephritis icheck-inline">
                                            <input type="radio" id="all" name="teacherType" value="a" <?php if($teacher->type == "a"): ?> checked <?php endif; ?> required>
                                            <label for="all">ทั้งสอนและสแกน</label>
                                        </div>
                                        <div class="icheck-nephritis icheck-inline">
                                            <input type="radio" id="teach" name="teacherType" value="t" <?php if($teacher->type == "t"): ?> checked <?php endif; ?>>
                                            <label for="teach">สอนอย่างเดียว</label>
                                        </div>
                                        <div class="icheck-nephritis icheck-inline">
                                            <input type="radio" id="scan" name="teacherType" value="s" <?php if($teacher->type == "s"): ?> checked <?php endif; ?>>
                                            <label for="scan">สแกนอย่างเดียว</label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>  <!-- div card body -->

                </div>
                <div class="row mt-3">
                    <div class="col-12">
                        <div style="float:left">
                            <a href="<?php echo e(route('teacher.index')); ?>" class="btn btn-outline-secondary"><i class="fas fa-chevron-left"></i> ย้อนกลับ</a>
                        </div>
                        <div style="float: right">
                            <button type="reset" class="btn btn-outline-secondary" value="reset">ล้างข้อความ</button>
                            <button type="submit" class="btn btn-success ml-2" value="add-course">แก้ไขผู้สอน</button>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('footerscript'); ?>
<script src="<?php echo e(asset('js/bootstrap-select.min.js')); ?>"></script>
<script src="<?php echo e(asset('js/bootstrap-datepicker-custom.min.js')); ?>"></script>
<script src="<?php echo e(asset('js/bootstrap-datepicker.th.min.js')); ?>"></script>
<script src="<?php echo e(asset('js/JQL.min.js')); ?>"></script>
<script src="<?php echo e(asset('js/typeahead.bundle.js')); ?>"></script>
<script src="<?php echo e(asset('js/jquery.Thailand.min.js')); ?>"></script>
<script src="<?php echo e(asset('js/custom.js')); ?>"></script>
<script>
    $(document).ready(function(){
        $('.selectpicker').selectpicker();

        $('#birthdate').datepicker({
            format: 'dd/mm/yyyy',
            autoclose: true,
            language: 'th',
            orientation: 'bottom',
        }).datepicker("update", convertDateforPicker('birthdateValue'));

        $.Thailand({
            $district: $('#district'),
            $amphoe: $('#amphoe'),
            $province: $('#province'),
            $zipcode: $('#zipcode')
        });
    });
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.web', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\system.pongpetrdriving.com\resources\views/teacher/edit.blade.php ENDPATH**/ ?>