| 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/www/thepharmajournal/admin/ |
Upload File : |
<?php
if(($opt1) && ($opt1 === 'add' || $opt1 === 'view')):
$stmt = $mysqli->prepare("SELECT $firstcol, category, name, degree, post, content, email, phone, institutionalprofile, googlescholarprofile, ssrnprofile, researchgateprofile, picture, resume, 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, $category, $name, $degree, $post, $content, $email, $phone, $institutionalprofile, $googlescholarprofile, $ssrnprofile, $researchgateprofile, $picture, $resume, $creation);
$stmt->fetch();
$stmt->close();
if($count_rows == 1):
$name = mb_convert_case(trim($name), MB_CASE_TITLE, 'UTF-8');
$name = html_entity_decode($name);
$degree = html_entity_decode(trim($degree));
$post = preg_replace_callback('/[a-zA-Z]+/', 'changecase', trim(trim($post), ' '));
$post = html_entity_decode($post);
$content = preg_replace_callback('/[a-zA-Z]+/', 'changecase', $content);
$content = strip_tags($fn->remespace(str_replace(array('<br>', '<br />', PHP_EOL), ' ', trim($content))));
$content = html_entity_decode($content);
if($opt1 === 'view'):
$picture = (($picture && file_exists($boardfileuploadpath.$picture))) ? $boardfiledir.$picture : $imageurl.'avatar_2x.png';
$pic_ext = strtolower(pathinfo($boardfileuploadpath.$picture, PATHINFO_EXTENSION));
if(($pic_ext !== 'jpg' && $pic_ext !== 'jpeg' && $pic_ext !== 'png' && $pic_ext !== 'gif')):
$picture = $imageurl.'avatar_2x.png';
endif;
echo <<<EOJ
<input type="hidden" name="dataid" value="{$id}" readonly />
<div class="head">
{$back}
<input type="button" class="action ico delete" onclick="dopost('delete', '{$id}', 'Do you really want to delete?', true)" />
<input type="submit" value="" class="action ico download" onclick="sOPT('downloadfiles')" />
<input type="button" value="add" class="action g" onclick="cURL('add/{$id}')" />
</div>
<table border="0" cellpadding="0" cellspacing="0" class="table view">
<tbody>
<tr><th>Data ID</th><td>#{$id}</td>
<tr><th>Category</th><td>{$category}</td>
<tr><th>Name</th><td>{$name}</td>
<tr><th>Degree</th><td>{$degree}</td>
<tr><th>Designation</th><td>{$post}</td>
<tr><th>Email ID</th><td>{$email}</td>
<tr><th>Phone</th><td>{$phone}</td>
<tr><th>Content</th><td>{$content}</td>
<tr><th>Picture</th><td><img src="{$picture}" alt="{$name}" class="img-round" /></td>
<tr><th>Creation</th><td>{$fn->dateformat($creation)}</td>
</tr>
</tbody>
</table>
EOJ;
elseif($opt1 === 'add'):
function categories(){
global $mysqli;$html = '';
$stmt = $mysqli->prepare("SELECT TRIM(category) FROM editors GROUP BY TRIM(category) ORDER BY TRIM(category) ASC") or die($mysqli->error);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($category);
while($stmt->fetch()):
$html .= ($category) ? '<option value="'.$category.'">'.$category.'</option>' : '';
endwhile;
$stmt->close();
return $html;
}
$categories = categories();
function subcategories(){
global $mysqli;$html = '';
$stmt = $mysqli->prepare("SELECT TRIM(subcategory) FROM editors GROUP BY TRIM(subcategory) ORDER BY TRIM(subcategory) ASC") or die($mysqli->error);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($subcategory);
while($stmt->fetch()):
$html .= ($subcategory) ? '<option value="'.$subcategory.'">'.$subcategory.'</option>' : '';
endwhile;
$stmt->close();
return $html;
}
$subcategories = subcategories();
echo <<<EOJ
<input type="hidden" name="dataid" value="{$id}" readonly />
<div class="head">
{$back}
<input type="reset" value="reset" class="action" />
<input type="submit" value="submit" class="action b" />
</div>
<div class="body">
<div class="row">
<div class="fl">
<div class="fl">
<label class="flbl">Category :<span>*</span></label>
<input type="text" name="category" value="{$category}" class="field" />
</div>
<div class="fr">
<label class="flbl">Category List :</label>
<select name="categories" class="field field-select" onchange="this.form.category.value=this.value;">
<option value="" selected="selected">Select Category</option>
{$categories}
</select>
</div>
</div>
<div class="fr">
<div class="fl">
<label class="flbl">Sub Category :</label>
<input type="text" name="subcategory" value="{$subcategory}" class="field" />
</div>
<div class="fr">
<label class="flbl">Sub Category List :</label>
<select name="subcategories" class="field field-select" onchange="this.form.subcategory.value=this.value;">
<option value="" selected="selected">Select Sub Category</option>
{$subcategories}
</select>
</div>
</div>
</div>
<div class="row">
<label class="flbl">Editor Name :<span>*</span></label>
<input type="text" name="name" value="{$name}" class="field" />
</div>
<div class="row">
<div class="fl">
<label class="flbl">Degree :</label>
<input type="text" name="degree" value="{$degree}" class="field" />
</div>
<div class="fr">
<label class="flbl">Designation :</label>
<input type="text" name="post" value="{$post}" class="field" />
</div>
</div>
<div class="row">
<label class="flbl">Content :<span>*</span></label>
<input type="text" name="content" value="{$content}" class="field" />
</div>
<div class="row">
<div class="fl">
<label class="flbl">Email :</label>
<div class="flex">
<input type="text" name="email" value="{$email}" class="field" />
<div class="rw"><label><input type="checkbox" name="emailshow" value="1" checked="checked" />show</label></div>
</div>
</div>
<div class="fr">
<label class="flbl">Phone :</label>
<div class="flex">
<input type="text" name="phone" value="{$phone}" class="field" />
<div class="rw"><label><input type="checkbox" name="phoneshow" value="1" checked="checked" />show</label></div>
</div>
</div>
</div>
<div class="row">
<div class="fl">
<label class="flbl">Institutional Profile :</label>
<input type="text" name="institutionalprofile" value="{$institutionalprofile}" class="field" />
</div>
<div class="fr">
<label class="flbl">Google Scholar Profile :</label>
<input type="text" name="googlescholarprofile" value="{$googlescholarprofile}" class="field" />
</div>
</div>
<div class="row">
<div class="fl">
<label class="flbl">SSRN Profile :</label>
<input type="text" name="ssrnprofile" value="{$ssrnprofile}" class="field" />
</div>
<div class="fr">
<label class="flbl">Research Gate Profile :</label>
<input type="text" name="researchgateprofile" value="{$researchgateprofile}" class="field" />
</div>
</div>
<div class="row">
<div class="rw"><label><input type="checkbox" name="sendsms" value="Y" checked="checked" />send sms</label></div>
<div class="rw"><label><input type="checkbox" name="sendemail" value="Y" checked="checked" />send email</label></div>
<div class="rw"><label><input type="checkbox" name="certificate" value="Y" checked="checked" onclick="if(this.checked)this.form.sendemail.checked=true;" />send certificate</label></div>
<div class="rw"><label><input type="checkbox" name="status" value="enabled" checked="checked" />status</label></div>
</div>
</div>
EOJ;
endif;
else:
echo 'Invalid data selection.';
endif;
else:
$keyword = htmlentities("%$keyword%");
if($opt1 === 'search'):
$stmt = $mysqli->prepare("SELECT * FROM $table WHERE (name LIKE ? OR degree LIKE ? OR post LIKE ? OR content LIKE ? OR email LIKE ? OR phone LIKE ?)") or die($mysqli->error);
$stmt->bind_param('ssssss', $keyword, $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;
echo <<<EOJ
<div class="head">
<input type="submit" value="download emails" class="action" onclick="sOPT('downloademails')" />
<input type="submit" value="" class="action ico delete hidden" onclick="sOPT('delete', 'Do you really want to delete?')" />
<div class="fr">{$pagination->get($total_rows, $page_number, $item_per_page)}</div>
</div>
<table border="0" cellpadding="0" cellspacing="0" class="table">
<thead>
<tr>
<th align="center" valign="middle" class="xs"><input type="checkbox" name="checkall" id="checkall" value="" /></th>
<th align="center" valign="middle" class="xs">s. no.</th>
<th align="center" valign="middle" class="xs">picture</th>
<th align="left" valign="middle">name</th>
<th align="left" valign="middle">email</th>
<th align="left" valign="middle">phone</th>
<th align="left" valign="middle">degree</th>
<th align="right" valign="middle" class="md">creation</th>
<th align="center" valign="middle" class="sm">action</th>
</tr>
</thead>
<tbody>
EOJ;
if($opt1 === 'search'):
$stmt = $mysqli->prepare("SELECT $firstcol, name, degree, email, phone, picture, creation FROM $table WHERE (name LIKE ? OR degree LIKE ? OR post LIKE ? OR content LIKE ? OR email LIKE ? OR phone LIKE ?) ORDER BY $firstcol DESC LIMIT $page_position, $item_per_page") or die($mysqli->error);
$stmt->bind_param('ssssss', $keyword, $keyword, $keyword, $keyword, $keyword, $keyword);
else:
$stmt = $mysqli->prepare("SELECT $firstcol, name, degree, email, phone, picture, 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, $name, $degree, $email, $phone, $picture, $creation);
while($stmt->fetch()):
$snum = ($page_number == 1) ? $snum + 1 : $page_position++ + 1;
$picture = (($picture && file_exists($boardfileuploadpath.$picture))) ? $boardfiledir.$picture : $imageurl.'avatar_2x.png';
$pic_ext = strtolower(pathinfo($boardfileuploadpath.$picture, PATHINFO_EXTENSION));
if(($pic_ext !== 'jpg' && $pic_ext !== 'jpeg' && $pic_ext !== 'png' && $pic_ext !== 'gif')):
$picture = $imageurl.'avatar_2x.png';
endif;
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="center" valign="middle"><img src="{$picture}" alt="{$name}" class="img-round" /></td>
<td align="left" valign="middle">{$name}</td>
<td align="left" valign="middle">{$email}</td>
<td align="left" valign="middle">{$phone}</td>
<td align="left" valign="middle">{$degree}</td>
<td align="right" valign="middle">{$fn->dateformat($creation)}</td>
<td align="center" valign="middle">
<button type="button" onclick="cURL('add/{$id}')">add</button>
<button type="button" onclick="cURL('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;
?>