<?php print_head('Nametag'); ?> </head> <body> <div id="main"> <h1>Nametag</h1> <?php if (array_key_exists('uid', $_GET)) { echo <<<EOF \t\t\t<h2>Automagic</h2> \t\t\t<div> EOF; $pdo = new PDO('sqlite:../sucker/hovselist.db'); generate_nametag($pdo, Mole::getMoleByUid($pdo, (int) $_GET['uid'])); echo <<<EOF \t\t\t</div> EOF; } else { echo <<<EOF \t\t\t<h2>Enter Your UID</h2> \t\t\t<form action="./" method="get"> \t\t\t\t<div class="form-control"> \t\t\t\t\t<label for="uid">UID</label> \t\t\t\t\t<div class="input-group"> \t\t\t\t\t\t<input type="text" id="uid" name="uid" /> \t\t\t\t\t</div> \t\t\t\t</div> \t\t\t\t<div class="form-control">
<h2>Feel the Power</h2> <p class="text-center"> <a id="gen-class" class="btn btn gen" href="#">Generate Class Lists</a> <a id="gen-cohort" class="btn btn gen" href="#">Generate Cohort Lists</a> <a id="gen-location" class="btn btn gen" href="#">Generate Location Lists</a> <a id="gen-offices" class="btn btn gen" href="#">Generate Team Lists</a> <a id="gen-people" class="btn btn gen" href="#">Generate Office Lists</a> <a id="gen-support" class="btn btn gen" href="#">Generate Support Lists</a> <a id="gen-gender" class="btn btn gen" href="#">Generate Gender Lists</a> <a id="gen-mole" class="btn btn gen" href="#">Generate Membership Lists</a> <a id="restart-mailingset" class="btn btn gen" href="#">Restart Mailingset</a> </p> <table class="hovselist"> <tr> <th><?php $cols = Mole::getFields(); echo implode("</th>\n\t\t\t\t\t<th>", $cols); ?> </th> </tr> <?php $result = $pdo->prepare('SELECT `' . implode('`, `', array_slice(array_keys($cols), 0, -1)) . '` FROM `moles` ORDER BY `name`'); $result->execute(); while ($mole = $result->fetchObject('Mole')) { echo <<<EOF \t\t\t\t<tr id="u{$mole->uid}" class="form-control"> EOF; $majors = $mole->getMajors($pdo); foreach ($cols as $col => $label) { if ($col == 'major') {