<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/js/swal/sweetalert.css');?>">
<script src="<?php echo base_url('assets/js/swal/sweetalert.js');?>"></script>
<link rel="stylesheet" href="<?php echo base_url('assets/peta/leaflet.css');?>" />
<script src="<?php echo base_url('assets/peta/leaflet-src.js');?>"></script>
</script>
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            Dashboard
            <small>Version <?php echo $versiapp;?></small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
            <li class="active">Dashboard</li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content">
	<?php
	$kemarin = date('Y-m-d', strtotime("-1 day", strtotime(date("Y-m-d"))));
	$hariini = date("Y-m-d");
	//echo $kemarin."<br>".$hariini;
	?>
        <!-- Info boxes -->
        <div class="row">
            <div class="col-md-6 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-aqua"><i class="fa fa-users"></i></span>
                    <div class="info-box-content">
                        <span class="info-box-text">Jumlah Siswa</span>
						<?php
						$puser=$this->db->query("SELECT * FROM web_siswa");
						$juser=$puser->num_rows();
                        echo '<span class="info-box-number">'.$juser.'</span>';
						?>
                    </div><!-- /.info-box-content -->
                </div><!-- /.info-box -->
            </div><!-- /.col -->
            <div class="col-md-6 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-red"><i class="fa fa-file"></i></span>
                    <div class="info-box-content">
                        <span class="info-box-text">Jumlah Absensi</span>
                        <?php
						$puser=$this->db->query("SELECT * FROM web_absen");
						$juser=$puser->num_rows();
                        echo '<span class="info-box-number">'.$juser.'</span>';
						?>
                    </div><!-- /.info-box-content -->
                </div><!-- /.info-box -->
            </div><!-- /.col -->


        </div><!-- /.row -->

        <div class="row">
			<div class="col-md-12 font">
				<div style="display:block">
					<h1 class="text-<?php echo $warna;?> bold uppercase"><b><?php echo strtoupper($statusserver);?></b></h1>
				</div>
				<div class="alert alert-<?php echo $warna;?>">
					<span><?php echo $keterangan;?></span>
				</div>
        <!--<?php echo $map['html']; ?>
        <?php echo $map['js']; ?>-->
        <div id="map" style="width:100%; height:400px;"></div>
        <script type='text/javascript'>
        	var map = new L.Map('map', {
        		 	 	 center: new L.LatLng(<?php echo $koordinat;?>),
        		 	 	 zoom: 12
        	});
        // create marker in map
        L.tileLayer("https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png", {attribution: '<?php echo $namasek;?>'}).addTo(map)
        L.marker([<?php echo $koordinat;?>],({})).addTo(map).bindPopup("<?php echo $namasek;?>").openPopup();
		var lat, lng;

		map.addEventListener('mousemove', function(ev) {
		   lat = ev.latlng.lat;
		   lng = ev.latlng.lng;
		});

		document.getElementById("map").addEventListener("contextmenu", function (event) {
			event.preventDefault();

			// Add marker
			 L.marker([lat, lng]).addTo(map);
			alert(lat + ' - ' + lng);

			return false; // To disable default popup.
		});
      </script>
			</div>
		</div>

    </section><!-- /.content -->
