change status from open to closed

1

Hello everyone I would like to see if there is a way to change a survey status at the moment the user answers it.

that is, I have a task calendar, here I add new tasks and they are listed. I also have the option to perform. and what I require is that the user click here and at the time of answering the survey, change to answer. and only until the user answers it and not when clicking on Perform.

I do not know if you can help me with an example.

<?php
require 'conexion.php';
//llamamo al archivo de sesion.php
include 'header.php';
?>
<style type="text/css">
<!-- 
.estilo1 { 
font-family: Arial, Helvetica, sans-serif; 
font-size: 12px; 
color: #003366; 
} 
.estilo2 { 
color: #990000; 
font-weight: bold; 
} 
.estilo3 {font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: #660099; } 
--> 
</style>
<section id="form">
    <form class="contact_form" action="GuardarTarea.php" method="post">
        <ul>
            <li>
                <h2>Calendario de Tareas</h2>
            </li>
            <table>
                <tr><td><label for="nombre">Fecha Deseada:</label></td>
                    <td><input type="date" name="deseada" step="1" min="2013-01-01" max="2099-12-31" value="<?php echo date("Y-m-d");?>"></td></tr>
                <tr><td><label for="nombre">Fecha de Limite:</label></td>
                    <td><input type="date" name="limite" step="1" min="2013-01-01" max="2099-12-31" value="<?php echo date("Y-m-d");?>"></td></tr>
                    <tr><td><label for="sel1">Quien Realizara la Auditoria?:</label></td>
                     <td><select name="auditor" id="auditor">
                     <option value="0">elige una opción</option>
                      <?php
                      $query = $conexion -> query ("SELECT * FROM login ORDER BY id");
                        while ($valores = mysqli_fetch_array($query)) {
                         echo '<option value="'.$valores[Nombre].'">'.$valores[Nombre].'</option>';
                            }
                        ?>
                       </select></td></tr>
                 <tr><td><label for="nombre">Que Auditoria se Realizara?:</label></td>
                     <td><select name="auditoria" id="auditoria">
                     <option value="0">elige una opción</option>
                      <?php
                      $query = $conexion -> query ("SELECT * FROM encuestas ORDER BY id");
                        while ($valores = mysqli_fetch_array($query)) {
                         echo '<option value="'.$valores[titulo].'">'.$valores[titulo].'</option>';
                            }
                        ?>
                       </select></td></tr>
                 <td><input type="submit" name="opcion" class="submit" value="Guardar"></input></td>
            </table> </br>
 
            <?php
/* Realizamos la consulta SQL */
$sql="select * from tareas";
$result= mysqli_query($conexion,$sql) or die(mysqli_error());
if(mysqli_num_rows($result)==0) die("No hay registros para mostrar");
 
/* Desplegamos cada uno de los registros dentro de una tabla */  
echo "<table border=0 cellpadding=15 cellspacing=3>";
 
/*Priemro los encabezados*/
 echo "<tr>
         <th colspan=16 BGCOLOR='#BCC1C2' WIDTH='10%' face='Georgia' align='center'> Auditorias Programadas </th>
       <tr BGCOLOR='#DADDDE'>
         <th class='estilo1'> ID </th><th class='estilo1'> Auditor </th><th class='estilo1'> Auditoria </th>
         <th class='estilo1'> Fecha Deseada </th><th class='estilo1'> Fecha limite </th><th class='estilo1'> Estado </th><th class='estilo1'> Realizar </th>
      </tr>";
 
/*Y ahora todos los registros */
while($row=mysqli_fetch_array($result))
{
 echo "<tr>
         <td align='right' class='estilo1'> $row[ID] </td>
         <td class='estilo1'> $row[Auditor] </td>
         <td class='estilo1'> $row[Auditoria] </td>
         <td class='estilo1'> $row[Fdeseada] </td>
         <td class='estilo1'> $row[Flimite] </td>
             <td class='estilo1'> $row[Estado] </td>
                 <td class='estilo1'><A HREF='verEncuesta.php'> Realizar </A></td>
 
      </tr>";
}
echo "</table>";
 
?>
            
</section>
    
asked by antonio sanchez 02.04.2018 в 23:14
source

0 answers