Commit inicial
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"remotePath": "./public_html/ludotecaempresarial.com/juegos/Colaborando",
|
||||
"host": "cp7068.webempresa.eu",
|
||||
"username": "cheve@ludotecaempresarial.com",
|
||||
"password": "Lestat04@",
|
||||
"port": 21,
|
||||
"secure": false,
|
||||
"protocol": "ftp",
|
||||
"uploadOnSave": true,
|
||||
"passive": false,
|
||||
"debug": false,
|
||||
"privateKeyPath": null,
|
||||
"passphrase": null,
|
||||
"agent": null,
|
||||
"allow": [],
|
||||
"ignore": ["\\.vscode", "\\.git", "\\.DS_Store"],
|
||||
"generatedFiles": {
|
||||
"extensionsToInclude": [""],
|
||||
"path": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"enableStatusBarItem": true,
|
||||
"enableQuickPick": true,
|
||||
"uploadOnSave": true,
|
||||
"autoDelete": true,
|
||||
"checkGitignore": false,
|
||||
"activeTargets": [
|
||||
"LudotecaEmpresrial"
|
||||
],
|
||||
"concurrency": 5,
|
||||
"ignore": [
|
||||
".git/**/*",
|
||||
".vscode/**/*"
|
||||
],
|
||||
"include": [],
|
||||
"targets": [
|
||||
{
|
||||
"name": "My SFTP",
|
||||
"type": "sftp",
|
||||
"host": "localhost",
|
||||
"port": 22,
|
||||
"user": "admin",
|
||||
"password": "123456",
|
||||
"dir": "/",
|
||||
"baseDir": "/",
|
||||
"privateKey": null,
|
||||
"passphrase": null
|
||||
},
|
||||
{
|
||||
"name": "LudotecaEmpresrial",
|
||||
"type": "ftp",
|
||||
"host": "cp7068.webempresa.eu",
|
||||
"port": 21,
|
||||
"user": "cheve@ludotecaempresarial.com",
|
||||
"password": "Lestat04@",
|
||||
"dir": "/",
|
||||
"baseDir": "/public_html/ludotecaempresarial.com/juegos",
|
||||
"transferDataType": "binary"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"CodeGPT.apiKey": "CodeGPT Plus Beta",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[html]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[css]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[vue]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[php]": {
|
||||
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client"
|
||||
},
|
||||
"b4xIntellisense.autoLoadProjectAssets": true
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "Ludoteca (Produccion)",
|
||||
"host": "cp7068.webempresa.eu",
|
||||
"protocol": "ftp",
|
||||
"port": 21,
|
||||
"username": "cheve@ludotecaempresarial.com",
|
||||
"password": "Lestat04@",
|
||||
"remotePath": "./public_html/ludotecaempresarial.com/juegos",
|
||||
"uploadOnSave": true,
|
||||
"passive": true,
|
||||
"useTempFile": false,
|
||||
"openSsh": false
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
<?php
|
||||
session_start();
|
||||
if($_SESSION["logueadoA"] == TRUE) {
|
||||
require("conexion.php");
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
if (isset($_GET['add']))// Vamos a guardar un usuario.
|
||||
{ $sqlUsrsAdd = "SELECT * FROM `experi10_tricenli_wp`.`wp_users` WHERE ID = '".$_GET['add']."'"; // Traemos los datos del usuario desde WP.
|
||||
if($usrsARes = $mysqli->query($sqlUsrsAdd)) {
|
||||
while($rowUsrA = $usrsARes->fetch_array())
|
||||
{
|
||||
$orden = "";
|
||||
$sqlOrders = "SELECT * FROM experi10_tricenli_wp.wp_postmeta WHERE meta_key = 'wps_customer_id' and meta_value = '".$rowUsrA["ID"]."'"; // Traemos la orden del usuario.
|
||||
if($ordrsRes = $mysqli->query($sqlOrders)) {
|
||||
while($rowOrdr = $ordrsRes->fetch_array()){
|
||||
$orden = $rowOrdr["post_id"];
|
||||
}
|
||||
}
|
||||
$suscripcion = "";
|
||||
$sqlSusc = "SELECT * FROM experi10_tricenli_wp.wp_postmeta WHERE meta_key = 'product_name' and post_id = '".$orden."'"; // Traemos la suscripcion del usuario.
|
||||
if($suscRes = $mysqli->query($sqlSusc)) {
|
||||
while($rowSusc = $suscRes->fetch_array()){
|
||||
$suscripcion = $rowSusc["meta_value"];
|
||||
}
|
||||
}
|
||||
if($suscripcion == "Plan Mensual Básico Everest" || $suscripcion == "Plan Básico Everest"){$suscripcion = "Basico";} // Pasamos la suscripcion al formato que maneja Juegos.
|
||||
if($suscripcion == "Plan Mensual Premium Everest"){$suscripcion = "Premium";}
|
||||
if($suscripcion == "Plan Mensual Empresarial Everest"){$suscripcion = "Empresarial";}
|
||||
// Guardamos el usuario en Juegos.
|
||||
$sqlGuardaUsr = "insert into usuarios (wpId, usuario, password, wp_password, nombre, correo, empresa, tipo, nivel, vigencia) values ('".$rowUsrA["ID"]."', '".$rowUsrA["user_email"]."', '".$rowUsrA["user_email"]."', '".$rowUsrA["user_pass"]."', '".$rowUsrA["display_name"]."', '".$rowUsrA["user_email"]."', 'Individual', '".$suscripcion."', '0', '')";
|
||||
if($guardaUsrRes = $mysqli->query($sqlGuardaUsr)) {
|
||||
$last_id = $mysqli->insert_id;
|
||||
echo "Usuario guardado.<br>";
|
||||
}
|
||||
$sql = "INSERT INTO juegosXusrs (idUsr, idJuego) VALUES ('".$last_id."', '3')"; // Asignamos el juego "Everest" al usuario nuevo.
|
||||
if ($mysqli->query($sql) === TRUE) {
|
||||
echo "Juego asignado correctamente<br><br>";
|
||||
echo "<script>history.pushState(null, null, '".$_SERVER['PHP_SELF']."');</script>"; // Quitamos el parametro "add" del URL para evitar que se presione "F5" y se agregue otra vez el usuario.
|
||||
} else {
|
||||
echo "Error: " . $sql . "<br>" . $mysqli->error;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "Error: " . $sql . "<br>" . $mysqli->error;
|
||||
}
|
||||
|
||||
|
||||
//$mysqli->close();
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Back Office - No Registrados</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="css/jquery-ui.css">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<script src="js/jquery-3.5.1.min.js"></script>
|
||||
<script src="js/jquery-ui.js"></script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');
|
||||
</style>
|
||||
<style>
|
||||
body, input {font-family: 'Poppins', sans-serif;}
|
||||
.trumbowyg{width:340px;background-color:white;}
|
||||
.trumbowyg-editor{font-size:20px;font-weight:bold;text-align:center;}
|
||||
.b{color:white;padding:5 5 5 5;}
|
||||
select, input, textarea{height:40px;font-size:15px;width:250;text-align:center;}
|
||||
span{text-decoration:underline #000 dotted;}
|
||||
#tablaEventos td {border: 1px solid gray;padding:6px;font-size:14px;}
|
||||
#tablaEventos thead td{background-color:silver;font-weight:bold;text-align:center;}
|
||||
.manitaOnHover {cursor:pointer;}
|
||||
.botonMenu {width:332px;height:28px;font-size:15px;}
|
||||
</style>
|
||||
<script>
|
||||
$( function() {
|
||||
$( "#datepicker" ).datepicker({dateFormat:"yy-mm-dd"});
|
||||
} );
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a href="bo.php?expira=1"><input type="button" id="agregarUsuario" value="Cerrar sesión" class="botonMenu"></a><br>
|
||||
<a href="bo.php?a=au"><input type="button" id="agregarUsuario" value="Agregar Usuario" class="botonMenu"<?php if(isset($_GET["a"]) && $_GET["a"] == "au"){echo " style='background-color:green;color:white;'";}?>></a><br>
|
||||
<a href="bo.php?a=mu"><input type="button" id="modificarUsuario" value="Modificar Usuario" class="botonMenu"<?php if(isset($_GET["a"]) && $_GET["a"] == "mu"){echo " style='background-color:green;color:white;'";}?>></a><br>
|
||||
<a href="bo.php?a=vu"><input type="button" id="muestraUsuarios" value="Ver Usuarios" class="botonMenu"<?php if(isset($_GET["a"]) && $_GET["a"] == "vu"){echo " style='background-color:green;color:white;'";}?>></a><br>
|
||||
<!--- <a href="bo.php?a=aj"><input type="button" id="agregarJuego" value="Agregar Juego" style="width:332px;height:30px;font-size:15px;"></a><br> --->
|
||||
<!--- <a href="bo.php?a=mj"><input type="button" id="modificarJuego" value="Modificar Juego" style="width:332px;height:30px;font-size:15px;"></a><br> --->
|
||||
<a href="bo.php?a=aju"><input type="button" id="modificarJuego" value="Asignar un juego a un usuario" class="botonMenu"<?php if(isset($_GET["a"]) && $_GET["a"] == "aju"){echo " style='background-color:green;color:white;'";}?>></a><br>
|
||||
<a href="bo.php?a=ma&cid=1"><input type="button" id="modificarJuego" value="Modificar asignación de juego" class="botonMenu"<?php if(isset($_GET["a"]) && $_GET["a"] == "ma"){echo " style='background-color:green;color:white;'";}?>></a><br>
|
||||
<!--- <a href="bo.php?a=at"><input type="button" id="agregarTrajetas" value="Agregar Tarjetas" style="width:332px;height:30px;font-size:15px;"></a><br> --->
|
||||
<a href="verHistorial.php?a=vh"><input type="button" id="verHistorial" value="Ver el historial de un usuario" class="botonMenu"<?php if(isset($_GET["a"]) && $_GET["a"] == "vh"){echo " style='background-color:green;color:white;'";}?>></a><br>
|
||||
<a href="verNoRegistrados.php?a=vnr"><input type="button" id="verNoRegistrados" value="Ver los usuarios no registrados" class="botonMenu"<?php if(isset($_GET["a"]) && $_GET["a"] == "vnr"){echo " style='background-color:green;color:white;'";}?>></a>
|
||||
<br>
|
||||
<p>
|
||||
<table id="tablaEventos">
|
||||
<thead><td align="center">Id</td><td>Nombre</td><td>Correo</td><td align="center">Orden</td><td align="center">Plan</td><td align="center">Estatus</td><td align="center">Modificado</td><td> </td></thead>
|
||||
|
||||
<!---
|
||||
|
||||
- wp_posts - > 1700
|
||||
- wp_woocommerce_order_items - > 70 y 1700
|
||||
- wp_woocommerce_order_itemmeta - > 70
|
||||
- wp_postmeta - > 1700's
|
||||
- Para traer la orden de un usuario usar este query y ver la columna post_id: SELECT * FROM wp_postmeta WHERE meta_key = 'wps_customer_id' and meta_value = '11'
|
||||
- Para obtener el ID del usuario usar este query y ver la columna ID: SELECT * FROM wp_users WHERE user_email = 'cheveguerra@gmail.com'
|
||||
- Tambien puede ser este query con la columna wpid o id : SELECT * FROM wp_bwf_contact WHERE email = 'cheveguerra@gmail.com'
|
||||
- Para traer los usuarios de WP que no están en juegos, usar este query: SELECT * FROM wp_users WHERE user_email not in (select correo from experi10_tricenli_juegos.usuarios)
|
||||
|
||||
Preguntas:
|
||||
- WP tiene un login de usuarios .. o solo para COMPRAR?
|
||||
- Queremos que se muestre Basico y Basico Anual o solo Basico
|
||||
- Las suscripciones anuales las guarda con intervalo y expiracion MENSUAL.
|
||||
|
||||
Mejoras:
|
||||
- Cuando se agregue un usuario a WP (triggers), que ponga en una tabla el usuario a agregar o actualizar, y cuando se entre a Juegos (/juegos/index.php) se traigan los datos y se realice la accion necesaria.
|
||||
|
||||
--->
|
||||
|
||||
<?php
|
||||
$sqlUsrs = "SELECT * FROM `experi10_tricenli_wp`.`wp_users` WHERE user_email not in (select correo from experi10_tricenli_juegos.usuarios)"; // Traemos los usuarios de WP que no estan en Juegos.
|
||||
if($usrsRes = $mysqli->query($sqlUsrs)) {
|
||||
while($rowUsr = $usrsRes->fetch_array())
|
||||
{ $orden = "";
|
||||
$sqlOrders = "SELECT * FROM experi10_tricenli_wp.wp_postmeta WHERE meta_key = 'wps_customer_id' and meta_value = '".$rowUsr["ID"]."'"; // Traemos la orden del usuario.
|
||||
if($ordrsRes = $mysqli->query($sqlOrders)) {
|
||||
while($rowOrdr = $ordrsRes->fetch_array()){
|
||||
$orden = $rowOrdr["post_id"];
|
||||
}
|
||||
}
|
||||
$suscripcion = "";
|
||||
$sqlSusc = "SELECT * FROM experi10_tricenli_wp.wp_postmeta WHERE meta_key = 'product_name' and post_id = '".$orden."'"; // Traemos la suscripcion del usuario.
|
||||
if($suscRes = $mysqli->query($sqlSusc)) {
|
||||
while($rowSusc = $suscRes->fetch_array()){
|
||||
$suscripcion = $rowSusc["meta_value"];
|
||||
}
|
||||
}
|
||||
if($suscripcion == "Plan Mensual Básico Everest" || $suscripcion == "Plan Básico Everest"){$suscripcion = "Basico";} // Pasamos la suscripcion al formato que maneja Juegos.
|
||||
if($suscripcion == "Plan Mensual Premium Everest"){$suscripcion = "Premium";}
|
||||
if($suscripcion == "Plan Mensual Empresarial Everest"){$suscripcion = "Empresarial";}
|
||||
|
||||
$estatus = "";
|
||||
$modificado = "";
|
||||
$sqlOtros = "SELECT * FROM experi10_tricenli_wp.wp_posts WHERE ID = '".$orden."'"; // Traemos estatus y fecha de modificacion del usuario.
|
||||
if($otrosRes = $mysqli->query($sqlOtros)) {
|
||||
while($rowOtros = $otrosRes->fetch_array()){
|
||||
$estatus = $rowOtros["post_status"];
|
||||
$modificado = $rowOtros["post_modified"];
|
||||
}
|
||||
}
|
||||
if($orden != ""){
|
||||
echo("<tr><td align='center'>".$rowUsr["ID"]."</td><td>".$rowUsr["display_name"]."</td><td>".$rowUsr["user_email"]."</td><td align='center'>".$orden."</td><td align='center'>".$suscripcion."</td><td align='center'>".$estatus."</td><td align='center'>".$modificado."</td><td><a hrefx='".$_SERVER['PHP_SELF']."?add=".$rowUsr["ID"]."' onclick='return agregarUsuario(".$rowUsr["ID"].")' class='manitaOnHover'>Agregar</a></td></tr>");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "Error: " . $sql . "<br>" . $mysqli->error;
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
else{
|
||||
header("Location: admin.php");
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
function agregarUsuario(id)
|
||||
{ console.log("xxxxx");
|
||||
if (confirm("Seguro que desea agregar el usuario \""+ id +"\"?")) {
|
||||
window.location.href = "<?php echo $_SERVER['PHP_SELF'] ?>?add=" + id;
|
||||
return false;
|
||||
}
|
||||
else {return false;}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 541 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 989 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 872 B |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 44 KiB |