public function home()
 {
     $page_title = "لوحة التحكم";
     $section_title = "لوحة التحكم";
     Date::setLocale('ar');
     $date = Date::now()->format('j F Y');
     $day = Date::now()->format('l');
     $month = Date::now()->format('F');
     $year = Date::now()->format('Y');
     //**************Tasks***************
     $tasksToday = Task::orderBy('task_date', 'desc')->today()->take(5);
     $tasksWeek = Task::orderBy('task_date', 'desc')->thisweek()->take(5);
     $tasksMonth = Task::orderBy('task_date', 'desc')->thisMonth()->take(5);
     $tasks_count = count($tasksToday->toArray());
     //**************Fails***************
     $failsToday = Failure::orderBy('fail_time', 'desc')->today()->take(5);
     $failsWeek = Failure::orderBy('fail_time', 'desc')->thisweek()->take(5);
     $failsMonth = Failure::orderBy('fail_time', 'desc')->thisMonth()->take(5);
     $fails_count = count($failsToday->toArray());
     //**************Repairs***************
     $repairsToday = Repair::today();
     $repairsWeek = Repair::thisweek();
     $repairsMonth = Repair::thisMonth();
     $repairs_count = count($repairsToday->toArray());
     return view('dashboard.dashboard', compact('page_title', 'section_title', 'date', 'day', 'month', 'year', 'tasksToday', 'tasksMonth', 'tasksWeek', 'tasks_count', 'failsToday', 'failsMonth', 'failsWeek', 'fails_count', 'repairsToday', 'repairsMonth', 'repairsWeek', 'repairs_count'));
 }
 /**
  * Show the application dashboard.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tasks = Task::orderBy('created_at', 'asc')->get();
     //echo "hallo in todoconstructor";
     //print_r($tasks);
     return view('tasks', ['tasks' => $tasks]);
 }
 /**
  * Show the application dashboard.
  *
  * @return Response
  */
 public function index()
 {
     $status = statu::orderBy('status', 'asc')->get();
     $owners = owner::orderBy('owner_name', 'asc')->get();
     $tasks = Task::orderBy('created_at', 'asc')->get();
     return view('home', compact('tasks'), compact('owners'));
 }
 public function getTasks()
 {
     if (Auth::check()) {
         return view('tasks', ['tasks' => Task::orderBy('created_at', 'asc')->get()]);
     } else {
         return redirect('/login');
     }
 }
Exemple #5
0
 public function index()
 {
     /*$data = DB::table('tasks')->orderBy('priority', 'DESC')->get();*/
     $priority = DB::table('issues')->join('companies', 'companies.id', '=', 'issues.company_id')->select(DB::raw('sum(companies.score * issues.level) AS total_priority'))->where('order_lines.product_id', $product->id)->where('orders.order_status_id', 4)->first();
     Task::create(['issue_id' => '9', 'person_id' => '9', 'priority' => '9']);
     $data = Task::orderBy('priority', 'DESC')->get();
     return view('welcome', compact('data'));
 }
Exemple #6
0
 public static function getGroupedDateAndLineId()
 {
     $tasks = Task::orderBy('date')->get(['date', 'line_id', 'type', 'content']);
     $tasksGrouped = [];
     foreach ($tasks as $task) {
         $tasksGrouped[$task->date][$task->line_id][$task->type] = $task->content;
     }
     return $tasksGrouped;
 }
Exemple #7
0
 public function show()
 {
     $users = DB::table('user')->count();
     $tasks = DB::table('task')->count();
     $count = DB::table('UserTask')->join('task', 'UserTask.id_task', '=', 'task.id')->where('UserTask.status', 'done')->select(DB::raw('sum(point) as point'))->get();
     if (count($count) > 0) {
         $sum = $count[0]->point;
     } else {
         $sum = 0;
     }
     $querydone = DB::table('UserTask')->select(DB::raw('count(id_task) as done'))->where('status', 'done')->get();
     if (count($querydone) > 0) {
         $countDone = (int) $querydone[0]->done;
     } else {
         $countDone = 0;
     }
     $users_list = \App\Users::orderBy('created_at', 'desc')->take(5)->get();
     $rowsUsers = "";
     foreach ($users_list as $user) {
         $rowsUsers .= '<tr class="gradeC userRow" id="' . $user->id . '">
                                             <td class="userEmail">
                                                 ' . $user->email . '
                                             </td>
                                             <td class="userLastName">
                                                ' . $user->last_name . '
                                             </td>
                                             <td class="center userFirstName">
                                                 ' . $user->first_name . '
                                             </td>
                                             <td class="center userCity">
                                                 ' . $user->city . '
                                             </td>';
     }
     $tasks_list = \App\Task::orderBy('created_at', 'desc')->take(5)->get();
     $rowsTask = "";
     foreach ($tasks_list as $task) {
         $rowsTask .= '<tr class="gradeC taskRow" id="' . $task->id . '">
                                             <td class="taskName">
                                                 ' . $task->name . '
                                             </td>
                                             <td class="center userFirstName">
                                                 ' . $task->point . '
                                             </td>
                                             <td class="center userStreet">
                                                 ' . $task->timer . '
                                             </td></tr>';
     }
     return View::make($this->_view, ['taskCount' => $tasks, 'userCount' => $users, 'usersScoreCount' => $count[0]->point, 'usersDoneCount' => $countDone, 'rowsUsers' => $rowsUsers, 'rowsTask' => $rowsTask, 'classMain' => 'active', 'classUsers' => '', 'classTasks' => '']);
 }
 public function index()
 {
     if ($this->user->auth()->active == 1) {
         if ($this->user->auth()->hasRole('Admin')) {
             $userCount = $this->user->getUserCount();
             $query = Input::get('q');
             $tasks = Task::orderBy('completed', 'asc')->simplePaginate(10);
             $users = $query ? User::where('name', 'LIKE', "%{$query}%")->orderBy('active')->get() : User::orderBy('active')->simplePaginate(10);
             return view('sezgicraft.admin.home', compact('userCount', 'users', 'tasks'));
         } else {
             session()->flash('flash_message_important', 'You are not permitted to do that!');
             return redirect('/sezgicraft');
         }
     }
 }
Exemple #9
0
 function read()
 {
     $tasks = Task::orderBy('created_at', 'asc')->get();
     return view('tasks', ['tasks' => $tasks]);
 }
 public function index()
 {
     // echo "Hello from index controller";
     $tasks = Task::orderBy('created_at', 'asc')->get();
     return view('tasks', ['tasks' => $tasks]);
 }
Exemple #11
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tasks = Task::orderBy('created_at', 'DESC')->paginate(10);
     return view('tasks.index')->with('tasks', $tasks);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $task = Task::orderBy('updated_at', 'desc')->paginate(50);
     return view('admin.task.index', compact('task'));
 }
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for 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.
|
*/
use Illuminate\Http\Request;
use App\Task;
use Illuminate\Support\Facades\Validator;
Route::get('/', function () {
    $tasks = Task::orderBy('created_at', 'asc')->get();
    return view('tasks', ['tasks' => $tasks]);
});
Route::get('/tasks', function () {
    $tasks = Task::orderBy('name', 'asc')->get();
    return view('alltasks', ['tasks' => $tasks]);
});
/*
 * Add a new Task
**/
Route::post('/task', function (Request $request) {
    $validator = Validator::make($request->all(), ['name' => 'required|max:255']);
    if ($validator->fails()) {
        return redirect('/')->withInput()->withErrors($validator);
    }
    $task = new Task();
    $task->name = $request->name;
    $task->save();
    return redirect('/');
});
 /**
  * Return all tasks
  *
  * @return \App\Task
  */
 public function all()
 {
     return $this->task->orderBy('priority', 'asc')->get();
 }
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
use App\Task;
use Illuminate\Http\Request;
Route::group(['middleware' => ['web']], function () {
    /*SHOW TASK DASHBOARD*/
    Route::get("/", function () {
        $tasks = Task::orderBy("created_at", "asc")->get();
        return view("tasks", ["tasks" => $tasks]);
    });
    /*ADD NEW TASK*/
    Route::post("/task", function (Request $request) {
        $validator = Validator::make($request->all(), ['name' => 'required|max:255']);
        if ($validator->fails()) {
            return redirect('/')->withInput()->withErrors($validator);
        }
        $task = new Task();
        $task->name = $request->name;
        $task->save();
        return redirect('/');
    });
    /*DELETE TASK*/
    Route::delete("/task/{task}", function (Task $task) {
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tasks = Task::orderBy('id', 'desc')->get();
     return view('tasks', ['tasks' => $tasks]);
 }
Exemple #17
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $tasks = Task::orderBy('id', 'desc')->paginate(10);
     return view('tasks.index', compact('tasks'));
 }
Exemple #18
0
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
use App\Task;
use Illuminate\Http\Request;
/**
 * Show Task Dashboard
 */
Route::get('/', function () {
    return view('tasks', ['tasks' => Task::orderBy('created_at', 'asc')->get()]);
});
/**
 * Add New Task
 */
Route::post('/task', function (Request $request) {
    $validator = Validator::make($request->all(), ['name' => 'required|max:255']);
    if ($validator->fails()) {
        return redirect('/')->withInput()->withErrors($validator);
    }
    $task = new Task();
    $task->name = $request->name;
    $task->save();
    return redirect('/');
});
/**
Exemple #19
0
 public function show()
 {
     $tasks_list = \App\Task::orderBy('created_at', 'desc')->get();
     $rowsTask = "";
     foreach ($tasks_list as $task) {
         $queryactive = DB::table('UserTask')->select(DB::raw('count(id_user) as active'))->where('id_task', $task->id)->where('status', 'active')->groupBy('id_task')->get();
         if (count($queryactive) > 0) {
             $dataOut['usersActiveCount'] = (int) $queryactive[0]->active;
         } else {
             $dataOut['usersActiveCount'] = 0;
         }
         $queryavailable = DB::table('UserTask')->select(DB::raw('count(id_user) as available'))->where('id_task', $task->id)->where('status', 'available')->groupBy('id_task')->get();
         if (count($queryavailable) > 0) {
             $dataOut['usersAvailableCount'] = (int) $queryavailable[0]->available;
         } else {
             $dataOut['usersAvailableCount'] = 0;
         }
         $querycancel = DB::table('UserTask')->select(DB::raw('count(id_user) as cancel'))->where('id_task', $task->id)->where('status', 'cancel')->groupBy('id_task')->get();
         if (count($querycancel) > 0) {
             $dataOut['usersCancelCount'] = (int) $querycancel[0]->cancel;
         } else {
             $dataOut['usersCancelCount'] = 0;
         }
         $querytimeout = DB::table('UserTask')->select(DB::raw('count(id_user) as timeout'))->where('id_task', $task->id)->where('status', 'timeout')->groupBy('id_task')->get();
         if (count($querytimeout) > 0) {
             $dataOut['usersTimeoutCount'] = (int) $querytimeout[0]->timeout;
         } else {
             $dataOut['usersTimeoutCount'] = 0;
         }
         $querydone = DB::table('UserTask')->select(DB::raw('count(id_user) as done'))->where('id_task', $task->id)->where('status', 'done')->groupBy('id_task')->get();
         if (count($querydone) > 0) {
             $dataOut['usersDoneCount'] = (int) $querydone[0]->done;
         } else {
             $dataOut['usersDoneCount'] = 0;
         }
         $rowsTask .= '<tr class="gradeC taskRow" id="' . $task->id . '" data-id="' . $task->id . '">
                                             <td class="taskName taskCell">
                                                 ' . $task->name . '
                                             </td>
                                             <td class="taskCell">
                                                ' . $task->created_at . '
                                             </td>
                                             <td class="center taskCell">
                                                 ' . $dataOut['usersDoneCount'] . '
                                             </td>
                                             <td class="center taskCell">
                                                 ' . $dataOut['usersCancelCount'] . '
                                             </td>
                                             <td class="center taskTime taskCell">
                                                 ' . $dataOut['usersTimeoutCount'] . '
                                             </td>
                                             <td class="center taskTime taskCell">
                                                 ' . $dataOut['usersAvailableCount'] . '
                                             </td>
                                             <td class="deleteCheck">
                                                 <div class="checkbox">
                                                     <label>
                                                     <input type="checkbox" data-id="' . $task->id . '">
                                                 </label>
                                                 </div>
                                             </td></tr>';
     }
     $users = \App\Users::all();
     $rowsUsers = '<select multiple="multiple" id="select">';
     foreach ($users as $user) {
         $rowsUsers .= '<option value="' . $user->id . '">' . $user->first_name . ' ' . $user->last_name . '</option>';
     }
     $rowsUsers .= '</select>';
     return View::make('view.task')->withTitle('TaskGame - Tasks')->withRows($rowsTask)->withUsers($rowsUsers)->withPaginate('');
 }
Exemple #20
0
 public function toJson()
 {
     $tasks = Task::orderBy('created_at', 'DESC')->get();
     return $tasks->toJson();
 }
 public function index()
 {
     //
     $tasks = Task::orderBy('publish_date', 'asc')->where('publish_date', '>=', Carbon::now())->get();
     return view('task.tasks', ['tasks' => $tasks]);
 }
Exemple #22
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return view('tasks', ['tasks' => Task::orderBy('created_at', 'asc')->get()]);
 }
Exemple #23
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for 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.
|
*/
$app->get('/', function () use($app) {
    $tasks = \App\Task::orderBy('created_at', 'desc')->get();
    return view('index', ['tasks' => $tasks]);
});
$app->post('tasks/{id}/toggle-complete', 'App\\Http\\Controllers\\TaskController@toggleComplete');
$app->post('tasks', 'App\\Http\\Controllers\\TaskController@create');
$app->post('tasks/clear-complete', 'App\\Http\\Controllers\\TaskController@clearComplete');
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tasks = Task::orderBy('created_at', 'asc')->get();
     return view('layouts.tasks', ['tasks' => $tasks]);
 }
Exemple #25
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tasks = Task::orderBy('created_at', 'asc')->get();
     return view('tasks', compact('tasks'));
 }
Exemple #26
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $tasks = Task::orderBy('id', 'desc')->get();
     return $tasks;
 }
Exemple #27
0
});
/**
 * Add A New Task
 */
Route::post('/task', function (Request $request) {
    $validator = Validator::make($request->all(), ['name' => 'required|max:255']);
    if ($validator->fails()) {
        return redirect('/')->withInput()->withErrors($validator);
    }
    $task = new Task();
    $task->name = $request->name;
    $task->save();
    return redirect('/');
});
Route::get('/', function () {
    $tasks = Task::orderBy('created_at', 'asc')->get();
    return view('tasks', ['tasks' => $tasks]);
});
/**
 * Delete An Existing Task
 */
Route::delete('/task/{id}', function ($id) {
    Task::findOrFail($id)->delete();
    return redirect('/');
});
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tasks = Task::orderBy('title')->get();
     return view('tasks.index')->withTasks($tasks);
 }