Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
middleware('auth'); } /** * Show the application dashboard. * * @return \Illuminate\Contracts\Support\Renderable */ #################################################SAMPLE CODES ################################################################################### public function add_expenses_post(Request $request) { $ex=explode('|',$request->name); $ledger_id=$ex[0]; $name=$ex[1]; $nature=$ex[2]; if($nature=="expense"){ $batch_id = 'EX-'.rand().'-'.time(); $data =array( 'branch_id'=>Session::get('user')['branch_id'], 'name'=>$name, 'amount'=>$request->amount, 'expenseDate'=>$request->expenseDate, 'description'=>$request->description, 'batch'=>$batch_id, 'registered_by'=>Auth::id(), 'date'=>date('Y-m-d'), 'status'=>1, ); DB::table('expenses')->insert($data); $expenses_idID = DB::getPdo()->lastInsertId(); ##daily ledger####### $ledger_account_fetch = DB::table('ledger_accounts')->where('id',$ledger_id)->get(); foreach($ledger_account_fetch as $ss){ $ledger_product_id = $ss->id; $ledger_account = $ss->bank; } $method = $request->method; if($method==3){ foreach(DB::table('ledger_accounts')->where('visible','cash')->where('branch_id',Session::get('user')['branch_id'])->get() as $cash){ $ledger_account=$cash->id; } } $debitCredit="debit"; $ledger1 = array( 'branch_id'=>Session::get('user')['branch_id'], 'ledger_account_id'=>$ledger_id, 'amount'=>$request->amount, 'cr_dr'=>$debitCredit, 'batch_id'=>$batch_id, 'ledger_source_id'=>$expenses_idID, 'time'=>date('H:i:s'), 'date'=>date('Y-m-d'), ); if($debitCredit=='credit'){ $debitCredit2='debit'; }else{ $debitCredit2='credit'; } DB::table('daily_ledger')->insert($ledger1); $ledger2 = array( 'branch_id'=>Session::get('user')['branch_id'], 'ledger_account_id'=>$ledger_account, 'amount'=>$request->amount, 'cr_dr'=>$debitCredit2, 'batch_id'=>$batch_id, 'ledger_source_id'=>$expenses_idID, 'time'=>date('H:i:s'), 'date'=>date('Y-m-d'), ); DB::table('daily_ledger')->insert($ledger2); ##daily ledger####### }else{ #income functions... $batch_id = 'IN-'.rand().'-'.time(); $data =array( 'branch_id'=>Session::get('user')['branch_id'], 'name'=>$name, 'amount'=>$request->amount, 'transactionDate'=>$request->expenseDate, 'description'=>$request->description, 'batch'=>$batch_id, 'registered_by'=>Auth::id(), 'date'=>date('Y-m-d'), 'status'=>1, ); DB::table('incomes')->insert($data); $income_idID = DB::getPdo()->lastInsertId(); ##daily ledger####### ##daily ledger####### $ledger_account_fetch = DB::table('ledger_accounts')->where('id',$ledger_id)->get(); foreach($ledger_account_fetch as $ss){ $ledger_product_id = $ss->id; $ledger_account = $ss->bank; } $method = $request->method; if($method==3){ foreach(DB::table('ledger_accounts')->where('visible','cash')->where('branch_id',Session::get('user')['branch_id'])->get() as $cash){ $ledger_account=$cash->id; } } $debitCredit="credit"; $ledger1 = array( 'branch_id'=>Session::get('user')['branch_id'], 'ledger_account_id'=>$ledger_product_id, 'amount'=>$request->amount, 'cr_dr'=>$debitCredit, 'batch_id'=>$batch_id, 'ledger_source_id'=>$income_idID, 'time'=>date('H:i:s'), 'date'=>date('Y-m-d'), ); if($debitCredit=='credit'){ $debitCredit2='debit'; }else{ $debitCredit2='credit'; } DB::table('daily_ledger')->insert($ledger1); $ledger2 = array( 'branch_id'=>Session::get('user')['branch_id'], 'ledger_account_id'=>$ledger_account, 'amount'=>$request->amount, 'cr_dr'=>$debitCredit2, 'batch_id'=>$batch_id, 'ledger_source_id'=>$income_idID, 'time'=>date('H:i:s'), 'date'=>date('Y-m-d'), ); DB::table('daily_ledger')->insert($ledger2); ##daily ledger####### } return redirect('/expenses_other_income/add_expenses?sent'); } public function add_income_post(Request $request) { $ex=explode('|',$request->name); $ledger_id=$ex[0]; $name=$ex[1]; $data =array( 'branch_id'=>Session::get('user')['branch_id'], 'name'=>$name, 'amount'=>$request->amount, 'transactionDate'=>$request->expenseDate, 'description'=>$request->description, 'registered_by'=>Auth::id(), 'date'=>date('Y-m-d'), 'status'=>1, ); DB::table('incomes')->insert($data); $expenses_idID = DB::getPdo()->lastInsertId(); foreach ($_FILES["file"]["name"] as $f => $name) { $path = $name; $ext = pathinfo($path, PATHINFO_EXTENSION); $document = "./uploads/docs/".date('Ymd')."-".rand()."-".time().".".$ext; move_uploaded_file($_FILES["file"]["tmp_name"][$f], base_path('public/assets/').$document); $data = array( 'branch_id'=>Session::get('user')['branch_id'], 'income_id'=>$expenses_idID, 'file'=>$document, 'registered_by'=>Auth::id(), 'date'=>date('Y-m-d'), ); DB::table('income_documents')->insert($data); } ##daily ledger####### ##daily ledger####### $ledger_account_fetch = DB::table('ledger_accounts')->where('id',$ledger_id)->get(); foreach($ledger_account_fetch as $ss){ $ledger_product_id = $ss->id; $ledger_account = $ss->bank; } $method = $request->method; if($method==3){ foreach(DB::table('ledger_accounts')->where('visible','cash')->get() as $cash){ $ledger_account=$cash->id; } } $debitCredit="credit"; $ledger1 = array( 'branch_id'=>Session::get('user')['branch_id'], 'ledger_account_id'=>$ledger_product_id, 'amount'=>$request->amount, 'cr_dr'=>$debitCredit, 'time'=>date('H:i:s'), 'date'=>date('Y-m-d'), ); if($debitCredit=='credit'){ $debitCredit2='debit'; }else{ $debitCredit2='credit'; } DB::table('daily_ledger')->insert($ledger1); $ledger2 = array( 'branch_id'=>Session::get('user')['branch_id'], 'ledger_account_id'=>$ledger_account, 'amount'=>$request->amount, 'cr_dr'=>$debitCredit2, 'time'=>date('H:i:s'), 'date'=>date('Y-m-d'), ); DB::table('daily_ledger')->insert($ledger2); ##daily ledger####### return redirect('/expenses_other_income/add_expenses?sent'); } public function add_expenses(){ $methods = DB::table('expensetype')->where('branch_id',Session::get('user')['branch_id'])->get(); $loan = DB::table('loans')->where('branch_id',Session::get('user')['branch_id'])->get(); return view('/pages/add_expenses')->with('methods',$methods)->with('loan', $loan); } public function add_other_income(){ $methods = DB::table('incometypes')->where('branch_id',Session::get('user')['branch_id'])->get(); $loan = DB::table('loans')->where('branch_id',Session::get('user')['branch_id'])->get(); return view('/pages/add_other_income')->with('methods',$methods)->with('loan', $loan); } public function view_expenses(){ $methods1 = DB::table('expensetype')->where('branch_id',Session::get('user')['branch_id'])->get(); $expenses = DB::table('expenses')->where('branch_id',Session::get('user')['branch_id'])->get(); return view('/pages/view_expenses')->with('methods1',$methods1 )->with('expenses',$expenses); } public function delete_expense_transaction(Request $request){ $id=base64_decode($request->id); $batch_id=base64_decode($request->batch); DB::table('expenses')->where('id',$id)->where('branch_id',Session::get('user')['branch_id'])->delete(); //delete transaction from daily ledger and update general ledger... DB::table('daily_ledger')->where('ledger_source_id',$id)->where('batch_id',$batch_id)->where('branch_id',Session::get('user')['branch_id'])->delete(); #update ledger itakuja hapa... return redirect('expenses_other_income/view_expenses?del'); } public function delete_income_transaction(Request $request){ $id=base64_decode($request->id); $batch_id=base64_decode($request->batch); DB::table('incomes')->where('id',$id)->where('branch_id',Session::get('user')['branch_id'])->delete(); //delete transaction from daily ledger and update general ledger... DB::table('daily_ledger')->where('ledger_source_id',$id)->where('batch_id',$batch_id)->where('branch_id',Session::get('user')['branch_id'])->delete(); #update ledger itakuja hapa... return redirect('expenses_other_income/view_other_income?del'); } public function view_other_income(){ $methods = DB::table('incometypes')->where('branch_id',Session::get('user')['branch_id'])->get(); $incomes = DB::table('incomes')->where('branch_id',Session::get('user')['branch_id'])->get(); return view('/pages/view_other_income')->with('methods',$methods)->with('incomes',$incomes); } public function search_expenses(Request $request){ $from = date("Y-m-d", strtotime(str_replace('/', '-',$request->from))); $to = date("Y-m-d", strtotime(str_replace('/', '-',$request->to))); $methods1=array(); $expense_type = $request->expenses_id; //echo $expense_type;exit; if($expense_type=='All'){ $methods1 = DB::table('expenses') ->where('branch_id',Session::get('user')['branch_id']) ->where('expenseDate','>=',$from)->where('expenseDate','<=',$to) ->get(); }else{ $methods1 = DB::table('expenses') ->where('branch_id',Session::get('user')['branch_id']) ->where('expensetype_id',$expense_type) ->where('expenseDate','>=',$from)->where('expenseDate','<=',$to) ->get(); } ?> get_expensesfiles_by_id($row->id); $type = app('App\Http\Controllers\Load')->get_expensestype_id($row->expensetype_id); foreach($type as $rows){ ?>
Action Name Type Description amount Files
expenseDate; ?> name;?> description ?> amount ?> view files
from))); $to = date("Y-m-d", strtotime(str_replace('/', '-',$request->to))); $methods1=array(); $incometype_id = $request->incometype_id; //echo $incometype_id;exit; if($incometype_id=='All'){ $methods1 = DB::table('incomes') ->where('branch_id',Session::get('user')['branch_id']) ->where('transactionDate','>=',$from)->where('transactionDate','<=',$to) ->get(); }else{ $methods1 = DB::table('incomes') ->where('branch_id',Session::get('user')['branch_id']) ->where('incometype_id',$incometype_id) ->where('transactionDate','>=',$from)->where('transactionDate','<=',$to) ->get(); } ?> get_incomesfiles_by_id($row->id); $type = app('App\Http\Controllers\Load')->get_incometypes_id($row->incometype_id); foreach($type as $rows){ ?>
Action Name Type Description amount Files
transactionDate ; ?> name;?> description ?> amount ?> view files
Session::get('user')['branch_id'], 'name'=>$request->incometypes, 'registered_by'=>Auth::id(), 'date'=>date('Y-m-d'), ); DB::table('incometypes')->insert($data); return redirect('/settings/income_types'); } public function loan_products(){ $fees = DB::table('fee')->where('branch_id',Session::get('user')['branch_id'])->get(); $interest = DB::table('loaninterestmethods')->where('branch_id',Session::get('user')['branch_id'])->get(); $methods = DB::table('transactiontype')->where('branch_id',Session::get('user')['branch_id'])->get(); $loanproducts = DB::table('loanproducts')->where('branch_id',Session::get('user')['branch_id'])->get(); return view('/pages/loan_products')->with('methods',$methods)->with('interests',$interest)->with('fees',$fees)->with('loanproducts',$loanproducts); } ######################################################################SAMPLE CODES#################################################################################### public function add_savings_accounts(){ //get account Number function generateRandomNumber($length = 9) { $number = '1234567890'; $numberLength = strlen($number); $randomNumber = ''; for ($i = 0; $i < $length; $i++) { $randomNumber .= $number[rand(0, $numberLength - 1)]; } $randomNumber='5001'.$randomNumber; $count = DB::table('savingaccount')->where('savingAccount', $randomNumber)->get()->count(); if($count>0){ generateRandomNumber(); }else{ return $randomNumber; } } $accountNumber = generateRandomNumber(); $methods = DB::table('borrowers')->where('branch_id',Session::get('user')['branch_id'])->get(); $groups = DB::table('borrowergroups')->where('branch_id',Session::get('user')['branch_id'])->get(); $products = DB::table('savingproduct')->where('branch_id',Session::get('user')['branch_id'])->get(); return view('/pages/add_savings_accounts')->with('methods',$methods)->with('products',$products)->with('accountNumber',$accountNumber)->with('groups',$groups); } public function insert_savings_accounts(Request $request) { $borrower=explode('/',$request->borrower_id); $borrower_id=(int)$borrower[0]; $borrowerType=$borrower[1]; $data = array( 'branch_id'=>Session::get('user')['branch_id'], 'borrower_id'=>$borrower_id, 'borrowerType'=>$borrowerType, 'savingProduct_id'=>$request->savingProduct_id, 'savingAccount'=>$request->savingAccount, 'description'=>$request->description, 'registered_by'=>Auth::id(), 'date'=>date('Y-m-d'), ); DB::table('savingaccount')->insert($data); return redirect('/savings/add_savings_accounts'); } public function view_savings_acounts(){ $methods = DB::table('savingaccount')->where('branch_id',Session::get('user')['branch_id'])->get(); return view('/pages/view_savings_acounts')->with('methods',$methods); } public function view_savings_transactions(){ $methods = DB::table('savingtransactions')->where('branch_id',Session::get('user')['branch_id'])->get(); return view('/pages/view_savings_transactions')->with('methods',$methods); } public function add_savings_transactions(){ $methods = DB::table('borrowers')->where('branch_id',Session::get('user')['branch_id'])->get(); $groups = DB::table('borrowergroups')->where('branch_id',Session::get('user')['branch_id'])->get(); $m = DB::table('savingaccount')->where('branch_id',Session::get('user')['branch_id'])->get(); return view('/pages/add_savings_transactions')->with('methods',$methods)->with('groups',$groups)->with('m',$m); } public function insert_savings_transactions(Request $request) { $datetime=$request->date.' '.$request->time; $deb=explode('/',$request->type); $type=$deb[0]; $debitCredit=$deb[1]; $data = array( 'branch_id'=>Session::get('user')['branch_id'], 'borrower_id'=>$request->borrower_id, 'account_id'=>$request->account_id, 'amount'=>$request->amount, 'debitCredit'=>$debitCredit, 'type'=>$type, 'datetime'=>$datetime, 'description'=>$request->description, 'registered_by'=>Auth::id(), 'date'=>date('Y-m-d'), ); DB::table('savingtransactions')->insert($data); return redirect('/savings_transactions/add_savings_transactions'); } }