<?php
session_start();
 $con=mysql_connect("localhost","root",$_SESSION['claveing']);
 mysql_select_db("M01000",$con); 
 include ("emenux.php");
 ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript" src="fstandar.js"></script>
<script language="javascript">
function ponecomuna(){
 document.form1.hdcom.value=document.form1.cmbcom.value;
 }
function valida(){ 
 err=0;
 if (modulo11(document.form1.rut.value)==-1){
  window.alert("El rut ingresado es incorrecto");
  err=1;
  document.form1.rut.style.backgroundColor="#FFFFCC";
  document.form1.rut.focus();  
  }
 if (verificaMail(document.form1.email,"")==false){
  err=1;
  document.form1.email.style.backgroundColor="#FFFFCC";
  document.form1.email.focus();
  }
 if (err==0){
  document.form1.action="grabaprov.php"
  document.form1.method="post";
  document.form1.submit();
  } 
}  
</script>


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<!-- styles for demo menu #1-->
<link rel="stylesheet" href="menu.css">
<style type="text/css">
<!--
.Estilo2 {
	font-size: 36px;
	font-weight: bold;
	color: #FF0000;
	font-family: Tahoma;
}
-->
</style>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th height="50" background="images/log_top.jpg" scope="col">&nbsp;</th>
  </tr>
  <tr>
    <th scope="row"><br />
    <br />
    <br /></th>
  </tr>
  <tr>
    <th scope="row"><form id="form1" name="form1" method="post" action="">
      <div align="left">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <th scope="col"><div align="right">Rut:</div></th>
              <th scope="col"><div align="left">
                <input name="rut" type="text" id="rut" />
              </div></th>
            </tr>
            <tr>
              <th scope="row"><div align="right">Nombre:</div></th>
              <td><div align="left">
                <input type="text" name="textfield2" />
              </div></td>
            </tr>
            <tr>
              <th scope="row">Direccion::</th>
              <td><div align="left">
                  <input type="text" name="textfield2" />
              </div></td>
            </tr>
            <tr>
              <th scope="row">Comuna:</th>
              <td><div align="left">
                <label>
				<?php
				 $sqlcom="select * from m01003 order by 2;";
				 $rescom=mysql_query($sqlcom,$con) ;				
				 ?>
                <select name="cmbcom" id="cmbcom" onchange="ponecomuna()">
				 <?php 
				  while ($fila=mysql_fetch_row($rescom)){
                  echo "<option value=$fila[0]>$fila[1]</option>";
				  }
				  ?>
                </select>
                </label>
                <input name="hdcom" type="hidden" id="hdcom" />
              </div></td>
            </tr>
            <tr>
              <th scope="row">Glosa:</th>
              <td><div align="left">
                  <input type="text" name="textfield2" />
              </div></td>
            </tr>
            <tr>
              <th scope="row">Glosa:</th>
              <td><div align="left">
                  <input type="text" name="textfield2" />
              </div></td>
            </tr>
            <tr>
              <th scope="row">Glosa:</th>
              <td><div align="left">
                  <input type="text" name="textfield2" />
              </div></td>
            </tr>
            <tr>
              <th scope="row">Glosa:</th>
              <td><div align="left">
                  <input type="text" name="textfield2" />
              </div></td>
            </tr>
            <tr>
              <th scope="row">Glosa:</th>
              <td><div align="left">
                  <input type="text" name="email" id="email" />
              </div></td>
            </tr>
            <tr>
              <th scope="row">Glosa:</th>
              <td>&nbsp;</td>
            </tr>
              </table>
			  <p>
      </div>
      
            <div align="left">
              <table width="72%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="33%" scope="col">
                    
                    <div align="right">
                      <input name="cmdgra" type="button" id="cmdgra" value="Grabar" onclick="valida()" />
                    </div></td><td width="28%" scope="col">
                      
                      <div align="center">
                        <input name="cmdmod" type="button" id="cmdmod" value="Modificar" />
                      </div></td>
                  <td width="39%" scope="col">
                    <div align="left">
                      <input name="cmdel" type="submit" id="cmdel" value="Eliminar" />
                    </div></td>
                </tr>
                          </table>
            </div>
            <label>
            <div align="left"><br />
        </div>
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
        </label>
    </form>    </th>
  </tr>
  <tr>
    <th height="50" background="images/log_buttom.jpg" scope="row"><div align="left"></div></th>
  </tr>
  <!-- /Footer -->

<!-- menu script itself. you should not modify this file -->
<script language="JavaScript" src="menu.js"></script>
<!-- items structure. menu hierarchy and links are stored there -->
<!-- <script language="JavaScript" src="menu_items.js"></script>-->
<!-- files with geometry and styles structures -->
<script language="JavaScript" src="menu_tpl.js"></script>
<script language="JavaScript">
	<!--//
	// Note where menu initialization block is located in HTML document.
	// Don't try to position menu locating menu initialization block in
	// some table cell or other HTML element. Always put it before </body>

	// each menu gets two parameters (see demo files)
	// 1. items structure
	// 2. geometry structure

	new menu (MENU_ITEMS, MENU_POS);
	// make sure files containing definitions for these variables are linked to the document
	// if you got some javascript error like "MENU_POS is not defined", then you've made syntax
	// error in menu_tpl.js file or that file isn't linked properly.
	
	// also take a look at stylesheets loaded in header in order to set styles
	//-->
</script>
</table>
</body>
<?php
 mysql_close($con); ?>
</html>
