Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/04/2011, 08:34
portela85
 
Fecha de Ingreso: abril-2011
Mensajes: 103
Antigüedad: 13 años, 1 mes
Puntos: 3
Respuesta: recuperar datos para un formulario tipo checkbox y select

sigo con los archivos
la plantilla desde la que agrego y modifico:
Código:
  <?= $cabecera ?>  
        <div id="formulario">
<header><h1>Reporte de actividades</h1></header>
<div id="report_left">
    
    <FORM method="post" action="reportes.php">
    <input type="hidden" name="accion" value="<?php if(isset($accion)) print $accion;?>">
    <input type="hidden" value="<?php if(isset($trabajo->idtrabajo)){ print $trabajo->idtrabajo;} ?>">
    
        <span>Grupos:</span>
            <?php echo $grupo;   ?> 
                     
        <span>Proyecto:</span>
            <?php echo $proyecto; ?> 
        
        <span>Cliente:</span>
            <?php echo $cliente; ?>
            
        <span>Interlocutor</span>
            <?php echo $interlocutor;?>
        
        <span>Actividad:</span>
            <?php echo $actividad ?>
            
        <span>Fecha de inicio:</span>
            <input name="fechainicio" id="demo1" type="text" size="25" class="fechas" value="<?php if(isset($trabajo->f_inicio)){ print $trabajo->f_inicio;} ?>"/><a href="javascript:NewCal('demo1','ddmmyyyy')"><img src="js/cal.gif" width="16" height="16" border="0" alt="Selecciona una fecha de Inicio"></a>        
            
        <span>Fecha de fin</span>
            <input name="fechafin" id="demo2" type="text" size="25" class="fechas" value="<?php if(isset($trabajo->f_fin)){ print $trabajo->f_fin;} ?>"/><a href="javascript:NewCal('demo2','ddmmyyyy')"><img src="js/cal.gif" width="16" height="16" border="0" alt="Selecciona una fecha de Fin, si quieres..."></a>        
        
        <span>Descripci&oacute;n:</span>
        <textarea name="descripcion" value="<?php if(isset($trabajo->descripcion)){ print $trabajo->descripcion;} ?>"><?php if(isset($trabajo->descripcion)){ print $trabajo->descripcion;} ?></textarea>

        
</div>

<div id="report_right">
        
        
        <span>Status</span>
            <?php echo $statu;?>
        
        <span>Descripci&oacute;n del Status si Suspendido:</span>
             <textarea name="descripcionstatus" value="<?php if(isset($trabajo->descripcionstatus)){ print $trabajo->descripcionstatus;} ?>"><?php if(isset($trabajo->descripcionstatus)){ print $trabajo->descripcionstatus;} ?></textarea>
       
        <fieldset id="primero">
        <span>Cantidad:</span>
        <input type="text" name="cantidad" value="<?php if(isset($trabajo->cantidad)){ print $trabajo->cantidad;} else{print "1";} ?>"/>

        <span>Escalado:</span>
        <input type="text" name="escalado" value="<?php if(isset($trabajo->escalado)){ print $trabajo->escalado;} else{print "1";} ?>"/>
        
        <span>si escalado distinto de 1(jquery)</span>
        <textarea name="descripcionescalado" value="<?php if(isset($trabajo->descripcionescalado)){ print $trabajo->descripcionescalado;} ?>"><?php if(isset($trabajo->descripcionescalado)){ print $trabajo->descripcionescalado;} ?></textarea>
        </fieldset>
        
        <fieldset>
        <label>
        <input type="checkbox" name="pago" value="<?php if(isset($trabajo->pago)){ print $trabajo->pago;}  ?>"/>Pago Actuaci&oacute;n
        </label>
        
        <label>
        <input type="checkbox" name="nocturna" class="check"/>Nocturna
        </label >
 
         <label>
        <input type="checkbox" name="pagohoras" class="check"/>Pago de horas
        </label >
         
        <select name="horas">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="6">6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
        </select> 
          <!--      <script>  
                    if(!Modernizr.inputtype.number) {  input.stepUp(n);
                    input.stepDown(n);
                    input.valueAsNumber}</script>
        
                <button name="stepUp">
                <button name="stepDown">-->
        
<!--<input type="number" min="1"  step="1" value="1" class="spinbox">-->

        </fieldset>
        
        
        <input name="submit" type="submit" value="Env&iacute;a el trabajito!"/>
    </FORM>
    
</div>
</div>
        
  <?= $pie?>
?>[/CODE]

y la plantilla reporte_inicio.tpl.php

Código:
<?= $cabecera ?>
<p>Desde aqu&iacute; podemos administrar todo lo relativo a los Trabajos.</p>

<p><font color=red><?php if (isset($error_msg)) print $error_msg;?></font></p>
<table border="1" bgcolor="#ffffff" cellspacing="0" cellpadding="3" width="55%" align="left">
    
<tr>
<th colspan="10" align="left"><h3>Reportes | <a href="reportes.php?accion=anadir">A&ntilde;adir Actividad</a> </h3> </th>
</tr>

<tr>
<th colspan="10" align="left"><h3>Listado de actividades reportadas en el d&iacute;a de hoy.</h3> </th>
</tr>

<tr>
<!--<th>Indicador</th>
<th>Grupo</th>-->
<th>Cliente</th>
<th>Proyecto</th>
<th>Interlocutor</th>
<th>Fecha Inicio</th>
<!--<th>Fecha Fin</th>-->
<th>Descripcion</th>
<!--<th>Cantidad</th>
<th>Escalado</th>
<th>Descripcion Escalado</th>
<th>Precio Total</th>
<th>Pago Actuación</th>
<th>Nocturna</th>
<th>Comentarios</th>-->
<!--<th>Status</th>
<th>Descripcion Status</th>-->
<th>Actividad</th>
<!--<th>Precio</th>-->
<th>Talla</th>
<!--<th>Consultor</th>
<th>Pago horas</th>
<th>Horas</th>-->
<th>Acciones Posibles</th>
</tr>

<?php 
if (isset($reportes_lista_de_hoy) && count($reportes_lista_de_hoy)>0) {
    $i=1;
    foreach ($reportes_lista_de_hoy as $reportehoy) {
?>

<tr>
<!--<td bgcolor="#ffffff"><b><?=$reportehoy['indicador'];?></b></td>
<td ><b><?=$reportehoy['grupo'];?></b></td>-->
<td ><b><?=$reportehoy['cliente'];?></b></td>
<td ><b><?=$reportehoy['proyecto'];?></b></td>
<td ><b><?=$reportehoy['interlocutor'];?></b></td>
<td ><b><?=$reportehoy['fechainicio'];?></b></td>
<!--<td ><b><?=$reportehoy['fechafin'];?></b></td>-->
<td ><b><?=$reportehoy['descripcion'];?></b></td>
<!--<td ><b><?=$reportehoy['cantidad'];?></b></td>
<td ><b><?=$reportehoy['escalado'];?></b></td>
<td ><b><?=$reportehoy['descripcionescalado'];?></b></td>
<td ><b><?=$reportehoy['preciotot'];?></b></td>
<td ><b><?=$reportehoy['pagoactuacion'];?></b></td>
<td ><b><?=$reportehoy['nocturna'];?></b></td>
<td ><b><?=$reportehoy['comenta'];?></b></td>-->
<!--<td ><b><?=$reportehoy['status'];?></b></td>
<td ><b><?=$reportehoy['descripcionstatus'];?></b></td>-->
<td ><b><?=$reportehoy['actividad'];?></b></td>
<!--<td ><b><?=$reportehoy['precio'];?></b></td>-->
<td ><b><?=$reportehoy['talla'];?></b></td>
<!--<td ><b><?=$reportehoy['consultor'];?></b></td>
<td ><b><?=$reportehoy['pagohoras'];?></b></td>
<td ><b><?=$reportehoy['horas'];?></b></td>-->

<td>	<a href="reportes.php?accion=editar&idtrabajo=<?=$reportehoy['idtrabajo'];?>">Editar</a>&nbsp;&nbsp;
	<a href="reportes.php?accion=vereliminar&idtrabajo=<?=$reportehoy['idtrabajo'];?>">Borrar</a> </td>
</tr>

<?php
 
   }}
 else {
	print 'No hay proyectos... ¡Qu&eacute; vergüenza!';
}
?>


</table>

<?= $pie ?>
Muchas gracias por la ayuda!