<?php
 
session_start();
include("DMMYSQLG.php");
?>
<html>
<head>
<title>Hotel Manager System</title>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="menu_mer/men_car/stm31.js"></script>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
</head>
<body>

<?php

//buscar operador y su clave de venndedor si es 
if($_SESSION['tip_ope']==1){
	@$bus32= mysqli_query($con ,"SELECT * FROM amcatven where cod_ven = '".$_SESSION['ope_vot']."'");
	$reg32=mysqli_num_rows($bus32); 
	if($reg32 == 1){
		$_SESSION['vendedor']=$_SESSION['ope_vot'];
		$_SESSION['tip_ven']=1;
		include("menu_mer/men_pro/menu5.inc");
		exit();
	}
}

if(isset($_POST['t1'])){
	@$sql= mysqli_query($con ,"SELECT * FROM amcatven where cod_ven = '".$_POST['t1']."' && contrasea = '".$_POST['cont']."'");
	$ns=mysqli_num_rows($sql); 
	if($ns==1){
		$_SESSION['vendedor']=$_POST['t1'];
		$_SESSION['tip_ven']=1;
		include("menu_mer/men_car/menu5.inc");
		//echo 'Bienvenido: ' .$_SESSION['vendedor'];
	}else{
		echo '<meta content="0; url=DM41120.php"  HTTP-EQUIV="REFRESH">';
	}
}else{
?>
<form name="frm1" method="post" action="">
<table width="366"  align="center">
  <tr>
    <td width="69">Ejecutivo: </td>
    <td width="161">
      <select name="t1" tabindex="1">
<?php

@$sql=mysqli_query($con ,"SELECT * FROM amcatven");
while($reg = mysqli_fetch_array($sql)){
	echo '<option value="'.$reg['cod_ven'].'">'.$reg['nom_ven']. ' '  . $reg['apa_ven'] . ' ' . $reg['ama_ven']. '</option>';
}
?>
      </select>
    
    </td>
  </tr>
  <tr>
    <td>Contrase&ntilde;a</td>
    <td><input name="cont" type="password" size="20" /></td>
  </tr>
  <tr>
    <td colspan="2"><div align="center">
      <input type="button" name="Button" value="Acceder" onClick="openpage('DM41120.php','_self')"/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="button" name="Submit2" value="Regresar" onClick="openpage('DM41100.php','_self')">
    </div></td>
  </tr>
</table>
</form>
<?php
 }?>
</body>
</html>
