2016-11-05 13:58:31 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
define('__ROOT__', dirname(dirname(dirname(__FILE__))) );
|
|
|
|
|
|
|
|
require_once __ROOT__.'/autoloader.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use \database\core\Repo;
|
|
|
|
use \database\core\DatabaseDriver;
|
|
|
|
use \orm\core\Table;
|
2016-11-05 15:13:31 +00:00
|
|
|
use \orm\core\Rows;
|
2016-11-05 13:58:31 +00:00
|
|
|
|
|
|
|
debug();
|
|
|
|
|
|
|
|
|
|
|
|
/* [2] Requests on lab-surveys
|
|
|
|
=========================================================*/
|
2016-11-05 15:13:31 +00:00
|
|
|
$lisst = Table::get('laboratoires', 'lab-surveys')
|
|
|
|
// ->select('idLaboratoire')
|
|
|
|
->whereIntitule('LISST');
|
|
|
|
|
2016-11-05 13:58:31 +00:00
|
|
|
$etudes = Table::get('etudes', 'lab-surveys')
|
2016-11-05 15:13:31 +00:00
|
|
|
// ->select('idEtude')
|
|
|
|
->join('idLaboratoire', $lisst)
|
|
|
|
->orderby('idEtude')
|
|
|
|
->unique();
|
|
|
|
|
|
|
|
$fiches = Table::get('fiches', 'lab-surveys')
|
|
|
|
->select('idFiche')
|
|
|
|
->orderby('idFiche')
|
|
|
|
->join('idEtude', $etudes);
|
|
|
|
|
|
|
|
$questions = Table::get('questionsFiches', 'lab-surveys')
|
|
|
|
->select('idQuestionFiche')
|
|
|
|
->select('intitule', null, null, 'question')
|
|
|
|
->orderby('idQuestionFiche')
|
|
|
|
// ->unique()
|
|
|
|
->join('idFiche', $fiches);
|
|
|
|
|
|
|
|
$repAtt = Table::get('reponsesAttenduesFiches', 'lab-surveys')
|
|
|
|
->select('intitule', Rows::SEL_CONCAT, null, 'reponses')
|
|
|
|
->orderby('idReponseAttendueFiche')
|
|
|
|
->join('idQuestionFiche', $questions);
|
|
|
|
|
|
|
|
$sujets = Table::get('sujets', 'lab-surveys')
|
|
|
|
->select('idSujet')
|
|
|
|
->select('pseudo');
|
|
|
|
|
2016-11-05 13:58:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-05 15:13:31 +00:00
|
|
|
var_dump( $v=$repAtt->fetch() );
|
2016-11-05 13:58:31 +00:00
|
|
|
|
|
|
|
?>
|