<div class="container-fluid px-0">
  <div class="row text-center mb-3">
    <div class="col">
      <?php if($target == 'store'): ?>
      <h1 class="h2"><?php echo app('translator')->get('db.users'); ?> <?php echo app('translator')->get('system.title.create'); ?></h1>
      <?php elseif($target == 'update'): ?>
      <h1 class="h2"><?php echo app('translator')->get('db.users'); ?> <?php echo app('translator')->get('system.title.edit'); ?></h1>
      <?php endif; ?>
    </div>
  </div>
  <?php if($target == 'store'): ?>
  <form action="/user" method="post" onsubmit="return submitForm()">
  <?php elseif($target == 'update'): ?>
  <form action="/user/<?php echo e($user->id); ?>" name="" method="post" onsubmit="return submitForm()">
    <input type="hidden" name="_method" value="PUT">
  <?php endif; ?>
    <?php echo csrf_field(); ?>
    <div class="row justify-content-center">
      <div class="col-12 col-md-8 col-lg-6">
        <?php echo $__env->make('common/error-message', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        <div class="card border-secondary mb-3 w-100">
          <div class="card-header mb-2"><?php echo app('translator')->get('db.users'); ?> <?php echo app('translator')->get('system.title.information'); ?></div>
          <div class="card-body">
            <div class="form-group mb-4">
              <label class="form-label mb-2"><?php echo app('translator')->get('db.user.name'); ?></label>
              <input type="text" class="form-control <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="name" placeholder="" value="<?php echo e(old('name', $user->name)); ?>">
              <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="invalid-feedback" role="alert"><strong><?php echo e($message); ?></strong></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="form-group mb-4">
              <label class="form-label mb-2"><?php echo app('translator')->get('db.user.car_id'); ?></label>
              <select class="form-select <?php $__errorArgs = ['car_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="car_id">
                <option value=""></option>
                <?php $__currentLoopData = $cars; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $car): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option value="<?php echo e($car->id); ?>" <?php if(old('car_id', $user->car_id)==$car->id): ?> selected  <?php endif; ?>><?php echo e($car->number); ?>【<?php echo app('translator')->get('db.car.use-'.$car->use); ?>】</option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
              </select>
              <div class="form-text"><?php echo app('translator')->get('db.reports'); ?>の初期選択として使用されます</div>
              <?php $__errorArgs = ['car_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="invalid-feedback" role="alert"><strong><?php echo e($message); ?></strong></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>            
            <div class="form-group mb-4">
              <label class="form-label mb-2"><?php echo app('translator')->get('db.user.phone_number'); ?></label>
              <input type="text" class="form-control <?php $__errorArgs = ['phone_number'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="phone_number" placeholder="" value="<?php echo e(old('phone_number', $user->phone_number)); ?>">
              <?php $__errorArgs = ['phone_number'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="invalid-feedback" role="alert"><strong><?php echo e($message); ?></strong></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="form-group mb-4">
              <label class="form-label mb-2"><?php echo app('translator')->get('db.user.email'); ?></label>
              <input type="email" class="form-control <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="email" placeholder="" value="<?php echo e(old('email', $user->email)); ?>">
              <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="invalid-feedback" role="alert"><strong><?php echo e($message); ?></strong></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="form-group mb-4">
              <label class="form-label mb-2"><?php echo app('translator')->get('db.user.account'); ?></label>
              <input type="text" class="form-control <?php $__errorArgs = ['account'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="account" placeholder="" value="<?php echo e(old('account', $user->account)); ?>" <?php if($user->id == 1): ?> readonly <?php endif; ?>>
              <?php $__errorArgs = ['account'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="invalid-feedback" role="alert"><strong><?php echo e($message); ?></strong></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <?php if($target == 'store'): ?>
            <div class="form-group mb-4">
              <label class="form-label mb-2"><?php echo app('translator')->get('db.user.password'); ?></label>
              <input type="password" id="password" class="form-control <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="password" placeholder="" value="<?php echo e(old('password')); ?>" autocomplete="new-password">
              <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="invalid-feedback" role="alert"><strong><?php echo e($message); ?></strong></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="form-group mb-4">
              <label class="form-label mb-2"><?php echo app('translator')->get('db.user.password_confirmation'); ?></label>
              <input type="password" id="password_confirmation" class="form-control <?php $__errorArgs = ['password_confirmation'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="password_confirmation" placeholder="" value="">
              <?php $__errorArgs = ['password_confirmation'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="invalid-feedback" role="alert"><strong><?php echo e($message); ?></strong></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <?php endif; ?>
          </div>
        </div>
        <?php if($target == 'update'): ?>
        <div class="card border-secondary mb-3 w-100">
          <div class="card-header mb-2"><?php echo app('translator')->get('db.user.password'); ?> <?php echo app('translator')->get('system.title.information'); ?></div>
          <div class="card-body">
            <div class="form-group mb-4">
              <label class="form-check-label">
                <input type="checkbox" id="password_change" class="form-check-input" name="password_change" value="1" <?php if(old('password_change') == '1'): ?> checked <?php endif; ?>>
                <?php echo app('translator')->get('system.command.change'); ?>
              </label>
            </div>
            <div class="form-group mb-4">
              <label class="form-label mb-2"><?php echo app('translator')->get('db.user.password'); ?></label>
              <input type="password" id="password" class="form-control <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="password" placeholder="" value="<?php echo e(old('password')); ?>" <?php if(old('password_change') != '1'): ?> disabled <?php endif; ?> autocomplete="new-password">
              <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="invalid-feedback" role="alert"><strong><?php echo e($message); ?></strong></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="form-group mb-4">
              <label class="form-label mb-2"><?php echo app('translator')->get('db.user.password_confirmation'); ?></label>
              <input type="password" id="password_confirmation" class="form-control <?php $__errorArgs = ['password_confirmation'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="password_confirmation" placeholder="" value="" <?php if(old('password_change') != '1'): ?> disabled <?php endif; ?>>
              <?php $__errorArgs = ['password_confirmation'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="invalid-feedback" role="alert"><strong><?php echo e($message); ?></strong></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
          </div>
        </div>
        <?php endif; ?>

      </div>
    </div>
    <div class="row justify-content-center mb-4">
      <div class="col-12 col-md-5 col-lg-4 mt-2 mb-2">
        <button type="submit" id="submit-button" class="btn btn-primary w-100"><span class="bi bi-check-circle me-2"></span><?php echo app('translator')->get('system.command.register'); ?></button>
      </div>
      <div class="col-12 col-md-3 col-lg-2 mt-2 mb-2">
        <?php if(session()->has('checkpoint')): ?>
        <a href="<?php echo e(session()->get('checkpoint')); ?>" class="btn btn-outline-primary w-100"><span class="bi bi-caret-left me-1"></span><?php echo app('translator')->get('system.command.back'); ?></a>
        <?php else: ?>
        <a href="./" class="btn btn-outline-primary w-100"><span class="bi bi-caret-left me-1"></span><?php echo app('translator')->get('system.command.back'); ?></a>
        <?php endif; ?>
      </div>
    </div>
  </form>
</div>
<?php if($target == 'update'): ?>
<script>
  window.addEventListener('load', function() {
    document.getElementById('password_change').addEventListener('change', function() {
      const password = document.getElementById('password');
      const password_confirmation = document.getElementById('password_confirmation');
      if (this.checked) {
        password.disabled = false;
        password_confirmation.disabled = false;
      } else {
        password.disabled = true;
        password_confirmation.disabled = true;
      }
      return;
    }, false);
  }, false);
</script>
<?php endif; ?>
<?php echo $__env->make('common/script-form', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php /**PATH /home/xs876501/miyagawa-t.com/laravel-project/miyagawa-transport/resources/views/user/form.blade.php ENDPATH**/ ?>