예제 #1
0
파일: sa.php 프로젝트: Gammelbob/echelon
	</tfoot>
	<tbody>
	<?php 
    $counter = 1;
    $keys_data = $dbl->getKeys($key_expire);
    $num_rows = $keys_data['num_rows'];
    if ($num_rows > 0) {
        foreach ($keys_data['data'] as $reg_keys) {
            // get data from query and loop
            $reg_key = $reg_keys['reg_key'];
            // the reg key
            $comment = cleanvar($reg_keys['comment']);
            // comment about key
            $time_add = date($tformat, $reg_keys['time_add']);
            $email = emailLink($reg_keys['email'], '');
            $admin_link = echUserLink($reg_keys['admin_id'], $reg_keys['admin']);
            $alter = alter();
            $token_keydel = genFormToken('keydel' . $reg_key);
            if ($mem->id == $admin_id) {
                // if the current user is the person who create the key allow the user to edit the key's comment
                $edit_comment = '<img src="" alt="[Edit]" title="Edit this comment" class="edit-key-comment" />';
            } else {
                $edit_comment = '';
            }
            // setup heredoc (table data)
            $data = <<<EOD
\t\t\t<tr class="{$alter}">
\t\t\t\t<td class="key">{$reg_key}</td>
\t\t\t\t<td>{$email}</td>
\t\t\t\t<td>{$admin_link}</td>
\t\t\t\t<td><span class="comment">{$comment}</span> {$edit_comment}</td>
예제 #2
0
	</tfoot>
	<tbody>
	<?php 
    $counter = 1;
    $keys_data = $dbl->getKeys($key_expire);
    $num_rows = $keys_data['num_rows'];
    if ($num_rows > 0) {
        foreach ($keys_data['data'] as $reg_keys) {
            // get data from query and loop
            $reg_key = $reg_keys['reg_key'];
            // the reg key
            $comment = cleanvar($reg_keys['comment']);
            // comment about key
            $time_add = date($tformat, $reg_keys['time_add']);
            $email = emailLink($reg_keys['email'], '');
            $admin_link = echUserLink($reg_keys['admin_id'], $reg_keys['display']);
            $alter = alter();
            $token_keydel = genFormToken('keydel' . $reg_key);
            if ($mem->id == $admin_id) {
                // if the current user is the person who create the key allow the user to edit the key's comment
                $edit_comment = '<img src="" alt="[Edit]" title="Edit this comment" class="edit-key-comment" />';
            } else {
                $edit_comment = '';
            }
            // setup heredoc (table data)
            $data = <<<EOD
\t\t\t<tr class="{$alter}">
\t\t\t\t<td class="key">{$reg_key}</td>
\t\t\t\t<td>{$email}</td>
\t\t\t\t<td>{$admin_link}</td>
\t\t\t\t<td><span class="comment">{$comment}</span> {$edit_comment}</td>
예제 #3
0
function displayEchLog($array, $style = 'client')
{
    global $tformat;
    // import the time format varible for use in this function
    foreach ($array as $ech_log) {
        ## get vars
        $id = $ech_log['id'];
        $type = $ech_log['type'];
        $msg = tableClean($ech_log['msg']);
        $time_add = $ech_log['time_add'];
        $time_add_read = date($tformat, $time_add);
        $game_id = $ech_log['game_id'];
        ## Page row color alternate
        $alter = alter();
        if ($style == 'admin') {
            $cid = $ech_log['client_id'];
            $client_link = clientLink($cid, $cid, $game_id);
            $table = <<<EOD
\t\t\t<tr class="{$alter}">
\t\t\t\t<td>{$id}</td>
\t\t\t\t<td>{$type}</td>
\t\t\t\t<td>{$msg}</td>
\t\t\t\t<td><em>{$time_add_read}</em></td>
\t\t\t\t<td>{$client_link}</td>
\t\t\t</tr>
EOD;
        } else {
            // if client
            $user_name = tableClean($ech_log['user_name']);
            $user_link = echUserLink($ech_log['user_id'], $user_name);
            $table = <<<EOD
\t\t\t<tr class="{$alter}">
\t\t\t\t<td>{$id}</td>
\t\t\t\t<td>{$type}</td>
\t\t\t\t<td>{$msg}</td>
\t\t\t\t<td><em>{$time_add_read}</em></td>
\t\t\t\t<td>{$user_link}</td>
\t\t\t</tr>
EOD;
        }
        echo $table;
        // echo out the formated data
    }
}