|
|
|
|
@ -417,7 +417,7 @@ function parse_xml_data($file) { |
|
|
|
|
$rs_exist=Database::query($sql_exist,__FILE__,__LINE__); |
|
|
|
|
$row=Database::fetch_array($rs_exist); |
|
|
|
|
if ($row['count']==0) { |
|
|
|
|
$sql='INSERT INTO '.$table_certificate.' (cat_id,user_id,score_certificate,date_certificate) |
|
|
|
|
$sql='INSERT INTO '.$table_certificate.' (cat_id,user_id,score_certificate,created_at) |
|
|
|
|
VALUES("'.intval($cat_id).'","'.intval($user_id).'","'.Database::escape_string($score_certificate).'","'.Database::escape_string($date_certificate).'")'; |
|
|
|
|
$rs=Database::query($sql,__FILE__,__LINE__); |
|
|
|
|
} |
|
|
|
|
@ -431,10 +431,10 @@ function parse_xml_data($file) { |
|
|
|
|
*/ |
|
|
|
|
function get_certificate_date_by_user_id ($cat_id,$user_id) { |
|
|
|
|
$table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE); |
|
|
|
|
$sql_get_date='SELECT date_certificate FROM '.$table_certificate.' WHERE cat_id="'.intval($cat_id).'" AND user_id="'.intval($user_id).'"'; |
|
|
|
|
$sql_get_date='SELECT created_at FROM '.$table_certificate.' WHERE cat_id="'.intval($cat_id).'" AND user_id="'.intval($user_id).'"'; |
|
|
|
|
$rs_get_date=Database::query($sql_get_date,__FILE__,__LINE__); |
|
|
|
|
$row_get_date=Database::fetch_array($rs_get_date,'ASSOC'); |
|
|
|
|
return $row_get_date['date_certificate']; |
|
|
|
|
return $row_get_date['created_at']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -450,7 +450,7 @@ function parse_xml_data($file) { |
|
|
|
|
if (!is_null($cat_id) && $cat_id>0) { |
|
|
|
|
$sql.=' WHERE cat_id='.Database::escape_string($cat_id); |
|
|
|
|
} |
|
|
|
|
$sql.=' ORDER BY u.firstname'; |
|
|
|
|
$sql.=' ORDER BY u.firstname'; |
|
|
|
|
$rs=Database::query($sql,__FILE__,__LINE__); |
|
|
|
|
$list_users=array(); |
|
|
|
|
while ($row=Database::fetch_array($rs)) { |
|
|
|
|
@ -467,11 +467,12 @@ function parse_xml_data($file) { |
|
|
|
|
*/ |
|
|
|
|
function get_list_gradebook_certificates_by_user_id ($user_id,$cat_id=null) { |
|
|
|
|
$table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE); |
|
|
|
|
$sql='SELECT gc.score_certificate,gc.date_certificate,gc.path_certificate,gc.cat_id,gc.user_id FROM '.$table_certificate.' gc |
|
|
|
|
$sql='SELECT gc.score_certificate,gc.created_at,gc.path_certificate,gc.cat_id,gc.user_id FROM '.$table_certificate.' gc |
|
|
|
|
WHERE gc.user_id="'.Database::escape_string($user_id).'" '; |
|
|
|
|
if (!is_null($cat_id) && $cat_id>0) { |
|
|
|
|
$sql.=' AND cat_id='.Database::escape_string($cat_id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$rs = Database::query($sql,__FILE__,__LINE__); |
|
|
|
|
$list_certificate=array(); |
|
|
|
|
while ($row=Database::fetch_array($rs)) { |
|
|
|
|
|