diff --git a/app/Http/Controllers/CustomersController.php b/app/Http/Controllers/CustomersController.php
index a32c055..6f5d103 100644
--- a/app/Http/Controllers/CustomersController.php
+++ b/app/Http/Controllers/CustomersController.php
@@ -78,6 +78,18 @@ class CustomersController extends Controller
}
}
+ //Cari By IC No
+ public function cari(Request $request)
+ {
+ $api_url = config('api.url');
+ $customers_info = Http::get(config('api.url') . '/api/customers/'. $request->icno)->json();
+
+ if(sizeof($customers_info) > 0)
+ return $customers_info[0];
+ else
+ return "no-data";
+ }
+
/**
* Show the form for creating a new resource.
*
diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php
index d41b704..5de23d4 100644
--- a/app/Http/Controllers/KhazanahController.php
+++ b/app/Http/Controllers/KhazanahController.php
@@ -3,6 +3,8 @@
namespace App\Http\Controllers;
use App\User;
+use App\Cawangan;
+
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Auth;
@@ -12,6 +14,33 @@ use PDF;
class KhazanahController extends Controller
{
+ public function index()
+ {
+ $search = false;
+
+ $api_url = config('api.url');
+ $auth_user = Auth::user();
+ $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
+ $bank = Http::get(config('api.url') . '/api/bank')->json();
+ return view('khazanah.index',compact('search','cawangan_info','bank','api_url'));
+ }
+
+ public function info(Request $request){
+ $auth_user = Auth::user();
+ $api_url = config('api.url');
+ $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
+ $customers_info = Http::get(config('api.url') . '/api/customers/'. $request->noic)->json();
+ if($customers_info){
+ $customer_info = $customers_info[0];
+ }else{
+ $customer_info = $customers_info;
+ }
+
+ $request->session()->forget('page_reload');
+ $request->session()->forget('norujukan');
+ return view('khazanah.info',compact('cawangan_info','api_url','customer_info'));
+ }
+
public function menu()
{
$auth_user = Auth::user();
@@ -23,6 +52,61 @@ class KhazanahController extends Controller
return view('khazanah.menu',compact('cawangan_info','api_url','gadai','listserah'));
}
+ public function dashboard()
+ {
+ $auth_user = Auth::user();
+ $api_url = config('api.url');
+
+ $harini = Carbon::now();
+ $harini = new Carbon;
+
+ //Hari Ini
+ $ringkasanharian = Http::get(config('api.url'). '/api/gadai/laporan/ringkasanharian/'. $auth_user['cawangan'] .'/'. $harini->toDateString())->json();
+ $ringkasanharian = $ringkasanharian[0];
+
+ $keseluruhanupahharian = $ringkasanharian['lelongupahsimpan'] + $ringkasanharian['tebus'][0]['upahsimpan'] + $ringkasanharian['advansur'][0]['upahsimpan'];
+
+ //Terkumpul
+ $ringkasanterkumpul = Http::get(config('api.url'). '/api/gadai/laporan/ringkasan/'. $auth_user['cawangan'] .'/'. $harini->toDateString())->json();
+ $ringkasanterkumpul = $ringkasanterkumpul[0];
+
+ $keseluruhanupahterkumpul = $ringkasanterkumpul['lelongupahsimpan'] + $ringkasanterkumpul['tebus'][0]['upahsimpan'] + $ringkasanterkumpul['advansur'][0]['upahsimpan'];
+
+ //Peti Besi Cawangan
+ $getVault=Http::get( config('api.url').'/api/VaultController/'.$auth_user['cawangan'])->json();
+
+ $getVault = $getVault[0]['BakiAwal'];
+
+ //Marhun Terkumpul
+ $marhun = Http::get(config('api.url'). '/api/marhunterkumpul/laporan/'. $auth_user['cawangan'] .'/'. $harini->toDateString())->json();
+
+ $totalmarhun = 0;
+
+ foreach($marhun as $index=>$m)
+ {
+ $totalmarhun += $m['n_marhun'];
+ }
+
+ $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
+ return view('khazanah.dashboard',compact('cawangan_info','api_url','totalmarhun','ringkasanharian','ringkasanterkumpul','getVault','keseluruhanupahharian','keseluruhanupahterkumpul'));
+ }
+
+ public function alirantunai()
+ {
+ $auth_user = Auth::user();
+ $api_url = config('api.url');
+
+ $tunai = Http::get( config('api.url') .'/api/TunaiController/'. $auth_user['cawangan'])->json();
+ $tunai = $tunai[0];
+
+ $addtunai = Http::get( config('api.url') .'/api/getAddTunai/'. $auth_user['cawangan'])->json();
+
+ $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
+
+
+ return view('khazanah.alirantunai',compact('cawangan_info','api_url','tunai','addtunai'));
+ }
+
public function gadaian()
{
$auth_user = Auth::user();
@@ -128,15 +212,101 @@ class KhazanahController extends Controller
}
+ ///PANJAR///
+
+ public function panjarlist()
+ {
+
+ }
+
+ ///END PANJAR///
+
+
+ ///KELULUSAN///
+
public function kelulusan()
{
$auth_user = Auth::user();
$api_url = config('api.url');
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
- return view('khazanah.kelulusan',compact('cawangan_info','api_url'));
+
+ $kelulusan = Http::get(config('api.url') . '/api/SenaraiKelulusan/' . $auth_user['cawangan'])->json();
+
+ return view('khazanah.kelulusan',compact('cawangan_info','api_url','kelulusan'));
}
+
+
+ public function getkelulusan(Request $request)
+ {
+ $auth_user = Auth::user();
+ $api_url = config('api.url');
+
+ $norujukan = $request->norujukan;
+
+ $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
+
+ $kelulusan = Http::get(config('api.url') . '/api/SenaraiDahLulus/' . $auth_user['cawangan'] . '/' . $norujukan)->json();
+
+ if(sizeof($kelulusan) > 0)
+ {
+ $kelulusan = $kelulusan[0]['pelulus'];
+ }
+ else
+ {
+ $kelulusan = '';
+ }
+
+ return response($kelulusan);
+ }
+
+ public function updatekelulusan(Request $request)
+ {
+ $auth_user = Auth::user();
+
+ $api_url = config('api.url');
+
+ $norujukan = $request->norujukan;
+
+ $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
+
+ $updatelulus = Http::put(config('api.url') . '/api/UpdateKelulusan/' . $auth_user['cawangan'] . '/' . $norujukan, [
+ 'pelulus' => $auth_user['name']
+ ])->json();
+
+ return response()->json($updatelulus,200);
+ }
+
+ public function createkelulusan(Request $request)
+ {
+ $auth_user = Auth::user();
+ $api_url = config('api.url');
+
+ $norujukan = $request->norujukan;
+
+ $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
+
+ $createlulus = Http::post(config('api.url') . '/api/CreateKelulusan/' . $auth_user['cawangan'] . '/' . $norujukan, [
+ 'komen' => "dsaa",
+ 'dategadai' => "2020-12-12",
+ 'bilgadai' => 1,
+ 'jumpinjam' => 1020,
+ 'jenistebus' => "G",
+ 'teller' => "dsaas"
+ // 'komen' => $request->komen,
+ // 'dategadai' => $dategadai,
+ // 'bilgadai' => $bilgadai,
+ // 'jumpinjam' => $request->jumpinjam,
+ // 'jenistebus' => "G",
+ // 'teller' => $request->teller
+ ])->json();
+
+ return response()->json($createlulus,201);
+ }
+
+ ///END KELULUSAN///
+
public function pendahuluan()
{
$auth_user = Auth::user();
@@ -204,9 +374,163 @@ class KhazanahController extends Controller
return view('khazanah.laporan.index',compact('cawangan_info','api_url','gadai'));
}
+ public function denominasicalculationpendahuluan($request)
+ {
+ $auth_user = Auth::user();
+
+ $denominasilist = Http::get( config('api.url') .'/api/DenominasiController/'. $auth_user['cawangan'])->json();
+
+ //bundle initialize
+ $rekodb1 = $denominasilist[0]['bd1']; $rekodb5 = $denominasilist[0]['bd5']; $rekodb10 = $denominasilist[0]['bd10']; $rekodb20 = $denominasilist[0]['bd20'];
+ $rekodb50 = $denominasilist[0]['bd50']; $rekodb100 = $denominasilist[0]['bd100'];
+
+ //wang Syilling Initialize
+ $rekodsen1 = $denominasilist[0]['txtSen1']; $rekodsen5 = $denominasilist[0]['txtSen5']; $rekodsen10 = $denominasilist[0]['txtSen10'];
+ $rekodsen20 = $denominasilist[0]['txtSen20']; $rekodsen50 = $denominasilist[0]['txtSen50'];
+
+ //Wang Ringgit Initialize
+ $rekodring1 = $denominasilist[0]['txtRing1']; $rekodring5 = $denominasilist[0]['txtRing5']; $rekodring10 = $denominasilist[0]['txtRing10'];
+ $rekodring20 = $denominasilist[0]['txtRing20']; $rekodring50 = $denominasilist[0]['txtRing50']; $rekodring100 = $denominasilist[0]['txtRing100'];
+
+ //Tolok Rekod
+ $rekodb1 -= intval($request->ambilanb1);
+ $rekodb5 -= intval($request->ambilanb5);
+ $rekodb10 -= intval($request->ambilanb10);
+ $rekodb20 -= intval($request->ambilanb20);
+ $rekodb50 -= intval($request->ambilanb50);
+ $rekodb100 -= intval($request->ambilanb100);
+
+ $rekodsen1 -= intval($request->ambilansen1);
+ $rekodsen5 -= intval($request->ambilansen5);
+ $rekodsen10 -= intval($request->ambilansen10);
+ $rekodsen20 -= intval($request->ambilansen20);
+ $rekodsen50 -= intval($request->ambilansen50);
+
+ $rekodring1 -= intval($request->ambilanring1);
+ $rekodring5 -= intval($request->ambilanring5);
+ $rekodring10 -= intval($request->ambilanring10);
+ $rekodring20 -= intval($request->ambilanring20);
+ $rekodring50 -= intval($request->ambilanring50);
+ $rekodring100 -= intval($request->ambilanring100);
+
+
+ $denominasicreate = Http::put(config('api.url').'/api/DenominasiUpdate/'.$auth_user['cawangan'],[
+
+ 'bd1' => $rekodb1,
+ 'bd5'=> $rekodb5,
+ 'bd10'=> $rekodb10,
+ 'bd20'=> $rekodb20,
+ 'bd50'=> $rekodb50,
+ 'bd100'=> $rekodb100,
+ 'txtRing1'=> $rekodring1,
+ 'txtRing5'=> $rekodring5,
+ 'txtSen1'=> $rekodsen1,
+ 'txtSen5'=> $rekodsen5,
+ 'txtSen10'=> $rekodsen10,
+ 'txtSen20'=> $rekodsen20,
+ 'txtSen50'=> $rekodsen50,
+ 'txtRing10'=> $rekodring10,
+ 'txtRing20'=> $rekodring20,
+ 'txtRing50'=> $rekodring50,
+ 'txtRing100'=> $rekodring100,
+ 'txtRing1000'=> "0",
+ 'jumlahbundle'=> "0",
+ 'txtJumlah'=> "0",
+ 'jumlahkeping' => "0"
+
+ ]);
+
+ $updaterequest=Http::put(config('api.url').'/api/requestTeller/update/'. $auth_user['cawangan'] . '/' . "SAMSIANA",[
+
+ 'no'=>$request->no
+
+ ]);
+
+ return redirect()->route('khazanah.pendahulu');
+
+ }
+
+ public function denominasicalculationserahan($request)
+ {
+ $auth_user = Auth::user();
+
+ $denominasilist = Http::get( config('api.url') .'/api/DenominasiController/'. $auth_user['cawangan'])->json();
+
+ //bundle initialize
+ $rekodb1 = $denominasilist[0]['bd1']; $rekodb5 = $denominasilist[0]['bd5']; $rekodb10 = $denominasilist[0]['bd10']; $rekodb20 = $denominasilist[0]['bd20'];
+ $rekodb50 = $denominasilist[0]['bd50']; $rekodb100 = $denominasilist[0]['bd100'];
+
+ //wang Syilling Initialize
+ $rekodsen1 = $denominasilist[0]['txtSen1']; $rekodsen5 = $denominasilist[0]['txtSen5']; $rekodsen10 = $denominasilist[0]['txtSen10'];
+ $rekodsen20 = $denominasilist[0]['txtSen20']; $rekodsen50 = $denominasilist[0]['txtSen50'];
+
+ //Wang Ringgit Initialize
+ $rekodring1 = $denominasilist[0]['txtRing1']; $rekodring5 = $denominasilist[0]['txtRing5']; $rekodring10 = $denominasilist[0]['txtRing10'];
+ $rekodring20 = $denominasilist[0]['txtRing20']; $rekodring50 = $denominasilist[0]['txtRing50']; $rekodring100 = $denominasilist[0]['txtRing100'];
+
+ //Tolok Rekod
+ $rekodb1 += intval($request->ambilanb1);
+ $rekodb5 += intval($request->ambilanb5);
+ $rekodb10 += intval($request->ambilanb10);
+ $rekodb20 += intval($request->ambilanb20);
+ $rekodb50 += intval($request->ambilanb50);
+ $rekodb100 += intval($request->ambilanb100);
+
+ $rekodsen1 += intval($request->ambilansen1);
+ $rekodsen5 += intval($request->ambilansen5);
+ $rekodsen10 += intval($request->ambilansen10);
+ $rekodsen20 += intval($request->ambilansen20);
+ $rekodsen50 += intval($request->ambilansen50);
+
+ $rekodring1 += intval($request->ambilanring1);
+ $rekodring5 += intval($request->ambilanring5);
+ $rekodring10 += intval($request->ambilanring10);
+ $rekodring20 += intval($request->ambilanring20);
+ $rekodring50 += intval($request->ambilanring50);
+ $rekodring100 += intval($request->ambilanring100);
+
+
+ $denominasicreate = Http::put(config('api.url').'/api/DenominasiUpdate/'.$auth_user['cawangan'],[
+
+ 'bd1' => $rekodb1,
+ 'bd5'=> $rekodb5,
+ 'bd10'=> $rekodb10,
+ 'bd20'=> $rekodb20,
+ 'bd50'=> $rekodb50,
+ 'bd100'=> $rekodb100,
+ 'txtRing1'=> $rekodring1,
+ 'txtRing5'=> $rekodring5,
+ 'txtSen1'=> $rekodsen1,
+ 'txtSen5'=> $rekodsen5,
+ 'txtSen10'=> $rekodsen10,
+ 'txtSen20'=> $rekodsen20,
+ 'txtSen50'=> $rekodsen50,
+ 'txtRing10'=> $rekodring10,
+ 'txtRing20'=> $rekodring20,
+ 'txtRing50'=> $rekodring50,
+ 'txtRing100'=> $rekodring100,
+ 'txtRing1000'=> "0",
+ 'jumlahbundle'=> "0",
+ 'txtJumlah'=> "0",
+ 'jumlahkeping' => "0"
+
+ ]);
+
+ $updaterequest=Http::put(config('api.url').'/api/requestTeller/update/'. $auth_user['cawangan'] . '/' . "SAMSIANA",[
+
+ 'no'=>$request->no
+
+ ]);
+
+ return redirect()->route('khazanah.serahan');
+
+ }
+
public function kemaskiniPendahuluan(Request $request) //Daftar Pendahuluan kepada Kaunter
{
+ return $this->denominasicalculationpendahuluan($request);
+
$auth_user = Auth::user();
$api_url = config('api.url');
$peti_besi_terkini=Http::get(config('api.url').'/api/VaultController/'.$auth_user['cawangan'])->json();
@@ -233,18 +557,17 @@ class KhazanahController extends Controller
$kodcaw=$auth_user['cawangan'];
- // $addTunai=Http::post(config('api.url').'/api/add/addTunai/'.$auth_user['cawangan'],[
- // 'kodcaw'=>$kodcaw,
- // 'KodLaluan'=>$kodlaluan,
- // 'tambah'=>$tambah,
- // 'kurang'=>$kurang,
- // 'nota'=>$nota
- // ]);
+ $addTunai=Http::post(config('api.url').'/api/add/addTunai/'.$auth_user['cawangan'],[
+ 'kodcaw'=>$kodcaw,
+ 'KodLaluan'=>$kodlaluan,
+ 'tambah'=>$tambah,
+ 'kurang'=>$kurang,
+ 'nota'=>$nota
+ ]);
$getTunai=Http::get(config('api.url').'/api/TunaiController/'.$auth_user['cawangan'])->json();
- dd($getTunai);
- return;
+
if(sizeof($getTunai) == 0)
{
@@ -258,6 +581,7 @@ class KhazanahController extends Controller
'teller'=>$request->teller
]);
+
$BakiAkhirT=0;$BakiAwalT=0;$tambahT=0;
@@ -267,6 +591,8 @@ class KhazanahController extends Controller
$bakiAwal=$getTunai2[0]['BakiAwal'];
$keluar=$getTunai2[0]['Keluar'];
+
+
if($bakiAwal==0)
{
@@ -293,58 +619,17 @@ class KhazanahController extends Controller
'bakiakhir'=>$BakiAkhirT
]);
- // echo($tambahT);
- // echo " ";
- // echo($kurang);
- // echo " ";
- // echo($BakiAkhirT);
- // dd($tambah);
- $latestVault=Http::get( config('api.url').'/api/VaultController/'.$auth_user['cawangan'])->json();
+ $latestVault=Http::get(config('api.url').'/api/VaultController/'.$auth_user['cawangan'])->json();
$masukV=$latestVault[0]['Masuk'];
$keluarV=$latestVault[0]['Keluar'];
$pendahuluanV=$latestVault[0]['pendahuluan'];
$serahanV=$latestVault[0]['serahan'];
$BakiAwalV=$latestVault[0]['BakiAwal'];
-
- if($masukV==0)
- {
- $masukV=0;
- }
- else
- {
- $masukV=$latestVault[0]["Masuk"];
- }
-
-
- if($keluarV==0) // checking wang keluar
- {
- $keluarV=0;
- }
- else
- {
- $keluarV=$latestVault[0]['Keluar'];
- }
-
- if($pendahuluanV==0)
- {
- $pendahuluanV=0;
- }
- else
- {
- $pendahuluanV=$latestVault[0]['pendahuluan'];
- }
-
- if($serahanV==0)
- {
- $serahanV=0;
-
- }else
- {
- $serahanV=$latestVault[0]['serahan'];
- }
+ // dd($latestVault);
+ // return;
$keluarV=$keluarV+$tambahT;
$GetLatestBakiTunai=Http::get( config('api.url').'/api/getLatestBaki/'.$auth_user['cawangan'])->json();
@@ -370,8 +655,9 @@ class KhazanahController extends Controller
]);
//-----PROCESS SELESAI-----------------------------------
- //didplay final result
- return view('khazanah.menu');
+ //display final result
+
+ return $this->denominasicalculationpendahuluan($request);
//dd($updateVault);
@@ -384,6 +670,8 @@ class KhazanahController extends Controller
public function KemaskiniSerahan(Request $request)
{
+ return $this->denominasicalculationserahan($request);
+
$auth_user = Auth::user();
$api_url = config('api.url');
$peti_besi_terkini=Http::get(config('api.url').'/api/VaultController/'.$auth_user['cawangan'])->json();
@@ -851,4 +1139,59 @@ class KhazanahController extends Controller
// dd($gadai);
return view('print.laporan_kawalanstok', compact('kawalanstok','cawangan_detail','tarikh_cetak','tebus_date','api_url'));
}
+
+
+ public function kakitangan()
+ {
+ $auth_user = Auth::user();
+ $api_url = config('api.url');
+ $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
+
+ $teller = User::where('roles','=',"teller")->get();
+ $khazanah = User::where('roles','=',"khazanah")->get();
+
+ return view('khazanah.kakitangan',compact('cawangan_info','api_url','teller','khazanah'));
+ }
+
+ public function capaian()
+ {
+ $auth_user = Auth::user();
+ $api_url = config('api.url');
+ $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
+ return view('khazanah.capaian',compact('cawangan_info','api_url'));
+ }
+
+ public function hargaemas()
+ {
+ $auth_user = Auth::user();
+ $api_url = config('api.url');
+ $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
+ $harga_emas = Http::get(config('api.url') . '/api/harga_emas/')->json();
+
+ return view('khazanah.hargaemas',compact('cawangan_info','api_url','harga_emas'));
+ }
+
+ public function pelanggan()
+ {
+ $auth_user = Auth::user();
+ $api_url = config('api.url');
+ $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
+ return view('khazanah.pelanggan',compact('cawangan_info','api_url'));
+ }
+
+ public function panjar()
+ {
+ $auth_user = Auth::user();
+ $api_url = config('api.url');
+ $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
+ return view('khazanah.panjar',compact('cawangan_info','api_url'));
+ }
+
+ public function unjuran()
+ {
+ $auth_user = Auth::user();
+ $api_url = config('api.url');
+ $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
+ return view('khazanah.unjuran',compact('cawangan_info','api_url'));
+ }
}
\ No newline at end of file
diff --git a/app/Http/Controllers/PenebusanController.php b/app/Http/Controllers/PenebusanController.php
index fd9bd38..7f0a8f1 100644
--- a/app/Http/Controllers/PenebusanController.php
+++ b/app/Http/Controllers/PenebusanController.php
@@ -374,4 +374,57 @@ class PenebusanController extends Controller
return response()->json($updatemarhun,200);
}
+
+
+ //Wakil Function - Jangan kacau saya nak makan kacang ni!!!!!!
+
+ public function getfirstWakil()
+ {
+ $auth_user = Auth::user();
+
+
+ $getfirstwakil = Http::get(config('api.url') . '/api/getwakil/'. $auth_user['cawangan'])->json();
+
+ if(sizeof($getfirstwakil) != 0)
+ return $getfirstwakil[0]['NOWAKIL'];
+ else
+ return $getfirstwakil;
+ }
+
+
+ public function getWakil(Request $request)
+ {
+ $auth_user = Auth::user();
+
+ $getwakil = Http::get(config('api.url') . '/api/getwakil/'. $auth_user['cawangan'] . '/' . $request->wakil)->json();
+
+ if(sizeof($getwakil) > 0)
+ return $getwakil[0];
+ else
+ return 'no-data';
+ }
+
+ public function createWakil(Request $request)
+ {
+ $auth_user = Auth::user();
+
+ $createwakil = Http::post(config('api.url') . '/api/createwakil/'. $auth_user['cawangan'] . '/' . $request->icno,[
+
+
+ 'nopelanggan' => $request->nopelanggan,
+ 'nowakil' => $request->nowakil,
+ 'nama' => $request->nama,
+ 'hubungan' => $request->hubungan,
+ 'alamat' => $request->alamat,
+ 'telefon' => $request->telefon,
+ 'nota' => $request->nota
+
+ ])->json();
+
+ if($createwakil)
+ return 1;
+ else
+ return 0;
+ }
+
}
diff --git a/public/js/main.js b/public/js/main.js
index 5fa0b37..ce15034 100644
--- a/public/js/main.js
+++ b/public/js/main.js
@@ -6,6 +6,21 @@ function totalamount(idwang,bilangan)
var amount = 0;
switch (idwang) {
case 'bundle1':
+ // var rec1 = parseInt($('#rekodb1').val());
+ // var tempbil = 0;
+
+ // console.log(rec1);
+
+
+ // bilangan != '' ? tempbil = bilangan : tempbil = 0;
+
+ // console.log(tempbil);
+
+
+ // total = rec1-tempbil;
+
+ // $('#rekodb1').val(total);
+
amount += (bilangan * 100);
break;
case 'bundle20':
@@ -76,8 +91,11 @@ function totalkey(datakeyin)
$.each(arrayambilan, function( index, arr ){
if(arr[0] == idkey)
- arrayambilan[index][1] = totalamount(idkey,valkey);
+ {
+ arrayambilan[index][1] = totalamount(idkey,valkey);
+ }
+
amount += arr[1];
});
diff --git a/resources/views/gadaian/index.blade.php b/resources/views/gadaian/index.blade.php
index 4449c63..aae0f17 100644
--- a/resources/views/gadaian/index.blade.php
+++ b/resources/views/gadaian/index.blade.php
@@ -60,8 +60,8 @@
+
+
@endsection
diff --git a/resources/views/khazanah/laporan/index.blade.php b/resources/views/khazanah/laporan/index.blade.php
index fff5672..236003e 100644
--- a/resources/views/khazanah/laporan/index.blade.php
+++ b/resources/views/khazanah/laporan/index.blade.php
@@ -24,10 +24,10 @@
Ringkasan Terkumpul
diff --git a/resources/views/khazanah/panjar.blade.php b/resources/views/khazanah/panjar.blade.php
new file mode 100644
index 0000000..559e633
--- /dev/null
+++ b/resources/views/khazanah/panjar.blade.php
@@ -0,0 +1,178 @@
+@extends('layouts.app')
+
+@section('content')
+
+@include('modal.panjar')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Keraian
+ Selenggara
+ Belanja Am
+ Perubatan
+ Dapur
+ Pos
+
+
+
+
+
+ bil
+ tarikh
+ deskripsi
+ kategori
+ bayaran
+
+
+
+
+
+
+
+ {{--
--}}
+
+
+
+
+
+
+
+
+@endsection
diff --git a/resources/views/khazanah/pelanggan.blade.php b/resources/views/khazanah/pelanggan.blade.php
new file mode 100644
index 0000000..ac488e2
--- /dev/null
+++ b/resources/views/khazanah/pelanggan.blade.php
@@ -0,0 +1,87 @@
+@extends('layouts.app')
+
+@section('content')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Bil
+ Teller
+ Tarikh
+ Pendahuluan
+ Serahan
+
+
+
+
+ 1
+ 31231
+ 2321
+ 32
+ 32
+
+
+
+
+
+
+
+
+
+
+
+
+
+@endsection
diff --git a/resources/views/khazanah/pendahuluanserah.blade.php b/resources/views/khazanah/pendahuluanserah.blade.php
index 821176e..00e2a0d 100644
--- a/resources/views/khazanah/pendahuluanserah.blade.php
+++ b/resources/views/khazanah/pendahuluanserah.blade.php
@@ -12,7 +12,7 @@
-
+
@csrf
Tarikh
@@ -29,7 +29,7 @@
-
+
Amaun (RM)
@@ -44,7 +44,7 @@
@@ -76,32 +76,33 @@
RM1
-
-
-
+
+
+
RM20
-
-
-
+
+
+
RM5
-
-
-
- RM50
-
-
+
+
+
+ RM50
+
+
+
RM10
-
-
-
+
+
+
RM100
-
-
-
+
+
+
@@ -109,7 +110,7 @@
@@ -303,5 +305,14 @@
+
+
@endsection
diff --git a/resources/views/khazanah/unjuran.blade.php b/resources/views/khazanah/unjuran.blade.php
new file mode 100644
index 0000000..c8ae3ee
--- /dev/null
+++ b/resources/views/khazanah/unjuran.blade.php
@@ -0,0 +1,65 @@
+@extends('layouts.app')
+
+@section('content')
+
+
+
+
+
+
+
+
+
+
+
+
Unjuran Pinjaman
+
+
+
+
+
+
+
+
+
+
+ Bil
+ Nama
+ No K/P
+ No Rujukan
+ Pinjaman
+ Upah
+ Bayaran
+
+
+
+
+ 1
+ 31231
+ 2321
+ 32
+ 32
+ 32
+ 32
+
+
+
+
+
+
+
+
+
+
+
+
+
+@endsection
diff --git a/resources/views/modal/panjar.blade.php b/resources/views/modal/panjar.blade.php
new file mode 100644
index 0000000..9a5c917
--- /dev/null
+++ b/resources/views/modal/panjar.blade.php
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/modal/wakil.blade.php b/resources/views/modal/wakil.blade.php
new file mode 100644
index 0000000..c3ebff7
--- /dev/null
+++ b/resources/views/modal/wakil.blade.php
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/views/penebusan/index.blade.php b/resources/views/penebusan/index.blade.php
index 19201c5..84727c7 100644
--- a/resources/views/penebusan/index.blade.php
+++ b/resources/views/penebusan/index.blade.php
@@ -1,5 +1,7 @@
@extends('layouts.app')
+@include('modal.wakil')
+
@section('content')
-
-
@@ -741,7 +746,7 @@ function bayaransemua()
{
Swal.fire(
'Amaran!',
- 'Masukkan jumlah melebihi jumlah perlu dibayar!',
+ 'Jumlah bayaran kurang daripada jumlah yang perlu dibayar!',
'error'
)
return false;
@@ -972,6 +977,169 @@ function bayaransemua()
}
+
+function wakilfunction(e)
+{
+ let wakil = $('#wakiltxt').val();
+
+ if(wakil.length == 12)
+ {
+ $.ajax({
+ method:'GET',
+ url: "{{ route('wakil.search') }}",
+ data:{
+ 'wakil' : wakil
+ },
+ success:function(data){
+
+ if(data == 'no-data')
+ {
+ Swal.fire({
+ allowOutsideClick: false,
+ allowEscapeKey: false,
+ allowEnterKey: false,
+ confirmButtonText: '
Daftar Dulu Boss!',
+ icon: 'info',
+ title: 'Maklumat anda tiada dalam senarai wakil! Tekan button okay untuk mendaftar!'
+ }).then(function(){
+ daftarfunction(wakil);
+ });
+ }else{
+ Swal.fire({
+ allowOutsideClick: false,
+ allowEscapeKey: false,
+ allowEnterKey: false,
+ confirmButtonText: '
Baik Boss!',
+ icon: 'success',
+ title: 'Maklumat anda Berjaya Direkodkan!'
+ });
+
+ $('#wakiltxt').prop( "disabled", true );
+ $(e).html("Ubah");
+ $(e).attr("onclick","ubahwakil(this)");
+ }
+
+ },error: function (request, status, error) {
+ console.log(request.responseText);
+ }
+ });
+ }
+ else
+ {
+ Swal.fire({
+ icon: 'error',
+ titleText: 'Kad Pengenalan',
+ text: 'mestilah tidak melebihi dan kurang daripada 12 patah perkataan'
+ });
+ }
+
+}
+
+function daftarwakil()
+{
+ let nopelanggan = $('#nopelanggan').val();
+ let nowakil = $('#nowakil').val();
+ let nama = $('#nama').val();
+ let hubungan = $('#slthubungan').val();
+ let alamat = $('#alamat').val();
+ let telefon = $('#notel').val();
+ let nota = $('#nota').val();
+ let nokp = $('#nokp').val();
+
+
+ $.ajax({
+ method:'POST',
+ url: "{{ route('wakil.create') }}",
+ data:{
+ "_token": "{{ csrf_token() }}",
+ "nopelanggan" : nopelanggan,
+ "nowakil" : nowakil,
+ "nama" : nama,
+ "hubungan" : hubungan,
+ "alamat" : alamat,
+ "telefon" : telefon,
+ "nota" : nota,
+ "icno" : nokp
+ },
+ success:function(data){
+
+ if(data == 1)
+ {
+ $('#WakilModal').hide();
+ $('#WakilModal').modal('hide');
+
+ Swal.fire({
+ allowOutsideClick: false,
+ allowEscapeKey: false,
+ allowEnterKey: false,
+ confirmButtonText: '
Baik Boss!',
+ icon: 'success',
+ title: 'Berjaya Mendaftar Wakil Pelanggan!'
+ }).then(function(){
+ $('#wakiltxt').prop( "disabled", true );
+ $('#caribtn').html("Ubah");
+ $('#caribtn').attr("onclick","ubahwakil(this)");
+
+
+ });
+ }
+
+ },error: function (request, status, error) {
+ console.log(request.responseText);
+ }
+ });
+}
+
+function daftarfunction(id)
+{
+ $('#nokp').val(id);
+
+ $.ajax({
+ method:'GET',
+ url: "{{ route('wakil.caricustomer') }}",
+ data:{ "icno" : id },
+ success:function(data){
+
+ $('#WakilModal').modal();
+ $('#nama').val('');
+ $('#alamat').val(data['']);
+ $('#notel').val(data['']);
+
+ //get first wakil
+ $.ajax({
+ method:'GET',
+ url: "{{ route('wakil.first') }}",
+ success:function(getfirstwakil)
+ {
+ let firstwakil = parseInt(getfirstwakil);
+
+ $('#nowakil').val(firstwakil+1);
+ }
+ });
+
+ if(data != 'no-data')
+ {
+ $('#nama').val(data['nama']);
+ $('#alamat').val(data['alamat1']);
+ $('#notel').val(data['telefon']);
+ $('#nopelanggan').val(data['nopelanggan']);
+ }
+
+
+ },error: function (request, status, error) {
+ console.log(request.responseText);
+ }
+
+ });
+}
+
+function ubahwakil(e)
+{
+ $('#wakiltxt').prop( "disabled", false);
+ $(e).html("Cari");
+ $(e).attr( "onclick", "wakilfunction(this)");
+}
+
// Restricts input for the set of matched elements to the given inputFilter function.
(function($) {
$.fn.inputFilter = function(inputFilter) {
@@ -990,8 +1158,5 @@ function bayaransemua()
};
}(jQuery));
-
-
-
@endsection
\ No newline at end of file
diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php
index 3fb48cc..ba4b0ba 100644
--- a/resources/views/welcome.blade.php
+++ b/resources/views/welcome.blade.php
@@ -9,6 +9,8 @@
+
+