Example #1
0
 public function boot()
 {
     date_default_timezone_set('Asia/Jakarta');
     /*
     		$abouts  = array();
     		$news = array();
     		$memo = array();*/
     $dcabang = array();
     $ddivisi = array();
     $dsales = array();
     // $dkota = array();
     $dsatuan = array();
     Config::set('registered', false);
     /*$articles = Article::select('article.*','users.first_name','users.last_name')
     		->leftJoin('user','article.user','=','users.id')->get();
     		
     		foreach ($articles as $article) {
     			switch($article->type){
     				case 'about' : 
     					$abouts[] = $article;break;
     				case 'news' :
     					$news[] = $article;break;
     				case 'memo' :
     					$memo[] = $article;break;
     			}
     			
     		}
     		$kota = Kota::all();
     		foreach ($kota as $v) {
     			$dkota[$v->idkota] = $v->nmkota;
     		}
     
     		*/
     $cabang = cabang::all();
     foreach ($cabang as $v) {
         $dcabang[$v->idcabang] = $v->nama;
     }
     $dcabang = Helpers::assoc_merge([0 => '--Daftar Cabang--'], $dcabang);
     $divisi = divisi::all();
     foreach ($divisi as $v) {
         $ddivisi[$v->nama] = $v->nama;
     }
     $ddivisi = Helpers::assoc_merge([0 => '--Semua Divisi--'], $ddivisi);
     $sales = sales::all();
     foreach ($sales as $v) {
         $dsales[$v->nama] = $v->nama;
     }
     $dsales = Helpers::assoc_merge([0 => '--Semua Sales--'], $dsales);
     $satuan = satuan::all();
     foreach ($satuan as $v) {
         $dsatuan[$v->namasatuan] = $v->namasatuan;
     }
     $data = array('satuan' => $dsatuan, 'cabang' => $dcabang, 'divisi' => $ddivisi, 'sales' => $dsales, 'menu' => Config::get('menu'), 'notification' => ['all' => 0, 'quote' => NULL, 'sjt' => NULL]);
     return View::share($data);
 }
Example #2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $sales = sales::paginate(Config::get('pages'));
     return view('admin.master.sales.sales')->with('sales', $sales);
 }