예제 #1
0
 public function bahagian($id)
 {
     if (Request::ajax()) {
         $bahagian = Bahagian::find($id);
         $bahagian->delete();
         return $bahagian->nama;
     }
 }
예제 #2
0
                </select>
            </div>
        </div>
        <br />
        <div class="control-group">
            <label class="control-label" for="selectError">Bahagian (<?php 
echo $staff->bahagian;
?>
)</label>
            <div class="controls">
                <select data-rel="chosen" name="bahagian" id="bahagian">
                    <option></option>
                    <?php 
$selected = '';
if (is_int($staff->bahagian)) {
    $selected = Bahagian::find($staff->bahagian)->get();
}
$bahagian = Bahagian::orderBy('id', 'ASC')->get();
foreach ($bahagian as $tempat) {
    if ($staff->bahagian == $tempat->id) {
        $selected = 'selected';
    }
    echo "<option value='" . $tempat->id . "' " . $selected . ">" . $tempat->nama . "</option>";
    $selected = '';
}
?>
                </select>
            </div>
        </div>
        <br />
        <div class="control-group">