 
<?php $__env->startSection('title', 'Form Components'); ?>
<?php $__env->startSection('content'); ?>

<?php 
    $getstatecodedata = DB::table('state_master')->get();
    $getdistrictcodedata = DB::table('district_master')->get();
?>
    <div class="container-fluid">
        <div class="page-header">
            <div class="row align-items-end">
                <div class="col-lg-8">
                    <div class="page-header-title">
                        <i class="ik ik-edit bg-blue"></i>
                        <div class="d-inline">
                            <h5><?php echo e(__('User Login')); ?></h5>
                        </div>
                    </div>
                </div>
                <div class="col-lg-4">
                    <nav class="breadcrumb-container" aria-label="breadcrumb">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item">
                                <a href="<?php echo e(route('dashboard')); ?>"><i class="ik ik-home"></i></a>
                            </li>
                            <li class="breadcrumb-item"><a href="#"><?php echo e(__('Forms')); ?></a></li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-header"><h3><?php echo e(__('Default form')); ?></h3></div>
                    <div class="card-body">
                        <form class="forms-sample" method='POST' <?php if(!empty($showdata)): ?> action='<?php echo e(url('updateuserlogin')); ?>' <?php else: ?> action='<?php echo e(url('userlogininsert')); ?>' <?php endif; ?> name='userloginmaster'>
                            <?php echo csrf_field(); ?>
                            
                            <?php if(!empty($showdata)): ?>
                            <input type='hidden' name='userid' value='<?php echo e($showdata[0]->id); ?>'>
                            <?php endif; ?>
                            
                            <div class="form-group">
                                <label for="name"><?php echo e(__('User Name')); ?></label>
                                <input type="text" class="form-control" id="name" name='name' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->name); ?>' <?php endif; ?> placeholder="Enter user name" required>
                            </div>
                            <div class="form-group">
                                <label for="email"><?php echo e(__('User Email')); ?></label>
                                <input type="email" class="form-control" id="email" name='email' <?php if(!empty($showdata)){ ?> value='<?php echo e($showdata[0]->email); ?>' <?php } ?> placeholder="Enter user email" required>
                            </div>
                            <?php if(empty($showdata)): ?>
                            <div class="form-group">
                                <label for="userpass"><?php echo e(__('User Password')); ?></label>
                                <input type="password" class="form-control" id="userpass" name='userpass' placeholder="Enter user password" required>
                            </div>
                            <?php endif; ?>
                            <div class="form-group">
                                <label for="dist_code"><?php echo e(__('District Code')); ?></label>
                                <select name='dist_code' id='distcode' class='form-control' value='Select Option'>
                                    <option>Select State Code</option>
                                    <?php foreach($getdistrictcodedata as $getdistrictcode){ ?>
                                     <option value='<?php echo $getdistrictcode->district_code; ?>' <?php if(!empty($showdata)): ?><?php echo e($showdata[0]->dist_code == $getdistrictcode->district_code ? 'selected' : ''); ?> <?php endif; ?> ><?php echo $getdistrictcode->district_code; ?></option>
                                     <?php } ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="state_code"><?php echo e(__('State Code')); ?></label>
                                <select name='state_code' id='statecode' class='form-control' value='Select Option'>
                                    <option>Select State Code</option>
                                    <?php foreach($getstatecodedata as $getstatecode){ ?>
                                     <option value='<?php echo $getstatecode->state_code; ?>' <?php if(!empty($showdata)): ?> <?php echo e($showdata[0]->state_code == $getstatecode->state_code ? 'selected' : ''); ?> <?php endif; ?> ><?php echo $getstatecode->state_code; ?></option>
                                     <?php } ?>
                                </select>
                            </div>
                            
                            <br><br>
                            <button type="submit" class="btn btn-primary mr-2"><?php echo e(__('Submit')); ?></button>
                            <?php if(empty($showdata)): ?>
                            <a href='<?php echo e('user-login'); ?>' class="btn btn-light"><?php echo e(__('Cancel')); ?></a>
                            <?php endif; ?>
                          </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
   
    <!-- push external js -->
    <?php $__env->startPush('script'); ?>
        <script src="<?php echo e(asset('js/form-components.js')); ?>"></script>
    <?php $__env->stopPush(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/viruxyz/public_html/ejaf/resources/views/pages/user-login.blade.php ENDPATH**/ ?>