Working on Report
Showing
36 changed files
with
2575 additions
and
248 deletions
application/app/Http/2502_routes.php
deleted
100644 → 0
| 1 | <?php | ||
| 2 | |||
| 3 | Route::get('/', array('uses'=> 'HomeController@index', 'as'=>'index.root')); | ||
| 4 | Route::get('index', array('uses'=> 'HomeController@index', 'as'=>'index.index')); | ||
| 5 | |||
| 6 | Route::get('test_table_8', 'Rom8Controller@testTable'); | ||
| 7 | Route::get('eg', 'egController@eg'); | ||
| 8 | |||
| 9 | Route::group(['middleware' => ['web']], function () { | ||
| 10 | |||
| 11 | Route::get('home', array('uses' => 'HomeController@home', 'as'=>'home.home')); | ||
| 12 | Route::get('login', array('uses'=> 'HomeController@login', 'as'=>'home.login')); | ||
| 13 | Route::post('login', array('uses'=> 'HomeController@do_login', 'as'=>'home.do_login')); | ||
| 14 | Route::get('logout', array('uses'=> 'HomeController@logout', 'as'=>'home.logout')); | ||
| 15 | Route::get('signup', array('uses'=> 'HomeController@signup', 'as'=>'home.signup')); | ||
| 16 | Route::post('signup', array('uses'=> 'HomeController@do_signup', 'as'=>'home.do_signup')); | ||
| 17 | |||
| 18 | Route::get('userfiles/{path}',array('uses'=>'HomeController@userfiles','as'=>'userfiles.get'))->where('path', '.*'); | ||
| 19 | |||
| 20 | Route::get('unsubscribe', array('uses'=> 'HomeController@unsubscribe', 'as'=>'home.unsubscribe')); | ||
| 21 | Route::any('forgotpassword', array('uses'=> 'HomeController@forgotpassword', 'as'=>'signup.forgotpassword')); | ||
| 22 | |||
| 23 | Route::get('profile', array('before' => 'auth','uses' => 'HomeController@profile', 'as'=>'profile.index')); | ||
| 24 | Route::post('profile', array('before' => 'auth','uses' => 'HomeController@do_profile', 'as'=>'profile.update')); | ||
| 25 | |||
| 26 | Route::get('msie', array('uses'=> 'HomeController@msie', 'as'=>'login.msie')); | ||
| 27 | Route::any('ajaxerror', array('uses'=> 'HomeController@ajaxerror', 'as'=>'home.ajaxerror')); | ||
| 28 | Route::any('gettoken', array('uses'=> 'HomeController@gettoken', 'as'=>'home.gettoken')); | ||
| 29 | Route::any('idleapp', array('uses'=> 'HomeController@idleapp', 'as'=>'home.idleapp')); | ||
| 30 | |||
| 31 | Route::any('fileupload', array('uses'=> 'HomeController@fileupload', 'as'=>'upload.file')); | ||
| 32 | Route::get('cron', array('uses'=> 'HomeController@cron', 'as'=>'cron.cron')); | ||
| 33 | Route::get('style', array('uses'=> 'HomeController@style', 'as'=>'style.index')); | ||
| 34 | Route::get('jshead', array('uses'=> 'HomeController@jshead', 'as'=>'jshead.index')); | ||
| 35 | Route::get('jsbody', array('uses'=> 'HomeController@jsbody', 'as'=>'jsbody.index')); | ||
| 36 | |||
| 37 | Route::resource('dashboard','DashboardController'); | ||
| 38 | Route::resource('notification','NotificationController'); | ||
| 39 | Route::resource('message','MessageController'); | ||
| 40 | Route::resource('task','TaskController'); | ||
| 41 | Route::resource('user','UserController'); | ||
| 42 | Route::resource('group','GroupController'); | ||
| 43 | Route::resource('role','RoleController'); | ||
| 44 | Route::resource('dispositionPlan','DispositionPlanController'); | ||
| 45 | |||
| 46 | Route::resource('master','MasterController'); | ||
| 47 | Route::resource('admin','AdminController'); | ||
| 48 | Route::resource('record','RecordController'); | ||
| 49 | Route::resource('campaign','CampaignController'); | ||
| 50 | |||
| 51 | Route::resource('dialer','DialerController'); | ||
| 52 | Route::resource('hr','HRController'); | ||
| 53 | Route::resource('social','SocialController'); | ||
| 54 | Route::resource('web','WebController'); | ||
| 55 | |||
| 56 | Route::get('notes', array('uses' => 'NotesController@loadQuestions', 'as'=>'questionare.load_questions')); | ||
| 57 | Route::post('notes',array('uses' => 'NotesController@store', 'as'=>'notes.store')); | ||
| 58 | |||
| 59 | Route::get('questionare/{qid?}/{optid?}/{level?}', array('uses' => 'QuestionareController@loadQuestions', 'as'=>'questionare.load_questions')); | ||
| 60 | Route::post('questionare', array('uses' => 'QuestionareController@saveQuestionAire', 'as'=>'questionare.save')); | ||
| 61 | //Route::get('notes', array('uses' => 'NotesController@index', 'as'=>'notes.index')); | ||
| 62 | //Route::resource('notesupdate','NotesController'); | ||
| 63 | |||
| 64 | Route::get('exceldownload', function() | ||
| 65 | { | ||
| 66 | return view("layout.module.userupload.exceldata"); | ||
| 67 | }); | ||
| 68 | |||
| 69 | Route::post('useruploaddata', array('uses' => 'UserController@userUpload', 'as'=>'useruploaddata')); | ||
| 70 | |||
| 71 | //Supervisor Call Mangement - By Manish on 16-02-17 | ||
| 72 | Route::get('SupervisorModule', array('uses'=> 'RecordController@supervisorUpload', 'as'=>'upload.comments')); | ||
| 73 | |||
| 74 | //Supervisor Call Mangement - By Manish on 22-03-17 | ||
| 75 | Route::post('complaint', array('uses'=> 'ComplaintController@saveComplaint', 'as'=>'upload.complaint')); | ||
| 76 | Route::post('resclassUnit', array('uses'=> 'ComplaintController@getBranchName', 'as'=>'get.branchname')); | ||
| 77 | Route::post('childcase', array('uses'=> 'ComplaintController@saveChildCase', 'as'=>'upload.case')); | ||
| 78 | |||
| 79 | //Supervisor Message Announcement - By Manish on 12-04-17 | ||
| 80 | Route::get('category/{resClassUnit}', array('uses'=> 'ComplaintController@getCat', 'as'=>'get.cat')); | ||
| 81 | Route::get('subcategory/{catId}/{resClassUnit}', array('uses'=> 'ComplaintController@getSubCat', 'as'=>'get.subcat')); | ||
| 82 | |||
| 83 | Route::post('SupervisorMessage', array('uses'=> 'MessageController@sendSupVisorMessage', 'as'=>'send.message')); | ||
| 84 | Route::get('supmessage/{msg_id?}/{username?}', array('uses'=> 'MessageController@viewSupVisorMessage', 'as'=>'view.allmessage')); | ||
| 85 | Route::get('viewmessage/{msg_id?}/{username?}', array('uses'=> 'MessageController@viewMessage', 'as'=>'view.message')); | ||
| 86 | |||
| 87 | //Addition of Customer Racing | ||
| 88 | Route::post('custrace', array('uses'=> 'RacingCustomerController@saveRacingCustomer', 'as'=>'upload.raccust')); | ||
| 89 | |||
| 90 | //Addition of Lead Entry Form | ||
| 91 | Route::post('leadentryform', array('uses'=> 'LeadEntryFormController@saveLeadEntryFormDetails', 'as'=>'upload.rleadform')); | ||
| 92 | Route::post('oaentryform', array('uses'=> 'OneAssistController@saveOneAssistFormDetails', 'as'=>'upload.oaleadform')); | ||
| 93 | |||
| 94 | Route::post('racingcustupdate',array('uses'=> 'RacingCustomerController@updateracingcust', 'as'=>'upload.updateraccust')); | ||
| 95 | Route::get('dialmode', array('uses'=> 'DialModeController@dialmodeview', 'as'=>'view.module')); | ||
| 96 | Route::post('dialmodeassign', array('uses'=> 'DialModeController@dialmodeassign', 'as'=>'assign.dialmodes')); | ||
| 97 | ///for the rlp pbwise | ||
| 98 | Route::get('rlp', array('uses'=> 'RecordController@rlpPbwise', 'as'=>'rlppb.comments')); | ||
| 99 | |||
| 100 | }); |
| ... | @@ -1547,42 +1547,7 @@ print_r($supervisorUsers); | ... | @@ -1547,42 +1547,7 @@ print_r($supervisorUsers); |
| 1547 | $data['count'] = $count; | 1547 | $data['count'] = $count; |
| 1548 | return view("layout.module.dialer.appointment",$data); | 1548 | return view("layout.module.dialer.appointment",$data); |
| 1549 | } | 1549 | } |
| 1550 | if($id=="reports") | 1550 | |
| 1551 | { | ||
| 1552 | return view("layout.module.dialer.reports",array()); | ||
| 1553 | } | ||
| 1554 | if($id=="campaigns") | ||
| 1555 | { | ||
| 1556 | return view("layout.module.dialer.campaigns",array()); | ||
| 1557 | } | ||
| 1558 | if($id=="calllog") | ||
| 1559 | { | ||
| 1560 | return view("layout.module.dialer.calllog",array()); | ||
| 1561 | } | ||
| 1562 | if($id=="agentreport") | ||
| 1563 | { | ||
| 1564 | return view("layout.module.dialer.agentreport",array()); | ||
| 1565 | } | ||
| 1566 | if($id=="campreport") | ||
| 1567 | { | ||
| 1568 | return view("layout.module.dialer.campreport",array()); | ||
| 1569 | } | ||
| 1570 | if($id=="statusreport") | ||
| 1571 | { | ||
| 1572 | return view("layout.module.dialer.statusreport",array()); | ||
| 1573 | } | ||
| 1574 | if($id=="questionnaire") | ||
| 1575 | { | ||
| 1576 | return view("layout.module.dialer.questairereport",array()); | ||
| 1577 | } | ||
| 1578 | if($id=="callmanagement") | ||
| 1579 | { | ||
| 1580 | return view("layout.module.dialer.callmanagementreport",array()); | ||
| 1581 | } | ||
| 1582 | if($id=="supmessages") | ||
| 1583 | { | ||
| 1584 | return view("layout.module.dialer.supmessagesreport",array()); | ||
| 1585 | } | ||
| 1586 | 1551 | ||
| 1587 | if($id=='playrecfile') | 1552 | if($id=='playrecfile') |
| 1588 | { | 1553 | { |
| ... | @@ -1613,18 +1578,6 @@ print_r($supervisorUsers); | ... | @@ -1613,18 +1578,6 @@ print_r($supervisorUsers); |
| 1613 | } | 1578 | } |
| 1614 | return; | 1579 | return; |
| 1615 | } | 1580 | } |
| 1616 | if($id=="liveusers") | ||
| 1617 | { | ||
| 1618 | return view("layout.module.dialer.liveusers",array()); | ||
| 1619 | } | ||
| 1620 | if($id=="recarchive") | ||
| 1621 | { | ||
| 1622 | return view("layout.module.dialer.recarchive",array()); | ||
| 1623 | } | ||
| 1624 | if($id=="recqc") | ||
| 1625 | { | ||
| 1626 | return view("layout.module.dialer.recqc",array()); | ||
| 1627 | } | ||
| 1628 | //relationship area dropdown option fetched code. code by Yashwant Sir | 1581 | //relationship area dropdown option fetched code. code by Yashwant Sir |
| 1629 | if($id=="relationship") | 1582 | if($id=="relationship") |
| 1630 | { | 1583 | { | ... | ... |
| 1 | <?php | ||
| 2 | |||
| 3 | namespace App\Http\Controllers; | ||
| 4 | |||
| 5 | use Illuminate\Http\Request; | ||
| 6 | |||
| 7 | use Auth; | ||
| 8 | use Input; | ||
| 9 | use Response; | ||
| 10 | use Config; | ||
| 11 | use App\Http\Requests; | ||
| 12 | use App\Models\Group; | ||
| 13 | use App\Models\Master; | ||
| 14 | use App\Models\Record; | ||
| 15 | use App\Models\CRMCall; | ||
| 16 | use App\Models\CRMCallArchive; | ||
| 17 | use App\Models\CRM; | ||
| 18 | use App\Models\CRMCampaign; | ||
| 19 | use App\Models\CRMList; | ||
| 20 | use App\Models\Cutoff; | ||
| 21 | use App\Jobs\KHRMSLib; | ||
| 22 | use App\Models\Sipid; | ||
| 23 | use App\Models\Dialline; | ||
| 24 | use App\Models\UserLog; | ||
| 25 | use App\Models\Kqueue; | ||
| 26 | use DB; | ||
| 27 | use Log; | ||
| 28 | use Session; | ||
| 29 | |||
| 30 | class ReportController extends Controller | ||
| 31 | { | ||
| 32 | public function __construct() | ||
| 33 | { | ||
| 34 | $this->middleware('auth'); | ||
| 35 | $this->middleware('module_access'); | ||
| 36 | } | ||
| 37 | |||
| 38 | public function show($id) | ||
| 39 | { | ||
| 40 | if($id=="reports") | ||
| 41 | { | ||
| 42 | return view("layout.module.reports.reports",array()); | ||
| 43 | } | ||
| 44 | |||
| 45 | if($id=="campaigns") | ||
| 46 | { | ||
| 47 | return view("layout.module.reports.campaigns",array()); | ||
| 48 | } | ||
| 49 | |||
| 50 | if($id=="calllog") | ||
| 51 | { | ||
| 52 | return view("layout.module.reports.calllog",array()); | ||
| 53 | } | ||
| 54 | |||
| 55 | if($id=="agentreport") | ||
| 56 | { | ||
| 57 | return view("layout.module.reports.agentreport",array()); | ||
| 58 | } | ||
| 59 | |||
| 60 | if($id=="campreport") | ||
| 61 | { | ||
| 62 | return view("layout.module.reports.campreport",array()); | ||
| 63 | } | ||
| 64 | |||
| 65 | if($id=="statusreport") | ||
| 66 | { | ||
| 67 | return view("layout.module.reports.statusreport",array()); | ||
| 68 | } | ||
| 69 | |||
| 70 | if($id=="questionnaire") | ||
| 71 | { | ||
| 72 | return view("layout.module.reports.questairereport",array()); | ||
| 73 | } | ||
| 74 | |||
| 75 | if($id=="callmanagement") | ||
| 76 | { | ||
| 77 | return view("layout.module.reports.callmanagementreport",array()); | ||
| 78 | } | ||
| 79 | |||
| 80 | if($id=="supmessages") | ||
| 81 | { | ||
| 82 | return view("layout.module.reports.supmessagesreport",array()); | ||
| 83 | } | ||
| 84 | |||
| 85 | if($id=="liveusers") | ||
| 86 | { | ||
| 87 | return view("layout.module.reports.liveusers",array()); | ||
| 88 | } | ||
| 89 | |||
| 90 | if($id=="recarchive") | ||
| 91 | { | ||
| 92 | return view("layout.module.reports.recarchive",array()); | ||
| 93 | } | ||
| 94 | |||
| 95 | if($id=="recqc") | ||
| 96 | { | ||
| 97 | return view("layout.module.reports.recqc",array()); | ||
| 98 | } | ||
| 99 | } | ||
| 100 | } |
application/app/Http/routes-2002.php
deleted
100644 → 0
| 1 | <?php | ||
| 2 | |||
| 3 | Route::get('/', array('uses'=> 'HomeController@index', 'as'=>'index.root')); | ||
| 4 | Route::get('index', array('uses'=> 'HomeController@index', 'as'=>'index.index')); | ||
| 5 | |||
| 6 | Route::get('test_table_8', 'Rom8Controller@testTable'); | ||
| 7 | Route::get('eg', 'egController@eg'); | ||
| 8 | |||
| 9 | Route::group(['middleware' => ['web']], function () { | ||
| 10 | |||
| 11 | Route::get('home', array('uses' => 'HomeController@home', 'as'=>'home.home')); | ||
| 12 | Route::get('login', array('uses'=> 'HomeController@login', 'as'=>'home.login')); | ||
| 13 | Route::post('login', array('uses'=> 'HomeController@do_login', 'as'=>'home.do_login')); | ||
| 14 | Route::get('logout', array('uses'=> 'HomeController@logout', 'as'=>'home.logout')); | ||
| 15 | Route::get('signup', array('uses'=> 'HomeController@signup', 'as'=>'home.signup')); | ||
| 16 | Route::post('signup', array('uses'=> 'HomeController@do_signup', 'as'=>'home.do_signup')); | ||
| 17 | |||
| 18 | Route::get('userfiles/{path}',array('uses'=>'HomeController@userfiles','as'=>'userfiles.get'))->where('path', '.*'); | ||
| 19 | |||
| 20 | Route::get('unsubscribe', array('uses'=> 'HomeController@unsubscribe', 'as'=>'home.unsubscribe')); | ||
| 21 | Route::any('forgotpassword', array('uses'=> 'HomeController@forgotpassword', 'as'=>'signup.forgotpassword')); | ||
| 22 | |||
| 23 | Route::get('profile', array('before' => 'auth','uses' => 'HomeController@profile', 'as'=>'profile.index')); | ||
| 24 | Route::post('profile', array('before' => 'auth','uses' => 'HomeController@do_profile', 'as'=>'profile.update')); | ||
| 25 | |||
| 26 | Route::get('msie', array('uses'=> 'HomeController@msie', 'as'=>'login.msie')); | ||
| 27 | Route::any('ajaxerror', array('uses'=> 'HomeController@ajaxerror', 'as'=>'home.ajaxerror')); | ||
| 28 | Route::any('gettoken', array('uses'=> 'HomeController@gettoken', 'as'=>'home.gettoken')); | ||
| 29 | Route::any('idleapp', array('uses'=> 'HomeController@idleapp', 'as'=>'home.idleapp')); | ||
| 30 | |||
| 31 | Route::any('fileupload', array('uses'=> 'HomeController@fileupload', 'as'=>'upload.file')); | ||
| 32 | Route::get('cron', array('uses'=> 'HomeController@cron', 'as'=>'cron.cron')); | ||
| 33 | Route::get('style', array('uses'=> 'HomeController@style', 'as'=>'style.index')); | ||
| 34 | Route::get('jshead', array('uses'=> 'HomeController@jshead', 'as'=>'jshead.index')); | ||
| 35 | Route::get('jsbody', array('uses'=> 'HomeController@jsbody', 'as'=>'jsbody.index')); | ||
| 36 | |||
| 37 | Route::resource('dashboard','DashboardController'); | ||
| 38 | Route::resource('notification','NotificationController'); | ||
| 39 | Route::resource('message','MessageController'); | ||
| 40 | Route::resource('task','TaskController'); | ||
| 41 | Route::resource('user','UserController'); | ||
| 42 | Route::resource('group','GroupController'); | ||
| 43 | Route::resource('role','RoleController'); | ||
| 44 | |||
| 45 | Route::resource('master','MasterController'); | ||
| 46 | Route::resource('admin','AdminController'); | ||
| 47 | Route::resource('record','RecordController'); | ||
| 48 | Route::resource('campaign','CampaignController'); | ||
| 49 | |||
| 50 | Route::resource('dialer','DialerController'); | ||
| 51 | Route::resource('hr','HRController'); | ||
| 52 | Route::resource('social','SocialController'); | ||
| 53 | Route::resource('web','WebController'); | ||
| 54 | |||
| 55 | Route::get('notes', array('uses' => 'NotesController@loadQuestions', 'as'=>'questionare.load_questions')); | ||
| 56 | Route::post('notes',array('uses' => 'NotesController@store', 'as'=>'notes.store')); | ||
| 57 | |||
| 58 | Route::get('questionare/{qid?}/{optid?}/{level?}', array('uses' => 'QuestionareController@loadQuestions', 'as'=>'questionare.load_questions')); | ||
| 59 | Route::post('questionare', array('uses' => 'QuestionareController@saveQuestionAire', 'as'=>'questionare.save')); | ||
| 60 | //Route::get('notes', array('uses' => 'NotesController@index', 'as'=>'notes.index')); | ||
| 61 | //Route::resource('notesupdate','NotesController'); | ||
| 62 | |||
| 63 | Route::get('exceldownload', function() | ||
| 64 | { | ||
| 65 | return view("layout.module.userupload.exceldata"); | ||
| 66 | }); | ||
| 67 | |||
| 68 | Route::post('useruploaddata', array('uses' => 'UserController@userUpload', 'as'=>'useruploaddata')); | ||
| 69 | |||
| 70 | //Supervisor Call Mangement - By Manish on 16-02-17 | ||
| 71 | Route::get('SupervisorModule', array('uses'=> 'RecordController@supervisorUpload', 'as'=>'upload.comments')); | ||
| 72 | |||
| 73 | //Supervisor Call Mangement - By Manish on 22-03-17 | ||
| 74 | Route::post('complaint', array('uses'=> 'ComplaintController@saveComplaint', 'as'=>'upload.complaint')); | ||
| 75 | Route::post('resclassUnit', array('uses'=> 'ComplaintController@getBranchName', 'as'=>'get.branchname')); | ||
| 76 | Route::post('childcase', array('uses'=> 'ComplaintController@saveChildCase', 'as'=>'upload.case')); | ||
| 77 | |||
| 78 | //Supervisor Message Announcement - By Manish on 12-04-17 | ||
| 79 | Route::get('category/{resClassUnit}', array('uses'=> 'ComplaintController@getCat', 'as'=>'get.cat')); | ||
| 80 | Route::get('subcategory/{catId}/{resClassUnit}', array('uses'=> 'ComplaintController@getSubCat', 'as'=>'get.subcat')); | ||
| 81 | |||
| 82 | Route::post('SupervisorMessage', array('uses'=> 'MessageController@sendSupVisorMessage', 'as'=>'send.message')); | ||
| 83 | Route::get('supmessage/{msg_id?}/{username?}', array('uses'=> 'MessageController@viewSupVisorMessage', 'as'=>'view.allmessage')); | ||
| 84 | Route::get('viewmessage/{msg_id?}/{username?}', array('uses'=> 'MessageController@viewMessage', 'as'=>'view.message')); | ||
| 85 | |||
| 86 | //Addition of Customer Racing | ||
| 87 | Route::post('custrace', array('uses'=> 'RacingCustomerController@saveRacingCustomer', 'as'=>'upload.raccust')); | ||
| 88 | |||
| 89 | //Addition of Lead Entry Form | ||
| 90 | Route::post('leadentryform', array('uses'=> 'LeadEntryFormController@saveLeadEntryFormDetails', 'as'=>'upload.rleadform')); | ||
| 91 | Route::post('oaentryform', array('uses'=> 'OneAssistController@saveOneAssistFormDetails', 'as'=>'upload.oaleadform')); | ||
| 92 | |||
| 93 | Route::post('racingcustupdate',array('uses'=> 'RacingCustomerController@updateracingcust', 'as'=>'upload.updateraccust')); | ||
| 94 | Route::get('dialmode', array('uses'=> 'DialModeController@dialmodeview', 'as'=>'view.module')); | ||
| 95 | Route::post('dialmodeassign', array('uses'=> 'DialModeController@dialmodeassign', 'as'=>'assign.dialmodes')); | ||
| 96 | ///for the rlp pbwise | ||
| 97 | Route::get('rlp', array('uses'=> 'RecordController@rlpPbwise', 'as'=>'rlppb.comments')); | ||
| 98 | |||
| 99 | }); |
| ... | @@ -53,6 +53,7 @@ Route::group(['middleware' => ['web']], function () { | ... | @@ -53,6 +53,7 @@ Route::group(['middleware' => ['web']], function () { |
| 53 | Route::resource('hr','HRController'); | 53 | Route::resource('hr','HRController'); |
| 54 | Route::resource('social','SocialController'); | 54 | Route::resource('social','SocialController'); |
| 55 | Route::resource('web','WebController'); | 55 | Route::resource('web','WebController'); |
| 56 | Route::resource('report','ReportController'); | ||
| 56 | 57 | ||
| 57 | Route::get('notes', array('uses' => 'NotesController@loadQuestions', 'as'=>'questionare.load_questions')); | 58 | Route::get('notes', array('uses' => 'NotesController@loadQuestions', 'as'=>'questionare.load_questions')); |
| 58 | Route::post('notes',array('uses' => 'NotesController@store', 'as'=>'notes.store')); | 59 | Route::post('notes',array('uses' => 'NotesController@store', 'as'=>'notes.store')); | ... | ... |
| ... | @@ -98,7 +98,7 @@ return [ | ... | @@ -98,7 +98,7 @@ return [ |
| 98 | "Task" => ["disp"=>"Tasks","icon"=>"edit","dash"=>"","onclick"=>"showBlock('Workflow');"], | 98 | "Task" => ["disp"=>"Tasks","icon"=>"edit","dash"=>"","onclick"=>"showBlock('Workflow');"], |
| 99 | "Dialer" => ["disp"=>"Dialer","icon"=>"phone","dash"=>"Dialer", | 99 | "Dialer" => ["disp"=>"Dialer","icon"=>"phone","dash"=>"Dialer", |
| 100 | "submenu"=>["Dialer"=>["kDialerModel();"], | 100 | "submenu"=>["Dialer"=>["kDialerModel();"], |
| 101 | "Reports"=>["menuAction('dialer/reports');"], | 101 | "Reports"=>["menuAction('report/reports');"], |
| 102 | ]], | 102 | ]], |
| 103 | "DialerCampaign" => ["disp"=>"Dialer","icon"=>"phone","dash"=>"", | 103 | "DialerCampaign" => ["disp"=>"Dialer","icon"=>"phone","dash"=>"", |
| 104 | "submenu"=>[ | 104 | "submenu"=>[ |
| ... | @@ -129,6 +129,7 @@ return [ | ... | @@ -129,6 +129,7 @@ return [ |
| 129 | "Record" => ["disp"=>"Record","icon"=>"file","dash"=>"","onclick"=>""], | 129 | "Record" => ["disp"=>"Record","icon"=>"file","dash"=>"","onclick"=>""], |
| 130 | "User" => ["disp"=>"User","icon"=>"home","dash"=>"","onclick"=>""], | 130 | "User" => ["disp"=>"User","icon"=>"home","dash"=>"","onclick"=>""], |
| 131 | "Role" => ["disp"=>"Role","icon"=>"home","dash"=>"","onclick"=>""], | 131 | "Role" => ["disp"=>"Role","icon"=>"home","dash"=>"","onclick"=>""], |
| 132 | "Report" => ["disp"=>"Report","icon"=>"home","dash"=>"","onclick"=>""], | ||
| 132 | "DialMode" => ["disp"=>"DialMode","icon"=>"home","dash"=>"","onclick"=>""], | 133 | "DialMode" => ["disp"=>"DialMode","icon"=>"home","dash"=>"","onclick"=>""], |
| 133 | "SupervisorModule" => ["disp"=>"SupervisorModule","icon"=>"globe","dash"=>"","onclick"=>"menuAction('SupervisorModule');"], | 134 | "SupervisorModule" => ["disp"=>"SupervisorModule","icon"=>"globe","dash"=>"","onclick"=>"menuAction('SupervisorModule');"], |
| 134 | "Notes" => ["disp"=>"Notes","icon"=>"globe","dash"=>"","onclick"=>"menuAction('notes');"], | 135 | "Notes" => ["disp"=>"Notes","icon"=>"globe","dash"=>"","onclick"=>"menuAction('notes');"], | ... | ... |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
| 1 | <?php | ||
| 2 | use App\Models\CRMCall; | ||
| 3 | use App\Models\Dialline; | ||
| 4 | use App\Models\Sipid; | ||
| 5 | use App\Models\User; | ||
| 6 | use App\Models\UserLog; | ||
| 7 | use App\Models\Kqueue; | ||
| 8 | use App\Jobs\KHRMSLib; | ||
| 9 | |||
| 10 | $selectedvals=explode(":",Input::get("selectedvals",":::::")); | ||
| 11 | $hdfcnodes=array(); | ||
| 12 | $offline=array(); | ||
| 13 | $arr=Config::get("app.hdfcnodes"); | ||
| 14 | foreach($arr as $server=>$arrline) | ||
| 15 | { | ||
| 16 | $tvals=explode(":",$arrline); | ||
| 17 | |||
| 18 | if($selectedvals[0]=="")$hdfcnodes[]=$server; | ||
| 19 | else if($selectedvals[0]==$tvals[0]) | ||
| 20 | { | ||
| 21 | if($selectedvals[1]=="")$hdfcnodes[]=$server; | ||
| 22 | else if($selectedvals[1]==$tvals[1]) | ||
| 23 | { | ||
| 24 | if($selectedvals[2]=="")$hdfcnodes[]=$server; | ||
| 25 | else if($selectedvals[2]==$tvals[2]) | ||
| 26 | { | ||
| 27 | if($selectedvals[3]=="")$hdfcnodes[]=$server; | ||
| 28 | else if($selectedvals[3]==$tvals[3]) | ||
| 29 | { | ||
| 30 | if($selectedvals[4]=="")$hdfcnodes[]=$server; | ||
| 31 | else if($selectedvals[4]==$tvals[4]) | ||
| 32 | { | ||
| 33 | $hdfcnodes[]=$server; | ||
| 34 | } | ||
| 35 | } | ||
| 36 | } | ||
| 37 | } | ||
| 38 | } | ||
| 39 | } | ||
| 40 | |||
| 41 | |||
| 42 | |||
| 43 | $wakka = new KHRMSLib(); | ||
| 44 | $dashboarduser=Auth::user(); | ||
| 45 | $nowts=time(); | ||
| 46 | $chart=array('ts'=>date('H:i:s',time()-($dashboarduser->timezone*60)),'Online'=>0,'NoCall'=>0,'InCall'=>0,'CallWait'=>0,'CmdList'=>0); | ||
| 47 | $alist=array(); | ||
| 48 | $sipidsfound=array(); | ||
| 49 | |||
| 50 | $userarr=array();$i=1; | ||
| 51 | $reporthead=array("#","ID","User","Campaign","Station","Status","CRMId","Number","Type","State","Duration"); | ||
| 52 | $reportarray=array(); | ||
| 53 | |||
| 54 | foreach($hdfcnodes as $ci=>$server) | ||
| 55 | { | ||
| 56 | $conn = array( | ||
| 57 | 'driver' => 'mysql', | ||
| 58 | 'host' => $server, | ||
| 59 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 60 | 'username' => env('DB_USERNAME', 'root'), | ||
| 61 | 'password' => env('DB_PASSWORD', ''), | ||
| 62 | 'charset' => 'utf8', | ||
| 63 | 'collation' => 'utf8_unicode_ci', | ||
| 64 | 'prefix' => '', | ||
| 65 | 'options' => array( | ||
| 66 | PDO::ATTR_TIMEOUT => 5, | ||
| 67 | ), | ||
| 68 | ); | ||
| 69 | Config::set("database.connections.conn$ci", $conn); | ||
| 70 | |||
| 71 | try | ||
| 72 | { | ||
| 73 | DB::connection("conn$ci")->getDatabaseName(); | ||
| 74 | |||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | |||
| 79 | |||
| 80 | $allusers=User::on("conn$ci")->where("status","=","Active")->get(); | ||
| 81 | foreach($allusers as $tuser)$uidlist[]=$tuser->id; | ||
| 82 | |||
| 83 | $newcalls=Dialline::on("conn$ci")->where('status','!=','Free')->where('conf','=','')->orderBy('updated_at')->get(); | ||
| 84 | $acalls=Dialline::on("conn$ci")->where('status','!=','Free')->where('conf','!=','')->orderBy('updated_at')->get(); | ||
| 85 | $sipids=Sipid::on("conn$ci")->whereIn("user",$uidlist)->where("status","=","1")->get(); | ||
| 86 | |||
| 87 | foreach($newcalls as $newcall) | ||
| 88 | { | ||
| 89 | $tcall=CRMCall::on("conn$ci")->where('dialline_id','=',$newcall->id)->orderBy('id','DESC')->first(); | ||
| 90 | $un="";$uid="";$us=""; | ||
| 91 | if($tcall->user_id>0) | ||
| 92 | { | ||
| 93 | $tuser=User::on("conn$ci")->find($tcall->user_id); | ||
| 94 | $un=$tuser->username; | ||
| 95 | $uid=userchatbox($tuser).$tuser->id; | ||
| 96 | |||
| 97 | $userlog=UserLog::on("conn$ci")->where('user_id','=',$tuser->id)->orderBy("id","DESC")->first(); | ||
| 98 | $stend=$userlog->getLastStatus(); | ||
| 99 | $us="$stend[0]-$stend[1]"; | ||
| 100 | |||
| 101 | $chart['Online']++; | ||
| 102 | $chart['InCall']++; | ||
| 103 | } | ||
| 104 | else $chart['CallWait']++; | ||
| 105 | |||
| 106 | $obj=array(); | ||
| 107 | $obj["#"]=$i++; | ||
| 108 | $obj["ID"]=$uid; | ||
| 109 | $obj["User"]=$un; | ||
| 110 | $obj["Campaign"]=$tcall->client; | ||
| 111 | $obj["Station"]=$tcall->sipid_id.userSpyStr($tcall->sipid_id); | ||
| 112 | $obj["Status"]=$us; | ||
| 113 | $obj["CRMId"]=$tcall->crm_id; | ||
| 114 | $obj["Number"]=$tcall->number; | ||
| 115 | $obj["Type"]=$tcall->type; | ||
| 116 | $obj["State"]=$tcall->state; | ||
| 117 | $obj["Duration"]=$nowts-strtotime($tcall->created_at); | ||
| 118 | |||
| 119 | $reportarray[$newcall->id]=$obj; | ||
| 120 | if(!empty($tcall->sipid_id))$sipidsfound[]=$tcall->sipid_id; | ||
| 121 | } | ||
| 122 | foreach($acalls as $acall) | ||
| 123 | { | ||
| 124 | $tcall=CRMCall::on("conn$ci")->where('dialline_id','=',$acall->id)->orderBy('id','DESC')->first(); | ||
| 125 | |||
| 126 | $tsipid=substr($acall->conf,4); | ||
| 127 | $tsip=Sipid::on("conn$ci")->find($tsipid); | ||
| 128 | $clidata=json_decode($tsip->clients,true); | ||
| 129 | |||
| 130 | $tuser=User::on("conn$ci")->find($tsip->user); | ||
| 131 | |||
| 132 | $userlog=UserLog::on("conn$ci")->where('user_id','=',$tuser->id)->orderBy("id","DESC")->first(); | ||
| 133 | $stend=$userlog->getLastStatus(); | ||
| 134 | |||
| 135 | $obj=array(); | ||
| 136 | $obj["#"]=$i++; | ||
| 137 | $obj["ID"]=userchatbox($tuser).$tsip->user; | ||
| 138 | $obj["User"]=$tuser->username; | ||
| 139 | $obj["Campaign"]=substr($clidata['r'],0,20); | ||
| 140 | $obj["Station"]=$tsip->id.userSpyStr($tsip->id); | ||
| 141 | $obj["Status"]="$stend[0]-$stend[1]"; | ||
| 142 | $obj["CRMId"]=$tcall->crm_id; | ||
| 143 | $obj["Number"]=$tcall->number; | ||
| 144 | $obj["Type"]=$tcall->type; | ||
| 145 | $obj["State"]=$tcall->state; | ||
| 146 | $obj["Duration"]=$nowts-strtotime($tcall->created_at); | ||
| 147 | |||
| 148 | $reportarray[$acall->id]=$obj; | ||
| 149 | $sipidsfound[]=$tsipid; | ||
| 150 | |||
| 151 | $chart['Online']++; | ||
| 152 | $chart['InCall']++; | ||
| 153 | } | ||
| 154 | foreach($sipids as $sipid) | ||
| 155 | { | ||
| 156 | if(!in_array($sipid->id,$sipidsfound)) | ||
| 157 | { | ||
| 158 | $clidata=json_decode($sipid->clients,true); | ||
| 159 | |||
| 160 | $tuser=User::on("conn$ci")->find($sipid->user); | ||
| 161 | $userlog=UserLog::on("conn$ci")->where('user_id','=',$tuser->id)->orderBy("id","DESC")->first(); | ||
| 162 | $stend=$userlog->getLastStatus(); | ||
| 163 | |||
| 164 | $obj=array(); | ||
| 165 | $obj["#"]=$i++; | ||
| 166 | $obj["ID"]=userchatbox($tuser).$sipid->user; | ||
| 167 | $obj["User"]=$tuser->username; | ||
| 168 | $obj["Campaign"]=substr($clidata['r'],0,20); | ||
| 169 | $obj["Station"]=$sipid->id.userSpyStr($sipid->id); | ||
| 170 | $obj["Status"]="$stend[0]-$stend[1]"; | ||
| 171 | $obj["CRMId"]=""; | ||
| 172 | $obj["Number"]=""; | ||
| 173 | $obj["Type"]=""; | ||
| 174 | $obj["State"]=""; | ||
| 175 | $obj["Duration"]=""; | ||
| 176 | |||
| 177 | $reportarray[]=$obj; | ||
| 178 | |||
| 179 | $chart['Online']++; | ||
| 180 | $chart['NoCall']++; | ||
| 181 | } | ||
| 182 | } | ||
| 183 | |||
| 184 | $chart['CmdList']=-1*Kqueue::on("conn$ci")->count(); | ||
| 185 | |||
| 186 | |||
| 187 | |||
| 188 | |||
| 189 | |||
| 190 | }catch(Exception $e) | ||
| 191 | { | ||
| 192 | $offline[]=$server; | ||
| 193 | } | ||
| 194 | } | ||
| 195 | |||
| 196 | |||
| 197 | if(Input::get('chartvals')==1) | ||
| 198 | { | ||
| 199 | echo json_encode($chart); | ||
| 200 | return; | ||
| 201 | } | ||
| 202 | |||
| 203 | $highestColumn = sizeof($reporthead); | ||
| 204 | $outhead="<tr>";$outstr=""; | ||
| 205 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 206 | $outhead.="<td>".$reporthead[$head]."</td>"; | ||
| 207 | } | ||
| 208 | $outhead.="</tr>"; | ||
| 209 | foreach($reportarray as $uid=>$uarr) | ||
| 210 | { | ||
| 211 | $outstr.="<tr>"; | ||
| 212 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 213 | $outstr.="<td>".$uarr[$reporthead[$head]]."</td>"; | ||
| 214 | } | ||
| 215 | $outstr.="</tr>"; | ||
| 216 | } | ||
| 217 | |||
| 218 | |||
| 219 | function userchatbox($tuser) | ||
| 220 | { | ||
| 221 | |||
| 222 | } | ||
| 223 | function userSpyStr($sipid) | ||
| 224 | { | ||
| 225 | |||
| 226 | } | ||
| 227 | //charts | ||
| 228 | ?> | ||
| 229 | |||
| 230 | |||
| 231 | <div class=innerAll> | ||
| 232 | |||
| 233 | |||
| 234 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 235 | <script> | ||
| 236 | $(document).ready(function() | ||
| 237 | { | ||
| 238 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 239 | { | ||
| 240 | $('#dialoglog').dialog({ | ||
| 241 | autoOpen: false, | ||
| 242 | width: '70%', | ||
| 243 | buttons: { | ||
| 244 | "Ok": function() { | ||
| 245 | $(this).dialog("close"); | ||
| 246 | }, | ||
| 247 | "Cancel": function() { | ||
| 248 | $(this).dialog("close"); | ||
| 249 | } | ||
| 250 | } | ||
| 251 | }); | ||
| 252 | } | ||
| 253 | }); | ||
| 254 | </script> | ||
| 255 | <div style="float:left;width:50%"> | ||
| 256 | <h5>Dialer : Live</h5> | ||
| 257 | </div> | ||
| 258 | <div style="float:left;width:50%"> | ||
| 259 | <button class="pull-right btn btn-sm btn-default" onclick='liveLogReloadFun(10);return false;' title='Reload' style='margin-top:-8px'><i class='fa fa-refresh'></i> Reload</button> | ||
| 260 | </div> | ||
| 261 | <div style="clear:both"></div> | ||
| 262 | <hr> | ||
| 263 | |||
| 264 | <div class=col-md-12> | ||
| 265 | |||
| 266 | |||
| 267 | <div id=liveuserlogschart1{!!$nowts!!} style='min-height:300px;width:100%'></div> | ||
| 268 | <script> | ||
| 269 | var livechart001=''; | ||
| 270 | $(function () { | ||
| 271 | livechart001=$('#liveuserlogschart1{!!$nowts!!}').highcharts({ | ||
| 272 | title: { | ||
| 273 | text: '', | ||
| 274 | x: -20 //center | ||
| 275 | }, | ||
| 276 | subtitle: { | ||
| 277 | text: '', | ||
| 278 | x: -20 | ||
| 279 | }, | ||
| 280 | xAxis: { | ||
| 281 | categories: [<?php $ccc=array();for($c=60;$c>0;$c--){echo "'",date('H:i:s',time()-($c*10)-($dashboarduser->timezone*60))."',";$ccc[]="0";}$ccc="[".implode(",",$ccc)."]"; ?>], | ||
| 282 | labels:{ | ||
| 283 | enabled:false//default is true | ||
| 284 | }, | ||
| 285 | }, | ||
| 286 | yAxis: { | ||
| 287 | title: { | ||
| 288 | text: '' | ||
| 289 | }, | ||
| 290 | plotLines: [{ | ||
| 291 | value: 0, | ||
| 292 | width: 1, | ||
| 293 | color: '#808080' | ||
| 294 | }] | ||
| 295 | }, | ||
| 296 | tooltip: { | ||
| 297 | valueSuffix: '' | ||
| 298 | }, | ||
| 299 | legend: { | ||
| 300 | |||
| 301 | }, | ||
| 302 | series: [{ | ||
| 303 | name: 'Online', | ||
| 304 | data: {!!Input::get('Online',$ccc)!!} | ||
| 305 | }, { | ||
| 306 | name: 'NoCall', | ||
| 307 | data: {!!Input::get('NoCall',$ccc)!!} | ||
| 308 | }, { | ||
| 309 | name: 'InCall', | ||
| 310 | data: {!!Input::get('InCall',$ccc)!!} | ||
| 311 | }, { | ||
| 312 | name: 'CallWait', | ||
| 313 | data: {!!Input::get('CallWait',$ccc)!!} | ||
| 314 | }, { | ||
| 315 | name: 'CmdList',visible: false, | ||
| 316 | data: {!!Input::get('CmdList',$ccc)!!} | ||
| 317 | }] | ||
| 318 | }); | ||
| 319 | }); | ||
| 320 | |||
| 321 | function liveLogReloadFun(delay) | ||
| 322 | { | ||
| 323 | var tchart=livechart001.highcharts(); | ||
| 324 | var sdata=''; | ||
| 325 | sdata+='&Online='+JSON.stringify(tchart.series[0].yData); | ||
| 326 | sdata+='&NoCall='+JSON.stringify(tchart.series[1].yData); | ||
| 327 | sdata+='&InCall='+JSON.stringify(tchart.series[2].yData); | ||
| 328 | sdata+='&CallWait='+JSON.stringify(tchart.series[3].yData); | ||
| 329 | sdata+='&CmdList='+JSON.stringify(tchart.series[4].yData); | ||
| 330 | |||
| 331 | setTimeout(function(){ | ||
| 332 | if($("#liveuserlogschart1{!!$nowts!!}").length) | ||
| 333 | doAjax('dialer/aliveusers',sdata+'&selectedvals='+getarvalval(),'rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | ||
| 334 | },delay); | ||
| 335 | } | ||
| 336 | function liveLogReloadChartFun(delay) | ||
| 337 | { | ||
| 338 | setTimeout(function(){ | ||
| 339 | if($("#liveuserlogschart1{!!$nowts!!}").length) | ||
| 340 | doAjax('dialer/aliveusers','chartvals=1'+'&selectedvals='+getarvalval(),'__FD__','ajax_dialer_reports','singlethis','GET',function(res) | ||
| 341 | { | ||
| 342 | var resobj=JSON.parse(res.responseText); | ||
| 343 | |||
| 344 | var tchart=livechart001.highcharts(); | ||
| 345 | var shift = tchart.series[0].data.length > 60; | ||
| 346 | |||
| 347 | // add the point | ||
| 348 | tchart.series[0].addPoint([resobj['ts'],resobj['Online']], true, shift); | ||
| 349 | tchart.series[1].addPoint([resobj['ts'],resobj['NoCall']], true, shift); | ||
| 350 | tchart.series[2].addPoint([resobj['ts'],resobj['InCall']], true, shift); | ||
| 351 | tchart.series[3].addPoint([resobj['ts'],resobj['CallWait']],true,shift); | ||
| 352 | tchart.series[4].addPoint([resobj['ts'],resobj['CmdList']],true,shift); | ||
| 353 | |||
| 354 | // call it again after one second | ||
| 355 | setTimeout(liveLogReloadChartFun, 5000); | ||
| 356 | |||
| 357 | |||
| 358 | }); | ||
| 359 | },delay); | ||
| 360 | } | ||
| 361 | liveLogReloadChartFun(10); | ||
| 362 | </script> | ||
| 363 | |||
| 364 | </div> | ||
| 365 | |||
| 366 | <div style='clear:both'></div> | ||
| 367 | |||
| 368 | |||
| 369 | |||
| 370 | <div style='clear:both'></div> | ||
| 371 | |||
| 372 | <div style='overflow:auto'> | ||
| 373 | <table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'> | ||
| 374 | <thead> | ||
| 375 | <?php echo $outhead; ?> | ||
| 376 | </thead> | ||
| 377 | <?php echo $outstr; ?> | ||
| 378 | </table> | ||
| 379 | </div> | ||
| 380 | |||
| 381 | <div id=dialoglog></div> | ||
| 382 | |||
| 383 | |||
| 384 | |||
| 385 | |||
| 386 | |||
| 387 | </div> | ||
| 388 | <!-- | ||
| 389 | |||
| 390 | <?php | ||
| 391 | //if($dashboarduser->moduleACL("Admin",false,false,true))print_r(Config::get('app.sqllog')); | ||
| 392 | foreach($arr as $server=>$arrline) | ||
| 393 | { | ||
| 394 | if(in_array($server,$hdfcnodes))echo "$server => $arrline\n"; | ||
| 395 | } | ||
| 396 | |||
| 397 | ?> | ||
| 398 | |||
| 399 | --> |
| 1 | <?php | ||
| 2 | $dashboarduser=Auth::user(); | ||
| 3 | $timeoffset=$dashboarduser->timezone*60; | ||
| 4 | ?> | ||
| 5 | <div class="container-fluid"> | ||
| 6 | <div class="layout-app"> | ||
| 7 | <div class="row"> | ||
| 8 | <div class="col-md-12"> | ||
| 9 | <div class="col-separator col-separator-first col-unscrollable box"> | ||
| 10 | <div class="innerAll"> | ||
| 11 | <div> | ||
| 12 | <h4 id='tcampaign_select' value=<?php if(!empty($client)) echo $client; ?>>Appointment <?php if(!empty($client)) echo ": ".$client; ?></h4></div> | ||
| 13 | <hr style="margin-bottom: 10px;" /> | ||
| 14 | |||
| 15 | <table class='table' | ||
| 16 | <thead> | ||
| 17 | <tr> | ||
| 18 | <th></th> | ||
| 19 | <th></th> | ||
| 20 | <?php if(empty($client)) echo "<th>Campaign</th>" ?> | ||
| 21 | <th>Cust_ID</th> | ||
| 22 | <th>Name</th> | ||
| 23 | <th>Number</th> | ||
| 24 | <!-- <th>Type</th>--> | ||
| 25 | <th>LastCall</th> | ||
| 26 | <!-- <th>Disposition</th> ---> | ||
| 27 | <th>Appointment Date</th> | ||
| 28 | <!--- <th>Status</th> ---> | ||
| 29 | |||
| 30 | <!-- <th>Count</th> --> | ||
| 31 | <!--<th></th>--> | ||
| 32 | <!-- <th>DID</th> --> | ||
| 33 | </tr> | ||
| 34 | </thead> | ||
| 35 | <tbody> | ||
| 36 | <?php | ||
| 37 | if($count > 0){ | ||
| 38 | foreach ($appointment as $key => $value) { //echo "<pre>";print_r($value);exit;?> | ||
| 39 | <tr> | ||
| 40 | <td></td> | ||
| 41 | <td></td> | ||
| 42 | <?php if(empty($client)) echo "<td>$value->client</td>" ?> | ||
| 43 | <td><?php echo $value->cust_id; ?></td> | ||
| 44 | <td><?php echo $value->customer_name; ?></td> | ||
| 45 | <td><a href=# class='' onclick='dialerQuickOpen("<?php echo $value->id; ?>","<?php echo $value->mobile; ?>","Manual","",0);return false;'><?php echo $value->mobile; ?></a></td> | ||
| 46 | <td><?php echo date("Y-m-d H:i:s",strtotime($value->dialer_lastcall)-$timeoffset); ?></td> | ||
| 47 | <!--<td><?php //echo $value->dialer_status; ?></td>--> | ||
| 48 | <td><?php echo date("Y-m-d H:i:s",strtotime($value->dialer_appointment)-$timeoffset); ?></td> | ||
| 49 | <!--<td><?php //echo $value->status; ?></td>--> | ||
| 50 | </tr> | ||
| 51 | <?php } | ||
| 52 | }else{ ?> | ||
| 53 | <td colspan="9" align="center">No Record Available</td> | ||
| 54 | <?php } ?> | ||
| 55 | </table> | ||
| 56 | |||
| 57 | <div id="campaignDetailsArea"></div> | ||
| 58 | </div> | ||
| 59 | </div> | ||
| 60 | </div> | ||
| 61 | </div> | ||
| 62 | |||
| 63 | </div> | ||
| 64 | </div> |
| 1 | <div class="layout-app"><!-- row-app --> | ||
| 2 | <div class="row row-app"> | ||
| 3 | |||
| 4 | <!-- col --> | ||
| 5 | <div class="col-md-2 col-sm-3"> | ||
| 6 | |||
| 7 | <!-- col-separator --> | ||
| 8 | <div class="col-separator col-separator-first box col-unscrollable"> | ||
| 9 | |||
| 10 | <!-- col-table --> | ||
| 11 | <div class="col-table" style='padding-left: 13px;padding-right: 13px;'> | ||
| 12 | |||
| 13 | <h4 class="innerAll margin-none border-bottom" style='background: #fff;'>Dialer Reports</h4> | ||
| 14 | |||
| 15 | <!-- col-table-row --> | ||
| 16 | <div class="col-table-row"> | ||
| 17 | |||
| 18 | <!-- col-app --> | ||
| 19 | <div class="col-app col-unscrollable"> | ||
| 20 | |||
| 21 | <!-- col-app --> | ||
| 22 | <div class="col-app"> | ||
| 23 | |||
| 24 | <ul class="list-group list-group-1 margin-none borders-none" style='padding-right: 26px;'> | ||
| 25 | |||
| 26 | |||
| 27 | <li class="list-group-item"> | ||
| 28 | <a href="#" onclick="areportsFun('aliveusers');return false"><i class="fa fa-circle-o"></i> Live</a> | ||
| 29 | </li> | ||
| 30 | <li class="list-group-item"> | ||
| 31 | <a href="#" onclick="areportsFun('acalllog');return false"><i class="fa fa-circle-o"></i> Call</a> | ||
| 32 | </li> | ||
| 33 | <li class="list-group-item"> | ||
| 34 | <a href="#" onclick="areportsFun('aagentreport');return false"><i class="fa fa-circle-o"></i> Login</a> | ||
| 35 | </li> | ||
| 36 | <li class="list-group-item"> | ||
| 37 | <a href="#" onclick="areportsFun('acampreport');return false"><i class="fa fa-circle-o"></i> Time</a> | ||
| 38 | </li> | ||
| 39 | <li class="list-group-item"> | ||
| 40 | <a href="#" onclick="areportsFun('astatusreport');return false"><i class="fa fa-circle-o"></i> Status</a> | ||
| 41 | </li> | ||
| 42 | |||
| 43 | <li class="list-group-item"></li> | ||
| 44 | <div class="col-separator-h"></div> | ||
| 45 | |||
| 46 | <h5 class="innerAll margin-none border-bottom" style='background: #fff;'>Filters</h5> | ||
| 47 | <li class="list-group-item"> | ||
| 48 | <select class=form-control id=arval0 onchange='arvalChange(0);'><option value=''></option><option value='COP'>COP</option><option value='Prime'>Prime</option></select> | ||
| 49 | <select class=form-control id=arval1 onchange='arvalChange(1);'><option value=''></option></select> | ||
| 50 | <select class=form-control id=arval2 onchange='arvalChange(2);'><option value=''></option></select> | ||
| 51 | <select class=form-control id=arval3 onchange='arvalChange(3);'><option value=''></option></select> | ||
| 52 | <select class=form-control id=arval4 onchange='arvalChange(4);'><option value=''></option></select> | ||
| 53 | </li> | ||
| 54 | |||
| 55 | |||
| 56 | |||
| 57 | </ul> | ||
| 58 | |||
| 59 | |||
| 60 | </div> | ||
| 61 | <!-- // END col-app --> | ||
| 62 | |||
| 63 | </div> | ||
| 64 | <!-- // END col-app --> | ||
| 65 | |||
| 66 | </div> | ||
| 67 | <!-- // END col-table-row --> | ||
| 68 | |||
| 69 | </div> | ||
| 70 | <!-- // END col-table --> | ||
| 71 | |||
| 72 | </div> | ||
| 73 | <!-- // END col-separator.box --> | ||
| 74 | |||
| 75 | </div> | ||
| 76 | <!-- // END col --> | ||
| 77 | |||
| 78 | <!-- col --> | ||
| 79 | <div class="col-md-10 col-sm-9" style='border-right:13px solid #eaeaea'> | ||
| 80 | |||
| 81 | <!-- col-separator.box --> | ||
| 82 | <div class="col-separator col-unscrollable box"> | ||
| 83 | |||
| 84 | <!-- col-table --> | ||
| 85 | <div class="col-table"> | ||
| 86 | |||
| 87 | <!-- <h4 class="innerAll margin-none border-bottom">My Sessions</h4> --> | ||
| 88 | |||
| 89 | <!-- col-table-row --> | ||
| 90 | <div class="col-table-row" style='background: #fff;'> | ||
| 91 | |||
| 92 | <!-- col-app --> | ||
| 93 | <div class="col-app col-unscrollable"> | ||
| 94 | |||
| 95 | <!-- col-app --> | ||
| 96 | <div class="col-app" style='position:relative'> | ||
| 97 | |||
| 98 | <div class="" id=rightmainreportdiv> | ||
| 99 | |||
| 100 | </div> | ||
| 101 | |||
| 102 | </div> | ||
| 103 | <!-- // END col-app --> | ||
| 104 | |||
| 105 | </div> | ||
| 106 | <!-- // END col-app.col-unscrollable --> | ||
| 107 | |||
| 108 | </div> | ||
| 109 | <!-- // END col-table-row --> | ||
| 110 | |||
| 111 | </div> | ||
| 112 | <!-- // END col-table --> | ||
| 113 | |||
| 114 | </div> | ||
| 115 | <!-- // END col-separator.box --> | ||
| 116 | |||
| 117 | </div> | ||
| 118 | <!-- // END col --> | ||
| 119 | |||
| 120 | </div> | ||
| 121 | <!-- // END row-app --> | ||
| 122 | |||
| 123 | |||
| 124 | |||
| 125 | |||
| 126 | </div> | ||
| 127 | <script> | ||
| 128 | function areportsFun(report) | ||
| 129 | { | ||
| 130 | doAjax('dialer/'+report,'selectedvals='+getarvalval(),'rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | ||
| 131 | } | ||
| 132 | |||
| 133 | |||
| 134 | var arvalvalue="::::::"; | ||
| 135 | function arvalChange(x) | ||
| 136 | { | ||
| 137 | <?php echo "var arr=JSON.parse('".json_encode(Config::get("app.hdfcnodes"))."');"; ?> | ||
| 138 | |||
| 139 | var selectopts=['']; | ||
| 140 | for(i=4;i>x;i--)updateJSSelect("arval"+i,selectopts); | ||
| 141 | |||
| 142 | for (var server in arr) | ||
| 143 | { | ||
| 144 | tvals=arr[server].split(":"); | ||
| 145 | if($("#arval"+x).val()==tvals[x])if(jQuery.inArray(tvals[x+1], selectopts)<0)selectopts[selectopts.length]=tvals[x+1]; | ||
| 146 | } | ||
| 147 | x++;updateJSSelect("arval"+x,selectopts); | ||
| 148 | } | ||
| 149 | function getarvalval() | ||
| 150 | { | ||
| 151 | arvalvalue="";for(i=0;i<5;i++)arvalvalue+=$("#arval"+i).val()+':'; | ||
| 152 | return arvalvalue; | ||
| 153 | } | ||
| 154 | </script> |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
| 1 | <?php | ||
| 2 | use App\Models\CRMCall; | ||
| 3 | use App\Models\User; | ||
| 4 | use App\Jobs\KHRMSLib; | ||
| 5 | use App\Models\SupervisonComments; | ||
| 6 | |||
| 7 | $wakka = new KHRMSLib(); | ||
| 8 | $dashboarduser=Auth::user(); | ||
| 9 | |||
| 10 | if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00"); | ||
| 11 | else $logdate=strtotime(date('Y-m-d')." 00:00:00"); | ||
| 12 | |||
| 13 | if(isset($_GET['logtodate']))$logtodate=strtotime($_GET['logtodate']." 23:59:59"); | ||
| 14 | else $logtodate=strtotime(date('Y-m-d')." 23:59:59"); | ||
| 15 | |||
| 16 | $userarr=array();$i=1; | ||
| 17 | $reporthead=array("id","created_at","updated_at","clientcode","supvisor_id","supvisor_recommends","agent","agent_comments"); | ||
| 18 | |||
| 19 | $reportarray=DB::table('supervisor_comments')->select('*')->where('updated_at','>=',date("Y-m-d H:i:s",$logdate))->where('updated_at','<=',date("Y-m-d H:i:s",$logtodate))->get(); | ||
| 20 | |||
| 21 | if(Input::has("dllogxls")) | ||
| 22 | { | ||
| 23 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 24 | |||
| 25 | $inputFileType = "Excel5"; | ||
| 26 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 27 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | ||
| 28 | $baseRow = 2; | ||
| 29 | |||
| 30 | $highestColumn = sizeof($reporthead); | ||
| 31 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 32 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 33 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $reporthead[$head]); | ||
| 34 | } | ||
| 35 | |||
| 36 | foreach($reportarray as $uid=>$uarr) | ||
| 37 | { | ||
| 38 | $row = $baseRow++; | ||
| 39 | $col = 0; | ||
| 40 | |||
| 41 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 42 | if($reporthead[$head]=="created_at") | ||
| 43 | $uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60); | ||
| 44 | |||
| 45 | if($reporthead[$head]=="updated_at") | ||
| 46 | $uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60); | ||
| 47 | |||
| 48 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 49 | $objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $uarr->$reporthead[$head]); | ||
| 50 | } | ||
| 51 | } | ||
| 52 | |||
| 53 | |||
| 54 | header('Content-Type: application/vnd.ms-excel'); | ||
| 55 | header('Content-Disposition: attachment;filename="CallManagement.xls"'); | ||
| 56 | header('Cache-Control: max-age=0'); | ||
| 57 | |||
| 58 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 59 | $objWriter->save('php://output'); | ||
| 60 | |||
| 61 | return ; | ||
| 62 | } | ||
| 63 | |||
| 64 | ?> | ||
| 65 | |||
| 66 | |||
| 67 | <div class=innerAll> | ||
| 68 | |||
| 69 | |||
| 70 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 71 | <script> | ||
| 72 | $(document).ready(function() | ||
| 73 | { | ||
| 74 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 75 | { | ||
| 76 | $('#dialoglog').dialog({ | ||
| 77 | autoOpen: false, | ||
| 78 | width: '70%', | ||
| 79 | buttons: { | ||
| 80 | "Ok": function() { | ||
| 81 | $(this).dialog("close"); | ||
| 82 | }, | ||
| 83 | "Cancel": function() { | ||
| 84 | $(this).dialog("close"); | ||
| 85 | } | ||
| 86 | } | ||
| 87 | }); | ||
| 88 | } | ||
| 89 | |||
| 90 | waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"2000"); | ||
| 91 | $('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 92 | |||
| 93 | $('#modto').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 94 | }); | ||
| 95 | </script> | ||
| 96 | <div style="float:left;width:50%"> | ||
| 97 | |||
| 98 | From : <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' /> | ||
| 99 | To : <input size=10 id='modto' name='modto' type='text' value='<?php echo date("Y-m-d",$logtodate); ?>' /> | ||
| 100 | |||
| 101 | </div> | ||
| 102 | <div style="float:right;width:50%"> | ||
| 103 | |||
| 104 | |||
| 105 | <button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button> | ||
| 106 | |||
| 107 | </div> | ||
| 108 | <div style="clear:both"></div> | ||
| 109 | <hr> | ||
| 110 | |||
| 111 | <div class=col-md-12> | ||
| 112 | |||
| 113 | |||
| 114 | <div id=userlogschart1 style='min-height:300px;width:100%'></div> | ||
| 115 | </div> | ||
| 116 | |||
| 117 | <script> | ||
| 118 | function dlAgentlogXls() | ||
| 119 | { | ||
| 120 | window.open('dialer/callmanagement?dllogxls=1&logdate='+$("#modfrom").val()+'&logtodate='+$("#modto").val());return false; | ||
| 121 | } | ||
| 122 | </script> | ||
| 123 | |||
| 124 | <div style='clear:both'></div> | ||
| 125 | |||
| 126 | <div class=col-md-12> | ||
| 127 | |||
| 128 | |||
| 129 | <div id=userlogschart2 style='min-height:300px;width:100%'></div> | ||
| 130 | |||
| 131 | </div> | ||
| 132 | |||
| 133 | |||
| 134 | |||
| 135 | <div style='clear:both'></div> | ||
| 136 | |||
| 137 | <div style='overflow:auto'> | ||
| 138 | <table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'> | ||
| 139 | <thead> | ||
| 140 | <?php /*echo $outhead;*/ ?> | ||
| 141 | </thead> | ||
| 142 | <?php /*echo $outstr;*/ ?> | ||
| 143 | </table> | ||
| 144 | </div> | ||
| 145 | |||
| 146 | <div id=dialoglog></div> | ||
| 147 | |||
| 148 | |||
| 149 | |||
| 150 | |||
| 151 | |||
| 152 | </div> |
This diff is collapsed.
Click to expand it.
| 1 | <div class="layout-app"><!-- row-app --> | ||
| 2 | <div class="row row-app"> | ||
| 3 | |||
| 4 | <!-- col --> | ||
| 5 | <div class="col-md-2 col-sm-3"> | ||
| 6 | |||
| 7 | <!-- col-separator --> | ||
| 8 | <div class="col-separator col-separator-first box col-unscrollable"> | ||
| 9 | |||
| 10 | <!-- col-table --> | ||
| 11 | <div class="col-table" style='padding-left: 13px;padding-right: 13px;'> | ||
| 12 | |||
| 13 | <h4 class="innerAll margin-none border-bottom" style='background: #fff;'>Campaign Admin</h4> | ||
| 14 | |||
| 15 | <!-- col-table-row --> | ||
| 16 | <div class="col-table-row"> | ||
| 17 | |||
| 18 | <!-- col-app --> | ||
| 19 | <div class="col-app col-unscrollable"> | ||
| 20 | |||
| 21 | <!-- col-app --> | ||
| 22 | <div class="col-app"> | ||
| 23 | |||
| 24 | <ul class="list-group list-group-1 margin-none borders-none" style='padding-right: 26px;'> | ||
| 25 | |||
| 26 | <li class="list-group-item"> | ||
| 27 | <a href="#" onclick="doAjax('dialer/camplist','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> List Campaigns</a> | ||
| 28 | </li> | ||
| 29 | <li class="list-group-item"> | ||
| 30 | <a href="#" onclick="doAjax('dialer/campchurn','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Churn Rules</a> | ||
| 31 | </li> | ||
| 32 | |||
| 33 | <?php if(Auth::user()->moduleACL("Dialer",true,true,true)){ ?> | ||
| 34 | |||
| 35 | <?php } ?> | ||
| 36 | |||
| 37 | |||
| 38 | </ul> | ||
| 39 | |||
| 40 | |||
| 41 | </div> | ||
| 42 | <!-- // END col-app --> | ||
| 43 | |||
| 44 | </div> | ||
| 45 | <!-- // END col-app --> | ||
| 46 | |||
| 47 | </div> | ||
| 48 | <!-- // END col-table-row --> | ||
| 49 | |||
| 50 | </div> | ||
| 51 | <!-- // END col-table --> | ||
| 52 | |||
| 53 | </div> | ||
| 54 | <!-- // END col-separator.box --> | ||
| 55 | |||
| 56 | </div> | ||
| 57 | <!-- // END col --> | ||
| 58 | |||
| 59 | <!-- col --> | ||
| 60 | <div class="col-md-10 col-sm-9" style='border-right:13px solid #eaeaea'> | ||
| 61 | |||
| 62 | <!-- col-separator.box --> | ||
| 63 | <div class="col-separator col-unscrollable box"> | ||
| 64 | |||
| 65 | <!-- col-table --> | ||
| 66 | <div class="col-table"> | ||
| 67 | |||
| 68 | <!-- <h4 class="innerAll margin-none border-bottom">My Sessions</h4> --> | ||
| 69 | |||
| 70 | <!-- col-table-row --> | ||
| 71 | <div class="col-table-row" style='background: #fff;'> | ||
| 72 | |||
| 73 | <!-- col-app --> | ||
| 74 | <div class="col-app col-unscrollable"> | ||
| 75 | |||
| 76 | <!-- col-app --> | ||
| 77 | <div class="col-app" style='position:relative'> | ||
| 78 | |||
| 79 | <div class="" id=rightmainreportdiv> | ||
| 80 | <script> | ||
| 81 | //doAjax('dialer/campaign_list','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | ||
| 82 | </script> | ||
| 83 | </div> | ||
| 84 | |||
| 85 | </div> | ||
| 86 | <!-- // END col-app --> | ||
| 87 | |||
| 88 | </div> | ||
| 89 | <!-- // END col-app.col-unscrollable --> | ||
| 90 | |||
| 91 | </div> | ||
| 92 | <!-- // END col-table-row --> | ||
| 93 | |||
| 94 | </div> | ||
| 95 | <!-- // END col-table --> | ||
| 96 | |||
| 97 | </div> | ||
| 98 | <!-- // END col-separator.box --> | ||
| 99 | |||
| 100 | </div> | ||
| 101 | <!-- // END col --> | ||
| 102 | |||
| 103 | </div> | ||
| 104 | <!-- // END row-app --> | ||
| 105 | |||
| 106 | |||
| 107 | |||
| 108 | |||
| 109 | </div> |
This diff is collapsed.
Click to expand it.
| 1 | <?php | ||
| 2 | use App\Models\CRMCall; | ||
| 3 | use App\Models\User; | ||
| 4 | use App\Jobs\KHRMSLib; | ||
| 5 | use App\Models\SupervisonComments; | ||
| 6 | |||
| 7 | $wakka = new KHRMSLib(); | ||
| 8 | $dashboarduser=Auth::user(); | ||
| 9 | |||
| 10 | if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00"); | ||
| 11 | else $logdate=strtotime(date('Y-m-d')." 00:00:00"); | ||
| 12 | |||
| 13 | if(isset($_GET['logtodate']))$logtodate=strtotime($_GET['logtodate']." 23:59:59"); | ||
| 14 | else $logtodate=strtotime(date('Y-m-d')." 23:59:59"); | ||
| 15 | |||
| 16 | $userarr=array();$i=1; | ||
| 17 | $reporthead=array("id","upload_date","call_id","cust_band","cust_type","source_of_info","service_type","priority","category","sub_category","resolving_branch","cust_city","acknowledge","resolve_class_unit","complainant_name","existing_customer","cust_id","shadow_cust_id","casa_number","docket_number","cust_mobile","contact_number","email","case_reference","logging_branch_name","logging_class_unit","nature_of_complaint","detailed_suggestion","additional_info","cust_name_on_card","card_number","aan","logging_branch_code","resolving_branch_code","status"); | ||
| 18 | |||
| 19 | $reportarray=DB::table('complaint_details')->select('*')->where('upload_date','>=',date("Y-m-d H:i:s",$logdate))->where('upload_date','<=',date("Y-m-d H:i:s",$logtodate))->get(); | ||
| 20 | |||
| 21 | |||
| 22 | //Child Case | ||
| 23 | if(isset($_GET['clogdate']))$clogdate=strtotime($_GET['clogdate']." 00:00:00"); | ||
| 24 | else $clogdate=strtotime(date('Y-m-d')." 00:00:00"); | ||
| 25 | |||
| 26 | if(isset($_GET['clogtodate']))$clogtodate=strtotime($_GET['clogtodate']." 23:59:59"); | ||
| 27 | else $clogtodate=strtotime(date('Y-m-d')." 23:59:59"); | ||
| 28 | |||
| 29 | $cuserarr=array();$i=1; | ||
| 30 | $creporthead=array("id","upload_date","complaint_id","cust_type","service_type","priority","category","sub_category","resolving_branch","resolve_class_unit","complainant_name","comments","task_desc","additional_info","status"); | ||
| 31 | |||
| 32 | $creportarray=DB::table('comp_child_details')->select('*')->where('upload_date','>=',date("Y-m-d H:i:s",$clogdate))->where('upload_date','<=',date("Y-m-d H:i:s",$clogtodate))->get(); | ||
| 33 | |||
| 34 | if(Input::has("dllogxls")) | ||
| 35 | { | ||
| 36 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 37 | |||
| 38 | $inputFileType = "Excel5"; | ||
| 39 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 40 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | ||
| 41 | $baseRow = 2; | ||
| 42 | |||
| 43 | $highestColumn = sizeof($reporthead); | ||
| 44 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 45 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 46 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $reporthead[$head]); | ||
| 47 | } | ||
| 48 | |||
| 49 | foreach($reportarray as $uid=>$uarr) | ||
| 50 | { | ||
| 51 | $row = $baseRow++; | ||
| 52 | $col = 0; | ||
| 53 | |||
| 54 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 55 | if($reporthead[$head]=="upload_date") | ||
| 56 | $uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60); | ||
| 57 | |||
| 58 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 59 | $objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $uarr->$reporthead[$head]); | ||
| 60 | } | ||
| 61 | } | ||
| 62 | |||
| 63 | |||
| 64 | header('Content-Type: application/vnd.ms-excel'); | ||
| 65 | header('Content-Disposition: attachment;filename="Complaint.xls"'); | ||
| 66 | header('Cache-Control: max-age=0'); | ||
| 67 | |||
| 68 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 69 | $objWriter->save('php://output'); | ||
| 70 | |||
| 71 | return ; | ||
| 72 | } | ||
| 73 | |||
| 74 | if(Input::has("cdllogxls")) | ||
| 75 | { | ||
| 76 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 77 | |||
| 78 | $inputFileType = "Excel5"; | ||
| 79 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 80 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | ||
| 81 | $baseRow = 2; | ||
| 82 | |||
| 83 | $highestColumn = sizeof($creporthead); | ||
| 84 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 85 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 86 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $creporthead[$head]); | ||
| 87 | } | ||
| 88 | |||
| 89 | foreach($creportarray as $uid=>$uarr) | ||
| 90 | { | ||
| 91 | $row = $baseRow++; | ||
| 92 | $col = 0; | ||
| 93 | |||
| 94 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 95 | if($creporthead[$head]=="upload_date") | ||
| 96 | $uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$creporthead[$head])+330*60); | ||
| 97 | |||
| 98 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 99 | $objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $uarr->$creporthead[$head]); | ||
| 100 | } | ||
| 101 | } | ||
| 102 | |||
| 103 | |||
| 104 | header('Content-Type: application/vnd.ms-excel'); | ||
| 105 | header('Content-Disposition: attachment;filename="Childcase.xls"'); | ||
| 106 | header('Cache-Control: max-age=0'); | ||
| 107 | |||
| 108 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 109 | $objWriter->save('php://output'); | ||
| 110 | |||
| 111 | return ; | ||
| 112 | } | ||
| 113 | |||
| 114 | ?> | ||
| 115 | |||
| 116 | |||
| 117 | <div class=innerAll> | ||
| 118 | |||
| 119 | |||
| 120 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 121 | <script> | ||
| 122 | $(document).ready(function() | ||
| 123 | { | ||
| 124 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 125 | { | ||
| 126 | $('#dialoglog').dialog({ | ||
| 127 | autoOpen: false, | ||
| 128 | width: '70%', | ||
| 129 | buttons: { | ||
| 130 | "Ok": function() { | ||
| 131 | $(this).dialog("close"); | ||
| 132 | }, | ||
| 133 | "Cancel": function() { | ||
| 134 | $(this).dialog("close"); | ||
| 135 | } | ||
| 136 | } | ||
| 137 | }); | ||
| 138 | } | ||
| 139 | |||
| 140 | waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"2000"); | ||
| 141 | $('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 142 | |||
| 143 | $('#modto').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 144 | |||
| 145 | $('#cmodfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 146 | |||
| 147 | $('#cmodto').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 148 | }); | ||
| 149 | </script> | ||
| 150 | <div style="float:left;width:50%"> | ||
| 151 | |||
| 152 | From : <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' /> | ||
| 153 | To : <input size=10 id='modto' name='modto' type='text' value='<?php echo date("Y-m-d",$logtodate); ?>' /> | ||
| 154 | |||
| 155 | </div> | ||
| 156 | <div style="float:right;width:50%"> | ||
| 157 | |||
| 158 | |||
| 159 | <button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button> | ||
| 160 | |||
| 161 | </div> | ||
| 162 | <div style="clear:both"></div> | ||
| 163 | <hr> | ||
| 164 | |||
| 165 | <br> | ||
| 166 | <!-- | ||
| 167 | <div style="float:left;width:50%"> | ||
| 168 | <label>Child Case:</label> | ||
| 169 | From : <input size=10 id='cmodfrom' name='cmodfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' /> | ||
| 170 | To : <input size=10 id='cmodto' name='cmodto' type='text' value='<?php echo date("Y-m-d",$logtodate); ?>' /> | ||
| 171 | |||
| 172 | </div> | ||
| 173 | <div style="float:right;width:50%"> | ||
| 174 | |||
| 175 | |||
| 176 | <button class="pull-right btn btn-sm btn-ino" onclick='cdlAgentlogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button> | ||
| 177 | |||
| 178 | </div>--!> | ||
| 179 | <div style="clear:both"></div> | ||
| 180 | <hr> | ||
| 181 | |||
| 182 | <div class=col-md-12> | ||
| 183 | |||
| 184 | |||
| 185 | <div id=userlogschart1 style='min-height:300px;width:100%'></div> | ||
| 186 | </div> | ||
| 187 | |||
| 188 | <script> | ||
| 189 | function dlAgentlogXls() | ||
| 190 | { | ||
| 191 | window.open('dialer/complaintreport?dllogxls=1&logdate='+$("#modfrom").val()+'&logtodate='+$("#modto").val());return false; | ||
| 192 | } | ||
| 193 | function cdlAgentlogXls() | ||
| 194 | { | ||
| 195 | window.open('dialer/complaintreport?cdllogxls=1&clogdate='+$("#cmodfrom").val()+'&clogtodate='+$("#cmodto").val());return false; | ||
| 196 | } | ||
| 197 | </script> | ||
| 198 | |||
| 199 | <div style='clear:both'></div> | ||
| 200 | |||
| 201 | <div class=col-md-12> | ||
| 202 | |||
| 203 | |||
| 204 | <div id=userlogschart2 style='min-height:300px;width:100%'></div> | ||
| 205 | |||
| 206 | </div> | ||
| 207 | |||
| 208 | |||
| 209 | |||
| 210 | <div style='clear:both'></div> | ||
| 211 | |||
| 212 | <div style='overflow:auto'> | ||
| 213 | <table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'> | ||
| 214 | <thead> | ||
| 215 | <?php /*echo $outhead;*/ ?> | ||
| 216 | </thead> | ||
| 217 | <?php /*echo $outstr;*/ ?> | ||
| 218 | </table> | ||
| 219 | </div> | ||
| 220 | |||
| 221 | <div id=dialoglog></div> | ||
| 222 | |||
| 223 | |||
| 224 | |||
| 225 | |||
| 226 | |||
| 227 | </div> |
| 1 | <?php | ||
| 2 | $dashboarduser=Auth::user(); | ||
| 3 | $timeoffset=$dashboarduser->timezone*60; | ||
| 4 | ?> | ||
| 5 | <div class="container-fluid"> | ||
| 6 | <div class="layout-app"> | ||
| 7 | <div class="row"> | ||
| 8 | <div class="col-md-12"> | ||
| 9 | <div class="col-separator col-separator-first col-unscrollable box"> | ||
| 10 | <div class="innerAll"> | ||
| 11 | <h4>Follow up <?php if(!empty($client)) echo ": ".$client; ?></h4> | ||
| 12 | <hr style="margin-bottom: 10px;" /> | ||
| 13 | |||
| 14 | <table class='table' | ||
| 15 | <thead> | ||
| 16 | <tr> | ||
| 17 | <th></th> | ||
| 18 | <th></th> | ||
| 19 | <?php if(empty($client)) echo "<th>Campaign</th>" ?> | ||
| 20 | <th>Cust_ID</th> | ||
| 21 | <th>Name</th> | ||
| 22 | <th>Number</th> | ||
| 23 | <!-- <th>Type</th>--> | ||
| 24 | <th>LastCall</th> | ||
| 25 | <!-- <th>Disposition</th> ---> | ||
| 26 | <th>NextFollowup</th> | ||
| 27 | <!--- <th>Status</th> ---> | ||
| 28 | |||
| 29 | <!-- <th>Count</th> --> | ||
| 30 | <!--<th></th>--> | ||
| 31 | <!-- <th>DID</th> --> | ||
| 32 | </tr> | ||
| 33 | </thead> | ||
| 34 | <tbody> | ||
| 35 | <?php | ||
| 36 | if($count > 0){ | ||
| 37 | foreach ($calllog as $key => $value) { //echo "<pre>";print_r($value);exit;?> | ||
| 38 | <tr> | ||
| 39 | <td></td> | ||
| 40 | <td></td> | ||
| 41 | <?php if(empty($client)) echo "<td>$value->client</td>" ?> | ||
| 42 | <td><?php echo $value->cust_id; ?></td> | ||
| 43 | <td><?php echo $value->customer_name; ?></td> | ||
| 44 | <td><a href=# class='' onclick='dialerQuickOpen("<?php echo $value->id; ?>","<?php echo $value->mobile; ?>","Manual","",0);return false;'><?php echo $value->mobile; ?></a></td> | ||
| 45 | <td><?php echo date("Y-m-d H:i:s",strtotime($value->dialer_lastcall)-$timeoffset); ?></td> | ||
| 46 | <!--<td><?php //echo $value->dialer_status; ?></td>--> | ||
| 47 | <td><?php echo date("Y-m-d H:i:s",strtotime($value->dialer_callback)-$timeoffset); ?></td> | ||
| 48 | <!--<td><?php //echo $value->status; ?></td>--> | ||
| 49 | </tr> | ||
| 50 | <?php } | ||
| 51 | }else{ ?> | ||
| 52 | <td colspan="9" align="center">No Record Available</td> | ||
| 53 | <?php } ?> | ||
| 54 | </table> | ||
| 55 | |||
| 56 | <div id="campaignDetailsArea"></div> | ||
| 57 | </div> | ||
| 58 | </div> | ||
| 59 | </div> | ||
| 60 | </div> | ||
| 61 | |||
| 62 | </div> | ||
| 63 | </div> |
This diff is collapsed.
Click to expand it.
| 1 | <?php | ||
| 2 | use App\Models\CRMCall; | ||
| 3 | use App\Models\User; | ||
| 4 | use App\Jobs\KHRMSLib; | ||
| 5 | |||
| 6 | $wakka = new KHRMSLib(); | ||
| 7 | $dashboarduser=Auth::user(); | ||
| 8 | |||
| 9 | if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00"); | ||
| 10 | else $logdate=strtotime(date('Y-m-d')." 00:00:00"); | ||
| 11 | |||
| 12 | if(isset($_GET['logtodate']))$logtodate=strtotime($_GET['logtodate']." 23:59:59"); | ||
| 13 | else $logtodate=strtotime(date('Y-m-d')." 23:59:59"); | ||
| 14 | |||
| 15 | $alist=CRMCall::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60)); | ||
| 16 | |||
| 17 | //if(!$dashboarduser->moduleACL("Dialer",false,false,true)) | ||
| 18 | if($dashboarduser->usertype != 'Admin') | ||
| 19 | { | ||
| 20 | $uidlist=array($dashboarduser->id); | ||
| 21 | $allusers=User::where(function ($query) use($dashboarduser) { | ||
| 22 | $query->where('supervisor','=',$dashboarduser->username) | ||
| 23 | ->orWhere('lteam2','=',$dashboarduser->username) | ||
| 24 | ->orWhere('lteam','=',$dashboarduser->username); | ||
| 25 | })->get(); | ||
| 26 | // ->where(function ($query) { | ||
| 27 | // $query->where('status', '=', 'Active'); | ||
| 28 | // })->get(); | ||
| 29 | |||
| 30 | foreach($allusers as $tuser)$uidlist[]=$tuser->id; | ||
| 31 | |||
| 32 | |||
| 33 | $roclientstr=array();$didlinesstr=array(); | ||
| 34 | if($dashboarduser->exten!="")$didlinesstr[]=$dashboarduser->exten; | ||
| 35 | $oclientlst=$wakka->clientsReadAccess(); | ||
| 36 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="") | ||
| 37 | { | ||
| 38 | $roclientstr[]="$tclnt"; | ||
| 39 | |||
| 40 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 41 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 42 | } | ||
| 43 | |||
| 44 | $alist=$alist->where(function ($query) use($roclientstr,$uidlist,$didlinesstr){ | ||
| 45 | $query->orWhereIn('client',$roclientstr) | ||
| 46 | ->orWhereIn('user_id',$uidlist) | ||
| 47 | ->orWhereIn('did',$didlinesstr); | ||
| 48 | }); | ||
| 49 | |||
| 50 | } | ||
| 51 | |||
| 52 | $alist=$alist->get(); | ||
| 53 | |||
| 54 | $userarr=array();$i=1; | ||
| 55 | $reporthead=array("id","created_at","updated_at","user_id","cust_id","call_id","name","number","question_time","question","primary_question","primary_response","primary_text","followup1_question","followup1_response","followup1_text","followup2_question","followup2_response","followup2_text","followup3_question","followup3_response","followup3_text","followup4_question","followup4_response","followup4_text","followup5_question","followup5_response","followup5_text","followup6_question","followup6_response","followup6_text","followup7_question","followup7_response","followup7_text"); | ||
| 56 | //$reportarray=DB::table('questionaire_details')->select('*')->get(); | ||
| 57 | |||
| 58 | $reportarray=DB::table('questionaire_details')->select('*')->where('updated_at','>=',date("Y-m-d H:i:s",$logdate))->where('updated_at','<=',date("Y-m-d H:i:s",$logtodate))->get(); | ||
| 59 | |||
| 60 | |||
| 61 | if(Input::has("dllogxls")) | ||
| 62 | { | ||
| 63 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 64 | |||
| 65 | $inputFileType = "Excel5"; | ||
| 66 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 67 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | ||
| 68 | $baseRow = 2; | ||
| 69 | |||
| 70 | |||
| 71 | $highestColumn = sizeof($reporthead); | ||
| 72 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 73 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 74 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $reporthead[$head]); | ||
| 75 | } | ||
| 76 | |||
| 77 | foreach($reportarray as $uid=>$uarr) | ||
| 78 | { | ||
| 79 | $row = $baseRow++; | ||
| 80 | $col = 0; | ||
| 81 | |||
| 82 | if($urr->auth_question!='') | ||
| 83 | { | ||
| 84 | $urr->auth_question = (array)json_decode($urr->auth_question); | ||
| 85 | } | ||
| 86 | |||
| 87 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 88 | |||
| 89 | if($reporthead[$head]=="created_at") | ||
| 90 | $uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60); | ||
| 91 | |||
| 92 | if($reporthead[$head]=="updated_at") | ||
| 93 | $uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60); | ||
| 94 | |||
| 95 | if($reporthead[$head]=="question_time") | ||
| 96 | $uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60); | ||
| 97 | |||
| 98 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 99 | $objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $uarr->$reporthead[$head]); | ||
| 100 | } | ||
| 101 | } | ||
| 102 | |||
| 103 | |||
| 104 | header('Content-Type: application/vnd.ms-excel'); | ||
| 105 | header('Content-Disposition: attachment;filename="QAireLog.xls"'); | ||
| 106 | header('Cache-Control: max-age=0'); | ||
| 107 | |||
| 108 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 109 | $objWriter->save('php://output'); | ||
| 110 | |||
| 111 | return ; | ||
| 112 | } | ||
| 113 | |||
| 114 | ?> | ||
| 115 | |||
| 116 | |||
| 117 | <div class=innerAll> | ||
| 118 | |||
| 119 | |||
| 120 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 121 | <script> | ||
| 122 | $(document).ready(function() | ||
| 123 | { | ||
| 124 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 125 | { | ||
| 126 | $('#dialoglog').dialog({ | ||
| 127 | autoOpen: false, | ||
| 128 | width: '70%', | ||
| 129 | buttons: { | ||
| 130 | "Ok": function() { | ||
| 131 | $(this).dialog("close"); | ||
| 132 | }, | ||
| 133 | "Cancel": function() { | ||
| 134 | $(this).dialog("close"); | ||
| 135 | } | ||
| 136 | } | ||
| 137 | }); | ||
| 138 | } | ||
| 139 | |||
| 140 | waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"2000"); | ||
| 141 | $('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 142 | |||
| 143 | $('#modto').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 144 | }); | ||
| 145 | </script> | ||
| 146 | <div style="float:left;width:50%"> | ||
| 147 | |||
| 148 | From : <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' /> | ||
| 149 | To : <input size=10 id='modto' name='modto' type='text' value='<?php echo date("Y-m-d",$logtodate); ?>' /> | ||
| 150 | |||
| 151 | </div> | ||
| 152 | <div style="float:right;width:50%"> | ||
| 153 | |||
| 154 | |||
| 155 | <button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button> | ||
| 156 | |||
| 157 | </div> | ||
| 158 | <div style="clear:both"></div> | ||
| 159 | <hr> | ||
| 160 | |||
| 161 | <div class=col-md-12> | ||
| 162 | |||
| 163 | |||
| 164 | <div id=userlogschart1 style='min-height:300px;width:100%'></div> | ||
| 165 | </div> | ||
| 166 | |||
| 167 | <script> | ||
| 168 | function dlAgentlogXls() | ||
| 169 | { | ||
| 170 | //window.open('dialer/questionnaire?dllogxls=1&logdate='+$("#modfrom").val());return false; | ||
| 171 | |||
| 172 | window.open('dialer/questionnaire?dllogxls=1&logdate='+$("#modfrom").val()+'&logtodate='+$("#modto").val());return false; | ||
| 173 | } | ||
| 174 | </script> | ||
| 175 | |||
| 176 | <div style='clear:both'></div> | ||
| 177 | |||
| 178 | <div class=col-md-12> | ||
| 179 | |||
| 180 | |||
| 181 | <div id=userlogschart2 style='min-height:300px;width:100%'></div> | ||
| 182 | |||
| 183 | </div> | ||
| 184 | |||
| 185 | |||
| 186 | |||
| 187 | <div style='clear:both'></div> | ||
| 188 | |||
| 189 | <div style='overflow:auto'> | ||
| 190 | <table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'> | ||
| 191 | <thead> | ||
| 192 | <?php /*echo $outhead;*/ ?> | ||
| 193 | </thead> | ||
| 194 | <?php /*echo $outstr;*/ ?> | ||
| 195 | </table> | ||
| 196 | </div> | ||
| 197 | |||
| 198 | <div id=dialoglog></div> | ||
| 199 | |||
| 200 | |||
| 201 | |||
| 202 | |||
| 203 | |||
| 204 | </div> |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
| 1 | <?php | ||
| 2 | use App\Models\CRMCallArchive; | ||
| 3 | use App\Models\CRMCall; | ||
| 4 | use App\Models\User; | ||
| 5 | use App\Jobs\KHRMSLib; | ||
| 6 | |||
| 7 | $wakka = new KHRMSLib(); | ||
| 8 | $dashboarduser=Auth::user(); | ||
| 9 | |||
| 10 | |||
| 11 | if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00"); | ||
| 12 | else $logdate=strtotime(date('Y-m-d')." 00:00:00"); | ||
| 13 | |||
| 14 | $prevlogdate = strtotime(date('Y-m-d', strtotime('-7 day'))); | ||
| 15 | |||
| 16 | $i=0; | ||
| 17 | if($logdate < $prevlogdate) | ||
| 18 | { | ||
| 19 | $alist=CRMCallArchive::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60))->where('type','!=','Inbound'); | ||
| 20 | |||
| 21 | } | ||
| 22 | else | ||
| 23 | { | ||
| 24 | $alist=CRMCall::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60))->where('type','!=','Inbound'); | ||
| 25 | } | ||
| 26 | |||
| 27 | |||
| 28 | if($dashboarduser->usertype != 'Admin') | ||
| 29 | { | ||
| 30 | $uidlist=array($dashboarduser->id); | ||
| 31 | $allusers=User::where(function ($query) use($dashboarduser) { | ||
| 32 | $query->where('supervisor','=',$dashboarduser->username) | ||
| 33 | ->orWhere('lteam2','=',$dashboarduser->username) | ||
| 34 | ->orWhere('lteam','=',$dashboarduser->username); | ||
| 35 | })->get(); | ||
| 36 | |||
| 37 | foreach($allusers as $tuser)$uidlist[]=$tuser->id; | ||
| 38 | |||
| 39 | |||
| 40 | $roclientstr=array();$didlinesstr=array(); | ||
| 41 | if($dashboarduser->exten!="")$didlinesstr[]=$dashboarduser->exten; | ||
| 42 | $oclientlst=$wakka->clientsReadAccess(); | ||
| 43 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="") | ||
| 44 | { | ||
| 45 | $roclientstr[]="$tclnt"; | ||
| 46 | |||
| 47 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 48 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 49 | } | ||
| 50 | |||
| 51 | $alist=$alist->where(function ($query) use($roclientstr,$uidlist,$didlinesstr){ | ||
| 52 | $query//->orWhereIn('client',$roclientstr) | ||
| 53 | ->orWhereIn('user_id',$uidlist) | ||
| 54 | ->orWhereIn('did',$didlinesstr); | ||
| 55 | }); | ||
| 56 | |||
| 57 | } | ||
| 58 | |||
| 59 | if(Input::get('sort')=='cpu')$alist=$alist->orderBy("callSec","DESC"); | ||
| 60 | else $alist=$alist->orderBy("id","DESC"); | ||
| 61 | $alist=$alist->get(); | ||
| 62 | /* | ||
| 63 | |||
| 64 | |||
| 65 | $userarr=array(); | ||
| 66 | $i=sizeof($alist);if(!empty($_GET['sort']))$i=1; | ||
| 67 | $totaltime=0;$ttlovr10=0;$ttlovr5=0;$ttlovr1=0;$ttlovr0=0;$outstr="";$usrcnt=0; | ||
| 68 | $totaltimeIn=0;$ttlovr10In=0;$ttlovr5In=0;$ttlovr1In=0;$ttlovr0In=0;$usrcntIn=0; | ||
| 69 | $actionarr=array();$actionarrIn=array(); | ||
| 70 | |||
| 71 | |||
| 72 | */ | ||
| 73 | $callarraid=''; | ||
| 74 | $crm_id=''; | ||
| 75 | foreach($alist as $aline) | ||
| 76 | { | ||
| 77 | if($aline->crm_id>0)$crm_id.=$aline->crm_id.","; | ||
| 78 | } | ||
| 79 | $crm_id=substr($crm_id,0,-1); | ||
| 80 | $crm_id=explode(",", $crm_id); | ||
| 81 | $clientcodearr=DB::table('records')->select('clientcode','id','currentstatus','legalstatus')->whereIn('id',$crm_id)->get(); | ||
| 82 | foreach ($clientcodearr as $clientid) | ||
| 83 | { | ||
| 84 | $clientcodeval[$clientid->id]=$clientid->clientcode; | ||
| 85 | } | ||
| 86 | |||
| 87 | if(Input::has("dllogxls")) | ||
| 88 | { | ||
| 89 | |||
| 90 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 91 | |||
| 92 | |||
| 93 | $inputFileType = "Excel5"; | ||
| 94 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 95 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | ||
| 96 | $baseRow = 3; | ||
| 97 | |||
| 98 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 99 | $fieldsarr[$tcol++]='#'; | ||
| 100 | $fieldsarr[$tcol++]='Date'; | ||
| 101 | $fieldsarr[$tcol++]='User_id'; | ||
| 102 | $fieldsarr[$tcol++]='Disposition'; | ||
| 103 | $fieldsarr[$tcol++]='ClientCode'; | ||
| 104 | $fieldsarr[$tcol++]='Services'; | ||
| 105 | |||
| 106 | |||
| 107 | $highestColumn = sizeof($fieldsarr); | ||
| 108 | for ($head = 0; $head < $highestColumn; $head++) | ||
| 109 | { | ||
| 110 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 111 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $fieldsarr[$head]); | ||
| 112 | } | ||
| 113 | |||
| 114 | $ii=1; | ||
| 115 | foreach($alist as $aline) | ||
| 116 | { | ||
| 117 | //$row = $baseRow++; | ||
| 118 | $col = 0; | ||
| 119 | |||
| 120 | |||
| 121 | $clientcode=""; | ||
| 122 | $tpostdata=json_decode($aline->data,true); | ||
| 123 | $fulldate=date("Y-m-d H:i:s",strtotime($aline->created_at)-($dashboarduser->timezone*60)); | ||
| 124 | if(!isset($userarr[$aline->user_id])&&$aline->user_id>0)$userarr[$aline->user_id]=User::find($aline->user_id); | ||
| 125 | $dispname="";if(isset($userarr[$aline->user_id]))$dispname=$userarr[$aline->user_id]->dispname(); | ||
| 126 | $username="";if(isset($userarr[$aline->user_id]))$username=$userarr[$aline->user_id]->username; | ||
| 127 | |||
| 128 | $val=''; | ||
| 129 | |||
| 130 | $userdata=json_decode($aline->userdata,true); | ||
| 131 | //echo "<pre>".print_r($userdata)."<br>"; | ||
| 132 | if(!empty($userdata)) | ||
| 133 | { | ||
| 134 | foreach ($userdata as $key=>$val) | ||
| 135 | { | ||
| 136 | |||
| 137 | if($val!="") | ||
| 138 | { | ||
| 139 | $row = $baseRow++; | ||
| 140 | $col=0; | ||
| 141 | $clientcode=""; | ||
| 142 | if($aline->crm_id>0) | ||
| 143 | { | ||
| 144 | //$user=$wakka->getPerson($aline->crm_id); | ||
| 145 | //$clientcode=$user["peopledata"]["clientcode"]; | ||
| 146 | $clientcode=$clientcodeval[$aline->crm_id]; | ||
| 147 | } | ||
| 148 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($ii++); | ||
| 149 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($fulldate); | ||
| 150 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($username); | ||
| 151 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($aline->userstatus); | ||
| 152 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($clientcode); | ||
| 153 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($val); | ||
| 154 | } | ||
| 155 | |||
| 156 | } | ||
| 157 | } | ||
| 158 | |||
| 159 | } | ||
| 160 | |||
| 161 | |||
| 162 | header('Content-Type: application/vnd.ms-excel'); | ||
| 163 | header('Content-Disposition: attachment;filename="Relationship.xls"'); | ||
| 164 | header('Cache-Control: max-age=0'); | ||
| 165 | |||
| 166 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 167 | $objWriter->save('php://output'); | ||
| 168 | |||
| 169 | return ; | ||
| 170 | } | ||
| 171 | |||
| 172 | |||
| 173 | |||
| 174 | foreach($alist as $aline) | ||
| 175 | { | ||
| 176 | $clientcode=""; | ||
| 177 | $userdata=json_decode($aline->userdata,true); | ||
| 178 | |||
| 179 | |||
| 180 | if($aline->crm_id>0) | ||
| 181 | { | ||
| 182 | //$user=$wakka->getPerson($aline->crm_id); | ||
| 183 | //$clientcode=$user["peopledata"]["clientcode"]; | ||
| 184 | $clientcode=$clientcodeval[$aline->crm_id]; | ||
| 185 | } | ||
| 186 | $tpostdata=json_decode($aline->data,true); | ||
| 187 | $fulldate=date("Y-m-d H:i:s",strtotime($aline->created_at)-($dashboarduser->timezone*60)); | ||
| 188 | $talktime=$aline->talkSec+$aline->recstartSec+$aline->recendSec; | ||
| 189 | $length=round(($aline->waitSec+$aline->callSec+$talktime+$aline->dispoSec)/1000,2); | ||
| 190 | |||
| 191 | if(!isset($userarr[$aline->user_id])&&$aline->user_id>0)$userarr[$aline->user_id]=User::find($aline->user_id); | ||
| 192 | $dispname="";if(isset($userarr[$aline->user_id]))$dispname=$userarr[$aline->user_id]->dispname(); | ||
| 193 | $username="";if(isset($userarr[$aline->user_id]))$username=$userarr[$aline->user_id]->username; | ||
| 194 | |||
| 195 | if(!empty($userdata)){ | ||
| 196 | foreach ($userdata as $key=>$val) | ||
| 197 | { | ||
| 198 | if($val!="") | ||
| 199 | { | ||
| 200 | $outstr.="<tr><td>".$i++."</td> | ||
| 201 | <td title='$fulldate'>".explode(" ",$fulldate)[0]."</td> | ||
| 202 | <td>".$username."</td> | ||
| 203 | <td title='".str_replace("'"," ",$aline->userremarks)."'>".$aline->userstatus."</td> | ||
| 204 | <td>$clientcode</td> | ||
| 205 | <td>$val</td> | ||
| 206 | </tr>"; | ||
| 207 | } | ||
| 208 | |||
| 209 | } | ||
| 210 | } | ||
| 211 | /*else | ||
| 212 | { | ||
| 213 | $outstr.="<tr><td>".$i++."</td> | ||
| 214 | <td title='$fulldate'>".explode(" ",$fulldate)[0]."</td> | ||
| 215 | <td>".$username."</td> | ||
| 216 | <td title='".str_replace("'"," ",$aline->userremarks)."'>".$aline->userstatus."</td> | ||
| 217 | <td>$clientcode</td> | ||
| 218 | <td></td> | ||
| 219 | </tr>"; | ||
| 220 | }*/ | ||
| 221 | } | ||
| 222 | ?> | ||
| 223 | |||
| 224 | |||
| 225 | |||
| 226 | <div class=innerAll> | ||
| 227 | |||
| 228 | |||
| 229 | |||
| 230 | |||
| 231 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 232 | <script> | ||
| 233 | function showExtraPost(varstr) | ||
| 234 | { | ||
| 235 | doAjax("hr?action=LiveUsers","getpostdata="+varstr,"dialoglog"); | ||
| 236 | |||
| 237 | $('#dialoglog').dialog('open'); | ||
| 238 | return false; | ||
| 239 | } | ||
| 240 | |||
| 241 | $(document).ready(function() | ||
| 242 | { | ||
| 243 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 244 | { | ||
| 245 | $('#dialoglog').dialog({ | ||
| 246 | autoOpen: false, | ||
| 247 | width: '70%', | ||
| 248 | buttons: { | ||
| 249 | "Ok": function() { | ||
| 250 | $(this).dialog("close"); | ||
| 251 | }, | ||
| 252 | "Cancel": function() { | ||
| 253 | $(this).dialog("close"); | ||
| 254 | } | ||
| 255 | } | ||
| 256 | }); | ||
| 257 | } | ||
| 258 | |||
| 259 | waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"2000"); | ||
| 260 | $('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 261 | }); | ||
| 262 | </script> | ||
| 263 | <div style="float:left;width:50%"> | ||
| 264 | |||
| 265 | Search <input id=filter name="filter" type="text"> | ||
| 266 | Date : <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' onchange='callLogReloadFun("");' /> | ||
| 267 | |||
| 268 | </div> | ||
| 269 | <div style="float:left;width:50%"> | ||
| 270 | |||
| 271 | |||
| 272 | <button class="pull-right btn btn-sm btn-default" onclick='dlCalllogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button> | ||
| 273 | |||
| 274 | </div> | ||
| 275 | <div style="clear:both"></div> | ||
| 276 | <hr> | ||
| 277 | |||
| 278 | <?php | ||
| 279 | /*$categories=array();$avgarr=array();$cntarr=array(); | ||
| 280 | foreach($actionarr as $act=>$actarr) | ||
| 281 | { | ||
| 282 | if($actarr['cnt']>sizeof($alist)/150) | ||
| 283 | { | ||
| 284 | |||
| 285 | $categories[]="'$act'"; | ||
| 286 | $avgarr[]=-round($actarr['time']/$actarr['cnt'],2); | ||
| 287 | $cntarr[]=$actarr['cnt']; | ||
| 288 | } | ||
| 289 | } | ||
| 290 | |||
| 291 | array_multisort($cntarr,$avgarr,$categories); | ||
| 292 | |||
| 293 | |||
| 294 | |||
| 295 | $categoriesIn=array();$avgarrIn=array();$cntarrIn=array(); | ||
| 296 | foreach($actionarrIn as $act=>$actarr) | ||
| 297 | { | ||
| 298 | if($actarr['cnt']>sizeof($alist)/150) | ||
| 299 | { | ||
| 300 | |||
| 301 | $categoriesIn[]="'$act'"; | ||
| 302 | $avgarrIn[]=-round($actarr['time']/$actarr['cnt'],2); | ||
| 303 | $cntarrIn[]=$actarr['cnt']; | ||
| 304 | } | ||
| 305 | } | ||
| 306 | |||
| 307 | array_multisort($cntarrIn,$avgarrIn,$categoriesIn);*/ | ||
| 308 | ?> | ||
| 309 | |||
| 310 | |||
| 311 | |||
| 312 | <div class=col-md-10> | ||
| 313 | |||
| 314 | <script> | ||
| 315 | |||
| 316 | |||
| 317 | function callLogReloadFun(sortby) | ||
| 318 | { | ||
| 319 | var sortstr='';if(sortby!="")sortstr="&sort="+sortby | ||
| 320 | |||
| 321 | doAjax('dialer/relationshipreport?logdate='+$("#modfrom").val()+sortstr,'','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | ||
| 322 | } | ||
| 323 | |||
| 324 | function dlCalllogXls() | ||
| 325 | { | ||
| 326 | window.open('dialer/relationshipreport?dllogxls=1&logdate='+$("#modfrom").val());return false; | ||
| 327 | } | ||
| 328 | </script> | ||
| 329 | |||
| 330 | </div> | ||
| 331 | |||
| 332 | <div style='clear:both'></div> | ||
| 333 | |||
| 334 | <div class=col-md-10> | ||
| 335 | |||
| 336 | <script> | ||
| 337 | |||
| 338 | </script> | ||
| 339 | |||
| 340 | </div> | ||
| 341 | |||
| 342 | <div style='clear:both'></div> | ||
| 343 | |||
| 344 | <div style='overflow:auto'> | ||
| 345 | <table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'> | ||
| 346 | <thead> | ||
| 347 | <tr> | ||
| 348 | <th>#</th> | ||
| 349 | <th>Date</th> | ||
| 350 | <th>User_id</th> | ||
| 351 | <th>Disposition</th> | ||
| 352 | <th>ClientCode</th> | ||
| 353 | <th>Services</th> | ||
| 354 | </tr> | ||
| 355 | </thead> | ||
| 356 | <?php echo $outstr; ?> | ||
| 357 | </table> | ||
| 358 | </div> | ||
| 359 | <?php | ||
| 360 | function convert($size) | ||
| 361 | { | ||
| 362 | $unit=array('b','kb','mb','gb','tb','pb'); | ||
| 363 | return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i]; | ||
| 364 | } | ||
| 365 | |||
| 366 | echo "<br>".convert(memory_get_peak_usage(true)); // 123 kb | ||
| 367 | |||
| 368 | |||
| 369 | ?> | ||
| 370 | <div id=dialoglog></div> | ||
| 371 | |||
| 372 | |||
| 373 | |||
| 374 | |||
| 375 | |||
| 376 | </div> |
| 1 | <?php | ||
| 2 | use App\Models\CRMCall; | ||
| 3 | use App\Models\CRMCallArchive; | ||
| 4 | use App\Models\User; | ||
| 5 | use App\Jobs\KHRMSLib; | ||
| 6 | |||
| 7 | $wakka = new KHRMSLib(); | ||
| 8 | $dashboarduser=Auth::user(); | ||
| 9 | $timeoffset = $dashboarduser->timezone; //-330; //$dashboarduser->timezone;\ | ||
| 10 | //$timeoffset = $timeoffset*60; | ||
| 11 | $timeoffset = 0; | ||
| 12 | |||
| 13 | $logtime =(isset($_GET['logtime'])) ? $_GET['logtime'] :9; | ||
| 14 | $logtimeto =(isset($_GET['logtimeto']))? $_GET['logtimeto']:20; | ||
| 15 | $logdate =(isset($_GET['logdate'])) ? strtotime($_GET['logdate']." ".$logtime.":00:00") | ||
| 16 | : strtotime(date("Y-m-d")." 09:00:00"); | ||
| 17 | $logdateto =(isset($_GET['logdateto']))? strtotime($_GET['logdateto']." ".$logtimeto.":00:00") | ||
| 18 | : strtotime(date("Y-m-d")." 20:00:00"); | ||
| 19 | $campaign =explode('||', (isset($_GET['campaign'])) ? $_GET['campaign'] : "All"); | ||
| 20 | $state =explode('||', (isset($_GET['state'])) ? $_GET['state'] : "All"); | ||
| 21 | $product =explode('||', (isset($_GET['product'])) ? $_GET['product'] : "All"); | ||
| 22 | $bucket =explode('||', (isset($_GET['bucket'])) ? $_GET['bucket'] : "All"); | ||
| 23 | |||
| 24 | $clientlist =$wakka->clientsReadAccess(); $clientlist; $clientlist[0] = 'All'; | ||
| 25 | |||
| 26 | $alist=DB::table('crmcalls_archive AS c')->leftJoin('records', 'c.crm_id', '=', 'records.id')->where('c.user_id','!=',0); | ||
| 27 | $alist=$alist ->where('c.created_at','>=',date("Y-m-d H:i:s",$logdate)) | ||
| 28 | ->where('c.created_at','<=',date("Y-m-d H:i:s",$logdateto)); | ||
| 29 | |||
| 30 | $displayAdv = 'none'; | ||
| 31 | if(!in_array('All', $campaign)) { | ||
| 32 | $displayAdv = 'block'; | ||
| 33 | $alist =$alist->whereIn('c.client',$campaign); | ||
| 34 | } | ||
| 35 | |||
| 36 | $userarr=array(); | ||
| 37 | $allusers = DB::table('users as u1')->leftjoin('users AS u2', 'u2.username', '=', 'u1.supervisor') | ||
| 38 | ->select('u1.id','u1.username','u1.fullname AS telecaller', 'u2.fullname AS sepervisor'); | ||
| 39 | |||
| 40 | if($dashboarduser->usertype != 'Admin') | ||
| 41 | { | ||
| 42 | $uidlist=array($dashboarduser->id); | ||
| 43 | $allusers=$allusers->where(function ($query) use($dashboarduser) { | ||
| 44 | $query->where('u1.supervisor','=',$dashboarduser->username) | ||
| 45 | ->orWhere('u1.lteam2','=',$dashboarduser->username) | ||
| 46 | ->orWhere('u1.lteam','=',$dashboarduser->username); | ||
| 47 | })->get(); | ||
| 48 | |||
| 49 | foreach($allusers as $tuser) | ||
| 50 | { | ||
| 51 | $uidlist[]=$tuser->id; | ||
| 52 | $userarr[$tuser->id] = $tuser; | ||
| 53 | } | ||
| 54 | $alist=$alist->whereIn('c.user_id',$uidlist); | ||
| 55 | |||
| 56 | /*$roclientstr=array();$didlinesstr=array(); | ||
| 57 | if($dashboarduser->exten!="")$didlinesstr[]=$dashboarduser->exten; | ||
| 58 | |||
| 59 | if(!empty($clientlist))foreach($clientlist as $tclnt)if($tclnt!="") | ||
| 60 | { | ||
| 61 | $roclientstr[]="$tclnt"; | ||
| 62 | |||
| 63 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 64 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 65 | } | ||
| 66 | |||
| 67 | $alist=$alist->where(function ($query) use($roclientstr,$uidlist,$didlinesstr){ | ||
| 68 | $query->orWhereIn('c.client',$roclientstr) | ||
| 69 | ->orWhereIn('c.did',$didlinesstr); | ||
| 70 | });*/ | ||
| 71 | } | ||
| 72 | else { | ||
| 73 | $allusers=$allusers->get(); | ||
| 74 | foreach($allusers as $tuser) | ||
| 75 | { | ||
| 76 | $userarr[$tuser->id] = $tuser; | ||
| 77 | } | ||
| 78 | } |
| 1 | <div class="layout-app"> | ||
| 2 | |||
| 3 | <!-- row-app --> | ||
| 4 | <div class="row row-app"> | ||
| 5 | |||
| 6 | <!-- col --> | ||
| 7 | <div class="col-md-2 col-sm-3"> | ||
| 8 | |||
| 9 | <!-- col-separator --> | ||
| 10 | <div class="col-separator col-separator-first box col-unscrollable"> | ||
| 11 | |||
| 12 | <!-- col-table --> | ||
| 13 | <div class="col-table" style='padding-left: 13px;padding-right: 13px;'> | ||
| 14 | |||
| 15 | <h4 class="innerAll margin-none border-bottom" style='background: #fff;'>Dialer Reports</h4> | ||
| 16 | |||
| 17 | <!-- col-table-row --> | ||
| 18 | <div class="col-table-row"> | ||
| 19 | |||
| 20 | <!-- col-app --> | ||
| 21 | <div class="col-app col-unscrollable"> | ||
| 22 | |||
| 23 | <!-- col-app --> | ||
| 24 | <div class="col-app"> | ||
| 25 | |||
| 26 | <ul class="list-group list-group-1 margin-none borders-none" style='padding-right: 26px;'> | ||
| 27 | <li class="list-group-item"> | ||
| 28 | <a href="#" onclick="doAjax('report/liveusers','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Live</a> | ||
| 29 | </li> | ||
| 30 | |||
| 31 | <li class="list-group-item"> | ||
| 32 | <a href="#" onclick="doAjax('report/calllog','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Call</a> | ||
| 33 | </li> | ||
| 34 | |||
| 35 | <li class="list-group-item"> | ||
| 36 | <a href="#" onclick="doAjax('report/agenttime','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Login</a> | ||
| 37 | </li> | ||
| 38 | <li class="list-group-item"> | ||
| 39 | <a href="#" onclick="doAjax('report/agenttimeAverage','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Login Average</a> | ||
| 40 | </li> | ||
| 41 | <li class="list-group-item"> | ||
| 42 | <a href="#" onclick="doAjax('report/campreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Time</a> | ||
| 43 | </li> | ||
| 44 | <li class="list-group-item"> | ||
| 45 | <a href="#" onclick="doAjax('report/statusreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Status</a> | ||
| 46 | </li> | ||
| 47 | |||
| 48 | <li class="list-group-item"> | ||
| 49 | <a href="#" onclick="doAjax('report/relationshipreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i>Relationship</a> | ||
| 50 | </li> | ||
| 51 | </ul> | ||
| 52 | </div> | ||
| 53 | <!-- // END col-app --> | ||
| 54 | |||
| 55 | </div> | ||
| 56 | <!-- // END col-app --> | ||
| 57 | |||
| 58 | </div> | ||
| 59 | <!-- // END col-table-row --> | ||
| 60 | |||
| 61 | </div> | ||
| 62 | <!-- // END col-table --> | ||
| 63 | |||
| 64 | </div> | ||
| 65 | <!-- // END col-separator.box --> | ||
| 66 | |||
| 67 | </div> | ||
| 68 | <!-- // END col --> | ||
| 69 | |||
| 70 | <!-- col --> | ||
| 71 | <div class="col-md-10 col-sm-9" style='border-right:13px solid #eaeaea'> | ||
| 72 | |||
| 73 | <!-- col-separator.box --> | ||
| 74 | <div class="col-separator col-unscrollable box"> | ||
| 75 | |||
| 76 | <!-- col-table --> | ||
| 77 | <div class="col-table"> | ||
| 78 | |||
| 79 | <!-- col-table-row --> | ||
| 80 | <div class="col-table-row" style='background: #fff;'> | ||
| 81 | |||
| 82 | <!-- col-app --> | ||
| 83 | <div class="col-app col-unscrollable"> | ||
| 84 | |||
| 85 | <!-- col-app --> | ||
| 86 | <div class="col-app" style='position:relative'> | ||
| 87 | |||
| 88 | <div class="" id=rightmainreportdiv> | ||
| 89 | <script> | ||
| 90 | |||
| 91 | doAjax('report/liveusers','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | ||
| 92 | |||
| 93 | </script> | ||
| 94 | </div> | ||
| 95 | |||
| 96 | </div> | ||
| 97 | <!-- // END col-app --> | ||
| 98 | |||
| 99 | </div> | ||
| 100 | <!-- // END col-app.col-unscrollable --> | ||
| 101 | |||
| 102 | </div> | ||
| 103 | <!-- // END col-table-row --> | ||
| 104 | |||
| 105 | </div> | ||
| 106 | <!-- // END col-table --> | ||
| 107 | |||
| 108 | </div> | ||
| 109 | <!-- // END col-separator.box --> | ||
| 110 | |||
| 111 | </div> | ||
| 112 | <!-- // END col --> | ||
| 113 | |||
| 114 | </div> | ||
| 115 | <!-- // END row-app --> | ||
| 116 | </div> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <?php | ||
| 2 | use App\Jobs\KHRMSLib; | ||
| 3 | use App\Models\CRMCall; | ||
| 4 | |||
| 5 | $wakka=new KHRMSLib(); | ||
| 6 | $roclientlst=$wakka->clientsReadAccess(); | ||
| 7 | if(isset($_GET['pbcode']))$pbcode=$_GET['pbcode']; | ||
| 8 | else $pbcode=''; | ||
| 9 | |||
| 10 | $alist=DB::table('p11086_cop_rlp_pb_base_uat') | ||
| 11 | ->select(DB::Raw("*")) | ||
| 12 | ->where('pbcode','=',$pbcode) | ||
| 13 | ->get(); | ||
| 14 | //print_r($alist); | ||
| 15 | |||
| 16 | ?> | ||
| 17 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 18 | |||
| 19 | <div class="layout-app"><!-- row-app --> | ||
| 20 | <div class="row row-app"> | ||
| 21 | |||
| 22 | <div class="col-md-12"> | ||
| 23 | |||
| 24 | <div class="col-separator col-separator-first col-unscrollable box"> | ||
| 25 | <div style='clear:both;margin:2% 0 0 1%;border: 2px solid #F5F5F5;padding:2%;border-radius: 5px;'> | ||
| 26 | <center><h4>RLP PB WISE</center> | ||
| 27 | |||
| 28 | <br> | ||
| 29 | <div class='container'> | ||
| 30 | |||
| 31 | PB CODE:<select id='pb_code' class=select2multi style="width:20%;" onclick="pbcodeSelect();"> | ||
| 32 | <?php foreach($roclientlst as $c){$s="";if($c==$pbcode)$s='selected';echo "<option value='$c' $s>$c</option>";} ?> | ||
| 33 | </select> | ||
| 34 | </div> | ||
| 35 | </div> | ||
| 36 | </div> | ||
| 37 | <div style='overflow:auto;margin-top: 10px;'> | ||
| 38 | <table id='logtable' class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px';margin:0; border:1px solid #BBB;> | ||
| 39 | <thead> | ||
| 40 | <tr> | ||
| 41 | <th>Product</th> | ||
| 42 | <th>Opportunity</th> | ||
| 43 | <th>Contacted</th> | ||
| 44 | <th>Pitched</th> | ||
| 45 | <th>LG</th> | ||
| 46 | </tr> | ||
| 47 | </thead> | ||
| 48 | <tr> | ||
| 49 | <td>AL</td> | ||
| 50 | <td><?php echo $alist[0]->al_qm_opp + $alist[0]->al_upg_opp + $alist[0]->al_al_cnc_opp + $alist[0]->al_pa_opp + $alist[0]->al_zip_opp ?></td> | ||
| 51 | <td><?php echo $alist[0]->al_called_opp ?></td> | ||
| 52 | <td><?php echo $alist[0]->al_pitch ?></td> | ||
| 53 | <td><?php echo $alist[0]->al_lg ?></td> | ||
| 54 | </tr> | ||
| 55 | <tr> | ||
| 56 | <td>PL/BL</td> | ||
| 57 | <td><?php echo $alist[0]->pl_10sec_opp+$alist[0]->pl_pa_opp+$alist[0]->pl_pq_opp+$alist[0]->bl_10sec_opp+$alist[0]->bl_pq_opp ?></td> | ||
| 58 | <td><?php echo $alist[0]->pl_called_opp ?></td> | ||
| 59 | <td><?php echo $alist[0]->pl_pitch ?></td> | ||
| 60 | <td><?php echo $alist[0]->pl_lg ?></td> | ||
| 61 | </tr> | ||
| 62 | <tr> | ||
| 63 | <td>Retail Assets</td> | ||
| 64 | <td><?php echo $alist[0]->twl_pa_opp+$alist[0]->hl_pq_opp+$alist[0]->hl_bt_opp+$alist[0]->gl_pitch+$alist[0]->las_opp+$alist[0]->lap_opp ?></td> | ||
| 65 | <td><?php echo $alist[0]->twl_called_opp+$alist[0]->hl_called_opp+$alist[0]->las_called_opp+$alist[0]->lap_called_opp ?></td> | ||
| 66 | <td><?php echo $alist[0]->twl_pitch+$alist[0]->hl_pitch+$alist[0]->gl_pitch+$alist[0]->las_pitch ?></td> | ||
| 67 | <td><?php echo $alist[0]->twl_lg+$alist[0]->hl_lg+$alist[0]->gl_lg+$alist[0]->las_lg+$alist[0]->lap_lg ?></td> | ||
| 68 | </tr> | ||
| 69 | <tr> | ||
| 70 | <td>HSL</td> | ||
| 71 | <td><?php echo $alist[0]->hsl_opp ?></td> | ||
| 72 | <td><?php echo $alist[0]->hsl_called_opp ?></td> | ||
| 73 | <td><?php echo $alist[0]->hsl_pitch ?></td> | ||
| 74 | <td></td> | ||
| 75 | </tr> | ||
| 76 | <tr> | ||
| 77 | <td>Credit Card- New Sourcing</td> | ||
| 78 | <td><?php echo $alist[0]->cc_eli_new_opp ?></td> | ||
| 79 | <td><?php echo $alist[0]->cc_activation_opp ?></td> | ||
| 80 | <td><?php echo $alist[0]->cc_pitch ?></td> | ||
| 81 | <td><?php echo $alist[0]->cc_lg ?></td> | ||
| 82 | </tr> | ||
| 83 | <tr> | ||
| 84 | <td>Credit Card- LTD Activation on Carded</td> | ||
| 85 | <td><?php echo $alist[0]->cc_activation_opp ?></td> | ||
| 86 | <td><?php echo $alist[0]->cc_activation_called_opp ?></td> | ||
| 87 | <td></td> | ||
| 88 | <td</td> | ||
| 89 | </tr> | ||
| 90 | <tr> | ||
| 91 | <td>Insurance LI</td> | ||
| 92 | <td><?php echo $alist[0]->li_opp ?></td> | ||
| 93 | <td><?php echo $alist[0]->li_called_opp ?></td> | ||
| 94 | <td></td> | ||
| 95 | <td></td> | ||
| 96 | </tr> | ||
| 97 | <tr> | ||
| 98 | <td>FD</td> | ||
| 99 | <td><?php echo $alist[0]->fd_opp ?></td> | ||
| 100 | <td><?php echo $alist[0]->fd_called_opp ?></td> | ||
| 101 | <td><?php echo $alist[0]->fd_pitch ?></td> | ||
| 102 | <td></td> | ||
| 103 | </tr> | ||
| 104 | <tr> | ||
| 105 | <td>LTD Activation-Savings Account</td> | ||
| 106 | <td><?php echo $alist[0]->ltd_act_saving_opp ?></td> | ||
| 107 | <td><?php echo $alist[0]->ltd_act_saving_opp ?></td> | ||
| 108 | <td></td> | ||
| 109 | <td></td> | ||
| 110 | </tr> | ||
| 111 | <tr> | ||
| 112 | <td>NB/MB Activations</td> | ||
| 113 | <td><?php echo $alist[0]->mb_opp ?></td> | ||
| 114 | <td><?php echo $alist[0]->mb_called_opp ?></td> | ||
| 115 | <td><?php echo $alist[0]->mb_pitch ?></td> | ||
| 116 | <td><?php echo $alist[0]->nb_mb_lg ?></td> | ||
| 117 | </tr> | ||
| 118 | <tr> | ||
| 119 | <td>Aadhar Seeding</td> | ||
| 120 | <td><?php echo $alist[0]->aadhaar_opp ?></td> | ||
| 121 | <td><?php echo $alist[0]->aadhaar_called_opp ?></td> | ||
| 122 | <td><?php echo $alist[0]->aadhaar_pitch ?></td> | ||
| 123 | <td><?php echo $alist[0]->aadhaar_activation ?></td> | ||
| 124 | </tr> | ||
| 125 | <tr> | ||
| 126 | <td>Digital Activation</td> | ||
| 127 | <td><?php echo $alist[0]->digi2_score_opp ?></td> | ||
| 128 | <td><?php echo $alist[0]->digi2_score_called_opp ?></td> | ||
| 129 | <td></td> | ||
| 130 | <td></td> | ||
| 131 | </tr> | ||
| 132 | <tr> | ||
| 133 | <td>BillPayments</td> | ||
| 134 | <td><?php echo $alist[0]->digi_billpay_opp ?></td> | ||
| 135 | <td><?php echo $alist[0]->digi_billpay_called_opp ?></td> | ||
| 136 | <td><?php echo $alist[0]->bill_pay_pitch ?></td> | ||
| 137 | <td></td> | ||
| 138 | </tr> | ||
| 139 | <tr> | ||
| 140 | <td>Financial Transactions</td> | ||
| 141 | <td><?php echo $alist[0]->digi_basic_banking_opp ?></td> | ||
| 142 | <td><?php echo $alist[0]->digi_basic_banking_called_opp ?></td> | ||
| 143 | <td></td> | ||
| 144 | <td></td> | ||
| 145 | </tr> | ||
| 146 | <tr> | ||
| 147 | <td>Digital 2.0 Score(Ecom Shopping Inactive)</td> | ||
| 148 | <td><?php echo $alist[0]->digi_ecom_shopping_opp ?></td> | ||
| 149 | <td><?php echo $alist[0]->digi_ecom_shopping_called_opp ?></td> | ||
| 150 | <td></td> | ||
| 151 | <td> </td> | ||
| 152 | </tr> | ||
| 153 | <tr> | ||
| 154 | <td>Digital 2.0 Score(Investment Inactive)</td> | ||
| 155 | <td><?php echo $alist[0]->digi_investment_opp ?></td> | ||
| 156 | <td><?php echo $alist[0]->digi_investment_called_opp ?></td> | ||
| 157 | <td><?php echo $alist[0]->invest_pitch ?></td> | ||
| 158 | <td></td> | ||
| 159 | </tr> | ||
| 160 | <tr> | ||
| 161 | <td>Reduction in Physical Transactions</td> | ||
| 162 | <td><?php echo $alist[0]->invest_pitch ?></td> | ||
| 163 | <td><?php echo $alist[0]->invest_pitch ?></td> | ||
| 164 | <td></td> | ||
| 165 | <td></td> | ||
| 166 | </tr> | ||
| 167 | <tr> | ||
| 168 | <td>% of Groups Contacted</td> | ||
| 169 | <td> </td> | ||
| 170 | <td> </td> | ||
| 171 | <td> </td> | ||
| 172 | <td> </td> | ||
| 173 | </tr> | ||
| 174 | <tr> | ||
| 175 | <td>Movement of Groups to higher engagement</td> | ||
| 176 | <td> </td> | ||
| 177 | <td> </td> | ||
| 178 | <td> </td> | ||
| 179 | <td></td> | ||
| 180 | </tr> | ||
| 181 | <tr> | ||
| 182 | <td>CASA Growth</td> | ||
| 183 | <td> </td> | ||
| 184 | <td> </td> | ||
| 185 | <td> </td> | ||
| 186 | <td> </td> | ||
| 187 | </tr> | ||
| 188 | <tr> | ||
| 189 | <td>Mutual Fund</td> | ||
| 190 | <td> </td> | ||
| 191 | <td> </td> | ||
| 192 | <td> </td> | ||
| 193 | <td> </td> | ||
| 194 | </tr> | ||
| 195 | </table> | ||
| 196 | </div> | ||
| 197 | <div id=dialoglog></div> | ||
| 198 | </div> | ||
| 199 | </div> | ||
| 200 | </div> | ||
| 201 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 202 | <script> | ||
| 203 | $(document).ready(function() | ||
| 204 | { | ||
| 205 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 206 | { | ||
| 207 | $('#dialoglog').dialog({ | ||
| 208 | autoOpen: false, | ||
| 209 | width: '70%', | ||
| 210 | buttons: { | ||
| 211 | "Ok": function() { | ||
| 212 | $(this).dialog("close"); | ||
| 213 | }, | ||
| 214 | "Cancel": function() { | ||
| 215 | $(this).dialog("close"); | ||
| 216 | } | ||
| 217 | } | ||
| 218 | }); | ||
| 219 | } | ||
| 220 | |||
| 221 | waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"2000"); | ||
| 222 | |||
| 223 | }); | ||
| 224 | function pbcodeSelect() | ||
| 225 | { | ||
| 226 | var pbcode=$('#pb_code').val(); | ||
| 227 | doAjax('rlp?pbcode='+pbcode,'','content','ajax_rlp','singlethis','GET'); | ||
| 228 | } | ||
| 229 | </script> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <style> | ||
| 2 | #logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;} | ||
| 3 | .select2-container-multi{height: 90px; overflow-y: auto;border: 1px solid #efefef;border-radius: 3px !important;} | ||
| 4 | .select2-container-active{height: 90px; overflow-y: auto;border: 1px solid #5897fb;border-radius: 3px !important;} | ||
| 5 | .select2-container-multi.select2-container-active.select2-choices{border:none !important; box-shadow: none !important;} | ||
| 6 | .select2-choices{border:none !important; box-shadow: none !important;} | ||
| 7 | .select2-drop,.select2-drop-active{border-color: #5897fb;margin-top: -9px;} | ||
| 8 | </style> | ||
| 9 | |||
| 10 | <?php | ||
| 11 | if($param) { | ||
| 12 | $clientlist = array_filter($clientlist, function($var) use ($param) { return (strpos(trim($var), $param) !== 0) ? false : true; }); | ||
| 13 | } | ||
| 14 | ?> | ||
| 15 | |||
| 16 | <div class=innerAll> | ||
| 17 | |||
| 18 | <h4 style="float:left;width:50%;margin:10px 0;">{{ $reportTitle }}</h4> | ||
| 19 | <div style="float:right;width:50%" id="download_btn"> | ||
| 20 | <button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download'><i class='fa fa-download'></i> Download</button> | ||
| 21 | </div> | ||
| 22 | <div style="clear:both"></div> | ||
| 23 | <hr style="margin-bottom: 5px;"> | ||
| 24 | <div> | ||
| 25 | Search <input id=filter name="filter" type="text" style="border:1px solid #efefef; padding: 2px 10px;"> | ||
| 26 | Date: From <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' onchange='statusLogReloadFun("");' /> | ||
| 27 | <select id="modtime" style="border:1px solid #efefef;" onchange='statusLogReloadFun("");'> | ||
| 28 | <?php | ||
| 29 | foreach (range(0,23) as $hour) { | ||
| 30 | $selected = ($hour == $logtime) ? "selected" : ""; | ||
| 31 | echo "<option value='$hour' $selected>".str_pad($hour, 2, "0", STR_PAD_LEFT) . ":00</option>"; | ||
| 32 | } | ||
| 33 | ?></select> | ||
| 34 | To <input size=10 id='modto' name='modto' type='text' value='<?php echo date("Y-m-d",$logdateto); ?>' onchange='statusLogReloadFun("");' /> | ||
| 35 | <select id="modtimeto" style="border:1px solid #efefef;" onchange='statusLogReloadFun("");'> | ||
| 36 | <?php | ||
| 37 | foreach (range(0,23) as $hour) { | ||
| 38 | $selected = ($hour == $logtimeto) ? "selected" : ""; | ||
| 39 | echo "<option value='$hour' $selected>".str_pad($hour, 2, "0", STR_PAD_LEFT) . ":00</option>"; | ||
| 40 | } | ||
| 41 | ?></select> | ||
| 42 | <button class="pull-right btn btn-sm btn-default" onclick='$("#advance").toggle();' title='Advance Search'><i class='fa fa-search'></i> Advance Search</button> | ||
| 43 | |||
| 44 | <div style="clear:both"></div> | ||
| 45 | <div style="margin-top: 5px; display:{{ $displayAdv }};" id="advance"> | ||
| 46 | <div style="width: 80%;" class="pull-left"> | ||
| 47 | Campaign | ||
| 48 | <select id="campaignbox" multiple="multiple" style="width:25%" class=select2multi> | ||
| 49 | <?php foreach($clientlist as $c) | ||
| 50 | { $s=""; | ||
| 51 | if($param) { | ||
| 52 | $s='selected'; | ||
| 53 | echo "<option value='$c' $s>$c</option>"; | ||
| 54 | } else { | ||
| 55 | if(in_array($c, $campaign))$s='selected'; | ||
| 56 | echo "<option value='$c' $s>$c</option>"; | ||
| 57 | } | ||
| 58 | }?> | ||
| 59 | </select> | ||
| 60 | </div> | ||
| 61 | <div style="margin-top: 5px;" class="pull-right"> | ||
| 62 | <button class="pull-right btn btn-sm btn-default" onclick='statusLogReloadFun("");' title='Search'><i class='fa fa-search'></i> Search</button> | ||
| 63 | </div> | ||
| 64 | </div> | ||
| 65 | </div> | ||
| 66 | |||
| 67 | <div style="clear:both"></div> | ||
| 68 | <hr style="margin:5px;"> | ||
| 69 | <script> | ||
| 70 | $(document).ready(function() { | ||
| 71 | waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"2000"); | ||
| 72 | $('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 73 | $('#modto').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 74 | }); | ||
| 75 | |||
| 76 | function dataString() | ||
| 77 | { | ||
| 78 | var campaignStr = ''; | ||
| 79 | $('#campaignbox :selected') .each(function(i, sel){ | ||
| 80 | if(campaignStr != '') campaignStr = campaignStr + '||' + $(sel).val(); | ||
| 81 | else campaignStr = $(sel).val(); | ||
| 82 | }); | ||
| 83 | return 'logdate='+$("#modfrom").val()+'&logtime='+$("#modtime").val()+'&logdateto='+$("#modto").val()+'&logtimeto='+$("#modtimeto").val()+'&campaign='+campaignStr; | ||
| 84 | } | ||
| 85 | function statusLogReloadFun(sortby) | ||
| 86 | { | ||
| 87 | var sortstr='';if(sortby!="")sortstr="&sort="+sortby | ||
| 88 | var searchStr = dataString(); | ||
| 89 | doAjax('dialer/{{ $returnblade }}?'+searchStr+sortstr,'','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | ||
| 90 | } | ||
| 91 | function dlAgentlogXls() | ||
| 92 | { | ||
| 93 | var searchStr = dataString(); | ||
| 94 | window.open('dialer/{{ $returnblade }}?dllogxls=1&'+searchStr); | ||
| 95 | return false; | ||
| 96 | } | ||
| 97 | function breakupXls(report,userId,column) | ||
| 98 | { | ||
| 99 | var searchStr = dataString(); | ||
| 100 | window.open('dialer/breakupxls?report='+report+'&userId='+userId+'&column='+column+'&'+searchStr); | ||
| 101 | return false; | ||
| 102 | } | ||
| 103 | |||
| 104 | function displayMode(mode) { | ||
| 105 | if(mode == 'percent') { | ||
| 106 | $(".summation").hide(); | ||
| 107 | $(".percent").show(); | ||
| 108 | } | ||
| 109 | else { | ||
| 110 | $(".percent").hide(); | ||
| 111 | $(".summation").show(); | ||
| 112 | } | ||
| 113 | } | ||
| 114 | </script> |
This diff is collapsed.
Click to expand it.
| 1 | <?php | ||
| 2 | use App\Models\CRMCall; | ||
| 3 | use App\Models\User; | ||
| 4 | use App\Jobs\KHRMSLib; | ||
| 5 | |||
| 6 | $wakka = new KHRMSLib(); | ||
| 7 | $dashboarduser=Auth::user(); | ||
| 8 | |||
| 9 | if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00"); | ||
| 10 | else $logdate=strtotime(date('Y-m-d')." 00:00:00"); | ||
| 11 | |||
| 12 | $alist=CRMCall::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60)); | ||
| 13 | |||
| 14 | //if(!$dashboarduser->moduleACL("Dialer",false,false,true)) | ||
| 15 | if($dashboarduser->usertype != 'Admin') | ||
| 16 | { | ||
| 17 | $uidlist=array($dashboarduser->id); | ||
| 18 | $allusers=User::where(function ($query) use($dashboarduser) { | ||
| 19 | $query->where('supervisor','=',$dashboarduser->username) | ||
| 20 | ->orWhere('lteam2','=',$dashboarduser->username) | ||
| 21 | ->orWhere('lteam','=',$dashboarduser->username); | ||
| 22 | })->get(); | ||
| 23 | // ->where(function ($query) { | ||
| 24 | // $query->where('status', '=', 'Active'); | ||
| 25 | // })->get(); | ||
| 26 | |||
| 27 | foreach($allusers as $tuser)$uidlist[]=$tuser->id; | ||
| 28 | |||
| 29 | |||
| 30 | $roclientstr=array();$didlinesstr=array(); | ||
| 31 | if($dashboarduser->exten!="")$didlinesstr[]=$dashboarduser->exten; | ||
| 32 | $oclientlst=$wakka->clientsReadAccess(); | ||
| 33 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="") | ||
| 34 | { | ||
| 35 | $roclientstr[]="$tclnt"; | ||
| 36 | |||
| 37 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 38 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 39 | } | ||
| 40 | |||
| 41 | $alist=$alist->where(function ($query) use($roclientstr,$uidlist,$didlinesstr){ | ||
| 42 | $query->orWhereIn('client',$roclientstr) | ||
| 43 | ->orWhereIn('user_id',$uidlist) | ||
| 44 | ->orWhereIn('did',$didlinesstr); | ||
| 45 | }); | ||
| 46 | |||
| 47 | } | ||
| 48 | |||
| 49 | $alist=$alist->get(); | ||
| 50 | |||
| 51 | $userarr=array();$i=1; | ||
| 52 | $reporthead=array("id","created_at","updated_at","sup_id","message","status"); | ||
| 53 | $reportarray=DB::table('supervisor_message')->where('sup_id','=',Auth::user()->username)->select('*')->get(); | ||
| 54 | |||
| 55 | if(Input::has("dllogxls")) | ||
| 56 | { | ||
| 57 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 58 | |||
| 59 | $inputFileType = "Excel5"; | ||
| 60 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 61 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | ||
| 62 | $baseRow = 2; | ||
| 63 | |||
| 64 | |||
| 65 | $highestColumn = sizeof($reporthead); | ||
| 66 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 67 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 68 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $reporthead[$head]); | ||
| 69 | } | ||
| 70 | |||
| 71 | foreach($reportarray as $uid=>$uarr) | ||
| 72 | { | ||
| 73 | $row = $baseRow++; | ||
| 74 | $col = 0; | ||
| 75 | |||
| 76 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 77 | |||
| 78 | if($reporthead[$head]=="created_at") | ||
| 79 | $uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60); | ||
| 80 | |||
| 81 | if($reporthead[$head]=="updated_at") | ||
| 82 | $uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60); | ||
| 83 | |||
| 84 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 85 | $objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $uarr->$reporthead[$head]); | ||
| 86 | } | ||
| 87 | } | ||
| 88 | |||
| 89 | |||
| 90 | header('Content-Type: application/vnd.ms-excel'); | ||
| 91 | header('Content-Disposition: attachment;filename="Messages.xls"'); | ||
| 92 | header('Cache-Control: max-age=0'); | ||
| 93 | |||
| 94 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 95 | $objWriter->save('php://output'); | ||
| 96 | |||
| 97 | return ; | ||
| 98 | } | ||
| 99 | |||
| 100 | ?> | ||
| 101 | |||
| 102 | |||
| 103 | <div class=innerAll> | ||
| 104 | |||
| 105 | |||
| 106 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 107 | <script> | ||
| 108 | $(document).ready(function() | ||
| 109 | { | ||
| 110 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 111 | { | ||
| 112 | $('#dialoglog').dialog({ | ||
| 113 | autoOpen: false, | ||
| 114 | width: '70%', | ||
| 115 | buttons: { | ||
| 116 | "Ok": function() { | ||
| 117 | $(this).dialog("close"); | ||
| 118 | }, | ||
| 119 | "Cancel": function() { | ||
| 120 | $(this).dialog("close"); | ||
| 121 | } | ||
| 122 | } | ||
| 123 | }); | ||
| 124 | } | ||
| 125 | |||
| 126 | waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"2000"); | ||
| 127 | $('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 128 | |||
| 129 | $('#modto').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 130 | }); | ||
| 131 | </script> | ||
| 132 | <div style="float:left;width:50%"> | ||
| 133 | |||
| 134 | |||
| 135 | </div> | ||
| 136 | <div style="float:right;width:50%"> | ||
| 137 | |||
| 138 | |||
| 139 | <button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button> | ||
| 140 | |||
| 141 | </div> | ||
| 142 | <div style="clear:both"></div> | ||
| 143 | <hr> | ||
| 144 | |||
| 145 | <div class=col-md-12> | ||
| 146 | |||
| 147 | |||
| 148 | <div id=userlogschart1 style='min-height:300px;width:100%'></div> | ||
| 149 | </div> | ||
| 150 | |||
| 151 | <script> | ||
| 152 | function dlAgentlogXls() | ||
| 153 | { | ||
| 154 | window.open('dialer/supmessages?dllogxls=1&logdate='+$("#modfrom").val());return false; | ||
| 155 | } | ||
| 156 | </script> | ||
| 157 | |||
| 158 | <div style='clear:both'></div> | ||
| 159 | |||
| 160 | <div class=col-md-12> | ||
| 161 | |||
| 162 | |||
| 163 | <div id=userlogschart2 style='min-height:300px;width:100%'></div> | ||
| 164 | |||
| 165 | </div> | ||
| 166 | |||
| 167 | |||
| 168 | |||
| 169 | <div style='clear:both'></div> | ||
| 170 | |||
| 171 | <div style='overflow:auto'> | ||
| 172 | <table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'> | ||
| 173 | <thead> | ||
| 174 | <?php /*echo $outhead;*/ ?> | ||
| 175 | </thead> | ||
| 176 | <?php /*echo $outstr;*/ ?> | ||
| 177 | </table> | ||
| 178 | </div> | ||
| 179 | |||
| 180 | <div id=dialoglog></div> | ||
| 181 | |||
| 182 | |||
| 183 | |||
| 184 | |||
| 185 | |||
| 186 | </div> |
-
Please register or sign in to post a comment