dashboard
This commit is contained in:
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Events\Dashboard;
|
||||||
|
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Foundation\Events\Dispatchable;
|
||||||
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||||
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||||
|
|
||||||
|
class KomoditiNotify implements ShouldBroadcast
|
||||||
|
{
|
||||||
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||||
|
|
||||||
|
public $response;
|
||||||
|
public $cawangan;
|
||||||
|
|
||||||
|
public function __construct($response,$cawangan)
|
||||||
|
{
|
||||||
|
$this->response = $response;
|
||||||
|
$this->cawangan = $cawangan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function broadcastOn()
|
||||||
|
{
|
||||||
|
return ['komoditi-notify'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function broadcastAs()
|
||||||
|
{
|
||||||
|
return 'trigger-komoditi';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Events\Dashboard;
|
||||||
|
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Foundation\Events\Dispatchable;
|
||||||
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||||
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||||
|
|
||||||
|
class PelangganNotify implements ShouldBroadcast
|
||||||
|
{
|
||||||
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||||
|
|
||||||
|
public $response;
|
||||||
|
public $cawangan;
|
||||||
|
|
||||||
|
public function __construct($response,$cawangan)
|
||||||
|
{
|
||||||
|
$this->response = $response;
|
||||||
|
$this->cawangan = $cawangan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function broadcastOn()
|
||||||
|
{
|
||||||
|
return ['pelanggan-notify'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function broadcastAs()
|
||||||
|
{
|
||||||
|
return 'trigger-pelanggan';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -118,7 +118,7 @@ class LoginController extends Controller
|
|||||||
return response()->json([
|
return response()->json([
|
||||||
'success' => false,
|
'success' => false,
|
||||||
'message' => 'Invalid Email or Password',
|
'message' => 'Invalid Email or Password',
|
||||||
], 401);
|
], 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ use Illuminate\Support\Facades\Http;
|
|||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Twilio\Rest\Client;
|
use Twilio\Rest\Client;
|
||||||
use App\Komoditi;
|
use App\Komoditi;
|
||||||
|
use App\Events\Dashboard\PelangganNotify;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
@@ -204,6 +205,7 @@ class CustomersController extends Controller
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
Session::put('customer_info',$customer_info);
|
Session::put('customer_info',$customer_info);
|
||||||
|
event(new PelangganNotify('lulus',$auth_user['cawangan']));
|
||||||
return redirect()->route('customer_info')->with( ['customer_info' => $customer_info] );
|
return redirect()->route('customer_info')->with( ['customer_info' => $customer_info] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ namespace App\Http\Controllers;
|
|||||||
use App\Events\OperasiNotice;
|
use App\Events\OperasiNotice;
|
||||||
use App\Events\StatusLiked;
|
use App\Events\StatusLiked;
|
||||||
use App\Events\NotifikasiKelulusan;
|
use App\Events\NotifikasiKelulusan;
|
||||||
|
use App\Events\Dashboard\KomoditiNotify;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -234,4 +235,10 @@ class OperasiController extends Controller
|
|||||||
return view('operasi.rekodtelahlulus',compact('cawangan_info','api_url','arraykelulusan'));
|
return view('operasi.rekodtelahlulus',compact('cawangan_info','api_url','arraykelulusan'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function notifyKomoditi()
|
||||||
|
{
|
||||||
|
$auth_user = Auth::user();
|
||||||
|
event(new KomoditiNotify('lulus',$auth_user['cawangan']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -414,9 +414,19 @@
|
|||||||
text: 'Pendahuluan Unit Komuditi Berjaya'
|
text: 'Pendahuluan Unit Komuditi Berjaya'
|
||||||
});
|
});
|
||||||
$('#pembelian_modal').modal('hide');
|
$('#pembelian_modal').modal('hide');
|
||||||
|
komoditiNotify();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
function komoditiNotify(){
|
||||||
|
$.ajax({
|
||||||
|
method:'get',
|
||||||
|
url: "{{ route('beli.notifyKomoditi') }}",
|
||||||
|
success:function(data){
|
||||||
|
console.log('berjaya');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
+3
-1
@@ -317,4 +317,6 @@ Route::get('admin/kakitangan/resetcredentials',['as'=>'admin.kakitangan.resetcre
|
|||||||
Route::get('admin/pelanggan',['as'=>'admin.pelanggan','uses'=>'KhazanahController@index'])->middleware('auth','admin');
|
Route::get('admin/pelanggan',['as'=>'admin.pelanggan','uses'=>'KhazanahController@index'])->middleware('auth','admin');
|
||||||
Route::get('admin/customer_info',['as'=>'admin.customer_info','uses'=>'KhazanahController@infoAdmin'])->middleware('auth','admin');
|
Route::get('admin/customer_info',['as'=>'admin.customer_info','uses'=>'KhazanahController@infoAdmin'])->middleware('auth','admin');
|
||||||
Route::get('admin/searchpelanggan',['as'=>'admin.searchpelanggan','uses'=>'KhazanahController@searchAdmin'])->middleware('auth','admin');
|
Route::get('admin/searchpelanggan',['as'=>'admin.searchpelanggan','uses'=>'KhazanahController@searchAdmin'])->middleware('auth','admin');
|
||||||
Route::get('admin/poskod',['as'=>'admin.poskod','uses'=>'HomeController@poskod']);
|
Route::get('admin/poskod',['as'=>'admin.poskod','uses'=>'HomeController@poskod']);
|
||||||
|
|
||||||
|
Route::get('pembeliannotifykomuditi',['as'=>'beli.notifyKomoditi','uses'=>'OperasiController@notifyKomoditi'])->middleware('auth','operasi');
|
||||||
Reference in New Issue
Block a user