Merge remote-tracking branch 'origin' into afiqhamzah-feat-mykad-reader-registration
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
class generateBackdateStockAuditProblem extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'generate:stockauditproblem {--all : all zone} {--1 : update zone 1} {--2 : update zone 2} {--3 : update zone3}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Command description';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
if($this->option('all')){
|
||||
$zone = 'all';
|
||||
}else if($this->option('1')){
|
||||
$zone = '1';
|
||||
}else if ($this->option('2')){
|
||||
$zone = '2';
|
||||
}else if ($this->option('3')){
|
||||
$zone = '3';
|
||||
}
|
||||
$tarikh = $this->ask('Masukkan Tarikh Hujung Bulan Yang Bermasalah Dalam Format (Y-m-d):');
|
||||
$cawangan = $this->ask('Masukkan Kod Cawangan : ');
|
||||
$updategadai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/backup/stok/audit/problem',[
|
||||
// 'zone' => $zone,
|
||||
'kodcaw' => $cawangan,
|
||||
'dateProblem' =>$tarikh
|
||||
])->json();
|
||||
$this->info('sucess');
|
||||
}
|
||||
}
|
||||
@@ -55,4 +55,10 @@ class ActionEvent implements ShouldBroadcastNow
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
public function broadcastAs()
|
||||
{
|
||||
return 'my-actionevent';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -214,11 +214,19 @@ class KakitanganController extends Controller
|
||||
}
|
||||
|
||||
public function deleteKakitangan(Request $request){
|
||||
// dd($request->all());
|
||||
|
||||
$auth_user = Auth::user();
|
||||
$user = User::find($request->staff_id);
|
||||
$user->delete();
|
||||
// dd($user_delete);
|
||||
return redirect()->route('admin.daftar.kakitangan');
|
||||
|
||||
// if($auth_user->roles == 'operasi'){
|
||||
// // return redirect()->route('daftar.kakitangan');
|
||||
// return "route('daftar.kakitangan')";
|
||||
// }else if($auth_user->roles == 'admin'){
|
||||
// // return redirect()->route('admin.daftar.kakitangan');
|
||||
// return "route('admin.daftar.kakitangan')";
|
||||
// }
|
||||
return response()->json('success');
|
||||
}
|
||||
|
||||
public function editKakitangan(Request $request){
|
||||
@@ -233,6 +241,7 @@ class KakitanganController extends Controller
|
||||
|
||||
public function editStoreKakitangan(Request $request){
|
||||
// dd($request->all());
|
||||
$auth_user = Auth::user();
|
||||
$user = User::find($request->user_id);
|
||||
$user->name = strtoupper($request->nama);
|
||||
$user->email = $request->email;
|
||||
@@ -242,8 +251,13 @@ class KakitanganController extends Controller
|
||||
$user->password = Hash::make($request->nokp);
|
||||
$user->save();
|
||||
|
||||
|
||||
if($auth_user->roles == 'operasi'){
|
||||
return redirect()->route('daftar.kakitangan');
|
||||
}else if($auth_user->roles == 'admin'){
|
||||
return redirect()->route('admin.daftar.kakitangan');
|
||||
}
|
||||
}
|
||||
|
||||
public function resetCredentials(Request $request){
|
||||
$user = User::find($request->id);
|
||||
|
||||
@@ -37,7 +37,9 @@ return [
|
||||
'app_id' => env('PUSHER_APP_ID'),
|
||||
'options' => [
|
||||
'cluster' => 'ap1',
|
||||
'host' => '172.16.4.110',
|
||||
'useTLS' => false,
|
||||
'port' => 6001,
|
||||
'scheme' => 'http'
|
||||
],
|
||||
],
|
||||
|
||||
@@ -61,6 +61,8 @@ return [
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
'unix_socket' => env('UNIX_SOCKET', '/Applications/MAMP/tmp/mysql/mysql.sock'),
|
||||
|
||||
],
|
||||
|
||||
'pgsql' => [
|
||||
|
||||
Vendored
+8
File diff suppressed because one or more lines are too long
Vendored
+2593
-1
File diff suppressed because one or more lines are too long
@@ -128,7 +128,7 @@
|
||||
@else
|
||||
@php
|
||||
$cawangan_staff = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $staff->cawangan)->json();
|
||||
echo ucwords($cawangan_staff['details_caw']);
|
||||
echo ($cawangan_staff) ? ucwords($cawangan_staff['details_caw']) : 'test';
|
||||
@endphp
|
||||
@endif
|
||||
</td>
|
||||
@@ -136,16 +136,18 @@
|
||||
@if($auth_user->roles == 'operasi')
|
||||
<a href="{{ route('kakitangan.tukartaraf',['id'=>$staff->id]) }}" class="btn btn-warning" title="Tukar Taraf"><i class="material-icons">edit</i></a>
|
||||
<a href="{{ route('kakitangan.tukarcawangan',['id'=>$staff->id]) }}" class="btn btn-info" title="Tukar Cawangan"><i class="material-icons">work</i></a>
|
||||
<a href="{{ route('operasi.kakitangan.edit',['id'=>$staff->id]) }}" class="btn btn-success" title="Edit Maklumat"><i class="material-icons">settings</i></a>
|
||||
<button type="button" class="btn btn-danger btn-delete" data-roles="{{ $auth_user->roles }}" data-staff-id="{{ $staff->id }}" data-token="{{ csrf_token() }}" title="Delete Kakitangan"><i class="material-icons">delete</i></button>
|
||||
@elseif($auth_user->roles == 'admin')
|
||||
<form method="post" action="{{ route('admin.kakitangan.delete') }}">
|
||||
{{ @csrf_field() }}
|
||||
{{-- <form method="post" action="{{ route('admin.kakitangan.delete') }}">
|
||||
{{ @csrf_field() }} --}}
|
||||
<input type="hidden" name="staff_id" value="{{ $staff->id }}"/>
|
||||
<a href="{{ route('admin.kakitangan.tukartaraf',['id'=>$staff->id]) }}" class="btn btn-warning" title="Tukar Taraf"><i class="material-icons">edit</i></a>
|
||||
<a href="{{ route('admin.kakitangan.tukarcawangan',['id'=>$staff->id]) }}" class="btn btn-info" title="Tukar Cawangan"><i class="material-icons">work</i></a>
|
||||
<a href="{{ route('admin.kakitangan.edit',['id'=>$staff->id]) }}" class="btn btn-success" title="Edit Maklumat"><i class="material-icons">settings</i></a>
|
||||
<a href="{{ route('admin.kakitangan.resetcredentials',['id'=>$staff->id]) }}" class="btn btn-primary" title="Reset Password"><i class="material-icons">restore</i></a>
|
||||
<button type="button" class="btn btn-danger btn-delete" data-staff-id="{{ $staff->id }}" data-token="{{ csrf_token() }}" title="Delete Kakitangan"><i class="material-icons">delete</i></button>
|
||||
</form>
|
||||
{{-- </form> --}}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@@ -165,20 +167,57 @@
|
||||
var tablerekod = $('#rekod_kakitangan').DataTable();
|
||||
|
||||
$('.btn-delete').on('click', function(){
|
||||
var form = $(this).closest('form');
|
||||
Swal.fire(
|
||||
{
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
// var form = $(this).closest('form');
|
||||
var roles = $(this).data('roles');
|
||||
var staff_id = $(this).data('staff-id');
|
||||
|
||||
var url_redirected = (roles == 'operasi') ? "{{ route('operasi.kakitangan.delete') }}" : "{{ route('admin.kakitangan.delete') }}";
|
||||
|
||||
Swal.fire({
|
||||
title: 'Padam Kakitangan Ini?',
|
||||
text: "Anda tidak boleh mengembalikan data ini balik selepas dipadamkan!",
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonClass: 'btn btn-danger',
|
||||
cancelButtonClass: 'btn btn-warning',
|
||||
confirmButtonText: 'Yes, delete it!',
|
||||
confirmButtonText: 'Padam!',
|
||||
cancelButtonText: 'Batal!',
|
||||
buttonsStyling: false
|
||||
}).then(function(result) {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url: url_redirected,
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"staff_id" : staff_id
|
||||
},
|
||||
success:function(data){
|
||||
if(data == 'success')
|
||||
{
|
||||
if(roles == 'operasi')
|
||||
window.location.href = "{{ route('daftar.kakitangan') }}";
|
||||
else
|
||||
window.location.href = "{{ route('admin.daftar.kakitangan') }}";
|
||||
|
||||
Swal.fire({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
didOpen: function () {
|
||||
Swal.showLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
).then(function() {
|
||||
form.submit();
|
||||
}).catch(swal.noop)
|
||||
});
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb pb-3">
|
||||
<li class="breadcrumb-item"><a href="{{ url('/') }}">Home</a></li>
|
||||
<li class="breadcrumb-item" aria-current="page"><a href="{{ route('admin.daftar.kakitangan') }}">Kakitangan</a></li>
|
||||
<li class="breadcrumb-item" aria-current="page"><a href="{{ (Auth::user()->roles == 'admin') ? route('admin.daftar.kakitangan') : route('daftar.kakitangan') }}">Kakitangan</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Edit Maklumat Kakitangan</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="card-body text-center">
|
||||
<form action="{{ route('admin.kakitangan.edit.store') }}" method="post">
|
||||
<form action="{{ (Auth::user()->roles == 'admin') ? route('admin.kakitangan.edit.store') : route('operasi.kakitangan.edit.store') }}" method="post">
|
||||
@csrf
|
||||
<input type="hidden" name='user_id' id='user_id' readonly value="{{ $user->id }}" class='form-control'>
|
||||
<div class='row form-group'>
|
||||
|
||||
@@ -25,6 +25,13 @@
|
||||
margin-top: -70px;
|
||||
}
|
||||
|
||||
@media print {
|
||||
.khazanah {
|
||||
margin-top: -60%;
|
||||
page-break-before: always;
|
||||
}
|
||||
}
|
||||
|
||||
.khazanah-copy{
|
||||
border:1px solid black;
|
||||
padding:10px;
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<h3 class="text-center text-uppercase">maklumat pengguna</h3>
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="col-md-12" style="margin-right:auto;margin-left:auto">
|
||||
<div class="row form-group">
|
||||
<div class="col-md-6">
|
||||
<div class="row form-group">
|
||||
<div class="col-md-6">NAMA</div>
|
||||
<div class="col-md-6"><input type="text" class="form-control"></div>
|
||||
<div class="col-md-6">NO TELEFON</div>
|
||||
<div class="col-md-6"><input type="text" class="form-control"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row form-group">
|
||||
<div class="col-md-6">NO KP</div>
|
||||
<div class="col-md-6"><input type="text" class="form-control"></div>
|
||||
<div class="col-md-6">JAWATAN</div>
|
||||
<div class="col-md-6"><input type="text" class="form-control"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{ asset('js/pusher.min.js') }}"></script>
|
||||
<script>
|
||||
|
||||
var pusher = new Pusher("{{ env('PUSHER_APP_KEY') }}", {
|
||||
cluster: 'ap1',
|
||||
encrypted: true
|
||||
});
|
||||
|
||||
var channel = pusher.subscribe('action-channel-one');
|
||||
channel.bind('my-actionevent', function(data) {
|
||||
|
||||
alert('asdas');
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -54,6 +54,16 @@ Route::get('/welcome',function(){
|
||||
|
||||
});
|
||||
|
||||
Route::get('/testing',function(){
|
||||
|
||||
$auth_user = Auth::user();
|
||||
$cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
|
||||
return view('testing', compact('cawangan_detail'));
|
||||
|
||||
});
|
||||
|
||||
|
||||
// Auth::routes();
|
||||
|
||||
@@ -314,6 +324,10 @@ Route::post('kakitangan/tukar_taraf/update',['as'=>'kakitangan.tukartaraf.update
|
||||
Route::get('kakitangan/tukar_cawangan',['as'=>'kakitangan.tukarcawangan','uses'=>'KakitanganController@tukarcawangan'])->middleware('auth','operasi');
|
||||
Route::post('kakitangan/tukar_cawangan/update',['as'=>'kakitangan.tukarcawangan.update','uses'=>'KakitanganController@tukarcawanganUpdate'])->middleware('auth','operasi');
|
||||
Route::post('operasi/komoditi/limit',['as'=>'komoditi.limit','uses'=>'KomuditiController@komoditiUpdate'])->middleware('auth','operasi');
|
||||
Route::post('operasi/kakitangan/delete',['as'=>'operasi.kakitangan.delete','uses'=>'KakitanganController@deleteKakitangan'])->middleware('auth','operasi');
|
||||
Route::get('operasi/kakitangan/edit',['as'=>'operasi.kakitangan.edit','uses'=>'KakitanganController@editKakitangan'])->middleware('auth','operasi');
|
||||
Route::post('operasi/kakitangan/edit/store',['as'=>'operasi.kakitangan.edit.store','uses'=>'KakitanganController@editStoreKakitangan'])->middleware('auth','operasi');
|
||||
|
||||
|
||||
Route::get('/operasi/margin',['as'=>'operasi.margin','uses'=>'OperasiController@margin'])->middleware('auth','operasi');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user