%PDF- %PDF-
Direktori : /home/silvzytp/dsr_code/resources/views/backend/pages/manager/ |
Current File : //home/silvzytp/dsr_code/resources/views/backend/pages/manager/form.blade.php |
@extends('layouts.backend') @section('title', $siteTitle) @section('action') <button type="submit" class="btn btn-sm btn-success submit-form-btn"><i class="fa fa-floppy-o"></i> @isset($manager) Update @else Submit @endisset </button> @endsection @push('styles') @endpush @section('content') <div class="row"> <div class="col-12"> <form action="{{ isset($manager) ? route(routeName().'.managers.update', $manager->id) : route(routeName().'.managers.store') }}" method="POST" id="form" enctype="multipart/form-data"> @csrf @isset($manager) @method('PUT') <input type="hidden" name="updated_at" value="{{ $manager->id }}"> @endisset <div class="row"> <div class="col-md-8"> <div class="ibox"> <div class="ibox-body"> <x-form.inputbox name="full_name" labelName="Full Name" required="required" placeholder="Enter name" value="{{ $manager->name ?? old('full_name') }}" error="full_name"/> <x-form.inputbox type="email" name="email" labelName="Email" required="required" placeholder="Enter Email" value="{{ $manager->email ?? old('email') }}" error="email"/> <x-form.inputbox name="phone" labelName="Phone" placeholder="Enter Phone Number" value="{{ $manager->phone_no ?? old('phone') }}" error="phone"/> <x-form.inputbox name="sale_target" type="number" labelName="Sale Target" placeholder="0.00" value="{{ $manager->s_target ?? old('sale_target') }}" error="sale_target"/> <div class="row"> <div class="col-md-10"> <x-form.inputicon type="password" name="password" labelName="Password" required="required" placeholder="xxxxxxxx" value="{!! isset($manager) ? $manager->password_text : '' !!}" icon="fa fa-eye" error="password" addonClass="password-text cursor-pointer"/> </div> <div class="col-md-2 text-right"> <label for="" class="opacity-0">hello</label> <button type="button" class="btn btn-md btn-primary generate-pass">Generate</button> </div> </div> </div> </div> </div> <div class="col-md-4"> <div class="ibox"> <div class="ibox-body"> <x-form.selectbox labelName="Role" name="role" required="required" error="role"> <option value="">-- Select Role --</option> <option value="3" @isset($manager) selected @endisset>Manager</option> </x-form.selectbox> <x-form.selectbox labelName="Status" name="status" required="required" error="status"> <option value="">-- Select Status --</option> <option value="1" @isset($manager) {{ $manager->status == 1 ? 'selected' : '' }} @endisset>Enabled</option> <option value="2" @isset($manager) {{ $manager->status == 2 ? 'selected' : '' }} @endisset>Disabled</option> </x-form.selectbox> <x-form.inputbox type="file" name="profile" labelName="Profile" error="profile"/> </div> </div> </div> </div> </form> </div> </div> @endsection @push('scripts') <script> // random password generate function generatePass() { let chars = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*"; let passLength = 8; let password = ""; for (let i = 0; i < passLength; i++) password += chars[Math.floor(Math.random() * chars.length)]; return password; } // random password value $(document).on('click','button.generate-pass', function(){ $('input[name="password"]').val(generatePass()); }) // password input type text $(document).on('click','.password-text',function(){ if($(this).children().hasClass('fa-eye')){ $(this).children().removeClass('fa-eye'); $(this).children().addClass('fa-eye-slash'); $('input[name="password"]').attr('type','text'); }else{ $(this).children().removeClass('fa-eye-slash'); $(this).children().addClass('fa-eye'); $('input[name="password"]').attr('type','password'); } }); </script> @endpush