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');
}
public function insert_add_asset(Request $request)
{
$ex=explode('|',$request->name);
$ledger_id=$ex[0];
$name=$ex[1];
$nature=$ex[2];
$batch_id = 'AS-'.rand().'-'.time();
$data =array(
'branch_id'=>Session::get('user')['branch_id'],
'name'=>$name,
'currentValue'=>$request->currentValue,
'valueDate'=>$request->valueDate,
'descriptions'=>$request->descriptions,
'batch'=>$batch_id,
'registered_by'=>Auth::id(),
'date'=>date('Y-m-d'),
);
DB::table('assets')->insert($data);
$asset_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_product_id,
'amount'=>$request->currentValue,
'cr_dr'=>$debitCredit,
'batch_id'=>$batch_id,
'ledger_source_id'=>$asset_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->currentValue,
'cr_dr'=>$debitCredit2,
'batch_id'=>$batch_id,
'ledger_source_id'=>$asset_idID,
'time'=>date('H:i:s'),
'date'=>date('Y-m-d'),
);
DB::table('daily_ledger')->insert($ledger2);
##daily ledger#######
return redirect('/asset_management/add_asset?sent');
}
public function delete_asset_transaction(Request $request){
$id=base64_decode($request->id);
$batch_id=base64_decode($request->batch);
DB::table('assets')->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('asset_management/view_assets?del');
}
public function add_asset(){
//$methods = DB::table('assettype')->where('branch_id',Session::get('user')['branch_id'])->get();
return view('/pages/add_asset');
}
public function view_assets(){
$methods = DB::table('assets')->where('branch_id',Session::get('user')['branch_id'])->get();
// $m = DB::table('assettype')->where('branch_id',Session::get('user')['branch_id'])->get();
return view('/pages/view_asset')->with('methods',$methods);
}
public function search_assets(Request $request){
$assettype=$request->assettype;
$from=$request->from;
$to=$request->to;
$methods = DB::table('assets')->where('branch_id',Session::get('user')['branch_id'])->get();
$m = DB::table('assettype')->where('id',$assettype)->where('branch_id',Session::get('user')['branch_id'])->get();
if($from!='' && $to!='' && $assettype=='all'){
$methods = DB::table('assets')->where('purchaseDate','>=',$request->from)->where('purchaseDate','<=',$request->to)->where('branch_id',Session::get('user')['branch_id'])->get();
}elseif($from!='' && $to!='' && $assettype!='all'){
foreach($m as $a){
$methods = DB::table('assets')->where('purchaseDate','>=',$request->from)->where('purchaseDate','<=',$request->to)->where('assettype_id',$a->id)->where('branch_id',Session::get('user')['branch_id'])->get();
}
}else{
$methods = DB::table('assets')->where('assettype_id',$a->id)->where('branch_id',Session::get('user')['branch_id'])->get();
}
?>
| Name/type |
Descriptions |
Current Value |
Purchase Date |
Serial Number |
Files |
Action |
assettype_id);
$files= app('App\Http\Controllers\Load')::get_assetfiles_id($method->id);
foreach($asset as $a){
$type= $a->name;
}
?>
|
descriptions;?> |
currentValue;?> |
purchaseDate;?> |
serialNumber;?> |
file;
?>
Doc
|
|