index.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. <?php
  2. /*
  3. Sistema de Portales de Soler y Palau SA de CV
  4. (2021) Desarrollos y Servicios en Tecnología Inteligente S de RL de CV
  5. Versión 1.0
  6. Última Actualización: 05/08/2021
  7. Código del Módulo: GBL001
  8. */
  9. $strModulo = 'GBL001';
  10. /*require_once('shared/conexionBaseDatos.php');
  11. require_once('shared/conexionBaseDatosCtl.php');
  12. require_once('shared/encriptacion.php');
  13. require_once('shared/iniciaSesion.php');
  14. require_once('shared/funciones.php');*/
  15. $bolErrorLogin = false; // Predefine que no hay error para el login
  16. $bolErrorApp = false; // Predefine que no hay errores para la aplicación
  17. $bolBloqueo = false; // Predefine que no hay bloqueos de acceso por Usuario / IP
  18. $bolSinPerfil = false; // Predefine que no se rechaza el acceso por falta de Perfiles asociados
  19. if((!empty($_POST['usuario'])) && (!empty($_POST['contrasena'])) && (!$bolErrorApp) && (!$bolBloqueo)) {
  20. $user = trim($_POST['usuario']);
  21. $contra = trim($_POST['contrasena']);
  22. if((intval($user) == 10) && ($contra == 'admin')){
  23. $q = '';
  24. header('Location: acceso.php'.$q);
  25. exit;
  26. }else{
  27. $bolErrorLogin = true;
  28. goto fin;
  29. }
  30. }
  31. // Destruye cualquier sesión existente para el usuario
  32. //session_destroy();
  33. // Si se disparó un error por Perfil impide que se dispare simultáneamente un error de Aplicación
  34. if($bolSinPerfil==true) { $bolErrorApp == false; }
  35. // Si se recibió un parámetro de acceso directo, lo mantiene vivo dentro de la petición.
  36. /*if(!empty($_GET['q'])) {
  37. $q = $_SERVER['PHP_SELF'].'?q='.urlencode($_GET['q']);
  38. } elseif(!empty($_GET['p'])) { // Para Proveedores
  39. $q = $_SERVER['PHP_SELF'].'?p='.urlencode($_GET['p']);
  40. }else{
  41. $q = $_SERVER['PHP_SELF'];
  42. }*/
  43. fin :
  44. $mensajeError = '';
  45. if($bolBloqueo){
  46. $mensajeError = '<b>Acceso Bloqueado</b> <br> Contacte al Administrador.';
  47. }
  48. if($bolErrorLogin){
  49. $mensajeError = '<b>Acceso Denegado</b> <br> Usuario o contraseña incorrecto.';
  50. }
  51. if($bolErrorApp){
  52. $mensajeError = '<b>Servicio No Disponible</b> <br> Intente nuevamente más tarde.';
  53. }
  54. if($bolSinPerfil){
  55. $mensajeError = '<b>El usuario no tiene Perfiles relacionados</b>';
  56. }
  57. ?>
  58. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  59. <html xmlns="http://www.w3.org/1999/xhtml">
  60. <head>
  61. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  62. <meta http-equiv="imagetoolbar" content="no" />
  63. <title>Bienvenido al Smart Portal de S&amp;P</title>
  64. <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Poppins:400,500,700,300,600">
  65. <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans">
  66. <!-- <link media="screen" rel="stylesheet" type="text/css" href="css/admin-login.css" /> -->
  67. <link rel="shortcut icon" type="image/x-icon" href="css/layout/global/sp.ico" />
  68. <meta name="viewport" content="width=device-width, user-scalable=yes">
  69. <!-- <meta name="theme-color" content="#dc3545"> -->
  70. <meta name="theme-color" content="#EC161E">
  71. <link rel="stylesheet" href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/vivify.min.css">
  72. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.0/css/bootstrap.min.css">
  73. <link href="https://fonts.googleapis.com/icon?family=Material+Icons"
  74. rel="stylesheet">
  75. <script type="text/JavaScript" src="js/front.js"></script>
  76. <script type="text/JavaScript">if(top.location != self.location)top.location = self.location;</script>
  77. <script>
  78. function crearIframe(){
  79. var link = "lp/mantenimiento.php";
  80. var iframe = document.createElement('iframe');
  81. iframe.frameBorder=0;
  82. iframe.width="100%";
  83. iframe.height="400px";
  84. iframe.id="randomid";
  85. iframe.setAttribute("src", link);
  86. document.getElementById("iframeIn").appendChild(iframe);
  87. }
  88. </script>
  89. </head>
  90. <body>
  91. <!-- header -->
  92. <div class="container-fluid">
  93. <div class="row">
  94. <nav class="navbar navbar-light bg-white col-sm-12">
  95. <div class="col-sm-6 col-9">
  96. <a class="navbar-brand" href="#">
  97. <img src="css/layout/global/header_logo_1.png" width="245" class="align-top mb-2 img-fluid" alt="S&P Mexico">
  98. </a>
  99. </div>
  100. <div class="col-sm-6 col-6 d-none d-sm-block">
  101. <a class="form-inline float-right" href="#">
  102. <img src="css/layout/global/SPA861201DK4_PDF.jpg" width="100" class="img-fluid" alt="Soler Y Palau Ventilation Group">
  103. </a>
  104. </div>
  105. </nav>
  106. </div>
  107. <div class="row">
  108. <div class="barra-roja">
  109. <div id="titulo"> Planta S&P </div>
  110. </div>
  111. </div>
  112. </div>
  113. <!-- body section -->
  114. <div class="container">
  115. <div id="iframeIn"></div>
  116. <div class="col-12 col-sm-9 col-md-7 col-lg-5 col-xl-4 mx-auto" id="login">
  117. <div class="card card-signin my-2 vivify animationObject popInTop">
  118. <div class="card-body">
  119. <h4 class="card-title text-center mb-2">Iniciar Sesión</h4>
  120. <form class="form-signin" action="index.php"
  121. onsubmit=""
  122. method="POST">
  123. <div class="form-label-group">
  124. <input type="text" id="inputUser" name="usuario" class="form-control" placeholder=""
  125. required autofocus="">
  126. <label for="inputUser">
  127. <i class="material-icons" style="vertical-align: middle;">person</i>
  128. Usuario
  129. </label>
  130. </div>
  131. <div class="form-label-group">
  132. <input type="password" id="inputPassword" name="contrasena" class="form-control"
  133. placeholder="" required>
  134. <label for="inputPassword">
  135. <i class="material-icons" style="vertical-align: middle;">lock</i>
  136. Contraseña</label>
  137. </div>
  138. <div class="vivify animationObject shake m-1 text-center"
  139. <?php if ($mensajeError === ''): ?>
  140. style="display:none;background: "
  141. <?php endif; ?>
  142. >
  143. <label class="text-dark text-center">
  144. <?php echo $mensajeError; ?>
  145. </label>
  146. </div>
  147. <button class="btn btn-lg btn-danger btn-block" type="submit">ACCEDER</button>
  148. </form>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. <!-- footer -->
  154. <div class="container-fluid">
  155. <div class="row">
  156. <footer class="text-left">
  157. <label class="ml-2">
  158. Copyright © <?php echo date('Y'); ?> <b class="font-weight-bold">S&P México.</b> Todos los derechos reservados.
  159. </label>
  160. <label class="footer_terminos">
  161. <a class="text-white" href="http://www.soler-palau.mx/terminos-condiciones.php" target="_new"> &nbsp; Términos y Condiciones</a>
  162. <a class="text-white" href="http://www.soler-palau.mx/politicas-privacidad.php" target="_new"> | Políticas de Privacidad</a>
  163. <a class="text-white" href="http://www.soler-palau.mx/aviso-privacidad.php" target="_new"> | Aviso de Privacidad</a>
  164. </label>
  165. </footer>
  166. </div>
  167. </div>
  168. <!-- modals aviso -->
  169. <div class="modal fade bd-example-modal-lg" id="modal-aviso" tabindex="-1" role="dialog" aria-labelledby="modal-aviso" aria-hidden="true">
  170. <div class="modal-dialog modal-lg">
  171. <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="cursor: pointer;">
  172. <span aria-hidden="true">&times;</span>
  173. </button>
  174. <div class="modal-content p-4">
  175. <img class="img-fluid" src="https://sportalsolerpalau.mx/portalsp/Avisos/AVISOCXC.png">
  176. </div>
  177. </div>
  178. </div>
  179. </body>
  180. <!-- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script> -->
  181. <!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" ></script> -->
  182. <script>
  183. // modal aviso
  184. // $('#modal-aviso').modal('show');
  185. </script>
  186. </html>
  187. <style>
  188. :root {
  189. --input-padding-x: 1.6rem;
  190. --input-padding-y: .75rem;
  191. }
  192. .barra-roja {
  193. background-image: url("css/layout/login/wrapper_bg.gif");
  194. height: 80px;
  195. width: 100%;
  196. }
  197. #titulo {
  198. height: 40px;
  199. width: auto;
  200. color: #fff;
  201. font-family: Poppins, ​Helvetica, ​sans-serif;
  202. font-size: 30px;
  203. font-weight: 200;
  204. line-height: 40px;
  205. text-align: right;
  206. padding-right: 20px;
  207. padding-top: 15px;
  208. }
  209. #login {
  210. margin-top: 2rem;
  211. }
  212. footer {
  213. border-top: 8px solid #D6D4D4;
  214. background-color: #333;
  215. position: absolute;
  216. bottom: 0;
  217. width: 100%;
  218. height: 52px;
  219. color: white;
  220. font-size: 12px;
  221. font-weight: 300;
  222. font-family: 'Open Sans', sans-serif;
  223. line-height: 24px;
  224. padding: 8px;
  225. }
  226. .btn-danger {
  227. color: #fff;
  228. background-color: #ec161e;
  229. border-color: #ec161e;
  230. }
  231. .card-signin {
  232. border: 2px solid #f90000;
  233. border-radius: 1rem;
  234. box-shadow: 0 0.3rem 0.2rem 0 rgba(101, 101, 101, 0.75);
  235. }
  236. .card-signin .card-body {
  237. padding: 2rem;
  238. }
  239. .form-signin {
  240. width: 100%;
  241. }
  242. .form-signin .btn {
  243. font-size: 90%;
  244. border-radius: 5rem;
  245. letter-spacing: .1rem;
  246. font-weight: bold;
  247. padding: 0.6rem;
  248. transition: all 0.2s;
  249. }
  250. .form-label-group {
  251. position: relative;
  252. margin-bottom: 1rem;
  253. }
  254. .form-label-group input {
  255. height: auto;
  256. border-radius: 2rem;
  257. }
  258. .form-label-group > input,
  259. .form-label-group > label {
  260. padding: var(--input-padding-y) var(--input-padding-x);
  261. }
  262. .form-label-group input:not(:placeholder-shown) ~ label > i {
  263. font-size: 11px;
  264. }
  265. .form-label-group > label {
  266. position: absolute;
  267. top: 0;
  268. left: 0;
  269. display: block;
  270. width: 100%;
  271. margin-bottom: 0;
  272. /* Override default `<label>` margin */
  273. line-height: 1.5;
  274. color: #495057;
  275. border: 1px solid transparent;
  276. border-radius: .25rem;
  277. transition: all .1s ease-in-out;
  278. }
  279. .form-label-group input::-webkit-input-placeholder {
  280. color: transparent;
  281. }
  282. .form-label-group input:-ms-input-placeholder {
  283. color: transparent;
  284. }
  285. .form-label-group input::-ms-input-placeholder {
  286. color: transparent;
  287. }
  288. .form-label-group input::-moz-placeholder {
  289. color: transparent;
  290. }
  291. .form-label-group input::placeholder {
  292. color: transparent;
  293. }
  294. .form-label-group input:not(:placeholder-shown) {
  295. padding-top: calc(var(--input-padding-y) + var(--input-padding-y) * (2 / 3));
  296. padding-bottom: calc(var(--input-padding-y) / 3);
  297. }
  298. .form-label-group input:not(:placeholder-shown) ~ label {
  299. padding-top: calc(var(--input-padding-y) / 3);
  300. padding-bottom: calc(var(--input-padding-y) / 3);
  301. font-size: 12px;
  302. color: #777;
  303. }
  304. /* Fallback for all
  305. -------------------------------------------------- */
  306. @media (min-width: 1500px) {
  307. #login {
  308. margin-top: 8rem;
  309. }
  310. }
  311. /* Alto maximo 590*/
  312. @media (max-height: 590px) {
  313. footer {
  314. position: relative;
  315. }
  316. }
  317. @media (max-width: 777px) {
  318. .footer_terminos {
  319. display: none;
  320. }
  321. footer {
  322. height: auto;
  323. }
  324. }
  325. /*Pantallas pequeñas*/
  326. @media (max-width: 540px) {
  327. #login {
  328. margin-top: 2rem;
  329. margin-bottom: 3rem;
  330. }
  331. }
  332. /* Fallback for Edge
  333. -------------------------------------------------- */
  334. @supports (-ms-ime-align: auto) {
  335. .form-label-group > label {
  336. display: none;
  337. }
  338. .form-label-group input::-ms-input-placeholder {
  339. color: #777;
  340. }
  341. }
  342. /* Fallback for IE
  343. -------------------------------------------------- */
  344. @media all and (-ms-high-contrast: none),
  345. (-ms-high-contrast: active) {
  346. .form-label-group > label {
  347. display: none;
  348. }
  349. .form-label-group input:-ms-input-placeholder {
  350. color: #777;
  351. }
  352. }
  353. </style>