$type = $pen['type']; $time_add = $pen['time_add']; $time_expire = $pen['time_expire']; $reason = tableClean($pen['reason']); $client_id = $pen['client_id']; $client_name = tableClean($pen['name']); $duration = $pen['duration']; ## Tidt data to make more human friendly if ($time_expire != '-1') { $duration_read = time_duration($duration * 60); } else { $duration_read = ''; } $time_expire_read = timeExpirePen($time_expire); $time_add_read = date($tformat, $time_add); $reason_read = removeColorCode($reason); if ($mem->loggedIn()) { $client_name_read = clientLink($client_name, $client_id); } else { $client_name_read = $client_name; } ## Row color $alter = alter(); // setup heredoc (table data) $data = <<<EOD t<tr class="{$alter}"> t\t<td><strong>{$client_name_read}</strong></td> t\t<td>{$ban_id}</td> t\t<td>{$type}</td> t\t<td>{$time_add_read}</td> t\t<td>{$duration_read}</td>
$stmt = $db->mysql->prepare($query) or die('<tr class="table-good"><td colspan="7"><span>Problem getting records from the database</span></td></tr>'); $stmt->bind_param('i', $cid); // bind in the client_id for the query $stmt->execute(); // run query $stmt->store_result(); // store the result - needed for the num_rows check if ($stmt->num_rows) { // if results exist $stmt->bind_result($pid, $type, $time_add, $time_expire, $reason, $data, $inactive, $duration, $admin_id, $admin_name); while ($stmt->fetch()) { // fetcht the results and store in an array // Change into readable times $time_add = date($tformat, $time_add); $time_expire_read = timeExpire($time_expire, $type, $inactive); $reason = tableClean(removeColorCode($reason)); $data = tableClean($data); $admin_name = tableClean($admin_name); if ($type_inc != 'Kick' && $type_inc != 'Notice' && $time_expire != '-1') { $duration = time_duration($duration * 60, 'yMwdhm'); } else { $duration = ''; } // Row odd/even colouring $alter = alter(); if ($admin_id != 1) { // if admin is not B3 show clientdetails link else show just the name $admin_link = '<a href="clientdetails.php?id=' . $admin_id . '" title="View the admin\'s client page">' . $admin_name . '</a>'; } else { $admin_link = $admin_name; }
private function buildLines($data_set, $ani = false) { global $tformat; // get the standardised time format if ($ani == 'tb') { $ani = 'tb-row'; } elseif ($ani == 'yes') { $ani = 'animate'; } else { $ani = ''; } if (count($data_set) > 0) { foreach ($data_set as $data) { $id = $data['id']; $msg_type = $data['msg_type']; $msg = cleanvar(removeColorCode($data['msg'])); $client_link = clientLink($data['client_name'], $data['client_id']); $time_read = date($tformat, $data['msg_time']); ## Highlight Commands ## if (substr($msg, 0, 1) == '!' or substr($msg, 0, 1) == '@') { $msg = '<span class="chat-cmd">' . $msg . "</span>"; } $alter = alter(); // setup heredoc (table data) $data = <<<EOD \t\t\t<tr class="{$alter} {$ani}" id="{$id}"> \t\t\t\t<td>{$id}</td> \t\t\t\t<td><strong>{$client_link}</strong></td> \t\t\t\t<td>{$msg_type}</td> \t\t\t\t<td>{$msg}</td> \t\t\t\t<td><em>{$time_read}</em></td> \t\t\t</tr> EOD; $content .= $data; } } return $content; }
if ($num_rows > 0) { $stmt->bind_result($reason, $time_add, $duration, $time_expire, $cid, $name, $pbid); $stmt->fetch(); } ?> <html> <head> </head> <body> <fieldset id="edit-ban"> <legend>Edit this Ban</legend> <?php if ($num_rows > 0) { $reason_read = cleanvar(removeColorCode($reason)); $name = cleanvar($name); $time_add_read = date($tformat, $time_add); $time_expire_read = timeExpirePen($time_expire); if ($duration != 0) { $duration_read = time_duration($duration * 60, 'yMwdhm'); } else { $duration_read = 'Permanent'; } $token_eb = genFormToken('editban'); ?> <fieldset class="none eb-fs"> <legend>Information about the ban</legend> <table class="cd-table"> <tbody>