function draw_quals_table() { $quals = get_quals(true); ?> <div class="col-md-10"> <table class="table table-condensed"> <tr> <th>Name</th> <th>Level</th> <th>Value</th> <th>URL</th> </tr> <?php while($qual = $quals->fetch_array()) { //Convert the level to the appropriate name $qual['level']=qual_level_to_levelname($qual['level']); echo '<tr class='.'"quallist'; if ($qual['inactive']==1) //If the qual is inactive, this will add "inactive" to its class echo ' quallist-inactive'; echo '" onclick="openEdit('.$qual['qual_id'].')">'; echo '<td>'.$qual['name'].'</td>'; echo '<td>'.ucfirst($qual['level']).'</td>'; echo '<td>'.$qual['value'].'</td>'; echo '<td><a href="'.$qual['url'].'"> <span class="glyphicon glyphicon-link"></span></a></td>'; echo '</tr>'; } ?> <tr> <td colspan=2>Total Value</td> <td><?php echo get_qual_point_total(); ?></td> <td></td> </table> </div> <div class="col-md-2"> <button class="btn btn-default btn-sm" onclick="toggleinactive()">Toggle inactives</button> </div> <?php }
function draw_edit_qual_form($qualinfo) { ?> <form action='' method='post' role="form" class="form-horizontal"> <div class="form-group"> <label for="name" class="col-sm-2 control-label">Name</label> <div class="col-sm-10"> <input class="form-control" type='text' id="name" name='name' value='<?php echo $qualinfo['name']; ?> '> </div> </div> <div class="form-group"> <label for="url" class="col-sm-2 control-label">url</label> <div class="col-sm-10"> <input class="form-control" type='text' id="url" name='url' value='<?php echo $qualinfo['url']; ?> '> </div> </div> <!-- Qual level - Make sure selected = $qualinfo['level'] --> <div class="col-xs-6"> <div class="form-group"> <label for="level" class="col-sm-2 control-label">Level</label> <select class="form-control" name="level"> <?php for ($i = 0; $i < 3; $i++) { echo '<option value=' . $i; if ($i == $qualinfo['level']) { echo ' selected="selected"'; } echo '>'; echo ucfirst(qual_level_to_levelname($i)); echo '</option>'; } ?> </select> </div> </div> <!-- Qual value - Make sure selected = $qualinfo['value'] --> <div class="col-xs-6"> <div class="form-group"> <label for="value" class="col-sm-2 control-label">Value</label> <select class="form-control" name="value"> <?php for ($i = 1; $i <= 10; $i++) { $x = $i * 10; echo '<option value=' . $x; if ($x == $qualinfo['value']) { echo ' selected="selected"'; } echo '>'; echo $x; echo '</option>'; } ?> </select> </div> </div> <input type='hidden' name='editqual-submit' value='true'> <input type='button' class="btn btn-default" value='Update' onclick='submit()'> </form> <?php }
function draw_qual_progress_form($userinfo) { $not_done_quals = get_not_done_quals($userinfo['user_id']); echo '<form action="" method="post">'; echo '<div class="col-xs-10">'; //START col-xs-10 echo '<select class="form-control" name="qual_id">'; while ($qual = $not_done_quals->fetch_array()) { echo '<option value="' . $qual['qual_id'] . '">'; echo ucfirst(qual_level_to_levelname($qual['level'])) . ' - ' . $qual['name']; echo '</option>'; } echo '</select>'; echo '</div>'; //END col-xs-10 echo '<input type="hidden" name="finishqual-submit" value="true">'; echo '<div class="col-xs-2">'; //START col-xs-2 echo '<input type="submit" class="btn btn-default">'; echo '</div>'; //END col-xs-2 echo '</form>'; }