function getAttributes($room = null) { if ($room == null) { die; } $_SESSION["APP"]["room"] = $room; $complaint = new complaintArray(); $data = $complaint->loadByRoom($room); include_once APP_PATH . 'templates/attributes.php'; }
<?php /** * Created by PhpStorm. * User: chris * Date: 2/23/16 * Time: 11:08 AM */ define('DB_NAME', 'ffpac'); /** MySQL database username */ define('DB_USER', 'ffpac'); /** MySQL database password */ define('DB_PASS', '2sJrDmQnhahzSCjM'); /** MySQL hostname */ define('DB_HOST', 'localhost'); /** Database Charset to use in creating database tables. */ define('DB_CHARSET', 'utf8mb4'); /** The Database Collate type. Don't change this if in doubt. */ define('DB_COLLATE', ''); include_once "DBCon.php"; include_once "BaseDB.php"; include_once "ArrayClass.php"; include_once "complaint.php"; $complaint = new complaintArray(); $complaint->load(); echo "<pre>"; print_r($complaint->loadByRoom(1)); echo "</pre>";
<?php foreach ($_REQUEST as $key => $value) { echo "<tr><td>{$key}</td><td>{$value}</td>"; } ?> </tbody> </table> </div> </div> <?php } ?> <div id="complaints" class="table-responsive"> <?php if (isset($_SESSION["APP"]["room"]) && !empty($_SESSION["APP"]["room"])) { $complaints = new complaintArray(); $data = $complaints->loadByRoom($_SESSION["APP"]["room"]); include_once ABSPATH . '/Application/templates/complaints.php'; } ?> </div> <?php } else { ?> <h1 class="page-title">Please select a room</h1> <a href="/room-select">Click here to select a room</a> <?php } ?> </div> <?php