/**
  * User chose single employee from dropdown to be edited
  *
  * @return mixed
  */
 public function doChooseEmployee()
 {
     $employee = Employee::find(Input::get('choose'));
     $dept = ['' => 'Choose...'] + Department::lists('name', 'id');
     $location = ['' => 'Choose...'] + Location::lists('name', 'id');
     return View::make('admin.edit-employee', compact('dept', 'location', 'employee'));
 }
Exemplo n.º 2
0
 /**
  * Display a listing of the resource.
  * GET /sppb
  *
  * @return Response
  */
 public function index()
 {
     $query = DB::table('SPPB')->select('no_SPPB')->orderBy('no_SPPB', 'desc')->first();
     $inisial = 'SPB';
     if (!isset($query)) {
         $kd = $inisial . '001';
     } else {
         $kode = substr($query->no_SPPB, 3);
         $kode = $kode + 1;
         if ($kode > 0) {
             $kd = $inisial . '00' . $kode;
             if ($kode > 9) {
                 $kd = $inisial . '0' . $kode;
                 if ($kode > 99) {
                     $kd = $inisial . $kode;
                 }
             }
         }
     }
     $data = array('department' => Department::lists('nm_dept', 'id_dept'), 'noSPPB' => $kd);
     return View::make('transaksi.SPPB', $data);
 }
Exemplo n.º 3
0
require 'model/professor.php';
$professor = new Project();
$app->get('/professors', function () {
    global $professor, $conn, $app;
    $query = $app->request()->params('query');
    echo json_encode($professor->show($conn, $query));
    // echo $condition;
});
/**
 * Department
 */
require 'model/department.php';
$department = new Department();
$app->get('/departments/list', function () {
    global $department, $conn;
    echo json_encode($department->lists($conn));
});
/**
 * Sponsor
 */
require 'model/sponsor.php';
$sponsor = new Sponsor();
$app->get('/sponsors', function () {
    global $sponsor, $conn, $app;
    $query = $app->request()->params('query');
    echo json_encode($sponsor->show($conn, $query));
});
$app->get('/sponsors/list', function () {
    global $sponsor, $conn;
    echo json_encode($sponsor->lists($conn));
});