|
|
|
|
@ -45,10 +45,10 @@ if (empty($_GET['export_all'])) { |
|
|
|
|
} else { |
|
|
|
|
$certificateTable = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE); |
|
|
|
|
$categoryTable = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY); |
|
|
|
|
$sql = "SELECT cer.user_id AS user_id |
|
|
|
|
FROM $certificateTable cer |
|
|
|
|
INNER JOIN $categoryTable cat |
|
|
|
|
ON (cer.cat_id = cat.id) |
|
|
|
|
$sql = "SELECT cer.user_id AS user_id |
|
|
|
|
FROM $certificateTable cer |
|
|
|
|
INNER JOIN $categoryTable cat |
|
|
|
|
ON (cer.cat_id = cat.id) |
|
|
|
|
WHERE cat.course_code = '$courseCode' AND cat.session_id = $sessionId"; |
|
|
|
|
$rs = Database::query($sql); |
|
|
|
|
while ($row = Database::fetch_assoc($rs)) { |
|
|
|
|
@ -102,13 +102,13 @@ if (empty($infoCertificate)) { |
|
|
|
|
$workSpace = intval(297 - $infoCertificate['margin_left'] - $infoCertificate['margin_right']); |
|
|
|
|
$widthCell = intval($workSpace / 6); |
|
|
|
|
$htmlText = ''; |
|
|
|
|
$htmlText .= ' |
|
|
|
|
<link rel="stylesheet" |
|
|
|
|
type="text/css" |
|
|
|
|
$htmlText .= ' |
|
|
|
|
<link rel="stylesheet" |
|
|
|
|
type="text/css" |
|
|
|
|
href="'.api_get_path(WEB_PLUGIN_PATH).'customcertificate/resources/css/certificate.css">'; |
|
|
|
|
$htmlText .= ' |
|
|
|
|
<link rel="stylesheet" |
|
|
|
|
type="text/css" |
|
|
|
|
$htmlText .= ' |
|
|
|
|
<link rel="stylesheet" |
|
|
|
|
type="text/css" |
|
|
|
|
href="'.api_get_path(WEB_CSS_PATH).'editor.css">'; |
|
|
|
|
$htmlText .= '<body>'; |
|
|
|
|
foreach ($userList as $userInfo) { |
|
|
|
|
@ -118,46 +118,46 @@ foreach ($userList as $userInfo) { |
|
|
|
|
$htmlText .= '<div class="caraA" style="padding:0; page-break-before:always;" margin:0; padding:0;>'; |
|
|
|
|
} else { |
|
|
|
|
$urlBackground = $path.$infoCertificate['background']; |
|
|
|
|
$htmlText .= ' |
|
|
|
|
<div class="caraA" |
|
|
|
|
style="background-image:url('.$urlBackground.') no-repeat; background-image-resize:6;" |
|
|
|
|
margin:0; |
|
|
|
|
$htmlText .= ' |
|
|
|
|
<div class="caraA" |
|
|
|
|
style="background-image:url('.$urlBackground.') no-repeat; background-image-resize:6;" |
|
|
|
|
margin:0; |
|
|
|
|
padding:0;>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!empty($infoCertificate['logo_left'])) { |
|
|
|
|
$logoLeft = ' |
|
|
|
|
<img |
|
|
|
|
style="max-height: 150px; max-width: '.(2 * $widthCell).'mm;" |
|
|
|
|
$logoLeft = ' |
|
|
|
|
<img |
|
|
|
|
style="max-height: 150px; max-width: '.(2 * $widthCell).'mm;" |
|
|
|
|
src="'.$path.$infoCertificate['logo_left'].'" />'; |
|
|
|
|
} else { |
|
|
|
|
$logoLeft = ''; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!empty($infoCertificate['logo_center'])) { |
|
|
|
|
$logoCenter = ' |
|
|
|
|
<img |
|
|
|
|
style="max-height: 150px; max-width: '.intval($workSpace - (2 * $widthCell)).'mm;" |
|
|
|
|
$logoCenter = ' |
|
|
|
|
<img |
|
|
|
|
style="max-height: 150px; max-width: '.intval($workSpace - (2 * $widthCell)).'mm;" |
|
|
|
|
src="'.$path.$infoCertificate['logo_center'].'" />'; |
|
|
|
|
} else { |
|
|
|
|
$logoCenter = ''; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!empty($infoCertificate['logo_right'])) { |
|
|
|
|
$logoRight = ' |
|
|
|
|
<img |
|
|
|
|
style="max-height: 150px; max-width: '.(2 * $widthCell).'mm;" |
|
|
|
|
$logoRight = ' |
|
|
|
|
<img |
|
|
|
|
style="max-height: 150px; max-width: '.(2 * $widthCell).'mm;" |
|
|
|
|
src="'.$path.$infoCertificate['logo_right'].'" />'; |
|
|
|
|
} else { |
|
|
|
|
$logoRight = ''; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$htmlText .= '<table |
|
|
|
|
width="'.$workSpace.'mm" |
|
|
|
|
style=" |
|
|
|
|
margin-left:'.$infoCertificate['margin_left'].'mm; |
|
|
|
|
margin-right:'.$infoCertificate['margin_right'].'mm; |
|
|
|
|
" |
|
|
|
|
$htmlText .= '<table |
|
|
|
|
width="'.$workSpace.'mm" |
|
|
|
|
style=" |
|
|
|
|
margin-left:'.$infoCertificate['margin_left'].'mm; |
|
|
|
|
margin-right:'.$infoCertificate['margin_right'].'mm; |
|
|
|
|
" |
|
|
|
|
border="0">'; |
|
|
|
|
$htmlText .= '<tr>'; |
|
|
|
|
$htmlText .= '<td colspan="4" class="logo">'.$logoLeft.'</td>'; |
|
|
|
|
@ -266,48 +266,48 @@ foreach ($userList as $userInfo) { |
|
|
|
|
$htmlText .= '<tr>'; |
|
|
|
|
$htmlText .= '<td colspan="2" class="seals" style="width:'.$widthCell.'mm">'. |
|
|
|
|
((!empty($infoCertificate['signature_text1'])) ? $infoCertificate['signature_text1'] : ''). |
|
|
|
|
'</td> |
|
|
|
|
'</td> |
|
|
|
|
<td colspan="2" class="seals" style="width:'.$widthCell.'mm">'. |
|
|
|
|
((!empty($infoCertificate['signature_text2'])) ? $infoCertificate['signature_text2'] : ''). |
|
|
|
|
'</td> |
|
|
|
|
'</td> |
|
|
|
|
<td colspan="2" class="seals" style="width:'.$widthCell.'mm">'. |
|
|
|
|
((!empty($infoCertificate['signature_text3'])) ? $infoCertificate['signature_text3'] : ''). |
|
|
|
|
'</td> |
|
|
|
|
'</td> |
|
|
|
|
<td colspan="2" class="seals" style="width:'.$widthCell.'mm">'. |
|
|
|
|
((!empty($infoCertificate['signature_text4'])) ? $infoCertificate['signature_text4'] : ''). |
|
|
|
|
'</td> |
|
|
|
|
<td colspan="4" class="seals" style="width:'.(2 * $widthCell).'mm"> |
|
|
|
|
'</td> |
|
|
|
|
<td colspan="4" class="seals" style="width:'.(2 * $widthCell).'mm"> |
|
|
|
|
'.((!empty($infoCertificate['seal'])) ? $plugin->get_lang('Seal') : ''). |
|
|
|
|
'</td>'; |
|
|
|
|
$htmlText .= '</tr>'; |
|
|
|
|
$htmlText .= '<tr>'; |
|
|
|
|
$htmlText .= '<td colspan="2" class="logo-seals" style="width:'.$widthCell.'mm">'. |
|
|
|
|
((!empty($infoCertificate['signature1'])) |
|
|
|
|
? '<img style="max-height: 100px; max-width: '.$widthCell.'mm;" |
|
|
|
|
? '<img style="max-height: 100px; max-width: '.$widthCell.'mm;" |
|
|
|
|
src="'.$path.$infoCertificate['signature1'].'" />' |
|
|
|
|
: ''). |
|
|
|
|
'</td> |
|
|
|
|
'</td> |
|
|
|
|
<td colspan="2" class="logo-seals" style="width:'.$widthCell.'mm">'. |
|
|
|
|
((!empty($infoCertificate['signature2'])) |
|
|
|
|
? '<img style="max-height: 100px; '.$widthCell.'mm;" |
|
|
|
|
? '<img style="max-height: 100px; '.$widthCell.'mm;" |
|
|
|
|
src="'.$path.$infoCertificate['signature2'].'" />' |
|
|
|
|
: ''). |
|
|
|
|
'</td> |
|
|
|
|
'</td> |
|
|
|
|
<td colspan="2" class="logo-seals" style="width:'.$widthCell.'mm">'. |
|
|
|
|
((!empty($infoCertificate['signature3'])) |
|
|
|
|
? '<img style="max-height: 100px; '.$widthCell.'mm;" |
|
|
|
|
? '<img style="max-height: 100px; '.$widthCell.'mm;" |
|
|
|
|
src="'.$path.$infoCertificate['signature3'].'" />' |
|
|
|
|
: ''). |
|
|
|
|
'</td> |
|
|
|
|
'</td> |
|
|
|
|
<td colspan="2" class="logo-seals" style="width:'.$widthCell.'mm">'. |
|
|
|
|
((!empty($infoCertificate['signature4'])) |
|
|
|
|
? '<img style="max-height: 100px; '.$widthCell.'mm;" |
|
|
|
|
? '<img style="max-height: 100px; '.$widthCell.'mm;" |
|
|
|
|
src="'.$path.$infoCertificate['signature4'].'" />' |
|
|
|
|
: ''). |
|
|
|
|
'</td> |
|
|
|
|
'</td> |
|
|
|
|
<td colspan="4" class="logo-seals" style="width:'.(2 * $widthCell).'mm">'. |
|
|
|
|
((!empty($infoCertificate['seal'])) |
|
|
|
|
? '<img style="max-height: 100px; '.(2 * $widthCell).'mm;" |
|
|
|
|
? '<img style="max-height: 100px; '.(2 * $widthCell).'mm;" |
|
|
|
|
src="'.$path.$infoCertificate['seal'].'" />' |
|
|
|
|
: ''). |
|
|
|
|
'</td>'; |
|
|
|
|
@ -359,11 +359,11 @@ foreach ($userList as $userInfo) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$sql = "SELECT 1 |
|
|
|
|
FROM $tblProperty |
|
|
|
|
WHERE tool = 'learnpath_category' |
|
|
|
|
AND ref = $categoryId |
|
|
|
|
AND visibility = 0 |
|
|
|
|
$sql = "SELECT 1 |
|
|
|
|
FROM $tblProperty |
|
|
|
|
WHERE tool = 'learnpath_category' |
|
|
|
|
AND ref = $categoryId |
|
|
|
|
AND visibility = 0 |
|
|
|
|
AND (session_id = $sessionId OR session_id IS NULL)"; |
|
|
|
|
$res = Database::query($sql); |
|
|
|
|
if (Database::num_rows($res) > 0) { |
|
|
|
|
@ -393,10 +393,10 @@ foreach ($userList as $userInfo) { |
|
|
|
|
|
|
|
|
|
foreach ($flat_list as $learnpath) { |
|
|
|
|
$lpId = $learnpath['lp_old_id']; |
|
|
|
|
$sql = "SELECT 1 |
|
|
|
|
FROM $tblProperty |
|
|
|
|
WHERE tool = 'learnpath' |
|
|
|
|
AND ref = $lpId AND visibility = 0 |
|
|
|
|
$sql = "SELECT 1 |
|
|
|
|
FROM $tblProperty |
|
|
|
|
WHERE tool = 'learnpath' |
|
|
|
|
AND ref = $lpId AND visibility = 0 |
|
|
|
|
AND (session_id = $sessionId OR session_id IS NULL)"; |
|
|
|
|
$res = Database::query($sql); |
|
|
|
|
if (Database::num_rows($res) > 0) { |
|
|
|
|
@ -464,11 +464,12 @@ function getIndexFiltered($index) |
|
|
|
|
$txt = strip_tags($index, "<b><strong><i>"); |
|
|
|
|
$txt = str_replace(chr(13).chr(10).chr(13).chr(10), chr(13).chr(10), $txt); |
|
|
|
|
$lines = explode(chr(13).chr(10), $txt); |
|
|
|
|
|
|
|
|
|
$text1 = ''; |
|
|
|
|
for ($x = 0; $x < 47; $x++) { |
|
|
|
|
$text1 .= $lines[$x].chr(13).chr(10); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$text2 = ''; |
|
|
|
|
for ($x = 47; $x < 94; $x++) { |
|
|
|
|
$text2 .= $lines[$x].chr(13).chr(10); |
|
|
|
|
} |
|
|
|
|
|