123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <?php
- /*
- * Created on 28 juil. 2006 by Elixir Interactive http://www.elixir-interactive.com
- */
-
- $nameTools= 'Réussite';
- $langFile = array ('registration', 'index','trad4all','tracking');
- $cidReset=true;
- require ('../inc/global.inc.php');
-
- $this_section = "session_my_space";
-
- api_block_anonymous_users();
- $interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
- Display :: display_header($nameTools);
-
-
- $tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
- $tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
- $tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
- $tbl_session = Database :: get_main_table(MAIN_SESSION_TABLE);
- $tbl_track_exercice = Database :: get_statistic_table(STATISTIC_TRACK_E_EXERCICES_TABLE);
-
- /*
- ===============================================================================
- MAIN CODE
- ===============================================================================
- */
- if(!empty($_GET['session']))
- {
-
- $sqlSession = " SELECT name,id
- FROM $tbl_session
- ORDER BY name ASC
- ";
- $resultSession = api_sql_query($sqlSession);
-
- echo "<a href='".$_SERVER['PHP_SELF']."'>".get_lang('MoyCourse')."</a>";
- echo "<br /><br />";
-
- if(mysql_num_rows($resultSession)>0)
- {
-
-
- echo '<table class="data_table">
- <tr>
- <th>
- '.get_lang('Session').'
- </th>
- <th>
- '.get_lang('MoyenneTest').'
- </th>
- <th>
- '.get_lang('MoyenneExamen').'
- </th>
- </tr>
- ';
-
- while($a_session = mysql_fetch_array($resultSession))
- {
- $sqlCourse = " SELECT title,code
- FROM $tbl_course as course
- INNER JOIN $tbl_session_course AS rel_course
- ON course.code = rel_course.course_code
- AND rel_course.id_session = ".$a_session['id']."
- ORDER BY title ASC
- ";
-
- $resultCourse = api_sql_query($sqlCourse);
- $totalResult = 0;
- $totalWeighting = 0;
- while($a_course = mysql_fetch_array($resultCourse))
- {
- $sqlMoyTest = " SELECT exe_result,exe_weighting
- FROM $tbl_track_exercice
- WHERE exe_cours_id = '".$a_course['code']."'
- ";
- $resultMoyTest = api_sql_query($sqlMoyTest);
- $result = 0;
- $weighting = 0;
- while($a_moyTest = mysql_fetch_array($resultMoyTest))
- {
- $result = $result + $a_moyTest['exe_result'];
- $weighting = $weighting + $a_moyTest['exe_weighting'];
- }
- $totalResult = $totalResult + $result;
- $totalWeighting = $totalWeighting + $weighting;
- }
- $moyenneTest = round(($totalResult*100) / $totalWeighting);
-
-
- echo '<tr>
- <td>
- '.$a_session['name'].'
- </td>
- <td align="center">
- '.$moyenneTest.'%
- </td>
- <td>
-
- </td>
- </tr>
- ';
-
- }
- echo '</table>';
- }
- else
- {
- echo get_lang('NoSession');
- }
- }
- else
- {
- $sqlCourse = " SELECT title,code
- FROM $tbl_course as course
- ORDER BY title ASC
- ";
-
- $resultCourse = api_sql_query($sqlCourse);
-
- echo "<a href='".$_SERVER['PHP_SELF']."?session=true'>".get_lang('MoySession')."</a>";
- echo "<br /><br />";
- if(mysql_num_rows($resultCourse)>0)
- {
- echo '<table class="data_table">
- <tr>
- <th>
- '.get_lang('Course').'
- </th>
- <th>
- '.get_lang('MoyenneTest').'
- </th>
- <th>
- '.get_lang('MoyenneExamen').'
- </th>
- </tr>
- ';
- while($a_course= mysql_fetch_array($resultCourse))
- {
- $sqlMoyTest = " SELECT exe_result,exe_weighting
- FROM $tbl_track_exercice
- WHERE exe_cours_id = '".$a_course['code']."'
- ";
- $resultMoyTest = api_sql_query($sqlMoyTest);
- $result = 0;
- $weighting = 0;
- while($a_moyTest = mysql_fetch_array($resultMoyTest))
- {
- $result = $result + $a_moyTest['exe_result'];
- $weighting = $weighting + $a_moyTest['exe_weighting'];
- }
- $moyenneTest = round(($result*100)/$weighting);
- echo '<tr>
- <td>
- '.$a_course['title'].'
- </td>
- <td align="center">
- '.$moyenneTest.'%
- </td>
- <td>
-
- </td>
- </tr>
- ';
- }
- echo '</table>';
- }
- else
- {
- echo get_lang('NoCourse');
- }
- }
- /*
- ==============================================================================
- FOOTER
- ==============================================================================
- */
-
- Display :: display_footer();
- ?>
|