ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.145.98.251 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/app/Http/Controllers/ |
Upload File : |
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers; use DB; class BankController extends ParentController { public function __construct(Request $request) { $this->division = $request->session()->get('division'); $this->divisionID = $request->session()->get('divisionID'); } public function create() { $data['bank_name'] = DB::table('tblbanklist')->get(); // $data['allCode'] = DB::table('tblbank') // ->leftJoin('tblbanklist', 'tblbank.bankID', '=', 'tblbanklist.bankID') // ->select('tblbanklist.bank', 'bank_code', 'sort_code') // ->where('divisionID', $this->divisionID) // ->get(); return view('bank.bank', $data); } public function store(Request $request) { $this->validate($request, [ 'bankName' => 'required|numeric', 'bankCode' => 'required|alpha_num', 'sortCode' => 'required|alpha_num', ]); $bankID = trim($request['bankName']); $bankCode = trim($request['bankCode']); $sortCode = trim($request['sortCode']); if (is_null(DB::table('tblbank')->where('bankID', $bankID)->where('divisionID', $this->divisionID)->first())) { DB::table('tblbank')->insert(array( 'bankID' => $bankID, 'bank_code' => $bankCode, 'sort_code' => $sortCode, 'divisionID' => $this->divisionID, )); $this->addLog('New bank added with bankID ' .$bankID.' and division ' . $this->division); return redirect('bank/create')->with('msg', 'New bank successfully added!'); } else { DB::update('update tblbank set bank_code = ?, sort_code = ? where bankID = ? and divisionID = ?', [$bankCode, $sortCode, $bankID, $this->divisionID]); // DB::table('tblbank')->where('bankID', $bankID)->update(array( // 'bank_code' => $bankCode, // 'sort_code' => $sortCode, // 'divisionID' => $this->divisionID, // )); $this->addLog('Bank updated with bankID ' .$bankID.' and division ' . $this->division); return redirect('bank/create')->with('msg', 'Bank updated successful!'); } } public function findBank(Request $request) { $this->validate($request, [ 'bankName' => 'required|numeric', ]); $bankID = $request->input('bankName'); $bankRecord = DB::table('tblbank') ->select('sort_code', 'bank_code') ->where('bankID', '=', $bankID) ->where('divisionID', $this->divisionID) ->first(); return response()->json($bankRecord); } }