<?php
$DB_DATABASE = "";
$prefix = "iitech_";
if(isset($_POST['database'])){
	$DB_DATABASE = $prefix.$_POST['database'];
}

// include db connect class
require_once __DIR__ . '/include/new_db_connect.php';

// connecting to db
$bdd = connect($DB_DATABASE);

$idr = 1;

try{
	$sql  = 'select *  from config_reclamation where id = :idr';
	$statement = $bdd->prepare($sql);
	$statement->bindParam(':idr', 		$idr, 		PDO::PARAM_STR);
	$statement->execute();
	$tab=$statement->fetch(PDO::FETCH_ASSOC);
	$semestre     = $tab['semestre'];

	$m_insertion  = $tab['m_insertion'];

	$recorrection = $tab['recorrection'];

	$tab1 = array('semestre' => "$semestre");

	$tab2 = array('m_insertion' => "$m_insertion");

	$tab3 = array('recorrection' => "$recorrection");

	$json['types'][] = $tab1;

	$json['types'][] = $tab2;

	$json['types'][] = $tab3;

	echo json_encode($json); 
	
}catch(PDOException  $e ){
	echo $e->getMessage( );
}
?>