@ -67,8 +67,8 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
} else {
$limit = 20;
$from = $page * $limit;
$limit=20;
$from=$page * $limit;
//if user is crfp admin only list its sessions
if(!api_is_platform_admin()) {
@ -85,11 +85,11 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
$and=" AND id_coach=user_id";
}
if (isset($_REQUEST['active']) & & !isset($_REQUEST['inactive']) ){
if(isset($_REQUEST['active']) & & !isset($_REQUEST['inactive']) ){
$and .= ' AND ( (session.date_start < = CURDATE() AND session.date_end >= CURDATE()) OR session.date_start="0000-00-00" ) ';
$cond_url = '& active='.Security::remove_XSS($_REQUEST['active']);
}
if (!isset($_REQUEST['active']) & & isset($_REQUEST['inactive']) ){
if(!isset($_REQUEST['active']) & & isset($_REQUEST['inactive']) ){
$and .= ' AND ( (session.date_start > CURDATE() OR session.date_end < CURDATE ( ) ) AND session . date_start < > "0000-00-00" ) ';
$cond_url = '& inactive='.Security::remove_XSS($_REQUEST['inactive']);
}
@ -136,9 +136,9 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
$recorset = Database::fetch_array($result_rows);
$num = $recorset['total_rows'];
$result = api_sql_query($query,__FILE__,__LINE__);
$Sessions = api_store_result($result);
$nbr_results = sizeof($Sessions);
$result=api_sql_query($query,__FILE__,__LINE__);
$Sessions=api_store_result($result);
$nbr_results=sizeof($Sessions);
$tool_name = get_lang('SessionList');
Display::display_header($tool_name);
//api_display_tool_title($tool_name);
@ -149,13 +149,13 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
if(isset($_GET['action'])) {
Display::display_normal_message(stripslashes($_GET['message']),false);
}
?>
?>
< div class = "actions" >
<?php
echo '< div style = "float:right;" >
< a href = "'.api_get_path(WEB_CODE_PATH).'admin/session_add.php" > '.Display::return_icon('view_more_stats.gif',get_lang('AddSession')).get_lang('AddSession').'< / a >
< / div > ';
< / div > ';
?>
< form method = "POST" action = "session_list.php" >
< input type = "text" name = "keyword" value = " <?php echo Security :: remove_XSS ( $_GET [ 'keyword' ]); ?> " />
@ -171,8 +171,8 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
echo get_lang('NoSearchResults');
echo ' < / div > ';
} else {
if ($num > $limit) {
if ($page) {
if($num>$limit){
if($page) {
?>
< a href = " <?php echo api_get_self (); ?> ?page= <?php echo $page - 1 ; ?> &sort= <?php echo $sort ; ?> &keyword= <?php echo $_REQUEST [ 'keyword' ]; ?><?php echo @ $cond_url ; ?> " > <?php echo get_lang ( 'Previous' ); ?> </ a >
<?php
@ -220,11 +220,11 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
< tr class = " <?php echo $i ? 'row_odd' : 'row_even' ; ?> " >
< td >< input type = "checkbox" id = "idChecked_ <?php echo $x ; ?> " name = "idChecked[]" value = " <?php echo $enreg [ 'id' ]; ?> " ></ td >
< td >< a href = "resume_session.php?id_session= <?php echo $enreg [ 'id' ]; ?> " > <?php echo api_htmlentities ( $enreg [ 'name' ], ENT_QUOTES , $charset ); ?> </ a ></ td >
< td >< a href = "session_course_list.php?id_session= <?php echo $enreg [ 'id' ]; ?> " > <?php echo $nb_courses ; ?> cours</ a ></ td >
< td > <?php echo api_htmlentities ( $enreg [ 'date_start' ], ENT_QUOTES , $charset ); ?> </ td >
< td > <?php echo api_htmlentities ( $enreg [ 'date_end' ], ENT_QUOTES , $charset ); ?> </ td >
< td > <?php echo api_htmlentities ( $enreg [ 'firstname' ], ENT_QUOTES , $charset ) . ' ' . api_htmlentities ( $enreg [ 'lastname' ], ENT_QUOTES , $charset ); ?> </ td >
< td >< a href = "resume_session.php?id_session= <?php echo $enreg [ 'id' ]; ?> " > <?php echo api_htmlentities ( $enreg [ 'name' ], ENT_QUOTES , $charset ); ?> </ a ></ td >
< td >< a href = "session_course_list.php?id_session= <?php echo $enreg [ 'id' ]; ?> " > <?php echo $nb_courses ; ?> cours</ a ></ td >
< td > <?php echo api_htmlentities ( $enreg [ 'date_start' ], ENT_QUOTES , $charset ); ?> </ td >
< td > <?php echo api_htmlentities ( $enreg [ 'date_end' ], ENT_QUOTES , $charset ); ?> </ td >
< td > <?php echo api_htmlentities ( api_get_person_name ( $enreg [ 'firstname' ], $enreg [ 'lastname' ]) , ENT_QUOTES , $charset ); ?> </ td >
< td >
< a href = "add_users_to_session.php?page=session_list.php&id_session= <?php echo $enreg [ 'id' ]; ?> " > <?php Display :: display_icon ( 'add_user_big.gif' , get_lang ( 'SubscribeUsersToSession' )); ?> </ a >
< a href = "add_courses_to_session.php?page=session_list.php&id_session= <?php echo $enreg [ 'id' ]; ?> " > <?php Display :: display_icon ( 'synthese_view.gif' , get_lang ( 'SubscribeCoursesToSession' )); ?> </ a >
@ -250,8 +250,8 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
<?php
if ($num > $limit) {
if ($page)
if($num>$limit) {
if($page)
{
?>