예제 #1
0
 public function fire()
 {
     $options = $this->option();
     $users = User::all();
     $this->repository = new AwardsRepository();
     $this->repository->setListener($this);
     $this->comment("// -------------------------------------");
     $this->comment("           Individual Awards            ");
     $this->comment("// -------------------------------------");
     // user based awards
     foreach ($users as $user) {
         $this->info("Checking awards for: " . $user->getName());
         $this->info($this->repository->checkAwardForUser($user));
     }
     $this->comment("// -------------------------------------");
     $this->comment("             Site Wide Awards           ");
     $this->comment("// -------------------------------------");
     // site wide awards - time based
     if (is_true($options['full'])) {
         $start = Task::orderBy('created_at')->first()->created_at;
         $end = Carbon::now();
         $date = clone $start;
         for ($i = $start->weekOfYear; $i <= $end->weekOfYear; $i++) {
             $this->info("Checking for week of " . $date->toDateString());
             $this->info($this->repository->checkForAwards($date));
             $date->addWeek();
         }
     } else {
         $this->info($this->repository->checkForAwards());
     }
 }
 function showTasks()
 {
     if (Auth::check()) {
         return View::make('tasks', ['tasks' => Task::orderBy('created_at', 'asc')->get()]);
     } else {
         // validation not successful, send back to form
         return Redirect::to('login');
     }
 }
예제 #3
0
 public function order()
 {
     $orders = Task::orderBy('created_at', 'desc')->get();
     $unpaid_orders_num = count(Task::where('state', 4)->get());
     return View::make('admin.taskOrder')->with('orders', $orders)->with('unpaid_orders_num', $unpaid_orders_num);
 }
 public function getGroupPostByID()
 {
     $input = Input::all();
     $groupid = $input['groupid'];
     $postid = $input['postid'];
     $authuser = Auth::user();
     if (Input::has('limitfrom')) {
         $skip = Input::get('limitfrom');
     } else {
         $skip = 0;
     }
     $group = Group::find($groupid);
     if (is_null($group)) {
         return Response::json(array('success' => false, 'errors' => 'Group not found'), 400);
         // 400 being the HTTP code for an invalid request.
     }
     //Now fetch all the posts belong to that group
     $posts = Post::orderBy('id', 'DESC')->where('id', $postid)->take(1)->skip($skip)->get();
     foreach ($posts as $post) {
         $task = Task::orderBy('id', 'DESC')->where('id', $post->task_id)->take(1)->get();
         $post->task_title = $task[0]->name;
         $post->task_content = $task[0]->description;
         $post->display_mission = $post->display_mission;
         $post->status = $post->status;
         $post->status_text = $post->filterStatus();
         $post->image = ($post->statustype = 'image') ? $post->displayMediaApi() : '';
         $post->screenhandle = User::find($post->user_id)->screenhandle;
         $post->firstname = User::find($post->user_id)->firstname;
         $post->lastname = User::find($post->user_id)->lastname;
         $post->comments = $post->getAPIComments();
         $user = User::find($post->user_id);
         $post->userImage = $user->APIGetPictureSrc();
         $post->likeCount = count(Like::orderBy('id', 'DESC')->where('post_id', $post->id)->get());
         if ($authuser->hasLike($post->id)) {
             $post->like = true;
         } else {
             $post->like = false;
         }
     }
     return $posts->toJson();
 }
 public function index()
 {
     $tasks = Task::orderBy('created_at', 'asc')->get();
     return view('tasks', ['tasks' => $tasks]);
 }
 public function edittask_forothers($id)
 {
     $pagetitle = 'Edit Task for Others';
     $get_task = Task::orderBy('task', 'asc')->lists('task', 'id');
     $get_taskforothers = DB::table('mytask_forothers')->where('id', $id)->first();
     $getattached = DB::table('attached_forothers')->where('forothers_id', $id)->get();
     $my_task = Task::where('id', $get_taskforothers->task_id)->first();
     return View::make('task.edit_taskforothers', compact('pagetitle', 'get_task', 'get_taskforothers', 'my_task', 'getattached'));
 }
예제 #7
0
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
//Route::get('/', function () {
//    return view('welcome');
//});
/**
 *  * 全タスク表示
 *   */
Route::get('/', function () {
    $tasks = Task::orderBy('created_at', 'asc')->get();
    return view('tasks', ['tasks' => $tasks]);
});
/**
 * 新タスク追加
 */
Route::post('/task', function (Request $request) {
    //
});
/**
 * 既存タスク削除
 */
Route::delete('/task/{id}', function ($id) {
    //
});
Route::post('/task', function (Request $request) {