コード例 #1
0
 public function postChangestatusshedule()
 {
     $data = Input::only('status', 'schedule_id', 'updatedby');
     $scObj = new Schedule();
     $update = $scObj->changeStatus($data['schedule_id'], $data['status'], $data['updatedby']);
     if ($update) {
         return Response::json(array('status' => '1', $data));
     } else {
         return Response::json(array('status' => '0', $data));
     }
 }
コード例 #2
0
ファイル: routes.php プロジェクト: arizawan/chaity.com
Route::group(array('before' => 'admin.login', 'prefix' => 'admin/schedules'), function () {
    # Admin Schedules
    Route::get('/', function () {
        $schedules = Schedule::get();
        return View::make('backend.schedules')->with('schedules', $schedules);
    });
    # Admin Add Schedules;
    Route::get('/add', function () {
        $user = Sentry::getUser();
        return View::make('backend.addschedules')->with('user', $user);
    });
    # Admin Status Change Schedules;
    Route::get('/status/{status}/{id}', function ($status, $id) {
        $user = Sentry::getUser();
        $scObj = new Schedule();
        $update = $scObj->changeStatus($id, $status, $user->id);
        $schedules = Schedule::get();
        return View::make('backend.schedules')->with('schedules', $schedules);
    });
    # Admin Delete Schedules;
    Route::get('/delete/{id}', function ($id) {
        $scObj = Schedule::find($id);
        //dd($scObj);
        $delobj = $scObj->delete();
        if ($delobj) {
            echo 1;
        } else {
            echo 0;
        }
    });
    Route::post('/add', array('uses' => 'RainTvController@postNewshedule'));