| Server IP : 192.169.170.185 / Your IP : 216.73.216.97 Web Server : Apache System : Linux p3plmcpnl495852.prod.phx3.secureserver.net 4.18.0-553.52.1.lve.el8.x86_64 #1 SMP Wed May 21 15:31:29 UTC 2025 x86_64 User : akhilnew ( 1712764) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/akhilnew/public_html/patholjournal.com/admin/ |
Upload File : |
<?php
if(($opt1 && $opt1 === 'view')):
$stmt = $mysqli->prepare("SELECT $firstcol, fullname, address, email, phone, title, creation FROM $table WHERE $firstcol = ? LIMIT 1") or die($mysqli->error);
$stmt->bind_param('i', $opt2);
$stmt->execute();
$stmt->store_result();
$count_rows = $stmt->num_rows();
$stmt->bind_result($id, $fullname, $address, $email, $phone, $title, $creation);
$stmt->fetch();
$stmt->close();
if($count_rows !== 1):
die('Invalid data selection.');
endif;
$address = nl2br($address);
$address = html_entity_decode($address);
$creation= DateFormat($creation, true);
echo <<<EOJ
<input type="hidden" name="dataid" value="{$id}" readonly="readonly" />
<div class="head">
<input type="button" value="" class="action ico back" onclick="history.back()" />
<input type="button" value="" class="action ico delete" onclick="dopost('delete', '{$id}', 'Do you really want to delete?', true)" />
<input type="submit" value="" class="action ico download" onclick="setopt(this, 'downloadfiles')" />
</div>
<table border="0" cellpaddign="0" cellspacing="0" class="table view">
<tr><th>Article Id</th><td>#{$opt2}</td></tr>
<tr><th>Full Name</th><td>{$fullname}</td></tr>
<tr><th>Address</th><td>{$address}</td></tr>
<tr><th>Email</th><td>{$email}</td></tr>
<tr><th>Phone</th><td>{$phone}</td></tr>
<tr><th>Title</th><td>{$title}</td></tr>
<tr><th>Date Created</th><td>{$creation}</td></tr>
</table>
EOJ;
else:
$keyword = "%$keyword%";
if($opt1 === 'search'):
$stmt = $mysqli->prepare("SELECT * FROM $table WHERE (fullname LIKE ? OR address LIKE ? OR email LIKE ? OR phone LIKE ? OR title LIKE ?)") or die($mysqli->error);
$stmt->bind_param('sssss', $keyword, $keyword, $keyword, $keyword, $keyword);
$stmt->execute();
$stmt->store_result();
$total_rows = $stmt->num_rows();
$stmt->close();
else:
$stmt = $mysqli->prepare("SELECT * FROM $table") or die($mysqli->error);
$stmt->execute();
$stmt->store_result();
$total_rows = $stmt->num_rows();
$stmt->close();
endif;
$pagination = pagination($total_rows, $page_number, $item_per_page);
echo <<<EOJ
<div class="head">
<input type="submit" value="" class="action ico delete hidden" onclick="setopt(this, 'delete', 'Do you really want to delete?')" />
<input type="submit" value="download emails" class="action" onclick="setopt(this, 'downloademails')" />
<div class="fr">{$pagination}</div>
</div>
<table border="0" cellpadding="0" cellspacing="0" class="table">
<thead>
<tr>
<th align="center" valign="middle" class="xs"><input type="checkbox" name="select_all" id="select_all" value=""/></th>
<th align="center" valign="middle" class="xs">s. no.</th>
<th align="left" valign="middle" style="width:170px">full name</th>
<th align="left" valign="middle">address</th>
<th align="left" valign="middle" style="width:200px">email</th>
<th align="left" valign="middle" style="width:130px">phone</th>
<th align="right" valign="middle" class="md">date created</th>
<th align="center" valign="middle" class="xs">action</th>
</tr>
</thead>
<tbody>
EOJ;
if($opt1 === 'search'):
$stmt = $mysqli->prepare("SELECT $firstcol, fullname, address, email, phone, creation FROM $table WHERE (fullname LIKE ? OR address LIKE ? OR email LIKE ? OR phone LIKE ? OR title LIKE ?) ORDER BY $firstcol DESC LIMIT $page_position, $item_per_page") or die($mysqli->error);
$stmt->bind_param('sssss', $keyword, $keyword, $keyword, $keyword, $keyword);
else:
$stmt = $mysqli->prepare("SELECT $firstcol, fullname, address, email, phone, creation FROM $table ORDER BY $firstcol DESC LIMIT $page_position, $item_per_page") or die($mysqli->error);
endif;
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows() > 0):
$stmt->bind_result($id, $fullname, $address, $email, $phone, $creation);
while($stmt->fetch()):
$snum = serial($page_number, $snum, $page_position);
$address = nl2br($address);
$address = html_entity_decode($address);
$creation = dateformat($creation);
echo <<<EOJ
<tr>
<td align="center" valign="middle"><input type="checkbox" name="dataid[]" value="{$id}" class="checkbox" /></td>
<td align="center" valign="middle">{$snum}</td>
<td align="left" valign="middle">{$fullname}</td>
<td align="left" valign="middle">{$address}</td>
<td align="left" valign="middle">{$email}</td>
<td align="left" valign="middle">{$phone}</td>
<td align="right" valign="middle">{$creation}</td>
<td align="center" valign="middle"><button type="button" onclick="gourl('view/{$id}')">view</button></td>
</tr>
EOJ;
endwhile;
$stmt->close();
else:
echo '<tr><td align="center" valign="middle" colspan="8">' . $emptyrows . '</td></tr>';
endif;
echo '</tbody>';
echo '</table>';
endif;
?>