bug 1138: added function get_se_log and fixed typos
authorINOPIAE <inopiae@cacert.org>
Sun, 8 Dec 2013 14:44:23 +0000 (15:44 +0100)
committerINOPIAE <inopiae@cacert.org>
Sun, 8 Dec 2013 14:44:23 +0000 (15:44 +0100)
includes/notary.inc.php
pages/account/59.php

index 236a124..83f95ae 100644 (file)
@@ -1233,6 +1233,14 @@ function get_training_result($userid){
        return mysql_query($query);
 }
 
+function get_se_log($userid){
+       $userid = intval($userid);
+       $query = "SELECT `adminlog`.`when`, `adminlog`.`type`, `adminlog`.`information`, `users`.`fname`, `users`.`lname`
+               FROM `adminlog`, `users`
+               WHERE `adminlog`.`admind` = `users`.`memid` and `adminlog`.`uid`=".$userid."
+               ORDER BY `adminlog`.`when`";
+       return mysql_query($query);
+}
 
 function output_log_email_header(){
        ?>
@@ -1288,7 +1296,7 @@ function output_log_domains($row){
 
 function output_log_agreement_header(){
        ?>
-       <tr
+       <tr>
                <td class="DataTD bold"><?= _("Agreement") ?></td>
                <td class="DataTD bold"><?= _("Date") ?></td>
                <td class="DataTD bold"><?= _("Method") ?></td>
@@ -1308,6 +1316,7 @@ function output_log_agreement($row){
 }
 
 function output_log_training_header(){
+       //should be entered in account/55.php
        ?>
        <tr>
                <td class="DataTD bold"><?= _("Agreement") ?></td>
@@ -1316,7 +1325,9 @@ function output_log_training_header(){
        </tr>
        <?
 }
+
 function output_log_training($row){
+       //should be entered in account/55.php
        ?>
        <tr>
                <td class="DataTD"><?=$row['pass_date']?></td>
@@ -1324,4 +1335,35 @@ function output_log_training($row){
                <td class="DataTD"><?=$row['test_text']?></td>
        </tr>
        <?
+}
+
+function output_log_se_header($support=0){
+       ?>
+       <tr>
+               <td class="DataTD bold"><?= _("Date") ?></td>
+               <td class="DataTD bold"><?= _("Type") ?></td>
+               <?if (1==$support) {
+                       ?>
+                               <td class="DataTD bold"><?= _("Information") ?></td>
+                               <td class="DataTD bold"><?= _("Admin") ?></td>
+                       <?
+               }?>
+       </tr>
+       <?
+}
+//SELECT `adminlog`.`when`, `adminlog`.`type`, `adminlog`.`information`, `users`.`fname`, `users`.`lname`
+function output_log_se($row, $support=0){
+       //should be entered in account/55.php
+       ?>
+       <tr>
+               <td class="DataTD"><?=$row['when']?></td>
+               <td class="DataTD"><?=$row['type']?></td>
+               <?if (1==$support) {
+                       ?>
+                       <td class="DataTD"><?=$row['information']?></td>
+                       <td class="DataTD"><?=$row['fname'].' '.$row['lname']?></td>
+                       <?
+               }?>
+       </tr>
+       <?
 }
\ No newline at end of file
index fac884f..762d33b 100644 (file)
@@ -29,7 +29,10 @@ $suffix = $row['suffix'];
 $dob = $row['dob'];
 $name = $fname." ".$mname." ".$lname." ".$suffix;
 $email = $row['email'];
-$alerts =get_alerts($userid)
+$alerts =get_alerts($userid);
+
+$support=0;
+
 ?>
 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
   <tr>
@@ -173,11 +176,31 @@ if(mysql_num_rows($dres) > 0) {
 }?>
 </table>
 <br/>
-
-<table>
+<?
+$dres = get_se_log($userid);
+$colspan=2;
+if (1==$support) {
+       $colspan=4;
+}
+?>
+<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
   <tr>
-    <td colspan="<? $colspandefault ?>" class="title"><?=_('Support Engineer actions')?></td>
+    <td colspan="<? $colspan?>" class="title"><?=_('Support activity')?></td>
   </tr>
+<?
+if(mysql_num_rows($dres) > 0) {
+       output_log_se_header($support);
+       while($drow = mysql_fetch_assoc($dres))
+       {
+               output_log_se($drow,$support);
+       }ELSE{
+               ?><td colspan="<? $colspan?>" ><?=_('no entry avialable')?></td><?
+       }
+}?>
+</table>
+<br/>
+
+<table>
   <tr>
     <td colspan="<? $colspandefault ?>" class="title"><?=_('Certificate actions')?></td>
   </tr>