67 行
		
	
	
	
		
			1.6 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
		
		
			
		
	
	
			67 行
		
	
	
	
		
			1.6 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
|  | 
 | ||
|  | <div class="container"> | ||
|  | 	<h1><?php echo $page_title; ?></h1>
 | ||
|  | 
 | ||
|  | 	<!-- Sub Nav for Awards --> | ||
|  | 	 | ||
|  |     <?php $this->load->view("awards/nav_bar")?>
 | ||
|  |      | ||
|  | 	<table class="table table-striped table-hover"> | ||
|  | 	<thead> | ||
|  |         <tr> | ||
|  |         <td style="width:225px">DOKs (<?php echo count($doks)?>)</td>
 | ||
|  |     <?php | ||
|  | 	foreach ($worked_bands as $slot) { | ||
|  | 		echo "          <td>$slot</td>\n"; | ||
|  | 	} | ||
|  |     ?>
 | ||
|  |         </tr> | ||
|  |     </thead> | ||
|  |     <tbody> | ||
|  |     <?php | ||
|  |         foreach($doks as $dok=>$val){ | ||
|  |             print("<tr><td>$dok</td>"); | ||
|  |             foreach($val as $band=>$count){ | ||
|  | 		if (in_array($band, $worked_bands)) { | ||
|  | 	                if ($count == 0){ | ||
|  | 	      	             print("<td> </td>"); | ||
|  | 	                }else{ | ||
|  | 	                    printf("<td><a href='dok_details?Dok=\"%s\"&Band=\"%s\"'>%d</a></td>", str_replace("&", "%26", $dok), $band, $count); | ||
|  | 	                } | ||
|  | 		}  | ||
|  |             } | ||
|  |             print("</tr>"); | ||
|  |         } | ||
|  | 
 | ||
|  |     ?>
 | ||
|  |     </tbody> | ||
|  | 
 | ||
|  | 	</table> | ||
|  | 	<style> | ||
|  |         #table-fixed{
 | ||
|  |             position: fixed; | ||
|  |             top: 40px; | ||
|  |             display: none; | ||
|  |             background-color: white; | ||
|  |             border: 1px solid black; | ||
|  |         } | ||
|  | 	</style> | ||
|  | 	<script> | ||
|  | 	var tableOffset = $(".zebra-striped").offset().top-40; | ||
|  | 	$('#table-fixed').width($(".zebra-striped").width()); | ||
|  | 	var $header = $(".zebra-striped > thead").clone(); | ||
|  | 	var $fixedHeader = $("#table-fixed").append($header); | ||
|  | 
 | ||
|  | 	$(window).bind("scroll", function() { | ||
|  | 	    var offset = $(this).scrollTop(); | ||
|  | 
 | ||
|  |         if (offset >= tableOffset && $fixedHeader.is(":hidden")) { | ||
|  | 	        $fixedHeader.show(); | ||
|  | 	    } | ||
|  | 	    else if (offset < tableOffset) { | ||
|  | 	        $fixedHeader.hide(); | ||
|  | 	    } | ||
|  | 	}); | ||
|  | 	</script> | ||
|  | </div> |