<?
include ("session.php");
include ("conexion.php");
$conectar=conectarse();
switch ($boton)
{
case "Guardar":
{
// $sql="insert into ficha(codficha)values('302828')";
echo"<center>";
echo"<table width='539' border='0'>";
echo"<tr>";
//echo"<td width='119'><div align='center'><img src='file:///C|/AppServ/www/sena-inv/imagenes/sena.gif' width='84' height='83'></div></td>";
echo"<td width='404'><div align='center'>";
echo"<p><strong>EMPRESA/strong></p>";
echo"</div></td>";
echo"</tr>";
echo"</table>";
$sql="insert into contratos (cedula,nombre,cargo,contrato,email,visible)values('$cedula','$nombre','$cargo','$contrato','$email','visible')";
echo "<strong><em>Datos Almacenados</strong></em>";
echo"<form name='form1' method='post' action='contratos.php'>";
echo"<input type='submit' name='Submit' value='<< Volver'>";
echo"</form></center>";
break;
/*$sql="select * from perfiles";
$result=mysql_query($sql,$conectar);
while($row=mysql_fetch_array($result))
{
echo $row["descrpcion"];
echo "<br>";
}
break;*/
}
case "Listar":
{
echo"<center>";
echo"<table width='539' border='0'>";
echo"<tr>";
//echo"<td width='119'><div align='center'><img src='file:///C|/AppServ/www/sena-inv/imagenes/sena.gif' width='84' height='83'></div></td>";
echo"<td width='404'><div align='center'>";
echo"<p><strong>EMPRESA</strong></p>";
echo"<p><strong>891102723-8</p></strong>";
echo"</div></td>";
echo"</tr>";
echo"</table>";
echo"<br>";
echo "<table border = 2>";
echo "<tr><td><strong><center>Cedula</center></strong></td><td><strong><center>Nombre</center></strong></td><td><strong><center>Cargo</center></strong></td><td><strong><center>Contrato</center></strong></td><td><strong><center>Email</center></strong></td><td><strong><center>Visible</center></strong></td>";
$sql="select * from contratos";
{
echo "<tr><td>"; echo $row2["cedula"];
echo "</td>";
echo "<td>"; echo $row2["nombre"];
echo "</td>";
echo "<td>"; echo $row2["cargo"];
echo "</td>";
echo "<td>"; echo $row2["contrato"];
echo "</td>";
echo "<td>"; echo $row2["email"];
echo "</td>";
echo "<td>"; echo $row2["visible"];
echo "</td></tr>";
}
echo "</table>";
echo"<form name='form1' method='post' action='contratos.php'>";
echo"<input type='submit' name='Submit' value='<< Volver'>";
echo"</form>";
echo"</center>";
break;
}
case "Eliminar":
{
echo"<center>";
echo"<table width='539' border='0'>";
echo"<tr>";
echo"<td width='404'><div align='center'>";
echo"<p><strong>EMPRESA</strong></p>";
echo"</div></td>";
echo"</tr>";
echo"</table>";
echo "<form action='eliminar.php' method='post' name='form1'>";
echo "<table border = 2>";
echo "<tr><td><strong><center>Eliminar</center></strong></td><td><center><strong>Cedula</center></strong></td><td><center><strong>Nombre</center></strong></td><td><center><strong>Cargo</center></strong></td><td><center><strong>Contrato</center></strong></td><td><center><strong>Email</center></strong></td><td><center><strong>Visible</center></strong></td>";
$sql="select * from contratos";
$c=1;
{
$arregcedula[$c-1]=$row2["cedula"];
$nom="chk".$c;
echo "<tr><td><input type='checkbox' name='$nom' value=1></td>";
echo "<td>"; echo $row2["cedula"];
echo "</td>";
echo "<td>"; echo $row2["nombre"];
echo "</td>";
echo "<td>"; echo $row2["cargo"];
echo "</td>";
echo "<td>"; echo $row2["contrato"];
echo "</td>";
echo "<td>"; echo $row2["email"];
echo "</td>";
echo "<td>"; echo $row2["visible"];
echo "</td></tr>";
$c++;
}
echo "</table></center><br>
<center><input type=submit name=elim value=Eliminar></center>
</form>";
echo"<center><form name='form1' method='post' action='contratos.php'>";
echo"<input type='submit' name='Submit' value='<< Volver'>";
echo"</form></center>";
break;
}
case "Modificar":
{
echo"<center>";
echo"<table width='539' border='0'>";
echo"<tr>";
//echo"<td width='119'><div align='center'><img src='file:///C|/AppServ/www/sena-inv/imagenes/sena.gif' width='84' height='83'></div></td>";
echo"<td width='404'><div align='center'>";
echo"<p><strong>EMPRESA</strong></p>";
echo"</div></td>";
echo"</tr>";
echo"</table>";
echo "<form action='modificar.php' method='post' name='form1'>";
echo "<table border = 2>";
echo "<tr><td><strong><center>Modificar</center></strong></td><td><center><strong>Cedula</center></strong></td><td><center><strong>Nombre</center></strong></td><td><center><strong>Cargo</center></strong></td><td><center><strong>Contrato</center></strong></td><td><center><strong>Email</center></strong></td><td><center><strong>Visible</center></strong></td>";
$sql="select * from contratos";
$c=1;
{
$amod=$row2["cedula"];
echo "<tr><td><input type='radio' name='mod' value='$amod'></td>";
echo "<td>"; echo $row2["cedula"];
echo "</td>";
echo "<td>"; echo $row2["nombre"];
echo "</td>";
echo "<td>"; echo $row2["cargo"];
echo "</td>";
echo "<td>"; echo $row2["contrato"];
echo "</td>";
echo "<td>"; echo $row2["email"];
echo "</td>";
echo "<td>"; echo $row2["visible"];
echo "</td></tr>";
$c++;
}
echo "</table><br>
<center><input type=submit name=modificar value=Modificar></center>
</form>";
echo"<center><form name='form1' method='post' action='contratos.php'>";
echo"<input type='submit' name='Submit' value='<< Volver'>";
echo"</form></center>";
break;
}
}
?>