<?php

/**
 * Harian
 */

Slim::get('/registrasi/piket/harian',function() {
	User::check_login('registrasi');

	if (isset($_GET['tgl'])) {
		$d = explode('-',$_GET['tgl']);
		$time = mktime(0, 0, 0, $d[1], $d[0], $d[2]);
	} else { $time = time(); }
	
	$data = Piket::getByDate($time);
	$poli = Poli::getAll();
	foreach ($poli as $k=>$p) {
		$poli[$k]['dokter'] = UserPoli::getByPoli($p['id']);
	}
	
	Slim::render("registrasi/piket/harian.html",array(
		"data"=>$data,
		"poli"=>$poli,
		"tgl"=>date("d-M-Y",$utime),
		"tgl_js"=>date("F d,Y",$utime),
		"tgl_get"=>date("d-m-Y",$utime)
	));
})->name('registrasi_piket_harian');

Slim::post('/registrasi/piket/harian/',function() {
	User::check_login('registrasi');
	
	
});

/**
 * Shift
 */

Slim::get('/registrasi/piket/shift/',function() {
	User::check_login('registrasi');
	
	$akun = Akun::getByBidang("admin");
	Slim::render("registrasi/piket/shift.html",array(
		"akun"=>$akun,
		"tgl"=>date("d-m-Y",time()),
		"tgl_js"=>date("F d,Y",time())
	));
})->name('registrasi_piket_shift');

Slim::post('/registrasi/piket/shift/',function() {
	User::check_login('registrasi');
	
	
});

?>