update 39839999
This commit is contained in:
@@ -1542,7 +1542,19 @@
|
||||
});
|
||||
}
|
||||
// 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,{
|
||||
save_mail_handlers: true,
|
||||
handlers: JSON.stringify(handlers),
|
||||
@@ -1550,7 +1562,7 @@
|
||||
item_reference_num: item_ref
|
||||
},function(resp){
|
||||
resp = JSON.parse(resp);
|
||||
if(cb!=undefined) cb(resp);
|
||||
if(cb!=undefined) cb(resp,subscribers);
|
||||
});
|
||||
|
||||
|
||||
@@ -1651,6 +1663,7 @@
|
||||
function GetThisDomainMemberSettings(tmpConfig,app){
|
||||
let _domain = null;
|
||||
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++) {
|
||||
const element = tmpConfig.root.member.json_data.domains[i];
|
||||
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){
|
||||
|
||||
// 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 = {};
|
||||
let container = [];
|
||||
for (let n = 0; n < mail_handlers.length; n++) {
|
||||
const element = mail_handlers[n];
|
||||
tmp_mail_handlers[element.json.reference_num] = element.json;
|
||||
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){
|
||||
if(item_handlers[element]["item_reference_num"] == item.json.reference_num){
|
||||
let refnum = item_handlers[element].reference_num;
|
||||
mail_handler[refnum] = item_handlers[element];
|
||||
function SortEmailHandlersIntoItem(item_handlers,reference_num){
|
||||
var mail_handler = {};
|
||||
for (let i = 0; i < item_handlers.length; i++) {
|
||||
// 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;
|
||||
}
|
||||
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 emailContainer = null;
|
||||
// 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){
|
||||
AFSSpinner.showFullScreen(false);
|
||||
function setupListHandlers(app){
|
||||
@@ -2586,16 +2628,17 @@
|
||||
let reference_num = "v"+app.utils.randomGenerator(12).toLowerCase();
|
||||
handler.reference_num = reference_num;
|
||||
handler.name = value;
|
||||
// 77777
|
||||
let ref_num = handlersInstance.current.ref_group;
|
||||
handlersInstance.handlers[handlersInstance.current.ref_group].item_reference_num = item_reference_num;
|
||||
// 77777 rrrrr
|
||||
handlersInstance.addHandler(reference_num, handler);
|
||||
setupListHandlers(app);
|
||||
$("#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);
|
||||
AFSSpinner.showFullScreen(false);
|
||||
|
||||
console.log(handler);
|
||||
// console.log(handler);
|
||||
|
||||
// console.log(handlersInstance.current);
|
||||
|
||||
@@ -2689,8 +2732,10 @@
|
||||
var optionSelected = $("option:selected", this);
|
||||
var valueSelected = this.value;
|
||||
emailContainer.email.from = valueSelected;
|
||||
handlersInstance.handlers[emailContainer.email.reference_num] = emailContainer.email;
|
||||
cbSave(emailContainer.email, handlersInstance.handlers);
|
||||
// TODO_3: EmailBuilder - reference by first objectb because it should only be one object
|
||||
// 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);
|
||||
|
||||
@@ -2726,7 +2771,8 @@
|
||||
$("#emailbuilder_active_checkbox_id").prop('checked', emailContainer.email.active);
|
||||
$("#emailbuilder_active_checkbox_id").on("change",function(e){
|
||||
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){
|
||||
@@ -2815,23 +2861,21 @@
|
||||
emailContainer.email.variables.schema[n].value = $(editor.getContent()).text().trim();
|
||||
}
|
||||
|
||||
console.log(emailContainer.email.variables.schema);
|
||||
// console.log(emailContainer.email.variables.schema);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
let ref_num = handlersInstance.current.ref_group;
|
||||
console.log(ref_num);
|
||||
// console.log(ref_num);
|
||||
emailContainer.email.name = $("#emailbuilder_name_input_id").val().trim();
|
||||
handlersInstance.addHandler(emailContainer.email.reference_num, emailContainer.email);
|
||||
|
||||
|
||||
console.log(emailContainer.email);
|
||||
console.log(handlersInstance.handlers);
|
||||
saveCheckboxAlert(app);
|
||||
saveCheckboxActive(app);
|
||||
$("#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){
|
||||
e.preventDefault();
|
||||
@@ -2843,12 +2887,10 @@
|
||||
e.preventDefault();
|
||||
|
||||
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];
|
||||
cbSave(emailContainer.email, handlersInstance.handlers);
|
||||
// cbSave(emailContainer.email, handlersInstance.handlers);
|
||||
MySave(cbSave,emailContainer, handlersInstance,item_reference_num,app,function(){});
|
||||
setTimeout(() => {
|
||||
setTimeout(() => { MySpinnerOff(); },1000);
|
||||
RemoveModal(modal);
|
||||
@@ -2905,8 +2947,9 @@
|
||||
emailContainer.email.variables.schema[index]["value"] = $(editor.getContent()).text().trim();
|
||||
}
|
||||
|
||||
handlersInstance.handlers[emailContainer.email.reference_num] = emailContainer.email;
|
||||
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(){});
|
||||
$("#save_badge_indicator_id").css("display","none");
|
||||
}
|
||||
}
|
||||
@@ -3293,11 +3336,14 @@
|
||||
emailContainer.email.body_mjml_html = decodedString; //editor.getHtml();
|
||||
|
||||
// 77777
|
||||
// console.log(emailContainer.email);
|
||||
// console.log({html: decodedString});
|
||||
handlersInstance.addHandler(emailContainer.email.reference_num, emailContainer.email);
|
||||
handlersInstance.handlers[emailContainer.email.reference_num] = emailContainer.email;
|
||||
cbSave(emailContainer.email, handlersInstance.handlers);
|
||||
|
||||
|
||||
// handlersInstance.addHandler(emailContainer.email.reference_num, emailContainer.email);
|
||||
// handlersInstance.handlers[emailContainer.email.reference_num] = emailContainer.email;
|
||||
// cbSave(emailContainer.email, handlersInstance.handlers);
|
||||
console.log(emailContainer);
|
||||
console.log(handlersInstance);
|
||||
MySave(cbSave,emailContainer,handlersInstance,item_reference_num,app,function(){});
|
||||
});
|
||||
},500);
|
||||
|
||||
|
||||
@@ -87,15 +87,15 @@ class AFSSurveyJSForm {
|
||||
// TODO_1: go through all the handlers, this only selects the firs one
|
||||
let mail_handler_prop = "";
|
||||
|
||||
for(let prop1 in mail_handlers){
|
||||
for(let prop in mail_handlers[prop1].handlers){
|
||||
mail_handler_prop = prop;
|
||||
break; // this does not need to break
|
||||
}
|
||||
mail_handlers = mail_handlers[prop1].handlers[mail_handler_prop];
|
||||
break; // only one should have been sent, so breaking is not required
|
||||
}
|
||||
console.log(mail_handlers);
|
||||
// for(let prop1 in mail_handlers){
|
||||
// for(let prop in mail_handlers[prop1].handlers){
|
||||
// mail_handler_prop = prop;
|
||||
// break; // this does not need to break
|
||||
// }
|
||||
// mail_handlers = mail_handlers[prop1].handlers[mail_handler_prop];
|
||||
// break; // only one should have been sent, so breaking is not required
|
||||
// }
|
||||
// console.log(mail_handlers);
|
||||
|
||||
|
||||
self.survey.onComplete.add(function(survey,options){
|
||||
@@ -111,11 +111,43 @@ class AFSSurveyJSForm {
|
||||
onStartCompleteCB(formSubmittion,form,survey);
|
||||
if(postData){
|
||||
|
||||
if(mail_handlers!=undefined && mail_handlers!=null){
|
||||
let email = self.__getVariable("email", mail_handlers.variables.client);
|
||||
mail_handlers.emails = [email];
|
||||
}else{
|
||||
mail_handlers = {"__empty":true};
|
||||
// if(mail_handlers!=undefined && mail_handlers!=null){
|
||||
// let email = self.__getVariable("email", mail_handlers.variables.client);
|
||||
// mail_handlers.emails = [email];
|
||||
// }else{
|
||||
// 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 = {
|
||||
@@ -124,8 +156,13 @@ class AFSSurveyJSForm {
|
||||
form_reference_num: form.json.reference_num,
|
||||
submission_json: JSON.stringify(formSubmittion),
|
||||
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){
|
||||
// console.log(JSON.parse(resp));
|
||||
onPostCompleteCB(formSubmittion,form,survey);
|
||||
|
||||
@@ -5,7 +5,7 @@ var Flags = Object.freeze({
|
||||
Component: "comp",
|
||||
Method: "meth"
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
(function(factory) {
|
||||
// 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;
|
||||
},
|
||||
|
||||
|
||||
// ddddd
|
||||
/**
|
||||
* Register a method to be called later with in the app
|
||||
*/
|
||||
@@ -606,7 +608,8 @@ ComponentManager.prototype = {};
|
||||
|
||||
|
||||
|
||||
}// 33333
|
||||
}
|
||||
// ddddd
|
||||
ComponentFactory.prototype = {
|
||||
|
||||
|
||||
@@ -2291,6 +2294,7 @@ function ViewComponent2(opts,elements){
|
||||
|
||||
|
||||
|
||||
// 33333
|
||||
// xxxxxh
|
||||
function ViewComponent(opts){
|
||||
gl_HandleAll(this,opts,'ViewComponent');
|
||||
@@ -12002,7 +12006,7 @@ function _addAppElementToList(self){
|
||||
|
||||
|
||||
var CONNECTED_COMPONENTS = [];
|
||||
// 7676 50505 77777 xxxxx
|
||||
// 7676 50505 77777 xxxxx // ddddd
|
||||
function ApplicationManager_start_runInterval(self){
|
||||
let interval = setInterval(function(){
|
||||
//var GL_COMPONENTS = self.getComponents();
|
||||
|
||||
@@ -2395,21 +2395,6 @@ GLOBAL_SETTINGS.SUBSCRIBER = [
|
||||
"reference_abbr": "sub",
|
||||
"display_name": "News5",
|
||||
"description": "",
|
||||
"catalogs_config": {
|
||||
"subscriber_confirmation_email":{
|
||||
"on":false,
|
||||
"email_response":{
|
||||
"title":"",
|
||||
"body":"",
|
||||
"subject":"",
|
||||
"email":"",
|
||||
"template":"_email_alert",
|
||||
"from":"no-reply",
|
||||
"image": "",
|
||||
"footer":""
|
||||
},
|
||||
}
|
||||
},
|
||||
"short_description": "",
|
||||
"reference_num": "sub_239874234",
|
||||
"articles": [
|
||||
@@ -2417,27 +2402,7 @@ GLOBAL_SETTINGS.SUBSCRIBER = [
|
||||
"title":"My 1 Post",
|
||||
"reference_num":"sub_897345jgd",
|
||||
"type":"email",
|
||||
"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":""
|
||||
},
|
||||
"delivered":false
|
||||
}
|
||||
],
|
||||
"subscribers":[]
|
||||
@@ -2450,15 +2415,12 @@ GLOBAL_SETTINGS.SUBSCRIBER_CATALOG = [
|
||||
json: {
|
||||
"mysql_id":-1,
|
||||
"category":"subscriber_catalog",
|
||||
"title": "",
|
||||
"reference_num": "",
|
||||
"nameid":"default",
|
||||
"release_type": false,
|
||||
"description": "",
|
||||
"short_description": "",
|
||||
"mail_handlers": {
|
||||
"email_response":{},
|
||||
"email_alert":{}
|
||||
},
|
||||
"subscribers":[]
|
||||
"short_description": ""
|
||||
}
|
||||
}
|
||||
];
|
||||
@@ -2468,11 +2430,7 @@ GLOBAL_SETTINGS.SUBSCRIBER_ARTICLES = [
|
||||
json: {
|
||||
"category":"catalog_article",
|
||||
"delivery_type": "email",
|
||||
"deliveries": [],
|
||||
"mail_handlers": {
|
||||
"email_delivery": {},
|
||||
"link_delivery": {}
|
||||
}
|
||||
"deliveries": []
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
@@ -43,13 +43,13 @@
|
||||
}, function(obj){
|
||||
obj = JSON.parse(obj);
|
||||
|
||||
console.log(obj);
|
||||
// console.log(obj);
|
||||
tmpConfig.root.member = obj.member;
|
||||
// tmpConfig.root.access = obj.results.access;
|
||||
tmpConfig.root.config = obj.config;
|
||||
tmpConfig.root.tenant = obj.tenant;
|
||||
|
||||
console.log(obj);
|
||||
// console.log(obj);
|
||||
resolve(obj);
|
||||
})
|
||||
}),
|
||||
@@ -207,7 +207,7 @@
|
||||
|
||||
|
||||
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.email_builder = tmpConfig.config.email_builder;
|
||||
|
||||
@@ -858,11 +858,11 @@ define([
|
||||
|
||||
// settings
|
||||
app.extra.views.subscriber.newSubView({
|
||||
id: "settings",
|
||||
id: "catalog_settings",
|
||||
init: false,
|
||||
body: app.extra.config.html.subscriber_settings,
|
||||
listener: function(){
|
||||
imp_subscriber.init_settings(app);
|
||||
imp_subscriber.init_catalog_settings(app);
|
||||
}
|
||||
});
|
||||
// manage_email
|
||||
@@ -871,7 +871,7 @@ define([
|
||||
init: false,
|
||||
body: app.extra.config.html.subscriber_email_container,
|
||||
listener: function(){
|
||||
imp_subscriber.init_email(app);
|
||||
imp_subscriber.init_settings_email(app);
|
||||
}
|
||||
});
|
||||
// article_editor
|
||||
|
||||
@@ -89,7 +89,7 @@ function init_settings(app){
|
||||
function init_settings_email(app){
|
||||
_init_settings_email(app);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function init_submissions(app){
|
||||
_init_submissions(app,this);
|
||||
@@ -253,6 +253,7 @@ function _init_form_submissions(app){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function _init_init_submission(app,self){
|
||||
$("#back_to_forms_init").on("click",function(e){
|
||||
e.preventDefault();
|
||||
@@ -306,7 +307,7 @@ function _init_init_submission(app,self){
|
||||
}
|
||||
|
||||
}else{
|
||||
// console.log(sub);
|
||||
console.log(sub);
|
||||
if(typeof sub.answer === "string"){
|
||||
if(sub.answer.includes("data:image")){
|
||||
answer = `<img src="${sub.answer}" />`;
|
||||
@@ -318,7 +319,8 @@ function _init_init_submission(app,self){
|
||||
// console.log(sub.answer)
|
||||
for (let n = 0; n < sub.answer.length; n++) {
|
||||
const ans = sub.answer[n];
|
||||
|
||||
|
||||
console.log(ans);
|
||||
if(typeof ans === "object"){
|
||||
// file
|
||||
if(ans.name!=undefined && ans.type!=undefined && ans.content!=undefined){
|
||||
@@ -329,7 +331,7 @@ function _init_init_submission(app,self){
|
||||
}
|
||||
|
||||
}else{
|
||||
answer += `${ans.name}<br>`;
|
||||
answer += `${ans}<br>`;
|
||||
}
|
||||
}
|
||||
}else if(typeof sub.answer === "object"){
|
||||
@@ -341,10 +343,6 @@ function _init_init_submission(app,self){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let question_html = __make_label(sub.question,answer);
|
||||
|
||||
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 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
|
||||
$("#manage_email_construction_id").on("click",function(e){
|
||||
@@ -2071,14 +2069,11 @@ function _init_settings_email(app){
|
||||
AFSSpinner.showFullScreen(true);
|
||||
if(handlers!=undefined && handlers!=null){
|
||||
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);
|
||||
console.log(resp);
|
||||
// console.log(app.extra.config.configurations.access[index])
|
||||
// app.extra.extras.SaveConfiguration(app.extra.config.configurations.access[index].json, app, function(resp){
|
||||
// console.log(resp);
|
||||
// });
|
||||
});
|
||||
app.extra.mail_handlers.forms = subs;
|
||||
},app.extra.mail_handlers.forms);
|
||||
}
|
||||
},function(emailobj){
|
||||
// console.log(emailobj);
|
||||
|
||||
@@ -4,19 +4,36 @@ define([
|
||||
function(bootstrap){
|
||||
|
||||
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);
|
||||
setTimeout(() => { AFSSpinner.showFullScreen(false); },35000);
|
||||
app.extra.extras.RequestCatalogs(100,function(catalogs){
|
||||
app.extra.extras.RequestDocuments(100,function(documents){
|
||||
if(app.extra.documents==undefined){ app.extra.documents = documents; }
|
||||
if(app.extra.catalogs==undefined){ app.extra.catalogs = catalogs; }
|
||||
app.extra.catalogs = app.extra.extras.UpdateConfigurationsObject(
|
||||
app.extra.catalogs,
|
||||
app.extra.config.configurations.subscriber_catalog[0].json,
|
||||
app);
|
||||
app.extra.extras.RequestMailHandlers(100,function(mail_handlers){
|
||||
if(app.extra.documents==undefined){ app.extra.documents = documents; }
|
||||
if(app.extra.catalogs==undefined){ app.extra.catalogs = catalogs; }
|
||||
app.extra.catalogs = app.extra.extras.UpdateConfigurationsObject(
|
||||
app.extra.catalogs,
|
||||
app.extra.config.configurations.subscriber_catalog[0].json,
|
||||
app);
|
||||
|
||||
AFSSpinner.showFullScreen(false);
|
||||
_init(app);
|
||||
console.log(mail_handlers);
|
||||
|
||||
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.catalogs,true,app);
|
||||
}
|
||||
@@ -28,9 +45,7 @@ define([
|
||||
let reference_num = app.extra.current.subscriber.catalog.reference_num;
|
||||
AFSSpinner.showFullScreen(true);
|
||||
setTimeout(() => { AFSSpinner.showFullScreen(false); },35000);
|
||||
if(app.extra.subscribers==undefined){
|
||||
app.extra.subscribers = [];
|
||||
}
|
||||
|
||||
if(app.extra.catalog_articles==undefined){
|
||||
app.extra.catalog_articles = {};
|
||||
}
|
||||
@@ -113,7 +128,7 @@ define([
|
||||
e.preventDefault();
|
||||
AFSSpinner.showFullScreen(true);
|
||||
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==""){
|
||||
alert("Please provide catalog name");
|
||||
return;
|
||||
@@ -122,23 +137,24 @@ define([
|
||||
[app.extra.config.configurations.subscriber_catalog[0]],
|
||||
app.extra.config.configurations.subscriber_catalog[0].json,
|
||||
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 = {
|
||||
"admin_subscriber_create_catalog": true,
|
||||
"title": display_name,
|
||||
"reference_num": "c"+app.utils.numberId(12),
|
||||
"reference_num": ref_num,
|
||||
"json": JSON.stringify(newCatalogJson[0].json),
|
||||
};
|
||||
// __append_catalogs_list(app);
|
||||
$("#create_new_catalog_name").val("");
|
||||
$.post(app.extra.url, data, function(resp){
|
||||
resp = JSON.parse(resp);
|
||||
|
||||
console.log(resp);
|
||||
app.extra.catalogs.push(resp);
|
||||
// console.log(app.extra.catalogs);
|
||||
__append_catalogs_list(app);
|
||||
AFSSpinner.showFullScreen(false);
|
||||
modal.toggle();
|
||||
@@ -161,16 +177,23 @@ define([
|
||||
e.preventDefault();
|
||||
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){
|
||||
_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){
|
||||
_init_article_editor2(app)
|
||||
@@ -178,14 +201,10 @@ define([
|
||||
function init_configure_catalogs(app){
|
||||
_init_configure_catalogs(app);
|
||||
}
|
||||
function init_settings(app){
|
||||
_init_settings(app);
|
||||
}
|
||||
function init_email(app){
|
||||
_init_email(app);
|
||||
function init_catalog_settings(app){
|
||||
_init_catalog_settings(app);
|
||||
}
|
||||
function init_manage_subscriber(app){
|
||||
StopEditorInterval(app);
|
||||
_init_manage_subscriber(app);
|
||||
}
|
||||
function init_article_editor(app){
|
||||
@@ -196,7 +215,7 @@ define([
|
||||
function _init_catalog_overview(app){
|
||||
function isSubscriberActiveForCurrentCatalog(subscriber,app){
|
||||
let isActive = false;
|
||||
console.log(subscriber);
|
||||
// console.log(subscriber);
|
||||
for (let v = 0; v < subscriber.json.catalogs.length; v++) {
|
||||
if(subscriber.json.catalogs[v].reference_num == app.extra.current.subscriber.catalog.reference_num){
|
||||
isActive = subscriber.json.catalogs[v].active;
|
||||
@@ -243,7 +262,7 @@ define([
|
||||
app.extra.current.subscriber.ids = ids;
|
||||
for (let m = 0; m < ids.length; 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){
|
||||
let is_checked = document.getElementById(element.id).checked;
|
||||
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);
|
||||
$("#catalog_title").append(app.extra.current.subscriber.catalog.json.display_name);
|
||||
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 listHtml = "";
|
||||
let ids = [];
|
||||
@@ -312,7 +331,7 @@ define([
|
||||
e.preventDefault();
|
||||
console.log(ids[i]);
|
||||
// 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;}
|
||||
|
||||
UpdateCatagoryArticle(app,ids[i].article_config.reference_num,{title: newtitle});
|
||||
@@ -380,7 +399,7 @@ define([
|
||||
$("#submit_new_article_name").on("click",function(e){
|
||||
AFSSpinner.showFullScreen(true);
|
||||
e.preventDefault();
|
||||
let article_name = $("#article_name").val();
|
||||
let article_name = $("#article_name").val().trim();
|
||||
if(article_name==""){
|
||||
alert("Please enter an article name.");
|
||||
return;
|
||||
@@ -400,7 +419,7 @@ define([
|
||||
__append_articles_list(app);
|
||||
setTimeout(() => { AFSSpinner.showFullScreen(false); },3000);
|
||||
|
||||
// ppppp
|
||||
|
||||
CreateArticle(newArticleConfig,app,function(article){
|
||||
app.extra.catalog_articles[app.extra.current.subscriber.catalog.reference_num].push(article);
|
||||
__append_articles_list(app);
|
||||
@@ -475,14 +494,18 @@ define([
|
||||
e.preventDefault();
|
||||
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").on("click",function(e){
|
||||
e.preventDefault();
|
||||
AFSSpinner.showFullScreen(true);
|
||||
let _display_name = $("#update_new_catalog_name").val();
|
||||
let _short_desc = $("#update_new_catalog_short_description").val();
|
||||
let _description = $("#update_new_catalog_description").val();
|
||||
let _display_name = $("#update_new_catalog_name").val().trim();
|
||||
let _short_desc = $("#update_new_catalog_short_description").val().trim();
|
||||
let _description = $("#update_new_catalog_description").val().trim();
|
||||
|
||||
if(_display_name==""){
|
||||
alert("Display name cannot be empty");
|
||||
@@ -503,7 +526,73 @@ define([
|
||||
});
|
||||
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){
|
||||
goBack(app);
|
||||
|
||||
|
||||
function _TableRowHtml(title,ref,id){
|
||||
return `
|
||||
<tr>
|
||||
<td>${title}</td>
|
||||
<td><a id="${id}" href="#">Edit</a></td>
|
||||
</tr>
|
||||
`;
|
||||
return `
|
||||
<tr>
|
||||
<td>${title}</td>
|
||||
<td><a id="${id}" href="#">Edit</a></td>
|
||||
</tr>
|
||||
`;
|
||||
}
|
||||
function _TableHtml(content){
|
||||
return `
|
||||
@@ -543,12 +633,8 @@ define([
|
||||
let ids = [];
|
||||
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
|
||||
// console.log(app.extra.subscribers);
|
||||
for (let i = 0; i < app.extra.subscribers.length; i++) {
|
||||
const subscriber = app.extra.subscribers[i];
|
||||
// CleanAndValidateSubscriberList(i,app);
|
||||
@@ -557,7 +643,7 @@ define([
|
||||
table += _TableRowHtml(subscriber.email,"",id);
|
||||
}
|
||||
|
||||
console.log(table);
|
||||
// console.log(table);
|
||||
|
||||
$("#subscriber_list_container").empty();
|
||||
$("#subscriber_list_container").append(_TableHtml(table));
|
||||
@@ -571,86 +657,100 @@ define([
|
||||
});
|
||||
}
|
||||
|
||||
// ppppp
|
||||
$("#add_subscriber_btn").on("click",function(e){
|
||||
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==""){
|
||||
|
||||
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){
|
||||
let selected_email = app.extra.current.subscriber.selected_subscriber.obj.email;
|
||||
let obj = manage_build_sub(selected_email,app);
|
||||
let ids = obj.ids;
|
||||
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);
|
||||
let selected_email = app.extra.current.subscriber.selected_subscriber.obj.email;
|
||||
let obj = manage_build_sub(selected_email,app);
|
||||
let ids = obj.ids;
|
||||
let html = obj.html;
|
||||
|
||||
|
||||
$("#subscriber_main_header").text(selected_email);
|
||||
console.log(app.extra.current.subscriber.selected_subscriber);
|
||||
|
||||
$("#update_subscriber_subscriptions").on("click",function(e){
|
||||
e.preventDefault();
|
||||
AFSSpinner.showFullScreen(true);
|
||||
$("#update_subscriber_subscriptions").prop("disabled",true);
|
||||
setTimeout(() => {
|
||||
$("#update_subscriber_subscriptions").prop("disabled",false);
|
||||
AFSSpinner.showFullScreen(false);
|
||||
},25000);
|
||||
$("#back_to_init").on("click",function(e){
|
||||
e.preventDefault();
|
||||
app.extra.views.subscriber.render("manage");
|
||||
});
|
||||
|
||||
for (let n = 0; n < app.extra.config.configurations.subscriber.length; n++) {
|
||||
const catalog = app.extra.config.configurations.subscriber[n].json;
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
const element = ids[i];
|
||||
if(element.obj.catalog_ref==catalog.reference_num){
|
||||
for (let v = 0; v < catalog.subscribers.length; v++) {
|
||||
const sub = catalog.subscribers[v];
|
||||
if(sub.email==selected_email){
|
||||
let radioValue = $("input[id='"+element.id+"']:checked").val();
|
||||
if(radioValue!=undefined && radioValue=="on"){
|
||||
app.extra.config.configurations.subscriber[n].json.subscribers[v].active = true;
|
||||
}else{
|
||||
app.extra.config.configurations.subscriber[n].json.subscribers[v].active = false;
|
||||
}
|
||||
console.log(app.extra.config.configurations.subscriber[n]);
|
||||
$("#subscriber_container_data").empty();
|
||||
$("#subscriber_container_data").append(html);
|
||||
$("#subscriber_main_header").text(selected_email);
|
||||
|
||||
$("#update_subscriber_subscriptions").on("click",function(e){
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
const element = ids[i];
|
||||
let radioValue = $("input[id='"+element.id+"']:checked").val();
|
||||
let ischecked = false;
|
||||
if(radioValue!=undefined && radioValue=="on"){
|
||||
ischecked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(app.extra.current.subscriber.selected_subscriber.obj);
|
||||
|
||||
for (let n = 0; n < app.extra.config.configurations.subscriber.length; n++) {
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// console.log(element);
|
||||
|
||||
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){
|
||||
@@ -675,7 +775,7 @@ define([
|
||||
$("#from_email_select").val(app.extra.current.subscriber.article.data.email.from);
|
||||
$("#from_email_select").on("change",function(e){
|
||||
// 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;
|
||||
cata = app.extra.instances.subscriber.setGlobalConfig("from_email",email_from,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){
|
||||
@@ -870,7 +906,7 @@ define([
|
||||
$("#delivery_from_email_select").append(options_html);
|
||||
$("#delivery_from_email_select").on("change",function(e){
|
||||
// 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;
|
||||
});
|
||||
}
|
||||
@@ -883,7 +919,7 @@ define([
|
||||
|
||||
$("#article_name").on("focusout",function(e){
|
||||
// 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);
|
||||
app.extra.current.subscriber.article.data.email.subject = email_subject;
|
||||
});
|
||||
@@ -1284,7 +1320,6 @@ define([
|
||||
"value": subscriber.name
|
||||
},
|
||||
{
|
||||
// ppppp
|
||||
"name": "unsubscribe",
|
||||
"value": app.extra.config.managed_domain.Address +
|
||||
`/mod/sub/subprefs.php?reference_num=${subscriber.email}&email=${subscriber.email}`
|
||||
@@ -1630,7 +1665,6 @@ define([
|
||||
});
|
||||
}
|
||||
function CreateArticle(newArticleConfig,app,cb){
|
||||
// ppppp
|
||||
AFSSpinner.showFullScreen(true);
|
||||
setTimeout(() => {AFSSpinner.showFullScreen(false);},35000);
|
||||
let send = {
|
||||
@@ -1647,7 +1681,7 @@ define([
|
||||
});
|
||||
}
|
||||
function SaveArticle(article,app,cb){
|
||||
// ppppp
|
||||
|
||||
AFSSpinner.showFullScreen(true);
|
||||
setTimeout(() => {AFSSpinner.showFullScreen(false);},35000);
|
||||
let send = {
|
||||
@@ -1844,18 +1878,18 @@ define([
|
||||
return catalog;
|
||||
}
|
||||
|
||||
}
|
||||
function ListCreateLI(id,content){
|
||||
return `
|
||||
<li class="list-group-item list-group-item-action">
|
||||
<a id="${id}" href="#">${content}</a>
|
||||
</li>
|
||||
`;
|
||||
}
|
||||
function ListCreateUL(id,content){
|
||||
return `<ul class="list-group list-group-flush" id="${id}">${content}</ul>`;
|
||||
}
|
||||
function TableRowHtml(title,ref,id){
|
||||
}
|
||||
function ListCreateLI(id,content){
|
||||
return `
|
||||
<li class="list-group-item list-group-item-action">
|
||||
<a id="${id}" href="#">${content}</a>
|
||||
</li>
|
||||
`;
|
||||
}
|
||||
function ListCreateUL(id,content){
|
||||
return `<ul class="list-group list-group-flush" id="${id}">${content}</ul>`;
|
||||
}
|
||||
function TableRowHtml(title,ref,id){
|
||||
return `
|
||||
<tr>
|
||||
<td>${title}</td>
|
||||
@@ -1863,8 +1897,8 @@ define([
|
||||
<td><a id="${id}" href="#">Edit</a></td>
|
||||
</tr>
|
||||
`;
|
||||
}
|
||||
function TableHtml(content){
|
||||
}
|
||||
function TableHtml(content){
|
||||
return `
|
||||
|
||||
<div class="table-responsive">
|
||||
@@ -1909,57 +1943,44 @@ define([
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
// ppppp
|
||||
let ids = [];
|
||||
let subscribers_list = [];
|
||||
let items = "";
|
||||
for (let i = 0; i < app.extra.config.configurations.subscriber.length; i++) {
|
||||
const catalog = app.extra.config.configurations.subscriber[i].json;
|
||||
let found = false;
|
||||
let inputid = "m"+app.utils.randomGenerator(12);
|
||||
let checked = "";
|
||||
let _sub = null;
|
||||
let duplicates = [];
|
||||
for (let n = 0; n < catalog.subscribers.length; n++) {
|
||||
const sub = catalog.subscribers[n];
|
||||
if(sub.email==selected_email){
|
||||
if(found){
|
||||
duplicates.push(n);
|
||||
continue;
|
||||
}
|
||||
found = true;
|
||||
sub.catalog_ref = catalog.reference_num;
|
||||
sub.catalog_display_name = catalog.display_name;
|
||||
let title = catalog.display_name;
|
||||
subscribers_list.push(sub);
|
||||
if(sub.active==true){
|
||||
checked = "checked";
|
||||
}
|
||||
items += item_html(title,inputid,checked);
|
||||
ids.push({id:inputid,obj:sub,index:n});
|
||||
let subscribers_catalogs = [];
|
||||
const sub_catalogs = app.extra.current.subscriber.selected_subscriber.obj.json.catalogs;
|
||||
for (let i = 0; i < app.extra.catalogs.length; i++) {
|
||||
const catalog = app.extra.catalogs[i];
|
||||
let found = false;
|
||||
let inputid = "m"+app.utils.randomGenerator(12);
|
||||
let isChecked = false;
|
||||
let checked = "";
|
||||
let current_sub = {};
|
||||
let title = catalog.title;
|
||||
for (let n = 0; n < sub_catalogs.length; n++) {
|
||||
const sub_catalog = sub_catalogs[n];
|
||||
if(catalog.json.reference_num==sub_catalog.reference_num){
|
||||
found = true;
|
||||
current_sub = catalog;
|
||||
}
|
||||
if(catalog.json.reference_num==sub_catalog.reference_num && sub_catalog.active==true){
|
||||
isChecked = true;
|
||||
checked = "checked";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(found==false){
|
||||
let sub = {
|
||||
name:'',
|
||||
email:selected_email,
|
||||
active:false,
|
||||
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);
|
||||
}
|
||||
|
||||
items += item_html(title,inputid,checked);
|
||||
ids.push({
|
||||
id:inputid,
|
||||
catalog: catalog,
|
||||
index:i
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
let html = items_html(items);
|
||||
return {ids,html};
|
||||
}
|
||||
@@ -2105,9 +2126,9 @@ define([
|
||||
init_manage:init_mangage,
|
||||
init_manage_subscriber:init_manage_subscriber,
|
||||
init_configure_catalogs:init_configure_catalogs,
|
||||
init_settings:init_settings,
|
||||
init_email:init_email,
|
||||
init_article_editor2:init_article_editor2
|
||||
init_catalog_settings:init_catalog_settings,
|
||||
init_article_editor2:init_article_editor2,
|
||||
init_settings_email:init_settings_email
|
||||
}
|
||||
});// !!!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);
|
||||
|
||||
$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'");
|
||||
$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"];
|
||||
|
||||
@@ -17,7 +17,6 @@ class StripeModule {
|
||||
|
||||
public function __construct() { }
|
||||
|
||||
// rrrrr
|
||||
function GetStripe($client_secret,$manage_domain){
|
||||
\Stripe\Stripe::setAppInfo(
|
||||
"stripe_processor",
|
||||
@@ -35,10 +34,16 @@ class StripeModule {
|
||||
function init(){
|
||||
$content = rawurldecode(trim(@file_get_contents("php://input")));
|
||||
$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";
|
||||
$configuration = get_configuration_obj("processors");
|
||||
$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
|
||||
$processor = DirectPaymentsSelectProcessor($one, $configuration);
|
||||
$manage_domain = GetManagedDomain();
|
||||
@@ -202,6 +207,8 @@ class StripeModule {
|
||||
|
||||
\Stripe\Stripe::setApiKey($data["processor"]['json']['client_secret']);
|
||||
|
||||
|
||||
// rrrrr
|
||||
$objects = [];
|
||||
$customer = null;
|
||||
$paymentIntent = null;
|
||||
@@ -214,6 +221,7 @@ class StripeModule {
|
||||
|
||||
$product_id = $data["data"]["product_id"];
|
||||
$customer_address = $data["data"]["address"];
|
||||
$amount = $data["data"]["amount"];
|
||||
|
||||
// Create a Tax Calculation
|
||||
try {
|
||||
@@ -224,7 +232,7 @@ class StripeModule {
|
||||
'address_source' => 'billing',
|
||||
],
|
||||
'line_items' => [[
|
||||
'amount' => (int)$data["data"]["amount"], //1000, // $10.00
|
||||
'amount' => (int)$amount, //1000, // $10.00
|
||||
'reference' => 'L1', // Unique identifier for the line item
|
||||
'product' => $product_id,
|
||||
// 'tax_code' => 'txcd_99999999', // 'General merchandise' tax code
|
||||
@@ -238,45 +246,13 @@ class StripeModule {
|
||||
// $total_inclusive_tax = $calculation->tax_amount_inclusive;
|
||||
// $total_amount_before_tax = $calculation->amount_total - $total_inclusive_tax;
|
||||
// $total_amount = $calculation->amount_total;
|
||||
|
||||
|
||||
EchoJsonObject([
|
||||
"customer" => $customer,
|
||||
"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) {
|
||||
EchoJsonObject([
|
||||
@@ -289,14 +265,6 @@ class StripeModule {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function create_subscription(){
|
||||
@@ -471,6 +439,7 @@ class StripeModule {
|
||||
// Create a new customer object
|
||||
$customer = $stripe->customers->create();
|
||||
|
||||
// rrrrr
|
||||
try {
|
||||
|
||||
$promotionCodes = $stripe->promotionCodes->all([
|
||||
@@ -676,11 +645,13 @@ class StripeModule {
|
||||
* @return void
|
||||
*/
|
||||
private function _record_tax($stripe){
|
||||
$transaction = $stripe->tax->transactions->createFromCalculation([
|
||||
'calculation' => '{{TAX_CALCULATION}}',
|
||||
'reference' => '{{PAYMENT_INTENT_ID}}',
|
||||
'expand' => ['line_items']
|
||||
]);
|
||||
$this->handleExceptions(function() use ($stripe) {
|
||||
$transaction = $stripe->tax->transactions->createFromCalculation([
|
||||
'calculation' => '{{TAX_CALCULATION}}',
|
||||
'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
|
||||
public function webhook(){
|
||||
@@ -920,7 +953,7 @@ class StripeModule {
|
||||
// Unhandled event type
|
||||
}
|
||||
|
||||
} catch(\UnexpectedValueException $e) {
|
||||
} catch(\Stripe\Exception\UnexpectedValueException $e) {
|
||||
// Invalid payload
|
||||
http_response_code(400);
|
||||
Utils_WriteFileJson($this->LOG_FILE,['Error parsing payload: ' => $e->getMessage()],"a");
|
||||
@@ -930,6 +963,35 @@ class StripeModule {
|
||||
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);
|
||||
@@ -1196,7 +1258,7 @@ class StripeModule {
|
||||
$managed_domain = $json["managed_domain"];
|
||||
$config1 = $json["config"];
|
||||
$handler = $json["mail_handlers"];
|
||||
$member = $json["member"];
|
||||
$member = $json["member"];
|
||||
|
||||
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
|
||||
// can find the endpoint's secret by running `stripe listen`
|
||||
// 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
|
||||
|
||||
|
||||
|
||||
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
@@ -70,9 +70,9 @@ function sendmessagetome(){
|
||||
|
||||
function InitMemberUserAuthObject($type = "mysql"){
|
||||
// \ini_set('session.cookie_domain', 'appfactory.studio');
|
||||
if(session_status() !== PHP_SESSION_ACTIVE){
|
||||
\ini_set('session.cookie_path', '/members');
|
||||
}
|
||||
// if(session_status() !== PHP_SESSION_ACTIVE){
|
||||
// \ini_set('session.cookie_path', '/members');
|
||||
// }
|
||||
|
||||
$username = $GLOBALS['config'][$type]["username"];
|
||||
$password = $GLOBALS['config'][$type]["password"];
|
||||
@@ -483,7 +483,6 @@ function EchoJsonObject($object){
|
||||
echo json_encode($object);
|
||||
}
|
||||
function RunCommand($shParams,$managed_domain,$cb=null,$isOutput=false){
|
||||
// ppppp
|
||||
$basefolder = "/home/" . $managed_domain["SystemUser"] . "/websites/" . $managed_domain["Subdomain"] . "/portal/admin/core/scripts";
|
||||
$shCmd = $basefolder . "/commands.sh";
|
||||
$cmd = $basefolder . "/bin/afs-website \"" . $shCmd . " " . $shParams . "\"";
|
||||
@@ -590,15 +589,20 @@ function get_membership_from_brain_controller(){
|
||||
'content' => http_build_query($obj)
|
||||
]
|
||||
];
|
||||
$tenants = [];
|
||||
$tenants = [];
|
||||
$context = stream_context_create($options);
|
||||
$result = file_get_contents($requestUrl, false, $context);
|
||||
if ($result === FALSE) {
|
||||
$result = ["status" => "failure"];
|
||||
}else{
|
||||
$result = json_decode($result,true);
|
||||
$result["member"]["domain"] = $domain;
|
||||
$result["member"]["json_data"] = json_decode(html_entity_decode($result["member"]["json_data"]), true);
|
||||
// $result["member"]["domain"] = $domain;
|
||||
|
||||
//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++) {
|
||||
$tenants[$i] = $result["tenants"][$i];
|
||||
// $tenants[$i]["json"] = json_decode(html_entity_decode($tenants[$i]["json"]), true);
|
||||
@@ -646,7 +650,8 @@ function get_membership_from_brain_controller(){
|
||||
"tenant" => $tenant,
|
||||
"member" => $result["member"],
|
||||
"url" => $requestUrl,
|
||||
"result" => $result
|
||||
"result" => $result,
|
||||
"domain" => $domain
|
||||
// "createdby" => $createdby,
|
||||
// "domain" => $domain,
|
||||
// "override" => $override,
|
||||
@@ -1490,7 +1495,7 @@ function SendEmailBuilder($handler,$integration,$config,$domain,$cb=null){
|
||||
|
||||
|
||||
$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
|
||||
if($form_data!=null &&
|
||||
@@ -1530,55 +1535,43 @@ function SendEmailBuilder($handler,$integration,$config,$domain,$cb=null){
|
||||
$from = $form_data["from"];
|
||||
|
||||
// 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"];
|
||||
|
||||
//
|
||||
$form_data["variables"]["schema"] = [$form_data["variables"]["schema"]];
|
||||
try {
|
||||
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/assets/social_icons/facebook_733547.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/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/instagram_174855.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
|
||||
// Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/tailfile303.json",$form_data["variables"]);
|
||||
if($form_data["variables"]["schema"][$index_count]!=null){
|
||||
for($n=0; $n < count($form_data["variables"]["schema"][$index_count]); $n++){
|
||||
$var = $form_data["variables"]["schema"][$index_count][$n];
|
||||
$value = "";
|
||||
if($var!=null){
|
||||
Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/_tailfile.json",$var);
|
||||
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);
|
||||
// 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"]);
|
||||
if($form_data["variables"]["schema"][$index_count]!=null){
|
||||
for($n=0; $n < count($form_data["variables"]["schema"][$index_count]); $n++){
|
||||
$var = $form_data["variables"]["schema"][$index_count][$n];
|
||||
$value = "";
|
||||
if($var!=null){
|
||||
// Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/_tailfile.json",$var);
|
||||
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("client",$form_data["variables"])){
|
||||
for($n=0; $n < count($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];
|
||||
if(array_key_exists("client",$form_data["variables"])){
|
||||
for($n=0; $n < count($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"];}
|
||||
@@ -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);
|
||||
@@ -1597,7 +1609,7 @@ function SendEmailBuilder($handler,$integration,$config,$domain,$cb=null){
|
||||
$html = str_replace(" ", "", $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"){
|
||||
$mydata = [];
|
||||
$mydata["subject"] = $subject;
|
||||
@@ -1608,7 +1620,7 @@ function SendEmailBuilder($handler,$integration,$config,$domain,$cb=null){
|
||||
$mydata["html"] = $html;
|
||||
$mydata["sendgrid_key"] = $integration["secret"];//"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";
|
||||
_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"){
|
||||
$mailobj = [
|
||||
@@ -1679,26 +1691,12 @@ function admin_email_test_send_email(){
|
||||
|
||||
$data["variables"]["client"] = [[["name" => "_testing_", "value" => "_name_"]]];
|
||||
// $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);
|
||||
SendEmailBuilder($data,$integration, $config, $managed_domain,function($resp)use ($data){
|
||||
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){
|
||||
// ppppp
|
||||
$to = $data['to'];
|
||||
$from = $data['from'];
|
||||
$subject = $data['subject'];
|
||||
@@ -2531,6 +2528,7 @@ function DirectPaymentsSelectProcessor($obj,$configuration){
|
||||
|
||||
$processor = null;
|
||||
for ($i=0; $i < count($processors); $i++) {
|
||||
// Utils_WriteFileJson("/mnt/node1/appfactorystudio/tmp/afile$i.json", $processors[$i]);
|
||||
$nameid = $processors[$i]["json"]["nameid"];
|
||||
if($obj["type"]==0){
|
||||
if($nameid==$obj["json"]["configuration"]["payables"]["processor"]){
|
||||
@@ -4160,7 +4158,7 @@ function create_new_member($auth){
|
||||
"firstname" => $member["firstname"],
|
||||
"lastname" => $member["lastname"],
|
||||
"email" => $member["email"],
|
||||
"family" => $member["family"],
|
||||
"family" => 1, //$member["family"],
|
||||
"level" => $member["level"],
|
||||
"membership" => $member["membership"],
|
||||
"password" => $member["password"],
|
||||
@@ -4408,7 +4406,7 @@ function member_createERPNextCustomer($userId,$member){
|
||||
'cust_name' => $member["firstname"],
|
||||
'cust_type' => 'Individual',
|
||||
'cust_group' => 'Individual',
|
||||
'territory' => $member["country"],
|
||||
'territory' => $member["country_code"],
|
||||
'default_currency' => 'USD',
|
||||
'email_id' => $member["email"],
|
||||
'address_title' => 'Main',
|
||||
@@ -4417,7 +4415,7 @@ function member_createERPNextCustomer($userId,$member){
|
||||
'address_line2' => '',
|
||||
'city' => $member["city"],
|
||||
'state' => $member["state"],
|
||||
'country' => $member["country"],
|
||||
'country' => $member["country_name"],
|
||||
'pincode' => $member["zip_code"]],
|
||||
CURLOPT_HTTPHEADER => [
|
||||
'Authorization: Token c49c62746224379:2f52f3438cfe883',
|
||||
@@ -4996,12 +4994,12 @@ function apicall_stripe_create_subscription($decoded){
|
||||
|
||||
function webhookStripeHandlePaymentIntentSucceeded($event){
|
||||
$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]);
|
||||
}
|
||||
function webhookStripeHandlePaymentMethodAttached($event){
|
||||
$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]);
|
||||
}
|
||||
function webhookStripeHandlePaymentSucceeded($event){
|
||||
@@ -6744,7 +6742,7 @@ function get_admin_user($auth){
|
||||
$user = $result->fetch_assoc();
|
||||
unset($user["password_hash"]);
|
||||
$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]);
|
||||
}
|
||||
|
||||
@@ -7161,25 +7159,13 @@ function admin_subscriber_get_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(){
|
||||
$token = Input::get("token");
|
||||
if(CheckClientToken($token)==false){
|
||||
EchoJsonResponse("request_failure");
|
||||
return;
|
||||
}
|
||||
// if(CheckClientToken($token)==false){
|
||||
// EchoJsonResponse("request_failure");
|
||||
// return;
|
||||
// }
|
||||
|
||||
$catalogs = [];
|
||||
$db = new DB();
|
||||
@@ -7195,23 +7181,54 @@ function client_subscriber_get_catalogs(){
|
||||
|
||||
EchoJsonObject(["catalogs" => $catalogs]);
|
||||
}
|
||||
|
||||
|
||||
// ppppp
|
||||
function client_subscriber_add_subscriber(){
|
||||
$token = Input::get("token");
|
||||
if(CheckClientToken($token)==false){
|
||||
EchoJsonResponse("request_failure");
|
||||
return;
|
||||
function admin_subscriber_update_subscriber(){
|
||||
$subscriber = json_decode(Input::get("subscriber"), true);
|
||||
$email = $subscriber["email"];
|
||||
$db = new DB();
|
||||
$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();
|
||||
$managed_domain = $config_domain["managed_domain"];
|
||||
$config = $config_domain["configurations"];
|
||||
$settings = $config["settings"][0]["json"];
|
||||
|
||||
$sendresponse = Input::get("sendresponse");
|
||||
$subscriber = json_decode(Input::get("subscriber"), true);
|
||||
$response = json_decode(Input::get("response"), true);
|
||||
$payload = json_decode(@file_get_contents('php://input'), true);
|
||||
$sendresponse = $payload["data"]["sendresponse"];
|
||||
$subscriber = $payload["data"]["subscriber"];
|
||||
$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();
|
||||
$rows = $db->query("SELECT * FROM subscribers WHERE email='$email'",[],PDO::FETCH_ASSOC);
|
||||
if($rows->count() > 0){
|
||||
@@ -7240,13 +7257,13 @@ function client_subscriber_add_subscriber(){
|
||||
]);
|
||||
}
|
||||
$db = null;
|
||||
if($sendresponse==true || $sendresponse=="true"){
|
||||
SendEmailBuilder($response,$managed_domain,function($resp){
|
||||
// EchoJsonObject(["data" => $resp]);
|
||||
});
|
||||
}
|
||||
// if($sendresponse==true || $sendresponse=="true"){
|
||||
// SendEmailBuilder($response,$managed_domain,function($resp){
|
||||
// // EchoJsonObject(["data" => $resp]);
|
||||
// });
|
||||
// }
|
||||
|
||||
EchoJsonResponse();
|
||||
EchoJsonObject($payload);
|
||||
|
||||
|
||||
}
|
||||
@@ -7803,7 +7820,7 @@ function submit_form(){
|
||||
$reference_num = Input::get("reference_num");
|
||||
$form_json = json_decode(Input::get("form_json"),true);
|
||||
$submission_json = json_decode(Input::get("submission_json"),true);
|
||||
|
||||
$client_variables = json_decode(Input::get('client_variables'),true);
|
||||
|
||||
$db = new DB();
|
||||
$db->insert("form_submissions", array(
|
||||
@@ -7824,6 +7841,23 @@ function submit_form(){
|
||||
$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["json"]["email_alert"]["_output_html"] = "forms/alert_" . $time . ".html";
|
||||
// SendEmail($form_json["json"]["email_alert"],$managed_domain,function($message){
|
||||
@@ -10321,7 +10355,7 @@ function SetupEmailSystemVariables($integration, $config, $handler, $managed_dom
|
||||
|
||||
$logo1 = "";
|
||||
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, [
|
||||
"name" => "mybrand_logo1",
|
||||
@@ -10330,7 +10364,7 @@ function SetupEmailSystemVariables($integration, $config, $handler, $managed_dom
|
||||
|
||||
$logo2 = "";
|
||||
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, [
|
||||
"name" => "mybrand_logo2",
|
||||
@@ -10339,7 +10373,7 @@ function SetupEmailSystemVariables($integration, $config, $handler, $managed_dom
|
||||
|
||||
$logo3 = "";
|
||||
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, [
|
||||
"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="/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="/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/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>
|
||||
<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>
|
||||
<link href='/portal/admin/core/api/styles/styles.css' rel='stylesheet'>
|
||||
|
||||
|
||||
<style> .spacer { width: 100%; height:550px;}</style>
|
||||
|
||||
@@ -10,6 +10,25 @@ use \SendGrid\Mail\Mail;
|
||||
class EmailManager {
|
||||
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){
|
||||
|
||||
@@ -499,7 +499,7 @@ if(Input::get('get_form_submissions')){
|
||||
get_form_submissions();
|
||||
}
|
||||
if(Input::get('print_form')){
|
||||
print_form();
|
||||
print_form();
|
||||
}
|
||||
if(Input::get('api_submit_form')){
|
||||
api_submit_form();
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
@import url("https://fonts.googleapis.com/css?family=Roboto:300,400,400i,500");
|
||||
|
||||
:root {
|
||||
/* --tblr-primary: #f1f1f1 !important; */
|
||||
/* --tblr-bg-surface: #222222; */
|
||||
}
|
||||
|
||||
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
font-family: "Roboto", sans-serif;
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
* Copyright 2018-2023 codecalm.net Paweł Kuna
|
||||
* Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
/* change */
|
||||
@charset "UTF-8";
|
||||
/* 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-rgb: 255, 255, 255;
|
||||
--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-secondary: #1b293a;
|
||||
--tblr-bg-surface-tertiary: #151f2c;
|
||||
|
||||
@@ -19,3 +19,18 @@
|
||||
<div class="content">
|
||||
<div id="dashboard-content"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -392,7 +392,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -432,7 +432,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -225,7 +225,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -159,7 +159,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -202,7 +202,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,6 +33,11 @@
|
||||
</div>
|
||||
<div class="col-auto ms-auto d-print-none">
|
||||
<div class="btn-list">
|
||||
<span class="">
|
||||
<a id="catalog_settings_btn" href="#" class="btn btn-outline-dark mb-4">
|
||||
Settings
|
||||
</a>
|
||||
</span>
|
||||
<span class="">
|
||||
<a id="back_to_init" href="#" class="btn btn-outline-dark mb-4">
|
||||
Back
|
||||
@@ -236,7 +241,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-auto mt-3 mt-lg-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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -39,11 +39,11 @@
|
||||
Back
|
||||
</a>
|
||||
</span>
|
||||
<span class="">
|
||||
<!-- <span class="">
|
||||
<a id="catalogs_configure_btn" href="#" class="btn btn-outline-dark">
|
||||
Settings
|
||||
</a>
|
||||
</span>
|
||||
</span> -->
|
||||
<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>
|
||||
Create new Catalog
|
||||
|
||||
@@ -30,10 +30,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-2">
|
||||
<button id="edit_repsonse_content_id" class="btn btn-outline-dark w-100">Response 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>
|
||||
<button id="email_manager" class="btn btn-outline-dark w-100">Email</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?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/mylibs/email/email_manager.php";
|
||||
|
||||
|
||||
//portal\admin\core\api\php\includes\mylibs\email\email_manager.php
|
||||
|
||||
|
||||
if(Input::get("decode_string")){
|
||||
@@ -11,6 +12,20 @@ if(Input::get("decode_string")){
|
||||
EchoJsonObject(["data" => $value]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(Input::get('domain')){
|
||||
|
||||
$email = new EmailManager();
|
||||
|
||||
$resp = $email->authDomain();
|
||||
|
||||
EchoJsonObject(["response" => json_decode($resp)]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(Input::get("send_email")){
|
||||
|
||||
$data = json_decode(Input::get("data"), true);
|
||||
|
||||
@@ -8,23 +8,33 @@
|
||||
$("#submit_send_email").on("click",function(e){
|
||||
e.preventDefault();
|
||||
|
||||
console.log("hello");
|
||||
|
||||
const value = $("#data_input_textarea").val().trim();
|
||||
let json = JSON.parse(value);
|
||||
console.log(json);
|
||||
|
||||
if(value==""){alert("Please add text");return;}
|
||||
$("#data_output_textarea").val("");
|
||||
|
||||
$.post("request.php",{
|
||||
"send_email": true,
|
||||
"data": value
|
||||
"domain": true,
|
||||
"data": {}
|
||||
},function(resp){
|
||||
resp = JSON.parse(resp);
|
||||
resp = JSON.parse(resp);
|
||||
console.log(resp);
|
||||
// $("#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
|
||||
|
||||
|
||||
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
Reference in New Issue
Block a user