예제 #1
0
 public function run()
 {
     App\Usaha::truncate();
     $data = array(array('nama' => 'KJA', 'jenis' => 'Budidaya Air Laut'), array('nama' => 'Kolam Tanah', 'jenis' => 'Budidaya Air Tawar'), array('nama' => 'Kolam Terpal', 'jenis' => 'Budidaya Air Tawar'), array('nama' => 'Tambak', 'jenis' => 'Budidaya Air Payau'));
     DB::table('app_usaha')->insert($data);
 }
											<th width="70">
												<button class="btn btn-check" data-toggle="modal" data-target="#modal-hapus" disabled id="hapus"><i class="pg-trash"></i></button>
											</th>
											<th>Jenis Usaha</th>
											<th>Aksi</th>
										</tr>
									</thead>
									<tbody>
										@foreach($usaha as $us)
										<tr>
											<td>
											<?php 
$data_master = App\User::where('id_usaha', $us->id)->count();
?>
											<?php 
$data_master2 = App\Usaha::where('jenis_usaha', $us->id)->count();
?>

													<?php 
$title = "";
$disabled = "";
if ($data_master + $data_master2 >= 1) {
    $title = "Usaha sedang terpakai";
    $disabled = "disabled";
}
?>
												<div class="checkbox" title="<?php 
echo $title;
?>
">
													<input type="checkbox" class="pilih" value="{{ $us->id }}" id="checkbox{{ $us->id }}" <?php