Browse Source

Minor style corrections + adding database::escape_string

Julio Montoya 13 years ago
parent
commit
e389dc86e4
2 changed files with 17 additions and 11 deletions
  1. 14 8
      main/admin/course_export.php
  2. 3 3
      main/admin/user_export.php

+ 14 - 8
main/admin/course_export.php

@@ -66,7 +66,7 @@ if ($_POST['formSent']) {
 			fputs($fp, $add);
 		}
 		fclose($fp);
-		$msg = get_lang('CoursesListHasBeenExported').'<br/><a href="'.$archiveURL.$archiveFile.'">'.get_lang('ClickHereToDownloadTheFile').'</a>';
+		$msg = get_lang('CoursesListHasBeenExported').'<br/><a class="btn" href="'.$archiveURL.$archiveFile.'">'.get_lang('ClickHereToDownloadTheFile').'</a>';
 	} else {
 		$msg = get_lang('ThereAreNotSelectedCoursesOrCoursesListIsEmpty');
 	}
@@ -82,14 +82,20 @@ if (!empty($msg)) {
     <input type="hidden" name="formSent" value="1">
     <legend><?php echo $tool_name; ?></legend>    
 <?php if (!empty($course_list)) { ?>
-<div>
-<input id="all-courses" class="checkbox" type="radio" value="1" name="select_type" <?php if(!$formSent || ($formSent && $select_type == 1)) echo 'checked="checked"'; ?> onclick="javascript: if(this.checked){document.getElementById('div-course-list').style.display='none';}"/>
-<label for="all-courses"><?php echo get_lang('ExportAllCoursesList')?></label>
-<br/>
-<input id="select-courses" class="checkbox" type="radio" value="2" name="select_type" <?php if($formSent && $select_type == 2) echo 'checked="checked"'; ?> onclick="javascript: if(this.checked){document.getElementById('div-course-list').style.display='block';}"/>
-<label for="select-courses"><?php echo get_lang('ExportSelectedCoursesFromCoursesList')?></label>
+<div class="control-group">    
+    
+    <div class="controls">
+        <label class="radio" for="all-courses">            
+        <input id="all-courses" class="checkbox" type="radio" value="1" name="select_type" <?php if(!$formSent || ($formSent && $select_type == 1)) echo 'checked="checked"'; ?> onclick="javascript: if(this.checked){document.getElementById('div-course-list').style.display='none';}"/>
+            <?php echo get_lang('ExportAllCoursesList')?>
+        </label>        
+        
+        <label class="radio" for="select-courses">
+            <input id="select-courses" class="checkbox" type="radio" value="2" name="select_type" <?php if($formSent && $select_type == 2) echo 'checked="checked"'; ?> onclick="javascript: if(this.checked){document.getElementById('div-course-list').style.display='block';}"/>
+            <?php echo get_lang('ExportSelectedCoursesFromCoursesList')?>
+        </label>        
+    </div>
 </div>
-<br />
 <div id="div-course-list" style="<?php echo (!$formSent || ($formSent && $select_type == 1))?'display:none':'display:block';?>">
 <table border="0" cellpadding="5" cellspacing="0">
 <tr>

+ 3 - 3
main/admin/user_export.php

@@ -53,18 +53,18 @@ $form = new FormValidator('export_users');
 $form->addElement('header', '', $tool_name);
 $form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'XML','xml');
 $form->addElement('radio', 'file_type', null, 'CSV','csv');
+
 $form->addElement('checkbox', 'addcsvheader', get_lang('AddCSVHeader'), get_lang('YesAddCSVHeader'),'1');
 $form->addElement('select', 'course_code', get_lang('OnlyUsersFromCourse'), $courses);
 $form->addElement('style_submit_button', 'submit',get_lang('Export'),'class="save"');
 $form->setDefaults(array('file_type'=>'csv'));
 
-if ($form->validate())
-{
+if ($form->validate()) {
 	global $_configuration;
 
 	$export = $form->exportValues();
 	$file_type = $export['file_type'];
-	$course_code = $export['course_code'];
+	$course_code = Database::escape_string($export['course_code']);
 
 	$sql = "SELECT  u.user_id 	AS UserId,
 					u.lastname 	AS LastName,