diff --git a/src/controladores/controlador_General.js b/src/controladores/controlador_General.js index 8a0f7e1..0b93ab4 100644 --- a/src/controladores/controlador_General.js +++ b/src/controladores/controlador_General.js @@ -56,7 +56,11 @@ function stringTo_md5(data_string){ console.log("MD5: ", md5); return md5; } -//********* APP-PEDIDOS-SIGMA ********// +//************* FORM LOGIN DEMO ****************// +controlador.login_test = (req, res) => { + res.render('login_test'); +}; +//********* FORM APP-PEDIDOS-SIGMA ********// controlador.app_sigma = (req, res) => { res.render('app_pedidos'); }; @@ -110,6 +114,12 @@ function stringTo_md5(data_string){ }); }); }; + controlador.recibe_pedidos = (req, res) => { + console.log("Data: "+req.body); + req.getConnection((err, conn) => { + res.json({sision:"exitosa"}); + }); + }; //********* APP-panel control ********// controlador.panel_control = (req, res) => { diff --git a/src/controladores/controlador_Items.js b/src/controladores/controlador_Items.js index b445c8a..cf8586d 100644 --- a/src/controladores/controlador_Items.js +++ b/src/controladores/controlador_Items.js @@ -178,7 +178,8 @@ controlador.app_consultaItemsPrecios = (req,res) => { //if(err) return res.status(500).send("Error en Consulta de Items"); rows.map( dat => { - //console.log(var_b64(dat.imagen)); + //console.log(blob_a_b64(dat.imagen)); + dat.imagen = blob_a_b64(dat.imagen); //fs.writeFileSync(path.join(__dirname,"../img/db_img"+image.codigo_prdcto+".png"),image.imagen); } ) @@ -189,20 +190,15 @@ controlador.app_consultaItemsPrecios = (req,res) => { }); }; -let blob_b64 = (blob) =>{ - return new Promise((resolve,reject)=>{ - const reader = new FileReader(); - reader.readAsDataURL(blob); - reader.onloadend = () => { - resolve(reader.result); - } - }) -}; - -var_b64 = (blob) => { - const reader = new FileReader(); - return reader.readAsDataURL(blob); -}; +function blob_a_b64(blob) { + var b64; + if(blob!=null){ + b64 = blob.toString('base64'); + }else{ + b64=""; + } + return b64; +} //********* CONSULTA ADICIONALES X MODIFICAR ********// controlador.cierresCaja = (req, res) => { diff --git a/src/public/css/login.css b/src/public/css/login.css index 1b43487..809749d 100644 --- a/src/public/css/login.css +++ b/src/public/css/login.css @@ -1,16 +1,92 @@ -body{ - background: #084C6D; +@import url('https://fonts.googleapis.com/css?family=Poppins:wght@300;400;500;600;700;800;900&display=swap'); +*{ + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Poppins', sans-serif,sigma_tipografia; } +body{ + /*background: #084C6D;*/ + display: flex; + justify-content:center; + align-items: center; + min-height: 100vh; + background: #23242a; +} +@font-face { + font-family: sigma_tipografia; + src: url(../tipografias/sigma_font.ttf) format('truetype'), url(../tipografias/sigma_font.otf) format('truetype'); + font-style: normal; +} + .login-page{ background-color: #084C6D; } .login-logo a, .register-logo a{ color: #b5daff } +.nom_app{ + font-family: sigma_tipografia; +} .login-logo{ font-size:32px; - font-family: 'SIGMA-FONT', sigma_font, sigma_tipografia; + font-family: sigma_tipografia; } .login-box-msg{ font-family: 'SIGMA-FONT', sigma_font, sigma_tipografia; +} + +.box{ + position: relative; + width: 380px; + height: 420px; + background-color: #1c1c1c; + border-radius: 8px; + overflow: hidden; +} +.box::before{ + content: ''; + position: absolute; + top: -50%; + left: -50%; + width: 370px; + height: 420px; + background: linear-gradient(0deg,transparent,#45f3ff,#45f3ff); + transform-origin: bottom right; + animation: animar 6s linear infinite; +} +.box::after{ + content: ''; + position: absolute; + top: -50%; + left: -50%; + width: 370px; + height: 420px; + background: linear-gradient(0deg,transparent,#45f3ff,#45f3ff); + transform-origin: bottom right; + animation: animar 6s linear infinite; + animation-delay: -3s; +} +@keyframes animar{ + 0%{ + transform: rotate(0deg); + } + 100%{ + transform: rotate(360deg); + } +} +.form-box { + position: absolute; + inset: 2px; + background: #28292d; + z-index: 10; +} +.login-box{ + position: absolute; + inset: 2px; + background: #28292d; + z-index: 10; + width: 99%; + margin-top: 0rem; + border-radius: 8px; } \ No newline at end of file diff --git a/src/rutas/rt_Generales.js b/src/rutas/rt_Generales.js index e943831..9878e0f 100644 --- a/src/rutas/rt_Generales.js +++ b/src/rutas/rt_Generales.js @@ -10,7 +10,10 @@ rutas.get('/gp_precios', controlador_init.app_GpPrecios);//consulta grupo precio rutas.get('/origen_pedidos', controlador_init.app_ORIGENES);//consulta grupo precios rutas.get('/panel_control', controlador_init.panel_control);//consulta grupo precios rutas.get('/pedidos', controlador_init.app_sigma);//Una app para PEDIDOS -rutas.get('/', controlador_init.app_login);//Una app para PEDIDOS -rutas.post('/login', controlador_init.auth);//Una app para PEDIDOS +rutas.get('/recepcionPedidos', controlador_init.recibe_pedidos);//receptar pedidos + +rutas.get('/', controlador_init.app_login);//FORM LOGIN DE LA APP +rutas.post('/login', controlador_init.auth);//Authenticacion de APP +rutas.get('/login_test', controlador_init.login_test);//login testing css / dev module.exports = rutas; diff --git a/src/views/login.ejs b/src/views/login.ejs index 6acc20c..d49814c 100644 --- a/src/views/login.ejs +++ b/src/views/login.ejs @@ -7,56 +7,60 @@
SIGMA Pedidos
- iniciar tu sesión
-