Minor - format code.

1.9.x
Julio Montoya 11 years ago
parent bafcdef12d
commit dd231d77f5
  1. 7
      main/admin/resume_session.php
  2. 31
      main/admin/session_course_user_list.php
  3. 4
      main/admin/session_edit.php
  4. 5
      main/auth/gotocourse.php
  5. 5
      main/inc/lib/course.lib.php

@ -96,11 +96,12 @@ switch ($action) {
}
break;
case 'delete':
$idChecked = $_GET['idChecked'];
$idChecked = isset($_GET['idChecked']) ? $_GET['idChecked'] : null;
if (is_array($idChecked)) {
$my_temp = array();
foreach ($idChecked as $id){
$my_temp[]= Database::escape_string($id);// forcing the escape_string
foreach ($idChecked as $id) {
// forcing the escape_string
$my_temp[]= Database::escape_string($id);
}
$idChecked = $my_temp;

@ -1,11 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.admin
*/
/**
* Code
*/
$language_file = array('admin', 'registration');
$cidReset = true;
@ -26,22 +24,24 @@ if (empty($id_session )) {
}
$course_code = Database::escape_string(trim($_GET['course_code']));
$page = intval($_GET['page']);
$action = $_REQUEST['action'];
$page = isset($_GET['page']) ? intval($_GET['page']) : null;
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
$default_sort = api_sort_by_first_name() ? 'firstname':'lastname';
$sort = in_array($_GET['sort'], array('lastname','firstname','username')) ? $_GET['sort'] : $default_sort;
$idChecked = (is_array($_GET['idChecked']) ? $_GET['idChecked'] : (is_array($_POST['idChecked']) ? $_POST['idChecked'] : null));
$sort = isset($_GET['sort']) && in_array($_GET['sort'], array('lastname','firstname','username')) ? $_GET['sort'] : $default_sort;
$idChecked = isset($_GET['idChecked']) && is_array($_GET['idChecked']) ? $_GET['idChecked'] : (isset($_POST['idChecked']) && is_array($_POST['idChecked']) ? $_POST['idChecked'] : null);
$direction = isset($_GET['direction']) && in_array($_GET['direction'], array('desc','asc')) ? $_GET['direction'] : 'desc';
if (is_array($idChecked)) {
$my_temp = array();
foreach ($idChecked as $id) {
$my_temp[]= intval($id);// forcing the intval
// forcing the intval
$my_temp[]= intval($id);
}
$idChecked = $my_temp;
}
$sql = "SELECT s.name, c.title FROM $tbl_session_rel_course src
$sql = "SELECT s.name, c.title
FROM $tbl_session_rel_course src
INNER JOIN $tbl_session s ON s.id = src.id_session
INNER JOIN $tbl_course c ON c.code = src.course_code
WHERE src.id_session='$id_session' AND src.course_code='".Database::escape_string($course_code)."' ";
@ -52,7 +52,7 @@ if (!list($session_name,$course_title) = Database::fetch_row($result)) {
exit();
}
switch($action) {
switch ($action) {
case 'delete':
if (is_array($idChecked) && count($idChecked)>0) {
array_map('intval', $idChecked);
@ -77,17 +77,6 @@ switch($action) {
$limit = 20;
$from = $page * $limit;
$is_western_name_order = api_is_western_name_order();
//scru.status<>2 scru.course_code='".$course_code."'
/*$sql = "SELECT DISTINCT
u.user_id,".($is_western_name_order ? 'u.firstname, u.lastname' : 'u.lastname, u.firstname').", u.username, scru.id_user as is_subscribed
FROM $tbl_session_rel_user s
INNER JOIN $tbl_user u ON (u.user_id=s.id_user)
LEFT JOIN $tbl_session_rel_course_rel_user scru ON (u.user_id=scru.id_user AND scru.course_code = '".$course_code."' )
WHERE s.id_session='$id_session'
ORDER BY $sort $direction
LIMIT $from,".($limit+1);*/
$sql = "SELECT DISTINCT
u.user_id,".($is_western_name_order ? 'u.firstname, u.lastname' : 'u.lastname, u.firstname').", u.username, scru.id_user as is_subscribed
FROM $tbl_session_rel_user s

@ -34,8 +34,8 @@ $interbreadcrumb[] = array('url' => 'index.php',"name" => get_lang('PlatformAdmi
$interbreadcrumb[] = array('url' => "session_list.php","name" => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id,"name" => get_lang('SessionOverview'));
list($year_start,$month_start,$day_start) = explode('-', $infos['date_start']);
list($year_end,$month_end,$day_end) = explode('-', $infos['date_end']);
list($year_start, $month_start, $day_start) = explode('-', $infos['date_start']);
list($year_end, $month_end, $day_end) = explode('-', $infos['date_end']);
// Default value
$showDescriptionChecked = 'checked';

@ -9,10 +9,9 @@
*
*/
require('../inc/global.inc.php');
require '../inc/global.inc.php';
require_once(api_get_path(SYS_PATH).'main/auth/cas/authcas.php');
$msg = null;
if (isset($_GET['firstpage'])) {
$firstpage = $_GET['firstpage'];

@ -36,8 +36,9 @@ class CourseManager
/**
* Creates a course
* @param array with the columns in the main.course table
* @return mixed false if the course was not created, array with the course info
* @param array $params columns in the main.course table
*
* @return mixed false if the course was not created, array with the course info
*/
public static function create_course($params)
{

Loading…
Cancel
Save