diff --git a/.gitignore b/.gitignore
index 30bc16279..e9c8e8112 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
-/node_modules
\ No newline at end of file
+/node_modules
+/nbproject/private/
\ No newline at end of file
diff --git a/app/Http/Controllers/Admin/helpdesk/SettingsController.php b/app/Http/Controllers/Admin/helpdesk/SettingsController.php
index 9f3bd209c..4b3e18aea 100644
--- a/app/Http/Controllers/Admin/helpdesk/SettingsController.php
+++ b/app/Http/Controllers/Admin/helpdesk/SettingsController.php
@@ -27,6 +27,7 @@ use App\Model\helpdesk\Utility\Time_format;
use Illuminate\Http\Request;
use Input;
use Exception;
+use DB;
/**
* SettingsController
@@ -54,7 +55,25 @@ class SettingsController extends Controller {
public function settings() {
return view('themes.default1.admin.helpdesk.setting');
}
-
+public function RatingSettings() {
+ $ratings = DB::table('settings_ratings')->get();
+
+ return view('themes.default1.admin.helpdesk.settings.ratings',compact('ratings'));
+ }
+ public function PostRatingSettings($slug) {
+ $name = Input::get('rating_name');
+ $publish = Input::get('publish');
+ $modify = Input::get('modify');
+
+ DB::table('settings_ratings')->whereSlug($slug)->update(array('rating_name' => $name,'publish' => $publish, 'modify' => $modify));
+
+ return redirect()->back()->with('success', 'Successfully updated');
+ }
+ public function RatingDelete($slug) {
+ DB::table('settings_ratings')->whereSlug($slug)->delete();
+
+ return redirect()->back()->with('success', 'Successfully Deleted');
+ }
/**
* @param int $id
* @return Response
diff --git a/app/Http/Controllers/Agent/helpdesk/TicketController.php b/app/Http/Controllers/Agent/helpdesk/TicketController.php
index 01514501b..09fe3ab29 100644
--- a/app/Http/Controllers/Agent/helpdesk/TicketController.php
+++ b/app/Http/Controllers/Agent/helpdesk/TicketController.php
@@ -2182,5 +2182,15 @@ class TicketController extends Controller {
return view('themes.default1.agent.helpdesk.dept-ticket.inprogress',compact('id'));
}
}
+ public function rating($id,$rating) {
+
+ Tickets::where('id', $id)->update(array('rating' => $rating));
+ return redirect()->back()->with('Success','Thank you for your rating!');
+ }
+ public function ratingReply($id,$rating) {
+
+ Tickets::where('id', $id)->update(array('ratingreply' => $rating));
+ return redirect()->back()->with('Success','Thank you for your rating!');
+ }
}
diff --git a/app/Http/routes.php b/app/Http/routes.php
index 65ddc7911..b4ef3ebad 100644
--- a/app/Http/routes.php
+++ b/app/Http/routes.php
@@ -1,6 +1,6 @@
'role.agent', 'middleware' => 'auth'], function ()
Route::get('agen1', 'Agent\helpdesk\DashboardController@ChartData');
- Route::post('chart-range', ['as' => 'post.chart', 'uses' => 'Agent\helpdesk\DashboardController@ChartData']);
+ Route::post('chart-range/{date1}/{date2}', ['as' => 'post.chart', 'uses' => 'Agent\helpdesk\DashboardController@ChartData']);
Route::resource('user', 'Agent\helpdesk\UserController'); /* User router is used to control the CRUD of user */
@@ -216,7 +216,11 @@ Route::group(['middleware' => 'role.agent', 'middleware' => 'auth'], function ()
Route::get('/test', ['as' => 'thr', 'uses' => 'Agent\helpdesk\MailController@fetchdata']); /* Fetch Emails */
- Route::get('/ticket', ['as' => 'ticket', 'uses' => 'Agent\helpdesk\TicketController@ticket_list']); /* Get Ticket */
+ Route::post('rating/{id}/{rating}', ['as' => 'ticket.rating' , 'uses' => 'Agent\helpdesk\TicketController@rating']); /* Get overall Ratings */
+
+ Route::post('rating2/{id}/{rating}', ['as' => 'ticket.rating2' , 'uses' => 'Agent\helpdesk\TicketController@ratingReply']); /* Get reply Ratings */
+
+ Route::get('/ticket', ['as' => 'ticket', 'uses' => 'Agent\helpdesk\TicketController@ticket_list']); /* Get Ticket */
Route::get('/ticket/inbox', ['as' => 'inbox.ticket', 'uses' => 'Agent\helpdesk\TicketController@inbox_ticket_list']); /* Get Inbox Ticket */
@@ -529,6 +533,12 @@ $router->get('test', 'ArticleController@test');
$router->post('image', 'Agent\kb\SettingsController@image');
+Route::get('getratings', 'Admin\helpdesk\SettingsController@RatingSettings');
+Route::get('deleter/{rating}',[
+ 'as'=>'ratings.delete' ,'uses'=>'Admin\helpdesk\SettingsController@RatingDelete'
+ ]);
+Route::patch('postratings/{slug}',['as'=>'settings.rating','uses'=> 'Admin\helpdesk\SettingsController@PostRatingSettings']);
+
$router->get('direct', function () {
return view('direct');
});
diff --git a/database/migrations/2016_01_25_075608_create_tickets_table.php b/database/migrations/2016_01_25_075608_create_tickets_table.php
index 0223ce530..ecfcccd25 100644
--- a/database/migrations/2016_01_25_075608_create_tickets_table.php
+++ b/database/migrations/2016_01_25_075608_create_tickets_table.php
@@ -26,6 +26,8 @@ class CreateTicketsTable extends Migration {
$table->integer('flags');
$table->integer('ip_address');
$table->integer('assigned_to')->unsigned()->nullable()->index('assigned_to');
+ $table->integer('rating');
+ $table->integer('ratingreply');
$table->integer('lock_by');
$table->integer('lock_at');
$table->integer('source')->unsigned()->nullable()->index('source');
diff --git a/database/migrations/2016_02_01_052219_settings_ratings.php b/database/migrations/2016_02_01_052219_settings_ratings.php
new file mode 100644
index 000000000..379444d8c
--- /dev/null
+++ b/database/migrations/2016_02_01_052219_settings_ratings.php
@@ -0,0 +1,52 @@
+increments('id');
+ $table->string('rating_name');
+ $table->integer('publish');
+ $table->integer('modify');
+ $table->string('slug')->unique();
+ $table->timestamps();
+ });
+ DB::table('settings_ratings')->insert(array(
+ array(
+ 'rating_name' => 'Overall Rating',
+ 'publish' => '1',
+ 'modify' => '1',
+ 'slug' => Str::slug(ucfirst('Overall Rating'))
+ ),
+ array(
+ 'rating_name' => 'Reply Rating',
+ 'publish' => '1',
+ 'modify' => '1',
+ 'slug' => Str::slug(ucfirst('Reply Rating'))
+ )
+ )
+ );
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('settings_ratings');
+ }
+
+}
diff --git a/nbproject/project.properties b/nbproject/project.properties
new file mode 100644
index 000000000..d37ef9563
--- /dev/null
+++ b/nbproject/project.properties
@@ -0,0 +1,7 @@
+include.path=${php.global.include.path}
+php.version=PHP_54
+source.encoding=UTF-8
+src.dir=.
+tags.asp=false
+tags.short=false
+web.root=.
diff --git a/nbproject/project.xml b/nbproject/project.xml
new file mode 100644
index 000000000..035db715d
--- /dev/null
+++ b/nbproject/project.xml
@@ -0,0 +1,9 @@
+
+{{Lang::get('lang.ratings')}}
+
+
+
+
+
+
+
+
+ @foreach($ratings as $rating)
+
+ ID
+
+ Title
+
+ Action
+
+
+
+ @endforeach
+
+ {!! $rating->id !!}
+
+ {!! $rating->rating_name !!}
+
+
+
+
+
+
+
+ {!! $tickets->rating !!}
+
+
+
+ {!! $tickets->ratingreply !!}
+