Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/11/2009, 17:50
lobbys
 
Fecha de Ingreso: junio-2009
Ubicación: lima
Mensajes: 139
Antigüedad: 14 años, 10 meses
Puntos: 0
error en mi codifcacion o que?? Radio Button

hola maestros
Seria muy largo detallarles con todo y puntos y comillas todo el lio pero tratare de resumirlo y procurar no errar en la sintaxis.

Estoy creando un registro de ingreso y salida de personal de oficinas en php . Todo esta saliendo muy bien , pero como en todo sistema hay defectos .Obvio, se pueden resolver y por eso pido su ayuda una vez mas.

Cree radio button para seleccionar el motivo de la salida de un usuario, el porque sale de su labor; por ello ingrese los option value y cuando fui a mi php lo probe y salio muy bien, aparecia en la lista el motivo. Han pasado 4 diasy de repente ya no me muestra en mi listado el porque salio de su trabajo.

Que paso o seme metio un virus "phpiano" o que?
Aqui les mando el codigo.

Ayuda plssssssssssssssss!!!!!!

aqui es donde puse los radio button:
Código PHP:
<?
session_start
();
include(
"include/bd.php");
include(
"include/functions.php");
bd_connect();





?>


<html>
<head>
    <head>
    <title>REGISTRO</title>
        <h1 ALIGN="center"></H1>
            
    </script> 

</head>


<script language="JavaScript" type="text/javascript">
function validaBusq() {
    if(document.frmPersonal.codigo.value == "" ) {
        alert("Debe ingresar su codigo de acceso");
        document.frmPersonal.codigo.focus();
        return false;
}

marcado=false;
if(marcado=false){ 
    alert("Por favor, marque una casilla"); 
    return false; 
    } 
  
    return true; 
    
}

</script>
</head>
        
<body>
<?include ("cabecera.php");?>
<script src="http://www.clocklink.com/embed.js"></script><script type="text/javascript" language="JavaScript">obj=new Object;obj.clockfile="5005-gray.swf";obj.TimeZone="Peru_Lima";obj.width=120;obj.height=40;obj.wmode="transparent";showClock(obj);</script>


<br>
<!--<form name="frmPersonal" method="get" action="contenido2.php" target="fraBusPersonal" onsubmit="return validaBusqw();">-->
<form name="frmPersonal" method="get" action="contenido_result.php" onSubmit="return validaBusq();">
<table border="0" width="550" cellpadding="0" cellspacing="0" align="center">
<tr>
    <td valign="top">
    
        <table border="0" width="550" cellpadding="0" cellspacing="0" align="center">
        <tr>
            <td align="center"><p class="clsLblTituloPagina">Salida</p></td>
        </tr>
        <tr>
            <td><hr></td>
        </tr>
        </table><br>
            <table border="0" width="550" cellpadding="0" cellspacing="0" align="center">    
                <tr>
            <td>Código:</td>
            <td><input type="text" name="codigo" value="<?echo $_GET['codigo']?>" class="clsText" onBlur="javascript:this.value=this.value.toUpperCase();"></td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>


        </table>

        <form action=salida.php method=post>
        <h3 >Motivo de Salida:</h3><br>

<input type=radio name=tipo value=Comision checked="checked" >Comision<br>
<input type=radio name=tipo value=Salud >Salud<br>
<input type=radio name=tipo value=Asuntos_Personales >Asuntos_Personales<br>
<input type=radio name=tipo value=Salida_Tarde>Salida_Tarde<br>
<input type=radio name=tipo value=Salida_Noche >Salida_Noche<br>
<br>
<br>

<align="center"><INPUT TYPE=submit NAME=OK VALUE="Registrar"><BR>

</FORM></HTML>

<?php

if ($OK == "Registrar") {

echo 
"<B>motivo =</B>".$tipo."<br>";

//$reporte_salida= "insert into reporte_salida (`tipo`) values ('".$tipo."') Where id_per= '$cod'";

//db_query($reporte_salida);
//echo $reporte_salida;

}
?>

    
    

                </td>
        </tr>
        </table>
        
        <br>
        <table width="550" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
              <td>
                <!--<iframe name="fraBusPersonal" marginwidth=0 marginheight=0 
                    src="pagina_blanco.php" frameborder=1 
                    width=100% scrolling=no height="170"></iframe>-->
                    
                        </tr>
                        <tr>
                            <td colspan="5" height="1" bgcolor="#000000"></td>
                        </tr>
                                                </table>
                        
                    </td>
                </tr>
                </table>
                </div>
                <??>

            </td>
        </tr>
          </table>
        
    </td>
</tr>
</table>
<font style="font-size:15px;"><SCRIPT LANGUAGE="Javascript"><!--

// Get today's current date.
var now = new Date();

// Array list of days.
var days = new Array('Domingo','Lunes','Martes'Miércoles','Jueves','Viernes','S&aacute;bado');

// Array list of months.
var months = new Array('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number)    {
    return (number < 1000) ? number + 1900 : number;
                                }

// Join it all together
today =  days[now.getDay()] + " " +
              date + " " +
              months[now.getMonth()] + " " +               
                (fourdigits(now.getYear())) ;

// Print out the data.
document.write("" +today+ " ");
  
//--></SCRIPT></font></td> 

<input type="hidden" name="IDreg" value="<?echo $_GET['IDreg']?>">
</form>
<?include("pie.php");?>
</body>
Aqui debe figurar el resultado con motivo:
Código PHP:
<?
session_start
();
include(
"include/bd.php");
include(
"include/functions.php");
$cod=$_GET['codigo'];
bd_connect();

    
$personal"SELECT * FROM personal WHERE id_per = '$cod' 
                               " 
$sql_more 
                ORDER BY id_per"
;

$personal_query db_query($personal);

   
$reporte_salida="INSERT INTO reporte_salida (`id_per`, `paterno`, `materno`, `nombre`, `id_ope`, `direccion_ope`, 
                                                 `cargo`, `fecha`, `hora_salida`, `tipo`, `ip`) 
   SELECT id_per, paterno, materno, nombre, id_ope, direccion_ope, cargo, NOW(), NOW(), '"
.$tipo."','".$_SERVER['REMOTE_ADDR']."'
   FROM `personal`
   WHERE id_per = '$cod'"



if (
$OK == "Registrar") {

echo 
"<B>motivo =</B>".$tipo."<br>";

//$reporte_salida= "INSERT INTO `reporte_salida` SET `tipo`  Where id_per= '$cod'";

}

db_query($reporte_salida);
echo 
$reporte_salida;

    
?>

<html>
<head>
    <title>REGISTRO</title>
         
   
        </head>

<body>
<?include ("cabecera.php")?>
<H2 align="center"> DATOS DEL PERSONAL</H2>

<div style="height:280;width:100%;overflow:auto">
<table border="1" width="100%" cellpadding="1" cellspacing="1">
<tr>
    <td valign="top">
    <?    
                $i 
1;
        while(
$personal db_fetch_array($personal_query)) {
        
?>

        <table border="0" width="100%" cellpadding="0" cellspacing="0" >
        <td>
                                   <tr> <td class="clsTituloTabla">Código</td> 
                        <td><?echo $personal['id_per']?></td></tr>
                        <tr><td  class="clsTituloTabla">Nombres</td>
                        <td ><?echo $personal['paterno'] . ' ' $personal['materno'] . ' ' $personal['nombre']?></td></tr>
                       <tr><td  class="clsTituloTabla">id_ope</td>
                        <td ><?echo $personal['id_ope']?></td ></tr>
            <tr><td  class="clsTituloTabla">Oficina de Enlace</td>
                        <td ><?echo $personal['direccion_ope']?></td></tr>
                        <tr><td  class="clsTituloTabla">Cargo</td>
                        <td ><?echo $personal['cargo']?></td></tr>
                        <tr><td  class="clsTituloTabla">Hora</td>
                        <td ><?echo date('H:i:s',time()  ) ?></td></tr>
                        <td align="center" class="clsTituloTabla">&nbsp;</td>
                        <td align="center" class="clsTituloTabla">&nbsp;</td>
                                                         </td>
                       <td aling="right"><? echo "<img src='" $foto['imagen'] . "'>"?></td>  

                        <td //onMouseOver="this.className='dataTableRowSelected'"                                                                                        //                         onmouseout="this.className='dataTableRow'">
                                   
        </td>
        <td>
            <td colspan="7" height="1" bgcolor="#000000"></td>
        </td>
        <?
        $i
++;
        }
        
?>
        </table>
        <? 


$Fecha
date('d-m-Y',time() - 21600 ); //le sumé  horas
$Horadate('H:i:s',time()  ); //le sumé una hora 

//echo "Fecha: ".$Fecha;
//echo "<br>";
//echo "Su hora de ingreso ha sido: ".$Hora;
//echo "<br>";
 
?>
<script language=javascript>
</script>
<tr></td>
</tr>
</table>
            <td align="center">
                <td align="center">
                         <META HTTP-EQUIV= "Refresh"CONTENT="5;URL= salida.php">

                       
                        
            </td>
        </tr>


</div>

</body>
</html>