middleware('auth'); } /** * Show the application dashboard to the user. * * @return Response */ public function index() { // ksjdckjdsnc return view('themes/default1/admin/dashboard'); } public function getsmtp() { $smtp = \App\Model\helpdesk\Email\Smtp::where('id', '=', '1')->first(); return $smtp->host; } Public function getdata() { return \View::make('emails/notifications/agent'); } public function getreport() { return \View::make('test'); } public function pushdata() { $date2 = strtotime(Date('Y-m-d')); $date3 = Date('Y-m-d'); $format = 'Y-m-d'; $date1 = strtotime(Date($format, strtotime('-1 month' . $date3))); $return = ""; $last = ""; for ($i = $date1; $i <= $date2; $i = $i + 86400) { $thisDate = date('Y-m-d', $i); $created = \DB::table('tickets')->select('created_at')->where('created_at', 'LIKE', '%' . $thisDate . '%')->count(); $closed = \DB::table('tickets')->select('closed_at')->where('closed_at', 'LIKE', '%' . $thisDate . '%')->count(); $reopened = \DB::table('tickets')->select('reopened_at')->where('reopened_at', 'LIKE', '%' . $thisDate . '%')->count(); $value = ['date' => $thisDate, 'open' => $created, 'closed' => $closed, 'reopened' => $reopened]; $array = array_map('htmlentities', $value); $json = html_entity_decode(json_encode($array)); $return .= $json . ','; } $last = rtrim($return, ','); return '[' . $last . ']'; } }