main/inc/lib/legal.lib.php 1 location
|
@@ 216-227 (lines=12) @@
|
| 213 |
|
* Gets the number of terms and conditions available |
| 214 |
|
* @return int |
| 215 |
|
*/ |
| 216 |
|
public static function count() |
| 217 |
|
{ |
| 218 |
|
$legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); |
| 219 |
|
$sql = "SELECT count(*) as count_result |
| 220 |
|
FROM $legal_conditions_table |
| 221 |
|
ORDER BY legal_id DESC "; |
| 222 |
|
$result = Database::query($sql); |
| 223 |
|
$url = Database::fetch_array($result,'ASSOC'); |
| 224 |
|
$result = $url['count_result']; |
| 225 |
|
|
| 226 |
|
return $result; |
| 227 |
|
} |
| 228 |
|
|
| 229 |
|
/** |
| 230 |
|
* Get type of terms and conditions |
main/inc/lib/statsUtils.lib.inc.php 1 location
|
@@ 32-42 (lines=11) @@
|
| 29 |
|
* @param sql : a sql query (as a string) |
| 30 |
|
* @desc Return many results of a query in a 1 column tab |
| 31 |
|
*/ |
| 32 |
|
public static function getManyResults1Col($sql) |
| 33 |
|
{ |
| 34 |
|
$res = Database::query($sql); |
| 35 |
|
if ($res !== false) { |
| 36 |
|
$i = 0; |
| 37 |
|
while ($resA = Database::fetch_array($res, 'NUM')) { |
| 38 |
|
$resu[$i++] = $resA[0]; |
| 39 |
|
} |
| 40 |
|
} |
| 41 |
|
return $resu; |
| 42 |
|
} |
| 43 |
|
|
| 44 |
|
/** |
| 45 |
|
* @author Sebastien Piraux <[email protected]> |
main/inc/lib/urlmanager.lib.php 1 location
|
@@ 140-149 (lines=10) @@
|
| 137 |
|
* @author Julio Montoya |
| 138 |
|
* @return int count of urls |
| 139 |
|
* */ |
| 140 |
|
public static function url_count() |
| 141 |
|
{ |
| 142 |
|
$table_access_url= Database :: get_main_table(TABLE_MAIN_ACCESS_URL); |
| 143 |
|
$sql = "SELECT count(id) as count_result FROM $table_access_url"; |
| 144 |
|
$res = Database::query($sql); |
| 145 |
|
$url = Database::fetch_array($res,'ASSOC'); |
| 146 |
|
$result = $url['count_result']; |
| 147 |
|
|
| 148 |
|
return $result; |
| 149 |
|
} |
| 150 |
|
|
| 151 |
|
/** |
| 152 |
|
* Gets the id, url, description, and active status of ALL URLs |
main/exercice/TestCategory.php 1 location
|
@@ 780-789 (lines=10) @@
|
| 777 |
|
/** |
| 778 |
|
* @return array |
| 779 |
|
*/ |
| 780 |
|
function get_all_categories() |
| 781 |
|
{ |
| 782 |
|
$table = Database::get_course_table(TABLE_QUIZ_CATEGORY); |
| 783 |
|
$sql = "SELECT * FROM $table ORDER BY title ASC"; |
| 784 |
|
$res = Database::query($sql); |
| 785 |
|
while ($row = Database::fetch_array($res,'ASSOC')) { |
| 786 |
|
$array[] = $row; |
| 787 |
|
} |
| 788 |
|
return $array; |
| 789 |
|
} |
| 790 |
|
|
| 791 |
|
/** |
| 792 |
|
* @param Exercise $exercise |