public function edit($KdJnsKategori)
 {
     $jnskategori = Jnskategori::find($KdJnsKategori);
     $kategori = Kategori::all();
     $subkategori = SubKategori::all();
     $satuan = Satuan::all();
     return View::make('jns_kategori.edit_jnskategoris')->with('jnskategori', $jnskategori)->with('kategori', $kategori)->with('satuan', $satuan)->with('subkategori', $subkategori);
 }
Beispiel #2
0
 public function kategori($id)
 {
     $kategori = Kategori::all();
     $koordinat = DB::Table('lokasi')->where('lokasi.id_kategori', '=', $id)->join('kategori', 'kategori.id_kategori', '=', 'lokasi.id_kategori')->get();
     $config['center'] = "-6.885177, 109.135567";
     $config['zoom'] = "13";
     $config['map_type'] = "ROADMAP";
     $config['trafficOverlay'] = true;
     Gmaps::initialize($config);
     foreach ($koordinat as $row) {
         $marker = array();
         $marker['icon'] = URL::to('uploads/icon/' . $row->icon);
         $marker['infowindow_content'] = $row->nm_lokasi . "<hr><strong>Alamat : " . $row->alamat . "<br><strong>Kode Pos : </strong>" . $row->kode_pos . "<br><strong>Telp : </strong>" . $row->telp;
         $marker['position'] = $row->lat . ',' . $row->lng;
         $marker['animation'] = 'DROP';
         Gmaps::add_marker($marker);
     }
     $map = Gmaps::create_map();
     return View::make('web.index')->with('map', $map)->with('kategori', $kategori);
 }
Beispiel #3
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $berita = Berita::find($id);
     $kategori = Kategori::all();
     return View::make('berita.edit')->with('berita', $berita)->with('kategori', $kategori);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $kategori = Kategori::all();
     return View::make('kategori.index')->with('kategori', $kategori);
 }
 public function editKatalog()
 {
     $kat = Kategori::all();
     $author = Author::all();
     $act = 'edit';
     $kategori = array();
     foreach ($kat as $key => $value) {
         $kategori[$value->id] = $value->categoryname;
     }
     $year = array();
     for ($i = (int) date('Y') - 30; $i <= (int) date('Y'); $i++) {
         $year[$i] = $i;
     }
     $publ = Publisher::all();
     $publisher = array();
     foreach ($publ as $key => $value) {
         $publisher[$value->id] = $value->publishername;
     }
     if (Input::has('submit')) {
         if (Input::has('youtube')) {
             $validator = array('title' => 'required', 'category' => 'required', 'summary' => 'required', 'release' => 'required', 'numpage' => 'required');
         } else {
             $validator = array('title' => 'required', 'category' => 'required', 'summary' => 'required', 'release' => 'required', 'numpage' => 'required', 'file' => 'mimes:pdf,mp4|max:20000', 'cover' => 'mimes:jpg,jpeg,png|max:5000');
         }
         $validator = Validator::make(Input::all(), $validator);
         if ($validator->passes()) {
             //file
             if (Input::hasFile('file')) {
                 $doc = Input::file('file');
                 $filename = $doc->getClientOriginalName();
                 $nama = rand() . '_' . $filename;
                 $size = Input::file('file')->getSize();
                 $type = Input::file('file')->getMimeType();
                 //$size = $_FILES['file']['size'];
                 //$type = $_FILES['file']['type'];
                 $destinationPath = public_path('file/');
                 $uploadSuccess = Input::file('file')->move($destinationPath, $nama);
                 /*$file = $_FILES['file'];
                 		$nama = rand().'_'.$file['name'];
                 		move_uploaded_file($file['tmp_name'], 'file/'.$nama);*/
             } else {
                 $nama = Input::get('youtube');
                 $size = '';
                 $type = '';
             }
             //kover
             if (Input::hasFile('cover')) {
                 $doc = Input::file('cover');
                 $filename = $doc->getClientOriginalName();
                 $img = rand() . '_' . $filename;
                 $destinationPath = public_path('image/cover/');
                 $uploadSuccess = Input::file('cover')->move($destinationPath, $img);
             } else {
                 $img = '';
             }
             $katalog = new Katalog();
             $katalog->title = Input::get('title');
             $katalog->category = Input::get('category');
             $katalog->summary = Input::get('summary');
             $katalog->filesize = $size;
             $katalog->filetype = $type;
             $katalog->release = Input::get('release');
             $katalog->numpage = Input::get('numpage');
             $katalog->ISBN = Input::get('isbn');
             $katalog->file = $nama;
             $katalog->publisher = Input::get('publisher');
             $katalog->img = $img;
             $katalog->like = 0;
             $katalog->save();
             foreach (Input::get('author') as $key => $value) {
                 $authkatalog = new AuthorKatalog();
                 $authkatalog->idKatalog = $katalog->id;
                 $authkatalog->author = $value;
                 $authkatalog->save();
             }
             return Redirect::to('admin/rkmkatalog')->with('sukses', 'rekam katalog sukses');
         } else {
             return Redirect::to('admin/rkmkatalog')->withInput()->withErrors($validator);
         }
     } else {
         return View::make('admin.katalog', compact('kategori', 'publisher', 'year', 'author', 'act'));
     }
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $lokasi = Lokasi::find($id);
     $kategori = Kategori::all();
     return View::make('lokasi.edit')->with('lokasi', $lokasi)->with('kategori', $kategori);
 }