223 lines
8.8 KiB
PHP
223 lines
8.8 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
<div class="container">
|
|
<div class="row ">
|
|
<div class="col mx-auto p-4">
|
|
<div class="card">
|
|
<div class="card-header header-style">
|
|
<a href="javascript:window.history.go(-1);" class="header-style-icon">
|
|
<i class="fas fa-arrow-left"></i>
|
|
</a>
|
|
<div class="header-style-title">
|
|
Kemaskini Maklumat Pembida
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
|
|
@if ($message = Session::get('success'))
|
|
<div class="alert alert-success">
|
|
<p>{{ $message }}</p>
|
|
</div>
|
|
@endif
|
|
<form action="{{ route('pembida.update') }}" method="POST" id="formkemaskini">
|
|
@csrf
|
|
<input type="hidden" value="{{$user->id}}" class="form-control" name="userid" id="userid" readonly>
|
|
<div class="form-row">
|
|
<div class="form-group col-md-6">
|
|
<label for="inputEmail4">Nama</label>
|
|
<input type="text" value="{{$user->name}}" class="form-control" name="name" id="name">
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label for="inputPassword4">Username</label>
|
|
<input type="text" value="{{$user->username}}" class="form-control" name="username" id="username">
|
|
</div>
|
|
</div>
|
|
<div class="form-row">
|
|
{{-- <div class="form-group col-md-6">
|
|
<label for="inputEmail4">Nama</label>
|
|
<input type="text" value="{{$user->name}}" class="form-control" name="name" id="name" readonly>
|
|
</div> --}}
|
|
<div class="form-group col-md-6">
|
|
<label for="inputPassword4">Emel</label>
|
|
<input type="email" value="{{$user->email}}" class="form-control" name="email" id="email">
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label for="inputPassword4">No Telefon</label>
|
|
<input type="text" value="{{$user->notelbimbit}}" class="form-control" name="notelbimbit" id="notelbimbit">
|
|
</div>
|
|
</div>
|
|
<div class="form-row">
|
|
<div class="form-group col-md-6">
|
|
<label for="inputPassword4">Kad Pengenalan/No Passport</label>
|
|
<input type="text" value="{{$user->nokp}}" class="form-control" name="nokp" id="nokp">
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label for="inputPassword4">Alamat</label>
|
|
{{-- <input type="text" value="{{$user->alamat}}" class="form-control" name="notelbimbit" id="notelbimbit"> --}}
|
|
<textarea class="form-control" name="alamat" id="alamat">{{$user->alamat}}</textarea>
|
|
</div>
|
|
</div>
|
|
<div class="d-flex form-group">
|
|
<div class="d-flex col-md-6">
|
|
<div style="margin-right:2%;">
|
|
<label for="status1">Status</label>
|
|
</div>
|
|
<div class="custom-control custom-switch" >
|
|
<input type="checkbox" class="custom-control-input" name="status" id="customSwitch1" onchange="showstatus(this)">
|
|
<label class="custom-control-label" for="customSwitch1" data-status="{{ $user->status }}" id="txtstatus"></label>
|
|
</div>
|
|
</div>
|
|
<div class="d-flex col-md-6">
|
|
<div style="margin-right:2%;">
|
|
<label for="status1">Senarai Hitam</label>
|
|
</div>
|
|
<div class="custom-control custom-switch" >
|
|
<input type="checkbox" class="custom-control-input" style="background-color:red !important" name="statusban" id="customSwitch2" onchange="showban(this)">
|
|
<label class="custom-control-label" for="customSwitch2" id="txtstatusban"></label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{-- <div class="form-row">
|
|
<h4 class="col-md-3">Kad Pengenalan/Gambar Passport</h4>
|
|
<div class="form-group col-md-9">
|
|
@foreach ($files as $file)
|
|
<div class=".col-6 .col-sm-4 form-check form-check-inline">
|
|
<img src="data:image/png;base64, {{ $file['filename'] }}" alt="Image Preview" style="width:350px; height:250px"/>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</div> --}}
|
|
<div class="text-right pt-4">
|
|
<input type="hidden" name="userid" value="{{$user->id}}">
|
|
<a href="{{url('pembida/senaraipembidakeseluruhan')}}" class="btn btn-primary">Kembali</a>
|
|
@hasrole('operasi')
|
|
<button type="button" class="btn btn-success" onclick="kemaskini()" >Kemaskini</button>
|
|
@endhasrole
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
var status = $('#txtstatus').data('status');
|
|
|
|
console.log(status);
|
|
if(status == 'active'){
|
|
$('#customSwitch1').prop('checked',true) ;
|
|
$('#customSwitch2').prop('checked',false) ;
|
|
$('#txtstatus').text('Active');
|
|
}
|
|
else if(status == 'banned')
|
|
{
|
|
$('#customSwitch1').prop('checked',false) ;
|
|
$('#customSwitch2').prop('checked',true) ;
|
|
$('#txtstatusban').text('Banned');
|
|
}
|
|
else{
|
|
$('#customSwitch1').prop('checked',false) ;
|
|
$('#customSwitch2').prop('checked',false) ;
|
|
$('#txtstatus').text('Inactive');
|
|
}
|
|
function kemaskini() {
|
|
// console.log($('#txtstatus').val());
|
|
$("#formkemaskini").submit();
|
|
}
|
|
|
|
function showban(e){
|
|
var value = $(e).prop('checked') ;
|
|
if( value == true){
|
|
$('#txtstatus').text('Inactive');
|
|
$('#txtstatusban').text('Banned');
|
|
$('#customSwitch1').prop('checked',false) ;
|
|
}
|
|
else{
|
|
if(status == 'active'){
|
|
$('#customSwitch1').prop('checked',true) ;
|
|
$('#txtstatus').text('Active');
|
|
$('#txtstatusban').text('');
|
|
}
|
|
else
|
|
{
|
|
$('#txtstatusban').text('');
|
|
$('#txtstatus').text('Inactive');
|
|
}
|
|
}
|
|
}
|
|
function showstatus(e){
|
|
var value = $(e).prop('checked') ;
|
|
if( value == true)
|
|
{
|
|
$('#txtstatusban').text('');
|
|
$('#txtstatus').text('Active');
|
|
$('#customSwitch2').prop('checked',false) ;
|
|
}
|
|
else{
|
|
if(status == 'banned'){
|
|
$('#customSwitch2').prop('checked',true) ;
|
|
$('#txtstatus').text('Inactive');
|
|
$('#txtstatusban').text('Banned');
|
|
}
|
|
else
|
|
{
|
|
$('#txtstatusban').text('');
|
|
$('#txtstatus').text('Inactive');
|
|
}
|
|
}
|
|
console.log(value);
|
|
}
|
|
function simpantolak() {
|
|
$('#modaltolak').modal('hide');
|
|
$("#formtolakpembida").submit();
|
|
}
|
|
function reject(e) {
|
|
var userid= $(e).data('user_id');
|
|
// console.log(userid);
|
|
$('#user_id').val(userid);
|
|
$('#modaltolak').modal('show');
|
|
}
|
|
function confirm() {
|
|
$.confirm({
|
|
title: 'Confirmation',
|
|
content: 'Anda pasti?',
|
|
type: 'green',
|
|
typeAnimated: true,
|
|
buttons: {
|
|
Sah: {
|
|
btnClass: 'btn-success',
|
|
action: function () {
|
|
$("#formpengguna").submit();
|
|
}
|
|
},
|
|
Batal: {
|
|
btnClass: 'btn-default',
|
|
action: function () {}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
// function reject() {
|
|
// $.reject({
|
|
// title: 'Confirmation',
|
|
// content: 'Anda pasti?',
|
|
// type: 'green',
|
|
// typeAnimated: true,
|
|
// buttons: {
|
|
// Sah: {
|
|
// btnClass: 'btn-success',
|
|
// action: function () {
|
|
// $("#formpengguna").submit();
|
|
// }
|
|
// },
|
|
// Batal: {
|
|
// btnClass: 'btn-default',
|
|
// action: function () {}
|
|
// }
|
|
// }
|
|
// });
|
|
// }
|
|
|
|
</script>
|
|
@endsection
|