initial commit

This commit is contained in:
equippedcoding-master
2025-09-17 09:37:06 -05:00
parent 86108ca47e
commit e2c98790b2
55389 changed files with 6206730 additions and 0 deletions
+372
View File
@@ -0,0 +1,372 @@
function func_login(app,view){
_func_login();
}
function func_dashboardDefaultViewListener(){
_func_dashboardDefaultViewListener();
}
function func_dashboardListener(){
views_dashboardContentView();
$('#dashboard-content').append(app_views['dashboard_main'].getHtml());
}
function func_emailListener(){
$("#email-back").click(function(){
app_views['dashboard_main'].render('default');
});
}
function func_webbuilderListener(){
_func_webbuilderListener();
}
function func_communicationListener(){
$("#communication-back").click(function(){
app_views['dashboard_main'].render('default');
});
}
function func_emailListener(){
_func_emailListener();
}
function func_emailManageListener(callback){
var data = {get_all_email_accounts:true};
$.post("core/request.php",data,function(resp){
resp = JSON.parse(resp);
//console.log(resp)
var verifiedArray = [];
var unverifiedArray = [];
var publicArray = [];
var privateArray = [];
for(var i=0; i < resp.length; i++){
if(resp[i].verified.verified==1){
verifiedArray.push(resp[i].verified);
}
if(resp[i].unverified!=undefined && resp[i].unverified.verified==0){
unverifiedArray.push(resp[i].unverified);
}
}
for(var i=0; i < verifiedArray.length; i++){
if(verifiedArray[i].category==0){
privateArray.push(verifiedArray[i]);
}else
if(verifiedArray[i].category==1){
publicArray.push(verifiedArray[i]);
}
}
var publicList = app.factory.list({
list: publicArray,
item: function(item,index){
this.label = item.username;
this.listener = function(item){
console.log(item);
openDialog(item);
}
return this;
}
});
var privateList = app.factory.list({
list: privateArray,
item: function(item,index){
this.label = item.username;
this.listener = function(item){
//console.log(item);
openDialog(item);
}
return this;
}
});
var nav = app.factory.nav({
//top[default], top-center, top-left, right, left
//position: "top-right"
});
nav.add({
init: true,
label: 'Public',
body: app.factory.container({
body:'<div id="list-emails-verified" class="manage-emails-container-list"></div>',
listener: function(){
$("#list-emails-verified").append(publicList.getHtml());
}
})
});
nav.add({
init: false,
label: 'Private',
body: app.factory.container({
body: '<div id="grap-emails-that-i-like-now"><h3>Empty</h3></div>',
listener: function(){
$("#grap-emails-that-i-like-now").append(privateList.getHtml());
}
})
});
nav.build();
$("#manage-verified-emails-list").append(nav.getHtml());
nav.initializeListeners();
var unverifiedList = app.factory.list({
list: unverifiedArray,
item: function(item,index){
//console.log(item);
this.label = ((item.userid==null||item.userid==undefined || item.userid=="") ? "[Name not chosen yet]" : item.userid) +" - "+ item.token;
this.listener = function(item){
console.log(item);
}
return this;
}
});
// ssss
$("#manage-unverified-emails-list").append(unverifiedList.getHtml());
if(callback!=undefined){
callback();
}
});
}
function openDialog(item){
// https://www2.cradle2careertx.xyz/portal/mailclient/1/
// <form action="${app_config.auto_login_url}" method="post" name="autologin">
var container1 = app.factory.container({
body: `
<form action="https://www2.cradle2careertx.xyz/portal/mailclient/1/" method="post" name="autologin">
<div style="display:none">
UserID <input name="rc_user" type="text" id="rc_user">
Passwort <input name="rc_pass" type="password" id="rc_pass">
</div>
<input type="submit" style="width:100%;margin-bottom:20px;" name="Submit" value="View Email">
</form>
`,
listener: function(){
$("#rc_user").val(item.userid);
$("#rc_pass").val(item.password);
}
});
var form = app.factory.form();
form.addCheckbox({
tag: "password",
label: "Update Password",
type: "text",
defaultValue: item.level
});
form.addInput({
tag: "forward",
label: "Forward Email",
type: "text",
defaultValue: item.level
});
form.addInput({
tag: "password",
label: "Update Password",
type: "text",
defaultValue: item.level
});
form.addRadioButtonGroup({
tag: 'category',
label: "Select Category",
inline: true,
defaultValue: item.category,
buttons: [
{
label:"Private",
value: 0,
id:"getg",
tag: "category_tag",
//checked: item.category==0 ? true : false
},
{
label:"Public",
value: 1,
tag: "category_tag",
id:"getgrt",
//checked: item.category==1 ? true : false
}
],
listener: function(obj){
//console.log(item)
}
});
form.addInput({
tag: "level",
label: "Level",
type: "number",
defaultValue: item.level
});
form.addInput({
tag: "firstname",
label: "First name",
type: "text",
defaultValue: (item.firstname=="_none_") ? "" : item.firstname,
});
form.addInput({
tag: "lastname",
label: "Last name",
type: "text",
defaultValue: (item.lastname=="_none_") ? "" : item.lastname,
});
form.onSubmit({
//id: "",
label: "Submit",
style: "width: 100%;",
className: "",// "btn btn-success",
overlay: true,
},function(obj){
//obj.values.category = parseInt(obj.values.category);
//console.log(item);
obj.values.username = item.username;
//console.log(obj.values);
var data2 = {
update_user_email_data: true,
data: JSON.stringify(obj.values)
};
$.post("core/request.php",data2,function(resp){
$("#manage-verified-emails-list").empty();
$("#manage-unverified-emails-list").empty();
func_emailManageListener(function(){
app.overlay(false);
AppDialog.toggle();
});
});
});
form.build();
var header = app.brick().stack().h5(item.userid + "@" + item.domain).build();
var layout = app.layout.newLayout()
.row()
.col({md:6}, header)
.row()
.col({md:6}, container1)
.row()
.col({md:6,offset_md:3}, form)
.build();
var comp1 = app.factory.container({body:layout})
AppDialog.setContent({
title: "Email",
body: comp1
});
AppDialog.toggle();
}
function func_emailCreateListener(){
$("#new-address-form").css({display:"block"});
$("#new-address-form-success").css({display:"none"});
$.post("./core/request.php",{get_all_email_accounts:true},function(resp1){
app_config["accounts"] = JSON.parse(resp1);
var form = comp_createEmailAddressForm();
$('#new-address-form').append(form.getHtml());
});
}
function func_emailSuccessListener(){
if(app_creationData==null || app_creationData==undefined){ return; }
$("#new-address-form").css({display:"none"});
$("#new-address-form-success").css({display:"block"});
$("#new-address-form-success-header").html("Invitation sent for "+ app_creationData.username + "@" + app_creationData.domain);
$("#new-address-form-success-button").click(function(e){
app_creationData = undefined;
$("#new-address-form-success-header").html("");
app_views['dashboard_email'].render("manage");
});
}
function func_createNewAdminEmailAddress(){
_func_createNewAdminEmailAddress();
}
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
function _func_webbuilderListener(){
$('#open-webbuilder-project').click(function(e){
e.preventDefault();
window.location.href = "webbuilder/";
});
$("#webbuilder-back").click(function(){
app_views['dashboard_main'].render('default');
});
}
function _func_createNewAdminEmailAddress(username,password,category,email,callback){
var data = {
'create_new_email_address':true,
username: username,
password: password,
category: category,
email: email
};
$.post("core/request.php",data,function(resp){
callback(resp);
});
}
function _func_emailListener(){
$("#email-container").append(app_views['dashboard_email'].getHtml());
$('#email-back').click(function(){
app_views['dashboard_main'].render('default');
});
$('#email-create-new-address').click(function(){
app_views['dashboard_email'].render('create');
});
$('#email-manage-address').click(function(){
app_views['dashboard_email'].render('manage');
});
}
function _func_dashboardDefaultViewListener(){
$(".default_view-btn-email").click(function(){
app_views['dashboard_main'].render('email');
});
$(".default_view-btn-webbuilder").click(function(){
app_views['dashboard_main'].render('webbuilder');
});
$(".default_view-btn-communication").click(function(){
app_views['dashboard_main'].render('communication');
});
$("#logout").click(function(e){
var data = { admin_logout:true };
$.post("core/request.php",data,function(resp){
console.log(resp);
});
app_views['main'].render('login');
});
}
function _func_login(){
// overflow: hidden;
// overflow: hidden;
$('body').css({"overflow":"hidden"});
//$('body').css({"overflow":"visible"});
$('#login-submit').click(function(e){
var username = $('#login-username').val();
var password = $('#login-password').val();
var data = {
"admin_login": true,
"username":username,
"password":password
};
$.post("core/request.php",data,function(data){
data = JSON.parse(data)
console.log(data);
if(data.status){
$("#login-status-text").html("Logging in...");
setTimeout(function(){
app_views['main'].render('dashboard');
},2000);
}else{
$("#login-status-text").html(data.message);
}
});
});
}
+28
View File
@@ -0,0 +1,28 @@
$(document).ready(function(){
// window.app = new ApplicationContextManager({});
// window.app_views = {};
// window.app_config = {};
// var data = {'initialize_dashboard':true};
// $.post("./core/request.php",data,function(resp){
// //console.log(resp);
// app_config = JSON.parse(resp);
// console.log(app_config)
// views_createMainView();
// document.body.appendChild(app_views['main'].getHtml());
// $.post("./core/request.php",{get_all_email_accounts:true},function(resp1){
// app_config["accounts"] = JSON.parse(resp1);
// });
// setTimeout(function(){
// if(app_session=="no"){
// app_views['main'].render('login');
// }else{
// app_views['main'].render('dashboard');
// }
// },1000);
// });
});
+181
View File
@@ -0,0 +1,181 @@
var loginTemplate = `
<form>
<!-- Email input -->
<div class="form-outline mb-4">
<input type="email" id="form2Example1" class="form-control" />
<label class="form-label" for="form2Example1">Email address</label>
</div>
<!-- Password input -->
<div class="form-outline mb-4">
<input type="password" id="form2Example2" class="form-control" />
<label class="form-label" for="form2Example2">Password</label>
</div>
<!-- 2 column grid layout for inline styling -->
<div class="row mb-4">
<div class="col d-flex justify-content-center">
<!-- Checkbox -->
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="form2Example31" checked />
<label class="form-check-label" for="form2Example31"> Remember me </label>
</div>
</div>
<div class="col">
<!-- Simple link -->
<a href="#!">Forgot password?</a>
</div>
</div>
<!-- Submit button -->
<button type="button" class="btn btn-primary btn-block mb-4">Sign in</button>
<!-- Register buttons -->
<div class="text-center">
<p>Not a member? <a href="#!">Register</a></p>
<p>or sign up with:</p>
<button type="button" class="btn btn-link btn-floating mx-1">
<i class="fab fa-facebook-f"></i>
</button>
<button type="button" class="btn btn-link btn-floating mx-1">
<i class="fab fa-google"></i>
</button>
<button type="button" class="btn btn-link btn-floating mx-1">
<i class="fab fa-twitter"></i>
</button>
<button type="button" class="btn btn-link btn-floating mx-1">
<i class="fab fa-github"></i>
</button>
</div>
</form>
`;
var loginTemplate2 = `
<div clas="container">
<div clas="row">
<div clas="col">
<section class="h-100 gradient-form" style="background-color: #eee;">
<div class="container py-5 h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
<div class="col-xl-10">
<div class="card rounded-3 text-black">
<div class="row g-0">
<div class="col-lg-6">
<div class="card-body p-md-5 mx-md-4">
<div class="text-center">
<img src="https://mdbcdn.b-cdn.net/img/Photos/new-templates/bootstrap-login-form/lotus.webp"
style="width: 185px;" alt="logo">
<h4 class="mt-1 mb-5 pb-1">We are The Lotus Team</h4>
</div>
<form>
<p>Please login to your account</p>
<div class="form-outline mb-4">
<input type="email" id="form2Example11" class="form-control"
placeholder="Phone number or email address" />
<label class="form-label" for="form2Example11">Username</label>
</div>
<div class="form-outline mb-4">
<input type="password" id="form2Example22" class="form-control" />
<label class="form-label" for="form2Example22">Password</label>
</div>
<div class="text-center pt-1 mb-5 pb-1">
<button class="btn btn-primary btn-block fa-lg gradient-custom-2 mb-3" type="button">Log
in</button>
<a class="text-muted" href="#!">Forgot password?</a>
</div>
<div class="d-flex align-items-center justify-content-center pb-4">
<p class="mb-0 me-2">Don't have an account?</p>
<button type="button" class="btn btn-outline-danger">Create new</button>
</div>
</form>
</div>
</div>
<div class="col-lg-6 d-flex align-items-center gradient-custom-2">
<div class="text-white px-3 py-4 p-md-5 mx-md-4">
<h4 class="mb-4">We are more than just a company</h4>
<p class="small mb-0">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
`;
var loginTemplate3 = `
<div class="bg-secondary login-template-3">
<section class=" gradient-custom">
<div class="container">
<div class="row d-flex justify-content-center align-items-center">
<div class="col-12 col-md-8 col-lg-6 col-xl-5">
<div class=" bg-secondary text-white" style="border-radius: 1rem;">
<div class=" p-4 text-center">
<div class="mb-md-5 mt-md-4 pb-5">
<h2 class="fw-bold mb-2 text-uppercase">Login To Administrator Dashboard</h2>
<p class="text-white-50 mb-5" id="login-status-text">Please enter your login and password!</p>
<div class="form-outline form-white mb-4">
<input type="text" id="login-username" class="form-control form-control-lg" />
<label class="form-label" for="login-username">Username</label>
</div>
<div class="form-outline form-white mb-4">
<input type="password" id="login-password" class="form-control form-control-lg" />
<label class="form-label" for="login-password">Password</label>
</div>
<!-- <p class="small mb-5 pb-lg-2"><a class="text-white-50" href="#!">Forgot password?</a></p> -->
<button class="btn btn-outline-light btn-lg px-5" id="login-submit" type="submit">Login</button>
<div class="d-flex justify-content-center text-center mt-4 pt-1">
<a href="#!" class="text-white"><i class="fab fa-facebook-f fa-lg"></i></a>
<a href="#!" class="text-white"><i class="fab fa-twitter fa-lg mx-4 px-2"></i></a>
<a href="#!" class="text-white"><i class="fab fa-google fa-lg"></i></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
`;
var emailTemplate = ``;
+134
View File
@@ -0,0 +1,134 @@
// Main View
function views_createMainView(){
var view = app.factory.view();
app_views['main'] = view;
view.newSubView({
id: "default",
init: true,
body: app.factory.container({
body: "<div></div>",
listener: function(){}
})
});
view.newSubView({
id: "login",
init: false,
body: app.factory.container({
body: loginTemplate3,
listener: function(){ func_login(app,view); }
})
});
view.newSubView({
id: "dashboard",
init: false,
body: app.factory.container({
body: TemplateDashboard,
listener: function(){
func_dashboardListener();
}
})
});
}
// main - event-attached:func_dashboardListener()
function views_dashboardContentView(){
var view = app.factory.view();
app_views['dashboard_main'] = view;
view.newSubView({
id: "default",
init: true,
body: app.factory.container({
body: TemplateDashboardDefault,
listener: function(){ func_dashboardDefaultViewListener(); }
})
});
view.newSubView({
id: "email",
init: false,
body: views_emailView()
});
view.newSubView({
id: "webbuilder",
init: false,
body: views_webbuilderView()
});
view.newSubView({
id: "communication",
init: false,
body: views_communicationView()
});
return view;
}
// email
function views_emailView(){
var view = app.factory.view();
app_views['dashboard_email'] = view;
view.newSubView({
id: "create",
init: true,
body: app.factory.container({
body: TemplateEmailCreateNewEmail,
listener: function(){ func_emailCreateListener(); }
})
});
view.newSubView({
id: "create-success",
init: false,
body: app.factory.container({
body: TemplateEmailCreateNewEmail,
listener: function(){ func_emailSuccessListener(); }
})
});
view.newSubView({
id: "manage",
init: false,
body: app.factory.container({
body: TemplateEmailManageEmail,
listener: function(){ func_emailManageListener(); }
})
});
var container = app.factory.container({
body: TemplateEmail,
listener: function(){ func_emailListener(); }
});
return container;
}
// web builder
function views_webbuilderView(){
var view = app.factory.view();
app_views['dashboard_webbuilder'] = view;
view.newSubView({
id: "default",
init: true,
body: app.factory.container({
body: TemplateWebBuilder,
listener: function(){ func_webbuilderListener(); }
})
});
return view;
}
// communication
function views_communicationView(){
var view = app.factory.view();
app_views['dashboard_communication'] = view;
view.newSubView({
id: "default",
init: true,
body: app.factory.container({
body: TemplateCommunication,
listener: function(){ func_communicationListener(); }
})
});
return view;
}