<?php

	require("§lib_inc.php");

	mysqli_query($_SESSION['dbh'],"LOCK TABLES family READ, events WRITE");

	mysqli_query($_SESSION['dbh'],"TRUNCATE TABLE oxg_calendar");

	mysqli_query($_SESSION['dbh'],"insert HIGH_PRIORITY into oxg_calendar ( id_family,  month,  day,  total ) select id_family, MONTH(devnt) month, DAY(devnt) day, count(*) total from oxg_events2 where devnt is not null group by id_family, MONTH(devnt), DAY(devnt)");

	mysqli_query($_SESSION['dbh'],"insert HIGH_PRIORITY into oxg_calendar ( id_family,  month,  day,  total ) select -1, MONTH(devnt) month, DAY(devnt) day, count(*) total from oxg_events2 where devnt is not null group by MONTH(devnt), DAY(devnt)");

?>

<P>Table oxg_calendar effectué
<?php
$CREAT=isset($_REQUEST["CREAT"])?$_REQUEST["CREAT"] : "";
if($CREAT=="AUTO")
{
	echo ("<p>");
	display_lng_text("ADM_DATA");
?>
	<SCRIPT LANGUAGE="JavaScript">
	<!--
	setTimeout("top.location.href = 'flash.php?CREAT=AUTO'",1);
	//-->
	</SCRIPT>
<?php
}
else
{
affiche_pied_page_admin(true);
}
?>
</body></html>