chess/resources/views/content/others/user/form.blade.php
Ramadhon Ikhsan Prasetya 603e31b0f4 init
2024-08-29 10:56:32 +07:00

96 lines
6.3 KiB
PHP

@php
// $role = DB::table('ref_role')->get();
$role = DB::table('ref_role')
->where('is_external', '=', DB::raw('(select is_external from ref_role rr where id = :id)'))
->setBindings(['id' => Auth::user()->role_id])
->get();
$client = DB::table('master_client')->get();
$division = DB::table('ref_division')
->where('is_external', '=', DB::raw('(select is_external from ref_division rd where id = :id)'))
->setBindings(['id' => Auth::user()->division_id])
->get();
@endphp
<x-other.modal id="mForm" title="Tambah Data" subTitle="Tambah Data User" info="" separator="false" size="lg">
<x-slot name="action">
<button onclick="store()" type="button" class="btn btn-success font-weight-bold mr-2" id="znBtnLoader">Simpan</button>
</x-slot>
<x-slot name="content">
<form id="formData">
<input id="get_id" type="hidden" name="get_id" value="">
{{-- <input id="is_active" type="hidden" name="is_active" value=""> --}}
<div class="separator separator-dashed separator-border-1 mt-5 mb-5"></div>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-6">
<div >Foto</div>
<div class="form-group image-input mb-3" id="kt_image_2" style="border: 1px solid gainsboro;">
<div id="ava1" class="image-input-wrapper" style="width: 200px;
height: 200px;background-image: url({{asset('assets/media/logos/no_img.png')}}); background-size: contain; background-repeat: no-repeat; background-position: center center;"></div>
<label class="btn btn-xs btn-icon btn-circle btn-white btn-hover-text-primary btn-shadow" data-action="change" data-toggle="tooltip" title="" data-original-title="Change avatar">
<i class="fa fa-pen icon-sm text-muted"></i>
<input type="file" name="foto_profil" id="foto_profil" accept=".png, .jpg, .jpeg"/>
<input type="hidden" name="profile_avatar_remove"/>
</label>
<span id="pic-cancel" class="btn btn-xs btn-icon btn-circle btn-white btn-hover-text-primary btn-shadow" data-action="cancel" data-toggle="tooltip" title="Cancel avatar">
<i class="ki ki-bold-close icon-xs text-muted"></i>
</span>
</div>
<div class="mb-5">
<small >Format Gambar PNG,JPG,JPEG maksimal 250 Kb. rekomendasi solusi 420x420 </small>
</div>
</div>
<div class="col-md-6">
<x-form.input title="Nama User" id="full_name" value="" />
<x-form.input title="Usercode / Username" id="user_code" value="" />
<x-form.input title="Email" id="email" value="" />
{{-- <x-form.no title="Nomor HP" id="phone_number" maxlength="20" value="" /> --}}
<x-form.select title="Role" id="role_id">
<x-slot name="option">
@foreach ($role as $r)
<option value="{{ $r->id }}" data-isexternal="{{ $r->is_external }}">{{ $r->definition }}</option>
@endforeach
</x-slot>
</x-form.select>
<input type="hidden" name="is_external" id="is_external_v" value="">
<div id="division_div">
<x-form.select title="Division" id="division_id">
<x-slot name="option">
@if(!empty($division))
@foreach ($division as $d)
<option value="{{ $d->id }}">{{ $d->definition }}</option>
@endforeach
@endif
</x-slot>
</x-form.select>
</div>
<div id="client_div">
<x-form.select title="Client" id="client_id">
<x-slot name="option">
@if(!empty($client))
@foreach ($client as $c)
<option value="{{ $c->id }}">{{ $c->client_name }}</option>
@endforeach
@endif
</x-slot>
</x-form.select>
</div>
<x-form.select title="Status Aktif" id="is_active">
<x-slot name="option">
<option value="true">Ya</option>
<option value="false">Tidak</option>
</x-slot>
</x-form.select>
</div>
</div>
</div>
</div>
</form>
</x-slot>
</x-other.modal>