Exemplo n.º 1
0
 public function show($id)
 {
     $transaksi = Transaksi::getTransaksi($id);
     $tujuan = json_decode(Ongkir::getCityById($transaksi['tujuan']));
     $tujuan = $tujuan->rajaongkir->results;
     $tujuan = $tujuan->type . " " . $tujuan->city_name . " Provinsi " . $tujuan->province;
     $data = array('barang' => $transaksi, 'tujuan' => $tujuan);
     return view('admin.show_transaksi', compact('data'));
 }
Exemplo n.º 2
0
 protected function getCombo()
 {
     $hasil = array();
     $prop = json_decode(Ongkir::getProvinsi());
     foreach ($prop->rajaongkir->results as $propinsi) {
         //echo $propinsi->province_id." dan ".$propinsi->province."<br/>";
         $kota = json_decode(Ongkir::getCity($propinsi->province_id));
         $hasil["0"] = "Pilih Tujuan Pengiriman";
         foreach ($kota->rajaongkir->results as $city) {
             $hasil[$city->city_id] = $city->city_name . " , " . $propinsi->province;
         }
     }
     return $hasil;
 }