zozer2404
Usuario Novato
Usuario Novato

Buenos dias, les cuento que tengo un codigo que hace la coneccion con SQL con un procedimiento almacenado. tipo select * from, pero este es un procedimiento total   exec swSp_EstCtrlTiempo 'id_departamento','',6, 2008" donde el campo que quiero que muestre esta designado por comillas simple.

ahora mi pregunta es si puedo hacer un comboBOX que me cambie el valor id_departamento por el que seleccione. en el comboBOX.

dejo el codigo haber si alguien me ayuda. le rcuerdo que el codigo funciona, pero el valor del id_departamento lo cambio directo en el codigo porlos del select name y me funciona.

<?php
$conexion_sqlserver = mssql_connect("direccion","nombre","password");
mssql_select_db("empresa");
?> (esto hace la coneccion con la base de datos EMPRESA)


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>SIGMA REPORTE...</title>
<style type="text/css">
<!--
body {
font-family: "Trebuchet MS", Tahoma, Verdana;
font-size: 12px;
font-weight: normal;
color: #666666;
text-decoration: none;
padding: 20px;
}
h4 {
color: #CC0000;
}
-->
</style>
</head>
<body>
<h4>SIGMA REPORTE...</h4>

<table class=misc_items width=100% border=1 cellpadding=0 cellspacing=0>
<tr><td align=center colspan=11><a style='font-size:11px;color:#ffffff;'
href='timeclock.php?printer_friendly=true'></a></td></tr>
<td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;'>Departamento</td>
<td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;'>Rut</td>
<td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;'>Nombre</td>
<td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;'>Anexo</td>
<td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;'>Numero de control</td>
<td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;'>Mes</td>
<td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;'>Año</td>
<td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;'>Tipo de Quincena</td>
<td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;'>Lineas</td>
<td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;'>Total de Horas</td>
</tr>

<form>
<br>
Seleccione Departamento:
<select name=id_departamento>
<option value=1>SERVICIOS CONTABLES</option>
<option value=2>TRIBUTARIA</option>
<option value=3>AUDITORIA FINANCIERA</option>
<option value=4>PAYROLL</option>
<option value=5>CONSULTING SOPORTE TI</option>
<option value=4>ADMINISTRACION</option>
</select><br>
</form>
<br>

<?php
$consulta_sql = mssql_query("exec swSp_EstCtrlTiempo 'id_departamento','',6, 2008",$conexion_sqlserver);
while ($registro = mssql_fetch_array($consulta_sql)) ((( ESTO HACE LA CONSULTA A LA BASE DE DATOS))))




{
echo "<tr><td width=113> ".$registro[0]."<br>";
echo " <td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;font-size:11px;color:#27408b;'> ".$registro[1]; echo "-".$registro[2]."<br>";
echo " <td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;font-size:11px;color:#27408b;'> ".$registro[3]."<br>"; echo " ".$registro[4]."<br>";
echo " <td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;font-size:11px;color:#27408b;'> ".$registro[5]."<br>";
echo " <td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;font-size:11px;color:#27408b;'> ".$registro[6]."<br>";
echo " <td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;font-size:11px;color:#27408b;'> ".$registro[7]."<br>";
echo " <td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;font-size:11px;color:#27408b;'> ".$registro[8]."<br>";
echo " <td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;font-size:11px;color:#27408b;'> ".$registro[9]."<br>";
echo " <td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;font-size:11px;color:#27408b;'> ".$registro[10]."<br>";
echo " <td nowrap width=20% align=center style='padding-left:10px;padding-right:10px;font-size:11px;color:#27408b;'> ".$registro[11]."<br>";
}
?>

¿puedo tener el form en el mismo PHP?

ATENCIÓN: Este tema no tiene actividad desde hace más de 6 MESES,
te recomendamos abrir un nuevo tema en lugar de responder al actual
Opciones:
Ir al subforo:
Permisos:
TU NO PUEDES Escribir nuevos temas
TU NO PUEDES Responder a los temas
TU NO PUEDES Editar tus propios mensajes
TU NO PUEDES Borrar tus propios mensajes
Temas similares
TemaUsuariosRespuestasVisitasActividad
Por: , el 08/May/2008, 17:32
makezano NoSetup.org K1ll1ng_M4ch1n322kMay/08
Por: , el 30/Nov/2011, 15:59
becest GestionXls e.aragona25kDec/11
Por: , el 06/Abr/2014, 04:51
illapa_79 NoSetup.org12kApr/14
Por: , el 10/Feb/2012, 15:26
Lepon NoSetup.org Tito2923Feb/12
Por: , el 02/Oct/2011, 07:22
MegaBedder Josepepe033 GestionXls94kOct/11