forked from goautodial/v4.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
agent.php
2272 lines (2102 loc) · 93.6 KB
/
agent.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* @file agent.php
* @brief Agent application
* @copyright Copyright (c) 2018 GOautodial Inc.
* @author Chris Lomuntad
* @author Demian Lizandro A. Biscocho
*
* @par <b>License</b>:
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
require_once('./php/APIHandler.php');
require_once('./php/CRMDefaults.php');
require_once('./php/UIHandler.php');
require_once('./php/LanguageHandler.php');
require_once('./php/DbHandler.php');
define('GO_BASE_DIRECTORY', str_replace($_SERVER['DOCUMENT_ROOT'], "", dirname(__FILE__)));
// initialize structures
require_once('./php/Session.php');
try {
$api = \creamy\APIHandler::getInstance();
$ui = \creamy\UIHandler::getInstance();
$lh = \creamy\LanguageHandler::getInstance();
$db = new \creamy\DbHandler();
$user = \creamy\CreamyUser::currentUser();
} catch (\Exception $e) {
header("location: ./logout.php");
die();
}
if($user->getUserRole() != CRM_DEFAULTS_USER_ROLE_AGENT){
header("location: index.php");
}
$lead_id = $_GET['lead_id'];
$output = $api->API_getLeadsInfo($lead_id);
$list_id_ct = count($output->list_id);
if ($list_id_ct > 0) {
for($i=0;$i < $list_id_ct;$i++){
$first_name = $output->first_name[$i];
$middle_initial = $output->middle_initial[$i];
$last_name = $output->last_name[$i];
$email = $output->email[$i];
$phone_number = $output->phone_number[$i];
$alt_phone = $output->alt_phone[$i];
$address1 = $output->address1[$i];
$address2 = $output->address2[$i];
$address3 = $output->address3[$i];
$city = $output->city[$i];
$state = $output->state[$i];
$country = $output->country[$i];
$gender = $output->gender[$i];
$date_of_birth = $output->date_of_birth[$i];
$comments = $output->comments[$i];
$title = $output->title[$i];
$call_count = $output->call_count[$i];
$last_local_call_time = $output->last_local_call_time[$i];
}
}
$fullname = $title.' '.$first_name.' '.$middle_initial.' '.$last_name;
$date_of_birth = date('Y-m-d', strtotime($date_of_birth));
//var_dump($output);
$output_script = $ui->getAgentScript($lead_id, $fullname, $first_name, $last_name, $middle_initial, $email,
$phone_number, $alt_phone, $address1, $address2, $address3, $city, $province, $state, $postal_code, $country);
if (isset($_GET["folder"])) {
$folder = $_GET["folder"];
} else $folder = MESSAGES_GET_INBOX_MESSAGES;
if ($folder < 0 || $folder > MESSAGES_MAX_FOLDER) { $folder = MESSAGES_GET_INBOX_MESSAGES; }
if (isset($_GET["message"])) {
$message = $_GET["message"];
} else $message = NULL;
$user_info = $api->API_getUserInfo($_SESSION['user'], "userInfo");
?>
<html>
<head>
<meta charset="UTF-8">
<title><?=CRM_GOAGENT_TITLE?> - <?=$lh->translateText('GOautodial')." ".CRM_GO_VERSION?></title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<!-- SnackbarJS -->
<link href="css/snackbar/snackbar.min.css" rel="stylesheet" type="text/css" />
<link href="css/snackbar/material.css" rel="stylesheet" type="text/css" />
<!-- multiple emails plugin -->
<link href="css/multiple-emails/multiple-emails.css" rel="stylesheet" type="text/css" />
<!-- Customized Style -->
<link href="css/creamycrm_test.css" rel="stylesheet" type="text/css" />
<?php
print $ui->standardizedThemeCSS();
print $ui->creamyThemeCSS();
print $ui->dataTablesTheme();
?>
<!-- Multi file upload -->
<script src="js/plugins/multifile/jQuery.MultiFile.min.js" type="text/javascript"></script>
<!-- Multiple emails -->
<script src="js/plugins/multiple-emails/multiple-emails.js" type="text/javascript"></script>
<!-- Print page -->
<script src="js/plugins/printThis/printThis.js" type="text/javascript"></script>
<!-- SIMPLE LINE ICONS-->
<link rel="stylesheet" src="js/dashboard/simple-line-icons/css/simple-line-icons.css">
<!-- WHIRL (spinners)-->
<link rel="stylesheet" src="js/dashboard/whirl/dist/whirl.css">
<!-- =============== PAGE VENDOR STYLES ===============-->
<!-- WEATHER ICONS-->
<link rel="stylesheet" src="js/dashboard/weather-icons/css/weather-icons.min.css">
<!-- Datetime picker -->
<link rel="stylesheet" src="js/dashboard/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css">
<!-- iCheck for checkboxes and radio inputs -->
<link href="css/iCheck/minimal/blue.css" rel="stylesheet" type="text/css" />
<!-- iCheck -->
<script src="js/plugins/iCheck/icheck.min.js" type="text/javascript"></script>
<!-- SLIMSCROLL-->
<script src="js/dashboard/slimScroll/jquery.slimscroll.min.js"></script>
<!-- MD5 HASH-->
<script src="js/jquery.md5.js" type="text/javascript"></script>
<!-- Date Picker -->
<script type="text/javascript" src="js/dashboard/eonasdan-bootstrap-datetimepicker/build/js/moment.js"></script>
<script type="text/javascript" src="js/dashboard/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
<!-- X-Editable -->
<link rel="stylesheet" src="js/dashboard/x-editable/dist/css/bootstrap-editable.css">
<script type="text/javascript" src="js/dashboard/x-editable/dist/js/bootstrap-editable.min.js"></script>
<!-- preloader -->
<link rel="stylesheet" href="css/customizedLoader.css">
<!-- flag sprites -->
<link rel="stylesheet" href="css/flags/flags.min.css">
<script type="text/javascript">
history.pushState('', document.title, window.location.pathname);
$(window).load(function() {
$(".preloader").fadeOut("slow", function() {
if (use_webrtc && (!!$.prototype.snackbar) && phone.isConnected()) {
$.snackbar({content: "<i class='fa fa-exclamation-circle fa-lg text-warning' aria-hidden='true'></i> Please wait while we register your phone extension to the dialer...", timeout: 3000, htmlAllowed: true});
}
});
$('#callback-list')
.removeClass( 'display' )
.addClass('table table-striped table-bordered');
if (typeof country_codes !== 'undefined') {
$("#country_code").append('<option value="1">United States of America</option>');
$("#country_code").append('<option value="1">Canada</option>');
$("#country_code").append('<option value="63">Philippines</option>');
$("#country_code").append('<option value="61">Australia</option>');
$("#country_code").append('<option value="44">United Kingdom of Great Britain and Northern Ireland</option>');
$.each(country_codes, function(key, value) {
if (! /^(USA_1|CAN_1|PHL_63|AUS_61|GBR_44)$/g.test(key)) {
$("#country_code").append('<option value="'+value.code+'">'+value.name+'</option>');
}
});
}
});
$(function() {
$("a[id='first_name'], a[id='middle_initial'], a[id='last_name']").on('hidden', function() {
var thisID = $(this).attr('id');
$('#'+thisID+'_label').addClass('hidden');
});
$("a[id='first_name'], a[id='middle_initial'], a[id='last_name']").on('shown', function() {
var thisID = $(this).attr('id');
var oldValue = $(this).editable('getValue', true);
//console.log(oldValue);
if ($(this).html() !== ' ') {
//$('div.editable-input input').val($(this).text());
//$(this).editable('setValue', oldValue, true);
} else {
//$('div.editable-input input').val('');
//$(this).editable('setValue', '', true);
}
$('#'+thisID+'_label').removeClass('hidden');
});
$("a[id='first_name']").editable({
type: 'text',
title: '<?=$lh->translationFor('enter_first_name')?>',
placeholder: '<?=$lh->translationFor('enter_first_name')?>',
emptytext: ' ',
unsavedclass: null,
inputclass: 'text-color-black',
onblur: 'submit'
});
$("a[id='middle_initial']").editable({
type: 'text',
title: '<?=$lh->translationFor('enter_middle_initial')?>',
placeholder: '<?=$lh->translationFor('enter_middle_initial')?>',
emptytext: ' ',
unsavedclass: null,
inputclass: 'text-color-black',
onblur: 'submit'
});
$("a[id='last_name']").editable({
type: 'text',
value: '',
title: '<?=$lh->translationFor('enter_last_name')?>',
placeholder: '<?=$lh->translationFor('enter_last_name')?>',
emptytext: ' ',
unsavedclass: null,
inputclass: 'text-color-black',
onblur: 'submit'
});
//$("#callback-list").DataTable({"bDestroy": true, "aoColumnDefs": [{ "bSortable": false, "aTargets": [ 5 ] }, { "bSearchable": false, "aTargets": [ 2, 5 ] }] });
});
//turn to inline mode
$.fn.editable.defaults.mode = 'inline'; //buttons
$.fn.editableform.buttons =
'<button type="submit" class="btn btn-primary btn-sm editable-submit" style="padding: 8px 10px;">'+
'<i class="fa fa-check"></i>'+
'</button>'+
'<button type="button" class="btn btn-default btn-sm editable-cancel" style="padding: 8px 10px;">'+
'<i class="fa fa-remove"></i>'+
'</button>';
</script>
<style>
.nav-tabs > li > a{
font-weight: normal;
border:0px;
border-radius: 3px 3px 0px 0px;
}
.custom-tabpanel{
padding-top: 20px;
margin-right: 10px;
}
h3{
font-weight: normal;
}
.custom-row{
padding: 0px 50px;
padding-bottom: 50px;
}
.panel{
margin-bottom:0;
}
.required_div{
background: rgba(158,158,158,0.30);
}
.textarea{
border: none;
border-bottom: .5px solid #dde6e9;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding-left: 0px;
}
.form-control[disabled], fieldset[disabled] .form-control{
cursor: text;
background-color: white;
}
.edit-profile-button{
font-size:14px;
font-weight:normal;
}
.hide_div{
display: none;
}
.btn.btn-raised {
box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);
}
button[id^='show-callbacks-']:hover, button[id^='show-callbacks-']:active {
text-decoration: none;
}
#popup-hotkeys {
position: absolute;
top: 160px;
left: 40px;
display: none;
box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);
min-width: 480px;
}
#popup-hotkeys .panel-heading {
background-color: #2a2a2a;
color: #fff;
}
#popup-hotkeys .panel-body dl {
margin-bottom: 0px;
}
.control-label {
padding-top: 0px;
}
.popover-title {
font-size: 16px;
font-weight: bold;
color: #555;
background-color: #f0f0f0;
}
.dataTables_empty {
text-align: center;
}
.table > thead > tr > th {
padding: 8px;
}
.modal-body {
min-height: inherit;
overflow-x: inherit;
overflow-y: inherit;
padding-top: 15px;
}
.form-group {
position: relative;
padding: 18px 0 24px 0;
}
.form-control {
position: relative;
z-index: 5;
width: 100%;
height: 34px;
padding: 2px;
color: inherit;
border: 0;
border-bottom: 1px solid #dde6e9;
border-radius: 0;
box-shadow: none;
}
.form-control:focus,
.form-control.focus {
padding-bottom: 1px;
border-color: #3f51b5;
border-bottom-width: 2px;
}
.form-control:focus ~ label,
.form-control.focus ~ label {
top: 0!important;
font-size: .85em!important;
color: #3f51b5;
opacity: 1;
}
.form-control ~ label {
position: absolute;
top: 0;
left: 0;
z-index: 0;
display: inline-block;
font-size: .85em;
opacity: .5;
-webkit-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
transition: all 0.2s ease;
}
.customform-label {
position: absolute;
top: 0;
left: 0;
z-index: 0;
display: inline-block;
font-size: .85em;
opacity: .5;
transition: all 0.2s ease;
font-weight: 700;
}
.text-color-black {
color: black;
}
body::-webkit-scrollbar, .tab-content::-webkit-scrollbar {
display: none;
}
.mail-preloader span.dots div, .cust-preloader span.dots div {
background-color: #2196F3;
}
#contact_info label, #comments label, #custom_form label {
color: #000;
opacity: 0.75;
}
.scrollable-menu {
width: 200px;
height: auto;
max-height: 200px;
overflow-x: hidden;
overflow-y: auto;
}
</style>
</head>
<?php print $ui->creamyAgentBody(); ?>
<div class="wrapper">
<!-- header logo: style can be found in header.less -->
<?php print $ui->creamyAgentHeader($user); ?>
<!-- Left side column. contains the logo and sidebar -->
<?php print $ui->getSidebar($user->getUserId(), $user->getUserName(), $user->getUserRole(), $user->getUserAvatar()); ?>
<!-- Right side column. Contains the navbar and content of the page -->
<aside class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-heading">
<!-- Page title -->
<span><?php $lh->translateText("contact_information"); ?></span>
<ol class="breadcrumb hidden-xs pull-right">
<li class="active"><i class="fa fa-home"></i> <?php $lh->translateText('home'); ?></li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<!-- standard custom edition form -->
<div id="cust_info" class="container-custom ng-scope">
<div class="card">
<div class="card-heading bg-inverse">
<div class="row">
<div id="cust_avatar" class="col-lg-1 col-md-1 col-sm-2 text-center hidden-xs" style="height: 64px;">
<avatar username="Dialed Client" src="<?php echo CRM_DEFAULTS_USER_AVATAR;?>" :size="64"></avatar>
</div>
<div class="col-lg-11 col-md-11 col-sm-10">
<h4 id="cust_full_name" class="hidden">
<span id="first_name_label" class="hidden"><?=$lh->translationFor('first_name')?>: </span><a href="#" id="first_name"></a> <span id="middle_initial_label" class="hidden"><?=$lh->translationFor('middle_initial')?>: </span><a href="#" id="middle_initial"></a> <span id="last_name_label" class="hidden"><?=$lh->translationFor('last_name')?>: </span><a href="#" id="last_name"></a>
</h4>
<p class="ng-binding animated fadeInUpShort"><span id="cust_number"></span></p>
</div>
</div>
</div>
<!-- /.card heading -->
<!-- Card body -->
<div class="card-body custom-tabpanel">
<div role="tabpanel" class="panel panel-transparent">
<ul id="agent_tablist" role="tablist" class="nav nav-tabs nav-justified">
<!-- Nav task panel tabs-->
<li role="presentation" class="active">
<a href="#contact_info" aria-controls="home" role="tab" data-toggle="tab" class="bb0">
<span class="fa fa-user hidden"></span>
<?=$lh->translationFor('contact_information')?></a>
</li>
<li role="presentation">
<a href="#comments_tab" aria-controls="home" role="tab" data-toggle="tab" class="bb0">
<span class="fa fa-comments-o hidden"></span>
<?=$lh->translationFor('comments')?></a>
</li>
<li role="presentation">
<a href="#scripts" aria-controls="home" role="tab" data-toggle="tab" class="bb0">
<span class="fa fa-file-text-o hidden"></span>
<?=$lh->translationFor('script')?></a>
</li>
</ul>
</div>
<!-- Tab panes-->
<div id="agent_tabs" class="tab-content bg-white">
<div id="contact_info" role="tabpanel" class="tab-pane active">
<fieldset style="padding-bottom: 0px; margin-bottom: 0px;">
<h4>
<a href="#" data-role="button" class="pull-right edit-profile-button hidden" id="edit-profile"><?=$lh->translationFor('edit_information')?></a>
</h4>
<br/>
<form role="form" id="name_form" class="formMain form-inline" >
<!--LEAD ID-->
<input type="hidden" value="<?php echo $lead_id;?>" name="lead_id">
<!--LIST ID-->
<input type="hidden" value="<?php echo $list_id;?>" name="list_id">
<!--ENTRY LIST ID-->
<input type="hidden" value="<?php echo $entry_list_id;?>" name="entry_list_id">
<!--VENDOR ID-->
<input type="hidden" value="<?php echo $vendor_lead_code;?>" name="vendor_lead_code">
<!--GMT OFFSET-->
<input type="hidden" value="<?php echo $gmt_offset_now;?>" name="gmt_offset_now">
<!--SECURITY PHRASE-->
<input type="hidden" value="<?php echo $security_phrase;?>" name="security_phrase">
<!--RANK-->
<input type="hidden" value="<?php echo $rank;?>" name="rank">
<!--CALLED COUNT-->
<input type="hidden" value="<?php echo $call_count;?>" name="called_count">
<!--UNIQUEID-->
<input type="hidden" value="<?php echo $uniqueid;?>" name="uniqueid">
<!--SECONDS-->
<input type="hidden" value="" name="seconds">
<!--CUSTOM FORM LOADED-->
<input type="hidden" value="0" name="FORM_LOADED">
<!--<div class="row">
<div class="col-sm-4">
<div class="mda-form-group label-floating">
<input id="first_name" name="first_name" type="text" maxlength="30" value="<?php echo $first_name;?>"
class="mda-form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched input-disabled" disabled required>
<label for="first_name">First Name</label>
</div>
</div>
<div class="col-sm-4">
<div class="mda-form-group label-floating">
<input id="middle_initial" name="middle_initial" type="text" maxlength="1" value="<?php echo $middle_initial;?>"
class="mda-form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched input-disabled" disabled>
<label for="middle_initial">Middle Name</label>
</div>
</div>
<div class="col-sm-4">
<div class="mda-form-group label-floating">
<input id="last_name" name="last_name" type="text" maxlength="30" value="<?php echo $last_name;?>"
class="mda-form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched input-disabled" disabled required>
<label for="last_name">Last Name</label>
</div>
</div>
</div>-->
</form>
<form id="contact_details_form" class="formMain">
<!-- phone number & alternative phone number -->
<div class="row">
<div class="col-sm-6">
<div class="mda-form-group label-floating">
<span id="phone_numberDISP" class="hidden"></span>
<input id="phone_code" name="phone_code" type="hidden" value="<?php echo $phone_code;?>">
<input id="phone_number" name="phone_number" type="number" min="0" maxlength="18" width="auto" value="<?php echo $phone_number;?>"
class="mda-form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched input-disabled" disabled required>
<label for="phone_number"><?=$lh->translationFor('phone_number')?></label>
<!--
<span class="mda-input-group-addon">
<em class="fa fa-phone fa-lg"></em>
</span>-->
</div>
</div>
<div class="col-sm-6">
<div class="mda-form-group label-floating">
<input id="alt_phone" name="alt_phone" type="number" min="0" maxlength="12" width="100" value="<?php echo $alt_phone;?>"
class="mda-form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched input-disabled" disabled>
<label for="alt_phone"><?=$lh->translationFor('alternative_phone_number')?></label>
</div>
</div>
</div>
<!-- /.phonenumber & alt phonenumber -->
<div class="mda-form-group label-floating">
<input id="address1" name="address1" type="text" maxlength="100" width="auto" value="<?php echo $address1;?>"
class="mda-form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched input-disabled" disabled>
<label for="address1"><?=$lh->translationFor('address')?></label>
<!--<span class="mda-input-group-addon">
<em class="fa fa-home fa-lg"></em>
</span>-->
</div>
<div class="mda-form-group label-floating">
<input id="address2" name="address2" type="text" maxlength="100" value="<?php echo $address2;?>"
class="mda-form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched input-disabled" disabled>
<label for="address2"><?=$lh->translationFor('address2')?></label>
</div>
<div class="row">
<div class="col-sm-4">
<div class="mda-form-group label-floating">
<input id="city" name="city" type="text" maxlength="50" value="<?php echo $city;?>"
class="mda-form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched input-disabled" disabled>
<label for="city"><?=$lh->translationFor('city')?></label>
</div>
</div>
<div class="col-sm-4">
<div class="mda-form-group label-floating">
<input id="state" name="state" type="text" maxlength="2" value="<?php echo $state;?>"
class="mda-form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched input-disabled" disabled>
<label for="state"><?=$lh->translationFor('state')?></label>
</div>
</div>
<div class="col-sm-4">
<div class="mda-form-group label-floating">
<input id="postal_code" name="postal_code" type="text" maxlength="10" value="<?php echo $postal_code;?>"
class="mda-form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched input-disabled" disabled>
<label for="postal_code"><?=$lh->translationFor('postal_code')?></label>
</div>
</div>
</div><!-- /.city,state,postalcode -->
<div class="mda-form-group label-floating">
<select id="country_code" name="country_code" type="text" maxlength="3"
class="mda-form-control select2 ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched select input-disabled" title="<?=$lh->translationFor('select_country_code')?>" disabled>
<option value="">- - - <?=$lh->translationFor('select_country_code')?> - - -</option>
</select>
<label for="country"><?=$lh->translationFor('country_code')?></label>
</div>
<div class="mda-form-group label-floating"><!-- add "mda-input-group" if with image -->
<input id="email" name="email" type="text" width="auto" value="<?php echo $email;?>"
class="mda-form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched input-disabled" disabled>
<label for="email"><?=$lh->translationFor('email_add')?></label>
<!--<span class="mda-input-group-addon">
<em class="fa fa-at fa-lg"></em>
</span>-->
</div>
</form>
<form role="form" id="gender_form" class="formMain form-inline" >
<div class="row">
<div class="col-sm-3">
<div class="mda-form-group label-floating">
<input id="title" name="title" type="text" maxlength="4" value="<?php echo $title;?>"
class="mda-form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched input-disabled" disabled>
<label for="title"><?=$lh->translationFor('title')?></label>
</div>
</div>
<div class="col-sm-3">
<div class="mda-form-group label-floating">
<select id="gender" name="gender" class="mda-form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched select input-disabled" disabled>
<option disabled value=""<?php if ($gender != 'M' && $gender != 'F') { echo " selected"; }?>></option>
<option value="M"<?php if ($gender == 'M') { echo " selected"; }?>><?=$lh->translationFor('male')?></option>
<option value="F"<?php if ($gender == 'F') { echo " selected"; }?>><?=$lh->translationFor('female')?></option>
</select>
<label for="gender"><?=$lh->translationFor('gender')?></label>
</div>
</div>
<div class="col-sm-6">
<div class="mda-form-group label-floating">
<input type="date" id="date_of_birth" value="" name="date_of_birth" class="mda-form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched input-disabled" disabled>
<label for="date_of_birth"><?=$lh->translationFor('date_of_birth')?></label>
</div>
</div>
<div id="call_notes_content" class="col-sm-12">
<div class="form-group" style="float: left; width:100%;">
<textarea rows="5" id="call_notes" name="call_notes" class="form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched textarea note-editor note-editor-margin" style="resize:none; width: 100%;"></textarea>
<label for="call_notes"><?=$lh->translationFor('call_notes')?></label>
</div>
</div>
</div><!-- /.gender & title -->
</form>
<!-- NOTIFICATIONS -->
<!--<div id="notifications_list">
<div class="output-message-success" style="display:none;">
<div class="alert alert-success alert-dismissible" role="alert">
<strong>Success!</strong> Successfuly updated contact.
</div>
</div>
<div class="output-message-error" style="display:none;">
<div class="alert alert-danger alert-dismissible" role="alert">
<strong>Error!</strong> Something went wrong please see input data on form or if agent already exists.
</div>
</div>
<div class="output-message-incomplete" style="display:none;">
<div class="alert alert-danger alert-dismissible" role="alert">
Please fill-up all the fields correctly and do not leave any highlighted fields blank.
</div>
</div>
</div>-->
<div class="hide_div">
<button type="submit" name="submit" id="submit_edit_form" class="btn btn-primary btn-block btn-flat"><?=$lh->translationFor('submit')?></button>
</div>
</fieldset>
</div><!--End of Profile-->
<div id="comments_tab" role="tabpanel" class="tab-pane">
<div class="row">
<div class="col-sm-12">
<h4><!--Comments-->
<!--<a href="#" data-role="button" class="pull-right edit-profile-button hidden" id="edit-profile">Edit Information</a>-->
</h4>
<form role="form" id="comment_form" class="formMain form-inline" >
<div class="mda-form-group hidden">
<p style="padding-right:0px;padding-top: 20px;"><?=$lh->translationFor('comments')?>:</p>
<button id="ViewCommentButton" onClick="ViewComments('ON');" value="-History-" class="hidden"></button>
</div>
<div class="form-group" style="float: left; width:100%;">
<textarea rows="10" id="comments" name="comments" maxlength="255" class="form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched textarea input-disabled note-editor note-editor-margin" style="resize:none; width: 100%;" disabled><?=$comments?></textarea>
<label for="comments"><?=$lh->translationFor('comments')?></label>
</div>
</form>
</div>
</div>
</div>
<!-- Scripts -->
<div id="scripts" role="tabpanel" class="tab-pane">
<div class="row">
<div class="col-sm-12">
<fieldset style="padding-bottom: 5px; margin-bottom: 5px;">
<h4>
<a href="#" data-role="button" class="pull-right edit-profile-button hidden" id="reload-script" style="padding: 5px;"><?=$lh->translationFor('reload_script')?></a>
</h4>
<div id="ScriptContents" style="min-height: 200px; border: dashed 1px #c0c0c0; padding: 20px 5px 5px;">
<?php echo $output_script;?>
</div>
</fieldset><!-- /.fieldset -->
</div><!-- /.col-sm-12 -->
</div><!-- /.row -->
</div>
<!-- End of Scripts -->
</div>
</div>
<div id="custom_fields_content" class="card-body" style="border: 1px solid rgb(221, 230, 233); margin: 0 32px 0 22px; display: none;">
<h4 style="font-weight: 600;">
<?=$lh->translationFor('custom_forms')?>
</h4>
<br>
<form role="form" id="custom_form" class="formMain">
<div id="custom_fields">
</div>
</form>
</div>
<br id="custom_br" style="display: none;">
<!-- SCRIPT MODAL -->
<div class="modal fade" id="script" name="script" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"><i class="fa fa-edit"></i> <b><?php $lh->translationFor("script"); ?></b></h4>
</div>
<div class="modal-body">
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
</div>
<div id="loaded-contents" class="container-custom ng-scope" style="display: none;">
<div id="contents-messages" class="row" style="display: none;">
<!-- left side folder list column -->
<div class="col-md-3">
<a href="composemail.php" class="btn btn-primary btn-block margin-bottom"><?php $lh->translateText("new_message"); ?></a>
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title"><?php print $lh->translationFor("folders"); ?></h3>
</div>
<div id="folders-list" class="box-body no-padding">
<?php print $ui->getMessageFoldersAsList($folder); ?>
</div><!-- /.box-body -->
</div><!-- /. box -->
</div><!-- /.col -->
<!-- main content right side column -->
<div id="mail-messages" class="col-md-9">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title"><?php $lh->translateText("messages"); ?></h3>
</div><!-- /.box-header -->
<div class="box-body no-padding">
<div class="mailbox-controls">
<?php print $ui->getMailboxButtons($folder); ?>
</div>
<div class="table-responsive mailbox-messages">
<?php print $ui->getMessagesFromFolderAsTable($user->getUserId(), $folder); ?>
</div><!-- /.mail-box-messages -->
<div class="mail-preloader" style="margin: 30px 0 10px; text-align: center; display: none;">
<span class="dots">
<div class="circ1"></div><div class="circ2"></div><div class="circ3"></div><div class="circ4"></div>
</span>
</div>
</div><!-- /.box-body -->
<div class="box-footer no-padding">
<div class="mailbox-controls">
<?php print $ui->getMailboxButtons($folder); ?>
</div>
</div>
</div><!-- /. box -->
</div><!-- /.col -->
<div id="mail-composemail" class="col-md-9" style="display: none;">
<div class="box box-default">
<form method="POST" id="send-message-form" enctype="multipart/form-data">
<div class="box-header with-border">
<h3 class="box-title"><?php $lh->translateText("compose_new_message"); ?></h3>
</div><!-- /.box-header -->
<div class="box-body">
<input type="hidden" id="fromuserid" name="fromuserid" value="<?php print $user->getUserId(); ?>">
<div class="form-group">
<?php print $ui->generateSendToUserSelect($user->getUserId(), false, null, $reply_user); ?>
<label for="touserid">Recipients</label>
</div>
<div class="form-group hidden">
<input id="external_recipients" name="external_recipients" class="form-control" placeholder="<?php $lh->translateText("external_message_recipients"); ?>"/>
<label for="external_recipients">External Recipients</label>
</div>
<div class="form-group">
<input id="subject" name="subject" class="form-control required" value="<?php print $reply_subject; ?>"/>
<label for="subject">Subject</label>
</div>
<div class="form-group">
<textarea id="compose-textarea" name="message" class="form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched textarea required" style="height: 200px" placeholder="<?php $lh->translateText("write_your_message_here"); ?>"></textarea>
<!--<label for="compose-textarea">Message</label>-->
</div>
<div class="form-group" style="padding: 0px;">
<div class="btn btn-default btn-file">
<i class="fa fa-paperclip"></i> <?php $lh->translateText("attachment"); ?>
<input type="file" class="attachment" name="attachment[]"/>
</div>
<p class="help-block"><?php print $lh->translationFor("max")." ".CRM_MAX_ATTACHMENT_FILESIZE; ?>MB</p>
</div>
</div><!-- /.box-body -->
<div class="box-footer" id="attachment-list">
<label><?php $lh->translateText("attachments"); ?>: </label>
</div>
<div class="box-footer" id="compose-mail-results">
</div>
<div class="box-footer">
<div class="pull-right">
<button class="btn btn-primary" id="compose-mail-submit"><i class="fa fa-envelope-o"></i> <?php $lh->translateText("send"); ?></button>
</div>
<button class="btn btn-default" id="compose-mail-discard"><i class="fa fa-times"></i> <?php $lh->translateText("discard"); ?></button>
<!-- Module hook footer -->
<?php print $ui->getComposeMessageFooter(); ?>
</div><!-- /.box-footer -->
</form> <!-- /.form -->
</div><!-- /. box -->
</div><!-- /.col -->
<div id="mail-readmail" class="col-md-9" style="display: none;">
<div class="box box-default" id="message-full-box">
<div class="box-header with-border non-printable">
<h3 class="box-title"><?php print $lh->translationFor("read_message"); ?></h3>
</div><!-- /.box-header -->
<div class="box-body no-padding">
<div class="mailbox-read-info">
<h3 id="read-message-subject"></h3>
<h5><?php print $lh->translationFor("from"); ?> <span id="read-message-from"></span>
<span id="read-message-from-id" class="hidden"></span>
<span id="read-message-from-name" class="hidden"></span>
<span id="read-message-date" class="mailbox-read-time pull-right"></span></h5>
</div><!-- /.mailbox-read-info -->
<div class="mailbox-controls with-border text-center non-printable">
<div class="btn-group">
<button class="btn btn-default btn-sm mail-delete" style="font-size: 12px;" data-toggle="tooltip" title="Delete"><i class="fa fa-trash-o"></i></button>
<button class="btn btn-default btn-sm mail-reply hidden" data-toggle="tooltip" title="Reply"><i class="fa fa-reply"></i></button>
<button class="btn btn-default btn-sm mail-forward hidden" data-toggle="tooltip" title="Forward"><i class="fa fa-share"></i></button>
</div><!-- /.btn-group -->
<button class="btn btn-default btn-sm mail-print" data-toggle="tooltip" title="Print"><i class="fa fa-print"></i></button>
</div><!-- /.mailbox-controls -->
<div class="mailbox-read-message" id="mailbox-message-text">
</div><!-- /.mailbox-read-message -->
<div class="mail-preloader non-printable" style="margin: 30px 0 10px; text-align: center; display: none;">
<span class="dots">
<div class="circ1"></div><div class="circ2"></div><div class="circ3"></div><div class="circ4"></div>
</span>
</div>
</div><!-- /.box-body -->
<!-- Attachments (if any) -->
<div id="read-message-attachment"></div>
<div class="box-footer">
<div class="pull-right">
<button class="btn btn-default mail-reply hidden"><i class="fa fa-reply"></i> <?=$lh->translationFor('reply')?></button>
<button class="btn btn-default mail-forward hidden"><i class="fa fa-share"></i> <?=$lh->translationFor('forward')?></button>
</div>
<button class="btn btn-default mail-delete"><i class="fa fa-trash-o"></i> <?=$lh->translationFor('delete')?></button>
<button class="btn btn-default mail-print"><i class="fa fa-print"></i> <?=$lh->translationFor('print')?></button>
</div><!-- /.box-footer -->
</div><!-- /. box -->
</div><!-- /.col -->
</div><!-- /.row -->
<div id="contents-callbacks" class="row" style="display: none;">
<div class="card col-md-12" style="padding: 15px;">
<table id="callback-list" class="display" style="border: 1px solid #f4f4f4">
<thead>
<tr>
<th>
<?=$lh->translationFor('customer_name')?>
</th>
<th>
<?=$lh->translationFor('phone_number')?>
</th>
<th>
<?=$lh->translationFor('last_call_time')?>
</th>
<th>
<?=$lh->translationFor('callback_time')?>
</th>
<th>
<?=$lh->translationFor('campaign')?>
</th>
<th>
<?=$lh->translationFor('comments')?>
</th>
<th>
<?=$lh->translationFor('action')?>
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div><!-- /.row -->
<!-- Profile -->
<div class="unwrap" style="display: none;">
<div style="background-image: url(img/profile-bg.jpg)" class="bg-cover">
<div class="p-xl text-center text-white">
<span style="display:table; margin:0 auto;"><?=$ui->getVueAvatar($_SESSION['user'], $user->getUserAvatar(), 128)?></span>
<h3 class="m0"><?=$user->getUserName()?></h3>
<p><?=$_SESSION['user']?></p>
<p>Empowering the next generation contact centers.</p>
</div>
</div>
<div class="text-center bg-gray-dark p-lg mb-xl">
<div class="row row-table" style="height: 7%">
<div class="col-xs-4 br">
<h3 class="m0"><?php echo $totalcallstoday; ?></h3>
<p class="m0">
<span class="hidden-xs"><?=$lh->translationFor('calls_today')?></span>
<!-- <span>Views</span> -->
</p>
</div>
<div class="col-xs-4 br">
<h3 class="m0"><?php echo $totalsalestoday; ?></h3>
<p class="m0"><?=$lh->translationFor('sales_today')?></p>
</div>
<div class="col-xs-4">
<h3 class="m0">100</h3>
<p class="m0"><?=$lh->translationFor('tickets')?></p>
</div>
</div>
</div>
<div class="p-lg">
<div class="row">
<div class="col-lg-9">
<!-- START timeline-->
<ul class="timeline">
<li data-datetime="Today" class="timeline-separator"></li>
<!-- START timeline item-->
<li>
<div class="timeline-badge primary">
<em class="fa fa-comment"></em>
</div>
<div class="timeline-panel">
<div class="popover left">
<div class="arrow"></div>
<div class="popover-content">
<div class="table-grid table-grid-align-middle mb">
<div class="col col-xs">
<img src="img/user/05.jpg" alt="Image" class="media-object img-circle thumb48">
</div>
<div class="col">
<p class="m0">
<a href="#" class="text-muted">
<strong>Aiden Curtis</strong>
</a>posted a comment</p>
</div>
</div>
<p>
<em>"Fusce pellentesque congue justo in rutrum. Praesent non nulla et ligula luctus mattis eget at lacus."</em>
</p>
</div>
</div>
</div>
</li>
<!-- END timeline item-->
<!-- START timeline item-->
<li class="timeline-inverted">
<div class="timeline-badge green">
<em class="fa fa-picture-o"></em>
</div>
<div class="timeline-panel">
<div class="popover right">
<div class="arrow"></div>
<div class="popover-content">
<div class="table-grid table-grid-align-middle mb">
<div class="col col-xs">
<img src="img/user/04.jpg" alt="Image" class="media-object img-circle thumb48">
</div>
<div class="col">
<p class="m0">
<a href="#" class="text-muted">
<strong>James Payne</strong>
</a>shared a new idea</p>
</div>
</div>
<a href="#">
<img src="img/mockup.png" alt="Img" class="img-responsive">
</a>
<p class="text-muted mv">3 Comments</p>
<div class="media bb p">
<small class="pull-right text-muted">12m ago</small>
<div class="pull-left">
<img src="img/user/05.jpg" alt="Image" class="media-object img-circle thumb32">
</div>
<div class="media-body">