My first commit of codes
This commit is contained in:
270
app/Http/Controllers/Admin/AgentController.php
Normal file
270
app/Http/Controllers/Admin/AgentController.php
Normal file
@@ -0,0 +1,270 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
//use App\Http\Requests\AgentRequest;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\AgentRequest;
|
||||
|
||||
/* include update request for update validation */
|
||||
use App\Http\Requests\AgentUpdate;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Model\Agent\Agents;
|
||||
use App\Model\Utility\Timezones;
|
||||
use App\Model\Agent\Groups;
|
||||
use App\Model\Agent\Department;
|
||||
use App\Model\Agent\Teams;
|
||||
|
||||
use App\Model\Agent\Assign_team_agent;
|
||||
|
||||
use DB;
|
||||
|
||||
use App\User;
|
||||
|
||||
use Auth;
|
||||
|
||||
class AgentController extends Controller {
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
public function index(User $user)
|
||||
{
|
||||
try
|
||||
{
|
||||
$user = $user->where('role','agent')->get();
|
||||
return view('themes.default1.admin.agent.agents.index', compact('user'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function create(Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team)
|
||||
{
|
||||
try
|
||||
{
|
||||
$team= $team->get();
|
||||
//$agents = $agent->get();
|
||||
$timezones = $timezone->get();
|
||||
$groups = $group->get();
|
||||
$departments = $department->get();
|
||||
|
||||
$teams = $team->lists('id','name');
|
||||
|
||||
//$assign = $team_assign_agent->where('agent_id',$id)->lists('team_id');
|
||||
|
||||
//$assign = $team_assign_agent->where('agent_id',1)->lists('team_id');
|
||||
|
||||
return view('themes.default1.admin.agent.agents.create', compact('assign','teams','agents','timezones','groups','departments','team'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store(User $user, AgentRequest $request, Assign_team_agent $team_assign_agent)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
//$agent -> fill($request->except('team_id'))->save();
|
||||
|
||||
/* Insert to user table */
|
||||
$user->role = 'agent';
|
||||
$user->fill($request->input())->save();
|
||||
|
||||
|
||||
// $teams = $request->input('assign_team');
|
||||
// $imp =implode(',', $teams);
|
||||
// $agent->assign_team = $imp;
|
||||
|
||||
$requests = $request->input('team_id');
|
||||
|
||||
$id = $user->id;
|
||||
|
||||
foreach($requests as $req)
|
||||
{
|
||||
DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||
|
||||
}
|
||||
|
||||
/* Succes And Failure condition */
|
||||
|
||||
if($user->save()==true)
|
||||
{
|
||||
return redirect('agents')->with('success','Agent Created sucessfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('agents')->with('fails','Agent can not Create');
|
||||
}
|
||||
}
|
||||
catch( Exception $e)
|
||||
{
|
||||
return redirect('agents')->with('fails','Agent can not Create');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($id,User $user, Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team)
|
||||
{
|
||||
try
|
||||
{
|
||||
$user = $user->whereId($id)->first();
|
||||
$team= $team->get();
|
||||
$teams1 = $team->lists('name','id');
|
||||
$timezones = $timezone->get();
|
||||
$groups = $group->get();
|
||||
$departments = $department->get();
|
||||
|
||||
// $selectedTeam= $user->assign_team;
|
||||
// $selectedTeams = explode(',',$selectedTeam);
|
||||
|
||||
$table = $team_assign_agent->where('agent_id',$id)->first();
|
||||
$teams = $team->lists('id','name');
|
||||
|
||||
$assign = $team_assign_agent->where('agent_id',$id)->lists('team_id');
|
||||
|
||||
|
||||
|
||||
|
||||
return view('themes.default1.admin.agent.agents.edit', compact('teams','assign','table','teams1','selectedTeams','user','timezones','groups','departments','team','exp','counted'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('agents')->with('fail','No such file');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function update($id, User $user, AgentUpdate $request, Assign_team_agent $team_assign_agent)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
//$agents = $agent -> whereId($id) -> first();
|
||||
|
||||
$user = $user->whereId($id)->first();
|
||||
|
||||
$daylight_save=$request->input('daylight_save');
|
||||
$limit_access=$request->input('limit_access');
|
||||
$directory_listing=$request->input('directory_listing');
|
||||
$vocation_mode=$request->input('vocation_mode');
|
||||
//$role=$request->input('role');
|
||||
|
||||
//dd($account_status);
|
||||
|
||||
// $agents->daylight_save=$daylight_save;
|
||||
// $agents->limit_access=$limit_access;
|
||||
// $agents->directory_listing=$directory_listing;
|
||||
// $agents->vocation_mode=$vocation_mode;
|
||||
|
||||
//==============================================
|
||||
|
||||
$user->daylight_save=$daylight_save;
|
||||
$user->limit_access=$limit_access;
|
||||
$user->directory_listing=$directory_listing;
|
||||
$user->vocation_mode=$vocation_mode;
|
||||
//$user->role=$role;
|
||||
|
||||
//==============================================
|
||||
|
||||
|
||||
$table = $team_assign_agent->where('agent_id',$id);
|
||||
$table->delete();
|
||||
|
||||
$requests = $request->input('team_id');
|
||||
|
||||
foreach($requests as $req)
|
||||
{
|
||||
DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||
|
||||
}
|
||||
|
||||
//Todo For success and failure conditions
|
||||
|
||||
//$agents->fill($request->except('daylight_save','limit_access','directory_listing','vocation_mode','assign_team'))->save();
|
||||
$user->fill($request->except('daylight_save','limit_access','directory_listing','vocation_mode','assign_team'))->save();
|
||||
return redirect('agents')->with('success','Agent Updated sucessfully');
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
return redirect('agents')->with('fails','Agent did not update');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($id, User $user, Assign_team_agent $team_assign_agent)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Becouse of foreign key we delete team_assign_agent first */
|
||||
$team_assign_agent = $team_assign_agent->where('agent_id',$id);
|
||||
$team_assign_agent->delete();
|
||||
|
||||
$user = $user->whereId($id)->first();
|
||||
|
||||
|
||||
if($user->delete())
|
||||
{
|
||||
return redirect('agents')->with('success','Agent Deleted sucessfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('agents')->with('fails','Agent can not Delete ');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('agents')->with('fails','Agent can not Delete if the team Excist');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
191
app/Http/Controllers/Admin/BanlistController.php
Normal file
191
app/Http/Controllers/Admin/BanlistController.php
Normal file
@@ -0,0 +1,191 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests\BanRequest;
|
||||
use App\Http\Controllers\Controller;
|
||||
/* include banlist Request for update function validation */
|
||||
use App\Http\Requests\BanlistRequest;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Model\Email\Banlist;
|
||||
|
||||
use App\User;
|
||||
|
||||
class BanlistController extends Controller {
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index(Banlist $ban)
|
||||
{
|
||||
try
|
||||
{
|
||||
$bans = $ban->get();
|
||||
return view('themes.default1.admin.emails.banlist.index',compact('bans'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
try
|
||||
{
|
||||
return view('themes.default1.admin.emails.banlist.create');
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store(banlist $ban, BanRequest $request, User $user)
|
||||
{
|
||||
try
|
||||
{
|
||||
//adding field to user whether it is banned or not
|
||||
$adban = $request->input('email_address');
|
||||
$use = $user->where('email',$adban)->first();
|
||||
// dd($use);
|
||||
if($use!==null)
|
||||
{
|
||||
$use->ban = 1;
|
||||
$use->save();
|
||||
$ban->create($request->input())->save();
|
||||
return redirect('banlist')->with('success','Email Banned sucessfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
$ban->create($request->input())->save();
|
||||
return redirect('banlist')->with('success','Email Banned sucessfully');
|
||||
}
|
||||
// $use = $user->where('email',$adban)->first();
|
||||
// $use->ban = 1;
|
||||
// $use->save();
|
||||
|
||||
|
||||
|
||||
// if($ban->create($request->input())->save()==true)
|
||||
// {
|
||||
// return redirect('banlist')->with('success','Email Banned sucessfully');
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return redirect('banlist')->with('fails','Email can not Ban');
|
||||
// }
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('banlist')->with('fails','Email can not Ban');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($id, Banlist $ban)
|
||||
{
|
||||
try
|
||||
{
|
||||
$bans = $ban->whereId($id)->first();
|
||||
return view('themes.default1.admin.emails.banlist.edit',compact('bans'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function update($id, Banlist $ban, BanlistRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
$bans = $ban->whereId($id)->first();
|
||||
if($bans->fill($request->input())->save())
|
||||
{
|
||||
return redirect('banlist')->with('success','Banned Email Updated sucessfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('banlist')->with('fails','Banned Email not Updated');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('banlist')->with('fails','Banned Email not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($id, Banlist $ban)
|
||||
{
|
||||
try
|
||||
{
|
||||
$bans = $ban->whereId($id)->first();
|
||||
|
||||
/* Success and Falure condition */
|
||||
|
||||
if($bans->delete()==true)
|
||||
{
|
||||
return redirect('banlist')->with('success','Banned Email Deleted sucessfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('banlist')->with('fails','Banned Email can not Delete');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('banlist')->with('fails','Banned Email can not Delete');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
11
app/Http/Controllers/Admin/Controller.php
Normal file
11
app/Http/Controllers/Admin/Controller.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use Illuminate\Foundation\Bus\DispatchesCommands;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
|
||||
abstract class Controller extends BaseController {
|
||||
|
||||
use DispatchesCommands, ValidatesRequests;
|
||||
|
||||
}
|
230
app/Http/Controllers/Admin/DepartmentController.php
Normal file
230
app/Http/Controllers/Admin/DepartmentController.php
Normal file
@@ -0,0 +1,230 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests\DepartmentRequest;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
/* include DepartmentUpdate Request for validation */
|
||||
use App\Http\Requests\DepartmentUpdate;
|
||||
|
||||
use App\Model\Manage\Sla_plan;
|
||||
use App\Model\Agent\Agents;
|
||||
use App\Model\Email\Emails;
|
||||
use App\Model\Agent\Groups;
|
||||
use App\Model\Agent\Department;
|
||||
use App\Model\Email\Template;
|
||||
|
||||
/* Include Teams model */
|
||||
use App\Model\Agent\Teams;
|
||||
|
||||
/* Use Group_assign_department */
|
||||
use App\Model\Agent\Group_assign_department;
|
||||
|
||||
use DB;
|
||||
|
||||
use App\User;
|
||||
|
||||
|
||||
class DepartmentController extends Controller {
|
||||
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
public function index(Department $department)
|
||||
{
|
||||
try
|
||||
{
|
||||
$departments = $department->get();
|
||||
return view('themes.default1.admin.agent.departments.index',compact('departments'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function create(User $user,Group_assign_department $group_assign_department, Department $department, Sla_plan $sla,Template $template,Emails $email,Groups $group)
|
||||
{
|
||||
try
|
||||
{
|
||||
$slas=$sla->get();
|
||||
$user=$user->where('role','agent')->get();
|
||||
$emails=$email->get();
|
||||
//$groups=$group->get();
|
||||
$templates = $template->get();
|
||||
$department = $department->get();
|
||||
|
||||
$groups = $group->lists('id','name');
|
||||
return view('themes.default1.admin.agent.departments.create',compact('department','templates','slas','user','emails','groups'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store(Department $department,DepartmentRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
$department -> fill($request->except('group_id'))->save();
|
||||
|
||||
$requests = $request->input('group_id');
|
||||
|
||||
$id = $department->id;
|
||||
|
||||
foreach($requests as $req)
|
||||
{
|
||||
DB::insert('insert into group_assign_department(group_id, department_id) values (?,?)', [$req, $id]);
|
||||
|
||||
}
|
||||
|
||||
/* Succes And Failure condition */
|
||||
/* Check Whether the function Success or Fail */
|
||||
|
||||
if($department->save()==true)
|
||||
{
|
||||
return redirect('departments')->with('success','Department Created sucessfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('departments')->with('fails','Department can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('departments')->with('fails','Department can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($id,User $user, Group_assign_department $group_assign_department, Template $template, Teams $team, Department $department,Sla_plan $sla,Emails $email,Groups $group)
|
||||
{
|
||||
try
|
||||
{
|
||||
$slas=$sla->get();
|
||||
$user=$user->where('role','agent')->get();
|
||||
$emails=$email->get();
|
||||
//$groups=$group->get();
|
||||
$templates = $template->get();
|
||||
$departments = $department->whereId($id)->first();
|
||||
|
||||
$groups = $group->lists('id','name');
|
||||
|
||||
$assign = $group_assign_department->where('department_id',$id)->lists('group_id');
|
||||
|
||||
return view('themes.default1.admin.agent.departments.edit',compact('assign','team','templates','departments','slas','user','emails','groups'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function update($id,Group_assign_department $group_assign_department, Department $department, DepartmentUpdate $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
$table = $group_assign_department->where('department_id',$id);
|
||||
$table->delete();
|
||||
|
||||
$requests = $request->input('group_id');
|
||||
|
||||
foreach($requests as $req)
|
||||
{
|
||||
DB::insert('insert into group_assign_department (group_id, department_id) values (?,?)', [$req, $id]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$departments = $department->whereId($id)->first();
|
||||
if($departments->fill($request->except('group_access'))->save())
|
||||
{
|
||||
return redirect('departments')->with('success','Department Updated sucessfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('departments')->with('fails','Department not Updated');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('departments')->with('fails','Department not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($id, Department $department, Group_assign_department $group_assign_department)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Becouse of foreign key we delete group_assign_department first */
|
||||
$group_assign_department = $group_assign_department->where('department_id',$id);
|
||||
$group_assign_department->delete();
|
||||
|
||||
$departments = $department->whereId($id)->first();
|
||||
|
||||
/* Check the function is Success or Fail */
|
||||
|
||||
if($departments->delete()==true)
|
||||
{
|
||||
return redirect('departments')->with('success','Department Deleted sucessfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('departments')->with('fails','Department can not Delete');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('departments')->with('fails','Department can not Delete');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
181
app/Http/Controllers/Admin/EmailsController.php
Normal file
181
app/Http/Controllers/Admin/EmailsController.php
Normal file
@@ -0,0 +1,181 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests\EmailsRequest;
|
||||
use App\Http\Requests\EmailsEditRequest;
|
||||
use App\Http\Controllers\Controller;
|
||||
/* Include Priority Model */
|
||||
use App\Model\Utility\Priority;
|
||||
/* Include Mailbox Protocol */
|
||||
use App\Model\Utility\MailboxProtocol;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Model\Email\Emails;
|
||||
use App\Model\Manage\Help_topic;
|
||||
use App\Model\Agent\Department;
|
||||
|
||||
use Crypt;
|
||||
|
||||
class EmailsController extends Controller {
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index(Emails $emails)
|
||||
{
|
||||
try
|
||||
{
|
||||
$emails = $emails->get();
|
||||
return view('themes.default1.admin.emails.emails.index', compact('emails'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function create(Department $department, Help_topic $help, Priority $priority, MailboxProtocol $mailbox_protocol)
|
||||
{
|
||||
try
|
||||
{
|
||||
$departments = $department->get();
|
||||
$helps = $help->get();
|
||||
$priority = $priority->get();
|
||||
$mailbox_protocols = $mailbox_protocol->get();
|
||||
return view('themes.default1.admin.emails.emails.create',compact('mailbox_protocols','priority','departments','helps'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store(Emails $email, EmailsRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
$password = $request->input('password');
|
||||
$encrypted = Crypt::encrypt($password);
|
||||
$email->password = $encrypted;
|
||||
if($email->fill($request->except('password'))->save()==true)
|
||||
{
|
||||
return redirect('emails')->with('success','Email Created sucessfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('emails')->with('fails','Email can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('emails')->with('fails','Email can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($id, Department $department, Help_topic $help, Emails $email, Priority $priority, MailboxProtocol $mailbox_protocol)
|
||||
{
|
||||
try
|
||||
{
|
||||
$emails = $email->whereId($id)->first();
|
||||
$departments = $department->get();
|
||||
$helps = $help->get();
|
||||
$priority = $priority->get();
|
||||
$mailbox_protocols = $mailbox_protocol->get();
|
||||
return view('themes.default1.admin.emails.emails.edit',compact('mailbox_protocols','priority','departments','helps','emails'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function update($id, Emails $email, EmailsEditRequest $request)
|
||||
{
|
||||
$password = $request->input('password');
|
||||
$encrypted = Crypt::encrypt($password);
|
||||
//echo $encrypted;
|
||||
//$value = Crypt::decrypt($encrypted);
|
||||
//echo $value;
|
||||
|
||||
try
|
||||
{
|
||||
$emails = $email->whereId($id)->first();
|
||||
$emails->password = $encrypted;
|
||||
$emails->fill($request->except('password'))->save();
|
||||
return redirect('emails')->with('success','Email Updated sucessfully');
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('emails')->with('fails','Email not updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($id, Emails $email)
|
||||
{
|
||||
try
|
||||
{
|
||||
$emails = $email->whereId($id)->first();
|
||||
if($emails->delete()==true)
|
||||
{
|
||||
return redirect('emails')->with('success','Email Deleted sucessfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('emails')->with('fails','Email can not Delete ');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('emails')->with('fails','Email can not Delete ');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
198
app/Http/Controllers/Admin/FormController.php
Normal file
198
app/Http/Controllers/Admin/FormController.php
Normal file
@@ -0,0 +1,198 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/* Include Forms Model */
|
||||
use App\Model\Manage\Forms;
|
||||
|
||||
/* Include Form_visibility model */
|
||||
use App\Model\Utility\Form_visibility;
|
||||
|
||||
/* Include Form_type model */
|
||||
use App\Model\Utility\Form_type;
|
||||
|
||||
/* Include FormRequest for validation */
|
||||
use App\Http\Requests\FormRequest;
|
||||
|
||||
class FormController extends Controller {
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index(Forms $form)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* declare variable $forms to hold the values of table form */
|
||||
$forms = $form->get();
|
||||
|
||||
/* Direct to index page with Form table values */
|
||||
return view('themes.default1.admin.manage.form.index',compact('forms'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function create(Form_visibility $visibility, Form_type $type)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Direct to Create page */
|
||||
return view('themes.default1.admin.manage.form.create',compact('visibility','type'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store(Forms $form, FormRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Fill the all request to the Table */
|
||||
/* Checking Whether function Success or not */
|
||||
|
||||
if($form->fill($request->input())->save()==true)
|
||||
{
|
||||
/* Redirect to Index page with Success Message */
|
||||
return redirect('form')->with('success','Form Created Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Redirect to Index page with Fail Message */
|
||||
return redirect('form')->with('fails','Form can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* Redirect to Index page with Fail Message */
|
||||
return redirect('form')->with('fails','Form can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($id, Forms $form, Form_visibility $visibility, Form_type $type)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* declare variable $forms to hold the values of a row by Id */
|
||||
$forms = $form->whereId($id)->first();
|
||||
|
||||
/* Direct to Edit page with Form table's perticular row using Id */
|
||||
return view('themes.default1.admin.manage.form.edit',compact('forms','visibility','type'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function update($id, Forms $form, FormRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* declare variable $forms to hold the values of a row by Id */
|
||||
$forms = $form->whereId($id)->first();
|
||||
|
||||
/* Fill the values to the row of a selected, by Id */
|
||||
/* Check Whether function is Success or not */
|
||||
if($forms->fill($request->input())->save()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('form')->with('success','Form Updated Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('form')->with('fails','Form can not Update');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* Redirect to Index page with Fail Message */
|
||||
return redirect('form')->with('fails','Form can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($id, Forms $form)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* declare variable $forms to hold the values of a row by Id */
|
||||
$forms = $form->whereId($id)->first();
|
||||
|
||||
/* Delete the values to the row of a selected, by Id */
|
||||
/* Check whether the fuction success or not */
|
||||
if($forms->delete()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('form')->with('success','Form Deleted Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('form')->with('fails','Form can not Deleted');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* Redirect to Index page with Fail Message */
|
||||
return redirect('form')->with('fails','Form can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
245
app/Http/Controllers/Admin/GroupController.php
Normal file
245
app/Http/Controllers/Admin/GroupController.php
Normal file
@@ -0,0 +1,245 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Http\Requests\GroupRequest;
|
||||
use App\Model\Agent\Groups;
|
||||
|
||||
use App\Model\Agent\Group_assign_department;
|
||||
|
||||
use App\Model\Agent\Department;
|
||||
|
||||
class GroupController extends Controller {
|
||||
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
|
||||
|
||||
public function index(Groups $group, Department $department,Group_assign_department $group_assign_department)
|
||||
{
|
||||
try
|
||||
{
|
||||
$groups = $group->get();
|
||||
$departments = $department->lists('id');
|
||||
return view('themes.default1.admin.agent.groups.index',compact('departments','group_assign_department','groups'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
try
|
||||
{
|
||||
return view('themes.default1.admin.agent.groups.create');
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store(Groups $group,GroupRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Check Whether function success or not */
|
||||
|
||||
if($group->fill($request->input())->save()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('groups')->with('success','Groups Created Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails','Groups can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails','Groups can not Create');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id, Groups $group, Request $request)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($id, Groups $group)
|
||||
{
|
||||
try
|
||||
{
|
||||
$groups = $group->whereId($id)->first();
|
||||
return view('themes.default1.admin.agent.groups.edit',compact('groups'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function update($id, Groups $group, Request $request )
|
||||
{
|
||||
try
|
||||
{
|
||||
$var = $group->whereId($id)->first() ;
|
||||
//Updating Name
|
||||
// $name = $request->Input('name');
|
||||
// $var->name = $name;
|
||||
//Updating Status
|
||||
$status = $request->Input('group_status');
|
||||
$var->group_status = $status;
|
||||
//Updating can_create_ticket field
|
||||
$createTicket = $request->Input('can_create_ticket');
|
||||
$var->can_create_ticket = $createTicket;
|
||||
//Updating can_edit_ticket field
|
||||
$editTicket = $request->Input('can_edit_ticket');
|
||||
$var->can_edit_ticket = $editTicket;
|
||||
//Updating can_post_ticket field
|
||||
$postTicket = $request->Input('can_post_ticket');
|
||||
$var->can_post_ticket = $postTicket;
|
||||
//Updating can_close_ticket field
|
||||
$closeTicket = $request->Input('can_close_ticket');
|
||||
$var->can_close_ticket = $closeTicket;
|
||||
//Updating can_assign_ticket field
|
||||
$assignTicket = $request->Input('can_assign_ticket');
|
||||
$var->can_assign_ticket = $assignTicket;
|
||||
//Updating can_trasfer_ticket field
|
||||
$trasferTicket = $request->Input('can_trasfer_ticket');
|
||||
$var->can_trasfer_ticket = $trasferTicket;
|
||||
//Updating can_delete_ticket field
|
||||
$deleteTicket = $request->Input('can_delete_ticket');
|
||||
$var->can_delete_ticket = $deleteTicket;
|
||||
//Updating can_ban_email field
|
||||
$banEmail = $request->Input('can_ban_email');
|
||||
$var->can_ban_email = $banEmail;
|
||||
//Updating can_manage_canned field
|
||||
$manageCanned = $request->Input('can_manage_canned');
|
||||
$var->can_manage_canned = $manageCanned;
|
||||
//Updating can_manage_faq field
|
||||
$manageFaq = $request->Input('can_manage_faq');
|
||||
$var->can_manage_faq = $manageFaq;
|
||||
//Updating can_view_agent_stats field
|
||||
$viewAgentStats = $request->Input('can_view_agent_stats');
|
||||
$var->can_view_agent_stats = $viewAgentStats;
|
||||
//Updating department_access field
|
||||
$departmentAccess = $request->Input('department_access');
|
||||
$var->department_access = $departmentAccess;
|
||||
//Updating admin_notes field
|
||||
$adminNotes = $request->Input('admin_notes');
|
||||
$var->admin_notes = $adminNotes;
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($var->save()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('groups')->with('success','Group Updated Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails','Group can not Update');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails','Groups can not Create');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// public function delete($id, Groups $group)
|
||||
// {
|
||||
// return view('')
|
||||
// }
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($id, Groups $group, Group_assign_department $group_assign_department)
|
||||
{
|
||||
try
|
||||
{
|
||||
$group_assign_department->where('group_id',$id)->delete();
|
||||
|
||||
$groups = $group->whereId($id)->first();
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($groups->delete()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('groups')->with('success','Group Deleted Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails','Group can not Delete');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails','Groups can not Create');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
227
app/Http/Controllers/Admin/HelptopicController.php
Normal file
227
app/Http/Controllers/Admin/HelptopicController.php
Normal file
@@ -0,0 +1,227 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests;
|
||||
|
||||
/* my own Request to Validate The create form */
|
||||
use App\Http\Requests\HelptopicRequest;
|
||||
|
||||
/* Include HelptopicUpdate for update validation*/
|
||||
use App\Http\Requests\HelptopicUpdate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/*Using Department Model*/
|
||||
use App\Model\Agent\Department;
|
||||
|
||||
/*Using Help_topic Model*/
|
||||
use App\Model\Manage\Help_topic;
|
||||
|
||||
/*Using Agents Model*/
|
||||
use App\Model\Agent\Agents;
|
||||
|
||||
/*Using Sla_plan Model*/
|
||||
use App\Model\Manage\Sla_plan;
|
||||
|
||||
/*Using Forms Model*/
|
||||
use App\Model\Form\Form_name;
|
||||
|
||||
/* Include Priority Model */
|
||||
use App\Model\Utility\Priority;
|
||||
|
||||
|
||||
|
||||
class HelptopicController extends Controller {
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index(Help_topic $topic)
|
||||
{
|
||||
try
|
||||
{
|
||||
$topics = $topic->get();
|
||||
return view('themes.default1.admin.manage.helptopic.index',compact('topics'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
/*
|
||||
================================================
|
||||
| Route to Create view file passing Model Values
|
||||
| 1.Department Model
|
||||
| 2.Help_topic Model
|
||||
| 3.Agents Model
|
||||
| 4.Sla_plan Model
|
||||
| 5.Forms Model
|
||||
================================================
|
||||
*/
|
||||
public function create(Priority $priority,Department $department, Help_topic $topic, Form_name $form, Agents $agent, Sla_plan $sla)
|
||||
{
|
||||
try
|
||||
{
|
||||
$departments = $department->get();
|
||||
$topics = $topic->get();
|
||||
$forms = $form->get();
|
||||
$agents = $agent->get();
|
||||
$slas = $sla->get();
|
||||
$priority = $priority->get();
|
||||
|
||||
return view('themes.default1.admin.manage.helptopic.create',compact('priority','departments','topics','forms','agents','slas'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store(Help_topic $topic, HelptopicRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($topic->fill($request->input())->save()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('helptopic')->with('success','Helptopic Created Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails','Helptopic can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails','Helptopic can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($id,Priority $priority,Department $department, Help_topic $topic, Form_name $form, Agents $agent, Sla_plan $sla)
|
||||
{
|
||||
try
|
||||
{
|
||||
$departments = $department->get();
|
||||
$topics = $topic->whereId($id)->first();
|
||||
$forms = $form->get();
|
||||
$agents = $agent->get();
|
||||
$slas = $sla->get();
|
||||
$priority = $priority->get();
|
||||
|
||||
return view('themes.default1.admin.manage.helptopic.edit',compact('priority','departments','topics','forms','agents','slas'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function update($id, Help_topic $topic, HelptopicUpdate $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
$topics = $topic->whereId($id)->first();
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($topics->fill($request->input())->save()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('helptopic')->with('success','Helptopic Updated Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails','Helptopic can not Updated');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails','Helptopic can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($id, Help_topic $topic)
|
||||
{
|
||||
try
|
||||
{
|
||||
$topics = $topic->whereId($id)->first();
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($topics->delete()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('helptopic')->with('success','Helptopic Deleted Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails','Helptopic can not Delete');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails','Helptopic can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
36
app/Http/Controllers/Admin/HomeController.php
Normal file
36
app/Http/Controllers/Admin/HomeController.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
class HomeController extends Controller {
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Home Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller renders your application's "dashboard" for users that
|
||||
| are authenticated. Of course, you are free to change or remove the
|
||||
| controller as you wish. It is just here to get your app started!
|
||||
|
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard to the user.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('themes/default1/admin/dashboard');
|
||||
}
|
||||
|
||||
}
|
108
app/Http/Controllers/Admin/ProfileController.php
Normal file
108
app/Http/Controllers/Admin/ProfileController.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\ProfilePassword;
|
||||
|
||||
/* include guest_note model */
|
||||
use App\Http\Requests\ProfileRequest;
|
||||
|
||||
/* include User Model */
|
||||
/* include Help_topic Model */
|
||||
|
||||
/* Profile validator */
|
||||
use App\User;
|
||||
|
||||
/* Profile Password validator */
|
||||
|
||||
/* include ticket_thred model */
|
||||
use Auth;
|
||||
|
||||
/* include tickets model */
|
||||
|
||||
/* TicketRequest to validate the ticket response */
|
||||
use Hash;
|
||||
|
||||
/* Validate post check ticket */
|
||||
|
||||
use Input;
|
||||
|
||||
class ProfileController extends Controller {
|
||||
|
||||
/* Define constructor for Authentication Checking */
|
||||
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
public function getProfile() {
|
||||
try
|
||||
{
|
||||
$user = Auth::user();
|
||||
if ($user) {
|
||||
return view('themes.default1.admin.profile', compact('user'));
|
||||
} else {
|
||||
return redirect('404');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('404');
|
||||
}
|
||||
}
|
||||
|
||||
public function postProfile($id, ProfileRequest $request) {
|
||||
$user = Auth::user();
|
||||
$user->gender = $request->input('gender');
|
||||
$user->save();
|
||||
|
||||
if ($user->profile_pic == 'avatar5.png' || $user->profile_pic == 'avatar2.png') {
|
||||
if ($request->input('gender') == 1) {
|
||||
|
||||
$name = 'avatar5.png';
|
||||
$destinationPath = 'dist/img';
|
||||
$user->profile_pic = $name;
|
||||
} elseif ($request->input('gender') == 0) {
|
||||
|
||||
$name = 'avatar2.png';
|
||||
$destinationPath = 'dist/img';
|
||||
$user->profile_pic = $name;
|
||||
}
|
||||
}
|
||||
|
||||
if (Input::file('profile_pic')) {
|
||||
//$extension = Input::file('profile_pic')->getClientOriginalExtension();
|
||||
$name = Input::file('profile_pic')->getClientOriginalName();
|
||||
|
||||
$destinationPath = 'dist/img';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
//echo $fileName;
|
||||
|
||||
Input::file('profile_pic')->move($destinationPath, $fileName);
|
||||
|
||||
$user->profile_pic = $fileName;
|
||||
|
||||
} else {
|
||||
$user->fill($request->except('profile_pic', 'gender'))->save();
|
||||
return redirect('guest')->with('success', 'Profile Updated sucessfully');
|
||||
|
||||
}
|
||||
|
||||
if ($user->fill($request->except('profile_pic'))->save()) {
|
||||
return redirect('guest')->with('success', 'Profile Updated sucessfully');
|
||||
}
|
||||
}
|
||||
|
||||
public function postProfilePassword($id, User $user, ProfilePassword $request) {
|
||||
$user = Auth::user();
|
||||
//echo $user->password;
|
||||
|
||||
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
||||
$user->password = Hash::make($request->input('new_password'));
|
||||
$user->save();
|
||||
return redirect('guest')->with('success', 'Password Updated sucessfully');
|
||||
} else {
|
||||
return redirect('guest')->with('fails', 'Password was not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
582
app/Http/Controllers/Admin/SettingsController.php
Normal file
582
app/Http/Controllers/Admin/SettingsController.php
Normal file
@@ -0,0 +1,582 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\CompanyRequest;
|
||||
|
||||
/* include CompanyRequest for company validation */
|
||||
use App\Http\Requests\EmailRequest;
|
||||
|
||||
/* include Company Model */
|
||||
use App\Http\Requests\SystemRequest;
|
||||
|
||||
/* include System Model */
|
||||
use App\Model\Agent\Department;
|
||||
|
||||
/* Include SystemRequest for system validation */
|
||||
use App\Model\Email\Emails;
|
||||
|
||||
/* include Ticket Model */
|
||||
use App\Model\Email\Template;
|
||||
|
||||
/* include Email Model */
|
||||
use App\Model\Manage\Help_topic;
|
||||
|
||||
/* Include EmailRequest for email settings validation */
|
||||
use App\Model\Manage\Sla_plan;
|
||||
|
||||
/* include Access Model */
|
||||
use App\Model\Settings\Access;
|
||||
|
||||
/* include Responder Model */
|
||||
use App\Model\Settings\Alert;
|
||||
|
||||
/* include Alert Model */
|
||||
use App\Model\Settings\Company;
|
||||
|
||||
/* include Department Model */
|
||||
use App\Model\Settings\Email;
|
||||
|
||||
/* include Timezones Model */
|
||||
use App\Model\Settings\Responder;
|
||||
|
||||
/* include Sla_plan Model */
|
||||
use App\Model\Settings\System;
|
||||
|
||||
/* include Help_topic Model */
|
||||
use App\Model\Settings\Ticket;
|
||||
|
||||
/* include Template Model */
|
||||
use App\Model\Utility\Date_format;
|
||||
|
||||
/* include Emails Model */
|
||||
use App\Model\Utility\Date_time_format;
|
||||
|
||||
/* Include date_format model*/
|
||||
use App\Model\Utility\Logs;
|
||||
|
||||
/* Include Date_time_format model*/
|
||||
use App\Model\Utility\Priority;
|
||||
|
||||
/* Include Time_format model*/
|
||||
use App\Model\Utility\Timezones;
|
||||
|
||||
/* Include Logs Model */
|
||||
use App\Model\Utility\Time_format;
|
||||
|
||||
/* Include Priority Model */
|
||||
use Illuminate\Http\Request;
|
||||
use Input;
|
||||
|
||||
class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $compant instance of company table
|
||||
*
|
||||
* get the form for company setting page
|
||||
*
|
||||
*/
|
||||
public function getcompany(Company $company) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of company from company table */
|
||||
$companys = $company->whereId('1')->first();
|
||||
|
||||
/* Direct to Company Settings Page */
|
||||
return view('themes.default1.admin.settings.company', compact('companys'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function postcompany($id, Company $company, CompanyRequest $request) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of company request */
|
||||
$companys = $company->whereId('1')->first();
|
||||
|
||||
if (Input::file('logo')) {
|
||||
$name = Input::file('logo')->getClientOriginalName();
|
||||
|
||||
$destinationPath = 'dist';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
//echo $fileName;
|
||||
|
||||
Input::file('logo')->move($destinationPath, $fileName);
|
||||
|
||||
$companys->logo = $fileName;
|
||||
}
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($companys->fill($request->except('logo'))->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getcompany')->with('success', 'Company Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getcompany')->with('fails', 'Company can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getcompany')->with('fails', 'Company can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $system instance of System table
|
||||
*
|
||||
* get the form for System setting page
|
||||
*
|
||||
*/
|
||||
public function getsystem(System $system, Department $department, Timezones $timezone, Date_format $date, Date_time_format $date_time, Time_format $time, Logs $log) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of system from system table */
|
||||
$systems = $system->whereId('1')->first();
|
||||
|
||||
/* Fetch the values from Department table */
|
||||
$departments = $department->get();
|
||||
|
||||
/* Fetch the values from Timezones table */
|
||||
$timezones = $timezone->get();
|
||||
|
||||
/* Direct to System Settings Page */
|
||||
return view('themes.default1.admin.settings.system', compact('systems', 'departments', 'timezones', 'time', 'date', 'date_time', 'log'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function postsystem($id, System $system, SystemRequest $request) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of system request */
|
||||
$systems = $system->whereId('1')->first();
|
||||
|
||||
/* fill the values to coompany table */
|
||||
/* Check whether function success or not */
|
||||
|
||||
//dd($request);
|
||||
|
||||
if ($systems->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getsystem')->with('success', 'System Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getsystem')->with('fails', 'System can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getsystem')->with('fails', 'System can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $ticket instance of Ticket table
|
||||
*
|
||||
* get the form for Ticket setting page
|
||||
*
|
||||
*/
|
||||
public function getticket(Ticket $ticket, Sla_plan $sla, Help_topic $topic, Priority $priority) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of ticket from ticket table */
|
||||
$tickets = $ticket->whereId('1')->first();
|
||||
|
||||
/* Fetch the values from SLA Plan table */
|
||||
$slas = $sla->get();
|
||||
|
||||
/* Fetch the values from Help_topic table */
|
||||
$topics = $topic->get();
|
||||
|
||||
/* Direct to Ticket Settings Page */
|
||||
return view('themes.default1.admin.settings.ticket', compact('tickets', 'slas', 'topics', 'priority'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function postticket($id, Ticket $ticket, Request $request) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of ticket request */
|
||||
$tickets = $ticket->whereId('1')->first();
|
||||
|
||||
/* fill the values to coompany table */
|
||||
$tickets->fill($request->except('captcha', 'claim_response', 'assigned_ticket', 'answered_ticket', 'agent_mask', 'html', 'client_update'))->save();
|
||||
|
||||
/* insert checkbox to Database */
|
||||
$tickets->captcha = $request->input('captcha');
|
||||
|
||||
$tickets->claim_response = $request->input('claim_response');
|
||||
|
||||
$tickets->assigned_ticket = $request->input('assigned_ticket');
|
||||
|
||||
$tickets->answered_ticket = $request->input('answered_ticket');
|
||||
|
||||
$tickets->agent_mask = $request->input('agent_mask');
|
||||
|
||||
$tickets->html = $request->input('html');
|
||||
|
||||
$tickets->client_update = $request->input('client_update');
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($tickets->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getticket')->with('success', 'Ticket Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getticket')->with('fails', 'Ticket can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getticket')->with('fails', 'Ticket can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $email instance of Email table
|
||||
*
|
||||
* get the form for Email setting page
|
||||
*
|
||||
*/
|
||||
|
||||
public function getemail(Email $email, Template $template, Emails $email1) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of email from Email table */
|
||||
$emails = $email->whereId('1')->first();
|
||||
|
||||
/* Fetch the values from Template table */
|
||||
$templates = $template->get();
|
||||
|
||||
/* Fetch the values from Emails table */
|
||||
$emails1 = $email1->get();
|
||||
|
||||
/* Direct to Email Settings Page */
|
||||
return view('themes.default1.admin.settings.email', compact('emails', 'templates', 'emails1'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function postemail($id, Email $email, EmailRequest $request) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of email request */
|
||||
$emails = $email->whereId('1')->first();
|
||||
|
||||
/* fill the values to email table */
|
||||
$emails->fill($request->except('email_fetching', 'all_emails', 'email_collaborator', 'strip', 'attachment'))->save();
|
||||
|
||||
/* insert checkboxes to database */
|
||||
$emails->email_fetching = $request->input('email_fetching');
|
||||
|
||||
$emails->all_emails = $request->input('all_emails');
|
||||
|
||||
$emails->email_collaborator = $request->input('email_collaborator');
|
||||
|
||||
$emails->strip = $request->input('strip');
|
||||
|
||||
$emails->attachment = $request->input('attachment');
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($emails->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getemail')->with('success', 'Email Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getemail')->with('fails', 'Email can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getemail')->with('fails', 'Email can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $access instance of Access table
|
||||
*
|
||||
* get the form for Access setting page
|
||||
*
|
||||
*/
|
||||
|
||||
public function getaccess(Access $access) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of access from access table */
|
||||
$accesses = $access->whereId('1')->first();
|
||||
|
||||
/* Direct to Access Settings Page */
|
||||
return view('themes.default1.admin.settings.access', compact('accesses'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function postaccess(Access $access, Request $request) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of access request */
|
||||
$accesses = $access->whereId('1')->first();
|
||||
|
||||
/* fill the values to access table */
|
||||
$accesses->fill($request->except('password_reset', 'bind_agent_ip', 'reg_require', 'quick_access'))->save();
|
||||
|
||||
/* insert checkbox value to DB */
|
||||
$accesses->password_reset = $request->input('password_reset');
|
||||
|
||||
$accesses->bind_agent_ip = $request->input('bind_agent_ip');
|
||||
|
||||
$accesses->reg_require = $request->input('reg_require');
|
||||
|
||||
$accesses->quick_access = $request->input('quick_access');
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($accesses->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getaccess')->with('success', 'Access Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getaccess')->with('fails', 'Access can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getaccess')->with('fails', 'Access can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $responder instance of Responder table
|
||||
*
|
||||
* get the form for Responder setting page
|
||||
*
|
||||
*/
|
||||
|
||||
public function getresponder(Responder $responder) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of responder from responder table */
|
||||
$responders = $responder->whereId('1')->first();
|
||||
|
||||
/* Direct to Responder Settings Page */
|
||||
return view('themes.default1.admin.settings.responder', compact('responders'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function postresponder(Responder $responder, Request $request) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of responder request */
|
||||
$responders = $responder->whereId('1')->first();
|
||||
|
||||
/* insert Checkbox value to DB */
|
||||
$responders->new_ticket = $request->input('new_ticket');
|
||||
|
||||
$responders->agent_new_ticket = $request->input('agent_new_ticket');
|
||||
|
||||
$responders->submitter = $request->input('submitter');
|
||||
|
||||
$responders->partcipants = $request->input('partcipants');
|
||||
|
||||
$responders->overlimit = $request->input('overlimit');
|
||||
|
||||
/* fill the values to coompany table */
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($responders->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getresponder')->with('success', 'Responder Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getresponder')->with('fails', 'Responder can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getresponder')->with('fails', 'Responder can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $alert instance of Alert table
|
||||
*
|
||||
* get the form for Alert setting page
|
||||
*
|
||||
*/
|
||||
|
||||
public function getalert(Alert $alert) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of alert from alert table */
|
||||
$alerts = $alert->whereId('1')->first();
|
||||
|
||||
/* Direct to Alert Settings Page */
|
||||
return view('themes.default1.admin.settings.alert', compact('alerts'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function postalert($id, Alert $alert, Request $request) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of alert request */
|
||||
$alerts = $alert->whereId('1')->first();
|
||||
|
||||
/* Insert Checkbox to DB */
|
||||
$alerts->assignment_status = $request->input('assignment_status');
|
||||
|
||||
$alerts->ticket_status = $request->input('ticket_status');
|
||||
|
||||
$alerts->overdue_department_member = $request->input('overdue_department_member');
|
||||
|
||||
$alerts->sql_error = $request->input('sql_error');
|
||||
|
||||
$alerts->excessive_failure = $request->input('excessive_failure');
|
||||
|
||||
$alerts->overdue_status = $request->input('overdue_status');
|
||||
|
||||
$alerts->overdue_assigned_agent = $request->input('overdue_assigned_agent');
|
||||
|
||||
$alerts->overdue_department_manager = $request->input('overdue_department_manager');
|
||||
|
||||
$alerts->internal_status = $request->input('internal_status');
|
||||
|
||||
$alerts->internal_last_responder = $request->input('internal_last_responder');
|
||||
|
||||
$alerts->internal_assigned_agent = $request->input('internal_assigned_agent');
|
||||
|
||||
$alerts->internal_department_manager = $request->input('internal_department_manager');
|
||||
|
||||
$alerts->assignment_assigned_agent = $request->input('assignment_assigned_agent');
|
||||
|
||||
$alerts->assignment_team_leader = $request->input('assignment_team_leader');
|
||||
|
||||
$alerts->assignment_team_member = $request->input('assignment_team_member');
|
||||
|
||||
$alerts->system_error = $request->input('system_error');
|
||||
|
||||
$alerts->transfer_department_member = $request->input('transfer_department_member');
|
||||
|
||||
$alerts->transfer_department_manager = $request->input('transfer_department_manager');
|
||||
|
||||
$alerts->transfer_assigned_agent = $request->input('transfer_assigned_agent');
|
||||
|
||||
$alerts->transfer_status = $request->input('transfer_status');
|
||||
|
||||
$alerts->message_organization_accmanager = $request->input('message_organization_accmanager');
|
||||
|
||||
$alerts->message_department_manager = $request->input('message_department_manager');
|
||||
|
||||
$alerts->message_assigned_agent = $request->input('message_assigned_agent');
|
||||
|
||||
$alerts->message_last_responder = $request->input('message_last_responder');
|
||||
|
||||
$alerts->message_status = $request->input('message_status');
|
||||
|
||||
$alerts->ticket_organization_accmanager = $request->input('ticket_organization_accmanager');
|
||||
|
||||
$alerts->ticket_department_manager = $request->input('ticket_department_manager');
|
||||
|
||||
$alerts->ticket_department_member = $request->input('ticket_department_member');
|
||||
|
||||
$alerts->ticket_admin_email = $request->input('ticket_admin_email');
|
||||
|
||||
/* fill the values to coompany table */
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($alerts->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getalert')->with('success', 'Alert Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getalert')->with('fails', 'Alert can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getalert')->with('fails', 'Alert can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getck() {
|
||||
return view('themes.default1.ckeditor');
|
||||
}
|
||||
|
||||
}
|
203
app/Http/Controllers/Admin/SlaController.php
Normal file
203
app/Http/Controllers/Admin/SlaController.php
Normal file
@@ -0,0 +1,203 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
/* include Sla_plan Model */
|
||||
use App\Model\Manage\Sla_plan;
|
||||
|
||||
/* Include SlaRequest */
|
||||
use App\Http\Requests\SlaRequest;
|
||||
|
||||
/* Include SlaUpdate */
|
||||
use App\Http\Requests\SlaUpdate;
|
||||
|
||||
class SlaController extends Controller {
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index(Sla_plan $sla)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Declare a Variable $slas to store all Values From Sla_plan Table */
|
||||
$slas = $sla->get();
|
||||
|
||||
/* Listing the values From Sla_plan Table */
|
||||
return view('themes.default1.admin.manage.sla.index',compact('slas'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Direct to Create Page */
|
||||
return view('themes.default1.admin.manage.sla.create');
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store(Sla_plan $sla, SlaRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Fill the request values to Sla_plan Table */
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($sla->fill($request->input())->save()==true)
|
||||
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('sla')->with('success','SLA Plan Created Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails','SLA Plan can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails','SLA Plan can not Create');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($id, Sla_plan $sla)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Direct to edit page along values of perticular field using Id */
|
||||
$slas = $sla->whereId($id)->first();
|
||||
$slas->get();
|
||||
return view('themes.default1.admin.manage.sla.edit',compact('slas'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function update($id, Sla_plan $sla, SlaUpdate $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Fill values to selected field using Id except Check box */
|
||||
$slas = $sla->whereId($id)->first();
|
||||
$slas->fill($request->except('transient','ticket_overdue'))->save();
|
||||
|
||||
/* Update transient checkox field */
|
||||
$slas->transient=$request->input('transient');
|
||||
|
||||
/* Update ticket_overdue checkox field */
|
||||
$slas->ticket_overdue=$request->input('ticket_overdue');
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($slas->save()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('sla')->with('success','SLA Plan Updated Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails','SLA Plan can not Update');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails','SLA Plan can not Update');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($id, Sla_plan $sla)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Delete a perticular field from the database by delete() using Id */
|
||||
$slas = $sla->whereId($id)->first();
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($slas->delete()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('sla')->with('success','SLA Plan Deleted Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails','SLA Plan can not Delete');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails','SLA Plan can not Delete');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
229
app/Http/Controllers/Admin/TeamController.php
Normal file
229
app/Http/Controllers/Admin/TeamController.php
Normal file
@@ -0,0 +1,229 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests\TeamRequest;
|
||||
|
||||
/* include TeamUpdate request for update validation */
|
||||
use App\Http\Requests\TeamUpdate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Model\Agent\Teams;
|
||||
use App\Model\Agent\Agents;
|
||||
|
||||
use App\Model\Agent\Assign_team_agent;
|
||||
|
||||
use App\User;
|
||||
|
||||
class TeamController extends Controller {
|
||||
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
public function index(Teams $team, Assign_team_agent $assign_team_agent)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
$teams = $team->get();
|
||||
|
||||
/* find out the Number of Members in the Team */
|
||||
|
||||
$id = $teams->lists('id');
|
||||
$assign_team_agent = $assign_team_agent->get();
|
||||
//dd($id);
|
||||
// foreach($id as $i)
|
||||
// {
|
||||
// $assign_team_agent = $assign_team_agent->where('team_id',$i);
|
||||
// dd($assign_team_agent);
|
||||
// }
|
||||
|
||||
return view('themes.default1.admin.agent.teams.index', compact('assign_team_agent','teams'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function create(User $user)
|
||||
{
|
||||
try
|
||||
{
|
||||
$user = $user->get();
|
||||
return view('themes.default1.admin.agent.teams.create',compact('user'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store(Teams $team,TeamRequest $request)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($team -> fill($request->input())->save()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('teams')->with('success','Teams Created Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails','Teams can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails','Teams can not Create');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($id,User $user,Assign_team_agent $assign_team_agent,Teams $team)
|
||||
{
|
||||
try
|
||||
{
|
||||
$user = $user->whereId($id)->first();
|
||||
$teams = $team->whereId($id)->first();
|
||||
//$allagents = $agent->get();
|
||||
|
||||
|
||||
/* Gettting member of the team */
|
||||
$agent_team = $assign_team_agent->where('team_id',$id)->get();
|
||||
//dd($agent_team);
|
||||
$agent_id = $agent_team->lists('agent_id','agent_id');
|
||||
// dd($agent_id);
|
||||
//$id = $agent->lists('id');
|
||||
//dd($id);
|
||||
// foreach($agent_id as $aaaaa)
|
||||
// {
|
||||
// $agent = $agent->where('id',$aaaaa)->first();
|
||||
// echo $agent;
|
||||
// //
|
||||
// }
|
||||
|
||||
|
||||
|
||||
return view('themes.default1.admin.agent.teams.edit', compact('agent_id','user','teams','allagents'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function update($id,Teams $team, TeamUpdate $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
$teams = $team->whereId($id)->first();
|
||||
//updating check box
|
||||
$alert = $request->input('assign_alert');
|
||||
$teams->assign_alert=$alert;
|
||||
$teams->save();//saving check box
|
||||
//updating whole field
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($teams->fill($request->input())->save()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('teams')->with('success','Teams Updated Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails','Teams can not Update');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails','Teams can not Update');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($id, Teams $team, Assign_team_agent $assign_team_agent)
|
||||
{
|
||||
try
|
||||
{
|
||||
$assign_team_agent->where('team_id',$id)->delete();
|
||||
|
||||
$teams = $team->whereId($id)->first();
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($teams->delete()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('teams')->with('success','Teams Deleted Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails','Teams can not Delete');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails','Teams can not Delete');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
225
app/Http/Controllers/Admin/TemplateController.php
Normal file
225
app/Http/Controllers/Admin/TemplateController.php
Normal file
@@ -0,0 +1,225 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests\TemplateRequest;
|
||||
use App\Http\Requests\DiagnoRequest;
|
||||
use App\Http\Controllers\Controller;
|
||||
/* include TemplateUpdate request for update validation */
|
||||
use App\Http\Requests\TemplateUdate;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Model\Email\Template;
|
||||
use App\Model\Utility\Languages;
|
||||
use App\Model\Email\Emails;
|
||||
|
||||
use Mail;
|
||||
class TemplateController extends Controller {
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index(Template $template)
|
||||
{
|
||||
try
|
||||
{
|
||||
$templates = $template->get();
|
||||
return view('themes.default1.admin.emails.template.index',compact('templates'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function create(Languages $language, Template $template )
|
||||
{
|
||||
try
|
||||
{
|
||||
$templates = $template->get();
|
||||
$languages = $language->get();
|
||||
return view('themes.default1.admin.emails.template.create',compact('languages','templates'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store(Template $template, TemplateRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($template->fill($request->input())->save()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('template')->with('success','Teams Created Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails','Teams can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails','Teams can not Create');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($id, Template $template, Languages $language)
|
||||
{
|
||||
try
|
||||
{
|
||||
$templates = $template->whereId($id)->first();
|
||||
$languages = $language->get();
|
||||
return view('themes.default1.admin.emails.template.edit',compact('templates','languages'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function update($id, Template $template, TemplateUdate $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
//TODO validation
|
||||
$templates = $template->whereId($id)->first();
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($templates->fill($request->input())->save()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('template')->with('success','Teams Updated Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails','Teams can not Update');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails','Teams can not Update');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($id, Template $template)
|
||||
{
|
||||
try
|
||||
{
|
||||
$templates = $template->whereId($id)->first();
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($templates->delete()==true)
|
||||
{
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('template')->with('success','Teams Deleted Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails','Teams can not Delete');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails','Teams can not Delete');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Form for Email connection checking.
|
||||
*
|
||||
* @param
|
||||
* @return Response
|
||||
*/
|
||||
public function formDiagno(Emails $email)
|
||||
{
|
||||
try
|
||||
{
|
||||
$emails = $email->get();
|
||||
return view('themes.default1.admin.emails.template.formDiagno', compact('emails'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
To Do function for Sending an Email
|
||||
*/
|
||||
|
||||
public function postDiagno(Request $request)
|
||||
{
|
||||
$email = $request->input('to');
|
||||
$subject = $request->input('subject');
|
||||
|
||||
$mail = Mail::send('themes.default1.admin.emails.template.connection',array('link' => url('getmail'), 'username' => $email), function($message) use($email) {
|
||||
$message->to($email)->subject('Checking the connection');
|
||||
});
|
||||
|
||||
return redirect('getdiagno')->with('success','Activate Your Account ! Click on Link that send to your mail');
|
||||
|
||||
|
||||
}
|
||||
}
|
37
app/Http/Controllers/Admin/ThreadController.php
Normal file
37
app/Http/Controllers/Admin/ThreadController.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/* include Priority Model */
|
||||
use App\Model\Priority;
|
||||
|
||||
/* include Ticket_thread Model */
|
||||
use App\Model\Ticket_thread;
|
||||
|
||||
class ThreadController extends Controller {
|
||||
|
||||
/* get the values from ticket_thread Table and direct to view page */
|
||||
|
||||
public function getTickets(Ticket_thread $thread, Priority $priority)
|
||||
|
||||
{
|
||||
try
|
||||
{
|
||||
/* get the values of Ticket_thread from Ticket_thread Table */
|
||||
$threads = $thread->get();
|
||||
|
||||
/* get the values of priority from Priority Table */
|
||||
$priorities = $priority->get();
|
||||
|
||||
/* Direct to view page */
|
||||
return view('themes.default1.admin.tickets.ticket', compact('threads','priorities'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
}
|
36
app/Http/Controllers/Admin/WelcomeController.php
Normal file
36
app/Http/Controllers/Admin/WelcomeController.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
class WelcomeController extends Controller {
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Welcome Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller renders the "marketing page" for the application and
|
||||
| is configured to only allow guests. Like most of the other sample
|
||||
| controllers, you are free to modify or remove it as you desire.
|
||||
|
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application welcome screen to the user.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('welcome');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user