/**
  * undocumented function summary
  *
  * Undocumented function long description
  *
  * @param type var Description
  **/
 public function get_stats($hours = 24)
 {
     $out = array();
     if (!$this->authorized()) {
         $out['error'] = 'Not authorized';
     } else {
         $mr = new Munkireport_model();
         $out = $mr->get_stats($hours);
     }
     $obj = new View();
     $obj->view('json', array('msg' => $out));
 }
		<div class="col-lg-4 col-md-6">

			<div class="panel panel-default">

			  <div class="panel-heading">

			    <h3 class="panel-title"><i class="fa fa-smile-o"></i> Munki</h3>

			  </div>

			  <div class="panel-body text-center">
			  	<?php 
$munkireport = new Munkireport_model();
$sql = "SELECT \n\t\t\t\t\tSUM(errors > 0) as errors, \n\t\t\t\t\tSUM(warnings > 0) as warnings, \n\t\t\t\t\tSUM(pendinginstalls > 0) as pending,\n\t\t\t\t\tSUM(installresults > 0) as installed \n\t\t\t\t\tFROM munkireport\n\t\t\t\t\tLEFT JOIN reportdata USING (serial_number)\n\t\t\t\t\t" . get_machine_group_filter();
?>
				<?php 
foreach ($munkireport->query($sql) as $obj) {
    ?>
				<a href="<?php 
    echo url('show/listing/munki#errors');
    ?>
" class="btn btn-danger">
					<span class="bigger-150"> <?php 
    echo $obj->errors;
    ?>
 </span><br>
					<span data-i18n="error" data-i18n-options='{"count":<?php 
    echo $obj->errors;
    ?>
}'>Errors</span>
				</a>
Ejemplo n.º 3
0
			  <tr>
			  	<th>Client</th>
			  	<th>Serial</th>
			  	<th>User</th>
			  	<th>IP</th>
			  	<th>Latest run</th>
			    <th>Name</th>
				<th>Type</th>
			  </tr>
			</thead>

			<tbody>
				<?php 
$sql = "SELECT computer_name, \n\t\t\t\t\t\t\tm.serial_number,\n\t\t\t\t\t\t\tlong_username,\n\t\t\t\t\t\t\tm.timestamp,\n\t\t\t\t\t\t\tremote_ip,\n\t\t\t\t\t\t\treport_plist\n\t\t\t\t\t\tFROM munkireport m\n\t\t\t\t\t\tLEFT JOIN machine USING (serial_number)\n\t\t\t\t\t\tLEFT JOIN reportdata USING (serial_number)\n\t\t\t\t\t\tWHERE pendinginstalls > 0\n\t\t\t\t\t\t" . get_machine_group_filter('AND');
$compress = function_exists('gzdeflate');
$mr = new Munkireport_model();
?>
				<?php 
foreach ($mr->query($sql) as $obj) {
    ?>
					<?php 
    $report_plist = unserialize($compress ? gzinflate($obj->report_plist) : $obj->report_plist);
    ?>
					<?php 
    if (isset($report_plist['AppleUpdates'])) {
        ?>
						<?php 
        foreach ($report_plist['AppleUpdates'] as $update) {
            ?>

				<tr>