PHP Classes

File: web/presenca-edit.php

Recommend this page to a friend!
  Classes of Rodrigo Faustino   PHP CRUD Application   web/presenca-edit.php   Download  
File: web/presenca-edit.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP CRUD Application
Show how to create a simple CRUD application
Author: By
Last change:
Date: 6 months ago
Size: 2,256 bytes
 

Contents

Class file image Download
<?php require_once "web/header.php"; ?>

<form name="frmAdd" method="post" action="" id="frmAdd" onSubmit="return validate_pres_edit();">
    <div>
    <?php
        $attendance_timestamp
= strtotime($presenca_date);
       
$presenca_date = date("m-d-Y", $attendance_timestamp);
   
?>
<input name="data_presenca" id="data_presenca" class="demoInputBox" disabled value="<?php echo $presenca_date; ?>">
    </div>
    <div id="toys-grid">
        <table cellpadding="10" cellspacing="1">
            <thead>
                <tr>
                    <th><strong>Estudante</strong></th>
                    <th><strong>Presença</strong></th>
                    <th><strong>Falta</strong></th>
                </tr>
            </thead>
            <tbody>
                    <?php
           
if (! empty($estudanteResult)) {
                foreach (
$estudanteResult as $k => $v) {
                   
$presentChecked = "";
                   
$absentChecked = "";
                    if(
$estudanteResult[$k]["id"] == $result[$k]["estudante_id"]) {
                        if(
$result[$k]["presenca"] == 1) {
                           
$presentChecked = "checked";
                        } else if(
$result[$k]["falta"] == 1) {
                           
$absentChecked = "checked";
                        }
                    }
           
?>
<tr>
            <td><input type="hidden" name="estudante_id[]" id="estudante_id" value = "<?php echo $estudanteResult[$k]["id"]; ?>">
            <?php echo $estudanteResult[$k]["nome"]; ?></td>
                    <td><input type="radio" name="presenca-<?php echo $estudanteResult[$k]["id"]; ?>" value="presenca" <?php echo $presentChecked; ?> /></td>
                    <td><input type="radio" name="presenca-<?php echo $estudanteResult[$k]["id"]; ?>" value="falta" <?php echo $absentChecked; ?> /></td>
            </tr>
                    <?php
                       
}
                    }
                   
?>
<tbody>
        </table>
    </div>
   <div>
        <input type="submit" name="add" id="btnSubmit" value="Salvar" />
    </div>
</form>
<script src="web/js/jquery-2.1.1.min.js"></script>
<script src="web/js/validador.js" ></script>
</body>
</html>