| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/surf_sites/surfcrm.com_training/layout/ |
Upload File : |
<?
$httpdocs = $_SERVER['DOCUMENT_ROOT'];
$htmlBody = ob_get_clean();
if(empty($title))
{
$title = "SurfCRM New Employee Training";
}
header("X-Robots-Tag: noindex, nofollow", true);
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<?
if($phone) {
?>
<meta name="viewport" content="initial-scale=<?=$scale?>, minimum-scale=<?=$scale?>, maximum-scale=<?=$scale?>">
<?
}
?>
<title>
<?=$title?>
</title>
<link type="text/css" href="/api/surf_style.css" rel="stylesheet" title="main"/>
<link rel="stylesheet" type="text/css" href="/layout/style/font-awesome/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="/icon/glyphicons_pro_1_9_2/glyphicons/web/html_css/css/glyphicons.css">
<link rel="stylesheet" type="text/css" href="/layout/style/bootstrap/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="/layout/style/common.css"/>
<link rel="stylesheet" type="text/css" href="/layout/style/training.css?update_date=2020-08-18"/>
<link rel="stylesheet" type="text/css" href="/layout/style/app.css"/>
<link href="/layout/style/uploadfile.min.css" rel="stylesheet" />
<script type="text/javascript" src="/js/jquery/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="/js/jquery/jquery-ui-1.8.13.min.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.signature.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.uploadfile.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.formatter.min.js"></script>
<script type="text/javascript" src="/js/angular.js"></script>
<script type="text/javascript" src="/js/angular-animate.js"></script>
<script src="/layout/style/audio/mediaelement-and-player.min.js"></script>
<link rel="stylesheet" type="text/css" href="/layout/style/audio/mediaelementplayer.css">
<script>
//document.domain = "surfcrm.com";
var app = angular.module('surfTraining', ['ngAnimate']);
app.run(function($rootScope, $http, filterFilter, $timeout) {
<?
if(!empty($user))
{
?>
angular.element(document).ready(function () {
<?
if(!empty($autoID))
{
if($autoParentID > 0)
{
?>
angular.element(document.querySelector('#nav-<?=$autoParentID?>')).click();
angular.element(document.querySelector('#sub-<?=$autoID?>')).click();
<?
}
else
{
?>
angular.element(document.querySelector('#nav-<?=$autoID?>')).click();
<?
}
}
?>
});
$rootScope.role = '<?=$role?>';
$rootScope.username = '<?=$username?>';
$rootScope.userFullName = '<?=$employeeData[0]['fullname']?>';
$rootScope.changeName=function(name) {
$rootScope.userFullName=name;
}
$rootScope.userData = {};
$rootScope.personData = {};
$rootScope.signedData = [];
$rootScope.signedData.signDocument = false;
$rootScope.signedData.dateSigned = new Date();
$rootScope.hasSignature = <?=(($employeeSignature[0]['signature'] == '{"lines":[]}' || empty($employeeSignature[0]['signature']))?'false':'true')?>;
$rootScope.showItem = false;
$rootScope.personalInfoForm = {};
$rootScope.userData.fmtBirthday = '';
$rootScope.userData.signatureCheck = false;
$rootScope.scriptAudios = 0;
$rootScope.scriptComplete = 0;
$rootScope.objectionAudios = 0;
$rootScope.objectionComplete = 0;
$rootScope.requiresSignature = false;
$rootScope.trainingComplete = <?=(($trainingComplete == 1) ? 'true' : 'false')?>;
$rootScope.trainingEmailSent = <?=(($trainingEmailSent) ? 'true' : 'false')?>;
$rootScope.workFromHome = <?=(($workFromHome) ? 'true' : 'false')?>;
$rootScope.role = '<?=$role?>';
$rootScope.firstTime = <?=(($firstLogin == 1) ? 'true' : 'false')?>;
$rootScope.saveUserData = false;
$rootScope.showSurvey = false;
$rootScope.showAppointment = false;
$rootScope.states = ["<?=(implode('", "', $states))?>"];
$rootScope.step = '<?=((!empty($_REQUEST['step'])) ? $_REQUEST['step'] : (($_SESSION['role']=='Marketer') ? 3 : 1))?>';
<?
if(count($employeeData) > 0)
{
?>
$rootScope.personData = <?=underscoreToCamel(stripslashes(json_encode($employeeData[0])))?>;
<?
}
else
{
?>
$rootScope.personData = {};
<?
}
?>
$rootScope.personData.user = '<?=$user?>';
$rootScope.personData.repId = '<?=$username?>';
$rootScope.personData.type = 'employee_picture';
$rootScope.userData.signatureId = <?=((!empty($employeeSignature[0]['id']))?$employeeSignature[0]['id']:"''")?>;
$rootScope.userData.signature = <?=((!empty($employeeSignature[0]['signature']))?$employeeSignature[0]['signature']:"''")?>;
$rootScope.isWorkFromHome = '<?=(($employeeSignature[0]['work_from_home'] == 1)?true:false)?>';
$rootScope.personData.empPic = '<?=$employeeData[0]['file_path']?>';
$rootScope.userData.signatures = <?=((!empty($employeeSignatures)) ? stripslashes(json_encode($employeeSignatures)):"[]")?>;
$rootScope.onlineForms = <?=((!empty($onlineForms))?stripslashes(json_encode($onlineForms)):"''")?>;
$rootScope.surveyQuestions = <?=((!empty($surveyQuestions))?stripslashes(json_encode($surveyQuestions)):"''")?>;
$rootScope.compSurveyQuestions = angular.copy($rootScope.surveyQuestions);
$rootScope.rating = <?=((!empty($ratings))?stripslashes(json_encode($ratings)):"{}")?>;
$rootScope.userData.documents = <?=((!empty($employeeDocs))?stripslashes(json_encode($employeeDocs)):"''")?>;
$rootScope.userData.requiredDocuments = <?=stripslashes(json_encode($requiredDocs))?>;
$rootScope.stepFourSections = <?=json_encode($stepFourSections)?>;
$rootScope.stepFiveSections = <?=json_encode($stepFiveSections)?>;
$rootScope.trainings = <?=json_encode(array_merge($stepFourSections, $stepFiveSections))?>;
$rootScope.completedAudio = <?=((!empty($listenedToData))?json_encode($listenedToData):"''")?>;
$rootScope.surveyComplete = '<?=$surveyComplete?>';
$rootScope.isEmpty = function (obj) {
for (var i in obj) if (obj.hasOwnProperty(i)) return false;
return true;
};
$rootScope.setTags = function()
{
var tagTraining = $rootScope.trainings;
var parentTag = 0;
var neededSections = 0;
var isSigned = 0;
var completeSections = {complete:[], incomplete:[], ignored:[]};
var tagTrainingApp = [];
for(surf in tagTraining)
{
var obj = tagTraining[surf];
if(obj.parent_id == 0)
{
tagTrainingApp[obj.id] = [];
tagTrainingApp[obj.id].section = obj.section;
}
}
for(surf in tagTraining)
{
var obj = tagTraining[surf];
if(obj.parent_id > 0)
{
tagTrainingApp[obj.parent_id].push(tagTraining[surf]);
}
else
{
tagTrainingApp[obj.id].push(tagTraining[surf]);
}
}
for(parent in tagTrainingApp)
{
var isSigned = 0;
var neededSections = 0;
obj.needsSignature = false;
for(sec in tagTrainingApp[parent])
{
var obj = tagTrainingApp[parent][sec];
if(obj.needs_signature == 1)
{
neededSections++;
obj.needsSignature = true;
obj.isSigned = false;
for(i in $rootScope.userData.signatures)
{
var signObj = $rootScope.userData.signatures[i];
var signId = signObj.training_section_id;
if(signId == obj.id)
{
isSigned++;
obj.isSigned = true;
}
}
}
}
tagTrainingApp[parent].neededSections = neededSections;
tagTrainingApp[parent].isSigned = isSigned;
if(neededSections == isSigned && neededSections > 0)
{
tagTrainingApp[parent].complete = true;
tagTrainingApp[parent].needed = true;
tagTrainingApp[parent].started = true;
tagTrainingApp[parent].finished = true;
}
else if(neededSections == 0 && isSigned == 0)
{
tagTrainingApp[parent].complete = true;
tagTrainingApp[parent].needed = false;
tagTrainingApp[parent].started = true;
tagTrainingApp[parent].finished = true;
}
else if(neededSections != isSigned && neededSections > 0 && isSigned > 0)
{
tagTrainingApp[parent].complete = false;
tagTrainingApp[parent].needed = true;
tagTrainingApp[parent].started = true;
tagTrainingApp[parent].finished = false;
}
else if(neededSections != isSigned && neededSections > 0 && isSigned == 0)
{
tagTrainingApp[parent].complete = false;
tagTrainingApp[parent].needed = true;
tagTrainingApp[parent].started = false;
tagTrainingApp[parent].finished = false;
}
}
for(s in tagTrainingApp)
{
var obj = tagTrainingApp[s];
var parentTagId = s+obj.section;
if(obj.complete == true && obj.needed == true && obj.started == true && obj.finished == true)
{
$('#tag-'+parentTagId).removeClass('red fa-circle-o');
$('#tag-'+parentTagId).removeClass('orange fa-dot-circle-o');
$('#tag-'+parentTagId).addClass('green fa-circle');
}
else if(obj.complete == false && obj.needed == true && obj.started == true && obj.finished == false)
{
$('#tag-'+parentTagId).removeClass('red fa-circle-o');
$('#tag-'+parentTagId).addClass('orange fa-dot-circle-o');
$('#tag-'+parentTagId).removeClass('green fa-circle');
}
else if(obj.complete == true && obj.needed == false && obj.started == true && obj.finished == true)
{
$('#tag-'+parentTagId).removeClass('red fa-circle-o');
$('#tag-'+parentTagId).removeClass('orange fa-dot-circle-o');
$('#tag-'+parentTagId).addClass('green fa-circle');
}
else if(obj.complete == false && obj.needed == false && obj.started == true && obj.finished == true)
{
$('#tag-'+parentTagId).removeClass('red fa-circle-o');
$('#tag-'+parentTagId).removeClass('orange fa-dot-circle-o');
$('#tag-'+parentTagId).addClass('green fa-circle');
}
else if(obj.complete == false && obj.needed == true && obj.started == false && obj.finished == false)
{
$('#tag-'+parentTagId).addClass('red fa-circle-o');
$('#tag-'+parentTagId).removeClass('orange fa-dot-circle-o');
$('#tag-'+parentTagId).removeClass('green fa-circle');
}
else
{
$('#tag-'+parentTagId).addClass('red fa-circle-o');
$('#tag-'+parentTagId).removeClass('orange fa-dot-circle-o');
$('#tag-'+parentTagId).removeClass('green fa-circle');
}
for(sec in obj)
{
var isSigned = obj[sec].isSigned;
var needsSignature = obj[sec].needsSignature;
var childTagId = obj[sec].id+obj[sec].section;
if(isSigned == true && needsSignature == true)
{
$('#tag-'+childTagId).removeClass('red fa-circle-o');
$('#tag-'+childTagId).removeClass('orange fa-dot-circle-o');
$('#tag-'+childTagId).addClass('green fa-circle');
}
else if(isSigned == false && needsSignature == true)
{
$('#tag-'+childTagId).addClass('red fa-circle-o');
$('#tag-'+childTagId).removeClass('orange fa-dot-circle-o');
$('#tag-'+childTagId).removeClass('green fa-circle');
}
else if(isSigned == false && needsSignature == false)
{
$('#tag-'+childTagId).removeClass('red fa-circle-o');
$('#tag-'+childTagId).removeClass('orange fa-dot-circle-o');
$('#tag-'+childTagId).addClass('green fa-circle');
}
}
}
};
$rootScope.setComplete = function()
{
if($rootScope.percentageComplete >= 100 &&
$rootScope.stepOneComplete.min >= 99 &&
$rootScope.stepTwoComplete.min >= 99 &&
$rootScope.stepThreeComplete.min >= 99 &&
$rootScope.stepFourComplete.min >= 99 &&
$rootScope.stepFiveComplete.min >= 99)
{
var empID = $('#employee_id').val();
var str = "empID="+encodeURIComponent(empID) + "&";
str += "emailSent="+$rootScope.trainingEmailSent;
$http({
method : 'POST',
url : 'functions/setComplete.php',
data : str,
headers : { 'Content-Type': 'application/x-www-form-urlencoded' }
}).success(function(data) {
$rootScope.trainingComplete = true;
$rootScope.trainingEmailSent = true;
$rootScope.showAppointment = true;
/*$timeout(function() {
window.location = "https://surfcrm.com/training_finish_appointment.php?u=<?= urlencode(base64_encode($_SESSION['username']));?>";
}, 3000);*/
});
}
};
$rootScope.clickedAppointment = function() {
$rootScope.showAppointment = false;
if(!$rootScope.surveyComplete)
{
$rootScope.showSurvey = true;
}
};
$rootScope.savePercentage = function() {
$rootScope.totalPercentage = $rootScope.stepOneComplete.min;
$rootScope.totalPercentage += $rootScope.stepTwoComplete.min;
$rootScope.totalPercentage += $rootScope.stepThreeComplete.min;
$rootScope.totalPercentage += $rootScope.stepFourComplete.min;
$rootScope.totalPercentage += $rootScope.stepFiveComplete.min;
$rootScope.percentageComplete = (100 / 500) * $rootScope.totalPercentage;
if($rootScope.percentageComplete > 100)
{
$rootScope.percentageComplete = 100;
}
if($rootScope.percentageComplete < 0)
{
$rootScope.percentageComplete = 0;
}
var empID = $rootScope.personData.user;
var str = "empID=" + encodeURIComponent(empID) + "&";
str += "percentage=" + $rootScope.percentageComplete;
$http({
method : 'POST',
url : "functions/setPercentage.php",
data : str,
headers : { 'Content-Type': 'application/x-www-form-urlencoded' }
}).success(function(data)
{
if(data.result == "success")
{
}
else
{
}
});
};
$rootScope.setSigning = function(step, section){
var isSigned = false;
$rootScope.signedData.signDocument = false;
for(i in $rootScope.userData.signatures)
{
if(isSigned == false)
{
var secId = $rootScope.userData.signatures[i].section_id;
var tesId = step+section;
if(tesId == secId)
{
$rootScope.signedData.signDocument = true;
$rootScope.signedData.dateSigned = new Date($rootScope.userData.signatures[i].ts);
isSigned = true;
break;
}
}
}
if(step == 4 || step == 5)
{
for(t in $rootScope.trainings)
{
var obj = $rootScope.trainings[t];
if(obj.step == step && obj.section == section)
{
if(obj.needs_signature == 0)
{
$rootScope.requiresSignature = false;
}
else
{
$rootScope.requiresSignature = true;
}
}
}
}
$rootScope.setComplete();
};
$rootScope.setScriptPercentage = function()
{
var audios = 0;
var listened = 0;
$('#scripts').find('audio').each(function(index, element) {
audios++;
});
$('#scripts').find('.audioComplete').each(function(index, element) {
listened++;
});
/*if(audios > listened)
{
$rootScope.requiresSignature = false;
}
else if(audios == listened)
{
$rootScope.requiresSignature = true;
}
else
{
$rootScope.requiresSignature = false;
}*/
$rootScope.requiresSignature = true;
$rootScope.scriptAudios = audios;
$rootScope.scriptComplete = listened;
$rootScope.savePercentage();
};
$rootScope.setObjectionPercentage = function()
{
var audios = 0;
var listened = 0;
$('#objections').find('audio').each(function(index, element) {
audios++;
});
$('#objections').find('.audioComplete').each(function(index, element) {
listened++;
});
if(audios > listened)
{
$rootScope.requiresSignature = false;
}
else if(audios == listened)
{
$rootScope.requiresSignature = true;
}
else
{
$rootScope.requiresSignature = false;
}
$rootScope.objectionAudios = audios;
$rootScope.objectionComplete = listened;
$rootScope.savePercentage();
};
$rootScope.numberoferrors = function(form){
var count = 0,
errors = form.$error;
angular.forEach(errors, function(val){ if(angular.isArray(val)) { count += val.length; } });
return count;
};
$rootScope.stepOneComplete = {
min: 0,
max: 100
};
$rootScope.stepTwoComplete = {
min: 0,
max: 100
};
$rootScope.stepThreeComplete = {
min: 0,
max: 100
};
$rootScope.stepFourComplete = {
min: 0,
max: 100
};
$rootScope.stepFiveComplete = {
min: 0,
max: 100
};
$rootScope.userDataProgress = function() {
var totalInputs = 10;
//var totalInputs = 9;
var inputIncomplete = 0;
if($rootScope.personData.firstName == '')
{
inputIncomplete++;
}
if($rootScope.personData.lastName == '')
{
inputIncomplete++;
}
if($rootScope.personData.address == '')
{
inputIncomplete++;
}
if($rootScope.personData.city == '')
{
inputIncomplete++;
}
if($rootScope.personData.state == '')
{
inputIncomplete++;
}
if($rootScope.personData.zip == '')
{
inputIncomplete++;
}
if($rootScope.personData.phoneMobile == '')
{
inputIncomplete++;
}
if($rootScope.personData.birthday == '')
{
inputIncomplete++;
}
if($rootScope.personData.email == '')
{
inputIncomplete++;
}
if($rootScope.personData.empPic == '')
{
inputIncomplete++;
}
//console.log($rootScope.personData);
var percent = ((inputIncomplete/totalInputs) * 100);
if(percent < 100)
{
percent = Math.round(100 - percent);
}
$rootScope.stepOneComplete.min = percent;
$rootScope.saveUserData = true;
//console.log(inputIncomplete+"/"+totalInputs+" = "+percent+" : changed personal information: "+$rootScope.saveUserData);
$rootScope.setComplete();
$rootScope.savePercentage();
};
//$rootScope.userDataProgress();
$rootScope.legalProgress = function(){
var numRequired = $rootScope.userData.requiredDocuments.length;
var numUploaded = 0;
for(doc in $rootScope.userData.documents)
{
var docType = $rootScope.userData.documents[doc].document_type;
for(req in $rootScope.userData.requiredDocuments)
{
var reqDoc = $rootScope.userData.requiredDocuments[req];
if(reqDoc == docType)
{
numUploaded++;
}
}
}
if(numUploaded == numRequired)
{
$rootScope.stepTwoComplete.min = 100;
}
else
{
if(numUploaded > 0)
{
var docPercent = Math.round((numUploaded/numRequired) * 100);
if(docPercent > 100)
{
docPercent = 100;
}
$rootScope.stepTwoComplete.min = docPercent;
}
if(numUploaded == 0)
{
$rootScope.stepTwoComplete.min = 0;
}
}
$rootScope.savePercentage();
};
$rootScope.compensationProgress = function(){
$rootScope.stepThreeComplete.min = 0;
var signatures = $rootScope.userData.signatures
var hasCompensation = false;
for(s in signatures)
{
var myID = signatures[s].step+""+signatures[s].section;
if(myID == '30-0')
{
hasCompensation = true;
}
}
if($rootScope.hasSignature == true && hasCompensation == true)
{
$rootScope.stepThreeComplete.min = 100;
}
else
{
$rootScope.stepThreeComplete.min = 0;
}
$rootScope.savePercentage();
};
$rootScope.compensationProgress();
$rootScope.stepFourSectionsProgress = function(){
var numSections = 0;
var numSigned = 0;
for(training in $rootScope.stepFourSections)
{
var needsSignature = $rootScope.stepFourSections[training]['needs_signature'];
var section = $rootScope.stepFourSections[training]['section'];
var step = $rootScope.stepFourSections[training]['step'];
var reqID = step+section;
if(needsSignature == 1)
{
numSections++;
for(sig in $rootScope.userData.signatures)
{
var secID = $rootScope.userData.signatures[sig].section_id;
if(reqID == secID)
{
numSigned++;
}
}
}
}
//There is an extra one somewhere
numSections--;
var sectionPercent = 0;
if(numSigned > 0 && numSections > 0)
{
sectionPercent = Math.round((numSigned/numSections) * 100);
}
if(sectionPercent > 100)
{
sectionPercent = 100;
}
$rootScope.stepFourComplete.min = sectionPercent;
$rootScope.savePercentage();
};
$rootScope.stepFiveSectionsProgress = function(){
var numSections = 0;
var numSigned = 0;
for(training in $rootScope.stepFiveSections)
{
var needsSignature = $rootScope.stepFiveSections[training]['needs_signature'];
var section = $rootScope.stepFiveSections[training]['section'];
var step = $rootScope.stepFiveSections[training]['step'];
var reqID = $rootScope.stepFiveSections[training]['id'];
if(needsSignature == 1)
{
numSections++;
//var found_it = false;
for(sig in $rootScope.userData.signatures)
{
var secID = $rootScope.userData.signatures[sig].training_section_id;
if(reqID == secID)
{
numSigned++;
//found_it = true;
break;
}
}
//if(!found_it) {
// console.log($rootScope.stepFiveSections[training]);
//}
}
}
var sectionPercent = 0;
if(numSigned > 0 && numSections > 0)
{
sectionPercent = Math.round((numSigned/numSections) * 100);
}
if(sectionPercent > 100)
{
sectionPercent = 100;
}
$rootScope.stepFiveComplete.min = sectionPercent;
$rootScope.savePercentage();
};
$rootScope.setSignature = function(id, step, section, sectionID)
{
var img = $('#sig_59').find('canvas').get(0).toDataURL("image/png");
var str = 'signature_img='+encodeURIComponent(img);
str += '&signature='+$('#signatureJSON_59').val();
$http({
method : 'POST',
url : 'functions/setSignature.php',
data : str,
headers : { 'Content-Type': 'application/x-www-form-urlencoded' }
}).success(function(data) {
$rootScope.userData.signatureCheck = true;
$rootScope.hasSignature = true;
var str = 'section='+encodeURIComponent(section);
str += '&step='+encodeURIComponent(step);
str += '&id='+encodeURIComponent(sectionID);
$('#tag-'+sectionID+sec).removeClass('red fa fa-circle-o');
$('#tag-'+sectionID+sec).removeClass('orange fa fa-dot-circle-o');
$('#tag-'+sectionID+sec).addClass('green fa fa-circle');
$rootScope.dateSigned = new Date();
str += '&action=ADD';
$http({
method : 'POST',
url : "functions/setSignatures.php",
data : str,
headers : { 'Content-Type': 'application/x-www-form-urlencoded' }
}).success(function(data)
{
if(data.result == "success")
{
$rootScope.signedData.signDocument = true;
$rootScope.userData.signatures.push(data.signature);
if(step == 3)
{
$rootScope.stepThreeComplete.min = 100;
}
if(step == 4)
{
$rootScope.stepFourSectionsProgress();
}
if(step == 5)
{
$rootScope.stepFiveSectionsProgress();
}
$rootScope.setTags();
$rootScope.setComplete();
}
else
{
}
});
});
};
$rootScope.range = function(count){
return Array.apply(0, Array(+count)).map(function(value,index){
return index;
});
}
<?
}
?>
console.log("SurfCRM Training Application Started..... ");
});
</script>
<script type="text/javascript" src="/js/controllers.js"></script>
<script type="text/javascript" src="/js/directives.js"></script>
<script type="text/javascript" src="/js/services.js"></script>
<script type="text/javascript" src="/js/start.js?ts=2020_11_03"></script>
<script type="text/javascript" src="/api/surf_action.js"></script>
<script language="javascript" type="application/javascript">
<?php
/*if(!empty($trainingComplete)) {
$has_appointment = $db->get_results("SELECT id FROM surfcrm.calendar WHERE username='".$db->clean($_SESSION['username'])."' AND type_label='one_on_one' LIMIT 1");
if(empty($has_appointment)) {
?>
window.location = "https://surfcrm.com/training_finish_appointment.php?u=<?= urlencode(base64_encode($_SESSION['username']));?>";
<?php }
}*/ ?>
var timeout_interval = self.setInterval("check_is_timed_out()", 240000);
check_is_timed_out();
<?
if(($role == 'Marketer' ||
$role == 'Grant Research Lead' ||
$role == 'Coaching') &&
!in_array(strtolower($username), array('jasons','joelb','leslieg','aaron','jeremy','woodrow')))
{
?>
var clock_out_popup_inactivity_interval = 1200000; // 20 minutes of inactivity
function make_internal_popup_clock(data)
{
$('body').append('<div id="id-popup-overlay"></div>');
$('body').append('<div id="id-popup-container"></div>');
$('#id-popup-overlay').attr('style','z-index:10000;position:fixed;top:0px;left:0px;bottom:0px;right:0px;background:rgba(0,0,0,.6);');
$('#id-popup-container').attr('style','z-index:10001;position:fixed;top:0px;left:0px;background:white;border-radius:16px;padding:15px;overflow:auto;');
$('#id-popup-container').html('<img class="ui-popup-close-button" src="/images/notebook_close_24x24.png" style="position:absolute;top:4px;right:5px;width:24px;height:24px;cursor:pointer;" onclick="$(\'#id-popup-container\').remove(); $(\'#id-popup-overlay\').remove();" />');
$('#id-popup-container').append(data);
$('#id-popup-container').css('max-height',$(window).height());
$('#id-popup-container').css('max-width',$(window).width());
$('#id-popup-container').css('left',$(window).width()/2 - $('#id-popup-container').width()/2);
$('#id-popup-container').css('top',$(window).height()/2 - $('#id-popup-container').height()/2);
$('#id-popup-container').resize(function() {
$('#id-popup-container').css('max-height',$(window).height());
$('#id-popup-container').css('max-width',$(window).width());
$('#id-popup-container').css('left',$(window).width()/2 - $('#id-popup-container').width()/2);
$('#id-popup-container').css('top',$(window).height()/2 - $('#id-popup-container').height()/2);
});
$('window').resize(function() {
$('#id-popup-container').css('max-height',$(window).height());
$('#id-popup-container').css('max-width',$(window).width());
$('#id-popup-container').css('left',$(window).width()/2 - $('#id-popup-container').width()/2);
$('#id-popup-container').css('top',$(window).height()/2 - $('#id-popup-container').height()/2);
});
}
var pop_ups_blocked = false;
var clock_out_window = null;
var clock_out_popup_timer = 60;
var clock_out_interval = window.setInterval("show_clock_out_popup()",clock_out_popup_inactivity_interval);
var clock_out_popup_interval = null;
var im_on_break = false;
function clock_out_popup_countdown()
{
if(clock_out_window != null)
{
if(clock_out_window.closed)
{
stay_logged_in();
}
else
{
if(clock_out_popup_timer<=0)
{
window.clearInterval(clock_out_popup_interval);
exit_session('FORCE');
}
else
{
if(clock_out_popup_timer<=15)
{
$('#id-popup-overlay').css('background','red');
}
clock_out_popup_timer--;
$(clock_out_window.document.body).find('#clock_out_popup_continue').val('Stay Logged In ('+clock_out_popup_timer+')');
$(clock_out_window.document.head).find('title').html('LOGGING OUT IN '+clock_out_popup_timer);
$('#clock_out_popup_continue').val('Stay Logged In ('+clock_out_popup_timer+')');
$('title').html('LOGGING OUT IN '+clock_out_popup_timer);
}
}
}
else
{
if(pop_ups_blocked == false)
{
//they closed the window
stay_logged_in();
}
else
{
if(clock_out_popup_timer <= 0)
{
window.clearInterval(clock_out_popup_interval);
exit_session('FORCE');
}
else
{
clock_out_popup_timer--;
$('#clock_out_popup_continue').val('Stay Logged In ('+clock_out_popup_timer+')');
$('title').html('LOGGING OUT IN '+clock_out_popup_timer);
}
}
}
}
function stay_logged_in()
{
im_on_break = false;
window.clearInterval(clock_out_interval);
window.clearInterval(clock_out_popup_interval);
clock_out_popup_timer = 60;
clock_out_interval = window.setInterval("show_clock_out_popup()",clock_out_popup_inactivity_interval);
$('title').html('Surf CRM');
$('.ui-popup-close-button').click();
if(clock_out_window != null)
{
clock_out_window.close();
}
clock_out_window = null;
}
function go_ahead_and_log_out()
{
im_on_break = false;
window.clearInterval(clock_out_interval);
window.clearInterval(clock_out_popup_interval);
clock_out_popup_timer = 60;
$('.ui-popup-close-button').click();
exit_session('GRACEFUL');
if(clock_out_window != null)
{
clock_out_window.close();
}
clock_out_window = null;
}
function show_clock_out_popup()
{
im_on_break = false;
var left = (screen.width/2) - (150);
var top = (screen.height/2) - (57);
pop_ups_blocked = false;
clock_out_window = window.open('','clock_out_window','left='+left+',top='+top+',width=300,height=114,menubar=no,location=no');
if(!clock_out_window || clock_out_window.outerHeight === 0)
{
pop_ups_blocked = true;
clock_out_window = null;
}
else
{
$(clock_out_window.document.head).html('<title>SurfCRM</title>');
$(clock_out_window.document.body).html('<center><h1>Are you still there?</h1><input type="button" id="clock_out_popup_continue" value="Stay Logged In (20)" class="ui-basic-button" onclick="opener.stay_logged_in(); window.close();" /> <input type="button" id="clock_out_popup_log_out" value="Log out" class="ui-basic-button" onclick="opener.go_ahead_and_log_out(); window.close();" /></center>');
clock_out_window.focus();
clock_out_window.onblur = function() { this.focus(); };
}
make_internal_popup_clock('<h1>Are you still there?</h1><input type="button" id="clock_out_popup_continue" onclick="stay_logged_in();" value="Stay Logged In (20)" class="ui-basic-button" /> <input type="button" id="clock_out_popup_log_out" value="Log out" onclick="go_ahead_and_log_out();" class="ui-basic-button" />');
$('.ui-popup-close-button').hide();
window.clearInterval(clock_out_interval);
window.clearInterval(clock_out_popup_interval);
clock_out_popup_timer = 60;
clock_out_popup_interval = window.setInterval("clock_out_popup_countdown()",1000);
}
$(document).mousemove(function(event)
{
if(im_on_break == false)
{
window.clearInterval(clock_out_interval);
clock_out_interval = window.setInterval("show_clock_out_popup()",clock_out_popup_inactivity_interval);
}
});
$(document).keypress(function()
{
if(im_on_break == false)
{
window.clearInterval(clock_out_interval);
clock_out_interval = window.setInterval("show_clock_out_popup()",clock_out_popup_inactivity_interval);
}
});
function show_break_info()
{
show_feedback("Loading",50);
var str = "username=<?=$username;?>";
$.ajax
({
cache: false,
type: "POST",
data: str,
url: "bin/ajax/select_break_info.php",
success: function(msg)
{
close_feedback('DONE',50);
make_internal_popup_clock(msg);
},error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus+' : '+errorThrown);
}
});
}
function use_a_break(me,type,timer)
{
im_on_break = true;
$(me).attr('disabled','disabled');
$(me).unbind('click');
window.clearInterval(clock_out_interval);
window.clearInterval(clock_out_popup_interval);
clock_out_popup_timer = 60;
clock_out_interval = window.setInterval("show_clock_out_popup()",timer);
var str = "type="+encodeURIComponent(type)+"&username=<?=$username;?>";
$.ajax
({
cache: false,
type: "POST",
data: str,
url: "bin/ajax/insert_break_info.php",
success: function(msg)
{
$('#id-popup-container,#id-popup-overlay').remove();
},error: function(jqXHR, textStatus, errorThrown){
alert(textStatus+' : '+errorThrown);
}
});
}
<?
}
?>
</script>
</head>
<body ng-app="surfTraining" class="ng-cloak" ng-controller="training" style="overflow-y:scroll;">
<div class="rb" ng-controller="trainingHeader">
<div class="rb left dark-gray-bg" style="height:64px;">
<div class="aib left f18 bold white" style="left:105px; top:20px;">
<?=ucwords($role)?> Training
</div>
<div class="ab f12 white"
style="
right:24px;
top:18px;
">
<table>
<tr>
<td class="pl10 pt4">
<div class="rb f13 white" ng-show="userFullName">
{{userFullName}}
</div>
<div class="rb f11 light-gray" ng-show="username" style="top:-1px;">
{{role}}
</div>
</td>
<td>
<div id="logoutButton" class="hmbl" title="Logout" onclick="exit_session('BTN');">
<div class="aib glyphicons glyphicons-log-out normal" style="left:2px; top:-28px; font-size:25px;"></div>
<div style="color:white;font-size:8px;font-weight:bold;position:absolute;left:9px;top:4px;">Logout</div>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="ui-header-top-icon pointer"
onclick="window.location = '/'"
style=" background-size:cover;
width:80px;
height:37px;
top:12px;
left:16px;
"></div>
</div>
<div class="">
<div class="row dark-gray-bg tborder p20 cc">
<div class="rib cc white" ng-if="role == 'Marketer' || role=='Coaching'">
<span class="f16 bold">
Welcome to SurfCRM.com<br />
Please complete each step below by reading or watching the content in each section of training.<br />
You will need to "CLICK" and "Sign" at the bottom of each training page.<br />
After you are finished, please fill out the survey at the bottom.
</span>
</div>
<div class="rib cc white" ng-if="role == 'Customer Service'">
<span class="f16 bold">
Welcome to SurfCRM.com. There are a few<br>things we need before you can get started.
</span>
</div>
<div class="rib cc white" ng-if="role == 'Programmer'">
<span class="f16 bold">
Welcome to SurfCRM.com. What up brogrammer!?<br> Here is some stuff only programmers see, soooo....
</span>
</div>
</div>
<div class="container-fluid">
<?
/*
<div class="row white-bg">
<div class="col-lg-12 ui-header-top" style="height:32px;">
<div class="absolute block f12 white uppercase" style="right:20px; top:10px;">
<div class="relative iblock rollover-underline pointer" style="margin-right:20px;"
onclick="window.location='/';"
ng-show="trainingComplete == true && firstTime == false">
Back to Surf
</div>
<div class="relative iblock rollover-underline pointer" style="margin-right:20px;"
onclick="exit_session('BTN');">
Logout
</div>
<div class="relative iblock" style="">
<?=$username?>
</div>
</div>
</div>
<div class="col-lg-12 ui-header-middle center-center hidden-xs">
<div class="relative iblock center-center white">
<div class="f28" style="margin-top:-15px;">Employee Training</div>
<div class="f16">
Welcome to SurfCRM.com. There are a few<br>things we need before you can get started making sales.
</div>
</div>
<div class="relative iblock center-center" style="width:0px; height:100%; margin-left:-1px;">
</div>
</div>
<div class="col-xs-12 ui-header-middle center-center hidden-sm hidden-md hidden-lg">
<div class="f28 white ts" style="margin-top:20px; padding:10px;">New Employee Training</div>
</div>
<div class="ui-header-top-icon"></div>
</div>
*/
?>
<?
if(!empty($user))
{
echo $htmlBody;
}
?>
</div>
<?
//---------------------------------------------------------
include('inc/sign.php');
//---------------------------------------------------------
?>
<input type="hidden" name="username" id="username" value="<?=$_SESSION['username']?>" />
<input type="hidden" name="employee_id" id="employee_id" value="<?=$_SESSION['employee_id']?>" />
<div id="overlay" class="fixed block center-center"
style="overflow:scroll; width:100%; height:100%; top:0px; left:0px; background-color:rgba(0,0,0,0.3); display:none;">
<div class="absolute block" style="width:100%; height:100%;" onclick="$(this).fadeOut(200).html('');"></div>
<div id="overlayHTML" class="relative iblock center-center">
</div>
<div class="relative iblock center-center" style="width:0px; height:100%; margin-left:-1px;">
</div>
</div>
<div class="relative block" style="height:140px;"></div>
<div class="fixed block black-bg light-gray" style="width:100%; height:150px; bottom:0px; left:0px;"
ng-show="trainingComplete == true && firstTime == true">
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12" style=""></div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12" style="">
<div class="relative block center-center pt10">
<div class="f24 bold light-green p4">
Congratulations on completing training.
</div>
<div class="f18 bold p4">
You should hear from our sales manager, Jason, within the next 48 hours to receive an extension. If he hasn't been able to reach you in that time, please feel free to call him at 800-858-1052 ext. 263
</div>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12" style=""></div>
</div>
</div>
<div id="id-feedback-form-holder" align="right" style="height:330px; bottom:-294px;">
<div id="id-feedback-tab" onclick="show_some_feedback();">
<table width="100%" height="100%">
<tr>
<td style="width:18px; padding:4px 6px 4px 6px;">
<span class="glyphicons glyphicons-hospital f18 light-red"></span>
</td>
<td style="padding:4px 4px 4px 4px;">
REPORT ISSUE
</td>
</tr>
</table>
</div>
<div id="id-feedback-form" style="height:310px; width:500px; padding:15px;">
<div id='data-feedback' align="left">
loading...
</div>
</div>
</div>
<div ng-show="showAppointment">
<div id="scheduleAppointment" class="fixed block center-center layer-top"
style="width:100%; height:100%; left:0px; top:0px; background-color:rgba(0,0,0,0.5);">
<div class="absolute block" style="width:100%; height:100%; left:0px; top:0px;"
ng-click="showAppointment = !showAppointment"></div>
<div class="relative iblock center-center" style="margin-top:20px;background:white;">
<p style="font-size:32px;">Congratulations, you've completed training! The last step is to schedule a brief Zoom video call with the sales manager so he can walk you through the startup process, assign you an extension and answer any questions you have. The video call should only take about 15 minutes. If possible, schedule a time when you'll have access to the computer you'll be using for the job. Click the link below to schedule your video call:</p>
<p style="font-size:32px;"><a href="https://surfcrm.com/training_finish_appointment.php?u=<?= urlencode(base64_encode($_SESSION['username']));?>" ng-click="clickedAppointment();">Schedule Appointment</a></p>
</div>
</div>
</div>
<div ng-controller="survey">
<div class="fixed block blue-bg white center pointer" ng-show="trainingComplete == true && firstTime == true" ng-click="showSurvey = !showSurvey"
style="bottom:0px; right:160px; height:36px; width:100px;">
<div class="relative block center f12"
style="top:11px;">
SURVEY
</div>
</div>
<div id="trainingSurvey" class="fixed block center-center layer-top" ng-show="showSurvey"
style="width:100%; height:100%; left:0px; top:0px; background-color:rgba(0,0,0,0.5);">
<div class="absolute block" style="width:100%; height:100%; left:0px; top:0px;"
ng-click="showSurvey = !showSurvey"></div>
<div class="relative iblock center-center" style="margin-top:20px;">
<div class="left" ng-include="'/inc/trainingSurvey.html'"></div>
</div>
</div>
</div>
<script>
$(document).ready(function(e) {
if('<?=$ua['name']?>' == 'Apple Safari' || '<?=$ua['name']?>' == 'Mozilla Firefox')
{
$('#birthdayDesc').show();
}
});
</script>
</body>
</html>