<commit_before><?$this->view('partials/head')?>

<div class="container">

  <div class="row">

  	<div class="span12">
		<script type="text/javascript" charset="utf-8">
			$(document).ready(function() {
				$('.table').dataTable({
		            "iDisplayLength": 25,
		            "aLengthMenu": [[25, 50, -1], [25, 50, "All"]],
					"bStateSave": true,
		            "aaSorting": [[3,'desc']],
				    "aoColumns": [ 
						/* Client */			null,
						/* Serial */			null,
						/* Hostname */			null,
						/* Status */			null,
						/* Expires in */		null,
						/* Timediff */	{ "bVisible":    false }
					],
		            "aoColumnDefs": [
				      { "iDataSort": 5, "aTargets": [ 4 ] }
				    ]


				});
			} );
		</script>

		<?$warranty = new Warranty()?>

		  <h1>Warranty Reports (<?=$warranty->count()?>)</h1>
		  
		  <table class="table table-striped">
		    <thead>
		      <tr>
		        <th>Client    </th>
		        <th>Serial    </th>
		        <th>Hostname   </th>
		        <th>Status</th>
				<th>Expires in</th>
				<th>Timediff</th>
		      </tr>
		    </thead>
		    <tbody>
		    <?$thirty = 60 * 60 * 24 * 30?>
			<?foreach($warranty->retrieve_many() as $client):?>
			<?$class = $client->status == 'Expired' ? 'error' : ($client->status == 'Supported' ? 'success' : 'warning');
			$timediff = strtotime($client->end_date) - time(); 
			if($timediff < $thirty){ $class = 'error';}?>
		      <tr class="<?=$class?>">
				<?$machine = new Machine($client->sn)?>
		        <td>
					<a href="<?=url("clients/detail/$client->sn")?>"><?=$machine->computer_name?></a>
				</td>
				<td><?=$machine->serial_number?></td>
				<td><?=$machine->hostname?></td>
				<td><?=$client->status?></td>
				<td><?=RelativeTime($timediff)?></td>
				<td><?=$timediff?>
		      </tr>
			<?endforeach?>
		    </tbody>
		  </table>
    </div> <!-- /span 12 -->
  </div> <!-- /row --><commit_msg>Warranty list now uses badges instead of colored rows. Easier on the eye!<commit_after><?$this->view('partials/head')?>

<div class="container">

  <div class="row">

  	<div class="span12">
		<script type="text/javascript" charset="utf-8">
			$(document).ready(function() {
				$('.table').dataTable({
		            "iDisplayLength": 25,
		            "aLengthMenu": [[25, 50, -1], [25, 50, "All"]],
					"bStateSave": true,
		            "aaSorting": [[3,'desc']],
				    "aoColumns": [ 
						/* Client */			null,
						/* Serial */			null,
						/* Hostname */			null,
						/* Status */			null,
						/* Expires in */		null,
						/* Timediff */	{ "bVisible":    false }
					],
		            "aoColumnDefs": [
				      { "iDataSort": 5, "aTargets": [ 4 ] }
				    ]


				});
			} );
		</script>

		<?$warranty = new Warranty()?>

		  <h1>Warranty Reports (<?=$warranty->count()?>)</h1>
		  
		  <table class="table table-striped">
		    <thead>
		      <tr>
		        <th>Client    </th>
		        <th>Serial    </th>
		        <th>Hostname   </th>
		        <th>Status</th>
				<th>Expires in</th>
				<th>Timediff</th>
		      </tr>
		    </thead>
		    <tbody>
		    <?$thirty = 60 * 60 * 24 * 30?>
			<?foreach($warranty->retrieve_many() as $client):?>
			<?$class = $client->status == 'Expired' ? 'important' : ($client->status == 'Supported' ? 'success' : 'warning');
			$timediff = strtotime($client->end_date) - time(); 
			if($timediff < $thirty){ $class = 'important';}?>
		      <tr>
				<?$machine = new Machine($client->sn)?>
		        <td>
					<a href="<?=url("clients/detail/$client->sn")?>"><?=$machine->computer_name?></a>
				</td>
				<td><?=$machine->serial_number?></td>
				<td><?=$machine->hostname?></td>
				<td><span class="label label-<?=$class?>"><?=$client->status?></span></td>
				<td><?=RelativeTime($timediff)?></td>
				<td><?=$timediff?>
		      </tr>
			<?endforeach?>
		    </tbody>
		  </table>
    </div> <!-- /span 12 -->
  </div> <!-- /row -->
{'fraction_non_alphanumeric': 0.23915832691814215, 'fraction_numerical': 0.014883243520656916, 'mean_word_length': 2.1977030352748153, 'pattern_counts': {'":': 18, '<': 131, '<?xml version=': 0, '>': 153, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5145002', 'n_tokens_mistral': 1755, 'n_tokens_neox': 1396, 'n_words': 245}