<?php

class formulaire
{
	function hidden_structures()
	{
		global $produits_tab, $resultats_tab;

		echo "<div class=\"hidden structures-list\" id=\"structures-root\">\n";
		echo "Structure : <span class=\"bold\" id=\"cLabel\"></span>\n";
		echo "<table>\n";
		echo "<tr>\n";
		echo "<td>Pr&eacute;cisez</td>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"struct_interv[]\" /></td>\n";
		echo "<td>Type d'addiction</td>\n";
		echo "<td><select name=\"struct_add[]\" size=\"1\">\n";
		echo "<option value=\"0\">--Choisir--</option>\n";
		foreach ($produits_tab as $key => $value)
			echo "<option value=\"" . $key . "\">" . $value ."</option>\n";
		echo "</select>\n";
		echo "</td>\n";
		echo "<td>Date de prise en charge</td>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"struct_date[]\" id=\"tmpdate\" size=\"10\" maxlength=\"10\" /><span><a href=\"#\" id=\"tmpcal\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a>&nbsp;(jj/mm/aaaa)</span></td>\n";
		echo "</tr>\n";
		echo "<tr>\n";
		echo "<td>Dur&eacute;e</td>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"struct_duree[]\" /></td>\n";
		echo "<td>R&eacute;sultat</td>\n";
		echo "<td><select name=\"struct_res[]\" size=\"1\">\n";
		echo "<option value=\"0\">--Choisir--</option>\n";
		foreach ($resultats_tab as $key => $value)
			echo "<option value=\"" . $key . "\">" . $value ."</option>\n";
		echo "</select>\n";
		echo "</td>\n";
		echo "</tr>\n";
		echo "</table>\n";
		echo "<input type=\"hidden\" name=\"struct_type[]\" id=\"cType\" value=\"\" />\n";
		echo "<input class=\"inb\" type=\"button\" value=\"Supprimer\" onClick=\"if (confirm('Etes-vous sûr de vouloir supprimer cette structure ?')) this.parentNode.parentNode.removeChild(this.parentNode);\" />\n";
		echo "</div>\n";
	}

	function info_generales($consu_date, $consu_comment, $corres_coords, $id_couv, $sit_ress, $sit_tutelle, $sit_prof, $sit_mat, $sit_enf, $sit_enfchg, $sit_fam, $sit_log, $sit_csp, $sit_etude, $sit_pec, $structures_select, $struct_type, $struct_add, $struct_date, $struct_interv, $struct_duree, $struct_res)
	{
		global $sit_mat_tab, $sit_fam_tab, $sit_log_tab, $sit_ress_tab, $couv_tab, $sit_etude_tab, $sit_pec_tab, $structures_tab, $produits_tab, $resultats_tab, $sit_csp_tab, $last_consult, $consu_type, $id_consult;
		global $menu, $util, $prop;

		if (!empty($last_consult) && $user = $util->get_utilisateur($last_consult["id_user"]))
		{
			echo "<div id=\"last-user\">\n";
			echo "Derni&egrave;re consultation le " . format_date($last_consult["consu_date"]) . " par " . $user["user_nom"] . " " . $user["user_prenom"];
			echo "</div>\n";
		}

		if ($consu_type == 3 || $consu_type == 4)
		{
			if ($id_consult)
				$last_prop = $prop->get_proposition($last_consult["id_prop"]);
			else
				$last_prop = $prop->get_last_proposition($_SESSION["Sid_pat"]);

			if ($last_prop)
			{
				$module = $menu->get_module($last_prop["id_mod"]);

				echo "<div id=\"last-prop\">\n";
				echo "Module en cours : " . $module["mod_nom"] . "<br />";
				echo "Objectif du module : " . $last_prop["prop_objectif"];
				echo "</div>\n";
			}
		}

		if (empty($consu_date))
			$consu_date = format_date(date("Y-m-d"));

		echo "<table>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Date de consultation " . req() ."</td>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"consu_date\" id=\"consu_date\" value=\"" . $consu_date . "\" size=\"10\" maxlength=\"10\" /><span><a href=\"#\" onclick=\"return showCalendar('consu_date', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a>&nbsp;(jj/mm/aaaa)</span></td>\n";
		echo "</tr>\n";

		echo "</table>\n";

		echo "<hr />\n";

		echo "<table class=\"center\" id=\"correspondants\">\n";

		$list_spe = $menu->list_specialite();

		if ($c = count($list_spe))
		{
			if ($c > 1)
			{
				echo "<tr class=\"titre\">\n";
				echo "<th>Correspondants</th>\n";
				echo "<th>Coordonn&eacute;es</th>\n";
				echo "<th>Correspondants</th>\n";
				echo "<th>Coordonn&eacute;es</th>\n";
				echo "</tr>\n";

				for ($i = 0; $i < $c; $i+=2)
				{
					echo "<tr>\n";
					echo "<th>" . $list_spe[$i]["spe_nom"] . "</th>\n";
					echo "<td class=\"border center\"><textarea name=\"corres_coords[" . $list_spe[$i]["id_spe"] . "]\">" . (isset($corres_coords[$list_spe[$i]["id_spe"]]) ? nobr($corres_coords[$list_spe[$i]["id_spe"]]) : "") . "</textarea></td>\n";
					if (isset($list_spe[$i + 1]["spe_nom"]))
					{
						echo "<th>" . $list_spe[$i + 1]["spe_nom"] . "</th>\n";
						echo "<td class=\"border center\"><textarea name=\"corres_coords[" . $list_spe[$i + 1]["id_spe"] . "]\">" . (isset($corres_coords[$list_spe[$i + 1]["id_spe"]]) ? nobr($corres_coords[$list_spe[$i + 1]["id_spe"]]) : "") . "</textarea></td>\n";
					}
					echo "</tr>\n";
				}
			}
			else
			{
				echo "<tr class=\"titre\">\n";
				echo "<th>Correspondants</th>\n";
				echo "<th>Coordonn&eacute;es</th>\n";
				echo "</tr>\n";

				echo "<tr>\n";
				echo "<th>" . $list_spe[0]["spe_nom"] . "</th>\n";
				echo "<td class=\"border center\"><textarea name=\"corres_coords[" . $list_spe[0]["id_spe"] . "]\" value=\"" . (isset($corres_coords[$list_spe[0]]) ? nobr($corres_coords[$list_spe[0]]) : "") . "\" ></textarea></td>\n";
				echo "</tr>\n";
			}
		}

		echo "</table>\n";

		echo "<table>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Situation matrimoniale</td>\n";
		echo "<td>" . select("sit_mat", $sit_mat_tab, $sit_mat) . "</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Situation familiale</td>\n";
		echo "<td>" . select("sit_fam", $sit_fam_tab, $sit_fam) . "</td>\n";
		echo "</tr>\n";
/*
		echo "<tr>\n";
		echo "<td class=\"r\">Nombre total d'enfants</td>\n";
		echo "<td><input type=\"texte\" class=\"int\" name=\"sit_enf\" id=\"sit_enf\" value=\"" . $sit_enf . "\" maxlength=\"2\" size=\"2\" /></td>\n";
		echo "</tr>\n";
*/
		echo "<tr>\n";
		echo "<td class=\"r\">Nombre d'enfants &agrave; charge</td>\n";
		echo "<td><input type=\"texte\" class=\"int\" name=\"sit_enfchg\" id=\"sit_enfchg\" value=\"" . (empty($sit_enfchg) ? "0" : $sit_enfchg) . "\" maxlength=\"2\" size=\"2\" /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Logement</td>\n";
		echo "<td>" . select("sit_log", $sit_log_tab, $sit_log) . "</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Ressources</td>\n";
		echo "<td>" . select("sit_ress", $sit_ress_tab, $sit_ress) . "</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Incapable majeur (sous tutelle)</td>\n";
		echo "<td><input type=\"checkbox\" name=\"sit_tutelle\" value=\"1\"" . (!empty($sit_tutelle) ? " checked=\"checked\"" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Couverture sociale</td>\n";
		echo "<td>" . select("id_couv", $couv_tab, $id_couv) . "</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Niveau d'&eacute;tudes</td>\n";
		echo "<td>" . select("sit_etude", $sit_etude_tab, $sit_etude) . "</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Cat&eacute;gorie socioprofessionnelle</td>\n";
		echo "<td>" . select("sit_csp", $sit_csp_tab, $sit_csp) . "</td>\n";
		echo "</tr>\n";

		echo "</table>\n";

		echo "<ul><li><p class=\"bold\">D&eacute;marches de soin vis-&agrave;-vis des addictions (produit ou comportement)</p></li></ul>\n";

		echo "<table>\n";
		echo "<tr>\n";
		echo "<td class=\"r\">Prise en charge addictologique</td>\n";
		if ($consu_type == 3 || $consu_type == 4)
			echo "<td>: En cours<input type=\"hidden\" name=\"sit_pec\" value=\"3\" /></td>\n";
		else
			echo "<td>" . select("sit_pec", $sit_pec_tab, $sit_pec) . "</td>\n";
		echo "</tr>\n";
		echo "</table>\n";

		echo "<p class=\"bold\">Structures</p>";

		echo "<a class=\"slink\" href=\"javascript:addStructure()\">Ajouter</a>&nbsp;" . select("structures_select", $structures_tab, $structures_select);

		echo "<div id=\"structures-contenu\">\n";

		if (!empty($struct_type) && $c = count($struct_type))
		{
			for ($i = 0; $i < $c; $i++)
			{
				echo "<div class=\"structures-list\">\n";
				echo "Structure : <span class=\"bold\">" . $structures_tab[$struct_type[$i]] . "</span>\n";
				echo "<table>\n";
				echo "<tr>\n";
				echo "<td>Pr&eacute;cisez</td>\n";
				echo "<td><input class=\"int\" type=\"text\" name=\"struct_interv[]\" value=\"" . $struct_interv[$i] . "\" /></td>\n";
				echo "<td>Type d'addiction</td>\n";
				echo "<td><select name=\"struct_add[]\" size=\"1\">\n";
				echo "<option value=\"0\">--Choisir--</option>\n";
				foreach ($produits_tab as $key => $value)
					echo "<option value=\"" . $key . "\"" . ($struct_add[$i] == $key ? " selected=selected" : "") . ">" . $value ."</option>\n";
				echo "</select>\n";
				echo "</td>\n";
				echo "<td>Date de prise en charge</td>\n";
				$uniqID = md5(uniqid(rand(), true));
				echo "<td><input class=\"int\" type=\"text\" id=\"" . $uniqID . "\" size=\"10\" maxlength=\"10\" name=\"struct_date[]\" value=\"" . $struct_date[$i] . "\" /><span><a href=\"#\" onclick=\"return showCalendar('" . $uniqID . "', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a>&nbsp;(jj/mm/aaaa)</span></td>\n";
				echo "</tr>\n";
				echo "<tr>\n";
				echo "<td>Dur&eacute;e</td>\n";
				echo "<td><input class=\"int\" type=\"text\" name=\"struct_duree[]\" value=\"" . $struct_duree[$i] . "\" /></td>\n";
				echo "<td>R&eacute;sultat</td>\n";
				echo "<td><select name=\"struct_res[]\" size=\"1\">\n";
				echo "<option value=\"0\">--Choisir--</option>\n";
				foreach ($resultats_tab as $key => $value)
					echo "<option value=\"" . $key . "\" " . ($struct_res[$i] == $key ? " selected=selected" : "") . ">" . $value ."</option>\n";
				echo "</select>\n";
				echo "</td>\n";
				echo "</tr>\n";
				echo "</table>\n";
				echo "<input type=\"hidden\" name=\"struct_type[]\" value=\"" . $struct_type[$i] . "\" />\n";
				echo "<input class=\"inb\" type=\"button\" value=\"Supprimer\" onClick=\"if (confirm('Etes-vous sûr de vouloir supprimer cette structure ?')) this.parentNode.parentNode.removeChild(this.parentNode);\" />\n";
				echo "</div>\n";
			}
		}

		echo "</div>\n";

		echo "<div class=\"pager\">\n";

		if ($_SESSION["Suser_cat"] == 1)
			echo "<a class=\"slink\" href=\"#\" onclick=\"javascript:displayTab('alcool');\">Suite</a>\n";
		else
			echo "<a class=\"slink\" href=\"#\" onclick=\"javascript:displayTab('rosace');\">Suite</a>\n";

		echo "</div>\n";
	}

	function alcool_tabac($alc_verre_jour, $alc_jour_sem, $alc_jour_mois, $alc_an, $alc_4_5_jour, $alc_4_5_occ, $alc_8_12_jour, $alc_8_12_occ, $alc_16_20_jour, $alc_16_20_occ, $alc_40_jour, $alc_40_occ, $alc_conso_sem, $alc_conso_jour, $alc_conso_occ, $alc_audit, $tab_conso, $alc_conso, $alc_usage, $alc_debut, $alc_ivresse, $alc_abst, $alc_abst_duree, $tab_debut, $tab_usage, $alc_objectif)
	{
		global $alc_conso_tab, $alc_usage_tab, $tab_conso_tab, $consu_type;

		if ($consu_type != 3 && $consu_type != 4)
		{
			echo "<table>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Alcool</td>\n";
			echo "<td>" . select("alc_conso", $alc_conso_tab, $alc_conso) . "</td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Si consommateur actuel</td>\n";
			echo "<td>" . select("alc_usage", $alc_usage_tab, $alc_usage) . "</td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Age au d&eacute;but de la consommation</td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"alc_debut\" id=\"alc_debut\" value=\"" . $alc_debut . "\" size=\"3\" /></td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Nombre d'ivresses au cours du mois pass&eacute;</td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"alc_ivresse\" id=\"alc_ivresse\" value=\"" . $alc_ivresse . "\" size=\"3\" /></td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Nombre d'abstinences d&eacute;clar&eacute;es > 3 mois</td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"alc_abst\" id=\"alc_abst\" value=\"" . $alc_abst . "\" size=\"3\" /></td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Dur&eacute;e d'abstinence d&eacute;clar&eacute;e la plus longue en mois</td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"alc_abst_duree\" id=\"alc_abst_duree\" value=\"" . $alc_abst_duree . "\" size=\"3\" /></td>\n";
			echo "</tr>\n";

			echo "</table>\n";
		}

		echo "<div id=\"conso-alcool\">\n";

		if ($consu_type == 3 || $consu_type == 4)
		{
			echo "<p>Objectif atteint ? <input type=\"radio\" name=\"alc_objectif\" value=\"1\"" . ($alc_objectif == 1 ? " checked=\"checked\"" : "") . " /> oui <input type=\"radio\" name=\"alc_objectif\" value=\"-1\"" . ($alc_objectif == -1 ? " checked=\"checked\"" : "") . " /> non <br /><br /></p>\n";
		}
		else
			echo "<input type=\"hidden\" name=\"alc_objectif\" value=\"" . $alc_objectif . "\" />";

		echo "<ul><li><p>Consommation d&eacute;clar&eacute;e d'alcool: <span class=\"small\">au cours " . ($consu_type == 1 || $consu_type == 2 ? "de l'ann&eacute;e pass&eacute;e" : "du mois pass&eacute;") . "</span></p></li></ul>\n";

		echo "<table class=\"center\">\n";

		echo "<tr class=\"titre\">\n";
		echo "<th>Rythme</th>\n";
		echo "<th colspan=\"3\">Nombre de verres / jour ou occasion</th>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>&nbsp;</td>\n";
		echo "<td class=\"border center\">Type de boisson</td>\n";
		echo "<td class=\"border center\">Par jour</td>\n";
		echo "<td class=\"border center\">Par occasion</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td><input type=\"radio\" name=\"alc_verre_jour\" value=\"1\"" . ($alc_verre_jour == 1 ? " checked=checked" : "") . " /> quotidien</td>\n";
		echo "<td class=\"border\">4 à 5° (bi&egrave;re, cidre)</td>\n";
		echo "<td class=\"border center\"><input class=\"int\" onkeyup=\"javascript:calculJour()\" onkeydown=\"javascript:calculJour()\" type=\"text\" name=\"alc_4_5_jour\" id=\"alc_4_5_jour\" value=\"" . $alc_4_5_jour . "\" size=\"2\" maxlength=\"2\" /></td>\n";
		echo "<td class=\"border center\"><input class=\"int\" onkeyup=\"javascript:calculOcc()\" onkeydown=\"javascript:calculOcc()\" type=\"text\" name=\"alc_4_5_occ\" id=\"alc_4_5_occ\" value=\"" . $alc_4_5_occ . "\" size=\"2\" maxlength=\"2\" /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td><input type=\"radio\" name=\"alc_verre_jour\" value=\"2\"" . ($alc_verre_jour == 2 ? " checked=checked" : "") . " /> non quotidien</td>\n";
		echo "<td class=\"border\">8 &agrave; 12° (vin, bi&egrave;re forte)</td>\n";
		echo "<td class=\"border center\"><input class=\"int\" onkeyup=\"javascript:calculJour()\" onkeydown=\"javascript:calculJour()\" type=\"text\" name=\"alc_8_12_jour\" id=\"alc_8_12_jour\" value=\"" . $alc_8_12_jour . "\" size=\"2\" maxlength=\"2\" /></td>\n";
		echo "<td class=\"border center\"><input class=\"int\" onkeyup=\"javascript:calculOcc()\" onkeydown=\"javascript:calculOcc()\" type=\"text\" name=\"alc_8_12_occ\" id=\"alc_8_12_occ\" value=\"" . $alc_8_12_occ . "\" size=\"2\" maxlength=\"2\" /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"alc_jour_sem\" id=\"alc_jour_sem\" value=\"" . $alc_jour_sem . "\" size=\"2\" maxlength=\"2\" /> jours / semaine</td>\n";
		echo "<td class=\"border\">16 &agrave; 20° (ap&eacute;ritif)</td>\n";
		echo "<td class=\"border center\"><input class=\"int\" onkeyup=\"javascript:calculJour()\" onkeydown=\"javascript:calculJour()\" type=\"text\" name=\"alc_16_20_jour\" id=\"alc_16_20_jour\" value=\"" . $alc_16_20_jour . "\" size=\"2\" maxlength=\"2\" /></td>\n";
		echo "<td class=\"border center\"><input class=\"int\" onkeyup=\"javascript:calculOcc()\" onkeydown=\"javascript:calculOcc()\" type=\"text\" name=\"alc_16_20_occ\" id=\"alc_16_20_occ\" value=\"" . $alc_16_20_occ . "\" size=\"2\" maxlength=\"2\" /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"alc_jour_mois\" id=\"alc_jour_mois\" value=\"" . $alc_jour_mois . "\" size=\"2\" maxlength=\"2\" /> jours / mois</td>\n";
		echo "<td class=\"border\">Plus de 40°</td>\n";
		echo "<td class=\"border center\"><input class=\"int\" onkeyup=\"javascript:calculJour()\" onkeydown=\"javascript:calculJour()\" type=\"text\" name=\"alc_40_jour\" id=\"alc_40_jour\" value=\"" . $alc_40_jour . "\" size=\"2\" maxlength=\"2\" /></td>\n";
		echo "<td class=\"border center\"><input class=\"int\" onkeyup=\"javascript:calculOcc()\" onkeydown=\"javascript:calculOcc()\" type=\"text\" name=\"alc_40_occ\" id=\"alc_40_occ\" value=\"" . $alc_40_occ . "\" size=\"2\" maxlength=\"2\" /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>";
		if ($consu_type == 1 || $consu_type == 2)
			echo "<input class=\"int\" type=\"text\" name=\"alc_an\" id=\"alc_an\" value=\"" . $alc_an . "\" size=\"2\" maxlength=\"3\" /> jours / an";
		else
			echo "&nbsp;";
		echo "</td>\n";
		echo "<td class=\"border\">Total en moyenne / jour</td>\n";
		echo "<td class=\"border center\"><input class=\"int\" type=\"text\" name=\"total_jour\" id=\"total_jour\" size=\"2\" value=\"" . ($alc_4_5_jour + $alc_8_12_jour + $alc_16_20_jour + $alc_40_jour) . "\" readonly=\"readonly\" /></td>\n";
		echo "<td class=\"border center\"><input class=\"int\" type=\"text\" name=\"total_occ\" id=\"total_occ\" size=\"2\" value=\"" . ($alc_4_5_occ + $alc_8_12_occ + $alc_16_20_occ + $alc_40_occ) . "\" readonly=\"readonly\" /></td>\n";
		echo "</tr>\n";

		echo "</table>\n";

		echo "</div>\n"; // Fin conso-alcool

		if ($consu_type != 3 && $consu_type != 4)
		{
			echo "<div style=\"float: left;\">\n";
			if ($consu_type == 1 || $consu_type == 2)
				echo "<ul><li><p>Consommation d&eacute;clar&eacute;e d'alcool: <span class=\"small\">au cours du mois pass&eacute;</span></p></li></ul>\n";

			echo "<table>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Nombre de jours de consommation/semaine</td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"alc_conso_sem\" id=\"alc_conso_sem\" value=\"" . $alc_conso_sem . "\" size=\"2\" maxlength=\"1\" /></td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Nombre moyen de verres par jour</td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"alc_conso_jour\" id=\"alc_conso_jour\" value=\"" . $alc_conso_jour . "\" size=\"2\" maxlength=\"2\" /></td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Nombre moyen de verres par occasion</td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"alc_conso_occ\" id=\"alc_conso_occ\" value=\"" . $alc_conso_occ . "\" size=\"2\" maxlength=\"2\" /></td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Score AUDIT: <span class=\"small\">total à reporter ici</span></td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"alc_audit\" id=\"alc_audit\" value=\"" . $alc_audit . "\" size=\"2\" maxlength=\"2\" /></td>\n";
			echo "</tr>\n";

			echo "</table>\n";
			echo "</div>\n";
		}

		if ($consu_type != 1)
		{
			echo "<div style=\"float: left; margin-left: 100px; margin-top: 25px;\">\n";
			echo "<ul><li><p>Tabac " . select_rosace("tab_conso", $tab_conso_tab, $tab_conso) . "</p></li></ul>\n";

			echo "<table>\n";

			if ($consu_type == 1 || $consu_type == 2)
			{
				echo "<tr>\n";
				echo "<td class=\"r\">Dur&eacute;e en ann&eacute;es</td>\n";
				echo "<td>";
				echo "<input class=\"int\" type=\"text\" name=\"tab_debut\" id=\"tab_debut\" value=\"" . $tab_debut . "\" size=\"2\" maxlength=\"2\" />";
				echo "</td>\n";
				echo "</tr>\n";
			}

			echo "<tr>\n";
			echo "<td class=\"r\">Nombre de gr de tabac/jour</td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"tab_usage\" id=\"tab_usage\" value=\"" . $tab_usage . "\" size=\"2\" maxlength=\"2\" />";
			if ($consu_type != 1 && $consu_type != 2)
				echo "<input type=\"hidden\" name=\"tab_debut\" id=\"tab_debut\" value=\"" . $tab_debut . "\" />";
			echo "</td>\n";
			echo "</tr>\n";

			echo "</table>\n";
			echo "</div>\n";
		}

		echo "<div style=\"clear: both;\"></div>\n";

		echo "<div class=\"pager\">\n";
		if ($consu_type == 1)
			echo "<a class=\"slink\" href=\"#\" onclick=\"javascript:displayTab('rosace');\">Suite</a>\n";
		else
			echo "<a class=\"slink\" href=\"#\" onclick=\"javascript:displayTab('drogue');\">Suite</a>\n";
		echo "</div>\n";

		echo "<div style=\"clear: both;\"></div>\n";
}

	function drogue($drog_canabis, $drog_heroine, $drog_codeine, $drog_opium, $drog_lsd, $drog_hallu, $drog_colle, $drog_amphe, $drog_mdma, $drog_stimul, $drog_stimul_desc, $drog_coke, $drog_crack, $drog_autre, $drog_autre_desc, $drog_intra)
	{
		echo "<ul><li><p>Produits illicites</p></li></ul>\n";

		echo "<table class=\"center\">\n";

		echo "<tr>\n";
		echo "<th class=\"nobg\">&nbsp;</th>\n";
		echo "<th>Non usage</th>\n";
		echo "<th>Usage actuel</th>\n";
		echo "<th>Ancien usage</th>\n";
		echo "<th>Non r&eacute;ponse</th>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Cannabis et d&eacute;riv&eacute;s</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_canabis\" value=\"0\"" . ($drog_canabis == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_canabis\" value=\"1\"" . ($drog_canabis == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_canabis\" value=\"2\"" . ($drog_canabis == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_canabis\" value=\"3\"" . ($drog_canabis == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>H&eacute;roine</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_heroine\" value=\"0\"" . ($drog_heroine == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_heroine\" value=\"1\"" . ($drog_heroine == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_heroine\" value=\"2\"" . ($drog_heroine == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_heroine\" value=\"3\"" . ($drog_heroine == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Cod&eacute;ine</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_codeine\" value=\"0\"" . ($drog_codeine == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_codeine\" value=\"1\"" . ($drog_codeine == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_codeine\" value=\"2\"" . ($drog_codeine == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_codeine\" value=\"3\"" . ($drog_codeine == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Autres opiac&eacute;s et d&eacute;riv&eacute;s</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_opium\" value=\"0\"" . ($drog_opium == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_opium\" value=\"1\"" . ($drog_opium == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_opium\" value=\"2\"" . ($drog_opium == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_opium\" value=\"3\"" . ($drog_opium == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>LSD + autres acides</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_lsd\" value=\"0\"" . ($drog_lsd == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_lsd\" value=\"1\"" . ($drog_lsd == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_lsd\" value=\"2\"" . ($drog_lsd == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_lsd\" value=\"3\"" . ($drog_lsd == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Autres hallucinog&egrave;nes</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_hallu\" value=\"0\"" . ($drog_hallu == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_hallu\" value=\"1\"" . ($drog_hallu == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_hallu\" value=\"2\"" . ($drog_hallu == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_hallu\" value=\"3\"" . ($drog_hallu == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Solvants et colles</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_colle\" value=\"0\"" . ($drog_colle == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_colle\" value=\"1\"" . ($drog_colle == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_colle\" value=\"2\"" . ($drog_colle == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_colle\" value=\"3\"" . ($drog_colle == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Amph&eacute;tamines</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_amphe\" value=\"0\"" . ($drog_amphe == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_amphe\" value=\"1\"" . ($drog_amphe == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_amphe\" value=\"2\"" . ($drog_amphe == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_amphe\" value=\"3\"" . ($drog_amphe == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Ecstasy et d&eacute;riv&eacute;s</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_mdma\" value=\"0\"" . ($drog_mdma == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_mdma\" value=\"1\"" . ($drog_mdma == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_mdma\" value=\"2\"" . ($drog_mdma == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_mdma\" value=\"3\"" . ($drog_mdma == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Autres stimulants</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_stimul\" value=\"0\"" . ($drog_stimul == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_stimul\" value=\"1\"" . ($drog_stimul == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_stimul\" value=\"2\"" . ($drog_stimul == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_stimul\" value=\"3\"" . ($drog_stimul == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pr&eacute;cisez</td>\n";
		echo "<td colspan=\"4\"><input class=\"int\" type=\"text\" name=\"drog_stimul_desc\" id=\"drog_stimul_desc\" value=\"" . $drog_stimul_desc . "\" /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Coca&iuml;ne et coca (feuilles)</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_coke\" value=\"0\"" . ($drog_coke == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_coke\" value=\"1\"" . ($drog_coke == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_coke\" value=\"2\"" . ($drog_coke == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_coke\" value=\"3\"" . ($drog_coke == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Crack</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_crack\" value=\"0\"" . ($drog_crack == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_crack\" value=\"1\"" . ($drog_crack == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_crack\" value=\"2\"" . ($drog_crack == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_crack\" value=\"3\"" . ($drog_crack == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Autres produits illicites</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_autre\" value=\"0\"" . ($drog_autre == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_autre\" value=\"1\"" . ($drog_autre == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_autre\" value=\"2\"" . ($drog_autre == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_autre\" value=\"3\"" . ($drog_autre == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pr&eacute;cisez</td>\n";
		echo "<td colspan=\"4\"><input class=\"int\" type=\"text\" name=\"drog_autre_desc\" value=\"" . $drog_autre_desc . "\" /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Voie I.V</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_intra\" value=\"0\"" . ($drog_intra == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_intra\" value=\"1\"" . ($drog_intra == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_intra\" value=\"2\"" . ($drog_intra == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"drog_intra\" value=\"3\"" . ($drog_intra == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "</table>\n";

		echo "<div class=\"pager\">\n";
		echo "<a class=\"slink\" href=\"#\" onclick=\"javascript:displayTab('medic');\">Suite</a>\n";
		echo "</div>\n";
	}

	function medicaments($medic_benzo, $medic_benzo_mesu, $medic_anxio, $medic_anxio_mesu, $medic_hypno, $medic_hypno_mesu, $medic_antidepr, $medic_antidepr_mesu, $medic_neuro, $medic_neuro_mesu, $medic_barbi, $medic_barbi_mesu, $medic_autres, $medic_autres_mesu, $medic_autres_desc, $medic_methadone, $medic_metha_mesu, $medic_subutex, $medic_subu_mesu, $medic_subst_autres, $medic_subst_autres_mesu, $medic_iv, $medic_anorexie, $medic_boulimie, $medic_jeupath, $medic_anxiete, $medic_depression, $medic_eval_psy, $medic_trouble_psy)
	{
		global $medic_anxiete_tab, $medic_depression_tab, $medic_trouble_psy_tab, $consu_type;

		echo "<ul><li><p>M&eacute;dicaments psychotropes</p></li></ul>\n";

		echo "<table class=\"center\">\n";

		echo "<tr>\n";
		echo "<th class=\"nobg\">&nbsp;</th>\n";
		echo "<th colspan=\"4\">Selon prescription</th>\n";
		echo "<th colspan=\"4\">M&eacute;susage</th>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<th class=\"nobg\">&nbsp;</th>\n";
		echo "<th>Non usage</th>\n";
		echo "<th>Usage actuel</th>\n";
		echo "<th>Ancien usage</th>\n";
		echo "<th>Non r&eacute;ponse</th>\n";
		echo "<th>Non</th>\n";
		echo "<th>Actuel</th>\n";
		echo "<th>Ancien</th>\n";
		echo "<th>Non r&eacute;ponse</th>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Benzodiaz&eacute;pines</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_benzo\" value=\"0\"" . ($medic_benzo == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center usage-med\"><input type=\"radio\" name=\"medic_benzo\" value=\"1\"" . ($medic_benzo == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_benzo\" value=\"2\"" . ($medic_benzo == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_benzo\" value=\"3\"" . ($medic_benzo == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_benzo_mesu\" value=\"0\"" . ($medic_benzo_mesu == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center mesusage-med\"><input type=\"radio\" name=\"medic_benzo_mesu\" value=\"1\"" . ($medic_benzo_mesu == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_benzo_mesu\" value=\"2\"" . ($medic_benzo_mesu == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_benzo_mesu\" value=\"3\"" . ($medic_benzo_mesu == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Autres anxiolytiques</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_anxio\" value=\"0\"" . ($medic_anxio == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center usage-med\"><input type=\"radio\" name=\"medic_anxio\" value=\"1\"" . ($medic_anxio == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_anxio\" value=\"2\"" . ($medic_anxio == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_anxio\" value=\"3\"" . ($medic_anxio == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_anxio_mesu\" value=\"0\"" . ($medic_anxio_mesu == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center mesusage-med\"><input type=\"radio\" name=\"medic_anxio_mesu\" value=\"1\"" . ($medic_anxio_mesu == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_anxio_mesu\" value=\"2\"" . ($medic_anxio_mesu == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_anxio_mesu\" value=\"3\"" . ($medic_anxio_mesu == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Hypnotiques</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_hypno\" value=\"0\"" . ($medic_hypno == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center usage-med\"><input type=\"radio\" name=\"medic_hypno\" value=\"1\"" . ($medic_hypno == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_hypno\" value=\"2\"" . ($medic_hypno == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_hypno\" value=\"3\"" . ($medic_hypno == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_hypno_mesu\" value=\"0\"" . ($medic_hypno_mesu == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center mesusage-med\"><input type=\"radio\" name=\"medic_hypno_mesu\" value=\"1\"" . ($medic_hypno_mesu == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_hypno_mesu\" value=\"2\"" . ($medic_hypno_mesu == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_hypno_mesu\" value=\"3\"" . ($medic_hypno_mesu == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Antid&eacute;presseurs</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_antidepr\" value=\"0\"" . ($medic_antidepr == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center usage-med\"><input type=\"radio\" name=\"medic_antidepr\" value=\"1\"" . ($medic_antidepr == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_antidepr\" value=\"2\"" . ($medic_antidepr == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_antidepr\" value=\"3\"" . ($medic_antidepr == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_antidepr_mesu\" value=\"0\"" . ($medic_antidepr_mesu == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center mesusage-med\"><input type=\"radio\" name=\"medic_antidepr_mesu\" value=\"1\"" . ($medic_antidepr_mesu == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_antidepr_mesu\" value=\"2\"" . ($medic_antidepr_mesu == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_antidepr_mesu\" value=\"3\"" . ($medic_antidepr_mesu == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Neuroleptiques</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_neuro\" value=\"0\"" . ($medic_neuro == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center usage-med\"><input type=\"radio\" name=\"medic_neuro\" value=\"1\"" . ($medic_neuro == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_neuro\" value=\"2\"" . ($medic_neuro == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_neuro\" value=\"3\"" . ($medic_neuro == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_neuro_mesu\" value=\"0\"" . ($medic_neuro_mesu == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center mesusage-med\"><input type=\"radio\" name=\"medic_neuro_mesu\" value=\"1\"" . ($medic_neuro_mesu == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_neuro_mesu\" value=\"2\"" . ($medic_neuro_mesu == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_neuro_mesu\" value=\"3\"" . ($medic_neuro_mesu == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Barbituriques</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_barbi\" value=\"0\"" . ($medic_barbi == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center usage-med\"><input type=\"radio\" name=\"medic_barbi\" value=\"1\"" . ($medic_barbi == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_barbi\" value=\"2\"" . ($medic_barbi == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_barbi\" value=\"3\"" . ($medic_barbi == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_barbi_mesu\" value=\"0\"" . ($medic_barbi_mesu == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center mesusage-med\"><input type=\"radio\" name=\"medic_barbi_mesu\" value=\"1\"" . ($medic_barbi_mesu == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_barbi_mesu\" value=\"2\"" . ($medic_barbi_mesu == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_barbi_mesu\" value=\"3\"" . ($medic_barbi_mesu == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Autres</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_autres\" value=\"0\"" . ($medic_autres == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center usage-med\"><input type=\"radio\" name=\"medic_autres\" value=\"1\"" . ($medic_autres == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_autres\" value=\"2\"" . ($medic_autres == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_autres\" value=\"3\"" . ($medic_autres == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_autres_mesu\" value=\"0\"" . ($medic_autres_mesu == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center mesusage-med\"><input type=\"radio\" name=\"medic_autres_mesu\" value=\"1\"" . ($medic_autres_mesu == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_autres_mesu\" value=\"2\"" . ($medic_autres_mesu == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_autres_mesu\" value=\"3\"" . ($medic_autres_mesu == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pr&eacute;cisez</td>\n";
		echo "<td colspan=\"8\"><input class=\"int\" type=\"text\" name=\"medic_autres_desc\" id=\"medic_autres_desc\" value=\"" . $medic_autres_desc . "\" /></td>\n";
		echo "</tr>\n";

		echo "</table>\n";

		echo "<ul><li><p>Produits de substitution</p></li></ul>\n";

		echo "<table class=\"center\">\n";

		echo "<tr>\n";
		echo "<th class=\"nobg\">&nbsp;</th>\n";
		echo "<th colspan=\"4\">Selon prescription</th>\n";
		echo "<th colspan=\"4\">M&eacute;susage</th>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<th class=\"nobg\">&nbsp;</th>\n";
		echo "<th>Non usage</th>\n";
		echo "<th>Usage actuel</th>\n";
		echo "<th>Ancien usage</th>\n";
		echo "<th>Non r&eacute;ponse</th>\n";
		echo "<th>Non</th>\n";
		echo "<th>Actuel</th>\n";
		echo "<th>Ancien</th>\n";
		echo "<th>Non r&eacute;ponse</th>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>M&eacute;thadone</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_methadone\" value=\"0\"" . ($medic_methadone == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center usage-med\"><input type=\"radio\" name=\"medic_methadone\" value=\"1\"" . ($medic_methadone == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_methadone\" value=\"2\"" . ($medic_methadone == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_methadone\" value=\"3\"" . ($medic_methadone == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_metha_mesu\" value=\"0\"" . ($medic_metha_mesu == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center mesusage-med\"><input type=\"radio\" name=\"medic_metha_mesu\" value=\"1\"" . ($medic_metha_mesu == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_metha_mesu\" value=\"2\"" . ($medic_metha_mesu == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_metha_mesu\" value=\"3\"" . ($medic_metha_mesu == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Subutex</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_subutex\" value=\"0\"" . ($medic_subutex == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center usage-med\"><input type=\"radio\" name=\"medic_subutex\" value=\"1\"" . ($medic_subutex == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_subutex\" value=\"2\"" . ($medic_subutex == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_subutex\" value=\"3\"" . ($medic_subutex == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_subu_mesu\" value=\"0\"" . ($medic_subu_mesu == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center mesusage-med\"><input type=\"radio\" name=\"medic_subu_mesu\" value=\"1\"" . ($medic_subu_mesu == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_subu_mesu\" value=\"2\"" . ($medic_subu_mesu == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_subu_mesu\" value=\"3\"" . ($medic_subu_mesu == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Autres</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_subst_autres\" value=\"0\"" . ($medic_subst_autres == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center usage-med\"><input type=\"radio\" name=\"medic_subst_autres\" value=\"1\"" . ($medic_subst_autres == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_subst_autres\" value=\"2\"" . ($medic_subst_autres == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_subst_autres\" value=\"3\"" . ($medic_subst_autres == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_subst_autres_mesu\" value=\"0\"" . ($medic_subst_autres_mesu == 0 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center mesusage-med\"><input type=\"radio\" name=\"medic_subst_autres_mesu\" value=\"1\"" . ($medic_subst_autres_mesu == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_subst_autres_mesu\" value=\"2\"" . ($medic_subst_autres_mesu == 2 ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"medic_subst_autres_mesu\" value=\"3\"" . ($medic_subst_autres_mesu == 3 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>M&eacute;susage&nbsp;I.V</td>\n";
		echo "<td colspan=\"8\"><input type=\"radio\" name=\"medic_iv\" value=\"1\"" . ($medic_iv == 1 ? " checked=checked" : "") . " />oui <input type=\"radio\" name=\"medic_iv\" value=\"2\"" . ($medic_iv != 1 ? " checked=checked" : "") . " />non</td>\n";
		echo "</tr>\n";

		echo "</table>\n";

		echo "<div style=\"float: left;\">\n";
		echo "<ul><li><p>Troubles des conduites alimentaires</p></li></ul>\n";

		echo "<table>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Anorexie</td>\n";
		echo "<td><input type=\"radio\" name=\"medic_anorexie\" value=\"1\"" . ($medic_anorexie == 1 ? " checked=checked" : "") . " />oui <input type=\"radio\" name=\"medic_anorexie\" value=\"0\"" . ($medic_anorexie != 1 ? " checked=checked" : "") . " />non</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Boulimie</td>\n";
		echo "<td><input type=\"radio\" name=\"medic_boulimie\" value=\"1\"" . ($medic_boulimie == 1 ? " checked=checked" : "") . " />oui <input type=\"radio\" name=\"medic_boulimie\" value=\"0\"" . ($medic_boulimie != 1 ? " checked=checked" : "") . " />non</td>\n";
		echo "</tr>\n";

		echo "</table>\n";
		echo "</div>\n";

		echo "<div style=\"float: left; margin-left: 100px;\">\n";
		echo "<ul><li><p>Addictions comportementales</p></li></ul>\n";

		echo "<table>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Jeu pathologique</td>\n";
		echo "<td><input type=\"radio\" name=\"medic_jeupath\" value=\"1\"" . ($medic_jeupath == 1 ? " checked=checked" : "") . " />oui <input type=\"radio\" name=\"medic_jeupath\" value=\"2\"" . ($medic_jeupath != 1 ? " checked=checked" : "") . " />non</td>\n";
		echo "</tr>\n";

		echo "</table>\n";
		echo "</div>\n";

		echo "<div style=\"clear: both;\"></div>\n";
/*
		echo "<ul><li><p class=\"bold\">Evaluation psychiatrique</p></li></ul>\n";

		echo "<table>\n";

		if ($medic_anxiete == "")
			$medic_anxiete = 1;

		echo "<tr>\n";
		echo "<td class=\"r\">Anxi&eacute;t&eacute;</td>\n";
		echo "<td>" . select("medic_anxiete", $medic_anxiete_tab, $medic_anxiete) . "</td>\n";
		echo "</tr>\n";

		if ($medic_depression == "")
			$medic_depression = 1;

		echo "<tr>\n";
		echo "<td class=\"r\">D&eacute;pression</td>\n";
		echo "<td>" . select("medic_depression", $medic_depression_tab, $medic_depression) . "</td>\n";
		echo "</tr>\n";

		if ($medic_trouble_psy == "")
			$medic_trouble_psy = 1;

		echo "<tr>\n";
		echo "<td class=\"r\">Troubles psychiatriques</td>\n";
		echo "<td>" . select("medic_trouble_psy", $medic_trouble_psy_tab, $medic_trouble_psy) . "</td>\n";
		echo "</tr>\n";

		echo "</table>\n";
*/

		echo "<div class=\"pager\">\n";
		echo "<a class=\"slink\" href=\"#\" onclick=\"javascript:displayTab('" . ($consu_type != 3 ? "rosace" : "bio" ) . "');\">Suite</a>\n";
		echo "</div>\n";

		echo "<div style=\"clear: both;\"></div>\n";
	}

	function biologie($bio_date, $bio_vgm, $bio_ggt, $bio_asat, $bio_alat, $bio_cdt, $bio_alcoo, $bio_autre)
	{
		echo "<ul><li><p>Biologie</p></li></ul>\n";

		echo "<table>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Date</td>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"bio_date\" id=\"bio_date\" value=\"" . ($bio_date != "0000-00-00" ? format_date($bio_date) : "") . "\" size=\"10\" maxlength=\"10\" /><span><a href=\"#\" onclick=\"return showCalendar('bio_date', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a>&nbsp;(jj/mm/aaaa)</span></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">VGM</td>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"bio_vgm\" id=\"bio_vgm\" value=\"" . $bio_vgm . "\" size=\"3\" maxlength=\"3\" /> µ3</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">GGT</td>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"bio_ggt\" id=\"bio_ggt\" value=\"" . $bio_ggt . "\" size=\"3\" maxlength=\"3\" /> UI/l</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">ASAT</td>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"bio_asat\" id=\"bio_asat\" value=\"" . $bio_asat . "\" size=\"3\" maxlength=\"3\" /> UI/l</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">ALAT</td>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"bio_alat\" id=\"bio_alat\" value=\"" . $bio_alat . "\" size=\"3\" maxlength=\"3\" /> UI/l</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">CDT</td>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"bio_cdt\" id=\"bio_cdt\" value=\"" . $bio_cdt . "\" size=\"3\" maxlength=\"3\" /> UI/l</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Alcool&eacute;mie</td>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"bio_alcoo\" id=\"bio_alcoo\" value=\"" . $bio_alcoo . "\" size=\"3\" maxlength=\"3\" /> gr/l</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"r\">Autre</td>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"bio_autre\" id=\"bio_autre\" value=\"" . $bio_autre . "\" /></td>\n";
		echo "</tr>\n";

		echo "</table>\n";

		echo "<div class=\"pager\">\n";
		echo "<a class=\"slink\" href=\"#\" onclick=\"javascript:displayTab('rosace');\">Suite</a>\n";
		echo "</div>\n";
	}

	function rosace($eval_qv, $eval_alcool, $eval_tabac, $eval_canabis, $eval_mesusmedi, $eval_prodill, $eval_troublcond, $eval_probjudi, $eval_probpro, $eval_probsoc, $eval_probfam, $eval_etatpsy, $eval_etatsoma, $eval_motiv)
	{
		global $eval_qv_tab, $eval_motiv_tab, $rosace_tab, $consu_type, $medic_anxiete, $medic_anxiete_tab, $medic_depression, $medic_depression_tab, $medic_trouble_psy, $medic_trouble_psy_tab;

		echo "<table>\n";

		echo "<tr>\n";
		echo "<td>Evaluation de la qualit&eacute; de vie</td>\n";
		echo "<td>" . select("eval_qv", $eval_qv_tab, $eval_qv) . "</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Evaluation de la motivation</td>\n";
		echo "<td>" . select("eval_motiv", $eval_motiv_tab, $eval_motiv) . "</td>\n";
		echo "</tr>\n";

		echo "</table>\n";

		if ($consu_type != 1)
		{
			echo "<ul><li><p>Evaluation psychiatrique</p></li></ul>\n";

			echo "<table>\n";

			if ($medic_anxiete == "")
				$medic_anxiete = 1;

			echo "<tr>\n";
			echo "<td class=\"r\">Anxi&eacute;t&eacute;</td>\n";
			echo "<td>" . select("medic_anxiete", $medic_anxiete_tab, $medic_anxiete) . "</td>\n";
			echo "</tr>\n";

			if ($medic_depression == "")
				$medic_depression = 1;

			echo "<tr>\n";
			echo "<td class=\"r\">D&eacute;pression</td>\n";
			echo "<td>" . select("medic_depression", $medic_depression_tab, $medic_depression) . "</td>\n";
			echo "</tr>\n";

			if ($medic_trouble_psy == "")
				$medic_trouble_psy = 1;

			echo "<tr>\n";
			echo "<td class=\"r\">Troubles psychiatriques</td>\n";
			echo "<td>" . select("medic_trouble_psy", $medic_trouble_psy_tab, $medic_trouble_psy) . "</td>\n";
			echo "</tr>\n";

			echo "</table>\n";
		}

		if ($consu_type == 4)
		{
			global $fin_add, $fin_motiv, $produits_tab;

			echo "<ul><li><p>Evaluation de la motivation : Autre addiction</p></li></ul>\n";

			echo "<table>\n";

			echo "<tr>\n";
			echo "<td>Addiction concern&eacute;e</td>\n";
			echo "<td>" . select("fin_add", $produits_tab, $fin_add) . "</td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td>Motivation</td>\n";
			echo "<td>" . select("fin_motiv", $eval_motiv_tab, $fin_motiv) . "</td>\n";
			echo "</tr>\n";

			echo "</table>\n";
		}

		if ($consu_type != 3)
		{
			echo "<ul><li><p>Rosace</p></li></ul>\n";

			echo "<div class=\"legende\">\n";
			echo "<div class=\"center bold\">L&eacute;gende de la rosace</div><br /><br />\n";
			echo "0 : Aucun probl&egrave;me<br />";
			echo "1 : Probl&egrave;me inapparent<br />";
			echo "2 : Plaintes uniquements<br />";
			echo "3 : Cons&eacute;quences concr&egrave;tes";
			echo "</div>\n";

			echo "<table>\n";

			echo "<tr>\n";
			echo "<td>Consommation d'alcool</td>\n";
			echo "<td>" . select_rosace("eval_alcool", $rosace_tab, $eval_alcool) . "</td>\n";
			echo "<td>Consommation de tabac</td>\n";
			echo "<td>" . select_rosace("eval_tabac", $rosace_tab, $eval_tabac) . "</td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td>Consommation de canabis</td>\n";
			echo "<td>" . select_rosace("eval_canabis", $rosace_tab, $eval_canabis) . "</td>\n";
			echo "<td>M&eacute;susage de m&eacute;dicaments</td>\n";
			echo "<td>" . select_rosace("eval_mesusmedi", $rosace_tab, $eval_mesusmedi) . "</td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td>Produits illicites, M&eacute;susage</td>\n";
			echo "<td>" . select_rosace("eval_prodill", $rosace_tab, $eval_prodill) . "</td>\n";
			echo "<td>Troubles des conduites alimentaires</td>\n";
			echo "<td>" . select_rosace("eval_troublcond", $rosace_tab, $eval_troublcond) . "</td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td>Probl&egrave;me judiciaire</td>\n";
			echo "<td>" . select_rosace("eval_probjudi", $rosace_tab, $eval_probjudi) . "</td>\n";
			echo "<td>Probl&egrave;me professionnel</td>\n";
			echo "<td>" . select_rosace("eval_probpro", $rosace_tab, $eval_probpro) . "</td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td>Probl&egrave;me socio-financier</td>\n";
			echo "<td>" . select_rosace("eval_probsoc", $rosace_tab, $eval_probsoc) . "</td>\n";
			echo "<td>Probl&egrave;me familial</td>\n";
			echo "<td>" . select_rosace("eval_probfam", $rosace_tab, $eval_probfam) . "</td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td>Etat psychique</td>\n";
			echo "<td>" . select_rosace("eval_etatpsy", $rosace_tab, $eval_etatpsy) . "</td>\n";
			echo "<td>Etat somatique</td>\n";
			echo "<td>" . select_rosace("eval_etatsoma", $rosace_tab, $eval_etatsoma) . "</td>\n";
			echo "</tr>\n";

			echo "</table>\n";

			echo "<p><a class=\"slink\" href=\"javascript:drawRosace()\">Afficher la rosace</a></p>\n";

			echo "<div id=\"myRosace\" style=\"position:relative; left:0px; top:0px;\">\n";
			echo "<img src=\"img/rosace.png\" alt=\"Rosace\" style=\"width: 633px; height: 477px;\" />\n";
			echo "</div>\n";
		}

		echo "<div class=\"pager\">\n";
		if ($consu_type == 1)
			$tab = "consultation";
		elseif ($consu_type == 2)
			$tab = "proposition";
		elseif ($consu_type == 3)
			$tab = "prescription";
		else
			$tab = "proposition";

		if ($_SESSION["Suser_cat"] != 1)
			$tab = "consultation";

		echo "<a class=\"slink\" href=\"#\" onclick=\"javascript:displayTab('" . $tab . "');\">Suite</a>\n";
		echo "</div>\n";
	}

	function proposition($id_prop, $id_mod, $prop_date, $prop_contrat, $prop_objectif, $prop_orientation, $prop_interv, $prop_sortie, $prop_motif)
	{
		global $prop_orientation_tab, $prop_interv_tab, $consu_type, $prop_tera_tab, $prop_tera;
		global $menu, $suivi;

		global $propPresc;

		echo "<table>\n";

		echo "<tr>\n";
		echo "<td>Module propos&eacute;e</td>\n";
		echo "<td>" . $menu->select_module($id_mod) . "</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Date de la proposition</td>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"prop_date\" id=\"prop_date\" value=\"" . ($prop_date != "0000-00-00" ? format_date($prop_date) : format_date(date("Y-m-d"))) . "\" size=\"10\" maxlength=\"10\" /><span><a href=\"#\" onclick=\"return showCalendar('prop_date', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a>&nbsp;(jj/mm/aaaa)</span></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Date de signature du contrat</td>\n";
		echo "<td><input class=\"int\" type=\"text\" name=\"prop_contrat\" id=\"prop_contrat\" value=\"" . ($prop_contrat != "0000-00-00" ? format_date($prop_contrat) : "") . "\" size=\"10\" maxlength=\"10\" /><span><a href=\"#\" onclick=\"return showCalendar('prop_contrat', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a>&nbsp;(jj/mm/aaaa)</span></td>\n";
		echo "</tr>\n";

		if (empty($consu_type))
		{
			$list_suivi_pat = $suivi->list_suivi_pat($_SESSION["Sid_pat"]);
			$nb_suivi = count($list_suivi_pat);

			echo "<tr>\n";
			echo "<td>Prescripteur</td>\n";
			echo "<td>";
			echo "<select name=\"propPresc\" size=\"1\">";
			foreach ($list_suivi_pat as $suivi_pat)
			{
				if ($suivi_pat["id_user"])
				{
					echo "<option value=\"" . $suivi_pat["id_user"] . "\"" . ($propPresc == $suivi_pat["id_user"] ? " selected=\"selected\"" : "") . ">" . $suivi_pat["user_nom"] . " " . $suivi_pat["user_prenom"] . "</option>\n";
				}
			}
			echo "</select>";
			echo "</td>\n";
			echo "</tr>\n";
		}

		echo "<tr>\n";
		echo "<td>Objectif</td>\n";
		echo "<td><textarea name=\"prop_objectif\" id=\"prop_objectif\">" . nobr($prop_objectif) . "</textarea></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Proposition thérapeutique</td>\n";
		echo "<td><select name=\"prop_tera\" size=\"1\">";
		echo "<option value=\"\">-- Choisir --</option>\n";

		foreach($prop_tera_tab AS $key => $value)
		{
			if (ereg("^opt", $key, $regs))
				echo "<optgroup label=\"" . $value . "\">\n";
			elseif (ereg("^/opt", $key, $regs))
				echo "</optgroup>\n";
			else
				echo "<option value=\"" . $key. "\"" . ($key == $prop_tera ? " selected=selected" : "") . ">" . $value . "</option>\n";
		}

		echo "</select>";
		echo "</td>\n";
		echo "</tr>\n";
/*
		echo "<tr>\n";
		echo "<td>Intervenants</td>\n";
		echo "<td>" . select("prop_interv", $prop_interv_tab, $prop_interv) . "</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Sortie du r&eacute;seau</td>\n";
		echo "<td><input type=\"checkbox\" name=\"prop_sortie\" id=\"prop_sortie\" value=\"1\"" . ($prop_sortie == 1 ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Motif de la sortie</td>\n";
		echo "<td><textarea name=\"prop_motif\" id=\"prop_motif\">" . nobr($prop_motif) . "</textarea></td>\n";
		echo "</tr>\n";
*/
		echo "</table>\n";

		if (!empty($consu_type))
		{
			echo "<div class=\"pager\">\n";
			echo "<a class=\"slink\" href=\"#\" onclick=\"javascript:displayTab('" . ($consu_type != 4 ? "consultation" : "satisfaction") . "');\">Suite</a>\n";
			echo "</div>\n";
		}

		echo "<input type=\"hidden\" name=\"id_prop\" value=\"" . $id_prop . "\" />\n";
	}

	function prescriptions($bio_spe, $bio_posol, $bio_duree, $activites)
	{
		global $consu_type, $prop_tera_tab, $prop_tera;

		if ($consu_type != 3)
		{
			echo "<ul><li><p>Prescription m&eacute;dicamenteuse</p></li></ul>\n";

			echo "<table>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Sp&eacute;cialit&eacute; ou DCI</td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"bio_spe\" id=\"bio_spe\" value=\"" . $bio_spe . "\" /></td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Posologie</td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"bio_posol\" id=\"bio_posol\" value=\"" . $bio_posol . "\" /></td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Dur&eacute;e</td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"bio_duree\" id=\"bio_duree\" value=\"" . $bio_duree . "\" /></td>\n";
			echo "</tr>\n";

			echo "</table>\n";
		}
		else
		{
			echo "<table style=\"width: 100%\">\n";

			echo "<tr>\n";
			echo "<td style=\"width: 50%\" colspan=\"2\"><ul><li><p>Prescription m&eacute;dicamenteuse</p></li></ul></td>\n";
			echo "<td style=\"width: 50%\" colspan=\"2\"><ul><li><p>Proposition thérapeutique</p></li></ul></td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Sp&eacute;cialit&eacute; ou DCI</td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"bio_spe\" id=\"bio_spe\" value=\"" . $bio_spe . "\" /></td>\n";
			echo "<td rowspan=\"3\">";

			echo "<select name=\"prop_tera\" size=\"1\">\n";
			echo "<option value=\"\">-- Choisir --</option>\n";

			foreach($prop_tera_tab AS $key => $value)
			{
				if (ereg("^opt", $key, $regs))
					echo "<optgroup label=\"" . $value . "\">\n";
				elseif (ereg("^/opt", $key, $regs))
					echo "</optgroup>\n";
				else
					echo "<option value=\"" . $key. "\"" . ($key == $prop_tera ? " selected=selected" : "") . ">" . $value . "</option>\n";
			}

			echo "</select>\n";

			echo "</td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Posologie</td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"bio_posol\" id=\"bio_posol\" value=\"" . $bio_posol . "\" /></td>\n";
			echo "</tr>\n";

			echo "<tr>\n";
			echo "<td class=\"r\">Dur&eacute;e</td>\n";
			echo "<td><input class=\"int\" type=\"text\" name=\"bio_duree\" id=\"bio_duree\" value=\"" . $bio_duree . "\" /></td>\n";
			echo "</tr>\n";

			echo "</table>\n";
		}

		echo "<ul><li><p>Prescriptions (date au format jj/mm/aaaa)</p></li></ul>\n";

		echo "<table id=\"table-prescription\" class=\"center\">\n";

		echo "<tr>\n";
		echo "<th>Suivi</th>\n";
		echo "<th class=\"nobg\">&nbsp;</th>\n";
		echo "<th>Prescrit</th>\n";
		echo "<th>Effectu&eacute;</th>\n";
		echo "</tr>\n";
/*
		echo "<tr>\n";
		echo "<td rowspan=\"3\">Consultation</td>\n";
		echo "<td>Diéteticienne</td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"id_act[]\" value=\"1\"" . (!empty($id_act) && in_multi_array(1, $id_act) ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"act_faite[]\" value=\"1\"" . (!empty($act_faite) && in_multi_array(1, $act_faite) ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Psychologue</td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"id_act[]\" value=\"2\"" . (!empty($id_act) && in_multi_array(2, $id_act) ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"act_faite[]\" value=\"2\"" . (!empty($act_faite) && in_multi_array(2, $act_faite) ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Infirmier</td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"id_act[]\" value=\"3\"" . (!empty($id_act) && in_multi_array(3, $id_act) ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"act_faite[]\" value=\"3\"" . (!empty($act_faite) && in_multi_array(3, $act_faite) ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Activité CCAA</td>\n";
		echo "<td>Relaxation</td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"id_act[]\" value=\"4\"" . (!empty($id_act) && in_multi_array(4, $id_act) ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"act_faite[]\" value=\"4\"" . (!empty($act_faite) && in_multi_array(4, $act_faite) ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td rowspan=\"4\">Groupe CCAA</td>\n";
		echo "<td>Information</td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"id_act[]\" value=\"5\"" . (!empty($id_act) && in_multi_array(5, $id_act) ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"act_faite[]\" value=\"5\"" . (!empty($act_faite) && in_multi_array(5, $act_faite) ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Motivationnel</td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"id_act[]\" value=\"6\"" . (!empty($id_act) && in_multi_array(6, $id_act) ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"act_faite[]\" value=\"6\"" . (!empty($act_faite) && in_multi_array(6, $act_faite) ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Maintien de l'abstinence</td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"id_act[]\" value=\"7\"" . (!empty($id_act) && in_multi_array(7, $id_act) ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"act_faite[]\" value=\"7\"" . (!empty($act_faite) && in_multi_array(7, $act_faite) ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Groupe du Mardi</td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"id_act[]\" value=\"8\"" . (!empty($id_act) && in_multi_array(8, $id_act) ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"act_faite[]\" value=\"8\"" . (!empty($act_faite) && in_multi_array(8, $act_faite) ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td rowspan=\"4\">Activités hors CCAA</td>\n";
		echo "<td>Détente et bien être</td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"id_act[]\" value=\"9\"" . (!empty($id_act) && in_multi_array(9, $id_act) ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"act_faite[]\" value=\"9\"" . (!empty($act_faite) && in_multi_array(9, $act_faite) ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Relaxation</td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"id_act[]\" value=\"10\"" . (!empty($id_act) && in_multi_array(10, $id_act) ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"act_faite[]\" value=\"10\"" . (!empty($act_faite) && in_multi_array(10, $act_faite) ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Expression théâtrale et corporelle</td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"id_act[]\" value=\"11\"" . (!empty($id_act) && in_multi_array(11, $id_act) ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"act_faite[]\" value=\"11\"" . (!empty($act_faite) && in_multi_array(11, $act_faite) ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Mouvement d'anciens buveurs</td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"id_act[]\" value=\"12\"" . (!empty($id_act) && in_multi_array(12, $id_act) ? " checked=checked" : "") . " /></td>\n";
		echo "<td class=\"center\"><input type=\"checkbox\" name=\"act_faite[]\" value=\"12\"" . (!empty($act_faite) && in_multi_array(12, $act_faite) ? " checked=checked" : "") . " /></td>\n";
		echo "</tr>\n";
*/
		echo "<tr>\n";
		echo "<td rowspan=\"3\">Consultation</td>\n";
		echo "<td>Diéteticienne</td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites1_1\" name=\"activites[1][prescrit]\" value=\"" . (isset($activites[1]["prescrit"]) ? $activites[1]["prescrit"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites1_1', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites1_2\" name=\"activites[1][effectue]\" value=\"" . (isset($activites[1]["effectue"]) ? $activites[1]["effectue"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites1_2', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Psychologue</td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites2_1\" name=\"activites[2][prescrit]\" value=\"" . (isset($activites[2]["prescrit"]) ? $activites[2]["prescrit"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites2_1', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites2_2\" name=\"activites[2][effectue]\" value=\"" . (isset($activites[2]["effectue"]) ? $activites[2]["effectue"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites2_2', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Infirmier</td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites3_1\" name=\"activites[3][prescrit]\" value=\"" . (isset($activites[3]["prescrit"]) ? $activites[3]["prescrit"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites3_1', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites3_2\" name=\"activites[3][effectue]\" value=\"" . (isset($activites[3]["effectue"]) ? $activites[3]["effectue"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites3_2', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Activité CCAA</td>\n";
		echo "<td>Relaxation</td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites4_1\" name=\"activites[4][prescrit]\" value=\"" . (isset($activites[4]["prescrit"]) ? $activites[4]["prescrit"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites4_1', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites4_2\" name=\"activites[4][effectue]\" value=\"" . (isset($activites[4]["effectue"]) ? $activites[4]["effectue"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites4_2', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td rowspan=\"4\">Groupe CCAA</td>\n";
		echo "<td>Information</td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites5_1\" name=\"activites[5][prescrit]\" value=\"" . (isset($activites[5]["prescrit"]) ? $activites[5]["prescrit"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites5_1', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites5_2\" name=\"activites[5][effectue]\" value=\"" . (isset($activites[5]["effectue"]) ? $activites[5]["effectue"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites5_2', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Motivationnel</td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites6_1\" name=\"activites[6][prescrit]\" value=\"" . (isset($activites[6]["prescrit"]) ? $activites[6]["prescrit"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites6_1', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites6_2\" name=\"activites[6][effectue]\" value=\"" . (isset($activites[6]["effectue"]) ? $activites[6]["effectue"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites6_2', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Maintien de l'abstinence</td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites7_1\" name=\"activites[7][prescrit]\" value=\"" . (isset($activites[7]["prescrit"]) ? $activites[7]["prescrit"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites7_1', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites7_2\" name=\"activites[7][effectue]\" value=\"" . (isset($activites[7]["effectue"]) ? $activites[7]["effectue"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites7_2', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Groupe du Mardi</td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites8_1\" name=\"activites[8][prescrit]\" value=\"" . (isset($activites[8]["prescrit"]) ? $activites[8]["prescrit"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites8_1', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites8_2\" name=\"activites[8][effectue]\" value=\"" . (isset($activites[8]["effectue"]) ? $activites[8]["effectue"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites8_2', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td rowspan=\"4\">Activités hors CCAA</td>\n";
		echo "<td>Détente et bien être</td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites9_1\" name=\"activites[9][prescrit]\" value=\"" . (isset($activites[9]["prescrit"]) ? $activites[9]["prescrit"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites9_1', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites9_2\" name=\"activites[9][effectue]\" value=\"" . (isset($activites[9]["effectue"]) ? $activites[9]["effectue"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites9_2', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Relaxation</td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites10_1\" name=\"activites[10][prescrit]\" value=\"" . (isset($activites[10]["prescrit"]) ? $activites[10]["prescrit"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites10_1', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites10_2\" name=\"activites[10][effectue]\" value=\"" . (isset($activites[10]["effectue"]) ? $activites[10]["effectue"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites10_2', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Expression théâtrale et corporelle</td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites11_1\" name=\"activites[11][prescrit]\" value=\"" . (isset($activites[11]["prescrit"]) ? $activites[11]["prescrit"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites11_1', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites11_2\" name=\"activites[11][effectue]\" value=\"" . (isset($activites[11]["effectue"]) ? $activites[11]["effectue"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites11_2', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Mouvement d'anciens buveurs</td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites12_1\" name=\"activites[12][prescrit]\" value=\"" . (isset($activites[12]["prescrit"]) ? $activites[12]["prescrit"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites12_1', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "<td class=\"center\"><input class=\"int\" type=\"text\" size=\"10\" maxlength=\"10\" id=\"activites12_2\" name=\"activites[12][effectue]\" value=\"" . (isset($activites[12]["effectue"]) ? $activites[12]["effectue"] : "") . "\" /><span><a href=\"#\" onclick=\"return showCalendar('activites12_2', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a></span></td>\n";
		echo "</tr>\n";

		echo "</table>\n";

		echo "<div class=\"pager\">\n";
		echo "<a class=\"slink\" href=\"#\" onclick=\"javascript:displayTab('consultation');\">Suite</a>\n";
		echo "</div>\n";
	}

	function satisfaction($sat_secret, $sat_info, $sat_rdv, $sat_demandes, $sat_accueil, $sat_soins, $sat_objectif)
	{
		echo "<table class=\"center\">\n";

		echo "<tr>\n";
		echo "<th>Score</th>\n";
		echo "<th>Tr&egrave;s insatisfait</th>\n";
		echo "<th>Insatisfait</th>\n";
		echo "<th>Satisfait</th>\n";
		echo "<th>Tr&egrave;s satisfait</th>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td class=\"nobg center\">&nbsp;</td>\n";
		echo "<td class=\"nobg center\">-2</td>\n";
		echo "<td class=\"nobg center\">-1</td>\n";
		echo "<td class=\"nobg center\">+1</td>\n";
		echo "<td class=\"nobg center\">+2</td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Le secret professionnel a &eacute;t&eacute; respect&eacute;</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_secret\" value=\"1\"" . ($sat_secret == 1 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_secret\" value=\"2\"" . ($sat_secret == 2 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_secret\" value=\"3\"" . ($sat_secret == 3 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_secret\" value=\"4\"" . ($sat_secret == 4 ? " checked=checked" : "" ) . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>J'ai &eacute;t&eacute; clairement inform&eacute;</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_info\" value=\"1\"" . ($sat_info == 1 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_info\" value=\"2\"" . ($sat_info == 2 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_info\" value=\"3\"" . ($sat_info == 3 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_info\" value=\"4\"" . ($sat_info == 4 ? " checked=checked" : "" ) . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>Les rendez vous ont &eacute;t&eacute; respect&eacute;s</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_rdv\" value=\"1\"" . ($sat_rdv == 1 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_rdv\" value=\"2\"" . ($sat_rdv == 2 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_rdv\" value=\"3\"" . ($sat_rdv == 3 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_rdv\" value=\"4\"" . ($sat_rdv == 4 ? " checked=checked" : "" ) . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Mes demandes ont &eacute;t&eacute; prises en compte</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_demandes\" value=\"1\"" . ($sat_demandes == 1 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_demandes\" value=\"2\"" . ($sat_demandes == 2 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_demandes\" value=\"3\"" . ($sat_demandes == 3 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_demandes\" value=\"4\"" . ($sat_demandes == 4 ? " checked=checked" : "" ) . " /></td>\n";
		echo "</tr>\n";

		echo "<tr>\n";
		echo "<td>J'ai &eacute;t&eacute; bien accueilli</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_accueil\" value=\"1\"" . ($sat_accueil == 1 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_accueil\" value=\"2\"" . ($sat_accueil == 2 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_accueil\" value=\"3\"" . ($sat_accueil == 3 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_accueil\" value=\"4\"" . ($sat_accueil == 4 ? " checked=checked" : "" ) . " /></td>\n";
		echo "</tr>\n";

		echo "<tr class=\"inter\">\n";
		echo "<td>Les soins m'ont aid&eacute; &agrave; am&eacute;liorer mon &eacute;tat de sant&eacute;</td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_soins\" value=\"1\"" . ($sat_soins == 1 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_soins\" value=\"2\"" . ($sat_soins == 2 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_soins\" value=\"3\"" . ($sat_soins == 3 ? " checked=checked" : "" ) . " /></td>\n";
		echo "<td class=\"center\"><input type=\"radio\" name=\"sat_soins\" value=\"4\"" . ($sat_soins == 4 ? " checked=checked" : "" ) . " /></td>\n";
		echo "</tr>\n";

		echo "</table>\n";

		echo "<div class=\"pager\">\n";
		echo "<a class=\"slink\" href=\"#\" onclick=\"javascript:displayTab('consultation');\">Suite</a>\n";
		echo "</div>\n";
	}
}

?>