<?php

ini_set("display_errors", "1");
ini_set("error_reporting", "2047");

//Ci-dessous pour la securite du transfert des donnees configurer l'acces https
/*if (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != "on")
{
	header ("Location: https://<nom de domaine>");
	exit;
}
*/
@session_start();

//Pour tester laisser la valeur a 1 puis mettre a 0
define("NO_LOGIN", 1);

//Definir un pass general pour l'administration si oui <true> si non <false> 
//le pass est a inscrire crypte MD5 dans le fichier class/utilisateur.class.php ligne 97
define("ADMIN_ACCOUNT", false);

include ("error_handler.php");
include ("dbconfig.php");
include ("functions.php");

if (!mysql_connect($dbconfig["server"], $dbconfig["login"], $dbconfig["pass"]) || !mysql_select_db($dbconfig["database"]))
  die ("Erreur m&eacute;canique " . mysql_errno() . " : " . mysql_error());

include ("class/formulaire.class.php");
include ("class/patient.class.php");
include ("class/utilisateur.class.php");
include ("class/menu.class.php");
include ("class/suivi.class.php");
include ("class/consultation.class.php");
include ("class/rdv.class.php");
include ("class/proposition.class.php");
include ("class/alctab.class.php");
include ("class/bio.class.php");
include ("class/debut.class.php");
include ("class/drogue.class.php");
include ("class/medicament.class.php");
include ("class/rosace.class.php");
include ("class/situpat.class.php");
include ("class/structure.class.php");
include ("class/correspondants.class.php");
include ("class/satisfaction.class.php");
include ("class/activite.class.php");
include ("class/final.class.php");
include ("class/bilan.class.php");
include ("class/bilan_mod1.class.php");
include ("class/bilan_global.class.php");
include ("class/compta.class.php");

$form = new formulaire();
$pat = new patient();
$util = new utilisateur();
$menu = new menu();
$suivi = new suivi();
$consu = new consultation();
$rdv = new rdv();
$prop = new proposition();
$alctab = new alctab();
$bio = new bio();
$debut = new debut();
$drogue = new drogue();
$medic = new medicament();
$rosace = new rosace();
$situpat = new situpat();
$structure = new structure();
$corres = new correspondants();
$sat = new satisfaction();
$activite = new activite();
$final = new finalCons();

// Boite d'information
$infobox = array();

// Droits
include ("rights.php");

define("ADMIN_USER", 1);

// Menu déroulants
$cat_tab = array (
	1 => "Prescripteur",
	2 => "Non prescripteur",
);

$sexe_tab = array (
	1 => "Masculin",
	2 => "F&eacute;minin",
);

$sit_mat_tab = array (
	1 => "Non r&eacute;ponse",
	2 => "C&eacute;libataire",
	3 => "Mari&eacute;(e)",
	4 => "Veuf(ve)",
	5 => "PACS",
	6 => "Vit maritalement",
	7 => "Divorc&eacute;(e)",
);

$sit_fam_tab = array (
	1  => "Non r&eacute;ponse",
	2  => "Chez ses parents",
	3  => "Chez un seul parent",
	4  => "Chez d'autres membres de la famille",
	5  => "Seul(e)",
	6  => "Seul(e) avec enfant(s)",
	7  => "En couple sans enfant(s)",
	8  => "En couple avec enfant(s)",
	9  => "Avec des amis",
	10 => "Autre",
	11 => "Ne sait pas",
);

$sit_log_tab = array (
	1  => "Non r&eacute;ponse",
	2  => "Ind&eacute;pendant durable",
	9  => "Ind&eacute;pendant provisoire",
	3  => "Foyer durable",
	10 => "Foyer provisoire",
	4  => "Milieu p&eacute;nitentiaire",
	5  => "Chez des proches durable",
	11 => "Chez des proches provisoire",
	6  => "En institution durable",
	12 => "En institution provisoire",
	7  => "Rue ou squat",
	8  => "Autre",
);

$sit_ress_tab = array (
	1 => "Aucune",
	2 => "Emploi (ou retraite, invalidit&eacute;, longue maladie)",
	3 => "Familiales ou tiers",
	4 => "AAH",
	5 => "RMI",
	6 => "ASSEDIC",
	7 => "Autres",
//	8 => "Difficult&eacute;s financi&egrave;res",
//	9 => "Incapable majeur (= sous tutelle)",
	10 => "Ne sait pas",
);

$couv_tab = array (
	1  => "Non r&eacute;ponse",
	2  => "Aucune",
	3  => "S&eacute;curit&eacute; sociale seule",
	4  => "S&eacute;curit&eacute; sociale + mutuelle",
	5  => "CMU base",
	6  => "CMU compl&eacute;mentaire",
	7  => "ALD",
	8  => "AME",
	9  => "Dispense d'avis des frais",
	10 => "Ne sait pas",
);

$sit_etude_tab = array (
	1  => "Non r&eacute;ponse",
	2  => "Non scolaris&eacute;",
	3  => "Primaire",
	4  => "BEPC",
	11 => "CAP",
	5  => "BAC",
	6  => "BAC +2",
	7  => "BAC >2",
	8  => "Dipl&ocirc;me sup&eacute;rieur",
	9  => "Illettrisme",
	10 => "Ne sait pas",
);


$sit_csp_tab = array (
	1 => "Agriculteurs / Artisans",
	2 => "Commer&ccedil;ants / Cadres",
	3 => "Professions lib&eacute;rales",
	4 => "Professions interm&eacute;diaires (services)",
	5 => "Employ&eacute;s",
	6 => "Ouvriers",
	7 => "Sans profession",
	8 => "Ne sait pas",
);

$sit_pec_tab = array (
  1 => "Aucune",
  2 => "Ant&eacute;rieure",
  3 => "En cours",
  4 => "Non r&eacute;ponse",
  5 => "Ne sait pas",
);

$alc_conso_tab = array (
	1 => "non consommateur",
	2 => "consommateur actuel",
	3 => "consommateur ant&eacute;rieur",
	4 => "non r&eacute;ponse",
);

$alc_usage_tab = array (
	1 => "usage",
	2 => "usage &agrave; risque",
	3 => "usage nocif",
	4 => "alcoolo-d&eacute;pendance",
);

$tab_conso_tab = array (
	0 => "non usage",
	1 => "usage actuel",
	2 => "ancien usage",
	3 => "non r&eacute;ponse",
);

$medic_anxiete_tab = array (
	1 => "0. Pas d'anxi&eacute;t&eacute;",
	2 => "1. Anxi&eacute;t&eacute; ressentie occasionnellement, vite surmont&eacute;e",
	3 => "2. Anxi&eacute;t&eacute; r&eacute;currente ou persistante, mais conservation des activit&eacute;s normales",
	4 => "3. Anxi&eacute;t&eacute; entra&icirc;nant des troubles de la vie sociale ou familiale",
);

$medic_anxiete_score = array (
	1 => 0,
	2 => 1,
	3 => 2,
	4 => 3,
);

$medic_depression_tab = array (
	1 => "0. Pas d'affects d&eacute;pressifs",
	2 => "1. Affects d&eacute;pressifs passagers",
	3 => "2. Affects d&eacute;pressifs r&eacute;currents ou persistants, sans perturbation sociale, familiale ou professionnelle",
	4 => "3. Perturbations sociales et familiales, activit&eacute; professionnelle impossible",
);

$medic_depression_score = array (
	1 => 0,
	2 => 1,
	3 => 2,
	4 => 3,
);

$medic_trouble_psy_tab = array (
	1 => "Pas de troubles psychiatriques",
	2 => "Trouble de la personnalit&eacute;",
	3 => "Psychose",
	4 => "Troubles anxieux primaires",
	5 => "Troubles d&eacute;pressifs primaires",
);

$rosace_tab = array (
	0 => "0",
	1 => "1",
	2 => "2",
	3 => "3",
);

$prop_orientation_tab = array (
	4 => "Aucune",
	1 => "Consultation anti-tabac",
	2 => "Soins et traitements aux toxicomanes",
	3 => "Consultation Cannabis",
);

$prop_interv_tab = array (
	5 => "Aucun",
	1 => "Services sociaux",
	2 => "M&eacute;decin sp&eacute;cialiste non psychiatre",
	3 => "Psychiatre",
	4 => "Autre",
);

$structures_tab = array (
	1 => "G&eacute;n&eacute;raliste",
	2 => "Psychiatre",
	3 => "Structure Alcoologique",
	4 => "Autre structure Addictologique",
	5 => "Structure psychiatrique",
	6 => "Structure non sp&eacute;cialis&eacute;s",
);

$produits_tab = array (
	26 => "Alcool",
	27 => "Tabac",
	1  => "Cannabis et d&eacute;riv&eacute;s",
	2  => "H&eacute;ro&iuml;ne",
	3  => "Cod&eacute;&iuml;ne",
	4  => "Autres opiac&eacute;s et d&eacute;riv&eacute;s",
	5  => "LSD + autres acides",
	6  => "Autres hallucinog&egrave;nes",
	7  => "Solvants et colles",
	8  => "Amph&eacute;tamines",
	9  => "MDMA et d&eacute;riv&eacute;s",
	10 => "Autres stimulants",
	11 => "Coca&iuml;ne et coca",
	12 => "Crack",
	13 => "Autres produits illicites",
//	14 => "Voie I.V",
	15 => "Benzodiaz&eacute;pines",
	16 => "Autres anxiolytiques",
	17 => "Hypnotiques",
	18 => "Antid&eacute;presseurs",
	19 => "Neuroleptiques",
	20 => "Barbituriques",
	21 => "M&eacute;thadone",
	22 => "Subutex",
	23 => "Anorexie",
	24 => "Boulimie",
	25 => "Jeu pathologique",
);

$resultats_tab = array (
	1 => "Abstinence",
	2 => "Substitution",
	3 => "Réduction",
	4 => "Echec",
	5 => "Rechute",
);

$eval_qv_tab = array (
	1  => 0,
	2  => 1,
	3  => 2,
	4  => 3,
	5  => 4,
	6  => 5,
	7  => 6,
	8  => 7,
	9  => 8,
	10 => 9,
	11 => 10,
);

$eval_motiv_tab = array (
	7 => "Ne sait pas",
	1 => "Pr&eacute;-intention",
	2 => "Intention",
	3 => "Pr&eacute;paration",
	4 => "Action",
	5 => "Maintien",
	6 => "R&eacute;solution",
);

$prop_tera_tab = array (
	"opt1"  => "Autres structures addictologiques",
	1       => "Consultation anti-tabac",
	2       => "Soins et traitements aux toxicomanes",
	3       => "Consultation cannabis",
	"/opt1" => "",
	"opt2"  => "Intervenant",
	4       => "Services sociaux",
	5       => "Médecin spécialiste non psychiatre",
	6       => "Psychiatre",
	7       => "Autre",
	"/opt2" => "",
	"opt3"  => "Hôpital",
	8       => "Service d'urgence",
	9       => "Hôpital psychiatrique",
	10      => "Autres service",
	"/opt3" => "",
);

// ---------------------------------
// Parametres pour les erreurs
// ---------------------------------

$error_list = array (
	1 => "Erreur m&eacute;canique, veuillez contacter l'administrateur.",
	2 => "Merci de remplir les champs &eacute;toil&eacute;s.",
	3 => "V&eacute;rifiez le format de votre e-mail.",
	4 => "Vous n'avez pas entr&eacute; exactement les m&ecirc;mes mots de passe dans les deux zones de saisie.",
	5 => "La date de naissance n'est pas valide.",
	6 => "La date de consultation n'est pas valide.",
	7 => "La date de RDV n'est pas valide.",
	8 => "Attention<br />Un patient ayant les mêmes 3 premières lettres du nom, la même première lettre du prénom et la même date de naissance<br />existe déjà dans la base de données, veuillez contacter l'administrateur pour vérification.",
);


$consu_type_tab = array (
	1 => "Fiche de contact",
	2 => "Dossier initial",
	3 => "Consultation de suite",
	4 => "Dossier final",
);

$consu_type_file_tab = array (
	1 => "fiche.php",
	2 => "dossier_init.php",
	3 => "dossier_suite.php",
	4 => "dossier_final.php",
);

?>