Skip to content

Commit

Permalink
Select all checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ollie Armstrong committed Jun 4, 2012
1 parent acbd611 commit bd6b78e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions js/generic.js
@@ -1,5 +1,15 @@
jQuery(document).ready( function(){

jQuery('.wpsqt-selectall').click( function() {
if (jQuery(this).attr('checked') == 'checked') {
jQuery('.wpsqt-delete').attr('checked', 'checked');
jQuery('.wpsqt-selectall').attr('checked', 'checked');
} else {
jQuery('.wpsqt-delete').removeAttr('checked');
jQuery('.wpsqt-selectall').removeAttr('checked');
}
});

jQuery('#add_section_quiz').click( function(){
var rowCount = jQuery('#section_table tbody tr').length;
var html = '';
Expand Down
6 changes: 3 additions & 3 deletions pages/admin/results/index.php
Expand Up @@ -49,7 +49,7 @@
<table class="widefat post fixed" cellspacing="0">
<thead>
<tr>
<th scope="col" width="30"><input type="checkbox" class="selectall" /></th>
<th scope="col" width="30"><input type="checkbox" class="wpsqt-selectall" /></th>
<th class="manage-column" scope="col" width="35"><a href="<?php echo WPSQT_URL_MAIN; ?>&section=results&subsection=quiz&id=<?php echo urlencode($_GET['id']); ?>&orderby=id&order=<?=$order?><?php if (isset($_GET['status'])) { echo '&status='.$_GET['status']; } ?>">ID</a></th>
<th class="manage-column column-title" scope="col"><a href="<?php echo WPSQT_URL_MAIN; ?>&section=results&subsection=quiz&id=<?php echo urlencode($_GET['id']); ?>&orderby=person_name&order=<?=$order?><?php if (isset($_GET['status'])) { echo '&status='.$_GET['status']; } ?>">Title</a></th>
<th scope="col" width="75"><a href="<?php echo WPSQT_URL_MAIN; ?>&section=results&subsection=quiz&id=<?php echo urlencode($_GET['id']); ?>&orderby=score&order=<?=$order?><?php if (isset($_GET['status'])) { echo '&status='.$_GET['status']; } ?>">Score</a></th>
Expand All @@ -61,7 +61,7 @@
</thead>
<tfoot>
<tr>
<th scope="col" width="30"><input type="checkbox" class="selectall" /></th>
<th scope="col" width="30"><input type="checkbox" class="wpsqt-selectall" /></th>
<th class="manage-column" scope="col" width="35"><a href="<?php echo WPSQT_URL_MAIN; ?>&section=results&subsection=quiz&id=<?php echo urlencode($_GET['id']); ?>&orderby=id&order=<?=$order?><?php if (isset($_GET['status'])) { echo '&status='.$_GET['status']; } ?>">ID</a></th>
<th class="manage-column column-title" scope="col"><a href="<?php echo WPSQT_URL_MAIN; ?>&section=results&subsection=quiz&id=<?php echo urlencode($_GET['id']); ?>&orderby=person_name&order=<?=$order?><?php if (isset($_GET['status'])) { echo '&status='.$_GET['status']; } ?>">Title</a></th>
<th scope="col" width="75"><a href="<?php echo WPSQT_URL_MAIN; ?>&section=results&subsection=quiz&id=<?php echo urlencode($_GET['id']); ?>&orderby=score&order=<?=$order?><?php if (isset($_GET['status'])) { echo '&status='.$_GET['status']; } ?>">Score</a></th>
Expand All @@ -74,7 +74,7 @@
<tbody>
<?php foreach( $results as $result ){ ?>
<tr>
<td><input type="checkbox" name="delete[]" value="<?=$result['id']?>" /></td>
<td><input type="checkbox" name="delete[]" value="<?=$result['id']?>" class="wpsqt-delete" /></td>
<th scope="row"><?php echo $result['id']; ?></th>
<td class="column-title">
<strong>
Expand Down

0 comments on commit bd6b78e

Please sign in to comment.