update 39839999
This commit is contained in:
@@ -1542,7 +1542,19 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// rrrrr
|
// rrrrr
|
||||||
function SaveMailHandlers(category,item_ref,handlers,app,cb){
|
function SaveMailHandlers(category,item_ref,handlers,app,cb,subscribers){
|
||||||
|
for(let prop in handlers){
|
||||||
|
let exist = false;
|
||||||
|
for (let n = 0; n < subscribers.length; n++) {
|
||||||
|
const element = subscribers[n];
|
||||||
|
if(element.reference_num==handlers[prop].reference_num){
|
||||||
|
exist = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(exist) continue;
|
||||||
|
subscribers.push(handlers[prop]);
|
||||||
|
}
|
||||||
$.post(app.extra.url,{
|
$.post(app.extra.url,{
|
||||||
save_mail_handlers: true,
|
save_mail_handlers: true,
|
||||||
handlers: JSON.stringify(handlers),
|
handlers: JSON.stringify(handlers),
|
||||||
@@ -1550,7 +1562,7 @@
|
|||||||
item_reference_num: item_ref
|
item_reference_num: item_ref
|
||||||
},function(resp){
|
},function(resp){
|
||||||
resp = JSON.parse(resp);
|
resp = JSON.parse(resp);
|
||||||
if(cb!=undefined) cb(resp);
|
if(cb!=undefined) cb(resp,subscribers);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -1651,6 +1663,7 @@
|
|||||||
function GetThisDomainMemberSettings(tmpConfig,app){
|
function GetThisDomainMemberSettings(tmpConfig,app){
|
||||||
let _domain = null;
|
let _domain = null;
|
||||||
if(app.extra.root==undefined) app.extra.root = {};
|
if(app.extra.root==undefined) app.extra.root = {};
|
||||||
|
console.log(tmpConfig.root.member.json_data)
|
||||||
for (let i = 0; i < tmpConfig.root.member.json_data.domains.length; i++) {
|
for (let i = 0; i < tmpConfig.root.member.json_data.domains.length; i++) {
|
||||||
const element = tmpConfig.root.member.json_data.domains[i];
|
const element = tmpConfig.root.member.json_data.domains[i];
|
||||||
if(element.domain_name==app.extra.config.managed_domain.Domain){
|
if(element.domain_name==app.extra.config.managed_domain.Domain){
|
||||||
@@ -2421,31 +2434,60 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transforms the mail_handler from a database object to a standered object
|
||||||
|
* @param {object} mail_handlers
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
function StructureEmailHandlers(mail_handlers){
|
function StructureEmailHandlers(mail_handlers){
|
||||||
|
|
||||||
|
// check to see if mail_handlers is already formated
|
||||||
|
if(mail_handlers.length > 0){
|
||||||
|
if(mail_handlers[0].json==undefined){
|
||||||
|
return mail_handlers;
|
||||||
|
}
|
||||||
|
}
|
||||||
var tmp_mail_handlers = {};
|
var tmp_mail_handlers = {};
|
||||||
|
let container = [];
|
||||||
for (let n = 0; n < mail_handlers.length; n++) {
|
for (let n = 0; n < mail_handlers.length; n++) {
|
||||||
const element = mail_handlers[n];
|
const element = mail_handlers[n];
|
||||||
tmp_mail_handlers[element.json.reference_num] = element.json;
|
tmp_mail_handlers[element.json.reference_num] = element.json;
|
||||||
tmp_mail_handlers[element.json.reference_num]["item_reference_num"] = element.item_reference_num;
|
tmp_mail_handlers[element.json.reference_num]["item_reference_num"] = element.item_reference_num;
|
||||||
|
container.push(tmp_mail_handlers[element.json.reference_num]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return tmp_mail_handlers;
|
return container;
|
||||||
}
|
}
|
||||||
function SortEmailHandlersIntoItem(item_handlers,item){
|
|
||||||
var mail_handler = {};
|
|
||||||
|
|
||||||
for(element in item_handlers){
|
function SortEmailHandlersIntoItem(item_handlers,reference_num){
|
||||||
if(item_handlers[element]["item_reference_num"] == item.json.reference_num){
|
var mail_handler = {};
|
||||||
let refnum = item_handlers[element].reference_num;
|
for (let i = 0; i < item_handlers.length; i++) {
|
||||||
mail_handler[refnum] = item_handlers[element];
|
// console.log(item_handlers[i])
|
||||||
|
if(item_handlers[i]["item_reference_num"]=="") continue;
|
||||||
|
if(item_handlers[i]["item_reference_num"] == reference_num){
|
||||||
|
let refnum = item_handlers[i]["reference_num"];
|
||||||
|
mail_handler[refnum] = item_handlers[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mail_handler;
|
return mail_handler;
|
||||||
}
|
}
|
||||||
function InitializeEmailCreatorDashboard2(handlers,cbMain,cbSave,cbExit,app,append_container){
|
function InitializeEmailCreatorDashboard2(handlers,cbMain,cbSave,cbExit,app,append_container,item_reference_num=null){
|
||||||
let handlersInstance = new EmailHandlerManager(handlers,app);
|
let handlersInstance = new EmailHandlerManager(handlers,app);
|
||||||
let emailContainer = null;
|
let emailContainer = null;
|
||||||
// console.log(handlersInstance.handlers);
|
// console.log(handlersInstance.handlers);
|
||||||
|
|
||||||
|
function MySave(cbSave,emailContainer,handlersInstance,item_reference_num,app,cb){
|
||||||
|
if(emailContainer==null){
|
||||||
|
cbSave(null, handlersInstance.handlers);
|
||||||
|
}else{
|
||||||
|
|
||||||
|
handlersInstance.handlers[handlersInstance.current.ref_group][emailContainer.email.reference_num] = emailContainer.email;
|
||||||
|
handlersInstance.handlers[handlersInstance.current.ref_group][emailContainer.email.reference_num].item_reference_num = item_reference_num;
|
||||||
|
cbSave(emailContainer.email, handlersInstance.handlers);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function _init_category(app){
|
function _init_category(app){
|
||||||
AFSSpinner.showFullScreen(false);
|
AFSSpinner.showFullScreen(false);
|
||||||
function setupListHandlers(app){
|
function setupListHandlers(app){
|
||||||
@@ -2586,16 +2628,17 @@
|
|||||||
let reference_num = "v"+app.utils.randomGenerator(12).toLowerCase();
|
let reference_num = "v"+app.utils.randomGenerator(12).toLowerCase();
|
||||||
handler.reference_num = reference_num;
|
handler.reference_num = reference_num;
|
||||||
handler.name = value;
|
handler.name = value;
|
||||||
// 77777
|
handlersInstance.handlers[handlersInstance.current.ref_group].item_reference_num = item_reference_num;
|
||||||
let ref_num = handlersInstance.current.ref_group;
|
// 77777 rrrrr
|
||||||
handlersInstance.addHandler(reference_num, handler);
|
handlersInstance.addHandler(reference_num, handler);
|
||||||
setupListHandlers(app);
|
setupListHandlers(app);
|
||||||
$("#new_template_name_input").val("");
|
$("#new_template_name_input").val("");
|
||||||
cbSave(handler, handlersInstance.handlers);
|
// TODO_1: EmailBuilder - Because emailContainer do not save
|
||||||
|
MySave(cbSave,null,handlersInstance,item_reference_num,app,function(){});
|
||||||
RemoveModal(modal);
|
RemoveModal(modal);
|
||||||
AFSSpinner.showFullScreen(false);
|
AFSSpinner.showFullScreen(false);
|
||||||
|
|
||||||
console.log(handler);
|
// console.log(handler);
|
||||||
|
|
||||||
// console.log(handlersInstance.current);
|
// console.log(handlersInstance.current);
|
||||||
|
|
||||||
@@ -2689,8 +2732,10 @@
|
|||||||
var optionSelected = $("option:selected", this);
|
var optionSelected = $("option:selected", this);
|
||||||
var valueSelected = this.value;
|
var valueSelected = this.value;
|
||||||
emailContainer.email.from = valueSelected;
|
emailContainer.email.from = valueSelected;
|
||||||
handlersInstance.handlers[emailContainer.email.reference_num] = emailContainer.email;
|
// TODO_3: EmailBuilder - reference by first objectb because it should only be one object
|
||||||
cbSave(emailContainer.email, handlersInstance.handlers);
|
// handlersInstance.handlers[emailContainer.email.reference_num] = emailContainer.email;
|
||||||
|
// cbSave(emailContainer.email, handlersInstance.handlers);
|
||||||
|
MySave(cbSave,emailContainer,handlersInstance,item_reference_num,app,function(){});
|
||||||
});
|
});
|
||||||
$("#delivery_from_email_select").val(emailContainer.email.from);
|
$("#delivery_from_email_select").val(emailContainer.email.from);
|
||||||
|
|
||||||
@@ -2726,7 +2771,8 @@
|
|||||||
$("#emailbuilder_active_checkbox_id").prop('checked', emailContainer.email.active);
|
$("#emailbuilder_active_checkbox_id").prop('checked', emailContainer.email.active);
|
||||||
$("#emailbuilder_active_checkbox_id").on("change",function(e){
|
$("#emailbuilder_active_checkbox_id").on("change",function(e){
|
||||||
saveCheckboxActive(app);
|
saveCheckboxActive(app);
|
||||||
cbSave(emailContainer.email,handlersInstance.handlers);
|
// cbSave(emailContainer.email,handlersInstance.handlers);
|
||||||
|
MySave(cbSave,emailContainer,handlersInstance,item_reference_num,app,function(){});
|
||||||
});
|
});
|
||||||
|
|
||||||
// $("#delivery_from_email_select").on("change",function(e){
|
// $("#delivery_from_email_select").on("change",function(e){
|
||||||
@@ -2815,23 +2861,21 @@
|
|||||||
emailContainer.email.variables.schema[n].value = $(editor.getContent()).text().trim();
|
emailContainer.email.variables.schema[n].value = $(editor.getContent()).text().trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(emailContainer.email.variables.schema);
|
// console.log(emailContainer.email.variables.schema);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let ref_num = handlersInstance.current.ref_group;
|
let ref_num = handlersInstance.current.ref_group;
|
||||||
console.log(ref_num);
|
// console.log(ref_num);
|
||||||
emailContainer.email.name = $("#emailbuilder_name_input_id").val().trim();
|
emailContainer.email.name = $("#emailbuilder_name_input_id").val().trim();
|
||||||
handlersInstance.addHandler(emailContainer.email.reference_num, emailContainer.email);
|
handlersInstance.addHandler(emailContainer.email.reference_num, emailContainer.email);
|
||||||
|
|
||||||
|
|
||||||
console.log(emailContainer.email);
|
|
||||||
console.log(handlersInstance.handlers);
|
|
||||||
saveCheckboxAlert(app);
|
saveCheckboxAlert(app);
|
||||||
saveCheckboxActive(app);
|
saveCheckboxActive(app);
|
||||||
$("#save_badge_indicator_id").css("display","none");
|
$("#save_badge_indicator_id").css("display","none");
|
||||||
cbSave(emailContainer.email, handlersInstance.handlers);
|
// cbSave(emailContainer.email, handlersInstance.handlers);
|
||||||
|
MySave(cbSave,emailContainer,handlersInstance,item_reference_num,app,function(){});
|
||||||
});
|
});
|
||||||
$("#options_delete_emailbuilder_id").on("click",function(e){
|
$("#options_delete_emailbuilder_id").on("click",function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -2843,12 +2887,10 @@
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
MySpinnerOn(function(MySpinnerOff){
|
MySpinnerOn(function(MySpinnerOff){
|
||||||
console.log(handlersInstance);
|
|
||||||
console.log(handlersInstance.current.ref_group);
|
|
||||||
console.log(emailContainer.email.reference_num);
|
|
||||||
|
|
||||||
delete handlersInstance.handlers[handlersInstance.current.ref_group]["handlers"][emailContainer.email.reference_num];
|
delete handlersInstance.handlers[handlersInstance.current.ref_group]["handlers"][emailContainer.email.reference_num];
|
||||||
cbSave(emailContainer.email, handlersInstance.handlers);
|
// cbSave(emailContainer.email, handlersInstance.handlers);
|
||||||
|
MySave(cbSave,emailContainer, handlersInstance,item_reference_num,app,function(){});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setTimeout(() => { MySpinnerOff(); },1000);
|
setTimeout(() => { MySpinnerOff(); },1000);
|
||||||
RemoveModal(modal);
|
RemoveModal(modal);
|
||||||
@@ -2905,8 +2947,9 @@
|
|||||||
emailContainer.email.variables.schema[index]["value"] = $(editor.getContent()).text().trim();
|
emailContainer.email.variables.schema[index]["value"] = $(editor.getContent()).text().trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
handlersInstance.handlers[emailContainer.email.reference_num] = emailContainer.email;
|
// handlersInstance.handlers[emailContainer.email.reference_num] = emailContainer.email;
|
||||||
cbSave(emailContainer.email, handlersInstance.handlers);
|
// cbSave(emailContainer.email, handlersInstance.handlers);
|
||||||
|
MySave(cbSave,emailContainer, handlersInstance,item_reference_num,app,function(){});
|
||||||
$("#save_badge_indicator_id").css("display","none");
|
$("#save_badge_indicator_id").css("display","none");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3293,11 +3336,14 @@
|
|||||||
emailContainer.email.body_mjml_html = decodedString; //editor.getHtml();
|
emailContainer.email.body_mjml_html = decodedString; //editor.getHtml();
|
||||||
|
|
||||||
// 77777
|
// 77777
|
||||||
// console.log(emailContainer.email);
|
|
||||||
// console.log({html: decodedString});
|
|
||||||
handlersInstance.addHandler(emailContainer.email.reference_num, emailContainer.email);
|
// handlersInstance.addHandler(emailContainer.email.reference_num, emailContainer.email);
|
||||||
handlersInstance.handlers[emailContainer.email.reference_num] = emailContainer.email;
|
// handlersInstance.handlers[emailContainer.email.reference_num] = emailContainer.email;
|
||||||
cbSave(emailContainer.email, handlersInstance.handlers);
|
// cbSave(emailContainer.email, handlersInstance.handlers);
|
||||||
|
console.log(emailContainer);
|
||||||
|
console.log(handlersInstance);
|
||||||
|
MySave(cbSave,emailContainer,handlersInstance,item_reference_num,app,function(){});
|
||||||
});
|
});
|
||||||
},500);
|
},500);
|
||||||
|
|
||||||
|
|||||||
@@ -87,15 +87,15 @@ class AFSSurveyJSForm {
|
|||||||
// TODO_1: go through all the handlers, this only selects the firs one
|
// TODO_1: go through all the handlers, this only selects the firs one
|
||||||
let mail_handler_prop = "";
|
let mail_handler_prop = "";
|
||||||
|
|
||||||
for(let prop1 in mail_handlers){
|
// for(let prop1 in mail_handlers){
|
||||||
for(let prop in mail_handlers[prop1].handlers){
|
// for(let prop in mail_handlers[prop1].handlers){
|
||||||
mail_handler_prop = prop;
|
// mail_handler_prop = prop;
|
||||||
break; // this does not need to break
|
// break; // this does not need to break
|
||||||
}
|
// }
|
||||||
mail_handlers = mail_handlers[prop1].handlers[mail_handler_prop];
|
// mail_handlers = mail_handlers[prop1].handlers[mail_handler_prop];
|
||||||
break; // only one should have been sent, so breaking is not required
|
// break; // only one should have been sent, so breaking is not required
|
||||||
}
|
// }
|
||||||
console.log(mail_handlers);
|
// console.log(mail_handlers);
|
||||||
|
|
||||||
|
|
||||||
self.survey.onComplete.add(function(survey,options){
|
self.survey.onComplete.add(function(survey,options){
|
||||||
@@ -111,11 +111,43 @@ class AFSSurveyJSForm {
|
|||||||
onStartCompleteCB(formSubmittion,form,survey);
|
onStartCompleteCB(formSubmittion,form,survey);
|
||||||
if(postData){
|
if(postData){
|
||||||
|
|
||||||
if(mail_handlers!=undefined && mail_handlers!=null){
|
// if(mail_handlers!=undefined && mail_handlers!=null){
|
||||||
let email = self.__getVariable("email", mail_handlers.variables.client);
|
// let email = self.__getVariable("email", mail_handlers.variables.client);
|
||||||
mail_handlers.emails = [email];
|
// mail_handlers.emails = [email];
|
||||||
}else{
|
// }else{
|
||||||
mail_handlers = {"__empty":true};
|
// mail_handlers = {"__empty":true};
|
||||||
|
// }
|
||||||
|
|
||||||
|
let client_variables = [];
|
||||||
|
client_variables.push({
|
||||||
|
"name": "form_name",
|
||||||
|
"value": form.name,
|
||||||
|
})
|
||||||
|
let response_email = null;
|
||||||
|
for (let v = 0; v < formSubmittion.length; v++) {
|
||||||
|
const element = formSubmittion[v];
|
||||||
|
// console.log(element);
|
||||||
|
if(element.form.name==undefined){continue;}
|
||||||
|
if(typeof element.answer !== 'string'){continue;}
|
||||||
|
if(element.form.name=="email"){
|
||||||
|
response_email = element.answer;
|
||||||
|
}
|
||||||
|
client_variables.push({
|
||||||
|
"name": element.form.name,
|
||||||
|
"value": element.answer,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(response_email!=null){
|
||||||
|
for(let prop1 in mail_handlers){
|
||||||
|
for(let prop2 in mail_handlers[prop1].handlers){
|
||||||
|
if(mail_handlers[prop1].handlers[prop2]['alert']==true)
|
||||||
|
continue;
|
||||||
|
mail_handlers[prop1].handlers[prop2]['emails'] = [response_email];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let senddata = {
|
let senddata = {
|
||||||
@@ -124,8 +156,13 @@ class AFSSurveyJSForm {
|
|||||||
form_reference_num: form.json.reference_num,
|
form_reference_num: form.json.reference_num,
|
||||||
submission_json: JSON.stringify(formSubmittion),
|
submission_json: JSON.stringify(formSubmittion),
|
||||||
form_json: JSON.stringify(form),
|
form_json: JSON.stringify(form),
|
||||||
mail_handlers: JSON.stringify(mail_handlers)
|
mail_handlers: JSON.stringify(mail_handlers),
|
||||||
|
client_variables: JSON.stringify([client_variables])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(form);
|
||||||
|
console.log(client_variables);
|
||||||
|
console.log(formSubmittion);
|
||||||
$.post(url, senddata, function(resp){
|
$.post(url, senddata, function(resp){
|
||||||
// console.log(JSON.parse(resp));
|
// console.log(JSON.parse(resp));
|
||||||
onPostCompleteCB(formSubmittion,form,survey);
|
onPostCompleteCB(formSubmittion,form,survey);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ var Flags = Object.freeze({
|
|||||||
Component: "comp",
|
Component: "comp",
|
||||||
Method: "meth"
|
Method: "meth"
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
(function(factory) {
|
(function(factory) {
|
||||||
// Establish the root object, `window` (`self`) in the browser, or `global` on the server.
|
// Establish the root object, `window` (`self`) in the browser, or `global` on the server.
|
||||||
@@ -269,6 +269,8 @@ function RUN(root,$,b,_,bootstrap){
|
|||||||
this._props_._root_element_component = element;
|
this._props_._root_element_component = element;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// ddddd
|
||||||
/**
|
/**
|
||||||
* Register a method to be called later with in the app
|
* Register a method to be called later with in the app
|
||||||
*/
|
*/
|
||||||
@@ -606,7 +608,8 @@ ComponentManager.prototype = {};
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
}// 33333
|
}
|
||||||
|
// ddddd
|
||||||
ComponentFactory.prototype = {
|
ComponentFactory.prototype = {
|
||||||
|
|
||||||
|
|
||||||
@@ -2291,6 +2294,7 @@ function ViewComponent2(opts,elements){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 33333
|
||||||
// xxxxxh
|
// xxxxxh
|
||||||
function ViewComponent(opts){
|
function ViewComponent(opts){
|
||||||
gl_HandleAll(this,opts,'ViewComponent');
|
gl_HandleAll(this,opts,'ViewComponent');
|
||||||
@@ -12002,7 +12006,7 @@ function _addAppElementToList(self){
|
|||||||
|
|
||||||
|
|
||||||
var CONNECTED_COMPONENTS = [];
|
var CONNECTED_COMPONENTS = [];
|
||||||
// 7676 50505 77777 xxxxx
|
// 7676 50505 77777 xxxxx // ddddd
|
||||||
function ApplicationManager_start_runInterval(self){
|
function ApplicationManager_start_runInterval(self){
|
||||||
let interval = setInterval(function(){
|
let interval = setInterval(function(){
|
||||||
//var GL_COMPONENTS = self.getComponents();
|
//var GL_COMPONENTS = self.getComponents();
|
||||||
|
|||||||
@@ -2395,21 +2395,6 @@ GLOBAL_SETTINGS.SUBSCRIBER = [
|
|||||||
"reference_abbr": "sub",
|
"reference_abbr": "sub",
|
||||||
"display_name": "News5",
|
"display_name": "News5",
|
||||||
"description": "",
|
"description": "",
|
||||||
"catalogs_config": {
|
|
||||||
"subscriber_confirmation_email":{
|
|
||||||
"on":false,
|
|
||||||
"email_response":{
|
|
||||||
"title":"",
|
|
||||||
"body":"",
|
|
||||||
"subject":"",
|
|
||||||
"email":"",
|
|
||||||
"template":"_email_alert",
|
|
||||||
"from":"no-reply",
|
|
||||||
"image": "",
|
|
||||||
"footer":""
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"short_description": "",
|
"short_description": "",
|
||||||
"reference_num": "sub_239874234",
|
"reference_num": "sub_239874234",
|
||||||
"articles": [
|
"articles": [
|
||||||
@@ -2417,27 +2402,7 @@ GLOBAL_SETTINGS.SUBSCRIBER = [
|
|||||||
"title":"My 1 Post",
|
"title":"My 1 Post",
|
||||||
"reference_num":"sub_897345jgd",
|
"reference_num":"sub_897345jgd",
|
||||||
"type":"email",
|
"type":"email",
|
||||||
"delivered":false,
|
"delivered":false
|
||||||
"email_response":{
|
|
||||||
"title":"",
|
|
||||||
"body":"",
|
|
||||||
"subject":"",
|
|
||||||
"email":"",
|
|
||||||
"template":"_email_alert",
|
|
||||||
"from":"no-reply",
|
|
||||||
"image": "",
|
|
||||||
"footer":""
|
|
||||||
},
|
|
||||||
"email_alert":{
|
|
||||||
"title":"",
|
|
||||||
"body":"",
|
|
||||||
"subject":"",
|
|
||||||
"emails":[],
|
|
||||||
"template":"_email_alert",
|
|
||||||
"from":"no-reply",
|
|
||||||
"image": "",
|
|
||||||
"footer":""
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"subscribers":[]
|
"subscribers":[]
|
||||||
@@ -2450,15 +2415,12 @@ GLOBAL_SETTINGS.SUBSCRIBER_CATALOG = [
|
|||||||
json: {
|
json: {
|
||||||
"mysql_id":-1,
|
"mysql_id":-1,
|
||||||
"category":"subscriber_catalog",
|
"category":"subscriber_catalog",
|
||||||
|
"title": "",
|
||||||
|
"reference_num": "",
|
||||||
"nameid":"default",
|
"nameid":"default",
|
||||||
"release_type": false,
|
"release_type": false,
|
||||||
"description": "",
|
"description": "",
|
||||||
"short_description": "",
|
"short_description": ""
|
||||||
"mail_handlers": {
|
|
||||||
"email_response":{},
|
|
||||||
"email_alert":{}
|
|
||||||
},
|
|
||||||
"subscribers":[]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@@ -2468,11 +2430,7 @@ GLOBAL_SETTINGS.SUBSCRIBER_ARTICLES = [
|
|||||||
json: {
|
json: {
|
||||||
"category":"catalog_article",
|
"category":"catalog_article",
|
||||||
"delivery_type": "email",
|
"delivery_type": "email",
|
||||||
"deliveries": [],
|
"deliveries": []
|
||||||
"mail_handlers": {
|
|
||||||
"email_delivery": {},
|
|
||||||
"link_delivery": {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -43,13 +43,13 @@
|
|||||||
}, function(obj){
|
}, function(obj){
|
||||||
obj = JSON.parse(obj);
|
obj = JSON.parse(obj);
|
||||||
|
|
||||||
console.log(obj);
|
// console.log(obj);
|
||||||
tmpConfig.root.member = obj.member;
|
tmpConfig.root.member = obj.member;
|
||||||
// tmpConfig.root.access = obj.results.access;
|
// tmpConfig.root.access = obj.results.access;
|
||||||
tmpConfig.root.config = obj.config;
|
tmpConfig.root.config = obj.config;
|
||||||
tmpConfig.root.tenant = obj.tenant;
|
tmpConfig.root.tenant = obj.tenant;
|
||||||
|
|
||||||
console.log(obj);
|
// console.log(obj);
|
||||||
resolve(obj);
|
resolve(obj);
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
@@ -207,7 +207,7 @@
|
|||||||
|
|
||||||
|
|
||||||
app.extra.manager = new internalsdk.MemberManagementSystem(__PLAY_MODE__, tmpConfig.root.member, tmpConfig.root.config);
|
app.extra.manager = new internalsdk.MemberManagementSystem(__PLAY_MODE__, tmpConfig.root.member, tmpConfig.root.config);
|
||||||
console.log(app.extra);
|
// console.log(app.extra);
|
||||||
|
|
||||||
app.extra.config.html = app.extra.extras.ConvertHtmlTextToLanguage(app.extra.config.html);
|
app.extra.config.html = app.extra.extras.ConvertHtmlTextToLanguage(app.extra.config.html);
|
||||||
app.extra.config.email_builder = tmpConfig.config.email_builder;
|
app.extra.config.email_builder = tmpConfig.config.email_builder;
|
||||||
|
|||||||
@@ -858,11 +858,11 @@ define([
|
|||||||
|
|
||||||
// settings
|
// settings
|
||||||
app.extra.views.subscriber.newSubView({
|
app.extra.views.subscriber.newSubView({
|
||||||
id: "settings",
|
id: "catalog_settings",
|
||||||
init: false,
|
init: false,
|
||||||
body: app.extra.config.html.subscriber_settings,
|
body: app.extra.config.html.subscriber_settings,
|
||||||
listener: function(){
|
listener: function(){
|
||||||
imp_subscriber.init_settings(app);
|
imp_subscriber.init_catalog_settings(app);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// manage_email
|
// manage_email
|
||||||
@@ -871,7 +871,7 @@ define([
|
|||||||
init: false,
|
init: false,
|
||||||
body: app.extra.config.html.subscriber_email_container,
|
body: app.extra.config.html.subscriber_email_container,
|
||||||
listener: function(){
|
listener: function(){
|
||||||
imp_subscriber.init_email(app);
|
imp_subscriber.init_settings_email(app);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// article_editor
|
// article_editor
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ function init_settings(app){
|
|||||||
function init_settings_email(app){
|
function init_settings_email(app){
|
||||||
_init_settings_email(app);
|
_init_settings_email(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function init_submissions(app){
|
function init_submissions(app){
|
||||||
_init_submissions(app,this);
|
_init_submissions(app,this);
|
||||||
@@ -253,6 +253,7 @@ function _init_form_submissions(app){
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function _init_init_submission(app,self){
|
function _init_init_submission(app,self){
|
||||||
$("#back_to_forms_init").on("click",function(e){
|
$("#back_to_forms_init").on("click",function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -306,7 +307,7 @@ function _init_init_submission(app,self){
|
|||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
// console.log(sub);
|
console.log(sub);
|
||||||
if(typeof sub.answer === "string"){
|
if(typeof sub.answer === "string"){
|
||||||
if(sub.answer.includes("data:image")){
|
if(sub.answer.includes("data:image")){
|
||||||
answer = `<img src="${sub.answer}" />`;
|
answer = `<img src="${sub.answer}" />`;
|
||||||
@@ -318,7 +319,8 @@ function _init_init_submission(app,self){
|
|||||||
// console.log(sub.answer)
|
// console.log(sub.answer)
|
||||||
for (let n = 0; n < sub.answer.length; n++) {
|
for (let n = 0; n < sub.answer.length; n++) {
|
||||||
const ans = sub.answer[n];
|
const ans = sub.answer[n];
|
||||||
|
|
||||||
|
console.log(ans);
|
||||||
if(typeof ans === "object"){
|
if(typeof ans === "object"){
|
||||||
// file
|
// file
|
||||||
if(ans.name!=undefined && ans.type!=undefined && ans.content!=undefined){
|
if(ans.name!=undefined && ans.type!=undefined && ans.content!=undefined){
|
||||||
@@ -329,7 +331,7 @@ function _init_init_submission(app,self){
|
|||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
answer += `${ans.name}<br>`;
|
answer += `${ans}<br>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(typeof sub.answer === "object"){
|
}else if(typeof sub.answer === "object"){
|
||||||
@@ -341,10 +343,6 @@ function _init_init_submission(app,self){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let question_html = __make_label(sub.question,answer);
|
let question_html = __make_label(sub.question,answer);
|
||||||
|
|
||||||
html += question_html;
|
html += question_html;
|
||||||
@@ -2048,7 +2046,7 @@ function _init_settings(app,self){
|
|||||||
}
|
}
|
||||||
|
|
||||||
let form = app.extra.config.forms[app.extra.current.forms.form_index];
|
let form = app.extra.config.forms[app.extra.current.forms.form_index];
|
||||||
let mail_handler = app.extra.extras.SortEmailHandlersIntoItem(app.extra.mail_handlers.forms, form);
|
let mail_handler = app.extra.extras.SortEmailHandlersIntoItem(app.extra.mail_handlers.forms, form.json.reference_num);
|
||||||
|
|
||||||
// rrrrr
|
// rrrrr
|
||||||
$("#manage_email_construction_id").on("click",function(e){
|
$("#manage_email_construction_id").on("click",function(e){
|
||||||
@@ -2071,14 +2069,11 @@ function _init_settings_email(app){
|
|||||||
AFSSpinner.showFullScreen(true);
|
AFSSpinner.showFullScreen(true);
|
||||||
if(handlers!=undefined && handlers!=null){
|
if(handlers!=undefined && handlers!=null){
|
||||||
let category = app.extra.config.configurations.forms[0].json.category;
|
let category = app.extra.config.configurations.forms[0].json.category;
|
||||||
app.extra.extras.SaveMailHandlers(category, form.json.reference_num, handlers, app, function(resp){
|
app.extra.extras.SaveMailHandlers(category, form.json.reference_num, handlers, app, function(resp,subs){
|
||||||
AFSSpinner.showFullScreen(false);
|
AFSSpinner.showFullScreen(false);
|
||||||
console.log(resp);
|
console.log(resp);
|
||||||
// console.log(app.extra.config.configurations.access[index])
|
app.extra.mail_handlers.forms = subs;
|
||||||
// app.extra.extras.SaveConfiguration(app.extra.config.configurations.access[index].json, app, function(resp){
|
},app.extra.mail_handlers.forms);
|
||||||
// console.log(resp);
|
|
||||||
// });
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},function(emailobj){
|
},function(emailobj){
|
||||||
// console.log(emailobj);
|
// console.log(emailobj);
|
||||||
|
|||||||
@@ -4,19 +4,36 @@ define([
|
|||||||
function(bootstrap){
|
function(bootstrap){
|
||||||
|
|
||||||
function init(app){
|
function init(app){
|
||||||
|
if(app.extra.mail_handlers.subscribers==undefined){
|
||||||
|
app.extra.mail_handlers.subscribers = [];
|
||||||
|
}
|
||||||
|
if(app.extra.subscribers==undefined){
|
||||||
|
app.extra.subscribers = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
AFSSpinner.showFullScreen(true);
|
AFSSpinner.showFullScreen(true);
|
||||||
setTimeout(() => { AFSSpinner.showFullScreen(false); },35000);
|
setTimeout(() => { AFSSpinner.showFullScreen(false); },35000);
|
||||||
app.extra.extras.RequestCatalogs(100,function(catalogs){
|
app.extra.extras.RequestCatalogs(100,function(catalogs){
|
||||||
app.extra.extras.RequestDocuments(100,function(documents){
|
app.extra.extras.RequestDocuments(100,function(documents){
|
||||||
if(app.extra.documents==undefined){ app.extra.documents = documents; }
|
app.extra.extras.RequestMailHandlers(100,function(mail_handlers){
|
||||||
if(app.extra.catalogs==undefined){ app.extra.catalogs = catalogs; }
|
if(app.extra.documents==undefined){ app.extra.documents = documents; }
|
||||||
app.extra.catalogs = app.extra.extras.UpdateConfigurationsObject(
|
if(app.extra.catalogs==undefined){ app.extra.catalogs = catalogs; }
|
||||||
app.extra.catalogs,
|
app.extra.catalogs = app.extra.extras.UpdateConfigurationsObject(
|
||||||
app.extra.config.configurations.subscriber_catalog[0].json,
|
app.extra.catalogs,
|
||||||
app);
|
app.extra.config.configurations.subscriber_catalog[0].json,
|
||||||
|
app);
|
||||||
|
|
||||||
AFSSpinner.showFullScreen(false);
|
console.log(mail_handlers);
|
||||||
_init(app);
|
|
||||||
|
app.extra.mail_handlers.subscribers = app.extra.extras.StructureEmailHandlers(mail_handlers);
|
||||||
|
console.log(app.extra.mail_handlers.subscribers)
|
||||||
|
|
||||||
|
AFSSpinner.showFullScreen(false);
|
||||||
|
_init(app);
|
||||||
|
|
||||||
|
|
||||||
|
},app.extra.mail_handlers.subscribers, true, app, "subscriber_catalog");
|
||||||
},app.extra.documents,true,app);
|
},app.extra.documents,true,app);
|
||||||
},app.extra.catalogs,true,app);
|
},app.extra.catalogs,true,app);
|
||||||
}
|
}
|
||||||
@@ -28,9 +45,7 @@ define([
|
|||||||
let reference_num = app.extra.current.subscriber.catalog.reference_num;
|
let reference_num = app.extra.current.subscriber.catalog.reference_num;
|
||||||
AFSSpinner.showFullScreen(true);
|
AFSSpinner.showFullScreen(true);
|
||||||
setTimeout(() => { AFSSpinner.showFullScreen(false); },35000);
|
setTimeout(() => { AFSSpinner.showFullScreen(false); },35000);
|
||||||
if(app.extra.subscribers==undefined){
|
|
||||||
app.extra.subscribers = [];
|
|
||||||
}
|
|
||||||
if(app.extra.catalog_articles==undefined){
|
if(app.extra.catalog_articles==undefined){
|
||||||
app.extra.catalog_articles = {};
|
app.extra.catalog_articles = {};
|
||||||
}
|
}
|
||||||
@@ -113,7 +128,7 @@ define([
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
AFSSpinner.showFullScreen(true);
|
AFSSpinner.showFullScreen(true);
|
||||||
setTimeout(() => {AFSSpinner.showFullScreen(false);},35000);
|
setTimeout(() => {AFSSpinner.showFullScreen(false);},35000);
|
||||||
let display_name = $("#create_new_catalog_name").val();
|
let display_name = $("#create_new_catalog_name").val().trim();
|
||||||
if(display_name==""){
|
if(display_name==""){
|
||||||
alert("Please provide catalog name");
|
alert("Please provide catalog name");
|
||||||
return;
|
return;
|
||||||
@@ -122,23 +137,24 @@ define([
|
|||||||
[app.extra.config.configurations.subscriber_catalog[0]],
|
[app.extra.config.configurations.subscriber_catalog[0]],
|
||||||
app.extra.config.configurations.subscriber_catalog[0].json,
|
app.extra.config.configurations.subscriber_catalog[0].json,
|
||||||
app);
|
app);
|
||||||
// ppppp
|
|
||||||
|
|
||||||
console.log(newCatalogJson);
|
const ref_num = "v"+app.utils.numberId(4) + "-" + app.utils.numberId(4) + "-" + app.utils.numberId(4) + "-" + app.utils.numberId(4);
|
||||||
|
|
||||||
|
newCatalogJson[0].title = display_name;
|
||||||
|
newCatalogJson[0].json.title = display_name;
|
||||||
|
newCatalogJson[0].json.reference_num = ref_num;
|
||||||
let data = {
|
let data = {
|
||||||
"admin_subscriber_create_catalog": true,
|
"admin_subscriber_create_catalog": true,
|
||||||
"title": display_name,
|
"title": display_name,
|
||||||
"reference_num": "c"+app.utils.numberId(12),
|
"reference_num": ref_num,
|
||||||
"json": JSON.stringify(newCatalogJson[0].json),
|
"json": JSON.stringify(newCatalogJson[0].json),
|
||||||
};
|
};
|
||||||
// __append_catalogs_list(app);
|
|
||||||
$("#create_new_catalog_name").val("");
|
$("#create_new_catalog_name").val("");
|
||||||
$.post(app.extra.url, data, function(resp){
|
$.post(app.extra.url, data, function(resp){
|
||||||
resp = JSON.parse(resp);
|
resp = JSON.parse(resp);
|
||||||
|
|
||||||
console.log(resp);
|
console.log(resp);
|
||||||
app.extra.catalogs.push(resp);
|
app.extra.catalogs.push(resp);
|
||||||
// console.log(app.extra.catalogs);
|
|
||||||
__append_catalogs_list(app);
|
__append_catalogs_list(app);
|
||||||
AFSSpinner.showFullScreen(false);
|
AFSSpinner.showFullScreen(false);
|
||||||
modal.toggle();
|
modal.toggle();
|
||||||
@@ -161,16 +177,23 @@ define([
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
modal.toggle();
|
modal.toggle();
|
||||||
});
|
});
|
||||||
$("#catalogs_configure_btn").on("click",function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
app.extra.views.subscriber.render("settings");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function init_settings_email(app){
|
||||||
|
_init_settings_email(app);
|
||||||
|
}
|
||||||
|
|
||||||
function init_mangage(app){
|
function init_mangage(app){
|
||||||
_init_mangage(app);
|
app.extra.extras.RequestSubscribers(500,function(subscribers){
|
||||||
|
console.log(subscribers);
|
||||||
|
app.extra.subscribers = app.extra.subscribers.concat(subscribers);;
|
||||||
|
_init_mangage(app);
|
||||||
|
},app.extra.subscribers , false, app);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
function init_article_editor2(app){
|
function init_article_editor2(app){
|
||||||
_init_article_editor2(app)
|
_init_article_editor2(app)
|
||||||
@@ -178,14 +201,10 @@ define([
|
|||||||
function init_configure_catalogs(app){
|
function init_configure_catalogs(app){
|
||||||
_init_configure_catalogs(app);
|
_init_configure_catalogs(app);
|
||||||
}
|
}
|
||||||
function init_settings(app){
|
function init_catalog_settings(app){
|
||||||
_init_settings(app);
|
_init_catalog_settings(app);
|
||||||
}
|
|
||||||
function init_email(app){
|
|
||||||
_init_email(app);
|
|
||||||
}
|
}
|
||||||
function init_manage_subscriber(app){
|
function init_manage_subscriber(app){
|
||||||
StopEditorInterval(app);
|
|
||||||
_init_manage_subscriber(app);
|
_init_manage_subscriber(app);
|
||||||
}
|
}
|
||||||
function init_article_editor(app){
|
function init_article_editor(app){
|
||||||
@@ -196,7 +215,7 @@ define([
|
|||||||
function _init_catalog_overview(app){
|
function _init_catalog_overview(app){
|
||||||
function isSubscriberActiveForCurrentCatalog(subscriber,app){
|
function isSubscriberActiveForCurrentCatalog(subscriber,app){
|
||||||
let isActive = false;
|
let isActive = false;
|
||||||
console.log(subscriber);
|
// console.log(subscriber);
|
||||||
for (let v = 0; v < subscriber.json.catalogs.length; v++) {
|
for (let v = 0; v < subscriber.json.catalogs.length; v++) {
|
||||||
if(subscriber.json.catalogs[v].reference_num == app.extra.current.subscriber.catalog.reference_num){
|
if(subscriber.json.catalogs[v].reference_num == app.extra.current.subscriber.catalog.reference_num){
|
||||||
isActive = subscriber.json.catalogs[v].active;
|
isActive = subscriber.json.catalogs[v].active;
|
||||||
@@ -243,7 +262,7 @@ define([
|
|||||||
app.extra.current.subscriber.ids = ids;
|
app.extra.current.subscriber.ids = ids;
|
||||||
for (let m = 0; m < ids.length; m++) {
|
for (let m = 0; m < ids.length; m++) {
|
||||||
const element = ids[m];
|
const element = ids[m];
|
||||||
console.log(app.extra.subscribers[ids[m].index])
|
// console.log(app.extra.subscribers[ids[m].index])
|
||||||
$(`#${element.id}`).on("change",function(e){
|
$(`#${element.id}`).on("change",function(e){
|
||||||
let is_checked = document.getElementById(element.id).checked;
|
let is_checked = document.getElementById(element.id).checked;
|
||||||
for (let v = 0; v < app.extra.subscribers[ids[m].index].json.catalogs.length; v++) {
|
for (let v = 0; v < app.extra.subscribers[ids[m].index].json.catalogs.length; v++) {
|
||||||
@@ -263,7 +282,7 @@ define([
|
|||||||
// console.log(app.extra.catalog_articles);
|
// console.log(app.extra.catalog_articles);
|
||||||
$("#catalog_title").append(app.extra.current.subscriber.catalog.json.display_name);
|
$("#catalog_title").append(app.extra.current.subscriber.catalog.json.display_name);
|
||||||
function __append_articles_list(app){
|
function __append_articles_list(app){
|
||||||
// ppppp
|
|
||||||
let articles = app.extra.catalog_articles[app.extra.current.subscriber.catalog.reference_num]; //app.extra.current.subscriber.catalog.json.articles;
|
let articles = app.extra.catalog_articles[app.extra.current.subscriber.catalog.reference_num]; //app.extra.current.subscriber.catalog.json.articles;
|
||||||
let listHtml = "";
|
let listHtml = "";
|
||||||
let ids = [];
|
let ids = [];
|
||||||
@@ -312,7 +331,7 @@ define([
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
console.log(ids[i]);
|
console.log(ids[i]);
|
||||||
// modal_form_article_title_name_input
|
// modal_form_article_title_name_input
|
||||||
let newtitle = $("#modal_form_article_title_name_input").val();
|
let newtitle = $("#modal_form_article_title_name_input").val().trim();
|
||||||
if(newtitle=="" || newtitle.length < 2) { alert("Cannot be empty or less to 2 characters"); return;}
|
if(newtitle=="" || newtitle.length < 2) { alert("Cannot be empty or less to 2 characters"); return;}
|
||||||
|
|
||||||
UpdateCatagoryArticle(app,ids[i].article_config.reference_num,{title: newtitle});
|
UpdateCatagoryArticle(app,ids[i].article_config.reference_num,{title: newtitle});
|
||||||
@@ -380,7 +399,7 @@ define([
|
|||||||
$("#submit_new_article_name").on("click",function(e){
|
$("#submit_new_article_name").on("click",function(e){
|
||||||
AFSSpinner.showFullScreen(true);
|
AFSSpinner.showFullScreen(true);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let article_name = $("#article_name").val();
|
let article_name = $("#article_name").val().trim();
|
||||||
if(article_name==""){
|
if(article_name==""){
|
||||||
alert("Please enter an article name.");
|
alert("Please enter an article name.");
|
||||||
return;
|
return;
|
||||||
@@ -400,7 +419,7 @@ define([
|
|||||||
__append_articles_list(app);
|
__append_articles_list(app);
|
||||||
setTimeout(() => { AFSSpinner.showFullScreen(false); },3000);
|
setTimeout(() => { AFSSpinner.showFullScreen(false); },3000);
|
||||||
|
|
||||||
// ppppp
|
|
||||||
CreateArticle(newArticleConfig,app,function(article){
|
CreateArticle(newArticleConfig,app,function(article){
|
||||||
app.extra.catalog_articles[app.extra.current.subscriber.catalog.reference_num].push(article);
|
app.extra.catalog_articles[app.extra.current.subscriber.catalog.reference_num].push(article);
|
||||||
__append_articles_list(app);
|
__append_articles_list(app);
|
||||||
@@ -475,14 +494,18 @@ define([
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
app.extra.views.subscriber.render("manage_catalogs");
|
app.extra.views.subscriber.render("manage_catalogs");
|
||||||
});
|
});
|
||||||
|
$("#catalog_settings_btn").on("click",function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
app.extra.views.subscriber.render("catalog_settings");
|
||||||
|
});
|
||||||
|
|
||||||
$("#modal_update_category_btn").off("click");
|
$("#modal_update_category_btn").off("click");
|
||||||
$("#modal_update_category_btn").on("click",function(e){
|
$("#modal_update_category_btn").on("click",function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
AFSSpinner.showFullScreen(true);
|
AFSSpinner.showFullScreen(true);
|
||||||
let _display_name = $("#update_new_catalog_name").val();
|
let _display_name = $("#update_new_catalog_name").val().trim();
|
||||||
let _short_desc = $("#update_new_catalog_short_description").val();
|
let _short_desc = $("#update_new_catalog_short_description").val().trim();
|
||||||
let _description = $("#update_new_catalog_description").val();
|
let _description = $("#update_new_catalog_description").val().trim();
|
||||||
|
|
||||||
if(_display_name==""){
|
if(_display_name==""){
|
||||||
alert("Display name cannot be empty");
|
alert("Display name cannot be empty");
|
||||||
@@ -503,7 +526,73 @@ define([
|
|||||||
});
|
});
|
||||||
SetupCatalogOverview(app);
|
SetupCatalogOverview(app);
|
||||||
|
|
||||||
|
// console.log(app.extra.current.subscriber);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
function _init_catalog_settings(app){
|
||||||
|
$("#back_to_init").on("click",function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
app.extra.views.subscriber.render("catalog_overview");
|
||||||
|
});
|
||||||
|
|
||||||
|
function CreateSubmissionVariables(app){
|
||||||
|
let index = app.extra.current.forms.form_index;
|
||||||
|
let submission_variables = [];
|
||||||
|
for (let i = 0; i < app.extra.config.forms[index].json.form_data.pages.length; i++) {
|
||||||
|
const page = app.extra.config.forms[index].json.form_data.pages[i];
|
||||||
|
for (let n = 0; n < page.elements.length; n++) {
|
||||||
|
const element = page.elements[n];
|
||||||
|
submission_variables.push({
|
||||||
|
name: element.name,
|
||||||
|
value: ""
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return submission_variables;
|
||||||
|
}
|
||||||
|
|
||||||
|
let catalog = app.extra.catalogs[app.extra.current.subscriber.catalog_index];
|
||||||
|
let mail_handler = app.extra.extras.SortEmailHandlersIntoItem(app.extra.mail_handlers.subscribers, catalog.json.reference_num);
|
||||||
|
|
||||||
|
|
||||||
|
// rrrrr
|
||||||
|
$("#email_manager").on("click",function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
app.extra.current._emailbuilder.handler = mail_handler;
|
||||||
|
app.extra.views.subscriber.render("manage_email");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function _init_settings_email(app){
|
||||||
|
let catalog = app.extra.catalogs[app.extra.current.subscriber.catalog_index];
|
||||||
|
// console.log(catalog);
|
||||||
|
app.extra.extras.InitializeEmailCreatorDashboard2(app.extra.current._emailbuilder.handler,
|
||||||
|
function(view){
|
||||||
|
},
|
||||||
|
function(handler,handlers){
|
||||||
|
AFSSpinner.showFullScreen(true);
|
||||||
|
if(handlers!=undefined && handlers!=null){
|
||||||
|
|
||||||
|
// console.log(catalog);
|
||||||
|
app.extra.extras.SaveMailHandlers(
|
||||||
|
catalog.json.category,
|
||||||
|
catalog.json.reference_num,
|
||||||
|
handlers, app, function(resp,subs){
|
||||||
|
AFSSpinner.showFullScreen(false);
|
||||||
|
app.extra.mail_handlers.subscribers = subs;
|
||||||
|
|
||||||
|
},app.extra.mail_handlers.subscribers);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function(emailobj){
|
||||||
|
// console.log(emailobj);
|
||||||
|
app.extra.views.subscriber.render("catalog_settings");
|
||||||
|
},app,"#email_manager_contaner",catalog.json.reference_num);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -511,13 +600,14 @@ define([
|
|||||||
function _init_mangage(app){
|
function _init_mangage(app){
|
||||||
goBack(app);
|
goBack(app);
|
||||||
|
|
||||||
|
|
||||||
function _TableRowHtml(title,ref,id){
|
function _TableRowHtml(title,ref,id){
|
||||||
return `
|
return `
|
||||||
<tr>
|
<tr>
|
||||||
<td>${title}</td>
|
<td>${title}</td>
|
||||||
<td><a id="${id}" href="#">Edit</a></td>
|
<td><a id="${id}" href="#">Edit</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
function _TableHtml(content){
|
function _TableHtml(content){
|
||||||
return `
|
return `
|
||||||
@@ -543,12 +633,8 @@ define([
|
|||||||
let ids = [];
|
let ids = [];
|
||||||
let table = "";
|
let table = "";
|
||||||
|
|
||||||
// app.extra.config.configurations.subscriber[1].json.subscribers.push(app.extra.config.configurations.subscriber[0]);
|
|
||||||
// app.extra.config.configurations.subscriber[1].json.subscribers.push(app.extra.config.configurations.subscriber[0]);
|
|
||||||
// app.extra.config.configurations.subscriber[1].json.subscribers.push(app.extra.config.configurations.subscriber[0]);
|
|
||||||
// app.extra.config.configurations.subscriber[1].json.subscribers.push(app.extra.config.configurations.subscriber[0]);
|
|
||||||
|
|
||||||
// loop through each catalog's subscriber list
|
// loop through each catalog's subscriber list
|
||||||
|
// console.log(app.extra.subscribers);
|
||||||
for (let i = 0; i < app.extra.subscribers.length; i++) {
|
for (let i = 0; i < app.extra.subscribers.length; i++) {
|
||||||
const subscriber = app.extra.subscribers[i];
|
const subscriber = app.extra.subscribers[i];
|
||||||
// CleanAndValidateSubscriberList(i,app);
|
// CleanAndValidateSubscriberList(i,app);
|
||||||
@@ -557,7 +643,7 @@ define([
|
|||||||
table += _TableRowHtml(subscriber.email,"",id);
|
table += _TableRowHtml(subscriber.email,"",id);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(table);
|
// console.log(table);
|
||||||
|
|
||||||
$("#subscriber_list_container").empty();
|
$("#subscriber_list_container").empty();
|
||||||
$("#subscriber_list_container").append(_TableHtml(table));
|
$("#subscriber_list_container").append(_TableHtml(table));
|
||||||
@@ -571,86 +657,100 @@ define([
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ppppp
|
||||||
$("#add_subscriber_btn").on("click",function(e){
|
$("#add_subscriber_btn").on("click",function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let new_subscriber_email = $("#add_email_subscriber_input").val();
|
let new_subscriber_email = $("#add_email_subscriber_input").val().trim();
|
||||||
if(new_subscriber_email==""){
|
if(new_subscriber_email==""){
|
||||||
|
return;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
let sub = {name:"",email:new_subscriber_email,active:false};
|
|
||||||
for (let n = 0; n < app.extra.config.configurations.subscriber.length; n++) {
|
|
||||||
app.extra.config.configurations.subscriber[n].json.subscribers.unshift(sub);
|
|
||||||
}
|
|
||||||
app.extra.current.subscriber.selected_subscriber = {obj:sub};
|
|
||||||
app.extra.views.subscriber.render("manage_subscriber");
|
|
||||||
|
|
||||||
|
let found = false;
|
||||||
|
for (let n = 0; n < app.extra.subscribers.length; n++) {
|
||||||
|
if(app.extra.subscribers[n].email==new_subscriber_email){
|
||||||
|
|
||||||
|
app.extra.current.subscriber.selected_subscriber = {
|
||||||
|
obj: app.extra.subscribers[n],
|
||||||
|
index: n
|
||||||
|
};
|
||||||
|
const index = app.extra.current.subscriber.selected_subscriber.obj.index;
|
||||||
|
app.extra.subscribers[index] = app.extra.current.subscriber.selected_subscriber.obj;
|
||||||
|
app.extra.views.subscriber.render("manage_subscriber");requestAnimationFrame;
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(found) return;
|
||||||
|
|
||||||
|
let s = new AFSSdk.AFSSubscriber();
|
||||||
|
let newsub = s.initializeSubscriber(new_subscriber_email,"","").buildSubscriber();
|
||||||
|
// console.log(newsub);
|
||||||
|
app.extra.subscribers.push(newsub);
|
||||||
|
app.extra.current.subscriber.selected_subscriber = {
|
||||||
|
obj:newsub,
|
||||||
|
index:(app.extra.subscribers.length-1)
|
||||||
|
};
|
||||||
|
|
||||||
|
$.post(app.extra.url,{
|
||||||
|
"admin_subscriber_update_subscriber": true,
|
||||||
|
"subscriber": JSON.stringify(app.extra.current.subscriber.selected_subscriber.obj)
|
||||||
|
},function(resp){
|
||||||
|
resp = JSON.parse(resp);
|
||||||
|
console.log(resp);
|
||||||
|
const index = app.extra.current.subscriber.selected_subscriber.obj.index;
|
||||||
|
app.extra.subscribers[index] = app.extra.current.subscriber.selected_subscriber.obj;
|
||||||
|
app.extra.views.subscriber.render("manage_subscriber");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function _init_manage_subscriber(app){
|
function _init_manage_subscriber(app){
|
||||||
let selected_email = app.extra.current.subscriber.selected_subscriber.obj.email;
|
let selected_email = app.extra.current.subscriber.selected_subscriber.obj.email;
|
||||||
let obj = manage_build_sub(selected_email,app);
|
let obj = manage_build_sub(selected_email,app);
|
||||||
let ids = obj.ids;
|
let ids = obj.ids;
|
||||||
let html = obj.html;
|
let html = obj.html;
|
||||||
|
|
||||||
$("#back_to_init").on("click",function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
app.extra.views.subscriber.render("manage");
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#subscriber_container_data").empty();
|
|
||||||
$("#subscriber_container_data").append(html);
|
|
||||||
|
|
||||||
|
|
||||||
$("#subscriber_main_header").text(selected_email);
|
console.log(app.extra.current.subscriber.selected_subscriber);
|
||||||
|
|
||||||
$("#update_subscriber_subscriptions").on("click",function(e){
|
$("#back_to_init").on("click",function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
AFSSpinner.showFullScreen(true);
|
app.extra.views.subscriber.render("manage");
|
||||||
$("#update_subscriber_subscriptions").prop("disabled",true);
|
});
|
||||||
setTimeout(() => {
|
|
||||||
$("#update_subscriber_subscriptions").prop("disabled",false);
|
|
||||||
AFSSpinner.showFullScreen(false);
|
|
||||||
},25000);
|
|
||||||
|
|
||||||
for (let n = 0; n < app.extra.config.configurations.subscriber.length; n++) {
|
$("#subscriber_container_data").empty();
|
||||||
const catalog = app.extra.config.configurations.subscriber[n].json;
|
$("#subscriber_container_data").append(html);
|
||||||
for (let i = 0; i < ids.length; i++) {
|
$("#subscriber_main_header").text(selected_email);
|
||||||
const element = ids[i];
|
|
||||||
if(element.obj.catalog_ref==catalog.reference_num){
|
$("#update_subscriber_subscriptions").on("click",function(e){
|
||||||
for (let v = 0; v < catalog.subscribers.length; v++) {
|
for (let i = 0; i < ids.length; i++) {
|
||||||
const sub = catalog.subscribers[v];
|
const element = ids[i];
|
||||||
if(sub.email==selected_email){
|
let radioValue = $("input[id='"+element.id+"']:checked").val();
|
||||||
let radioValue = $("input[id='"+element.id+"']:checked").val();
|
let ischecked = false;
|
||||||
if(radioValue!=undefined && radioValue=="on"){
|
if(radioValue!=undefined && radioValue=="on"){
|
||||||
app.extra.config.configurations.subscriber[n].json.subscribers[v].active = true;
|
ischecked = true;
|
||||||
}else{
|
|
||||||
app.extra.config.configurations.subscriber[n].json.subscribers[v].active = false;
|
|
||||||
}
|
|
||||||
console.log(app.extra.config.configurations.subscriber[n]);
|
|
||||||
}
|
}
|
||||||
}
|
console.log(app.extra.current.subscriber.selected_subscriber.obj);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let n = 0; n < app.extra.config.configurations.subscriber.length; n++) {
|
// console.log(element);
|
||||||
let senddata = {
|
|
||||||
configurations_update:true,
|
|
||||||
mysql_id: app.extra.config.configurations.subscriber[n].json.mysql_id,
|
|
||||||
data: JSON.stringify(app.extra.config.configurations.subscriber[n].json)
|
|
||||||
}
|
|
||||||
$.post(app.extra.url,senddata,function(resp){
|
|
||||||
if(n==app.extra.config.configurations.subscriber.length-1){
|
|
||||||
console.log(resp);
|
|
||||||
AFSSpinner.showFullScreen(false);
|
|
||||||
$("#update_subscriber_subscriptions").prop("disabled",true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
app.extra.current.subscriber.selected_subscriber.obj.json.catalogs[i] = {
|
||||||
|
reference_num: element.catalog.json.reference_num,
|
||||||
|
active: ischecked
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
$.post(app.extra.url,{
|
||||||
|
"admin_subscriber_update_subscriber": true,
|
||||||
|
"subscriber": JSON.stringify(app.extra.current.subscriber.selected_subscriber.obj)
|
||||||
|
},function(resp){
|
||||||
|
resp = JSON.parse(resp);
|
||||||
|
console.log(resp);
|
||||||
|
const index = app.extra.current.subscriber.selected_subscriber.obj.index;
|
||||||
|
app.extra.subscribers[index] = app.extra.current.subscriber.selected_subscriber.obj;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
function _init_configure_catalogs(app){
|
function _init_configure_catalogs(app){
|
||||||
@@ -675,7 +775,7 @@ define([
|
|||||||
$("#from_email_select").val(app.extra.current.subscriber.article.data.email.from);
|
$("#from_email_select").val(app.extra.current.subscriber.article.data.email.from);
|
||||||
$("#from_email_select").on("change",function(e){
|
$("#from_email_select").on("change",function(e){
|
||||||
// let typeValue = Number($("input[name='delivery_from_email_select']:checked").val());
|
// let typeValue = Number($("input[name='delivery_from_email_select']:checked").val());
|
||||||
let email_from = $("#from_email_select").val();
|
let email_from = $("#from_email_select").val().trim();
|
||||||
let cata = app.extra.current.subscriber.catalog.json;
|
let cata = app.extra.current.subscriber.catalog.json;
|
||||||
cata = app.extra.instances.subscriber.setGlobalConfig("from_email",email_from,cata);
|
cata = app.extra.instances.subscriber.setGlobalConfig("from_email",email_from,cata);
|
||||||
app.extra.current.subscriber.catalog.json = cata;
|
app.extra.current.subscriber.catalog.json = cata;
|
||||||
@@ -755,72 +855,8 @@ define([
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
function _init_settings(app){
|
|
||||||
function CreateSubmissionVariables(app){
|
|
||||||
let submission_variables = [];
|
|
||||||
// TODO_3: Events Submission variables
|
|
||||||
// for (let i = 0; i < app.extra.config.forms[index].json.form_data.pages.length; i++) {
|
|
||||||
// const page = app.extra.config.forms[index].json.form_data.pages[i];
|
|
||||||
// for (let n = 0; n < page.elements.length; n++) {
|
|
||||||
// const element = page.elements[n];
|
|
||||||
// submission_variables.push({
|
|
||||||
// name: element.name,
|
|
||||||
// value: ""
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
return submission_variables;
|
|
||||||
}
|
|
||||||
$("#back_to_init").on("click",function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
app.extra.views.subscriber.render("manage_catalogs");
|
|
||||||
});
|
|
||||||
|
|
||||||
if(app.extra.config.configurations.subscriber[1].json.mail_handlers==undefined){
|
|
||||||
app.extra.config.configurations.subscriber[1].json.mail_handlers = {
|
|
||||||
email_response: app.extra.config.configurations.mail_handler[0].json.handler,
|
|
||||||
email_alert: app.extra.config.configurations.mail_handler[0].json.handler
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// app.extra.config.configurations.subscriber[1].json.mail_handlers.email_response.variables.schema[0] =
|
|
||||||
// app.extra.config.configurations.subscriber[1].json.mail_handlers.email_response.variables.schema[0][0];
|
|
||||||
|
|
||||||
|
|
||||||
$("#edit_repsonse_content_id").on("click",function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
let response = app.extra.config.configurations.subscriber[1].json.mail_handlers.email_response;
|
|
||||||
app.extra.current._emailbuilder.submission_variables = CreateSubmissionVariables(app);
|
|
||||||
app.extra.current._emailbuilder.type = "email_response";
|
|
||||||
app.extra.current._emailbuilder.email = response;
|
|
||||||
app.extra.views.subscriber.render("manage_email");
|
|
||||||
});
|
|
||||||
$("#edit_alert_content_id").on("click",function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
let alert = app.extra.config.configurations.subscriber[1].json.mail_handlers.email_alert;
|
|
||||||
app.extra.current._emailbuilder.submission_variables = CreateSubmissionVariables(app);
|
|
||||||
app.extra.current._emailbuilder.type = "email_alert";
|
|
||||||
app.extra.current._emailbuilder.email = alert;
|
|
||||||
app.extra.views.subscriber.render("manage_email");
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
function _init_email(app){
|
|
||||||
let email = app.extra.current._emailbuilder.email;
|
|
||||||
app.extra.extras.InitializeEmailCreatorDashboard(email,[],function(view){
|
|
||||||
},function(emailobj){
|
|
||||||
const key = app.extra.current._emailbuilder.type;
|
|
||||||
app.extra.config.configurations.subscriber[1].json.mail_handlers[key] = emailobj;
|
|
||||||
app.extra.extras.SaveConfiguration(app.extra.config.configurations.subscriber[1].json,app,function(){
|
|
||||||
|
|
||||||
});
|
|
||||||
},function(emailobj){
|
|
||||||
app.extra.current._emailbuilder.type = null;
|
|
||||||
app.extra.current._emailbuilder.email = null;
|
|
||||||
app.extra.views.subscriber.render("settings");
|
|
||||||
},app,"#email_manager_contaner");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function _init_article_editor2(app){
|
function _init_article_editor2(app){
|
||||||
@@ -870,7 +906,7 @@ define([
|
|||||||
$("#delivery_from_email_select").append(options_html);
|
$("#delivery_from_email_select").append(options_html);
|
||||||
$("#delivery_from_email_select").on("change",function(e){
|
$("#delivery_from_email_select").on("change",function(e){
|
||||||
// let typeValue = Number($("input[name='delivery_from_email_select']:checked").val());
|
// let typeValue = Number($("input[name='delivery_from_email_select']:checked").val());
|
||||||
let email_from = $("#delivery_from_email_select").val();
|
let email_from = $("#delivery_from_email_select").val().trim();
|
||||||
app.extra.current.subscriber.article.data.email.from = email_from;
|
app.extra.current.subscriber.article.data.email.from = email_from;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -883,7 +919,7 @@ define([
|
|||||||
|
|
||||||
$("#article_name").on("focusout",function(e){
|
$("#article_name").on("focusout",function(e){
|
||||||
// let typeValue = Number($("input[name='delivery_from_email_select']:checked").val());
|
// let typeValue = Number($("input[name='delivery_from_email_select']:checked").val());
|
||||||
let email_subject = $("#article_name").val();
|
let email_subject = $("#article_name").val().trim();
|
||||||
console.log(email_subject);
|
console.log(email_subject);
|
||||||
app.extra.current.subscriber.article.data.email.subject = email_subject;
|
app.extra.current.subscriber.article.data.email.subject = email_subject;
|
||||||
});
|
});
|
||||||
@@ -1284,7 +1320,6 @@ define([
|
|||||||
"value": subscriber.name
|
"value": subscriber.name
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// ppppp
|
|
||||||
"name": "unsubscribe",
|
"name": "unsubscribe",
|
||||||
"value": app.extra.config.managed_domain.Address +
|
"value": app.extra.config.managed_domain.Address +
|
||||||
`/mod/sub/subprefs.php?reference_num=${subscriber.email}&email=${subscriber.email}`
|
`/mod/sub/subprefs.php?reference_num=${subscriber.email}&email=${subscriber.email}`
|
||||||
@@ -1630,7 +1665,6 @@ define([
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function CreateArticle(newArticleConfig,app,cb){
|
function CreateArticle(newArticleConfig,app,cb){
|
||||||
// ppppp
|
|
||||||
AFSSpinner.showFullScreen(true);
|
AFSSpinner.showFullScreen(true);
|
||||||
setTimeout(() => {AFSSpinner.showFullScreen(false);},35000);
|
setTimeout(() => {AFSSpinner.showFullScreen(false);},35000);
|
||||||
let send = {
|
let send = {
|
||||||
@@ -1647,7 +1681,7 @@ define([
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function SaveArticle(article,app,cb){
|
function SaveArticle(article,app,cb){
|
||||||
// ppppp
|
|
||||||
AFSSpinner.showFullScreen(true);
|
AFSSpinner.showFullScreen(true);
|
||||||
setTimeout(() => {AFSSpinner.showFullScreen(false);},35000);
|
setTimeout(() => {AFSSpinner.showFullScreen(false);},35000);
|
||||||
let send = {
|
let send = {
|
||||||
@@ -1844,18 +1878,18 @@ define([
|
|||||||
return catalog;
|
return catalog;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
function ListCreateLI(id,content){
|
function ListCreateLI(id,content){
|
||||||
return `
|
return `
|
||||||
<li class="list-group-item list-group-item-action">
|
<li class="list-group-item list-group-item-action">
|
||||||
<a id="${id}" href="#">${content}</a>
|
<a id="${id}" href="#">${content}</a>
|
||||||
</li>
|
</li>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
function ListCreateUL(id,content){
|
function ListCreateUL(id,content){
|
||||||
return `<ul class="list-group list-group-flush" id="${id}">${content}</ul>`;
|
return `<ul class="list-group list-group-flush" id="${id}">${content}</ul>`;
|
||||||
}
|
}
|
||||||
function TableRowHtml(title,ref,id){
|
function TableRowHtml(title,ref,id){
|
||||||
return `
|
return `
|
||||||
<tr>
|
<tr>
|
||||||
<td>${title}</td>
|
<td>${title}</td>
|
||||||
@@ -1863,8 +1897,8 @@ define([
|
|||||||
<td><a id="${id}" href="#">Edit</a></td>
|
<td><a id="${id}" href="#">Edit</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
function TableHtml(content){
|
function TableHtml(content){
|
||||||
return `
|
return `
|
||||||
|
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
@@ -1909,57 +1943,44 @@ define([
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
// ppppp
|
||||||
let ids = [];
|
let ids = [];
|
||||||
let subscribers_list = [];
|
let subscribers_list = [];
|
||||||
let items = "";
|
let items = "";
|
||||||
for (let i = 0; i < app.extra.config.configurations.subscriber.length; i++) {
|
let subscribers_catalogs = [];
|
||||||
const catalog = app.extra.config.configurations.subscriber[i].json;
|
const sub_catalogs = app.extra.current.subscriber.selected_subscriber.obj.json.catalogs;
|
||||||
let found = false;
|
for (let i = 0; i < app.extra.catalogs.length; i++) {
|
||||||
let inputid = "m"+app.utils.randomGenerator(12);
|
const catalog = app.extra.catalogs[i];
|
||||||
let checked = "";
|
let found = false;
|
||||||
let _sub = null;
|
let inputid = "m"+app.utils.randomGenerator(12);
|
||||||
let duplicates = [];
|
let isChecked = false;
|
||||||
for (let n = 0; n < catalog.subscribers.length; n++) {
|
let checked = "";
|
||||||
const sub = catalog.subscribers[n];
|
let current_sub = {};
|
||||||
if(sub.email==selected_email){
|
let title = catalog.title;
|
||||||
if(found){
|
for (let n = 0; n < sub_catalogs.length; n++) {
|
||||||
duplicates.push(n);
|
const sub_catalog = sub_catalogs[n];
|
||||||
continue;
|
if(catalog.json.reference_num==sub_catalog.reference_num){
|
||||||
}
|
found = true;
|
||||||
found = true;
|
current_sub = catalog;
|
||||||
sub.catalog_ref = catalog.reference_num;
|
}
|
||||||
sub.catalog_display_name = catalog.display_name;
|
if(catalog.json.reference_num==sub_catalog.reference_num && sub_catalog.active==true){
|
||||||
let title = catalog.display_name;
|
isChecked = true;
|
||||||
subscribers_list.push(sub);
|
checked = "checked";
|
||||||
if(sub.active==true){
|
break;
|
||||||
checked = "checked";
|
}
|
||||||
}
|
|
||||||
items += item_html(title,inputid,checked);
|
|
||||||
ids.push({id:inputid,obj:sub,index:n});
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(found==false){
|
items += item_html(title,inputid,checked);
|
||||||
let sub = {
|
ids.push({
|
||||||
name:'',
|
id:inputid,
|
||||||
email:selected_email,
|
catalog: catalog,
|
||||||
active:false,
|
index:i
|
||||||
catalog_ref: catalog.reference_num,
|
});
|
||||||
catalog_display_name: catalog.display_name
|
|
||||||
};
|
|
||||||
app.extra.config.configurations.subscriber[i].json.subscribers.push(sub);
|
|
||||||
items += item_html(catalog.display_name,inputid,checked);
|
|
||||||
ids.push({id:inputid,obj:sub,index:i});
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete duplicate subscribers in 1 catalog
|
|
||||||
duplicates = duplicates.reverse();
|
|
||||||
for (let x = 0; x < duplicates.length; x++) {
|
|
||||||
let index = duplicates[x];
|
|
||||||
if(x!=0){ index = (duplicates[x]-1); }
|
|
||||||
app.extra.config.configurations.subscriber[i].json.subscribers.splice(index,1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let html = items_html(items);
|
let html = items_html(items);
|
||||||
return {ids,html};
|
return {ids,html};
|
||||||
}
|
}
|
||||||
@@ -2105,9 +2126,9 @@ define([
|
|||||||
init_manage:init_mangage,
|
init_manage:init_mangage,
|
||||||
init_manage_subscriber:init_manage_subscriber,
|
init_manage_subscriber:init_manage_subscriber,
|
||||||
init_configure_catalogs:init_configure_catalogs,
|
init_configure_catalogs:init_configure_catalogs,
|
||||||
init_settings:init_settings,
|
init_catalog_settings:init_catalog_settings,
|
||||||
init_email:init_email,
|
init_article_editor2:init_article_editor2,
|
||||||
init_article_editor2:init_article_editor2
|
init_settings_email:init_settings_email
|
||||||
}
|
}
|
||||||
});// !!!END!!!
|
});// !!!END!!!
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -33,15 +33,25 @@ class Membership {
|
|||||||
$domain = get_subdomain_managed_domain_new_way($subdomain);
|
$domain = get_subdomain_managed_domain_new_way($subdomain);
|
||||||
|
|
||||||
$username = \Input::get("username");
|
$username = \Input::get("username");
|
||||||
|
|
||||||
|
if($username==""){
|
||||||
|
$payload = json_decode(@file_get_contents('php://input'), true);
|
||||||
|
$username = $payload["username"];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// $nameid = \Input::get("nameid");
|
// $nameid = \Input::get("nameid");
|
||||||
$db = new \DB();
|
$db = new \DB();
|
||||||
$rows = $db->query("SELECT * FROM users_member WHERE reference_num='$username'");
|
$rows = $db->query("SELECT * FROM users_member WHERE reference_num='$username'",[], \PDO::FETCH_ASSOC);
|
||||||
$member = ["set"=>false,"username"=>$username];
|
$member = ["set"=>false,"username"=>$username];
|
||||||
if($rows->count() > 0){
|
if($rows->count() > 0){
|
||||||
$member = $rows->results()[0];
|
$member = $rows->results()[0];
|
||||||
|
$member["json_data"] = json_decode(html_entity_decode($member["json_data"]),true);
|
||||||
}
|
}
|
||||||
$db = null;
|
$db = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$config_domain = __get_main_configurations();
|
$config_domain = __get_main_configurations();
|
||||||
$managed_domain = $config_domain["managed_domain"];
|
$managed_domain = $config_domain["managed_domain"];
|
||||||
$config = $config_domain["configurations"];
|
$config = $config_domain["configurations"];
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ class StripeModule {
|
|||||||
|
|
||||||
public function __construct() { }
|
public function __construct() { }
|
||||||
|
|
||||||
// rrrrr
|
|
||||||
function GetStripe($client_secret,$manage_domain){
|
function GetStripe($client_secret,$manage_domain){
|
||||||
\Stripe\Stripe::setAppInfo(
|
\Stripe\Stripe::setAppInfo(
|
||||||
"stripe_processor",
|
"stripe_processor",
|
||||||
@@ -35,10 +34,16 @@ class StripeModule {
|
|||||||
function init(){
|
function init(){
|
||||||
$content = rawurldecode(trim(@file_get_contents("php://input")));
|
$content = rawurldecode(trim(@file_get_contents("php://input")));
|
||||||
$data = json_decode($content, true);
|
$data = json_decode($content, true);
|
||||||
$data["data"] = json_decode($data["data"],true);
|
if(gettype($data["data"])=="string"){
|
||||||
|
$data["data"] = json_decode($data["data"],true);
|
||||||
|
}
|
||||||
// $_POST["category"] = "processors";
|
// $_POST["category"] = "processors";
|
||||||
$configuration = get_configuration_obj("processors");
|
$configuration = get_configuration_obj("processors");
|
||||||
$one = $data["data"]['direct_payment'];
|
$one = $data["data"]['direct_payment'];
|
||||||
|
if(gettype($one)=="string"){
|
||||||
|
$one = json_decode($one,true);
|
||||||
|
}
|
||||||
|
// Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/afile00.json",$one);
|
||||||
// TODO_1: direct payment must be type 0 - type 1 subscriptions is not implemented yet
|
// TODO_1: direct payment must be type 0 - type 1 subscriptions is not implemented yet
|
||||||
$processor = DirectPaymentsSelectProcessor($one, $configuration);
|
$processor = DirectPaymentsSelectProcessor($one, $configuration);
|
||||||
$manage_domain = GetManagedDomain();
|
$manage_domain = GetManagedDomain();
|
||||||
@@ -202,6 +207,8 @@ class StripeModule {
|
|||||||
|
|
||||||
\Stripe\Stripe::setApiKey($data["processor"]['json']['client_secret']);
|
\Stripe\Stripe::setApiKey($data["processor"]['json']['client_secret']);
|
||||||
|
|
||||||
|
|
||||||
|
// rrrrr
|
||||||
$objects = [];
|
$objects = [];
|
||||||
$customer = null;
|
$customer = null;
|
||||||
$paymentIntent = null;
|
$paymentIntent = null;
|
||||||
@@ -214,6 +221,7 @@ class StripeModule {
|
|||||||
|
|
||||||
$product_id = $data["data"]["product_id"];
|
$product_id = $data["data"]["product_id"];
|
||||||
$customer_address = $data["data"]["address"];
|
$customer_address = $data["data"]["address"];
|
||||||
|
$amount = $data["data"]["amount"];
|
||||||
|
|
||||||
// Create a Tax Calculation
|
// Create a Tax Calculation
|
||||||
try {
|
try {
|
||||||
@@ -224,7 +232,7 @@ class StripeModule {
|
|||||||
'address_source' => 'billing',
|
'address_source' => 'billing',
|
||||||
],
|
],
|
||||||
'line_items' => [[
|
'line_items' => [[
|
||||||
'amount' => (int)$data["data"]["amount"], //1000, // $10.00
|
'amount' => (int)$amount, //1000, // $10.00
|
||||||
'reference' => 'L1', // Unique identifier for the line item
|
'reference' => 'L1', // Unique identifier for the line item
|
||||||
'product' => $product_id,
|
'product' => $product_id,
|
||||||
// 'tax_code' => 'txcd_99999999', // 'General merchandise' tax code
|
// 'tax_code' => 'txcd_99999999', // 'General merchandise' tax code
|
||||||
@@ -238,45 +246,13 @@ class StripeModule {
|
|||||||
// $total_inclusive_tax = $calculation->tax_amount_inclusive;
|
// $total_inclusive_tax = $calculation->tax_amount_inclusive;
|
||||||
// $total_amount_before_tax = $calculation->amount_total - $total_inclusive_tax;
|
// $total_amount_before_tax = $calculation->amount_total - $total_inclusive_tax;
|
||||||
// $total_amount = $calculation->amount_total;
|
// $total_amount = $calculation->amount_total;
|
||||||
|
|
||||||
EchoJsonObject([
|
EchoJsonObject([
|
||||||
"customer" => $customer,
|
"customer" => $customer,
|
||||||
"calculation" => $calculation,
|
"calculation" => $calculation,
|
||||||
// "payment_intent" => $paymentIntent,
|
"data" => $data,
|
||||||
"data" => $data
|
"amount" => $amount
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Display the results to the customer
|
|
||||||
// echo "Subtotal: $" . number_format($total_amount_before_tax / 100, 2) . "\n";
|
|
||||||
// echo "Tax: $" . number_format($total_tax / 100, 2) . "\n";
|
|
||||||
// echo "Total: $" . number_format($total_amount / 100, 2) . "\n";
|
|
||||||
|
|
||||||
// if($data["data"]["payment_intent_created"]==false){
|
|
||||||
// // $paymentIntent = $this->_createPaymentIntent($stripe,$data);
|
|
||||||
// // Create a PaymentIntent using the tax calculation results
|
|
||||||
// $paymentIntent = \Stripe\PaymentIntent::create([
|
|
||||||
// 'amount' => $calculation->amount_total,
|
|
||||||
// 'currency' => $calculation->currency,
|
|
||||||
// // 'tax_calculation' => $calculation->id,
|
|
||||||
// 'automatic_payment_methods' => ['enabled' => true],
|
|
||||||
// 'metadata' => ['tax_calculation' => $calculation->id]
|
|
||||||
// ]);
|
|
||||||
// }else{
|
|
||||||
// // rrrrr
|
|
||||||
// $payment_intent_id = $data["data"]["payment_intent_id"];
|
|
||||||
// $paymentIntent = \Stripe\PaymentIntent::update(
|
|
||||||
// $payment_intent_id, //'pi_YOUR_PAYMENT_INTENT_ID', // Replace with the actual PaymentIntent ID
|
|
||||||
// [
|
|
||||||
// 'amount' => $calculation->amount_total,
|
|
||||||
// 'metadata' => ['tax_calculation' => $calculation->id]
|
|
||||||
// //'amount' => 2000, // Update the amount to 20.00 USD (in cents)
|
|
||||||
// //'currency' => 'usd',
|
|
||||||
// //'description' => 'Updated payment for order #123',
|
|
||||||
// ]
|
|
||||||
// );
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
} catch (\Stripe\Exception\ApiErrorException $e) {
|
} catch (\Stripe\Exception\ApiErrorException $e) {
|
||||||
EchoJsonObject([
|
EchoJsonObject([
|
||||||
@@ -289,14 +265,6 @@ class StripeModule {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create_subscription(){
|
public function create_subscription(){
|
||||||
@@ -471,6 +439,7 @@ class StripeModule {
|
|||||||
// Create a new customer object
|
// Create a new customer object
|
||||||
$customer = $stripe->customers->create();
|
$customer = $stripe->customers->create();
|
||||||
|
|
||||||
|
// rrrrr
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$promotionCodes = $stripe->promotionCodes->all([
|
$promotionCodes = $stripe->promotionCodes->all([
|
||||||
@@ -676,11 +645,13 @@ class StripeModule {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function _record_tax($stripe){
|
private function _record_tax($stripe){
|
||||||
$transaction = $stripe->tax->transactions->createFromCalculation([
|
$this->handleExceptions(function() use ($stripe) {
|
||||||
'calculation' => '{{TAX_CALCULATION}}',
|
$transaction = $stripe->tax->transactions->createFromCalculation([
|
||||||
'reference' => '{{PAYMENT_INTENT_ID}}',
|
'calculation' => '{{TAX_CALCULATION}}',
|
||||||
'expand' => ['line_items']
|
'reference' => '{{PAYMENT_INTENT_ID}}',
|
||||||
]);
|
'expand' => ['line_items']
|
||||||
|
]);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -705,6 +676,68 @@ class StripeModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pass through function so that if an exception is called it will be handle.
|
||||||
|
*
|
||||||
|
* @param mixed $method_call
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function handleExceptions($method_call){
|
||||||
|
try {
|
||||||
|
$method_call();
|
||||||
|
} catch(\Stripe\Exception\UnexpectedValueException $e) {
|
||||||
|
// Invalid payload
|
||||||
|
http_response_code(400);
|
||||||
|
Utils_WriteFileJson($this->LOG_FILE,['Error parsing payload: ' => $e->getMessage()],"a");
|
||||||
|
exit();
|
||||||
|
} catch(\Stripe\Exception\SignatureVerificationException $e) {
|
||||||
|
// Invalid signature
|
||||||
|
http_response_code(400);
|
||||||
|
Utils_WriteFileJson($this->LOG_FILE,['Error verifying webhook signature: ' => $e->getMessage()],"a");
|
||||||
|
exit();
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\ApiConnectionException) {
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\ApiErrorException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\AuthenticationException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\BadMethodCallException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\CardException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\ExceptionInterface $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\IdempotencyException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\InvalidArgumentException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\InvalidRequestException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\PermissionException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\RateLimitException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\TemporarySessionExpiredException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\UnexpectedValueException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\UnknownApiErrorException $e){
|
||||||
|
|
||||||
|
} catch(\Exception $e) {
|
||||||
|
// Invalid payload
|
||||||
|
http_response_code(400);
|
||||||
|
Utils_WriteFileJson($this->LOG_FILE,["error" => $e->getMessage()], 'a');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// stripe listen --forward-to https://api.appfactory.studio/v1/modules/stripe/webhook?dp=4093-4070-2198-3695 --skip-verify
|
// stripe listen --forward-to https://api.appfactory.studio/v1/modules/stripe/webhook?dp=4093-4070-2198-3695 --skip-verify
|
||||||
public function webhook(){
|
public function webhook(){
|
||||||
@@ -920,7 +953,7 @@ class StripeModule {
|
|||||||
// Unhandled event type
|
// Unhandled event type
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch(\UnexpectedValueException $e) {
|
} catch(\Stripe\Exception\UnexpectedValueException $e) {
|
||||||
// Invalid payload
|
// Invalid payload
|
||||||
http_response_code(400);
|
http_response_code(400);
|
||||||
Utils_WriteFileJson($this->LOG_FILE,['Error parsing payload: ' => $e->getMessage()],"a");
|
Utils_WriteFileJson($this->LOG_FILE,['Error parsing payload: ' => $e->getMessage()],"a");
|
||||||
@@ -930,6 +963,35 @@ class StripeModule {
|
|||||||
http_response_code(400);
|
http_response_code(400);
|
||||||
Utils_WriteFileJson($this->LOG_FILE,['Error verifying webhook signature: ' => $e->getMessage()],"a");
|
Utils_WriteFileJson($this->LOG_FILE,['Error verifying webhook signature: ' => $e->getMessage()],"a");
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\ApiConnectionException) {
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\ApiErrorException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\AuthenticationException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\BadMethodCallException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\CardException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\ExceptionInterface $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\IdempotencyException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\InvalidArgumentException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\InvalidRequestException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\PermissionException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\RateLimitException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\TemporarySessionExpiredException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\UnexpectedValueException $e){
|
||||||
|
|
||||||
|
} catch(\Stripe\Exception\UnknownApiErrorException $e){
|
||||||
|
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
// Invalid payload
|
// Invalid payload
|
||||||
http_response_code(400);
|
http_response_code(400);
|
||||||
@@ -1196,7 +1258,7 @@ class StripeModule {
|
|||||||
$managed_domain = $json["managed_domain"];
|
$managed_domain = $json["managed_domain"];
|
||||||
$config1 = $json["config"];
|
$config1 = $json["config"];
|
||||||
$handler = $json["mail_handlers"];
|
$handler = $json["mail_handlers"];
|
||||||
$member = $json["member"];
|
$member = $json["member"];
|
||||||
|
|
||||||
Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/tailfile077.json",["handle" => $json]);
|
Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/tailfile077.json",["handle" => $json]);
|
||||||
|
|
||||||
@@ -1742,7 +1804,6 @@ class StripeModule {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// rrrrr
|
|
||||||
// If you are testing your webhook locally with the Stripe CLI you
|
// If you are testing your webhook locally with the Stripe CLI you
|
||||||
// can find the endpoint's secret by running `stripe listen`
|
// can find the endpoint's secret by running `stripe listen`
|
||||||
// Otherwise, find your endpoint's secret in your webhook settings in the Developer Dashboard
|
// Otherwise, find your endpoint's secret in your webhook settings in the Developer Dashboard
|
||||||
|
|||||||
@@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace AppfactoryStudio\Plugins;
|
||||||
|
require_once dirname( __DIR__, 2 ) . "/include.php";
|
||||||
|
|
||||||
|
class Subscribers {
|
||||||
|
|
||||||
|
public function get_catalogs(){
|
||||||
|
client_subscriber_get_catalogs();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create_subscriber(){
|
||||||
|
client_subscriber_add_subscriber();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(){
|
||||||
|
return "store made";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_form1(){
|
||||||
|
return '<form action="/portal/api/membership/store" method="post"> <input type="text" /> <button type="submit">Submit</button> </form>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function member_update(){
|
||||||
|
$content = trim(file_get_contents("php://input"));
|
||||||
|
$decoded = json_decode($content, true);
|
||||||
|
$member = $decoded["data"];
|
||||||
|
// $member = json_decode(\Input::get("data"),true);
|
||||||
|
SaveMember($member);
|
||||||
|
EchoJsonResponse($decoded);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get_membership(){
|
||||||
|
$subdomain = getSubdomain2();
|
||||||
|
$domain = get_subdomain_managed_domain_new_way($subdomain);
|
||||||
|
|
||||||
|
$username = \Input::get("username");
|
||||||
|
|
||||||
|
if($username==""){
|
||||||
|
$payload = json_decode(@file_get_contents('php://input'), true);
|
||||||
|
$username = $payload["username"];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// $nameid = \Input::get("nameid");
|
||||||
|
$db = new \DB();
|
||||||
|
$rows = $db->query("SELECT * FROM users_member WHERE reference_num='$username'",[], \PDO::FETCH_ASSOC);
|
||||||
|
$member = ["set"=>false,"username"=>$username];
|
||||||
|
if($rows->count() > 0){
|
||||||
|
$member = $rows->results()[0];
|
||||||
|
$member["json_data"] = json_decode(html_entity_decode($member["json_data"]),true);
|
||||||
|
}
|
||||||
|
$db = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$config_domain = __get_main_configurations();
|
||||||
|
$managed_domain = $config_domain["managed_domain"];
|
||||||
|
$config = $config_domain["configurations"];
|
||||||
|
|
||||||
|
$tenants = [];
|
||||||
|
$db = new \DB();
|
||||||
|
$rows = $db->query("SELECT * FROM brain_http_server_tenants WHERE member_reference_num='$username'",[],\PDO::FETCH_ASSOC);
|
||||||
|
if($rows->count() > 0){
|
||||||
|
for ($i=0; $i < $rows->count(); $i++) {
|
||||||
|
$tenant = $rows->results()[$i];
|
||||||
|
$tenant["json"] = json_decode(html_entity_decode($tenant["json"]),true);
|
||||||
|
array_push($tenants, $tenant);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$db = null;
|
||||||
|
// $authfile = dirname(__DIR__, 5) . "/db/application_data_model_schema.json";
|
||||||
|
// $auth_config = file_get_contents($authfile);
|
||||||
|
|
||||||
|
$authfile2 = dirname(__DIR__, 7) . "/system/data/application_registry_schema.json";
|
||||||
|
$auth_config2 = file_get_contents($authfile2);
|
||||||
|
return json_encode([
|
||||||
|
// "account" => $account,
|
||||||
|
// "config" => json_decode($auth_config),
|
||||||
|
"member" => $member,
|
||||||
|
"tenants" => $tenants,
|
||||||
|
"access" => $config["access"][0]["json"],
|
||||||
|
"registry" => json_decode($auth_config2),
|
||||||
|
"username" => $username,
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function member_get_config(){
|
||||||
|
// ApiCheck(function($header_set,$status,$decoded){
|
||||||
|
$username = \Input::get("subdomain");
|
||||||
|
$subdomain = getSubdomain2();
|
||||||
|
$domain = get_subdomain_managed_domain_new_way($subdomain);
|
||||||
|
|
||||||
|
$db = new \DB();
|
||||||
|
$rows = $db->query("SELECT * FROM configurations WHERE category='domain_settings'",[],\PDO::FETCH_ASSOC);
|
||||||
|
$configurations = array();
|
||||||
|
if($rows->count() > 0){
|
||||||
|
// $configurations['access'] = true;
|
||||||
|
for($i=0; $i < $rows->count(); $i++){
|
||||||
|
if(array_key_exists($rows->results()[$i]["category"], $configurations)==false){
|
||||||
|
$configurations[$rows->results()[$i]["category"]] = [];
|
||||||
|
}
|
||||||
|
$con = $rows->results()[$i];
|
||||||
|
$con["json"] = json_decode(html_entity_decode($con["json"]),true);
|
||||||
|
array_push($configurations[$rows->results()[$i]["category"]], $con);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$db = null;
|
||||||
|
EchoJsonObject( [ "configuration" => $configurations, "domain" => $domain ] );
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ require_once dirname( __DIR__ ) . "/includes/mylibs/email/email_manager.php";
|
|||||||
|
|
||||||
// /home/appfactorystudio/websites/www/portal/admin/core/api/php/includes/mylibs/email/sendgrid.php
|
// /home/appfactorystudio/websites/www/portal/admin/core/api/php/includes/mylibs/email/sendgrid.php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
use Psr\Http\Message\ResponseInterface as Response;
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
@@ -70,9 +70,9 @@ function sendmessagetome(){
|
|||||||
|
|
||||||
function InitMemberUserAuthObject($type = "mysql"){
|
function InitMemberUserAuthObject($type = "mysql"){
|
||||||
// \ini_set('session.cookie_domain', 'appfactory.studio');
|
// \ini_set('session.cookie_domain', 'appfactory.studio');
|
||||||
if(session_status() !== PHP_SESSION_ACTIVE){
|
// if(session_status() !== PHP_SESSION_ACTIVE){
|
||||||
\ini_set('session.cookie_path', '/members');
|
// \ini_set('session.cookie_path', '/members');
|
||||||
}
|
// }
|
||||||
|
|
||||||
$username = $GLOBALS['config'][$type]["username"];
|
$username = $GLOBALS['config'][$type]["username"];
|
||||||
$password = $GLOBALS['config'][$type]["password"];
|
$password = $GLOBALS['config'][$type]["password"];
|
||||||
@@ -483,7 +483,6 @@ function EchoJsonObject($object){
|
|||||||
echo json_encode($object);
|
echo json_encode($object);
|
||||||
}
|
}
|
||||||
function RunCommand($shParams,$managed_domain,$cb=null,$isOutput=false){
|
function RunCommand($shParams,$managed_domain,$cb=null,$isOutput=false){
|
||||||
// ppppp
|
|
||||||
$basefolder = "/home/" . $managed_domain["SystemUser"] . "/websites/" . $managed_domain["Subdomain"] . "/portal/admin/core/scripts";
|
$basefolder = "/home/" . $managed_domain["SystemUser"] . "/websites/" . $managed_domain["Subdomain"] . "/portal/admin/core/scripts";
|
||||||
$shCmd = $basefolder . "/commands.sh";
|
$shCmd = $basefolder . "/commands.sh";
|
||||||
$cmd = $basefolder . "/bin/afs-website \"" . $shCmd . " " . $shParams . "\"";
|
$cmd = $basefolder . "/bin/afs-website \"" . $shCmd . " " . $shParams . "\"";
|
||||||
@@ -590,15 +589,20 @@ function get_membership_from_brain_controller(){
|
|||||||
'content' => http_build_query($obj)
|
'content' => http_build_query($obj)
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
$tenants = [];
|
$tenants = [];
|
||||||
$context = stream_context_create($options);
|
$context = stream_context_create($options);
|
||||||
$result = file_get_contents($requestUrl, false, $context);
|
$result = file_get_contents($requestUrl, false, $context);
|
||||||
if ($result === FALSE) {
|
if ($result === FALSE) {
|
||||||
$result = ["status" => "failure"];
|
$result = ["status" => "failure"];
|
||||||
}else{
|
}else{
|
||||||
$result = json_decode($result,true);
|
$result = json_decode($result,true);
|
||||||
$result["member"]["domain"] = $domain;
|
// $result["member"]["domain"] = $domain;
|
||||||
$result["member"]["json_data"] = json_decode(html_entity_decode($result["member"]["json_data"]), true);
|
|
||||||
|
//Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/_afile.json",$result["member"]);
|
||||||
|
if(gettype($result["member"]["json_data"])=="string"){
|
||||||
|
$result["member"]["json_data"] = json_decode(html_entity_decode($result["member"]["json_data"]), true);
|
||||||
|
}
|
||||||
|
|
||||||
for ($i=0; $i < count($result["tenants"]); $i++) {
|
for ($i=0; $i < count($result["tenants"]); $i++) {
|
||||||
$tenants[$i] = $result["tenants"][$i];
|
$tenants[$i] = $result["tenants"][$i];
|
||||||
// $tenants[$i]["json"] = json_decode(html_entity_decode($tenants[$i]["json"]), true);
|
// $tenants[$i]["json"] = json_decode(html_entity_decode($tenants[$i]["json"]), true);
|
||||||
@@ -646,7 +650,8 @@ function get_membership_from_brain_controller(){
|
|||||||
"tenant" => $tenant,
|
"tenant" => $tenant,
|
||||||
"member" => $result["member"],
|
"member" => $result["member"],
|
||||||
"url" => $requestUrl,
|
"url" => $requestUrl,
|
||||||
"result" => $result
|
"result" => $result,
|
||||||
|
"domain" => $domain
|
||||||
// "createdby" => $createdby,
|
// "createdby" => $createdby,
|
||||||
// "domain" => $domain,
|
// "domain" => $domain,
|
||||||
// "override" => $override,
|
// "override" => $override,
|
||||||
@@ -1490,7 +1495,7 @@ function SendEmailBuilder($handler,$integration,$config,$domain,$cb=null){
|
|||||||
|
|
||||||
|
|
||||||
$form_data["variables"]["system"] = SetupEmailSystemVariables($integration,$config, $form_data, $domain);
|
$form_data["variables"]["system"] = SetupEmailSystemVariables($integration,$config, $form_data, $domain);
|
||||||
Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/tailfile778.json",$form_data);
|
// Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/tailfile778.json",$form_data);
|
||||||
|
|
||||||
// nnnnn
|
// nnnnn
|
||||||
if($form_data!=null &&
|
if($form_data!=null &&
|
||||||
@@ -1530,55 +1535,43 @@ function SendEmailBuilder($handler,$integration,$config,$domain,$cb=null){
|
|||||||
$from = $form_data["from"];
|
$from = $form_data["from"];
|
||||||
|
|
||||||
// ccccc
|
// ccccc
|
||||||
if(array_key_exists("variables",$form_data)){
|
|
||||||
// the system and schema variables only need 1 array as their values shouldn't change
|
|
||||||
$index_count = 0;
|
|
||||||
// schema variables process first because they might contain other variables
|
|
||||||
if(array_key_exists("schema",$form_data["variables"])){
|
|
||||||
// $setvariables = $form_data["variables"]["schema"];
|
|
||||||
|
|
||||||
//
|
try {
|
||||||
$form_data["variables"]["schema"] = [$form_data["variables"]["schema"]];
|
if(array_key_exists("variables",$form_data)){
|
||||||
|
// the system and schema variables only need 1 array as their values shouldn't change
|
||||||
|
$index_count = 0;
|
||||||
|
// schema variables process first because they might contain other variables
|
||||||
|
if(array_key_exists("schema",$form_data["variables"])){
|
||||||
|
// $setvariables = $form_data["variables"]["schema"];
|
||||||
|
|
||||||
|
//
|
||||||
|
$form_data["variables"]["schema"] = [$form_data["variables"]["schema"]];
|
||||||
|
|
||||||
|
|
||||||
// https://www.appfactory.studio/portal/admin/core/assets/tabler-icons/icons/brand-instagram.svg
|
// https://www.appfactory.studio/portal/admin/core/assets/tabler-icons/icons/brand-instagram.svg
|
||||||
// https://www.appfactory.studio/assets/social_icons/facebook_733547.png
|
// https://www.appfactory.studio/assets/social_icons/facebook_733547.png
|
||||||
// https://www.appfactory.studio/assets/social_icons/instagram_174855.png
|
// https://www.appfactory.studio/assets/social_icons/instagram_174855.png
|
||||||
// https://www.appfactory.studio/assets/social_icons/twitter_11823292.png
|
// https://www.appfactory.studio/assets/social_icons/twitter_11823292.png
|
||||||
|
|
||||||
// https://www.appfactory.studio/portal/admin/core/assets/tabler-icons/icons/brand-facebook-filled.svg
|
// https://www.appfactory.studio/portal/admin/core/assets/tabler-icons/icons/brand-facebook-filled.svg
|
||||||
// Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/tailfile303.json",$form_data["variables"]);
|
// Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/tailfile303.json",$form_data["variables"]);
|
||||||
if($form_data["variables"]["schema"][$index_count]!=null){
|
if($form_data["variables"]["schema"][$index_count]!=null){
|
||||||
for($n=0; $n < count($form_data["variables"]["schema"][$index_count]); $n++){
|
for($n=0; $n < count($form_data["variables"]["schema"][$index_count]); $n++){
|
||||||
$var = $form_data["variables"]["schema"][$index_count][$n];
|
$var = $form_data["variables"]["schema"][$index_count][$n];
|
||||||
$value = "";
|
$value = "";
|
||||||
if($var!=null){
|
if($var!=null){
|
||||||
Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/_tailfile.json",$var);
|
// Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/_tailfile.json",$var);
|
||||||
if(array_key_exists("value",$var)){$value = $var["value"];}
|
if(array_key_exists("value",$var)){$value = $var["value"];}
|
||||||
$subject = str_replace("\${".$var["name"]."}", strip_tags( $value), $subject);
|
$subject = str_replace("\${".$var["name"]."}", strip_tags( $value), $subject);
|
||||||
$title = str_replace("\${".$var["name"]."}", $value, $title);
|
$title = str_replace("\${".$var["name"]."}", $value, $title);
|
||||||
$html = str_replace("\${".$var["name"]."}", $value, $html);
|
$html = str_replace("\${".$var["name"]."}", $value, $html);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if(array_key_exists("client",$form_data["variables"])){
|
||||||
if(array_key_exists("client",$form_data["variables"])){
|
for($n=0; $n < count($form_data["variables"]["client"][$i]); $n++){
|
||||||
for($n=0; $n < count($form_data["variables"]["client"][$i]); $n++){
|
$var = $form_data["variables"]["client"][$i][$n];
|
||||||
$var = $form_data["variables"]["client"][$i][$n];
|
|
||||||
$value = "";
|
|
||||||
if($var!=null){
|
|
||||||
if(array_key_exists("value",$var)){$value = $var["value"];}
|
|
||||||
$subject = str_replace("\${".$var["name"]."}", strip_tags( $value), $subject);
|
|
||||||
$title = str_replace("\${".$var["name"]."}", $value, $title);
|
|
||||||
$html = str_replace("\${".$var["name"]."}", $value, $html);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(array_key_exists("system",$form_data["variables"])){
|
|
||||||
$setvariables = $form_data["variables"]["system"];
|
|
||||||
if($setvariables!=null && $setvariables[$index_count]!=null){
|
|
||||||
for($n=0; $n < count($setvariables[$index_count]); $n++){
|
|
||||||
$var = $setvariables[$index_count][$n];
|
|
||||||
$value = "";
|
$value = "";
|
||||||
if($var!=null){
|
if($var!=null){
|
||||||
if(array_key_exists("value",$var)){$value = $var["value"];}
|
if(array_key_exists("value",$var)){$value = $var["value"];}
|
||||||
@@ -1588,7 +1581,26 @@ function SendEmailBuilder($handler,$integration,$config,$domain,$cb=null){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(array_key_exists("system",$form_data["variables"])){
|
||||||
|
$setvariables = $form_data["variables"]["system"];
|
||||||
|
if($setvariables!=null && $setvariables[$index_count]!=null){
|
||||||
|
for($n=0; $n < count($setvariables[$index_count]); $n++){
|
||||||
|
$var = $setvariables[$index_count][$n];
|
||||||
|
$value = "";
|
||||||
|
if($var!=null){
|
||||||
|
if(array_key_exists("value",$var)){$value = $var["value"];}
|
||||||
|
// Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/tailfile30345.json",["message" => $form_data["variables"]["system"]]);
|
||||||
|
$subject = str_replace("\${".$var["name"]."}", strip_tags( $value), $subject);
|
||||||
|
$title = str_replace("\${".$var["name"]."}", $value, $title);
|
||||||
|
$html = str_replace("\${".$var["name"]."}", $value, $html);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}catch(\Exception $e){
|
||||||
|
|
||||||
}
|
}
|
||||||
// $html = str_replace(" ","", $html);
|
// $html = str_replace(" ","", $html);
|
||||||
// $html = str_replace(" ","", $html);
|
// $html = str_replace(" ","", $html);
|
||||||
@@ -1597,7 +1609,7 @@ function SendEmailBuilder($handler,$integration,$config,$domain,$cb=null){
|
|||||||
$html = str_replace(" ", "", $html);
|
$html = str_replace(" ", "", $html);
|
||||||
$html = html_entity_decode($html);
|
$html = html_entity_decode($html);
|
||||||
|
|
||||||
Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/tailfile333.json",$integration);
|
// Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/tailfile333.json",$integration);
|
||||||
if($integration["name"]=="sendgrid"){
|
if($integration["name"]=="sendgrid"){
|
||||||
$mydata = [];
|
$mydata = [];
|
||||||
$mydata["subject"] = $subject;
|
$mydata["subject"] = $subject;
|
||||||
@@ -1608,7 +1620,7 @@ function SendEmailBuilder($handler,$integration,$config,$domain,$cb=null){
|
|||||||
$mydata["html"] = $html;
|
$mydata["html"] = $html;
|
||||||
$mydata["sendgrid_key"] = $integration["secret"];//"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";
|
$mydata["sendgrid_key"] = $integration["secret"];//"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";
|
||||||
_email_send_sendgrid($mydata,$message_response, $cb);
|
_email_send_sendgrid($mydata,$message_response, $cb);
|
||||||
Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/tailfile334.json",$mydata);
|
// Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/tailfile334.json",$mydata);
|
||||||
}
|
}
|
||||||
if($integration["name"]=="appfactory_studio"){
|
if($integration["name"]=="appfactory_studio"){
|
||||||
$mailobj = [
|
$mailobj = [
|
||||||
@@ -1679,26 +1691,12 @@ function admin_email_test_send_email(){
|
|||||||
|
|
||||||
$data["variables"]["client"] = [[["name" => "_testing_", "value" => "_name_"]]];
|
$data["variables"]["client"] = [[["name" => "_testing_", "value" => "_name_"]]];
|
||||||
// $data["variables"]["schema"] = $data["variables"]["schema"];
|
// $data["variables"]["schema"] = $data["variables"]["schema"];
|
||||||
Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/__tailfile.json",$data["variables"]["schema"]);
|
// Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/__tailfile.json",$data["variables"]["schema"]);
|
||||||
$integration = GetActiveEmailIntegration($config);
|
$integration = GetActiveEmailIntegration($config);
|
||||||
SendEmailBuilder($data,$integration, $config, $managed_domain,function($resp)use ($data){
|
SendEmailBuilder($data,$integration, $config, $managed_domain,function($resp)use ($data){
|
||||||
EchoJsonObject(["data" => $resp, "variables" => $data["variables"]]);
|
EchoJsonObject(["data" => $resp, "variables" => $data["variables"]]);
|
||||||
});
|
});
|
||||||
|
|
||||||
// $client_variables = [];
|
|
||||||
// $integration = GetActiveEmailIntegration($config);
|
|
||||||
// // $mail_handler = array_shift($mail_handlers);
|
|
||||||
// $mail_handlers = ["handler" => $data];
|
|
||||||
// SendEmailBuildIntegration(
|
|
||||||
// $mail_handlers,
|
|
||||||
// $client_variables,
|
|
||||||
// $integration,
|
|
||||||
// $config,
|
|
||||||
// $managed_domain,
|
|
||||||
// function($resp){
|
|
||||||
// EchoJsonObject(["data" => $resp]);
|
|
||||||
// });
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1973,7 +1971,6 @@ function send_invite_email($fields){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function send_email($data){
|
function send_email($data){
|
||||||
// ppppp
|
|
||||||
$to = $data['to'];
|
$to = $data['to'];
|
||||||
$from = $data['from'];
|
$from = $data['from'];
|
||||||
$subject = $data['subject'];
|
$subject = $data['subject'];
|
||||||
@@ -2531,6 +2528,7 @@ function DirectPaymentsSelectProcessor($obj,$configuration){
|
|||||||
|
|
||||||
$processor = null;
|
$processor = null;
|
||||||
for ($i=0; $i < count($processors); $i++) {
|
for ($i=0; $i < count($processors); $i++) {
|
||||||
|
// Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/afile$i.json", $processors[$i]);
|
||||||
$nameid = $processors[$i]["json"]["nameid"];
|
$nameid = $processors[$i]["json"]["nameid"];
|
||||||
if($obj["type"]==0){
|
if($obj["type"]==0){
|
||||||
if($nameid==$obj["json"]["configuration"]["payables"]["processor"]){
|
if($nameid==$obj["json"]["configuration"]["payables"]["processor"]){
|
||||||
@@ -4160,7 +4158,7 @@ function create_new_member($auth){
|
|||||||
"firstname" => $member["firstname"],
|
"firstname" => $member["firstname"],
|
||||||
"lastname" => $member["lastname"],
|
"lastname" => $member["lastname"],
|
||||||
"email" => $member["email"],
|
"email" => $member["email"],
|
||||||
"family" => $member["family"],
|
"family" => 1, //$member["family"],
|
||||||
"level" => $member["level"],
|
"level" => $member["level"],
|
||||||
"membership" => $member["membership"],
|
"membership" => $member["membership"],
|
||||||
"password" => $member["password"],
|
"password" => $member["password"],
|
||||||
@@ -4408,7 +4406,7 @@ function member_createERPNextCustomer($userId,$member){
|
|||||||
'cust_name' => $member["firstname"],
|
'cust_name' => $member["firstname"],
|
||||||
'cust_type' => 'Individual',
|
'cust_type' => 'Individual',
|
||||||
'cust_group' => 'Individual',
|
'cust_group' => 'Individual',
|
||||||
'territory' => $member["country"],
|
'territory' => $member["country_code"],
|
||||||
'default_currency' => 'USD',
|
'default_currency' => 'USD',
|
||||||
'email_id' => $member["email"],
|
'email_id' => $member["email"],
|
||||||
'address_title' => 'Main',
|
'address_title' => 'Main',
|
||||||
@@ -4417,7 +4415,7 @@ function member_createERPNextCustomer($userId,$member){
|
|||||||
'address_line2' => '',
|
'address_line2' => '',
|
||||||
'city' => $member["city"],
|
'city' => $member["city"],
|
||||||
'state' => $member["state"],
|
'state' => $member["state"],
|
||||||
'country' => $member["country"],
|
'country' => $member["country_name"],
|
||||||
'pincode' => $member["zip_code"]],
|
'pincode' => $member["zip_code"]],
|
||||||
CURLOPT_HTTPHEADER => [
|
CURLOPT_HTTPHEADER => [
|
||||||
'Authorization: Token c49c62746224379:2f52f3438cfe883',
|
'Authorization: Token c49c62746224379:2f52f3438cfe883',
|
||||||
@@ -4996,12 +4994,12 @@ function apicall_stripe_create_subscription($decoded){
|
|||||||
|
|
||||||
function webhookStripeHandlePaymentIntentSucceeded($event){
|
function webhookStripeHandlePaymentIntentSucceeded($event){
|
||||||
$paymentMethod = $event->data->object;
|
$paymentMethod = $event->data->object;
|
||||||
$file = "/mnt/node1/appfactorystudio/tmp/a_hello_world_payment1.json";
|
// $file = "/mnt/node1/appfactorystudio/tmp/a_hello_world_payment1.json";
|
||||||
Utils_WriteFileJson($file,["event" => $event->type, "payment" => $paymentMethod]);
|
Utils_WriteFileJson($file,["event" => $event->type, "payment" => $paymentMethod]);
|
||||||
}
|
}
|
||||||
function webhookStripeHandlePaymentMethodAttached($event){
|
function webhookStripeHandlePaymentMethodAttached($event){
|
||||||
$paymentMethod = $event->data->object;
|
$paymentMethod = $event->data->object;
|
||||||
$file = "/mnt/node1/appfactorystudio/tmp/a_hello_world_payment2.json";
|
// $file = "/mnt/node1/appfactorystudio/tmp/a_hello_world_payment2.json";
|
||||||
Utils_WriteFileJson($file,["event" => $event->type, "payment" => $paymentMethod]);
|
Utils_WriteFileJson($file,["event" => $event->type, "payment" => $paymentMethod]);
|
||||||
}
|
}
|
||||||
function webhookStripeHandlePaymentSucceeded($event){
|
function webhookStripeHandlePaymentSucceeded($event){
|
||||||
@@ -6744,7 +6742,7 @@ function get_admin_user($auth){
|
|||||||
$user = $result->fetch_assoc();
|
$user = $result->fetch_assoc();
|
||||||
unset($user["password_hash"]);
|
unset($user["password_hash"]);
|
||||||
$user["user_id"] = $auth->getUserId();
|
$user["user_id"] = $auth->getUserId();
|
||||||
$user["json_data"] = json_decode(html_entity_decode($user["json_data"]),true);
|
$user["json"] = json_decode(html_entity_decode($user["json"]),true);
|
||||||
EchoJsonObject(["user" => $user]);
|
EchoJsonObject(["user" => $user]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7161,25 +7159,13 @@ function admin_subscriber_get_subscribers(){
|
|||||||
EchoJsonObject($subscribers);
|
EchoJsonObject($subscribers);
|
||||||
|
|
||||||
}
|
}
|
||||||
function admin_subscriber_update_subscriber(){
|
|
||||||
$subscriber = json_decode(Input::get("subscriber"), true);
|
|
||||||
$db = new DB();
|
|
||||||
$db->updateFields("subscribers",[
|
|
||||||
"name" => $subscriber["name"],
|
|
||||||
// "catagory" => $subscriber["catagory"],
|
|
||||||
"json" => htmlentities(json_encode($subscriber["json"]))
|
|
||||||
],[
|
|
||||||
"reference_num" => $subscriber["reference_num"]
|
|
||||||
]);
|
|
||||||
$db = null;
|
|
||||||
EchoJsonResponse();
|
|
||||||
}
|
|
||||||
function client_subscriber_get_catalogs(){
|
function client_subscriber_get_catalogs(){
|
||||||
$token = Input::get("token");
|
$token = Input::get("token");
|
||||||
if(CheckClientToken($token)==false){
|
// if(CheckClientToken($token)==false){
|
||||||
EchoJsonResponse("request_failure");
|
// EchoJsonResponse("request_failure");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
$catalogs = [];
|
$catalogs = [];
|
||||||
$db = new DB();
|
$db = new DB();
|
||||||
@@ -7195,23 +7181,54 @@ function client_subscriber_get_catalogs(){
|
|||||||
|
|
||||||
EchoJsonObject(["catalogs" => $catalogs]);
|
EchoJsonObject(["catalogs" => $catalogs]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ppppp
|
// ppppp
|
||||||
function client_subscriber_add_subscriber(){
|
function admin_subscriber_update_subscriber(){
|
||||||
$token = Input::get("token");
|
$subscriber = json_decode(Input::get("subscriber"), true);
|
||||||
if(CheckClientToken($token)==false){
|
$email = $subscriber["email"];
|
||||||
EchoJsonResponse("request_failure");
|
$db = new DB();
|
||||||
return;
|
$rows = $db->query("SELECT * FROM subscribers WHERE email='$email'");
|
||||||
|
if($rows->count() > 0){
|
||||||
|
$db->updateFields("subscribers",[
|
||||||
|
"name" => $subscriber["name"],
|
||||||
|
// "catagory" => $subscriber["catagory"],
|
||||||
|
"json" => htmlentities(json_encode($subscriber["json"]))
|
||||||
|
],[
|
||||||
|
"reference_num" => $subscriber["reference_num"]
|
||||||
|
]);
|
||||||
|
}else{
|
||||||
|
$db->insert("subscribers",[
|
||||||
|
"reference_num" => $subscriber["reference_num"],
|
||||||
|
"email" => $email,
|
||||||
|
"json" => htmlentities(json_encode($subscriber["json"]))
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$db = null;
|
||||||
|
EchoJsonResponse('success');
|
||||||
|
}
|
||||||
|
function client_subscriber_add_subscriber(){
|
||||||
|
// $token = Input::get("token");
|
||||||
|
// if(CheckClientToken($token)==false){
|
||||||
|
// EchoJsonResponse("request_failure");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
$config_domain = __get_main_configurations();
|
$config_domain = __get_main_configurations();
|
||||||
$managed_domain = $config_domain["managed_domain"];
|
$managed_domain = $config_domain["managed_domain"];
|
||||||
$config = $config_domain["configurations"];
|
$config = $config_domain["configurations"];
|
||||||
$settings = $config["settings"][0]["json"];
|
$settings = $config["settings"][0]["json"];
|
||||||
|
|
||||||
$sendresponse = Input::get("sendresponse");
|
$payload = json_decode(@file_get_contents('php://input'), true);
|
||||||
$subscriber = json_decode(Input::get("subscriber"), true);
|
$sendresponse = $payload["data"]["sendresponse"];
|
||||||
$response = json_decode(Input::get("response"), true);
|
$subscriber = $payload["data"]["subscriber"];
|
||||||
$email = $subscriber["email"];
|
$email = $subscriber["email"];
|
||||||
|
|
||||||
|
// $sendresponse = Input::get("sendresponse");
|
||||||
|
// $subscriber = json_decode(Input::get("subscriber"), true);
|
||||||
|
// $mail_handlers = json_decode(Input::get("mail_handlers"), true);
|
||||||
|
// $email = $subscriber["email"];
|
||||||
|
|
||||||
$db = new DB();
|
$db = new DB();
|
||||||
$rows = $db->query("SELECT * FROM subscribers WHERE email='$email'",[],PDO::FETCH_ASSOC);
|
$rows = $db->query("SELECT * FROM subscribers WHERE email='$email'",[],PDO::FETCH_ASSOC);
|
||||||
if($rows->count() > 0){
|
if($rows->count() > 0){
|
||||||
@@ -7240,13 +7257,13 @@ function client_subscriber_add_subscriber(){
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$db = null;
|
$db = null;
|
||||||
if($sendresponse==true || $sendresponse=="true"){
|
// if($sendresponse==true || $sendresponse=="true"){
|
||||||
SendEmailBuilder($response,$managed_domain,function($resp){
|
// SendEmailBuilder($response,$managed_domain,function($resp){
|
||||||
// EchoJsonObject(["data" => $resp]);
|
// // EchoJsonObject(["data" => $resp]);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
EchoJsonResponse();
|
EchoJsonObject($payload);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7803,7 +7820,7 @@ function submit_form(){
|
|||||||
$reference_num = Input::get("reference_num");
|
$reference_num = Input::get("reference_num");
|
||||||
$form_json = json_decode(Input::get("form_json"),true);
|
$form_json = json_decode(Input::get("form_json"),true);
|
||||||
$submission_json = json_decode(Input::get("submission_json"),true);
|
$submission_json = json_decode(Input::get("submission_json"),true);
|
||||||
|
$client_variables = json_decode(Input::get('client_variables'),true);
|
||||||
|
|
||||||
$db = new DB();
|
$db = new DB();
|
||||||
$db->insert("form_submissions", array(
|
$db->insert("form_submissions", array(
|
||||||
@@ -7824,6 +7841,23 @@ function submit_form(){
|
|||||||
$mytype = "yes";
|
$mytype = "yes";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ppppp
|
||||||
|
|
||||||
|
$integration = GetActiveEmailIntegration($config);
|
||||||
|
$mail_handler = array_shift($mail_handlers);
|
||||||
|
SendEmailBuildIntegration(
|
||||||
|
$mail_handler,
|
||||||
|
$client_variables,
|
||||||
|
$integration,
|
||||||
|
$config,
|
||||||
|
$managed_domain,
|
||||||
|
function($resp){
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// // $form_json["email_alert"]["variables"] = [$form_json["variables"]];
|
// // $form_json["email_alert"]["variables"] = [$form_json["variables"]];
|
||||||
// $form_json["json"]["email_alert"]["_output_html"] = "forms/alert_" . $time . ".html";
|
// $form_json["json"]["email_alert"]["_output_html"] = "forms/alert_" . $time . ".html";
|
||||||
// SendEmail($form_json["json"]["email_alert"],$managed_domain,function($message){
|
// SendEmail($form_json["json"]["email_alert"],$managed_domain,function($message){
|
||||||
@@ -10321,7 +10355,7 @@ function SetupEmailSystemVariables($integration, $config, $handler, $managed_dom
|
|||||||
|
|
||||||
$logo1 = "";
|
$logo1 = "";
|
||||||
if(array_key_exists("logo1", $domain_setting["brand"]["logos"])) {
|
if(array_key_exists("logo1", $domain_setting["brand"]["logos"])) {
|
||||||
$logo1 = $domain_setting["brand"]["logos"]["logo1"];
|
$logo1 = $domain_setting["brand"]["logos"]["logo1"]["reference_num"];
|
||||||
}
|
}
|
||||||
array_push($variables, [
|
array_push($variables, [
|
||||||
"name" => "mybrand_logo1",
|
"name" => "mybrand_logo1",
|
||||||
@@ -10330,7 +10364,7 @@ function SetupEmailSystemVariables($integration, $config, $handler, $managed_dom
|
|||||||
|
|
||||||
$logo2 = "";
|
$logo2 = "";
|
||||||
if(array_key_exists("logo2", $domain_setting["brand"]["logos"])) {
|
if(array_key_exists("logo2", $domain_setting["brand"]["logos"])) {
|
||||||
$logo2 = $domain_setting["brand"]["logos"]["logo2"];
|
$logo2 = $domain_setting["brand"]["logos"]["logo2"]["reference_num"];
|
||||||
}
|
}
|
||||||
array_push($variables, [
|
array_push($variables, [
|
||||||
"name" => "mybrand_logo2",
|
"name" => "mybrand_logo2",
|
||||||
@@ -10339,7 +10373,7 @@ function SetupEmailSystemVariables($integration, $config, $handler, $managed_dom
|
|||||||
|
|
||||||
$logo3 = "";
|
$logo3 = "";
|
||||||
if(array_key_exists("logo3", $domain_setting["brand"]["logos"])) {
|
if(array_key_exists("logo3", $domain_setting["brand"]["logos"])) {
|
||||||
$logo2 = $domain_setting["brand"]["logos"]["logo3"];
|
$logo2 = $domain_setting["brand"]["logos"]["logo3"]["reference_num"];
|
||||||
}
|
}
|
||||||
array_push($variables, [
|
array_push($variables, [
|
||||||
"name" => "mybrand_logo3",
|
"name" => "mybrand_logo3",
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ function func_page($auth, $is_sandbox = false){
|
|||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css" integrity="sha512-dPXYcDub/aeb08c63jRq/k6GaKccl256JQy/AnOq7CAnEZ9FzSL9wSbcZkMp4R26vBsMLFYH4kQ67/bbV8XaCQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css" integrity="sha512-dPXYcDub/aeb08c63jRq/k6GaKccl256JQy/AnOq7CAnEZ9FzSL9wSbcZkMp4R26vBsMLFYH4kQ67/bbV8XaCQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||||
<!-- <link rel="stylesheet" href="/portal/admin/core/libs/font-awsome-6.6.0-all.min.css"> -->
|
<!-- <link rel="stylesheet" href="/portal/admin/core/libs/font-awsome-6.6.0-all.min.css"> -->
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.0/css/all.min.css" integrity="sha512-3PN6gfRNZEX4YFyz+sIyTF6pGlQiryJu9NlGhu9LrLMQ7eDjNgudQoFDK3WSNAayeIKc6B8WXXpo4a7HqxjKwg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.0/css/all.min.css" integrity="sha512-3PN6gfRNZEX4YFyz+sIyTF6pGlQiryJu9NlGhu9LrLMQ7eDjNgudQoFDK3WSNAayeIKc6B8WXXpo4a7HqxjKwg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||||
<link rel="stylesheet" href="/portal/admin/core/api/styles/tabler/tabler.min.css"/>
|
<link rel="stylesheet" href="/portal/admin/core/api/styles/tabler/tabler.css"/>
|
||||||
|
|
||||||
<script src="/portal/admin/core/api/js/libs/jquery-3.6.3.min.js"></script>
|
<script src="/portal/admin/core/api/js/libs/jquery-3.6.3.min.js"></script>
|
||||||
<!-- <script src="/portal/admin/core/api/js/libs/bootstrap.bundle.min.js"></script> -->
|
<!-- <script src="/portal/admin/core/api/js/libs/bootstrap.bundle.min.js"></script> -->
|
||||||
@@ -120,10 +120,10 @@ function func_page($auth, $is_sandbox = false){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link href='/portal/admin/core/api/styles/styles.css' rel='stylesheet'>
|
|
||||||
<script src="//unpkg.com/grapesjs"></script>
|
<script src="//unpkg.com/grapesjs"></script>
|
||||||
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
|
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
|
||||||
<script src="/portal/admin/core/api/js/pages/modules/builder_email/mjml/_dist/index.js"></script>
|
<script src="/portal/admin/core/api/js/pages/modules/builder_email/mjml/_dist/index.js"></script>
|
||||||
|
<link href='/portal/admin/core/api/styles/styles.css' rel='stylesheet'>
|
||||||
|
|
||||||
|
|
||||||
<style> .spacer { width: 100%; height:550px;}</style>
|
<style> .spacer { width: 100%; height:550px;}</style>
|
||||||
|
|||||||
@@ -10,6 +10,25 @@ use \SendGrid\Mail\Mail;
|
|||||||
class EmailManager {
|
class EmailManager {
|
||||||
public function __construct(){ }
|
public function __construct(){ }
|
||||||
|
|
||||||
|
|
||||||
|
public function authDomain(){
|
||||||
|
|
||||||
|
$apiKey = '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';//getenv('SENDGRID_API_KEY'); // Or replace with your actual API key
|
||||||
|
$sg = new \SendGrid($apiKey);
|
||||||
|
|
||||||
|
$requestBody = json_decode('{
|
||||||
|
"domain": "mail.cradle2careertx.org",
|
||||||
|
"automated_security": false
|
||||||
|
}');
|
||||||
|
|
||||||
|
try {
|
||||||
|
$response = $sg->client->whitelabel()->domains()->post($requestBody);
|
||||||
|
// echo $response->statusCode();
|
||||||
|
return $response->body();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
return 'Caught exception: '. $e->getMessage() ."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function initialize($type,$data,$message_response,$cb){
|
public function initialize($type,$data,$message_response,$cb){
|
||||||
|
|||||||
@@ -499,7 +499,7 @@ if(Input::get('get_form_submissions')){
|
|||||||
get_form_submissions();
|
get_form_submissions();
|
||||||
}
|
}
|
||||||
if(Input::get('print_form')){
|
if(Input::get('print_form')){
|
||||||
print_form();
|
print_form();
|
||||||
}
|
}
|
||||||
if(Input::get('api_submit_form')){
|
if(Input::get('api_submit_form')){
|
||||||
api_submit_form();
|
api_submit_form();
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
@import url("https://fonts.googleapis.com/css?family=Roboto:300,400,400i,500");
|
@import url("https://fonts.googleapis.com/css?family=Roboto:300,400,400i,500");
|
||||||
|
|
||||||
|
:root {
|
||||||
|
/* --tblr-primary: #f1f1f1 !important; */
|
||||||
|
/* --tblr-bg-surface: #222222; */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
body {
|
body {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
* Copyright 2018-2023 codecalm.net Paweł Kuna
|
* Copyright 2018-2023 codecalm.net Paweł Kuna
|
||||||
* Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* change */
|
||||||
@charset "UTF-8";
|
@charset "UTF-8";
|
||||||
/* prettier-ignore */
|
/* prettier-ignore */
|
||||||
/* prettier-ignore */
|
/* prettier-ignore */
|
||||||
@@ -17587,7 +17589,11 @@ body.theme-dark .hide-theme-dark, body[data-bs-theme=dark] .hide-theme-dark {
|
|||||||
--tblr-emphasis-color: #ffffff;
|
--tblr-emphasis-color: #ffffff;
|
||||||
--tblr-emphasis-color-rgb: 255, 255, 255;
|
--tblr-emphasis-color-rgb: 255, 255, 255;
|
||||||
--tblr-bg-forms: #151f2c;
|
--tblr-bg-forms: #151f2c;
|
||||||
--tblr-bg-surface: #182433;
|
/* change */
|
||||||
|
/* --tblr-bg-surface: #182433; */
|
||||||
|
/* --tblr-bg-surface: #111111; */
|
||||||
|
/* --tblr-bg-surface: #222222; */
|
||||||
|
--tblr-bg-surface: #121212;
|
||||||
--tblr-bg-surface-dark: #151f2c;
|
--tblr-bg-surface-dark: #151f2c;
|
||||||
--tblr-bg-surface-secondary: #1b293a;
|
--tblr-bg-surface-secondary: #1b293a;
|
||||||
--tblr-bg-surface-tertiary: #151f2c;
|
--tblr-bg-surface-tertiary: #151f2c;
|
||||||
|
|||||||
@@ -19,3 +19,18 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<div id="dashboard-content"></div>
|
<div id="dashboard-content"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -392,7 +392,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -129,7 +129,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -114,7 +114,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -142,7 +142,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -432,7 +432,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -179,7 +179,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -131,7 +131,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -163,7 +163,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -207,7 +207,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -225,7 +225,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -159,7 +159,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -134,7 +134,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -113,7 +113,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -202,7 +202,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -97,7 +97,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -146,7 +146,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" style="text-decoration: none;" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" style="text-decoration: none;" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,6 +33,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-auto ms-auto d-print-none">
|
<div class="col-auto ms-auto d-print-none">
|
||||||
<div class="btn-list">
|
<div class="btn-list">
|
||||||
|
<span class="">
|
||||||
|
<a id="catalog_settings_btn" href="#" class="btn btn-outline-dark mb-4">
|
||||||
|
Settings
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
<span class="">
|
<span class="">
|
||||||
<a id="back_to_init" href="#" class="btn btn-outline-dark mb-4">
|
<a id="back_to_init" href="#" class="btn btn-outline-dark mb-4">
|
||||||
Back
|
Back
|
||||||
@@ -236,7 +241,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
||||||
<ul class="list-inline list-inline-dots mb-0">
|
<ul class="list-inline list-inline-dots mb-0">
|
||||||
<li class="list-inline-item"><a href="#" style="text-decoration: none;" class="link-secondary" rel="noopener">©2024 Appfactory Studio inc.</a></li>
|
<li class="list-inline-item"><a href="#" style="text-decoration: none;" class="link-secondary" rel="noopener">©2025 Appfactory Studio inc.</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -39,11 +39,11 @@
|
|||||||
Back
|
Back
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<span class="">
|
<!-- <span class="">
|
||||||
<a id="catalogs_configure_btn" href="#" class="btn btn-outline-dark">
|
<a id="catalogs_configure_btn" href="#" class="btn btn-outline-dark">
|
||||||
Settings
|
Settings
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span> -->
|
||||||
<a href="#" id="create_new_catalog_btn" class="btn btn-primary d-none d-sm-inline-block">
|
<a href="#" id="create_new_catalog_btn" class="btn btn-primary d-none d-sm-inline-block">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5l0 14"></path><path d="M5 12l14 0"></path></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5l0 14"></path><path d="M5 12l14 0"></path></svg>
|
||||||
Create new Catalog
|
Create new Catalog
|
||||||
|
|||||||
@@ -30,10 +30,7 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-md-2">
|
<div class="col-12 col-md-2">
|
||||||
<button id="edit_repsonse_content_id" class="btn btn-outline-dark w-100">Response Email</button>
|
<button id="email_manager" class="btn btn-outline-dark w-100">Email</button>
|
||||||
</div>
|
|
||||||
<div class="col-12 col-md-2">
|
|
||||||
<button id="edit_alert_content_id" class="btn btn-outline-dark w-100">Alert Email</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once dirname( __DIR__, 6 ) . "/portal/admin/core/api/php/includes/init.php";
|
require_once dirname( __DIR__, 6 ) . "/portal/admin/core/api/php/includes/init.php";
|
||||||
require_once dirname( __DIR__, 6 ) . "/portal/admin/core/api/php/includes/functions.php";
|
require_once dirname( __DIR__, 6 ) . "/portal/admin/core/api/php/includes/functions.php";
|
||||||
|
require_once dirname( __DIR__, 6 ) . "/portal/admin/core/api/php/includes/mylibs/email/email_manager.php";
|
||||||
|
|
||||||
|
//portal\admin\core\api\php\includes\mylibs\email\email_manager.php
|
||||||
|
|
||||||
|
|
||||||
if(Input::get("decode_string")){
|
if(Input::get("decode_string")){
|
||||||
@@ -11,6 +12,20 @@ if(Input::get("decode_string")){
|
|||||||
EchoJsonObject(["data" => $value]);
|
EchoJsonObject(["data" => $value]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(Input::get('domain')){
|
||||||
|
|
||||||
|
$email = new EmailManager();
|
||||||
|
|
||||||
|
$resp = $email->authDomain();
|
||||||
|
|
||||||
|
EchoJsonObject(["response" => json_decode($resp)]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(Input::get("send_email")){
|
if(Input::get("send_email")){
|
||||||
|
|
||||||
$data = json_decode(Input::get("data"), true);
|
$data = json_decode(Input::get("data"), true);
|
||||||
|
|||||||
@@ -8,23 +8,33 @@
|
|||||||
$("#submit_send_email").on("click",function(e){
|
$("#submit_send_email").on("click",function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
console.log("hello");
|
|
||||||
|
|
||||||
const value = $("#data_input_textarea").val().trim();
|
const value = $("#data_input_textarea").val().trim();
|
||||||
let json = JSON.parse(value);
|
let json = JSON.parse(value);
|
||||||
console.log(json);
|
console.log(json);
|
||||||
|
|
||||||
if(value==""){alert("Please add text");return;}
|
if(value==""){alert("Please add text");return;}
|
||||||
$("#data_output_textarea").val("");
|
$("#data_output_textarea").val("");
|
||||||
|
|
||||||
$.post("request.php",{
|
$.post("request.php",{
|
||||||
"send_email": true,
|
"domain": true,
|
||||||
"data": value
|
"data": {}
|
||||||
},function(resp){
|
},function(resp){
|
||||||
|
resp = JSON.parse(resp);
|
||||||
resp = JSON.parse(resp);
|
resp = JSON.parse(resp);
|
||||||
console.log(resp);
|
console.log(resp);
|
||||||
// $("#data_output_textarea").val(JSON.stringify(resp.data));
|
// $("#data_output_textarea").val(JSON.stringify(resp.data));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// $.post("request.php",{
|
||||||
|
// "send_email": true,
|
||||||
|
// "data": value
|
||||||
|
// },function(resp){
|
||||||
|
// resp = JSON.parse(resp);
|
||||||
|
// console.log(resp);
|
||||||
|
// // $("#data_output_textarea").val(JSON.stringify(resp.data));
|
||||||
|
// });
|
||||||
|
|
||||||
});
|
});
|
||||||
// https://jsoneditoronline.org/#left=local.pewama
|
// https://jsoneditoronline.org/#left=local.pewama
|
||||||
|
|
||||||
|
|||||||
478
portal/admin/playground/client/subscribers/_index.php
Normal file
478
portal/admin/playground/client/subscribers/_index.php
Normal file
@@ -0,0 +1,478 @@
|
|||||||
|
<?php
|
||||||
|
// require_once dirname( __DIR__, 2 ) . '/portal/admin/core/api/php/includes/indexcore.php';
|
||||||
|
// require_once 'portal/admin/core/api/php/includes/indexcore.php';
|
||||||
|
// require_once dirname(__DIR__, 2) . '/core/php/indexcore.php';
|
||||||
|
// header_remove("X-Powered-By");
|
||||||
|
// AFSIndexCoreTemplate("Cradle2Career - Events",
|
||||||
|
// "events_content.html",
|
||||||
|
// "events.css",
|
||||||
|
// "events",
|
||||||
|
// "../../",
|
||||||
|
// true,
|
||||||
|
// true,
|
||||||
|
// "pages/events.js");
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// require_once dirname( __DIR__, 2 ) . '/portal/admin/core/api/php/includes/indexcore.php';
|
||||||
|
// require_once 'portal/admin/core/api/php/includes/indexcore.php';
|
||||||
|
// require_once dirname(__DIR__, 2) . '/core/php/indexcore.php';
|
||||||
|
// header_remove("X-Powered-By");
|
||||||
|
// AFSIndexCoreTemplate("Cradle2Career - Events",
|
||||||
|
// "events_content.html",
|
||||||
|
// "events.css",
|
||||||
|
// "events",
|
||||||
|
// "../../",
|
||||||
|
// true,
|
||||||
|
// true,
|
||||||
|
// "pages/events.js");
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>Cradle2Career</title>
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico">
|
||||||
|
<!-- <link rel="stylesheet" href="https://unpkg.com/boxicons@2.0.7/css/boxicons.min.css"> -->
|
||||||
|
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"> -->
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css" integrity="sha512-2SwdPD6INVrV/lHTZbO2nodKhrnDdJK9/kg2XD1r9uGqPo1cUbujc+IYdlYdEErWNu69gVcYgdxlmVmzTWnetw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||||
|
<link rel="stylesheet" href="/core/styles/bootstrap-5.3.8-dist/css/bootstrap.min.css">
|
||||||
|
<!-- <link rel="stylesheet" href="/portal/admin/core/api/styles/tabler/tabler.min.css" /> -->
|
||||||
|
<link rel="stylesheet" href="/core/styles/styles.css">
|
||||||
|
<link rel="stylesheet" href="/core/styles/global.css">
|
||||||
|
<link rel="stylesheet" href="/core/styles/events.css">
|
||||||
|
|
||||||
|
<script src="https://code.jquery.com/jquery-3.6.3.min.js" integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script>
|
||||||
|
<script src="/portal/admin/core/api/js/appfactory/afsspinner.js"></script>
|
||||||
|
<script src="/portal/admin/core/api/js/libs/analytics_0.8.14.min.js"></script>
|
||||||
|
<script src="/portal/admin/core/api/js/libs/sameSize.js"></script>
|
||||||
|
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js"></script>
|
||||||
|
|
||||||
|
<script src="/portal/admin/core/api/js/libs/fetch-jsonp.js"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
<script src="https://api.appfactory.studio/sdk/js/afssdk.js"></script>
|
||||||
|
<script src="https://api.appfactory.studio/sdk/js/afssdk-internal.js"></script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- Navigation -->
|
||||||
|
<section class="navigation">
|
||||||
|
<div class="nav-container">
|
||||||
|
<div class="brand">
|
||||||
|
<img id="brand_image_logo_btn" class="brand_logo" src="../../../assets/c2c_stckd_pos_PMS.svg" alt="" width="145">
|
||||||
|
</div>
|
||||||
|
<div class="mobile-donate-btn">
|
||||||
|
<button class="nav-donate-btn button-34" data-bs-toggle="modal" data-bs-target="#modal_donation_dialog" role="button">
|
||||||
|
<i style="font-size: 1.75rem;" class="fas fa-hand-holding-heart fa-1x"></i>
|
||||||
|
</button>
|
||||||
|
<div class="clear-right"></div>
|
||||||
|
</div>
|
||||||
|
<nav class="mymainnav">
|
||||||
|
<div class="nav-mobile"><a id="nav-toggle" class="nav-toggle" href="#"><span></span></a></div>
|
||||||
|
<ul class="nav-list" style="">
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#!" class="main_nav_link mnl_about">About Us</span></a>
|
||||||
|
<ul class="nav-dropdown">
|
||||||
|
<li><a class="mainnav_list_item main-nav-anchor" href="/pages/whatwedo">What We Do</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/ourstory">Our Story</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/meettheboard">Meet The Board</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/financials">Financials</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#!" class="main_nav_link mnl_young">I'm a Young Parent</a>
|
||||||
|
<ul class="nav-dropdown">
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/apply">I Need Support</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/scholarships">Scholarships</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/resources">Resources</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#!" class="main_nav_link mnl_you">Give Forward</a>
|
||||||
|
<ul class="nav-dropdown">
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/waystodonate">Donate</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/volunteer">Volunteer</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/sponsorships">Sponsorships</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/partnerships">Partnerships </a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/pages/initiatives" id="initiatives_header_link" class="main_nav_link mnl_ini">Initiatives</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#!" class="main_nav_link mnl_news">News & Events</a>
|
||||||
|
<ul class="nav-dropdown">
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/events">Events</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/gallery">Gallery</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/news">News</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#!" class="main_nav_link mnl_contact">Contact</a>
|
||||||
|
<ul class="nav-dropdown">
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/media_inquires">Media Inquiries</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/need_a_speaker">Need A Speaker</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/contact">Contact Us </a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button style="background-color: #00B052;color: white;" class="nav-donate-btn button-33" id="main_modal_donation" role="button">
|
||||||
|
<img src="../../../assets/logos/Bug/White/c2c_bug_wht_RGB.png"
|
||||||
|
width="30"
|
||||||
|
/>Donate</button>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row mt-5">
|
||||||
|
<div class="col-12 mx-auto text-center">
|
||||||
|
<h1 class="text3 quirk-font">NOVEMBER 1, 2025 - TEEN PARENT SUMMIT</h1>
|
||||||
|
<a href="https://www.zeffy.com/en-US/ticketing/you-got-this-teen-parent-summit-2">
|
||||||
|
<h3>Register Here</h3>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 mx-auto text-center">
|
||||||
|
<p class="text3 fw-bold">
|
||||||
|
🌟 You Got This! Teen Summit
|
||||||
|
Empowering teen parents through education, support & community
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 mx-auto text-center mb-3">
|
||||||
|
<img id="instagram_event_img" style="cursor: pointer;" src="/assets/instagram_img.png" alt="" height="75px">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row mb-5 justify-content-center">
|
||||||
|
<div class="col-10 col-md-6 mx-auto justify-content-center">
|
||||||
|
<img src="/assets/flyer003.png" alt="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row d-flex justify-content-center">
|
||||||
|
<div class="col-12 col-md-3 mb-5 p-0">
|
||||||
|
<a class="text-center" href="https://www.zeffy.com/en-US/ticketing/you-got-this-teen-parent-summit-2">
|
||||||
|
<h3>Register Here</h3>
|
||||||
|
</a>
|
||||||
|
<p class="m-0 p-0 text-center">Living Word Fellowshipp Church</p>
|
||||||
|
<p class="m-0 p-0 text-center">7350 TC Jester BLVD.</p>
|
||||||
|
<p class="m-0 p-0 text-center mb-3">Houston, TX 77088</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<p class="m-0 p-0 text-center">(832) 987-2076 | info@cradle2careertx.org</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row d-flex justify-content-center">
|
||||||
|
<div class="col-md-3">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row row-cols-3 row-cols-md-3 row-cols-md-3 g-3">
|
||||||
|
<div class="col">
|
||||||
|
<a data-fslightbox="gallery" href="/assets/partners/sponsor_001.png">
|
||||||
|
|
||||||
|
<div class="img-responsive img-responsive-1x1 rounded" style="background-image: url(/assets/partners/sponsor_001.png)"></div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<a data-fslightbox="gallery" href="/assets/partners/sponsor_002.png">
|
||||||
|
|
||||||
|
<div class="img-responsive img-responsive-1x1 rounded" style="background-image: url(/assets/partners/sponsor_002.png)"></div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<a data-fslightbox="gallery" href="/assets/partners/sponsor_003.png">
|
||||||
|
|
||||||
|
<div class="img-responsive img-responsive-1x1 rounded" style="background-image: url(/assets/partners/sponsor_003.jpg)"></div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<a data-fslightbox="gallery" href="/assets/partners/sponsor_004.png">
|
||||||
|
|
||||||
|
<div class="img-responsive img-responsive-1x1 rounded" style="background-image: url(/assets/partners/sponsor_004.jpg)"></div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<a data-fslightbox="gallery" href="/assets/partners/sponsor_005.png">
|
||||||
|
|
||||||
|
<div class="img-responsive img-responsive-1x1 rounded" style="background-image: url(/assets/partners/sponsor_005.jpg)"></div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<a data-fslightbox="gallery" href="/assets/partners/sponsor_006.png">
|
||||||
|
|
||||||
|
<div class="img-responsive img-responsive-3x1 rounded" style="background-image: url(/assets/partners/sponsor_006.png)"></div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#spacer {
|
||||||
|
width: 100%;
|
||||||
|
height:600px;
|
||||||
|
}
|
||||||
|
.events-header-element {
|
||||||
|
width: 100%;
|
||||||
|
height: 50px;
|
||||||
|
/* background-color: #393e46; */
|
||||||
|
}
|
||||||
|
.events-header-element2{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 45px;
|
||||||
|
}
|
||||||
|
.events-header-element2-h4 {
|
||||||
|
|
||||||
|
}
|
||||||
|
.text56{
|
||||||
|
color: #00adb5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.hero {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
/* background: linear-gradient(45deg, #83B8D7, #BAA6FD); */
|
||||||
|
display: grid;
|
||||||
|
}
|
||||||
|
|
||||||
|
#calendar {
|
||||||
|
width: 100%;
|
||||||
|
/* margin: 40px auto; */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.text3 {
|
||||||
|
color: #00B052;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="sponsor-container mb-5">
|
||||||
|
<div class="sponsor-logo">
|
||||||
|
<img src="/assets/partners/sponsor_001.png" alt="" srcset="">
|
||||||
|
</div>
|
||||||
|
<div class="sponsor-logo">
|
||||||
|
<img src="/assets/partners/sponsor_006.png" alt="" srcset="">
|
||||||
|
</div>
|
||||||
|
<div class="sponsor-logo">
|
||||||
|
<img src="/assets/partners/sick_sensor_500x200.png" alt="" srcset="">
|
||||||
|
</div>
|
||||||
|
<div class="sponsor-logo">
|
||||||
|
<img src="/assets/partners/sponsor_002.png" alt="" srcset="">
|
||||||
|
</div>
|
||||||
|
<div class="sponsor-logo">
|
||||||
|
<img src="/assets/partners/sponsor_003.jpg" alt="" srcset="">
|
||||||
|
</div>
|
||||||
|
<div class="sponsor-logo">
|
||||||
|
<img src="/assets/partners/sponsor_004.jpg" alt="" srcset="">
|
||||||
|
</div>
|
||||||
|
<div class="sponsor-logo">
|
||||||
|
<img src="/assets/partners/sponsor_005.jpg" alt="" srcset="">
|
||||||
|
</div>
|
||||||
|
<div class="sponsor-logo">
|
||||||
|
<img src="/assets/partners/sponsor_004.jpg" alt="" srcset="">
|
||||||
|
</div>
|
||||||
|
<!-- <div class="sponsor-logo">
|
||||||
|
<img src="/assets/partners/khou11.jpg" alt="" srcset="">
|
||||||
|
</div> -->
|
||||||
|
<!-- <div class="sponsor-logo">
|
||||||
|
<img src="/assets/partners/kendra_scott.png" alt="" srcset="">
|
||||||
|
</div> -->
|
||||||
|
<div class="sponsor-logo">
|
||||||
|
<img src="/assets/partners/jblack_logo.png" alt="" srcset="">
|
||||||
|
</div>
|
||||||
|
<div class="sponsor-logo">
|
||||||
|
<img src="/assets/partners/Outlook-aubybrlz.png" alt="" srcset="">
|
||||||
|
</div>
|
||||||
|
<div class="sponsor-logo">
|
||||||
|
<img src="/assets/partners/Walmart_word_logo.png" alt="" srcset="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Start of footer -->
|
||||||
|
<footer class="footer_body">
|
||||||
|
<div class="footer_row primary">
|
||||||
|
|
||||||
|
<div class="column-footer-3">
|
||||||
|
<div class="row d-flex justify-content-center">
|
||||||
|
<div class="col-12 d-flex justify-content-center">
|
||||||
|
<img class="footer_logo_img" src="../../../assets/logos/Stacked-Bug/White/c2c_stckd-bg_wht_RGB.png" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer_column subscribe">
|
||||||
|
<h3 class="footer_h3 footer-text-1">Newsletter</h3>
|
||||||
|
<div>
|
||||||
|
<form>
|
||||||
|
<input id="footer-sub-input" class="subscribe-email-input" type="email" placeholder="Enter email" />
|
||||||
|
<a href="#" id="start_new_subscriber_signup" class="btn footer-btn" data-bs-target="#modal_target_new_subscriber">Subscribe</a>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="footer_column footer_links">
|
||||||
|
<h3 class="footer_h3 footer_h3_2"></h3>
|
||||||
|
<ul class="footer_ul mb-5">
|
||||||
|
<li class="footer_li">
|
||||||
|
<img class="mobile-seal-img-footer" width="100px" height="75px" style="" src="/assets/other/seal.png" alt="">
|
||||||
|
</li>
|
||||||
|
<li class="footer_li">
|
||||||
|
<a href="#" id="footer-apply-link" class="footer-text-1 i-want-to-apply-footer">I want to Apply</a>
|
||||||
|
</li>
|
||||||
|
<li class="footer_li">
|
||||||
|
<a href="#" id="footer-volunteer-link" class="footer-text-1 volunteer-opportunities-footer">Volunteer Opportunities</a>
|
||||||
|
</li class="footer_li">
|
||||||
|
<li class="footer_li">
|
||||||
|
<a href="terms_of_service.html" id="footer-terms-link" class="footer-text-1">Terms Of Service</a>
|
||||||
|
</li class="footer_li">
|
||||||
|
<li class="footer_li">
|
||||||
|
<a href="privacy-policy.html" id="footer-policy-link" class="footer-text-1">Privacy Policy</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer_column footer_about">
|
||||||
|
<h3 class="footer_h3 footer-text-1">Cradle2Career</h3>
|
||||||
|
<p class="footer_address footer-text-1">24301 Brazos Town Crossing #500, </p>
|
||||||
|
<p class="footer_address footer-text-1">PMB #318</p>
|
||||||
|
<p class="footer_address footer-text-1">Rosenberg, TX 77471</p>
|
||||||
|
<p class="footer_address footer-text-1">Phone Number: 832-987-2076</p>
|
||||||
|
<div class="social">
|
||||||
|
<i class="fa-brands fa-facebook-square facebook-click"></i>
|
||||||
|
<i class="fa-brands fa-instagram-square instagram-click"></i>
|
||||||
|
<i class="fa-brands fa-twitter-square twitter-click"></i>
|
||||||
|
<!-- <i class="fa-brands fa-youtube-square"></i>
|
||||||
|
<i class="fa-brands fa-whatsapp-square"></i> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer_row copyright">
|
||||||
|
<!--
|
||||||
|
<div class="footer-menu">
|
||||||
|
|
||||||
|
<a href="">Home</a>
|
||||||
|
<a href="">About</a>
|
||||||
|
<a href="">Contact</a>
|
||||||
|
<a href="">Blog</a>
|
||||||
|
<a href="">Social</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
<p style="text-align: center;">Copyright © Cradle2Career is a 501(c)(3) non-profit organization. Our Federal Tax ID number is 83-3875479</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var mypage = "events";
|
||||||
|
</script>
|
||||||
|
<script data-main="/core/js/main" src="/portal/admin/core/api/js/libs/require.js"></script>
|
||||||
|
<body>
|
||||||
|
</html>
|
||||||
3017
portal/admin/playground/client/subscribers/default_schema.js
Normal file
3017
portal/admin/playground/client/subscribers/default_schema.js
Normal file
File diff suppressed because it is too large
Load Diff
276
portal/admin/playground/client/subscribers/index.php
Normal file
276
portal/admin/playground/client/subscribers/index.php
Normal file
@@ -0,0 +1,276 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>AFS Playground</title>
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico">
|
||||||
|
<!-- <link rel="stylesheet" href="https://unpkg.com/boxicons@2.0.7/css/boxicons.min.css"> -->
|
||||||
|
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"> -->
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css" integrity="sha512-2SwdPD6INVrV/lHTZbO2nodKhrnDdJK9/kg2XD1r9uGqPo1cUbujc+IYdlYdEErWNu69gVcYgdxlmVmzTWnetw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||||
|
<!-- <link rel="stylesheet" href="/core/styles/bootstrap-5.3.8-dist/css/bootstrap.min.css"> -->
|
||||||
|
<!-- <link rel="stylesheet" href="/portal/admin/core/api/styles/tabler/tabler.min.css" /> -->
|
||||||
|
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
|
||||||
|
<link rel="stylesheet" href="./styles.css">
|
||||||
|
|
||||||
|
<script src="https://code.jquery.com/jquery-3.6.3.min.js" integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script>
|
||||||
|
<script src="/portal/admin/core/api/js/appfactory/afsspinner.js"></script>
|
||||||
|
<script src="/portal/admin/core/api/js/libs/analytics_0.8.14.min.js"></script>
|
||||||
|
<script src="/portal/admin/core/api/js/libs/sameSize.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/portal/admin/core/libs/surveyjs/defaultV2.min.css">
|
||||||
|
<script src="https://unpkg.com/survey-core/survey.core.min.js" type="text/javascript"></script>
|
||||||
|
<script src="https://unpkg.com/survey-jquery/survey.jquery.min.js" type="text/javascript"></script>
|
||||||
|
<script src="https://unpkg.com/survey-core/themes/layered-dark-panelless.min.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js"></script>
|
||||||
|
|
||||||
|
<script src="/portal/admin/core/api/js/libs/fetch-jsonp.js"></script>
|
||||||
|
<script src="/portal/admin/core/api/js/appfactory/appfactory3.js"></script>
|
||||||
|
<script src="/portal/admin/core/api/js/appfactory/afsform.js"></script>
|
||||||
|
<script src="/portal/admin/core/api/js/appfactory/afsextras.js"></script>
|
||||||
|
<script src="/portal/admin/core/api/js/appfactory/afssubscriber.js"></script>
|
||||||
|
<script src="./default_schema.js"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="https://api.appfactory.studio/sdk/js/afssdk.js"></script>
|
||||||
|
<script src="https://api.appfactory.studio/sdk/js/afssdk-internal.js"></script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- Navigation -->
|
||||||
|
<section class="navigation">
|
||||||
|
<div class="nav-container">
|
||||||
|
<div class="brand">
|
||||||
|
<img id="brand_image_logo_btn" class="brand_logo" src="" alt="" width="145">
|
||||||
|
</div>
|
||||||
|
<div class="mobile-donate-btn">
|
||||||
|
<button class="nav-donate-btn button-34" data-bs-toggle="modal" data-bs-target="#modal_donation_dialog" role="button">
|
||||||
|
<i style="font-size: 1.75rem;" class="fas fa-hand-holding-heart fa-1x"></i>
|
||||||
|
</button>
|
||||||
|
<div class="clear-right"></div>
|
||||||
|
</div>
|
||||||
|
<nav class="mymainnav">
|
||||||
|
<div class="nav-mobile"><a id="nav-toggle" class="nav-toggle" href="#"><span></span></a></div>
|
||||||
|
<ul class="nav-list" style="">
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#!" class="main_nav_link mnl_about">About Us</span></a>
|
||||||
|
<ul class="nav-dropdown">
|
||||||
|
<li><a class="mainnav_list_item main-nav-anchor" href="/pages/whatwedo">What We Do</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/ourstory">Our Story</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/meettheboard">Meet The Board</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/financials">Financials</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#!" class="main_nav_link mnl_young">I'm a Young Parent</a>
|
||||||
|
<ul class="nav-dropdown">
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/apply">I Need Support</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/scholarships">Scholarships</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/resources">Resources</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#!" class="main_nav_link mnl_you">Give Forward</a>
|
||||||
|
<ul class="nav-dropdown">
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/waystodonate">Donate</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/volunteer">Volunteer</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/sponsorships">Sponsorships</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/partnerships">Partnerships </a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="/pages/initiatives" id="initiatives_header_link" class="main_nav_link mnl_ini">Initiatives</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#!" class="main_nav_link mnl_news">News & Events</a>
|
||||||
|
<ul class="nav-dropdown">
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/events">Events</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/gallery">Gallery</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/news">News</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#!" class="main_nav_link mnl_contact">Contact</a>
|
||||||
|
<ul class="nav-dropdown">
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/media_inquires">Media Inquiries</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/need_a_speaker">Need A Speaker</a></li>
|
||||||
|
<li><a class="mainnav_list_item" href="/pages/contact">Contact Us </a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button style="background-color: #00B052;color: white;" class="nav-donate-btn button-33" id="main_modal_donation" role="button">
|
||||||
|
<img src=""
|
||||||
|
width="30"
|
||||||
|
/>Donate</button>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- form container -->
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-lg-12 d-flex justify-content-center">
|
||||||
|
<h2 class="quirk-font" style="color: var(--style-blue);">BECOME A BOARD MEMBER</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row d-flex justify-content-center">
|
||||||
|
<div class="col-12 col-lg-8">
|
||||||
|
<div id="surveyContainer" class="border border-success"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Start of footer -->
|
||||||
|
<footer class="footer_body">
|
||||||
|
<div class="footer_row primary">
|
||||||
|
|
||||||
|
<div class="column-footer-3">
|
||||||
|
<div class="row d-flex justify-content-center">
|
||||||
|
<div class="col-12 d-flex justify-content-center">
|
||||||
|
<img class="footer_logo_img" src="" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer_column subscribe">
|
||||||
|
<h3 class="footer_h3 footer-text-1">Newsletter</h3>
|
||||||
|
<div>
|
||||||
|
<form>
|
||||||
|
<input id="footer-sub-input" class="subscribe-email-input" type="email" placeholder="Enter email" />
|
||||||
|
<a href="#" id="start_new_subscriber_signup" class="btn footer-btn" data-bs-target="#modal_target_new_subscriber">Subscribe</a>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="footer_column footer_links">
|
||||||
|
<h3 class="footer_h3 footer_h3_2"></h3>
|
||||||
|
<ul class="footer_ul mb-5">
|
||||||
|
<li class="footer_li">
|
||||||
|
<img class="" width="100px" height="75px" style="" src="" alt="">
|
||||||
|
</li>
|
||||||
|
<li class="footer_li">
|
||||||
|
<a href="#" id="footer-apply-link" class="footer-text-1 i-want-to-apply-footer">I want to Apply</a>
|
||||||
|
</li>
|
||||||
|
<li class="footer_li">
|
||||||
|
<a href="#" id="footer-volunteer-link" class="footer-text-1 volunteer-opportunities-footer">Volunteer Opportunities</a>
|
||||||
|
</li class="footer_li">
|
||||||
|
<li class="footer_li">
|
||||||
|
<a href="terms_of_service.html" id="footer-terms-link" class="footer-text-1">Terms Of Service</a>
|
||||||
|
</li class="footer_li">
|
||||||
|
<li class="footer_li">
|
||||||
|
<a href="privacy-policy.html" id="footer-policy-link" class="footer-text-1">Privacy Policy</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer_column footer_about">
|
||||||
|
<h3 class="footer_h3 footer-text-1">Cradle2Career</h3>
|
||||||
|
<p class="footer_address footer-text-1">24301 Brazos Town Crossing #500, </p>
|
||||||
|
<p class="footer_address footer-text-1">PMB #318</p>
|
||||||
|
<p class="footer_address footer-text-1">Rosenberg, TX 77471</p>
|
||||||
|
<p class="footer_address footer-text-1">Phone Number: 832-987-2076</p>
|
||||||
|
<div class="social">
|
||||||
|
<i class="fa-brands fa-facebook-square facebook-click"></i>
|
||||||
|
<i class="fa-brands fa-instagram-square instagram-click"></i>
|
||||||
|
<i class="fa-brands fa-twitter-square twitter-click"></i>
|
||||||
|
<!-- <i class="fa-brands fa-youtube-square"></i>
|
||||||
|
<i class="fa-brands fa-whatsapp-square"></i> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer_row copyright">
|
||||||
|
<!--
|
||||||
|
<div class="footer-menu">
|
||||||
|
|
||||||
|
<a href="">Home</a>
|
||||||
|
<a href="">About</a>
|
||||||
|
<a href="">Contact</a>
|
||||||
|
<a href="">Blog</a>
|
||||||
|
<a href="">Social</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
<p style="text-align: center;">Copyright © Cradle2Career is a 501(c)(3) non-profit organization. Our Federal Tax ID number is 83-3875479</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var mypage = "events";
|
||||||
|
</script>
|
||||||
|
<script src="./script.js"></script>
|
||||||
|
<body>
|
||||||
|
</html>
|
||||||
149
portal/admin/playground/client/subscribers/index_include.php
Normal file
149
portal/admin/playground/client/subscribers/index_include.php
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-lg-12 d-flex justify-content-center">
|
||||||
|
<h2 class="quirk-font" style="color: var(--style-blue);">BECOME A BOARD MEMBER</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row d-flex justify-content-center">
|
||||||
|
<div class="col-12 col-lg-8">
|
||||||
|
<div id="surveyContainer" class="border border-success"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="spacer"></div>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// setTimeout(function(){
|
||||||
|
// $('.img-auto-sizer').fitImage({
|
||||||
|
// resizeDelayTime: '1',
|
||||||
|
// horizontalAlign: 'center'
|
||||||
|
// });
|
||||||
|
// },1000);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Start of footer -->
|
||||||
|
<footer class="footer_body">
|
||||||
|
<div class="footer_row primary">
|
||||||
|
|
||||||
|
<div class="column-footer-3">
|
||||||
|
<div class="row d-flex justify-content-center">
|
||||||
|
<div class="col-12 d-flex justify-content-center">
|
||||||
|
<img class="footer_logo_img" src="../../../assets/logos/Stacked-Bug/White/c2c_stckd-bg_wht_RGB.png" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer_column subscribe">
|
||||||
|
<h3 class="footer_h3 footer-text-1">Newsletter</h3>
|
||||||
|
<div>
|
||||||
|
<form>
|
||||||
|
<input id="footer-sub-input" class="subscribe-email-input" type="email" placeholder="Enter email" />
|
||||||
|
<a href="#" id="start_new_subscriber_signup" class="btn footer-btn" data-bs-target="#modal_target_new_subscriber">Subscribe</a>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="footer_column footer_links">
|
||||||
|
<h3 class="footer_h3 footer_h3_2"></h3>
|
||||||
|
<ul class="footer_ul mb-5">
|
||||||
|
<li class="footer_li">
|
||||||
|
<img class="mobile-seal-img-footer" width="100px" height="75px" style="" src="/assets/other/seal.png" alt="">
|
||||||
|
</li>
|
||||||
|
<li class="footer_li">
|
||||||
|
<a href="#" id="footer-apply-link" class="footer-text-1 i-want-to-apply-footer">I want to Apply</a>
|
||||||
|
</li>
|
||||||
|
<li class="footer_li">
|
||||||
|
<a href="#" id="footer-volunteer-link" class="footer-text-1 volunteer-opportunities-footer">Volunteer Opportunities</a>
|
||||||
|
</li class="footer_li">
|
||||||
|
<li class="footer_li">
|
||||||
|
<a href="terms_of_service.html" id="footer-terms-link" class="footer-text-1">Terms Of Service</a>
|
||||||
|
</li class="footer_li">
|
||||||
|
<li class="footer_li">
|
||||||
|
<a href="privacy-policy.html" id="footer-policy-link" class="footer-text-1">Privacy Policy</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer_column footer_about">
|
||||||
|
<h3 class="footer_h3 footer-text-1">Cradle2Career</h3>
|
||||||
|
<p class="footer_address footer-text-1">24301 Brazos Town Crossing #500, </p>
|
||||||
|
<p class="footer_address footer-text-1">PMB #318</p>
|
||||||
|
<p class="footer_address footer-text-1">Rosenberg, TX 77471</p>
|
||||||
|
<p class="footer_address footer-text-1">Phone Number: 832-987-2076</p>
|
||||||
|
<div class="social">
|
||||||
|
<i class="fa-brands fa-facebook-square facebook-click"></i>
|
||||||
|
<i class="fa-brands fa-instagram-square instagram-click"></i>
|
||||||
|
<i class="fa-brands fa-twitter-square twitter-click"></i>
|
||||||
|
<!-- <i class="fa-brands fa-youtube-square"></i>
|
||||||
|
<i class="fa-brands fa-whatsapp-square"></i> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer_row copyright">
|
||||||
|
<!--
|
||||||
|
<div class="footer-menu">
|
||||||
|
|
||||||
|
<a href="">Home</a>
|
||||||
|
<a href="">About</a>
|
||||||
|
<a href="">Contact</a>
|
||||||
|
<a href="">Blog</a>
|
||||||
|
<a href="">Social</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
<p style="text-align: center;">Copyright © Cradle2Career is a 501(c)(3) non-profit organization. Our Federal Tax ID number is 83-3875479</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
788
portal/admin/playground/client/subscribers/script.js
Normal file
788
portal/admin/playground/client/subscribers/script.js
Normal file
@@ -0,0 +1,788 @@
|
|||||||
|
(function(){
|
||||||
|
|
||||||
|
function init(app){
|
||||||
|
AFSSdk.InitializeClientSDK('afsdev_XqyZekkvjEj8diB1oaAMn9SC',function(api_config){
|
||||||
|
|
||||||
|
// form
|
||||||
|
// AFSSdk.GetMailHandler('v9685-5735-1682-1043',function(mail_handler){
|
||||||
|
// console.log(mail_handler);
|
||||||
|
// initForm(api_config,mail_handler,app);
|
||||||
|
// });
|
||||||
|
|
||||||
|
// subscriber
|
||||||
|
initSubscriber(api_config,app);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function initForm(api_config,mail_handler,app){
|
||||||
|
app.extra.myform = new AFSSurveyJSForm.AFSSurveyJSForm(app);
|
||||||
|
app.extra.myform.intializeForm("#surveyContainer","form808965595437",api_config,mail_handler,
|
||||||
|
function(){
|
||||||
|
AFSSpinner.showFullScreen(true);
|
||||||
|
setTimeout(() => { window.scrollTo(0, 0); AFSSpinner.showFullScreen(false); },2000);
|
||||||
|
},
|
||||||
|
function(survey){
|
||||||
|
// send notification
|
||||||
|
// analytics
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function initSubscriber(api_config,app){
|
||||||
|
app.extra.afssubscriber = new AFSSdk.AFSSubscriber();
|
||||||
|
app.extra.afssubscriber.requestCatalogs(function(catalogs){
|
||||||
|
AFSSdk.GetMailHandler('v1707-6481-8182-7066',function(mail_handler){
|
||||||
|
console.log(api_config);
|
||||||
|
console.log(catalogs);
|
||||||
|
console.log(mail_handler);
|
||||||
|
|
||||||
|
SetupEventListeners(app);
|
||||||
|
$('body').append(func_subscribeModal2(app));
|
||||||
|
$('body').append(func_subscribeModal3(app));
|
||||||
|
|
||||||
|
const myModal1 = new bootstrap.Modal('#modal_target_new_subscriber', {});
|
||||||
|
const myModal2 = new bootstrap.Modal('#modal_target_subscriber_thank_you', {});
|
||||||
|
|
||||||
|
$("#start_new_subscriber_signup").on("click",function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
let emailValue = $("#footer-sub-input").val();
|
||||||
|
if(emailValue==""){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
myModal1.show();
|
||||||
|
$("#title_modal_new_subscriber_section").text(" ( " +emailValue + " )");
|
||||||
|
subscribeMe(app,mail_handler,emailValue,myModal1,myModal2);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function subscribeMe(app,mail_handler,emailValue,myModal1,myModal2){
|
||||||
|
|
||||||
|
function append_subscriptions(app){
|
||||||
|
let count = 0;
|
||||||
|
let ids = [];
|
||||||
|
let html = "";
|
||||||
|
// let catalogs = app.extra.subscriber.getCatalogs();
|
||||||
|
let catalogs = app.extra.afssubscriber.getCatalogs();
|
||||||
|
|
||||||
|
// console.log(catalogs);
|
||||||
|
for (let i = 0; i < catalogs.length; i++) {
|
||||||
|
const catalog = catalogs[i];
|
||||||
|
if(catalog.json==undefined || catalog.json==null) continue;
|
||||||
|
if(catalog.json.release_type==false) continue;
|
||||||
|
console.log(catalog);
|
||||||
|
let inputhtml = func_subscriberInput(app);
|
||||||
|
let id = "m"+app.utils.randomGenerator(12);
|
||||||
|
let variables = [
|
||||||
|
{"name":"reference_num", "value":catalog.reference_num},
|
||||||
|
{"name":"input_classes", "value":"modal-subscribe-input modal-subscribe-custom1"},
|
||||||
|
{"name":"title_classes", "value":"modal-subscribe-h5"},
|
||||||
|
{"name":"short_classes", "value":"modal-subscribe-p"},
|
||||||
|
{"name":"input_id", "value":id},
|
||||||
|
{"name":"title", "value":catalog.title},
|
||||||
|
{"name":"desc", "value":catalog.json.short_description}
|
||||||
|
];
|
||||||
|
html += app.utils.variablesReplace(inputhtml, variables);
|
||||||
|
ids.push({id:id, obj:catalog, index: i});
|
||||||
|
if(count==3){
|
||||||
|
count = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#row_one").empty();
|
||||||
|
$("#row_one").append(html);
|
||||||
|
return ids;
|
||||||
|
}
|
||||||
|
|
||||||
|
let ids = append_subscriptions(app);
|
||||||
|
$("#submit_new_subscriber").on("click",function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
myModal1.hide();
|
||||||
|
myModal2.show();
|
||||||
|
|
||||||
|
let newsub = app.extra.afssubscriber.initializeSubscriber(emailValue,"","");
|
||||||
|
for (let i = 0; i < ids.length; i++) {
|
||||||
|
console.log(ids[i]);
|
||||||
|
const isChecked1 = $("#"+ids[i].id).is(":checked");
|
||||||
|
if(isChecked1==true){
|
||||||
|
let catalog = ids[i].obj;
|
||||||
|
newsub.addCatalog(catalog);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(newsub);
|
||||||
|
app.extra.afssubscriber.createSubscriber(newsub,mail_handler,function(resp){
|
||||||
|
$("#footer-sub-input").val("");
|
||||||
|
// send notification
|
||||||
|
// app.extra.notifications.sendNotification(
|
||||||
|
// "subscriber",
|
||||||
|
// `New ${catalog.display_name} Subscriber`,
|
||||||
|
// `New email ${emailValue} has subscribed to ${catalog.display_name} catalog`,
|
||||||
|
// {
|
||||||
|
// "catalog_reference_num": catalog.reference_num,
|
||||||
|
// "mypage": mypage
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
|
||||||
|
// app.extra.analytics.track('new_subscriber', {
|
||||||
|
// date: moment().format('LLL'),
|
||||||
|
// page_name: mypage,
|
||||||
|
// subscriber: newsub.email
|
||||||
|
// });
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// app.extra.subscriber.updateSubscriberConfiguration(newsub, function(catalog,resp){ });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function SetupEventListeners(app){
|
||||||
|
|
||||||
|
$("#footer-sub-button").on(function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
var email = $('#footer-sub-input').val();
|
||||||
|
if(email==""){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ModalHandler({
|
||||||
|
headerClass: "",
|
||||||
|
title: "",
|
||||||
|
content: `
|
||||||
|
<div class="email-container">
|
||||||
|
<div class="email-body">
|
||||||
|
<div class="banner">
|
||||||
|
<h2>Subscription Successful!</h2>
|
||||||
|
<!-- <h1>We Feel <span>the Love</span></h1> -->
|
||||||
|
</div>
|
||||||
|
<div class="email-content">
|
||||||
|
<p>Hi there!</p>
|
||||||
|
<p>Thank you for subscribing. We're so excited to share the latest news and updates with you. If you'd like to learn more, follow us on social media!</p>
|
||||||
|
<a class="facebook-click" href="#"><i class="fab fa-facebook-square"></i> Check us out on Facebook</a><br>
|
||||||
|
<a class="twitter-click" href="#"><i class="fab fa-twitter-square"></i> Follow Us on Twitter</a>
|
||||||
|
<hr>
|
||||||
|
<p>Sincerely,</p>
|
||||||
|
<p class="sig">Us at Cradle 2 Career</p>
|
||||||
|
<!-- <p><em>Melissa A.</em>
|
||||||
|
<br>Customer Success Manager
|
||||||
|
</p> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
callback: function(){
|
||||||
|
$.post('core/php/request.php',{subscribe:true,email:email},function(resp1){
|
||||||
|
$("#footer-sub-input").val("");
|
||||||
|
$.post('../../portal/admin/core/request.php',{send_subscribed_confirmation_email:true,email:email},function(resp2){
|
||||||
|
console.log(resp2);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('.click-here-to-subscribe-button').click(function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
ModalHandler({
|
||||||
|
headerClass: "",
|
||||||
|
title: "",
|
||||||
|
content: ``,
|
||||||
|
callback: function(body){
|
||||||
|
// if(newNode == null){
|
||||||
|
// newNode = document.getElementById('buysomegum').cloneNode(true);
|
||||||
|
// $('#buysomegum').empty();
|
||||||
|
// }
|
||||||
|
// var old_element = newNode;
|
||||||
|
// var new_element = old_element.cloneNode(true);
|
||||||
|
// old_element.parentNode.replaceChild(new_element, old_element);
|
||||||
|
// body.appendChild(old_element);
|
||||||
|
// newNode = old_element;
|
||||||
|
// newNode.style.display = 'block';
|
||||||
|
|
||||||
|
var node = app.utils.convertStringToHTMLNode(gl_SusbribeModal());
|
||||||
|
body.appendChild(node);
|
||||||
|
|
||||||
|
$('.modal-subscribe-news__btn').click(function(e){
|
||||||
|
// modal-subscribe-check5 = sponsorship
|
||||||
|
// modal-subscribe-check4 = initiatives
|
||||||
|
// modal-subscribe-check2 = events
|
||||||
|
// modal-subscribe-check1 = news
|
||||||
|
var email = $('#modal-subscribe-input-id').val();
|
||||||
|
var news = document.getElementById('modal-subscribe-check1').checked;
|
||||||
|
var events = document.getElementById('modal-subscribe-check2').checked;
|
||||||
|
var initiatives = document.getElementById('modal-subscribe-check4').checked;
|
||||||
|
var sponsorship = document.getElementById('modal-subscribe-check5').checked;
|
||||||
|
|
||||||
|
if(email==""){
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!news && !events && !initiatives && !sponsorship){
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ModalHandler({
|
||||||
|
headerClass:"",
|
||||||
|
title: "",
|
||||||
|
content: `
|
||||||
|
<h4 style="margin-bottom:75px;">Thank for your interest, you should be receiving a follow up email.</h4>
|
||||||
|
`,
|
||||||
|
callback: function(body2){
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var data = {
|
||||||
|
'single_subscribe': true,
|
||||||
|
'email': email,
|
||||||
|
'news': news,
|
||||||
|
'event': events,
|
||||||
|
'initiatives': initiatives,
|
||||||
|
'sponsorship': sponsorship,
|
||||||
|
'assigned_from': mypage
|
||||||
|
};
|
||||||
|
|
||||||
|
// TODO: send follow up email
|
||||||
|
post(URL_OWN_REQUEST, data, function(resp1){
|
||||||
|
console.log(resp1);
|
||||||
|
$('#modal-subscribe-input-id').val("");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
// $('#click-me-now').click(function(e){
|
||||||
|
// //$("#modal-subscribe-check1").prop('checked', false);
|
||||||
|
// });
|
||||||
|
$('#click-me-now').click(function(e){
|
||||||
|
// console.log(1)
|
||||||
|
|
||||||
|
|
||||||
|
// var a = app.utils.convertStringToHTMLNode(`<input class="modal-subscribe-input modal-subscribe-custom" type="checkbox" id="modal-subscribe-check1" checked>`);
|
||||||
|
// console.log(a.firstElementChild);
|
||||||
|
// $("#help-me").empty();
|
||||||
|
// document.getElementById("help-me").appendChild(a.firstElementChild);
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// $('#footer-apply-link').on('click',function(e){e.preventDefault();});
|
||||||
|
// $('#footer-volunteer-link').on('click',function(e){e.preventDefault(); });
|
||||||
|
|
||||||
|
$('#footer-terms-link').on('click',function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
let w = app.extra.config['managed_domain']['Address'] + '/terms_of_service.html';
|
||||||
|
console.log(w);
|
||||||
|
window.location.href = w;
|
||||||
|
});
|
||||||
|
$('#footer-policy-link').on('click',function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
window.location.href = app.extra.config['managed_domain']['Address'] + '/privacy-policy.html';
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.i-want-to-apply-footer').on('click',function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
//window.open("https://www15.cradle2careertx.xyz/pages/apply/");
|
||||||
|
window.location.href = app.extra.config['managed_domain']['Address'] + '/pages/apply/';
|
||||||
|
});
|
||||||
|
$('.volunteer-opportunities-footer').on('click',function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
//window.open("https://www15.cradle2careertx.xyz/pages/volunteer/");
|
||||||
|
window.location.href = app.extra.config['managed_domain']['Address'] + '/pages/volunteer/';
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('.facebook-click').on('click',function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
window.open(app.extra.config['configurations']['domain_settings'][1]['json']['social_media_links']['facebook'], '_blank');
|
||||||
|
});
|
||||||
|
$('.instagram-click').on('click',function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
window.open(app.extra.config['configurations']['domain_settings'][1]['json']['social_media_links']['instagram'], '_blank');
|
||||||
|
});
|
||||||
|
$('.twitter-click').on('click',function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
window.open(app.extra.config['configurations']['domain_settings'][1]['json']['social_media_links']['twitter'], '_blank');
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const URL = "/core/php/request.php";
|
||||||
|
let promises = [
|
||||||
|
// retrieve_data_for_update
|
||||||
|
new Promise((resolve,reject) => {
|
||||||
|
$.post(URL, {
|
||||||
|
retrieve_data_for_update: true
|
||||||
|
}, function(obj){
|
||||||
|
obj = JSON.parse(obj);
|
||||||
|
resolve(obj);
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
Promise.all(promises).then((m) =>{
|
||||||
|
console.log(m);
|
||||||
|
|
||||||
|
let app = new ApplicationContextManager();
|
||||||
|
app.extra.config = {};
|
||||||
|
app.extra.current = {};
|
||||||
|
app.extra.views = {};
|
||||||
|
app.extra.config.configurations = AFS_SCHEMA_DESCRIPTION_INTEGRATION(m[0].configurations);
|
||||||
|
app.extra.url = "./request.php";
|
||||||
|
|
||||||
|
console.log(app.extra.config.configurations)
|
||||||
|
init(app);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function func_subscribeModal2(app){
|
||||||
|
return `
|
||||||
|
|
||||||
|
<div class="modal modal-blur fade" id="modal_target_new_subscriber" tabindex="-1" style="display: none; padding-left: 0px;" aria-modal="true" role="dialog">
|
||||||
|
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||||||
|
<div style="min-height:400px;" class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 id="footer_modal_title" class="modal-title">Subscribe to Cradle2Career <span id="title_modal_new_subscriber_section"></span></h5>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<div id="footer_modal_body" class="modal-body">
|
||||||
|
|
||||||
|
<div class="container-fluid" style="">
|
||||||
|
<div class="row">
|
||||||
|
<div class="row" id="row_one"></div>
|
||||||
|
<div class="row" id="row_two"></div>
|
||||||
|
</div>
|
||||||
|
</div><!-- end container-fluid -->
|
||||||
|
|
||||||
|
|
||||||
|
</div><!-- end modal-body -->
|
||||||
|
|
||||||
|
<div id="footer_modal_footer" class="modal-footer">
|
||||||
|
<button type="button" class="btn me-auto" data-bs-dismiss="modal">Cancel</button>
|
||||||
|
<button id="submit_new_subscriber" type="button" class="btn btn-primary mycolorbtn">Submit</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
function func_subscribeModal3(app){
|
||||||
|
return `
|
||||||
|
|
||||||
|
<div class="modal modal-blur fade" id="modal_target_subscriber_thank_you" tabindex="-1" style="display: none; padding-left: 0px;" aria-modal="true" role="dialog">
|
||||||
|
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<!-- <h5 class="modal-title">Modal title</h5> -->
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<div class="email-container">
|
||||||
|
<div class="email-body">
|
||||||
|
<div class="banner">
|
||||||
|
<h2>Subscription Successful!</h2>
|
||||||
|
<!-- <h1>We Feel <span>the Love</span></h1> -->
|
||||||
|
</div>
|
||||||
|
<div class="email-content">
|
||||||
|
<p>Hi there!</p>
|
||||||
|
<p>Thank you for subscribing. We're so excited to share the latest news and updates with you. If you'd like to learn more, follow us on social media!</p>
|
||||||
|
<a class="facebook-click" href="#"><i class="fab fa-facebook-square"></i> Check us out on Facebook</a><br>
|
||||||
|
<a class="twitter-click" href="#"><i class="fab fa-twitter-square"></i> Follow Us on Twitter</a>
|
||||||
|
<hr>
|
||||||
|
<p>Sincerely,</p>
|
||||||
|
<p class="sig">Us at Cradle2Career</p>
|
||||||
|
<!-- <p><em>Melissa A.</em>
|
||||||
|
<br>Customer Success Manager
|
||||||
|
</p> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn me-auto" data-bs-dismiss="modal">Close</button>
|
||||||
|
<!-- <button type="button" class="btn btn-primary" data-bs-dismiss="modal">Save changes</button> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
function func_subscriberInput(app){
|
||||||
|
return `
|
||||||
|
<div class="col-12 col-lg-4">
|
||||||
|
<div class="row" style="height: 115px;width: 100%;">
|
||||||
|
<div class="col-2">
|
||||||
|
<!-- checkbox -->
|
||||||
|
<input id="\${input_id}" data-reference_num="\${reference_num}" class="\${input_classes}" type="checkbox" checked/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-10">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<!-- header -->
|
||||||
|
<h3 class="\${title_classes}">\${title}</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<!-- description -->
|
||||||
|
<p class="\${desc_classes}">\${desc}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Board members
|
||||||
|
function CreateFormData2(app){
|
||||||
|
return {
|
||||||
|
"elements": [{
|
||||||
|
name: "fullname",
|
||||||
|
title: "What is your first and last name?",
|
||||||
|
type: "text",
|
||||||
|
isRequired: true
|
||||||
|
},{
|
||||||
|
name: "email",
|
||||||
|
title: "What is your email address?",
|
||||||
|
type: "text",
|
||||||
|
isRequired: true
|
||||||
|
},{
|
||||||
|
name: "phonenumber",
|
||||||
|
title: "What is your phone number?",
|
||||||
|
type: "text",
|
||||||
|
isRequired: true
|
||||||
|
},{
|
||||||
|
name: "brief_description",
|
||||||
|
title: "Briefly describe why you would like to join our Board of Directors:",
|
||||||
|
type: "text"
|
||||||
|
},{
|
||||||
|
"type": "multipletext",
|
||||||
|
"name": "current_aff",
|
||||||
|
"title": "Your current organizational affiliations (names of the organization and your role(s), please include any current boards you serve on):",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"name": "1",
|
||||||
|
"inputType": "string",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "2",
|
||||||
|
"inputType": "string",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "3",
|
||||||
|
"inputType": "string",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "4",
|
||||||
|
"inputType": "string",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "5",
|
||||||
|
"inputType": "string",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},{
|
||||||
|
"type": "checkbox",
|
||||||
|
"name": "skills",
|
||||||
|
"title": "Which of your skills would you like to utilize on the Board? Check those that apply:",
|
||||||
|
"description": "",
|
||||||
|
"choices": [ "Board development", "Strategic planning", "Staffing / HR", "Program development", "Financial management", "Fundraising", "Evaluation","Community networking", "Training", "Marketing", "Volunteer management", "Facilities management"],
|
||||||
|
"isRequired": true,
|
||||||
|
"colCount": 2,
|
||||||
|
"showNoneItem": true,
|
||||||
|
"showOtherItem": true,
|
||||||
|
"showSelectAllItem": true,
|
||||||
|
"separateSpecialChoices": true
|
||||||
|
},{
|
||||||
|
name: "other_skills",
|
||||||
|
title: "Other skill(s) of yours that you would like to utilize",
|
||||||
|
type: "text"
|
||||||
|
},{
|
||||||
|
name: "other_types",
|
||||||
|
title: "What would you like to get for yourself out of your participation on the Board, e.g., what types of experiences, skills to develop, interests to cultivate for you, etc.?",
|
||||||
|
type: "text"
|
||||||
|
},{
|
||||||
|
"type": "boolean",
|
||||||
|
"name": "if_join",
|
||||||
|
"label": "If you join the Board, you agree that you can provide at least 2-4 hours a month in attendance to Board and Committee meetings, and that you do not have any conflict-of-interest in participating on the Board.",
|
||||||
|
// "titleLocation": "hidden",
|
||||||
|
"valueTrue": "Yes",
|
||||||
|
"valueFalse": "No",
|
||||||
|
"renderAs": "radio"
|
||||||
|
},{
|
||||||
|
"type": "boolean",
|
||||||
|
"name": "if_not_selected",
|
||||||
|
"label": "If you are not selected as a member of the Board, or if you decide not to join, would you like to be a volunteer to assist our organization in various ways that match your skills and interests?",
|
||||||
|
// "titleLocation": "hidden",
|
||||||
|
"valueTrue": "Yes",
|
||||||
|
"valueFalse": "No",
|
||||||
|
"renderAs": "radio"
|
||||||
|
},{
|
||||||
|
"type": "file",
|
||||||
|
"title": "Please upload your files",
|
||||||
|
"name": "files",
|
||||||
|
"storeDataAsText": false,
|
||||||
|
"waitForUpload": true,
|
||||||
|
"allowMultiple": true,
|
||||||
|
"maxSize": 102400,
|
||||||
|
"hideNumber": true
|
||||||
|
},{
|
||||||
|
"type": "signaturepad",
|
||||||
|
"name": "signature",
|
||||||
|
"title": "Please sign here",
|
||||||
|
"isRequired": true,
|
||||||
|
"signatureWidth": 600
|
||||||
|
},{
|
||||||
|
"type": "boolean",
|
||||||
|
"name": "agreement",
|
||||||
|
"title": "I consent to be sent communications regarding my Board application",
|
||||||
|
"defaultValue": "false",
|
||||||
|
"renderAs": "checkbox",
|
||||||
|
"validators": [
|
||||||
|
{
|
||||||
|
"type": "expression",
|
||||||
|
"text": "Please confirm consent",
|
||||||
|
"expression": "{agreement} = true"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"titleLocation": "left",
|
||||||
|
"label": "",
|
||||||
|
"showTitle": true
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function CreateFormStyle(){
|
||||||
|
return {
|
||||||
|
"backgroundImage": "",
|
||||||
|
"backgroundImageFit": "cover",
|
||||||
|
"backgroundImageAttachment": "scroll",
|
||||||
|
"backgroundOpacity": 1,
|
||||||
|
"themeName": "default",
|
||||||
|
"isPanelless": true,
|
||||||
|
"colorPalette": "light",
|
||||||
|
"cssVariables": {
|
||||||
|
"--sjs-general-backcolor": "rgba(255, 255, 255, 1)",
|
||||||
|
"--sjs-general-backcolor-dark": "rgba(248, 248, 248, 1)",
|
||||||
|
"--sjs-general-backcolor-dim": "rgba(255, 255, 255, 1)",
|
||||||
|
"--sjs-general-backcolor-dim-light": "rgba(249, 249, 249, 1)",
|
||||||
|
"--sjs-general-backcolor-dim-dark": "rgba(243, 243, 243, 1)",
|
||||||
|
"--sjs-general-forecolor": "rgba(0, 0, 0, 0.91)",
|
||||||
|
"--sjs-general-forecolor-light": "rgba(0, 0, 0, 0.45)",
|
||||||
|
"--sjs-general-dim-forecolor": "rgba(0, 0, 0, 0.91)",
|
||||||
|
"--sjs-general-dim-forecolor-light": "rgba(0, 0, 0, 0.45)",
|
||||||
|
"--sjs-primary-backcolor": "rgba(0, 176, 82, 1)",
|
||||||
|
"--sjs-primary-backcolor-light": "rgba(0, 176, 82, 0.1)",
|
||||||
|
"--sjs-primary-backcolor-dark": "rgba(0, 161, 75, 1)",
|
||||||
|
"--sjs-primary-forecolor": "rgba(255, 255, 255, 1)",
|
||||||
|
"--sjs-primary-forecolor-light": "rgba(255, 255, 255, 0.25)",
|
||||||
|
"--sjs-base-unit": "8px",
|
||||||
|
"--sjs-corner-radius": "4px",
|
||||||
|
"--sjs-secondary-backcolor": "rgba(255, 152, 20, 1)",
|
||||||
|
"--sjs-secondary-backcolor-light": "rgba(255, 152, 20, 0.1)",
|
||||||
|
"--sjs-secondary-backcolor-semi-light": "rgba(255, 152, 20, 0.25)",
|
||||||
|
"--sjs-secondary-forecolor": "rgba(255, 255, 255, 1)",
|
||||||
|
"--sjs-secondary-forecolor-light": "rgba(255, 255, 255, 0.25)",
|
||||||
|
"--sjs-shadow-small": "0px 1px 2px 0px rgba(0, 0, 0, 0.15)",
|
||||||
|
"--sjs-shadow-small-reset": "0px 0px 0px 0px rgba(0, 0, 0, 0.15)",
|
||||||
|
"--sjs-shadow-medium": "0px 2px 6px 0px rgba(0, 0, 0, 0.1)",
|
||||||
|
"--sjs-shadow-large": "0px 8px 16px 0px rgba(0, 0, 0, 0.1)",
|
||||||
|
"--sjs-shadow-inner": "inset 0px 1px 2px 0px rgba(0, 0, 0, 0.15)",
|
||||||
|
"--sjs-shadow-inner-reset": "inset 0px 0px 0px 0px rgba(0, 0, 0, 0.15)",
|
||||||
|
"--sjs-border-light": "rgba(0, 0, 0, 0.09)",
|
||||||
|
"--sjs-border-default": "rgba(0, 0, 0, 0.16)",
|
||||||
|
"--sjs-border-inside": "rgba(0, 0, 0, 0.16)",
|
||||||
|
"--sjs-special-red": "rgba(229, 10, 62, 1)",
|
||||||
|
"--sjs-special-red-light": "rgba(229, 10, 62, 0.1)",
|
||||||
|
"--sjs-special-red-forecolor": "rgba(255, 255, 255, 1)",
|
||||||
|
"--sjs-special-green": "rgba(25, 179, 148, 1)",
|
||||||
|
"--sjs-special-green-light": "rgba(25, 179, 148, 0.1)",
|
||||||
|
"--sjs-special-green-forecolor": "rgba(255, 255, 255, 1)",
|
||||||
|
"--sjs-special-blue": "rgba(67, 127, 217, 1)",
|
||||||
|
"--sjs-special-blue-light": "rgba(67, 127, 217, 0.1)",
|
||||||
|
"--sjs-special-blue-forecolor": "rgba(255, 255, 255, 1)",
|
||||||
|
"--sjs-special-yellow": "rgba(255, 152, 20, 1)",
|
||||||
|
"--sjs-special-yellow-light": "rgba(255, 152, 20, 0.1)",
|
||||||
|
"--sjs-special-yellow-forecolor": "rgba(255, 255, 255, 1)",
|
||||||
|
"--sjs-article-font-xx-large-textDecoration": "none",
|
||||||
|
"--sjs-article-font-xx-large-fontWeight": "700",
|
||||||
|
"--sjs-article-font-xx-large-fontStyle": "normal",
|
||||||
|
"--sjs-article-font-xx-large-fontStretch": "normal",
|
||||||
|
"--sjs-article-font-xx-large-letterSpacing": "0",
|
||||||
|
"--sjs-article-font-xx-large-lineHeight": "64px",
|
||||||
|
"--sjs-article-font-xx-large-paragraphIndent": "0px",
|
||||||
|
"--sjs-article-font-xx-large-textCase": "none",
|
||||||
|
"--sjs-article-font-x-large-textDecoration": "none",
|
||||||
|
"--sjs-article-font-x-large-fontWeight": "700",
|
||||||
|
"--sjs-article-font-x-large-fontStyle": "normal",
|
||||||
|
"--sjs-article-font-x-large-fontStretch": "normal",
|
||||||
|
"--sjs-article-font-x-large-letterSpacing": "0",
|
||||||
|
"--sjs-article-font-x-large-lineHeight": "56px",
|
||||||
|
"--sjs-article-font-x-large-paragraphIndent": "0px",
|
||||||
|
"--sjs-article-font-x-large-textCase": "none",
|
||||||
|
"--sjs-article-font-large-textDecoration": "none",
|
||||||
|
"--sjs-article-font-large-fontWeight": "700",
|
||||||
|
"--sjs-article-font-large-fontStyle": "normal",
|
||||||
|
"--sjs-article-font-large-fontStretch": "normal",
|
||||||
|
"--sjs-article-font-large-letterSpacing": "0",
|
||||||
|
"--sjs-article-font-large-lineHeight": "40px",
|
||||||
|
"--sjs-article-font-large-paragraphIndent": "0px",
|
||||||
|
"--sjs-article-font-large-textCase": "none",
|
||||||
|
"--sjs-article-font-medium-textDecoration": "none",
|
||||||
|
"--sjs-article-font-medium-fontWeight": "700",
|
||||||
|
"--sjs-article-font-medium-fontStyle": "normal",
|
||||||
|
"--sjs-article-font-medium-fontStretch": "normal",
|
||||||
|
"--sjs-article-font-medium-letterSpacing": "0",
|
||||||
|
"--sjs-article-font-medium-lineHeight": "32px",
|
||||||
|
"--sjs-article-font-medium-paragraphIndent": "0px",
|
||||||
|
"--sjs-article-font-medium-textCase": "none",
|
||||||
|
"--sjs-article-font-default-textDecoration": "none",
|
||||||
|
"--sjs-article-font-default-fontWeight": "400",
|
||||||
|
"--sjs-article-font-default-fontStyle": "normal",
|
||||||
|
"--sjs-article-font-default-fontStretch": "normal",
|
||||||
|
"--sjs-article-font-default-letterSpacing": "0",
|
||||||
|
"--sjs-article-font-default-lineHeight": "28px",
|
||||||
|
"--sjs-article-font-default-paragraphIndent": "0px",
|
||||||
|
"--sjs-article-font-default-textCase": "none"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function SurveyUploadFileComponent(survey,app) {
|
||||||
|
survey.onComplete.add((sender, options) => {
|
||||||
|
console.log(JSON.stringify(sender.data, null, 3));
|
||||||
|
});
|
||||||
|
|
||||||
|
survey.onUploadFiles.add((_, options) => {
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
options.files.forEach((file) => {
|
||||||
|
let data = {
|
||||||
|
original_name: file.name,
|
||||||
|
new_name: "file_" + app.utils.randomGenerator(32) + "." + file.name.split('.').pop(),
|
||||||
|
category: "forms",
|
||||||
|
nameid: "formsnameid",
|
||||||
|
savedirectory: "/modules/forms"
|
||||||
|
};
|
||||||
|
|
||||||
|
formData.append("api_upload_file", file);
|
||||||
|
formData.append("api_upload_data", JSON.stringify(data));
|
||||||
|
});
|
||||||
|
|
||||||
|
let requesturl = "/portal/admin/core/api/php/request.php"
|
||||||
|
fetch(requesturl, {
|
||||||
|
method: "POST",
|
||||||
|
body: formData
|
||||||
|
})
|
||||||
|
.then((response) => { return response.json(); })
|
||||||
|
.then((data2) => {
|
||||||
|
|
||||||
|
console.log(data2);
|
||||||
|
options.callback(
|
||||||
|
options.files.map((file) => {
|
||||||
|
console.log(file)
|
||||||
|
return {
|
||||||
|
file: file,
|
||||||
|
content: requesturl + "?api_download_file=" + data2["new_name"]
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error(error);
|
||||||
|
options.callback([], [ 'An error occurred during file upload.' ]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
async function deleteFile(fileURL, options) {
|
||||||
|
try {
|
||||||
|
const name = fileURL.split("=")[1];
|
||||||
|
const apiUrl = `https://api.surveyjs.io/private/Surveys/deleteTempFile?name=${name}`;
|
||||||
|
const response = await fetch(apiUrl, {
|
||||||
|
method: "DELETE"
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.status === 200) {
|
||||||
|
console.log(`File ${name} was deleted successfully`);
|
||||||
|
options.callback("success");
|
||||||
|
} else {
|
||||||
|
console.error(`Failed to delete file: ${name}`);
|
||||||
|
options.callback("error");
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error while deleting file: ", error);
|
||||||
|
options.callback("error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
survey.onClearFiles.add(async (_, options) => {
|
||||||
|
if (!options.value || options.value.length === 0)
|
||||||
|
return options.callback("success");
|
||||||
|
if (!options.fileName && !!options.value) {
|
||||||
|
for (const item of options.value) {
|
||||||
|
await deleteFile(item.content, options);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const fileToRemove = options.value.find(
|
||||||
|
(item) => item.name === options.fileName
|
||||||
|
);
|
||||||
|
if (fileToRemove) {
|
||||||
|
await deleteFile(fileToRemove.content, options);
|
||||||
|
} else {
|
||||||
|
console.error(`File with name ${options.fileName} is not found`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
})();
|
||||||
2026
portal/admin/playground/client/subscribers/styles.css
Normal file
2026
portal/admin/playground/client/subscribers/styles.css
Normal file
File diff suppressed because it is too large
Load Diff
@@ -9,13 +9,13 @@
|
|||||||
|
|
||||||
class Controller {
|
class Controller {
|
||||||
constructor(environment, member_config, json_config){
|
constructor(environment, member_config, json_config){
|
||||||
console.log(member_config);
|
// console.log(member_config);
|
||||||
this.config = { "member": member_config, "json": json_config, "environment": environment };
|
this.config = { "member": member_config, "json": json_config, "environment": environment };
|
||||||
this.membership = member_config.membership;
|
this.membership = member_config.membership;
|
||||||
this.testing = true;
|
this.testing = true;
|
||||||
this.config.key = "passthrough";
|
this.config.key = "passthrough";
|
||||||
|
|
||||||
console.log(json_config);
|
// console.log(json_config);
|
||||||
|
|
||||||
|
|
||||||
// TODO_4: user should already have json_data & records
|
// TODO_4: user should already have json_data & records
|
||||||
|
|||||||
@@ -220,6 +220,7 @@
|
|||||||
console.log("Appfactory Studio: SDK has not been initialized!");
|
console.log("Appfactory Studio: SDK has not been initialized!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log(1);
|
||||||
applicationManager.apicall("/v1/payments/initialize_direct_payments",{
|
applicationManager.apicall("/v1/payments/initialize_direct_payments",{
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -310,6 +311,7 @@
|
|||||||
"payment_intent": payment_intent
|
"payment_intent": payment_intent
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(2);
|
||||||
self.appManager.apicall("/v1/payments/save_handler",{
|
self.appManager.apicall("/v1/payments/save_handler",{
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -458,15 +460,6 @@
|
|||||||
},1000);
|
},1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__runPaypal2(){
|
__runPaypal2(){
|
||||||
const self = this;
|
const self = this;
|
||||||
function RunCreatePaypalPayment(){
|
function RunCreatePaypalPayment(){
|
||||||
@@ -641,8 +634,6 @@
|
|||||||
RunCreatePaypalPayment();
|
RunCreatePaypalPayment();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__payaplCheckOutHtmlElement(paypal_style,self){
|
__payaplCheckOutHtmlElement(paypal_style,self){
|
||||||
let showpaypalbutton = "";
|
let showpaypalbutton = "";
|
||||||
if(self.options.showPaypalButton){
|
if(self.options.showPaypalButton){
|
||||||
@@ -1609,7 +1600,6 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// nnnnn
|
|
||||||
$("#paypal_terms_and_conditions").on("click",function(e){
|
$("#paypal_terms_and_conditions").on("click",function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
window.open("https://www.paypal.com/us/legalhub/privacy-full");
|
window.open("https://www.paypal.com/us/legalhub/privacy-full");
|
||||||
@@ -2447,6 +2437,7 @@
|
|||||||
console.log(props);
|
console.log(props);
|
||||||
console.log(directPayment);
|
console.log(directPayment);
|
||||||
|
|
||||||
|
console.log(3);
|
||||||
directPayment.appManager.apicall("/v1/payments/stripe_create_customer",{
|
directPayment.appManager.apicall("/v1/payments/stripe_create_customer",{
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(props)
|
body: JSON.stringify(props)
|
||||||
@@ -2477,6 +2468,7 @@
|
|||||||
// reference_num: props.reference_num
|
// reference_num: props.reference_num
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(4);
|
||||||
directPayment.appManager.apicall("/v1/payments/stripe_create_subscription",{
|
directPayment.appManager.apicall("/v1/payments/stripe_create_subscription",{
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(data)
|
body: JSON.stringify(data)
|
||||||
@@ -2755,140 +2747,11 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function _stripe_subscribe(self){
|
function _stripe_subscribe(self){
|
||||||
// helper method for displaying a status message.
|
|
||||||
const setMessage = (message) => {
|
|
||||||
const messageDiv = document.querySelector('#messages');
|
|
||||||
messageDiv.innerHTML += "<br>" + message;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch public key and initialize Stripe.
|
|
||||||
let stripe, cardElement;
|
|
||||||
|
|
||||||
|
|
||||||
let data = {};
|
|
||||||
fetchJsonp(self.service_request_url + "?" + new URLSearchParams({type:"config",data: JSON.stringify(data)}), {
|
|
||||||
method: "get"
|
|
||||||
})
|
|
||||||
.then((resp) => resp.json())
|
|
||||||
.then((resp) => {
|
|
||||||
stripe = Stripe(resp.publishableKey);
|
|
||||||
|
|
||||||
const elements = stripe.elements();
|
|
||||||
cardElement = elements.create('card');
|
|
||||||
cardElement.mount('#card-element');
|
|
||||||
}).catch((err) => {
|
|
||||||
console.log(err);
|
|
||||||
});
|
|
||||||
|
|
||||||
// fetch('/config')
|
|
||||||
// .then((resp) => resp.json())
|
|
||||||
// .then((resp) => {
|
|
||||||
// stripe = Stripe(resp.publishableKey);
|
|
||||||
|
|
||||||
// const elements = stripe.elements();
|
|
||||||
// cardElement = elements.create('card');
|
|
||||||
// cardElement.mount('#card-element');
|
|
||||||
// });
|
|
||||||
|
|
||||||
// Extract the client secret query string argument. This is
|
|
||||||
// required to confirm the payment intent from the front-end.
|
|
||||||
const subscriptionId = window.sessionStorage.getItem('subscriptionId');
|
|
||||||
const clientSecret = window.sessionStorage.getItem('clientSecret');
|
|
||||||
// This sample only supports a Subscription with payment
|
|
||||||
// upfront. If you offer a trial on your subscription, then
|
|
||||||
// instead of confirming the subscription's latest_invoice's
|
|
||||||
// payment_intent. You'll use stripe.confirmCardSetup to confirm
|
|
||||||
// the subscription's pending_setup_intent.
|
|
||||||
// See https://stripe.com/docs/billing/subscriptions/trials
|
|
||||||
|
|
||||||
// Payment info collection and confirmation
|
|
||||||
// When the submit button is pressed, attempt to confirm the payment intent
|
|
||||||
// with the information input into the card element form.
|
|
||||||
// - handle payment errors by displaying an alert. The customer can update
|
|
||||||
// the payment information and try again
|
|
||||||
// - Stripe Elements automatically handles next actions like 3DSecure that are required for SCA
|
|
||||||
// - Complete the subscription flow when the payment succeeds
|
|
||||||
const form = document.querySelector('#subscribe-form');
|
|
||||||
form.addEventListener('submit', async (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
const nameInput = document.getElementById('name');
|
|
||||||
|
|
||||||
// Create payment method and confirm payment intent.
|
|
||||||
stripe.confirmCardPayment(clientSecret, {
|
|
||||||
payment_method: {
|
|
||||||
card: cardElement,
|
|
||||||
billing_details: {
|
|
||||||
name: nameInput.value,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}).then((result) => {
|
|
||||||
if(result.error) {
|
|
||||||
setMessage(`Payment failed: ${result.error.message}`);
|
|
||||||
} else {
|
|
||||||
// Redirect the customer to their account page
|
|
||||||
setMessage('Success! Redirecting to your account.');
|
|
||||||
window.location.href = '/account.html';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function _stripe_single_charge_payment_intent(options,cbStart,cbSuccess,cbBackEndError,cbStripeError,self){
|
async function _stripe_single_charge_payment_intent(options,cbStart,cbSuccess,cbBackEndError,cbStripeError,self){
|
||||||
let data = {
|
|
||||||
// customer: options.customer,
|
|
||||||
// mail_handlers: options.mail_handlers
|
|
||||||
};
|
|
||||||
fetchJsonp(self.service_request_url + "?" + new URLSearchParams({type:"signle-create-payment-intent",data: JSON.stringify(data)}), {
|
|
||||||
method: "get"
|
|
||||||
})
|
|
||||||
.then((resp) => resp.json())
|
|
||||||
.then(async (resp) => {
|
|
||||||
let clientSecret = resp.clientSecret;
|
|
||||||
if (resp.error) {
|
|
||||||
console.log(resp);
|
|
||||||
console.log(cbBackEndError);
|
|
||||||
if(cbBackEndError!=undefined && cbBackEndError!=null) cbBackEndError(resp);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(options.name==undefined) options.name = "";
|
|
||||||
if(options.email==undefined) options.email = "";
|
|
||||||
|
|
||||||
cbStart(resp.paymentIntent, async function(){
|
|
||||||
// Confirm the card payment given the clientSecret
|
|
||||||
// from the payment intent that was just created on
|
|
||||||
// the server.
|
|
||||||
const {error: stripeError, paymentIntent} = await options.stripe.confirmCardPayment(
|
|
||||||
clientSecret,
|
|
||||||
{
|
|
||||||
payment_method: {
|
|
||||||
card: options.card,
|
|
||||||
billing_details: {
|
|
||||||
name: options.name,
|
|
||||||
phone: "713-777-5555",
|
|
||||||
_member_reference_num: options._member_reference_num
|
|
||||||
},
|
|
||||||
},
|
|
||||||
metadata: {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (stripeError) {
|
|
||||||
console.log(stripeError);
|
|
||||||
if(cbStripeError!=undefined && cbStripeError!=null) cbStripeError(stripeError);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
cbSuccess(paymentIntent);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}).catch((err) => {
|
|
||||||
console.error(err);
|
|
||||||
// cb(null,null);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
async function _stripe_standalone_payment(props,cb,self){
|
async function _stripe_standalone_payment(props,cb,self){
|
||||||
let data = {};
|
let data = {};
|
||||||
@@ -3718,6 +3581,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function EmailHandlerAddResponseEmail(email,mail_handlers){
|
||||||
|
if(email!=undefined && email!=null){
|
||||||
|
for(let prop1 in mail_handlers){
|
||||||
|
for(let prop2 in mail_handlers[prop1].handlers){
|
||||||
|
if(mail_handlers[prop1].handlers[prop2]['alert']==true)
|
||||||
|
continue;
|
||||||
|
mail_handlers[prop1].handlers[prop2]['emails'] = [email];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mail_handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// nnnnn
|
||||||
class Utils {
|
class Utils {
|
||||||
|
|
||||||
|
|
||||||
@@ -3736,6 +3614,16 @@
|
|||||||
return rest + "." + lastTwo;
|
return rest + "." + lastTwo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static numberId(len){
|
||||||
|
let text = "";
|
||||||
|
let possible = "0123456789";
|
||||||
|
if(len==null || len==undefined) len = 5;
|
||||||
|
|
||||||
|
for( var i=0; i < len; i++ )
|
||||||
|
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3757,6 +3645,55 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* path: "/path",
|
||||||
|
data: {
|
||||||
|
code: code,
|
||||||
|
direct_payment: JSON.stringify(direct_payments_obj)
|
||||||
|
}
|
||||||
|
*
|
||||||
|
* @param {object} params
|
||||||
|
* @param {function} cb
|
||||||
|
* @param {boolean} raw - should the params be added together for a get request
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
function callAPI(params,cb,raw=true){
|
||||||
|
// const url = GetUrl('stripe');
|
||||||
|
// https://api.appfactory.studio/v1/modules/stripe/webhook
|
||||||
|
// let urlpath = "https://www." + applicationManager.config.api.json.url + "/portal/admin/core/api/php/request.php";
|
||||||
|
// let urlpath = "https://api.appfactory.studio/v1/modules/stripe" + params.path;
|
||||||
|
let urlpath = "https://api." + applicationManager.config.api.json.url + "" + params.path;
|
||||||
|
// let urlpath = "/portal/admin/core/api/php/includes/services/payments/stripe/stripe_payments.php"
|
||||||
|
let http = new XMLHttpRequest();
|
||||||
|
let urlEncodedData = "", urlEncodedDataPairs = [], name;
|
||||||
|
if(raw==false){
|
||||||
|
for( name in params ) {
|
||||||
|
urlEncodedDataPairs.push(encodeURIComponent(name)+'='+encodeURIComponent(params[name]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const URL = urlpath;
|
||||||
|
http.open('POST', URL, true);
|
||||||
|
// http.setRequestHeader('Content-Type', 'application/json');
|
||||||
|
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
||||||
|
http.onreadystatechange = function() {
|
||||||
|
// if(http.readyState == 4 && http.status == 200) {
|
||||||
|
if ((http.readyState == 4) && (http.status >= 200 && http.status < 300)) {
|
||||||
|
// console.log(http);
|
||||||
|
cb(JSON.parse(http.responseText));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(raw==false){
|
||||||
|
http.send(urlEncodedDataPairs.join("&"));
|
||||||
|
}else{
|
||||||
|
http.send(JSON.stringify(params));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
function callStripe(params,cb,raw=true){
|
function callStripe(params,cb,raw=true){
|
||||||
// const url = GetUrl('stripe');
|
// const url = GetUrl('stripe');
|
||||||
// https://api.appfactory.studio/v1/modules/stripe/webhook
|
// https://api.appfactory.studio/v1/modules/stripe/webhook
|
||||||
@@ -3843,7 +3780,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function stripeApplyDiscount(code,cb){
|
function stripeApplyDiscount(code, price_id, amount, cb){
|
||||||
let direct_payments_obj = sessionStorage.getItem('afs_direct_payment');
|
let direct_payments_obj = sessionStorage.getItem('afs_direct_payment');
|
||||||
if(direct_payments_obj==undefined){
|
if(direct_payments_obj==undefined){
|
||||||
console.log("error - no direct payment");
|
console.log("error - no direct payment");
|
||||||
@@ -3852,24 +3789,23 @@
|
|||||||
|
|
||||||
let client_id = direct_payments_obj._processor.json.client_id;
|
let client_id = direct_payments_obj._processor.json.client_id;
|
||||||
|
|
||||||
|
// may not needed
|
||||||
let price = sessionStorage.getItem('mystripe_price');
|
let price = sessionStorage.getItem('mystripe_price');
|
||||||
if(price==undefined || price==null){
|
if(price==undefined || price==null){ return; }
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
price = JSON.parse(price);
|
price = JSON.parse(price);
|
||||||
console.log(price);
|
console.log(price);
|
||||||
console.log(direct_payments_obj);
|
console.log(direct_payments_obj);
|
||||||
|
|
||||||
// AQGTB0WN
|
|
||||||
callStripe({
|
callStripe({
|
||||||
path: "/apply_coupon",
|
path: "/apply_coupon",
|
||||||
apply_coupon: true,
|
data: {
|
||||||
code: code,
|
code: code,
|
||||||
price_id: price.id,
|
price_id: price_id, //price.id,
|
||||||
direct_payment: JSON.stringify(direct_payments_obj)
|
amount: amount,
|
||||||
|
direct_payment: JSON.stringify(direct_payments_obj)
|
||||||
|
}
|
||||||
|
|
||||||
},function(resp){
|
},function(resp){
|
||||||
// resp = JSON.parse(resp);
|
|
||||||
// console.log(resp);
|
// console.log(resp);
|
||||||
if(resp.message!=undefined){
|
if(resp.message!=undefined){
|
||||||
cb(resp);
|
cb(resp);
|
||||||
@@ -3878,9 +3814,6 @@
|
|||||||
sessionStorage.setItem('mystripe_coupon_object',JSON.stringify(resp));
|
sessionStorage.setItem('mystripe_coupon_object',JSON.stringify(resp));
|
||||||
cb(resp);
|
cb(resp);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// rrrrr
|
// rrrrr
|
||||||
@@ -3896,8 +3829,6 @@
|
|||||||
setupCb(stripeManager);
|
setupCb(stripeManager);
|
||||||
RegisterStripeEvents(stripeManager);
|
RegisterStripeEvents(stripeManager);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(options.submit_id).on("click", async function(e){
|
$(options.submit_id).on("click", async function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -3910,9 +3841,10 @@
|
|||||||
|
|
||||||
// elements,cardNumber,cardCvc,cardExpiry
|
// elements,cardNumber,cardCvc,cardExpiry
|
||||||
let coupon = sessionStorage.getItem('mystripe_coupon_object');
|
let coupon = sessionStorage.getItem('mystripe_coupon_object');
|
||||||
console.log(coupon);
|
// console.log(coupon);
|
||||||
if(coupon!=undefined && coupon!=null){
|
if(coupon!=undefined && coupon!=null){
|
||||||
coupon = JSON.parse(coupon);
|
coupon = JSON.parse(coupon);
|
||||||
|
// TODO_1: Stripe taxes is not applied to coupon
|
||||||
_stripeWithCoupon(coupon,cardNumber,elements,stripe,direct_payments_obj,action,errCb,successCb,stripeManager);
|
_stripeWithCoupon(coupon,cardNumber,elements,stripe,direct_payments_obj,action,errCb,successCb,stripeManager);
|
||||||
}else{
|
}else{
|
||||||
_stripeWithoutCoupon(elements,cardNumber,stripe,direct_payments_obj,action,errCb,successCb,stripeManager);
|
_stripeWithoutCoupon(elements,cardNumber,stripe,direct_payments_obj,action,errCb,successCb,stripeManager);
|
||||||
@@ -3928,22 +3860,21 @@
|
|||||||
data.resultsCallback();
|
data.resultsCallback();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
document.addEventListener("update:tax",function(e){
|
document.addEventListener("update:tax",function(e){
|
||||||
|
console.log(e.detail);
|
||||||
_stripeEventUpdateTax(stripeManager,e.detail);
|
_stripeEventUpdateTax(stripeManager,e.detail);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function _stripeEventUpdateTax(stripeManager,data){
|
function _stripeEventUpdateTax(stripeManager,data){
|
||||||
if(stripeManager._saved_postal_code.trim()==data.data.address.postal_code.trim()){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
// if(stripeManager._saved_postal_code.trim()==data.data.address.postal_code.trim()){
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
stripeManager._saved_postal_code = data.data.address.postal_code.trim();
|
stripeManager._saved_postal_code = data.data.address.postal_code.trim();
|
||||||
// console.log(data);
|
stripeManager._card_elements = {};
|
||||||
|
const stripe = stripeManager.getStripe();
|
||||||
const stripe = stripeManager.getStripe(); //Stripe(client_id);
|
if(stripeManager._cardIsMounted==false){
|
||||||
const appearance = {
|
const appearance = {
|
||||||
rules: {
|
rules: {
|
||||||
'.Tab': {
|
'.Tab': {
|
||||||
@@ -3967,7 +3898,7 @@
|
|||||||
// See all supported class names and selector syntax below
|
// See all supported class names and selector syntax below
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const stripeOptions = {
|
stripeManager._card_elements.stripeOptions = {
|
||||||
// hidePostalCode: true,
|
// hidePostalCode: true,
|
||||||
layout: {
|
layout: {
|
||||||
type: 'accordion',
|
type: 'accordion',
|
||||||
@@ -3980,7 +3911,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const elements = stripe.elements({
|
stripeManager._card_elements.elements = stripe.elements({
|
||||||
fonts: [
|
fonts: [
|
||||||
{
|
{
|
||||||
cssSrc: 'https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap'
|
cssSrc: 'https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap'
|
||||||
@@ -3990,7 +3921,7 @@
|
|||||||
|
|
||||||
// const elements = stripe.elements({appearance});
|
// const elements = stripe.elements({appearance});
|
||||||
|
|
||||||
const cardNumber = elements.create('cardNumber', {
|
stripeManager._card_elements.cardNumber = stripeManager._card_elements.elements.create('cardNumber', {
|
||||||
// hidePostalCode: true,
|
// hidePostalCode: true,
|
||||||
style: {
|
style: {
|
||||||
base: {
|
base: {
|
||||||
@@ -4000,7 +3931,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const cardExpiry = elements.create('cardExpiry', {
|
stripeManager._card_elements.cardExpiry = stripeManager._card_elements.elements.create('cardExpiry', {
|
||||||
style: {
|
style: {
|
||||||
base: {
|
base: {
|
||||||
color: '#555',
|
color: '#555',
|
||||||
@@ -4009,7 +3940,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const cardCvc = elements.create('cardCvc', {
|
stripeManager._card_elements.cardCvc = stripeManager._card_elements.elements.create('cardCvc', {
|
||||||
style: {
|
style: {
|
||||||
base: {
|
base: {
|
||||||
color: '#555',
|
color: '#555',
|
||||||
@@ -4018,7 +3949,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const addressElement = elements.create("address", {
|
stripeManager._card_elements.addressElement = stripeManager._card_elements.elements.create("address", {
|
||||||
mode: "billing", // or "shipping"
|
mode: "billing", // or "shipping"
|
||||||
defaultValues:{
|
defaultValues:{
|
||||||
name: "James Mitchell",// data.data.name,
|
name: "James Mitchell",// data.data.name,
|
||||||
@@ -4027,7 +3958,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const cardZip = elements.create('postalCode', {
|
stripeManager._card_elements.cardZip = stripeManager._card_elements.elements.create('postalCode', {
|
||||||
style: {
|
style: {
|
||||||
base: {
|
base: {
|
||||||
color: '#555',
|
color: '#555',
|
||||||
@@ -4036,25 +3967,41 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
stripeManager.getTax(data.data,function(results){
|
}
|
||||||
// console.log("mounting");
|
|
||||||
// console.log(data.data);
|
|
||||||
// console.log(results);
|
|
||||||
|
|
||||||
|
|
||||||
addressElement.mount("#address_no_mount");
|
stripeManager.getTax(data.data, function(results){
|
||||||
cardNumber.mount(stripeManager.getOptions().card.cardNumber);
|
console.log("mounting");
|
||||||
cardExpiry.mount(stripeManager.getOptions().card.cardExpiry);
|
console.log(data.data);
|
||||||
cardCvc.mount(stripeManager.getOptions().card.cardCVC);
|
console.log(results);
|
||||||
|
|
||||||
|
if(stripeManager._cardIsMounted==false){
|
||||||
|
// TODO_1: Stripe change to user supplied id
|
||||||
|
stripeManager._card_elements.addressElement.mount("#address_no_mount");
|
||||||
|
stripeManager._card_elements.cardNumber.mount(stripeManager.getOptions().card.cardNumber);
|
||||||
|
stripeManager._card_elements.cardExpiry.mount(stripeManager.getOptions().card.cardExpiry);
|
||||||
|
stripeManager._card_elements.cardCvc.mount(stripeManager.getOptions().card.cardCVC);
|
||||||
|
|
||||||
|
stripeManager._card_elements.cardNumber.on('ready', function() {
|
||||||
|
// console.log('Stripe card element is ready and mounted.');
|
||||||
|
// You can now safely interact with the element, e.g., card.focus();
|
||||||
|
stripeManager._cardIsMounted = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
stripeManager.elements = {
|
||||||
|
elements:stripeManager._card_elements.elements,
|
||||||
|
cardNumber:stripeManager._card_elements.cardNumber,
|
||||||
|
cardCvc:stripeManager._card_elements.cardCvc,
|
||||||
|
cardExpiry:stripeManager._card_elements.cardExpiry,
|
||||||
|
addressElement:stripeManager._card_elements.addressElement
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if(data.resultsCallback!=undefined){
|
if(data.resultsCallback!=undefined){
|
||||||
data.resultsCallback(results);
|
data.resultsCallback(results, stripeManager._cardIsMounted);
|
||||||
}
|
}
|
||||||
stripeManager.elements = {
|
|
||||||
elements,cardNumber,cardCvc,cardExpiry,addressElement
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4208,7 +4155,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.log('Address not complete or valid:');
|
console.log('Address not complete or invalid:');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -4222,8 +4169,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
class StripeEvents {
|
class StripeEvents {
|
||||||
#customEvent_display_card;
|
#customEvent_display_card = null;
|
||||||
#customEvent_update_tax;
|
#customEvent_update_tax = null;
|
||||||
constructor(){}
|
constructor(){}
|
||||||
|
|
||||||
trigger(event,data = {}){
|
trigger(event,data = {}){
|
||||||
@@ -4236,7 +4183,7 @@
|
|||||||
// document.dispatchEvent(this.#customEvent);
|
// document.dispatchEvent(this.#customEvent);
|
||||||
}else if(event=="update:tax"){
|
}else if(event=="update:tax"){
|
||||||
this.#customEvent_update_tax = new CustomEvent("update:tax",{
|
this.#customEvent_update_tax = new CustomEvent("update:tax",{
|
||||||
detail:data
|
detail: data
|
||||||
});
|
});
|
||||||
document.dispatchEvent(this.#customEvent_update_tax);
|
document.dispatchEvent(this.#customEvent_update_tax);
|
||||||
}
|
}
|
||||||
@@ -4258,6 +4205,7 @@
|
|||||||
#tax_calculation_id;
|
#tax_calculation_id;
|
||||||
_is_initialized = false;
|
_is_initialized = false;
|
||||||
_saved_postal_code = "";
|
_saved_postal_code = "";
|
||||||
|
_cardIsMounted = false;
|
||||||
#options;
|
#options;
|
||||||
constructor(direct_payment,options){
|
constructor(direct_payment,options){
|
||||||
this.events = new StripeEvents();
|
this.events = new StripeEvents();
|
||||||
@@ -4318,12 +4266,13 @@
|
|||||||
customer_created: isCustomerCreated,
|
customer_created: isCustomerCreated,
|
||||||
payment_intent_created: isPaymentIntentCreated,
|
payment_intent_created: isPaymentIntentCreated,
|
||||||
payment_method_created: isPaymentMethodCreated,
|
payment_method_created: isPaymentMethodCreated,
|
||||||
|
amount: opts.amount,
|
||||||
|
|
||||||
customer_id: this.#customer_id,
|
customer_id: this.#customer_id,
|
||||||
payment_intent_id: this.#payment_intent_id,
|
payment_intent_id: this.#payment_intent_id,
|
||||||
payment_method_id: this.#payment_method_id,
|
payment_method_id: this.#payment_method_id,
|
||||||
product_id: this.#product_id,
|
product_id: this.#product_id,
|
||||||
amount: this.#options.amount,
|
// amount: this.#options.amount,
|
||||||
address: opts.address
|
address: opts.address
|
||||||
}
|
}
|
||||||
callStripe({
|
callStripe({
|
||||||
@@ -4548,13 +4497,336 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////
|
||||||
|
/////////////////////////////////////////////////////////////////////////
|
||||||
|
/////////////////////////////////////////////////////////////////////////
|
||||||
|
//////// CatalogSubscribers
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// nnnnn
|
||||||
|
class Subscriber {
|
||||||
|
|
||||||
|
constructor(email,name,phone){
|
||||||
|
this.email = email;
|
||||||
|
this.name = name;
|
||||||
|
this.phone = phone;
|
||||||
|
this.catalogs = [];
|
||||||
|
this.reference_num = "s"+ Utils.numberId(21);
|
||||||
|
}
|
||||||
|
|
||||||
|
setCatalogs(catalogs){
|
||||||
|
this.catalogs = catalogs;
|
||||||
|
}
|
||||||
|
|
||||||
|
buildSubscriber(){
|
||||||
|
let self = this;
|
||||||
|
let catalogs = [];
|
||||||
|
for (let i = 0; i < self.catalogs.length; i++) {
|
||||||
|
const catalog = self.catalogs[i];
|
||||||
|
catalogs.push({
|
||||||
|
"reference_num": catalog.reference_num,
|
||||||
|
"active": true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
email: self.email,
|
||||||
|
reference_num: self.reference_num,
|
||||||
|
json: {
|
||||||
|
phone: self.phone,
|
||||||
|
name: (self.name==undefined) ? "" : self.name,
|
||||||
|
catalogs: catalogs
|
||||||
|
},
|
||||||
|
date: moment().format('LLL')
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
addCatalog(catalog){
|
||||||
|
let self = this;
|
||||||
|
self.catalogs.push(catalog);
|
||||||
|
}
|
||||||
|
|
||||||
|
getCatalogs(){ return this.catalogs; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class AFSSubscriber {
|
||||||
|
constructor() {
|
||||||
|
const self = this;
|
||||||
|
// self.app = app;
|
||||||
|
// self.managed_domain = managed_domain;
|
||||||
|
self.catalogs = [];
|
||||||
|
self.subscriber = {};
|
||||||
|
self._props_ = {
|
||||||
|
"has_been_updated": []
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
requestCatalogs(cb){
|
||||||
|
const self = this;
|
||||||
|
callAPI({
|
||||||
|
path: "/v1/modules/subscribers/get_catalogs",
|
||||||
|
},function(resp){
|
||||||
|
// console.log(resp);
|
||||||
|
if(resp.message!=undefined && resp.message=="request_failure"){
|
||||||
|
console.log("Error - no catalogs!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.catalogs = resp.catalogs;
|
||||||
|
if(cb!=undefined) cb(resp.catalogs);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* app.extra.config.configurations.subscriber
|
||||||
|
*
|
||||||
|
* @returns array
|
||||||
|
*/
|
||||||
|
getCatalogs() {
|
||||||
|
return this.catalogs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get catalog by reference_num or the index within the subscribers array.
|
||||||
|
* can return null.
|
||||||
|
*
|
||||||
|
* @param {string|number} index - The index or reference_num
|
||||||
|
* @returns object | null app.extra.config.configurations.subscriber[catalog].json
|
||||||
|
*/
|
||||||
|
getCatalog(index) {
|
||||||
|
const self = this;
|
||||||
|
let saveindex = -1;
|
||||||
|
if(typeof index === 'number'){
|
||||||
|
if(self._exist_catalog(index)){
|
||||||
|
return self.getCatalogs()[index];
|
||||||
|
}else{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(typeof index === 'string'){
|
||||||
|
for (let i = 0; i < self.getCatalogs().length; i++) {
|
||||||
|
if(self.getCatalogs().reference_num==index){
|
||||||
|
saveindex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(saveindex==-1){
|
||||||
|
return null;
|
||||||
|
}else{
|
||||||
|
return self.getCatalogs()[saveindex].json;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
initializeSubscriber(email,name,phone){
|
||||||
|
return new Subscriber(email,name,phone);
|
||||||
|
}
|
||||||
|
|
||||||
|
addCatalogSubscriber(catalog,subscriber){
|
||||||
|
subscriber.addCatalog(catalog);
|
||||||
|
}
|
||||||
|
|
||||||
|
createSubscriber(sub,mail_handlers,cb,sendresponse){
|
||||||
|
let self = this;
|
||||||
|
if(sub.getCatalogs().length==0) return;
|
||||||
|
if(sendresponse==undefined) sendresponse = true;
|
||||||
|
|
||||||
|
let subBuild = sub.buildSubscriber();
|
||||||
|
console.log(subBuild);
|
||||||
|
const response_email = subBuild['email'];
|
||||||
|
|
||||||
|
// nnnnn
|
||||||
|
mail_handlers = EmailHandlerAddResponseEmail(response_email,mail_handlers);
|
||||||
|
// console.log(mail_handlers);
|
||||||
|
|
||||||
|
callAPI({
|
||||||
|
path: "/v1/modules/subscribers/create_subscriber",
|
||||||
|
data: {
|
||||||
|
token: "token",
|
||||||
|
subscriber: subBuild,
|
||||||
|
mail_handlers: mail_handlers,
|
||||||
|
sendresponse: sendresponse
|
||||||
|
}
|
||||||
|
},function(resp){
|
||||||
|
console.log(resp);
|
||||||
|
if(cb!=undefined) cb();
|
||||||
|
});
|
||||||
|
|
||||||
|
// let email_response = structuredClone(self.app.extra.config.configurations.subscriber[1].json.mail_handlers.email_response);
|
||||||
|
|
||||||
|
// const settings = self.app.extra.config.configurations.settings[0].json;
|
||||||
|
// let sysVars = self.app.extra.extras.SetupSystemVariables(self.app);
|
||||||
|
// let sysVars = [];
|
||||||
|
// sysVars.push({
|
||||||
|
// name: "email",
|
||||||
|
// value: sub.email
|
||||||
|
// });
|
||||||
|
// sysVars.push({
|
||||||
|
// name: "manage_subscription_link",
|
||||||
|
// value: self.app.extra.config.managed_domain.Address + `/portal/pages/subscriber/manage.php?email=${sub.email}&reference_num=${sub.reference_num}`
|
||||||
|
// });
|
||||||
|
|
||||||
|
// email_response.emails = [sub.email];
|
||||||
|
// email_response.variables.client = [structuredClone(email_response.variables.client)];
|
||||||
|
// email_response.variables.schema = [structuredClone(email_response.variables.schema)];
|
||||||
|
// email_response.variables.system = [structuredClone(self.app.extra.extras.SetupSystemVariables(self.app, email_response))];
|
||||||
|
|
||||||
|
// let subBuild = sub.buildSubscriber();
|
||||||
|
// console.log(subBuild);
|
||||||
|
// $.post(self.app.extra.url,{
|
||||||
|
// client_subscriber_add_subscriber: true,
|
||||||
|
// token: self.app.extra.token,
|
||||||
|
// subscriber: JSON.stringify(subBuild),
|
||||||
|
// response: JSON.stringify(email_response),
|
||||||
|
// sendresponse: sendresponse,
|
||||||
|
// },function(resp1){
|
||||||
|
// resp1 = JSON.parse(resp1);
|
||||||
|
// if(cb!=undefined) cb(resp1);
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if catalog exist in array given index.
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
_exist_catalog(index){
|
||||||
|
const self = this;
|
||||||
|
if(typeof self.catalogs[index] === 'undefined') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateSubscriberConfiguration(provider,cb1){
|
||||||
|
const self = this;
|
||||||
|
let updates = self._props_.has_been_updated;
|
||||||
|
let catalogs = [];
|
||||||
|
for (let i = 0; i < updates.length; i++) {
|
||||||
|
const element = updates[i];
|
||||||
|
const catalog = self.getCatalog(element.catalog_reference_num);
|
||||||
|
if(catalog==null){
|
||||||
|
console.log(`Catalog ${element.catalog_reference_num} does not exist`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
catalogs.push(catalog);
|
||||||
|
}
|
||||||
|
|
||||||
|
let email_response = structuredClone(self.app.extra.config.configurations.subscriber[1].json.mail_handlers.email_response);
|
||||||
|
|
||||||
|
// const settings = self.app.extra.config.configurations.settings[0].json;
|
||||||
|
// let sysVars = self.app.extra.extras.SetupSystemVariables(self.app);
|
||||||
|
let sysVars = [];
|
||||||
|
sysVars.push({
|
||||||
|
name: "email",
|
||||||
|
value: provider.email
|
||||||
|
});
|
||||||
|
sysVars.push({
|
||||||
|
name: "subscription_manage_button_link",
|
||||||
|
value: self.app.extra.config.managed_domain.Address + `/portal/pages/subscriber/manage.php?email=${provider.email}&reference_num=${provider.reference_num}`
|
||||||
|
});
|
||||||
|
|
||||||
|
email_response.emails = [provider.email];
|
||||||
|
email_response.variables.client = [structuredClone(email_response.variables.client)];
|
||||||
|
email_response.variables.schema = [structuredClone(email_response.variables.schema)];
|
||||||
|
email_response.variables.system = [structuredClone(email_response.variables.system)];
|
||||||
|
|
||||||
|
// console.log(sysVars);
|
||||||
|
// console.log(provider);
|
||||||
|
// console.log(catalogs);
|
||||||
|
|
||||||
|
// if(catalogs.length==0) return;
|
||||||
|
// $.post(self.app.extra.url,{
|
||||||
|
// add_subscriber: true,
|
||||||
|
// catalogs: JSON.stringify(catalogs),
|
||||||
|
// response: JSON.stringify(email_response)
|
||||||
|
// },function(resp1){
|
||||||
|
// self.clear();
|
||||||
|
// if(cb1!=undefined) cb1(catalogs,resp1);
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteAllSubscribers(){
|
||||||
|
for (let i = 0; i < app.extra.config.configurations.subscriber.length; i++) {
|
||||||
|
app.extra.config.configurations.subscriber[i] = [];
|
||||||
|
|
||||||
|
let senddata ={
|
||||||
|
configurations_update:true,
|
||||||
|
mysql_id: app.extra.config.configurations.subscriber[i].json.mysql_id,
|
||||||
|
data: JSON.stringify(app.extra.config.configurations.subscriber[i].json)
|
||||||
|
}
|
||||||
|
$.post(app.extra.url,senddata,function(resp){
|
||||||
|
console.log(resp)
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sendConfirmationEmail(email,cb){
|
||||||
|
// const self = this;
|
||||||
|
// const list = [];
|
||||||
|
// const updates = self._props_.has_been_updated;
|
||||||
|
// for (let i = 0; i < updates.length; i++) {
|
||||||
|
// const catalog = self.getCatalog(updates[i].catalog_reference_num);
|
||||||
|
// if(catalog==null) continue;
|
||||||
|
// list.push(catalog.display_name);
|
||||||
|
// }
|
||||||
|
// const data = {
|
||||||
|
// subscriber_confirm_subscribed: true,
|
||||||
|
// catalog_display_names: JSON.stringify(list),
|
||||||
|
// email: email
|
||||||
|
// };
|
||||||
|
// $.post(self.app.url,data,function(resp){
|
||||||
|
// if(cb!=undefined) cb(resp);
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
clear(){
|
||||||
|
this._props_.has_been_updated = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
addCatalogSubscriber2(catalog,subscriber){
|
||||||
|
const self = this;
|
||||||
|
const cfn = catalog.reference_num;
|
||||||
|
if(self.getCatalog(cfn)!=null){
|
||||||
|
if(self.getCatalog(cfn)!=null){
|
||||||
|
_addorupdateCatalogSubscriber(subscriber, cfn, self);
|
||||||
|
}else{
|
||||||
|
console.log(`[]: catalog ${cfn} not found`);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
console.log(`[]: catalog ${cfn} not found`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
InitializeClientSDK: InitializeClientSDK,
|
InitializeClientSDK: InitializeClientSDK,
|
||||||
DirectPayments: DirectPayments,
|
DirectPayments: DirectPayments,
|
||||||
EmailHandler: EmailHandler,
|
EmailHandler: EmailHandler,
|
||||||
PaymentsProcessor: PaymentsProcessor,
|
PaymentsProcessor: PaymentsProcessor,
|
||||||
Utils: Utils,
|
Utils: Utils,
|
||||||
|
AFSSubscriber:AFSSubscriber,
|
||||||
|
|
||||||
GetMyUrl,
|
GetMyUrl,
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ $router->post('/get_tax',[AppfactoryStudio\Plugins\StripeModule::class, 'get_tax
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Setup
|
// Setup
|
||||||
$router->get('/setup_stripe_register_plans',[AppfactoryStudio\Plugins\StripeModule::class, 'RegisterSubscriptionPlans']);
|
$router->get('/setup_stripe_register_plans',[AppfactoryStudio\Plugins\StripeModule::class, 'RegisterSubscriptionPlans']);
|
||||||
|
|
||||||
|
|||||||
113
portal/api/v1/modules/subscribers/.htaccess
Normal file
113
portal/api/v1/modules/subscribers/.htaccess
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
########## BEGIN RECOMMENDED RULES (COMMENT OUT OR UNCOMMENT AS NEEDED) ##########
|
||||||
|
|
||||||
|
### htaccess (https://github.com/delight-im/htaccess)
|
||||||
|
### Copyright (c) delight.im (https://www.delight.im/)
|
||||||
|
### Licensed under the MIT License (https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
Header set Access-Control-Allow-Origin "*"
|
||||||
|
Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization"
|
||||||
|
Header set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
|
||||||
|
|
||||||
|
<IfModule mod_autoindex.c>
|
||||||
|
|
||||||
|
# Turn off directory listings for folders without default documents
|
||||||
|
Options -Indexes
|
||||||
|
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
<IfModule mod_negotiation.c>
|
||||||
|
|
||||||
|
# Disable 'MultiViews' implicit filename pattern matches
|
||||||
|
Options -MultiViews
|
||||||
|
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# Serve "text/plain" and "text/html" documents as UTF-8 by default
|
||||||
|
AddDefaultCharset utf-8
|
||||||
|
|
||||||
|
# Disable "ETag" headers so that browsers rely on the "Cache-Control" and "Expires" headers
|
||||||
|
FileETag None
|
||||||
|
|
||||||
|
<ifModule mod_headers.c>
|
||||||
|
|
||||||
|
# Enable HTTP Strict Transport Security (HSTS) with a duration of six months (Uncomment 1 line below)
|
||||||
|
# Header set Strict-Transport-Security max-age=15778800
|
||||||
|
|
||||||
|
</ifModule>
|
||||||
|
|
||||||
|
|
||||||
|
<ifModule mod_rewrite.c>
|
||||||
|
# Force 'www' (i.e. prefix the "bare" domain and all subdomains with 'www' through permanent redirects) (Uncomment 6 lines below)
|
||||||
|
# RewriteCond %{HTTP_HOST} !^$
|
||||||
|
# RewriteCond %{HTTP_HOST} !^www\. [NC]
|
||||||
|
# RewriteCond %{HTTPS}s ^on(s)|
|
||||||
|
# # RewriteCond %{REQUEST_SCHEME} ^http(s)|
|
||||||
|
# # RewriteCond %{SERVER_PORT}s ^443(s)|
|
||||||
|
# RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
|
||||||
|
|
||||||
|
# Force HTTPS (Uncomment 4 lines below)
|
||||||
|
# RewriteCond %{HTTPS} off
|
||||||
|
# # RewriteCond %{REQUEST_SCHEME} http
|
||||||
|
# # RewriteCond %{SERVER_PORT} !443
|
||||||
|
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
|
||||||
|
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# Prevent access to non-minified CSS and JS (Uncomment 3 lines below)
|
||||||
|
# <FilesMatch "(?<!.min)\.(css|js)$">
|
||||||
|
# Require all denied
|
||||||
|
# </FilesMatch>
|
||||||
|
|
||||||
|
# Show a custom error document for "404 Not Found" errors (Uncomment 1 line below)
|
||||||
|
# ErrorDocument 404 /notFound.html
|
||||||
|
|
||||||
|
# Announce contact information for security issues (Uncomment 2 lines below)
|
||||||
|
# Header set X-Vulnerability-Disclosure "https://www.example.com/security"
|
||||||
|
# Header set X-Security-Contact "security@example.com"
|
||||||
|
|
||||||
|
########## END RECOMMENDED RULES ##########
|
||||||
|
|
||||||
|
########## BEGIN CUSTOM RULES (YOUR OWN RULES GO HERE) ##########
|
||||||
|
|
||||||
|
# Add your rules here ...
|
||||||
|
|
||||||
|
########## END CUSTOM RULES ##########
|
||||||
|
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
||||||
|
RewriteBase /
|
||||||
|
RewriteRule ^index\.php$ - [L]
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule . /v1/modules/subscribers/index.php [L]
|
||||||
|
</IfModule>
|
||||||
|
<IfModule mod_headers.c>
|
||||||
|
Header set Access-Control-Allow-Origin "*"
|
||||||
|
|
||||||
|
|
||||||
|
# Prevent clickjacking (forbids framing by third-party sites)
|
||||||
|
Header set X-Frame-Options sameorigin
|
||||||
|
|
||||||
|
# Prevent content sniffing (MIME sniffing)
|
||||||
|
Header set X-Content-Type-Options nosniff
|
||||||
|
|
||||||
|
# Attempt to enable XSS filters in browsers, if available, and block reflected XSS
|
||||||
|
Header set X-XSS-Protection "1; mode=block"
|
||||||
|
|
||||||
|
# Cache media files for a month
|
||||||
|
<FilesMatch "\.(js|css|jpg|jpeg|png|svg|webp|gif|ico|ogg|mp4|webm)$">
|
||||||
|
Header set Cache-Control max-age=2629800
|
||||||
|
</FilesMatch>
|
||||||
|
|
||||||
|
# Remove response headers that provide no value but leak information
|
||||||
|
Header always unset X-Powered-By
|
||||||
|
|
||||||
|
Header unset Server
|
||||||
|
|
||||||
|
# Disable "ETag" headers so that browsers rely on the "Cache-Control" and "Expires" headers
|
||||||
|
Header unset ETag
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
21
portal/api/v1/modules/subscribers/index.php
Normal file
21
portal/api/v1/modules/subscribers/index.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
// require __DIR__ . "/vendor/autoload.php";
|
||||||
|
$dir = dirname( __DIR__, 4 );
|
||||||
|
|
||||||
|
$path = $dir . "/admin/core/api/php/includes/init.php";
|
||||||
|
require $path;
|
||||||
|
$router = new AppfactoryStudio\Core\Router();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// TODO_1: Rate limit or even ban ips that are not stripe to prevent DDOS attacks
|
||||||
|
|
||||||
|
$router->post('/get_catalogs',[AppfactoryStudio\Plugins\Subscribers::class, 'get_catalogs']);
|
||||||
|
$router->get('/get_catalogs',[AppfactoryStudio\Plugins\Subscribers::class, 'get_catalogs']);
|
||||||
|
$router->post('/create_subscriber',[AppfactoryStudio\Plugins\Subscribers::class, 'create_subscriber']);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
echo $router->UrlResolve("/v1/modules/subscribers", $_SERVER['REQUEST_URI'], strtolower($_SERVER['REQUEST_METHOD']));
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user