<?php require_once('Connections/odonto_connection1.php'); 

if(isset($_GET['deslogeo'])){
session_start();
session_destroy();}

if (!isset($_SESSION)) {session_start();}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {$_SESSION['PrevUrl'] = $_GET['accesscheck'];}
if (isset($_POST['textfield'])) {$loginUsername=$_POST['textfield'];
  //$password=md5($_POST['textfield2']);
  $password=$_POST['textfield2'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "./ajax/examples/negocio_0.php";
  $MM_redirectLoginFailed = "../../index.php?denuevo";
  $MM_redirecttoReferrer = false;
  $LoginRS__query=sprintf("SELECT user, contra FROM ingreso WHERE user='%s' AND contra='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password)); 
  $LoginRS = mysqli_query($odonto_connection,$LoginRS__query) or die(mysql_error());
  $loginFoundUser = mysqli_num_rows($LoginRS);
  if ($loginFoundUser) {$loginStrGroup = "";   //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;	      
    if (isset($_SESSION['PrevUrl']) && false) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];}
    header("Location: " . $MM_redirectLoginSuccess );}
  else {header("Location: ". $MM_redirectLoginFailed ); }} ?>
  
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>PonderZone</title>

<?php require_once('./inc/bootstrap.php');?>
	
<script>
	function Volver(){
				window.open("http://ponderzone.com","_parent");
			}
</script>
	
</head>
<body>

<?php require_once('./inc/cabecera.php');?>
<br>


	<div class="container-fluid" >

	
		<?php if(!isset($_GET['deslogeo'])){
			?>
		<div class="row">
		<div class="col">
		<h3><b>Ingresa Tus Claves</b></h3>
		<div class="page_text">
			<form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction;?>">


						<div >
							<label for="usuario" class="h6"><b>Usuario:</b></label>
						</div>
						<input type="text" class="form-control"  type="text" name="textfield" size="20"/>
						<div>
							<label for="contra" class="h6"><b>Contrase&ntilde;a:</b></label>
						</div>
						<b>
						<input type="password" class="form-control"  type="password" name="textfield2" size="20"/>
						<br>
						<div>
							<input type="submit" class="btn btn-info" name="Submit" value="Entrar" />
							<input type="button" class="btn btn-secondary" name="volver" id="volver" value="Volver" onclick="Volver()"/>
						</div>
						</b>

			</form><?php 
			
			if(isset($_GET['denuevo'])) echo "<div style='position:relative;top:170px;left:50px'>
						<h3>Ingrese nuevamente por favor</h3></div>";
			}
			else
			{
			
			?>		
			<div style="position:relative;left:0px"><h3>GRACIAS POR UTILIZAR PONDERZONE</h3></div><div class="page_text"><br>Para m&aacute;s informaci&oacute;n: <u>contacto@pondercom.com</u></div>
			<div class=""><br>o al: 3416656878</div>
			<a href="index.php"><h1 style="color:#81F7F3"><font onMouseOver="this.style.cursor='hand'; this.style.color='lightblue';" onMouseOut="this.style.color='darkblue';">INGRESAR NUEVAMENTE</font></h1></a>
			
			<?php }	?>
			
		</div>
		<br>
		<div class="row">
			<div class="col">
				<iframe width="853" height="480" src="https://www.youtube.com/embed/z1EWie2VVzI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>		
			</div>
		</div>
	</div>
	</div>
	</div>




</body>
</html>