public function save_koperasi()
 {
     $v = Validator::make(Input::all(), ['nama' => 'required', 'alamat' => 'required']);
     if ($v->fails()) {
         return redirect()->back()->withErrors($v->errors());
     }
     $new = \App\Koperasi::find(Auth::user()->assigned_koperasi);
     $new->nama = Input::get('nama');
     $new->email = Input::get('email');
     $new->no_telp = Input::get('no_telp');
     $new->no_fax = Input::get('no_fax');
     $new->alamat = Input::get('alamat');
     $new->rtrw = Input::get('rtrw');
     $new->kel = Input::get('kel');
     $new->kec = Input::get('kec');
     $new->kabkota = Input::get('kabkota');
     $new->prov = Input::get('prov');
     $new->kodepos = Input::get('kodepos');
     $new->negara = Input::get('negara');
     if (Input::hasFile('logo')) {
         $logo = date("YmdHis") . uniqid() . "." . Input::file('logo')->getClientOriginalExtension();
         Input::file('logo')->move(storage_path("images"), $logo);
         $new->logo = $logo;
     }
     $new->save();
     return redirect(url('pengaturan/koperasi'));
 }
Esempio n. 2
0
 public function get_angsuran_data($id_transaksi)
 {
     $data = \App\Transaksi::where('id_koperasi', Auth::user()->assigned_koperasi)->find($id_transaksi);
     $days = (strtotime(date_format($data->created_at, "Y-m-d")) - strtotime(date("Y-m-d"))) / (60 * 60 * 24);
     $data_induk = \App\Transaksi::where('id_koperasi', Auth::user()->assigned_koperasi)->find($data->id_induk)['jumlah_asli'];
     $json = array('bunga' => $data->jumlah_bunga, 'admin' => $data->biaya_admin, 'asuransi' => $data->biaya_asuransi, 'materai' => $data->biaya_materai, 'jumlah_asli' => $data->jumlah_asli, 'total_tabungan' => $data->total_tabungan, 'jumlah_total' => $data->jumlah_total, 'jatuh_tempo' => date_format($data->created_at, "d M Y"), 'terlambat' => $days, 'denda' => number_format(($days < -2 ? $days * -1 : 0) * (\App\Koperasi::find(Auth::user()->assigned_koperasi)['denda'] * $data_induk), 2, ".", ""), 'total_pembayaran' => number_format($data->jumlah_asli + $data->total_tabungan + ($days < -2 ? $days * -1 : 0) * (\App\Koperasi::find(Auth::user()->assigned_koperasi)['denda'] * $data_induk), 2, ".", ""));
     echo json_encode($json);
 }
Esempio n. 3
0
 public static function deleteKoperasi($id)
 {
     $laporans = Laporan::where('id_koperasi', $id)->get();
     foreach ($laporans as $laporan) {
         $laporan->delete();
     }
     $koperasi = Koperasi::find($id);
     $koperasi->delete();
 }
 public function insertNilai(EditLaporanRequest $request, $id)
 {
     $r = $request->all();
     Laporan::editLaporan($r['permodalan'], $r['kualitas_aktiva_produktif'], $r['manajemen'], $r['efisiensi'], $r['likuiditas'], $r['kemandirian_dan_pertumbuhan'], $r['jatidiri_koperasi'], $id);
     $searchlap = Laporan::find($id);
     $searchlap->terverifikasi = 1;
     $searchlap->save();
     $search = Koperasi::find($searchlap->id_koperasi);
     $search->penilaian = $r['permodalan'] + $r['kualitas_aktiva_produktif'] + $r['manajemen'] + $r['efisiensi'] + $r['likuiditas'] + $r['kemandirian_dan_pertumbuhan'] + $r['jatidiri_koperasi'];
     $search->save();
     // $laporan = Laporan::find($id);
     //       $laporan->permodalan = $r['permodalan'];
     //       $laporan->kualitas_aktiva_produktif = $kualitas_aktiva_produktif;
     //       $laporan->manajemen = $manajemen;
     //       $laporan->efisiensi = $efisiensi;
     //       $laporan->likuiditas = $likuiditas;
     //       $laporan->kemandirian_dan_pertumbuhan = $kemandirian_dan_pertumbuhan;
     //       $laporan->jatidiri_koperasi = $jatidiri_koperasi;
     //       $laporan->save();
     return redirect()->back()->with('message', 'Nilai laporan berhasil ditambahkan');
 }
 public function simpancatatan()
 {
     $v = Validator::make(Input::all(), ['catatan' => 'required|min:1']);
     if ($v->fails()) {
         return redirect()->back()->withErrors($v->errors());
     }
     $catatan = \App\Koperasi::find(Auth::user()->assigned_koperasi);
     $catatan->catatan = Input::get('catatan');
     $catatan->save();
     return redirect(url('preferensi/catatan'))->withPesan('tersimpan');
 }
Esempio n. 6
0
 public function livebuktimanual($id_induk, $id_transaksi, $id_anggota, $arrIDKeu)
 {
     $data['keuangan'] = \App\Keuangan::where('id_koperasi', Auth::user()->assigned_koperasi)->whereIn('id', explode(",", $arrIDKeu))->get();
     $data['koperasi'] = \App\Koperasi::find(Auth::user()->assigned_koperasi);
     $jumlah = 0;
     foreach ($data['keuangan'] as $key) {
         $jumlah += $key->masuk;
     }
     $data['total'] = $jumlah;
     $data['transaksi'] = \App\Transaksi::where('id_koperasi', Auth::user()->assigned_koperasi)->where('id', $id_transaksi)->first();
     $data['anggota'] = \App\Anggota::where('id_koperasi', Auth::user()->assigned_koperasi)->find($data['transaksi']->id_anggota);
     $data['induk'] = \App\Transaksi::where('id_koperasi', Auth::user()->assigned_koperasi)->where('id', $id_induk)->first();
     // $pdf = \App::make('dompdf.wrapper');
     //$pdf->loadView('transaksi.printpembayaran',$data);
     $pdf = PDF::loadView('transaksi.printpembayaran', $data);
     $pdf->setPaper(array(0, 0, 612, 379));
     return $pdf->stream('download.pdf');
     //return view('transaksi.printpembayaran')->with($data);
 }