<?php



include("config.php");
$datos = array();
#lunes
$l = mysql_query("select sum(total) as total from pago_mobil where DAYNAME(fecha)='Monday' and YEARWEEK(fecha) = YEARWEEK(NOW())") or die(mysql_error());
$lunes = mysql_result($l,0,"total");

#martes
$m = mysql_query("select sum(total) as total from pago_mobil where DAYNAME(fecha)='Tuesday' and YEARWEEK(fecha) = YEARWEEK(NOW())") or die(mysql_error());
$martes = mysql_result($m,0,"total");

#miercoles
$mi = mysql_query("select sum(total) as total from pago_mobil where DAYNAME(fecha)='Wednesday' and YEARWEEK(fecha) = YEARWEEK(NOW())") or die(mysql_error());
$miercoles = mysql_result($mi,0,"total");

#jueves
$j = mysql_query("select sum(total) as total from pago_mobil where DAYNAME(fecha)='Thursday' and YEARWEEK(fecha) = YEARWEEK(NOW())") or die(mysql_error());
$jueves = mysql_result($j,0,"total");


#viernes
$v = mysql_query("select sum(total) as total from pago_mobil where DAYNAME(fecha)='Friday' and YEARWEEK(fecha) = YEARWEEK(NOW())") or die(mysql_error());
$viernes = mysql_result($v,0,"total");

#sabado
$s = mysql_query("select sum(total) as total from pago_mobil where DAYNAME(fecha)='Saturday' and YEARWEEK(fecha) = YEARWEEK(NOW())") or die(mysql_error());
$sabado = mysql_result($s,0,"total");

#domingo
$d = mysql_query("select sum(total) as total from pago_mobil where DAYNAME(fecha)='Sunday' and YEARWEEK(fecha) = YEARWEEK(NOW())") or die(mysql_error());
$domingo = mysql_result($d,0,"total");

#abono hoy
$a = mysql_query("select sum(abono) as abono from pago_mobil where fecha = '$hoy'") or die(mysql_error());
$abono = mysql_result($a,0,"abono");

#abono hoy
$b = mysql_query("select sum(redito) as redito from pago_mobil where fecha = '$hoy'") or die(mysql_error());
$redito = mysql_result($b,0,"redito");

#abono hoy
$c = mysql_query("select sum(mora) as mora from pago_mobil where fecha = '$hoy'") or die(mysql_error());
$mora = mysql_result($c,0,"mora");





$datos["lunes"] = $lunes;
$datos["martes"] = $martes;
$datos["miercoles"] = $miercoles;
$datos["jueves"] = $jueves;
$datos["viernes"] = $viernes;
$datos["sabado"] = $sabado;
$datos["domingo"] = $domingo;
$datos["abono"] = $abono;
$datos["redito"] = $redito;
$datos["mora"] = $mora;
echo json_encode($datos);

?>