Subversion Repositories SmartDukaan

Rev

Rev 34968 | Rev 34987 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34968 Rev 34971
Line 732... Line 732...
732
 
732
 
733
	window.open(context + "/analysisDashboard?fofoId=" + fofoId, '_blank');
733
	window.open(context + "/analysisDashboard?fofoId=" + fofoId, '_blank');
734
});
734
});
735
 
735
 
736
$('#partnerTasks').modal({
736
$('#partnerTasks').modal({
737
	backdrop: 'static',   // Prevent close on outside click
737
	backdrop: 'static',
738
	keyboard: false       // Prevent close on ESC key
738
	keyboard: false
739
});
739
});
740
 
740
 
741
const emailId = getCookie('emailId');
741
const emailId = getCookie('emailId');
742
console.log("Email ID:", emailId);
742
console.log("Email ID:", emailId);
743
 
743
 
744
function showModal() {
744
function showModal() {
-
 
745
	if (emailId && emailId.endsWith('@smartdukaan.com')) {
-
 
746
		console.log('SmartDukaan user - modal not shown');
-
 
747
		return;
-
 
748
	}
745
	$('#partnerTasks').removeAttr('aria-hidden');
749
	$('#partnerTasks').removeAttr('aria-hidden');
746
 
750
 
747
	if (!emailId || !emailId.endsWith('@smartdukaan.com')) {
751
	if (!emailId || !emailId.endsWith('@smartdukaan.com')) {
748
		$('#chartData').html('<div class="loader text-center " style=" height: 30px;\n' +
752
		$('#chartData').html('<div class="loader text-center " style=" height: 30px;\n' +
749
			'    display: flex;\n' +
753
			'    display: flex;\n' +
Line 766... Line 770...
766
		$('#partnerTasks').css('zoom', '125%').modal('show');
770
		$('#partnerTasks').css('zoom', '125%').modal('show');
767
	}
771
	}
768
}
772
}
769
 
773
 
770
$(document).ready(function () {
774
$(document).ready(function () {
-
 
775
	if (emailId && emailId.endsWith('@smartdukaan.com')) {
-
 
776
		console.log('SmartDukaan user - no modal logic executed');
-
 
777
		return;
-
 
778
	}
771
	const today = new Date().toDateString();
779
	const today = new Date().toDateString();
772
	const currentHour = new Date().getHours();
780
	const currentHour = new Date().getHours();
773
	const stored = JSON.parse(localStorage.getItem('modalData') || '{}');
781
	const stored = JSON.parse(localStorage.getItem('modalData') || '{}');
774
 
782
 
775
	if (stored.date !== today) {
783
	if (stored.date !== today) {
Line 786... Line 794...
786
		$('.modal-backdrop').remove();
794
		$('.modal-backdrop').remove();
787
	}
795
	}
788
});
796
});
789
 
797
 
790
$(document).on('click', '.partner-tasks-btn', function () {
798
$(document).on('click', '.partner-tasks-btn', function () {
-
 
799
	if (emailId && emailId.endsWith('@smartdukaan.com')) {
-
 
800
		console.log('SmartDukaan user - button click blocked');
-
 
801
		return;
-
 
802
	}
791
	doGetAjaxRequestHandler(context + "/dashboardModal", function (response) {
803
	doGetAjaxRequestHandler(context + "/dashboardModal", function (response) {
792
		$('#chartData').html(response);
804
		$('#chartData').html(response);
793
		$('#partnerTasks').css('zoom', '125%').modal('show');
805
		$('#partnerTasks').css('zoom', '125%').modal('show');
794
		$('#partnerTasks').modal('show');
806
		$('#partnerTasks').modal('show');
795
	});
807
	});