public function index($param = 'home')
 {
     $dataInstansi = DataInstansi::find(1);
     $kabKotaId = $dataInstansi->kabkota_id;
     $tower = Tower::whereKabkotaId($kabKotaId)->whereRaw(" gambar != '' ")->get();
     $data['tower'] = $tower;
     return View::make($param, $data);
 }
 public function laporan()
 {
     $data['datawartel'] = $this->wartel->tampilData();
     $dataInstansi = DataInstansi::find(1);
     $kabKotaId = $dataInstansi->kabkota_id;
     $tower = Tower::whereKabkotaId($kabKotaId)->get();
     $data['dataInstansi'] = DataInstansi::find(1);
     return View::make('admin.laporan.wartel', $data);
 }
 /**
  * @Route("/gettower/{companyid}", methods={"POST"}, name="gettower")
  */
 public function gettowerAction($companyid)
 {
     $tower = Tower::findBycompanyid($companyid)->toArray();
     echo '<select id="towerid" name ="towerid">';
     echo '<option value ="0" >Select a Tower</option>';
     foreach ($tower as $toweritem) {
         echo '<option value ="' . $toweritem["id"] . '" >' . $toweritem["number"] . '</option>';
     }
     echo '</select>';
 }
$t = Tower::whereKabkotaId($kabKotaId)->whereZona($v)->whereDibangunTahun($lastYear)->get()->count();
?>
"{{$t}}", @endforeach],
				@endif
			},
			{
				label : '{{$thisYear}}',
				fillColor : "rgba(151,187,205,0.5)",
				strokeColor : "rgba(151,187,205,0.8)",
				highlightFill : "rgba(151,187,205,0.75)",
				highlightStroke : "rgba(151,187,205,1)",
				@if($title=='Menara')
				data : [@foreach($perusahaan as $p) "{{$p->tower()->whereDibangunTahun($thisYear)->count()}}", @endforeach],
				@elseif($title=='Zona')
				data : [@foreach($zona as $k=>$v) <?php 
$t = Tower::whereKabkotaId($kabKotaId)->whereZona($v)->whereDibangunTahun($thisYear)->get()->count();
?>
"{{$t}}", @endforeach],
				@endif
			}

		]

	}
	window.onload = function(){
		var ctx = document.getElementById("canvas").getContext("2d");
		window.myBar = new Chart(ctx).Bar(barChartData, {
			responsive : true,
			multiTooltipTemplate: "<%= datasetLabel %> - <%= value %>",
			maintainAspectRatio: false
		});
 /**
  * Deletes a tower
  *
  * @param string $id
  */
 public function deleteAction($id)
 {
     $tower = Tower::findFirstByid($id);
     if (!$tower) {
         $this->flash->error("tower was not found");
         return $this->dispatcher->forward(array("controller" => "tower", "action" => "index"));
     }
     if (!$tower->delete()) {
         foreach ($tower->getMessages() as $message) {
             $this->flash->error($message);
         }
         return $this->dispatcher->forward(array("controller" => "tower", "action" => "search"));
     }
     $this->flash->success("tower was deleted successfully");
     return $this->dispatcher->forward(array("controller" => "tower", "action" => "index"));
 }
 public function laporan()
 {
     #old
     //$tower = tower::with('pembayaran')->get();
     # Kirim variabel ke View
     $dataInstansi = DataInstansi::find(1);
     $kabKotaId = $dataInstansi->kabkota_id;
     $tower = Tower::whereKabkotaId($kabKotaId)->get();
     $dataInstansi = DataInstansi::find(1);
     return View::make('admin.laporan.tower', compact('tower', 'dataInstansi'));
 }