<style>
.modal div[class*="col-md"], .modal div[class*="col-lg"], .modal div[class*="col-xs"], .modal div[class*="col-sm"] {
margin-bottom: 0px;
}
.d-flex
{
display: flex;
}
#selectEntityModal {
/*box-shadow: 0px 6px 18px rgb(0 0 0 / 9%);*/
/*border-radius: 12px;*/
}
#selectEntityModal .modal-body {
padding: 0 1rem;
}
#selectEntityModal p {
margin-bottom: .5rem;
}
#selectEntityModal .selectize-control {
min-width: 100%;
}
#selectEntityModal .selectize-input.items {
border: 1px solid #d0d0d0;
padding: 8px 8px;
display: inline-block;
width: 100%;
overflow: hidden;
position: relative;
z-index: 1;
box-sizing: border-box;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .1);
border-radius: 3px;
}
#selectEntityModalForm {
/*max-width: 500px;*/
background-color: #ffffff;
/*margin: 40px auto;*/
padding: 40px;
box-shadow: 0px 6px 18px rgb(0 0 0 / 9%);
/*border-radius: 12px;*/
}
#selectEntityModalForm .form-header {
gap: 5px;
text-align: center;
font-size: .9em;
}
#selectEntityModalForm .form-header .stepIndicator {
position: relative;
flex: 1;
padding-bottom: 30px;
}
#selectEntityModalForm .form-header .stepIndicator.active {
font-weight: 600;
}
#selectEntityModalForm .form-header .stepIndicator.finish {
font-weight: 600;
color: #009688;
}
#selectEntityModalForm .form-header .stepIndicator::before {
content: "";
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
z-index: 9;
width: 20px;
height: 20px;
background-color: #d5efed;
border-radius: 50%;
border: 3px solid #ecf5f4;
}
#selectEntityModalForm .form-header .stepIndicator.active::before {
background-color: #a7ede8;
border: 3px solid #d5f9f6;
}
#selectEntityModalForm .form-header .stepIndicator.finish::before {
background-color: #009688;
border: 3px solid #b7e1dd;
}
#selectEntityModalForm .form-header .stepIndicator::after {
content: "";
position: absolute;
left: 50%;
bottom: 8px;
width: 100%;
height: 3px;
background-color: #f3f3f3;
}
#selectEntityModalForm .form-header .stepIndicator.active::after {
background-color: #a7ede8;
}
#selectEntityModalForm .form-header .stepIndicator.finish::after {
background-color: #009688;
}
#selectEntityModalForm .form-header .stepIndicator:last-child:after {
display: none;
}
#selectEntityModalForm input {
padding: 15px 20px;
width: 100%;
font-size: 1em;
border: 1px solid #e3e3e3;
border-radius: 5px;
}
#selectEntityModalForm input:focus {
border: 1px solid #009688;
outline: 0;
}
#selectEntityModalForm input.invalid {
border: 1px solid #ffaba5;
}
#selectEntityModalForm .step {
display: none;
}
#selectEntityModalForm .form-footer {
overflow: auto;
gap: 20px;
}
#selectEntityModalForm .form-footer button {
background-color: #1d5b9e;
border: 1px solid #1d5b9e;
color: #ffffff;
border: none;
padding: 13px 30px;
font-size: 1em;
cursor: pointer;
border-radius: 5px;
flex: 1;
margin-top: 5px;
}
#selectEntityModalForm .form-footer button:hover {
opacity: 0.8;
}
#selectEntityModalForm .form-footer #promptInfo_prevBtn {
background-color: #fff;
color: #009688;
}
.box-selector {
padding: 10px 4px;
cursor: pointer;
}
.box-selector .inside {
padding: 5px;
border-radius: 5px;
-webkit-box-shadow: 10px 10px 48px -24px rgba(14, 26, 87, 1);
-moz-box-shadow: 10px 10px 48px -24px rgba(14, 26, 87, 1);
box-shadow: 10px 10px 48px -24px rgba(14, 26, 87, 1);
}
.box-selector .inside input {
cursor: pointer
}
.box-selector .inside textarea {
text-align: center;
cursor: pointer;
width: 100%;
border: none;
resize: none;
font-size: 14px;
color: #1d5b9e;
font-weight: bold;
}
.box-selector.sch_selector_mon .inside,
.box-selector.sch_selector_day .inside
/*.box-selector.sch_selector_time .inside*/
{
padding: 10px 5px;
}
.box-selector.sch_selector_time .inside {
padding: 4px 5px;
}
.step .view_if_has_schedules {
display: none;
}
.box-selector.active:not(.man_sch_selector) .inside {
border: 2px solid #1d5b9e;
-webkit-box-shadow: 10px 10px 24px -3px rgba(29, 91, 158, 1);
-moz-box-shadow: 10px 10px 24px -3px rgba(29, 91, 158, 1);
box-shadow: 10px 10px 24px -3px rgba(29, 91, 158, 1);
}
.box-selector.active.man_sch_selector .inside {
border: 2px solid #1d5b9e;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.box-selector.sch_selector_mon.active .inside,
.box-selector.sch_selector_day.active .inside,
.box-selector.sch_selector_time.active .inside {
border: 2px solid #1d5b9e;
-webkit-box-shadow: 4px 7px 24px -3px rgba(29, 91, 158, 1);
-moz-box-shadow: 10px 10px 24px -3px rgba(29, 91, 158, 1);
box-shadow: 4px 7px 24px -3px rgba(29, 91, 158, 1);
}
.box-selector .img {
margin-left: 5px;
}
.box-selector .title {
text-align: center;
font-size: 13px;
margin-top: auto;
margin-bottom: auto;
}
.box-selector.paymentMethodSelectorBtn .title {
text-align: center;
margin-bottom: 1px;
font-size: 14px;
}
.box-selector .sub-title {
font-size: 12px;
color: grey;
}
#selectEntityModal .routineTable {
text-align: left;
vertical-align: middle;
}
#selectEntityModal .routineTable .icon-delete {
color: darkred;
font-weight: bold;
}
#selectEntityModal .routineTable .icon-delete .fa {
padding: 10px;
border-radius: 39px;
border: 1px solid #eddcdc;
width: 34px;
height: 34px;
text-align: center;
}
#selectEntityModal .routineTable .icon-check {
color: green;
font-weight: bold;
}
#selectEntityModal .routineTable .icon-check .fa {
opacity: 0.1;
}
#selectEntityModal .routineTable .icon-check.isChecked .fa {
opacity: 1;
}
#selectEntityModal .routineTable .icon-check .fa {
padding: 10px;
border-radius: 39px;
border: 1px solid #eddcdc;
width: 34px;
height: 34px;
text-align: center;
}
#selectEntityModal .routineTable {
text-align: left;
vertical-align: middle;
}
#selectEntityModal .routineTable .icon-delete {
color: darkred;
font-weight: bold;
}
#selectEntityModal .routineTable .icon-delete .fa {
padding: 10px;
border-radius: 39px;
border: 1px solid #eddcdc;
width: 34px;
height: 34px;
text-align: center;
}
#selectEntityModal .routineTable .icon-check {
color: green;
font-weight: bold;
}
#selectEntityModal .routineTable .icon-check .fa {
opacity: 0.1;
}
#selectEntityModal .routineTable .icon-check.isChecked .fa {
opacity: 1;
}
#selectEntityModal .routineTable .icon-check .fa {
padding: 10px;
border-radius: 39px;
border: 1px solid #eddcdc;
width: 34px;
height: 34px;
text-align: center;
}
</style>
<div class="modal fade" id="selectEntityModal" tabindex="-1" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header" style="">
<div class="header dont_print">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel"><span class="fa fa-list"></span> Select Company</h4>
</div>
</div>
<div class="modal-body">
<div class="row clearfix">
<div class="col-md-12">
<form id="selectEntityModalForm" action="#">
<!-- start step indicators -->
<div style="display: none;" class="form-header d-flex mb-4">
<span class="stepIndicator seq_0" data-seq-id="0">Select Country</span>
</div>
<div class="step seq_0 ">
{# <h5 class=" ">Select a Country</h5>#}
<div class="row clearfix cg_holder">
</div>
</div>
<div class="form-footer d-flex" style="display: none;">
<button type="button" class="prevBtn" id="selectEntityModal_prevBtn">
Previous
</button>
<button type="button" class="nextBtn" id="selectEntityModal_nextBtn">
Next
</button>
</div>
</form>
</div>
</div>
</div>
{# <div class="modal-footer"> #}
{# </div> #}
</div>
</div>
</div>
<script>
var selectEntityModal = {};
var spd = "";
var csToken = '';
var nextServerUrl = '';
var currentTabSelectEntityModal=0;
var accessList=[];
var accessListInitiated=0;
{% if app.session.get('aceessList','') !='' %}
accessList={{ app.session.get('aceessList','')|json_encode|raw() }}
accessListInitiated=1
{% endif %}
function stepShowTab(n, parentSelector) {
// alert('here')
// This function will display the specified tab of the form...
parentSelector = parentSelector || '#selectEntityModal'
var prevN = -1;
$(parentSelector + ' .stepIndicator.active').each(function (gg, elem) {
prevN = 1 * $(elem).data('seqId');
});
var newN = 0;
if (n === '+1') {
newN = (1 * prevN) + 1;
} else if (n === '-1') {
newN = (1 * prevN) - 1;
} else
newN = n;
if (!$(parentSelector + ' .stepIndicator.seq_' + newN).length)
newN = (1 * prevN);
if (!$(parentSelector + ' .stepIndicator.seq_' + (newN + 1)).length)
$(parentSelector + " .nextBtn").text('Confirm');
else
$(parentSelector + " .nextBtn").text('Next');
if (!$(parentSelector + ' .stepIndicator.seq_' + (newN - 1)).length)
$(parentSelector + " .prevBtn").hide();
else
$(parentSelector + " .prevBtn").show();
// alert(prevN)
// alert(newN)
// alert($(parentSelector+' .stepIndicator.seq_'+(newN+1)).length)
if (prevN == newN) {
$(parentSelector).modal('hide')
return false;
}
$(parentSelector + ' .stepIndicator').removeClass('active')
$(parentSelector + ' .step').hide()
$(parentSelector + ' .step.seq_' + newN).show()
for (var gg = 0; gg <= newN; gg++)
$(parentSelector + ' .stepIndicator.seq_' + gg).addClass('active')
var triggerFunc = $(parentSelector + ' .step.seq_' + newN).attr('data-trigger-function');
if (typeof triggerFunc !== 'undefined' && triggerFunc !== false) {
window[triggerFunc]();
}
}
function getUserCompanyList(userGetType){
userGetType=userGetType||'_LOCAL_';
var pika_ind_id = "_NA_";
$('#selectEntityModal .cg_holder').empty();
var userTypeTextObject={
1: 'Admin',
2: 'User',
3: 'Vendor',
4: 'Customer',
5: 'Management User',
6: 'Group Owner',
7: 'GLobal User',
8: 'Applicant',
9: 'Collaborator',
}
if(userGetType =='_LOCAL_') {
$.ajax({
url: BaseURL + "get_users_by_query?queryStr=" + $('#tempUsername').val(),
type: 'POST',
dataType: 'json',
data: {},
error: function () {
// callback();
},
success: function (res) {
if (res.success == true) {
if (res.data.length == 1) {
var dt = res.data[0];
$('#gocId').val(dt['gocId']);
$('#username').val(dt['loginUserName']);
$('#loginform').submit();
} else {
for (var jj = 0; jj < res.data.length; jj++) {
var dt = res.data[jj];
var ggStr = ' <div class="box-selector cg_selector cg_' + dt['id'] + ' col-md-12 col-sm-12"' +
' data-id="' + dt['gocId'] + '" ' +
' data-goc-id="' + dt['gocId'] + '" ' +
' data-user-name="' + dt['loginUserName'] + '" ' +
' data-gen-class="cg_selector" ' +
'>' +
'<div class="inside" style="display: flex;"> ' +
'<div class="img" href="" style="' +
"background:url('" + dt['companyLogoUrl'] + "');" +
'height: 50px !important;width: 40%;background-position: left;background-size: contain;background-repeat: no-repeat;display: inline-block;"> ' +
'</div> ' +
'<h6 class="title" style="height: 2rem; width: 60%;text-align: left;">' + dt['companyName'] + ' <p class="sub-title">' + userTypeTextObject[dt['userType']] + '</p></h6> ' +
'</div>' +
'';
$('#selectEntityModal .cg_holder').append(ggStr);
}
$('#selectEntityModal').modal('show');
}
}
}
});
}
if(userGetType =='_CENTRAL_') {
if(accessListInitiated==1) {
if (accessList.length == 1) {
// var dt = res.data[0];
//
// $('#gocId').val(dt['gocId']);
// $('#username').val(dt['loginUserName']);
// $('#loginform').submit();
} else {
for (var jj = 0; jj < accessList.length; jj++) {
var dt = accessList[jj];
var ggStr = ' <div class="box-selector cg_selector cg_' + dt['id'] + ' col-md-12 col-sm-12"' +
' data-id="' + dt['appId'] + '" ' +
' data-app-id="' + dt['appId'] + '" ' +
' data-goc-id="0" ' +
// ' data-user-name="' + dt['loginUserName'] + '" ' +
' data-gen-class="cg_selector" ' +
' data-auth-str="' + dt['authenticationStr'] + '" ' +
' data-server-url="' + dt['serverUrl'] + '" ' +
' data-cs-token="{{ app.session.get('csToken','') }}" ' +
'>' +
'<div class="inside" style="display: flex;"> ' +
'<div class="img" href="" style="' +
"background:url('{{ constant('ApplicationBundle\\Constants\\GeneralConstant::HONEYBEE_CENTRAL_SERVER') }}" + dt['companyLogoUrl'] + "');" +
'height: 50px !important;width: 40%;background-position: left;background-size: contain;background-repeat: no-repeat;display: inline-block;"> ' +
'</div> ' +
'<h6 class="title" style="height: 2rem; width: 60%;text-align: left;">' + dt['companyName'] + ' <p class="sub-title">' + userTypeTextObject[dt['userType']] + '</p></h6> ' +
'</div>' +
'';
$('#selectEntityModal .cg_holder').append(ggStr);
}
$('#selectEntityModal').modal('show');
}
}
else {
$.ajax({
url: "{{ constant('ApplicationBundle\\Constants\\GeneralConstant::HONEYBEE_CENTRAL_SERVER') }}/getSessionDataForApp" ,
type: 'POST',
dataType: 'json',
data: {
token:'{{ app.session.get('csToken','') }}'
},
error: function () {
// callback();
},
success: function (res) {
if (res.success == true) {
accessList=res.session_data.userAccessList;
// console.log(accessList)
for (var jj = 0; jj < accessList.length; jj++) {
var dt = accessList[jj];
var ggStr = ' <div class="box-selector cg_selector cg_' + dt['id'] + ' col-md-12 col-sm-12"' +
' data-id="' + dt['appId'] + '" ' +
' data-app-id="' + dt['appId'] + '" ' +
' data-goc-id="0" ' +
// ' data-user-name="' + dt['loginUserName'] + '" ' +
' data-gen-class="cg_selector" ' +
' data-auth-str="' + dt['authenticationStr'] + '" ' +
' data-server-url="' + dt['serverUrl'] + '" ' +
' data-cs-token="{{ app.session.get('csToken','') }}" ' +
'>' +
'<div class="inside" style="display: flex;"> ' +
'<div class="img" href="" style="' +
"background:url('{{ constant('ApplicationBundle\\Constants\\GeneralConstant::HONEYBEE_CENTRAL_SERVER') }}" + dt['companyLogoUrl'] + "');" +
'height: 50px !important;width: 40%;background-position: left;background-size: contain;background-repeat: no-repeat;display: inline-block;"> ' +
'</div> ' +
'<h6 class="title" style="height: 2rem; width: 60%;text-align: left;">' + dt['companyName'] + ' <p class="sub-title">' + userTypeTextObject[dt['userType']] + '</p></h6> ' +
'</div>' +
'';
$('#selectEntityModal .cg_holder').append(ggStr);
}
$('#selectEntityModal').modal('show');
}
}
});
}
}
}
jQuery(document).ready(function () {
stepShowTab(currentTabSelectEntityModal, '#selectEntityModal')
$(document).on('click', '.box-selector', function () {
$('.' + $(this).data('genClass')).removeClass('active')
$(this).addClass('active')
})
$(document).on('click', '#selectEntityModal .prevBtn', function () {
//validate action here
// if (!validateForm()) return false;
stepShowTab('-1', '#selectEntityModal')
})
$(document).on('click', '#selectEntityModal .stepIndicator', function () {
//validate action here
// if (!validateForm()) return false;
stepShowTab($(this).data('seqId'), '#selectEntityModal')
})
$(document).on('click', '#selectEntityModal .nextBtn', function () {
//validate action here
// if (!validateForm()) return false;
stepShowTab('+1', '#selectEntityModal')
})
$(document).on('click', '#selectEntityModal .cg_selector', function () {
if (typeof $(this).data('authStr') !== 'undefined') {
window.spd=$(this).data('authStr');
window.csToken=$(this).data('authStr');
window.nextServerUrl=$(this).data('serverUrl');
$.ajax({
url: BaseURL+"logout" ,
type: 'POST',
dataType: 'json',
data: {
returnJson: 1
},
error: function () {
// callback();
},
success: function (res) {
if (res.success == true) {
window.location.href=(window.nextServerUrl+'/switch_app?spd='+window.spd+'&csToken='+window.csToken);
}
}
});
}
else
{
$('#gocId').val($(this).data('gocId'));
$('#username').val($(this).data('userName'));
$('#loginform').submit();
}
})
});
</script>