Fixing PHP warning/notices

skala
Julio Montoya 14 years ago
parent f47cedb0c6
commit cac0b163f2
  1. 6
      main/admin/course_add.php
  2. 2
      main/admin/resume_session.php
  3. 20
      main/admin/session_add.php
  4. 30
      main/admin/session_edit.php
  5. 3
      main/course_info/infocours.php
  6. 5
      main/css/base.css

@ -67,13 +67,13 @@ $form->applyFilter('visual_code', 'api_strtoupper');
$form->applyFilter('visual_code', 'html_filter');
$form->addRule('visual_code', get_lang('Max'), 'maxlength', $maxlength);
$form->addElement('select', 'tutor_id', get_lang('CourseTitular'), $teachers, array('style' => 'width:350px'));
$form->addElement('select', 'tutor_id', get_lang('CourseTitular'), $teachers, array('style' => 'width:350px', 'class'=>'chzn-select', 'id'=>'tutor_id'));
$form->applyFilter('tutor_id', 'html_filter');
$form->addElement('select', 'course_teachers', get_lang('CourseTeachers'), $teachers, 'style="width:350px" multiple=multiple size=5');
$form->addElement('select', 'course_teachers', get_lang('CourseTeachers'), $teachers, ' id="course_teachers" style="width:350px" multiple="multiple" size="5"');
$form->applyFilter('course_teachers', 'html_filter');
$categories_select = $form->addElement('select', 'category_code', get_lang('CourseFaculty'), $categories, array('style' => 'width:350px'));
$categories_select = $form->addElement('select', 'category_code', get_lang('CourseFaculty'), $categories, array('style' => 'width:350px', 'class'=>'chzn-select', 'id'=>'category_code'));
$form->applyFilter('category_code', 'html_filter');
//This function fills the category_code select ...
CourseManager::select_and_sort_categories($categories_select);

@ -173,7 +173,7 @@ require_once api_get_path(LIBRARY_PATH).'urlmanager.lib.php';
if (api_get_multiple_access_url()) {
echo '<tr><td>';
echo get_lang('URL');
echo 'URL';
echo '</td>';
echo '<td>';
$url_list = UrlManager::get_access_url_from_session($id_session);

@ -178,24 +178,26 @@ $count_users = Database::result($rs, 0, 0);
if (intval($count_users)<50) {
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
$sql="SELECT user_id,lastname,firstname,username FROM $tbl_user WHERE status='1'".$order_clause;
$sql="SELECT user_id, lastname,firstname,username FROM $tbl_user WHERE status='1'".$order_clause;
global $_configuration;
if ($_configuration['multiple_access_urls']) {
$tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1){
$sql = 'SELECT username, lastname, firstname FROM '.$tbl_user.' user
$sql = 'SELECT user.user_id, username, lastname, firstname FROM '.$tbl_user.' user
INNER JOIN '.$tbl_user_rel_access_url.' url_user ON (url_user.user_id=user.user_id)
WHERE access_url_id = '.$access_url_id.' AND status=1'.$order_clause;
}
}
$result=Database::query($sql);
$Coaches=Database::store_result($result);
$result = Database::query($sql);
$Coaches = Database::store_result($result);
?>
<select id="coach_username" class="chzn-select" name="coach_username" value="true" style="width:350px;">
<select id="coach_username" class="chzn-select" name="coach_username" style="width:350px;" title="<?php echo get_lang('Select'); ?>" >
<option value="0"><?php get_lang('None'); ?></option>
<?php foreach($Coaches as $enreg): ?>
<option value="<?php echo $enreg['username']; ?>" <?php if($sent && $enreg['user_id'] == $id_coach) echo 'selected="selected"'; ?>><?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']).' ('.$enreg['username'].')'; ?></option>
<option value="<?php echo $enreg['username']; ?>"> <?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']).' ('.$enreg['username'].')'; ?></option>
<?php endforeach; ?>
</select>
<?php
@ -212,7 +214,7 @@ $Categories = SessionManager::get_all_session_category();
<tr>
<td width="40%"><?php echo get_lang('SessionCategory') ?></td>
<td width="60%">
<select id="session_category" class="chzn-select" name="session_category" value="true" style="width:350px;">
<select id="session_category" class="chzn-select" name="session_category" style="width:350px;" title="<?php echo get_lang('Select'); ?>">
<option value="0"><?php get_lang('None'); ?></option>
<?php
if (!empty($Categories)) {
@ -244,7 +246,7 @@ $Categories = SessionManager::get_all_session_category();
<td width="40%"></td>
<td width="60%">
<input id="start_limit" type="checkbox" name="start_limit" onchange="disable_starttime(this)" <?php if ($year_start=="0000") echo "checked"; ?>/>
<input id="start_limit" type="checkbox" name="start_limit" onchange="disable_starttime(this)" />
<label for="start_limit">
<?php echo get_lang('DateStartSession');?>
</label>
@ -316,7 +318,7 @@ for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) {
<tr>
<td width="40%">&nbsp;&nbsp;</td>
<td width="60%">
<input id="end_limit" type="checkbox" name="end_limit" onchange="disable_endtime(this)" <?php if ($year_end=="0000") echo "checked"; ?>/>
<input id="end_limit" type="checkbox" name="end_limit" onchange="disable_endtime(this)" />
<label for="end_limit">
<?php echo get_lang('DateEndSession') ?>
</label>

@ -3,7 +3,7 @@
// name of the language file that needs to be included
$language_file ='admin';
$cidReset=true;
$cidReset = true;
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'sessionmanager.lib.php';
@ -23,11 +23,13 @@ $tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$sql = "SELECT name,date_start,date_end,id_coach, session_admin_id, nb_days_access_before_beginning, nb_days_access_after_end, session_category_id, visibility FROM $tbl_session WHERE id = $id";
$result = Database::query($sql);
if (!$infos=Database::fetch_array($result)) {
if (!$infos = Database::fetch_array($result)) {
header('Location: session_list.php');
exit();
}
$id_coach = $infos['id_coach'];
if (!api_is_platform_admin() && $infos['session_admin_id'] != api_get_user_id()) {
api_not_allowed(true);
}
@ -115,23 +117,23 @@ if (!empty($return)) {
</tr>
<tr>
<td width="30%"><?php echo get_lang('CoachName') ?>&nbsp;&nbsp;</td>
<td width="70%"><select class="chzn-select" name="id_coach" style="width:380px;">
<option value="">----- <?php echo get_lang('Choose') ?> -----</option>
<?php
foreach($Coaches as $enreg) {
?>
<option value="<?php echo $enreg['user_id']; ?>" <?php if((!$sent && $enreg['user_id'] == $infos['id_coach']) || ($sent && $enreg['user_id'] == $id_coach)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']).' ('.$enreg['username'].')'; ?></option>
<?php
}
unset($Coaches);
$Categories = SessionManager::get_all_session_category();
<td width="70%">
<select class="chzn-select" name="id_coach" style="width:380px;" title="<?php echo get_lang('Choose'); ?>" >
<option value="">----- <?php echo get_lang('None') ?> -----</option>
<?php foreach($Coaches as $enreg) { ?>
<option value="<?php echo $enreg['user_id']; ?>" <?php if(($enreg['user_id'] == $infos['id_coach']) || ($enreg['user_id'] == $id_coach)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']).' ('.$enreg['username'].')'; ?></option>
<?php
}
unset($Coaches);
$Categories = SessionManager::get_all_session_category();
?>
</select></td>
</select>
</td>
</tr>
<tr>
<td width="30%"><?php echo get_lang('SessionCategory') ?></td>
<td width="70%">
<select class="chzn-select" id="session_category" name="session_category" style="width:380px;">
<select class="chzn-select" id="session_category" name="session_category" style="width:380px;" title="<?php echo get_lang('Select'); ?>">
<option value="0"><?php get_lang('None'); ?></option>
<?php
if (!empty($Categories)) {

@ -456,7 +456,8 @@ echo '</div>';
*/
echo '<script>
$(function() {
$( "#course_settings" ).accordion({
$("#course_settings").accordion({
autoHeight: false,
header: "div> h3",
});
});

@ -2265,3 +2265,8 @@ div.admin_section h4 {
padding:5px;
width: 380px;
}
#course_settings h3 img {
margin-left: 25px;
}
Loading…
Cancel
Save