daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Mar 19th, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Route::GET('edit','TasksController@edit');
  2. Route::resource('tasks', 'TasksController');
  3.  
  4.  
  5.  
  6. function editevent_details(id) {
  7.       // body...
  8.       $.ajax({
  9.         url:'edit',
  10.         type:'GET',
  11.         data:{id: id },
  12.         success:function(result)
  13.         {
  14.           $.each(result, function() {
  15.                 $.each(this, function(k, item) {
  16.                    alert(item.name);
  17.           $('#eventcode').val(item.name);
  18.           $('#eventname').val(item.description);
  19.           $('#current_date').val(item.task_date);
  20.           });
  21.               });
  22.  
  23.         }
  24.   });
  25. }
  26.  
  27. public function edit(Request $request)
  28. {
  29.     try
  30.     {
  31.  
  32.         $id=$request->input('id');
  33.         $details=DB::table('tasks')
  34.     //->join('staffcreations','tasks.dept_id','=','staffcreations.dept_id')
  35.     ->select('id','name','description','task_date')
  36.     ->where('id','=',$id)
  37.     ->get();
  38.     return response()->json(['response' => $details]);
  39.     }
  40.     catch(Exception $ex)
  41.     {
  42.  
  43.     }
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top