Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['data']))
- {
- $servername = "xxx.xxx.x.xx";
- $username = "xxxxx";
- $password = "xxxxxxxx";
- $dbname = "xxxxxxx";
- $conn = new mysqli($servername, $username, $password, $dbname);
- $conn->set_charset('utf8');
- $inicio = mysqli_real_escape_string($conn, $_POST['data']);
- $sql = "SELECT `regOratorio`.`DataEntrada`,
- `regOratorio`.`Utente`,
- `regOratorio`.`Estado`,
- `regOratorio`.`Observacao`,
- `regOratorio`.`Colaborador`
- FROM `centrodb`.`regOratorio` WHERE DataEntrada = '$inicio'";
- $estado = $_POST['Estado'];
- $observacao = $_POST['Observacao'];
- $result=mysqli_query($conn, $sql);
- if (!$result) {
- echo 'There are no results for your search';
- } else {
- echo '<form name="customer_details" action="" method="POST" onsubmit="return alguma_funcao()">';
- }
- while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
- {
- echo "<fieldset>";
- echo "<table cellspacing='10'>";
- echo "<tr>";
- echo "<td>";
- echo "<label>Utente</label>";
- echo "<input id='' type='text' value='".$row['Utente']."'";
- echo "<label>Estado</label>";
- echo "<input type='radio' id='Estado' name='Estado' value='Presente' " . ( ($row['Estado']=='Presente') ? 'checked' : '' ) ."> Presente";
- echo "<input type='radio' id='Estado' name='Estado' value='Ausente' " . ( ($row['Estado']=='Ausente') ? 'checked' : '' ) ."> Ausente";
- echo "<label>Observacao</label>";
- echo "<input type='text' id='Observacao' name='Observacao' value='".$row['Observacao']."'";
- echo "</td>";
- echo "</tr>";
- echo "</table>";
- echo "</fieldset>";
- echo "<fieldset>";
- echo "<table cellspacing='10'>";
- echo "<tr>";
- echo "<td>";
- echo "<input type='text' value='".$row['Colaborador']."'";
- echo "</td>";
- echo "</tr>";
- echo "</table>";
- echo "</fieldset>";
- }
- echo "</form>";
- mysqli_close($conn);
- }
- else
- {
- ?>
- <?php
- }
- ?>
Add Comment
Please, Sign In to add comment