| 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/electrojournal.com/admin/ |
Upload File : |
<?php
if($opt1 === 'add' OR ($opt1 === 'edit' && $opt2)):
function months($emonth)
{
$html = '';
for($m = 1; $m <= 12; $m++):
$month = date('M', mktime(0,0,0,$m,1));
$html .= '<option value="'.$month.'" '.($emonth === $month ? 'selected' : '').'>'.$month.'</option>';
endfor;
return $html;
}
function subjects()
{
global $mysqli, $table;$html = '';
$stmt = $mysqli->prepare("SELECT subject FROM $table GROUP BY TRIM(subject) ORDER BY subject ASC") or die($mysqli->error);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($subject);
while($stmt->fetch()):
$html .= $subject ? '<option value="'.trim($subject).'">'.trim($subject).'</option>' : '';
endwhile;
$stmt->close();
return $html;
}
function countries()
{
global $mysqli, $table;$html = '';
$stmt = $mysqli->prepare("SELECT nicename FROM country GROUP BY nicename ORDER BY nicename ASC") or die($mysqli->error);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($country);
while($stmt->fetch()):
$html .= $country ? '<option value="'.trim($country).'">'.trim($country).'</option>' : '';
endwhile;
$stmt->close();
return $html;
}
function font($font)
{
global $mysqli;$html = '';
$stmt = $mysqli->prepare("SELECT name FROM fonts ORDER BY name ASC") or die($mysqli->error);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($name);
while($stmt->fetch()):
$html .= '<option value="'.$name.'" '.($name === $font ? 'selected' : '').'>'.$name.'</option>';
endwhile;
$stmt->close();
return $html;
}
if($opt1 === 'edit'):
$stmt = $mysqli->prepare("SELECT $firstcol, doi, doistatus, month, year, refnumber, volume, issue, part, title, titlefont, authorname, authornamefont, abstract, abstractfont, keywords, description, file, supplementaryfile, subject, country, pagenumber, status, comment, mobile, email, retractcontent, retractstatus, modification, creation, views, downloads, specialissue, conference, shortnotes 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, $doi, $doistatus, $emonth, $year, $refnumber, $volume, $issue, $part, $title, $titlefont, $authorname, $authornamefont, $abstract, $abstractfont, $keywords, $description, $file, $supplementaryfile, $subject, $country, $pagenumber, $status, $comment, $mobile, $email, $retractcontent, $retractstatus, $modification, $creation, $views, $downloads, $specialissue, $conference, $shortnotes);
$stmt->fetch();
$stmt->close();
if($count_rows !== 1):
die('Invalid data selection.');
endif;
$emonth = trim(preg_replace('/[0-9]/', '', $emonth));
$mobileEmailField = '';
else:
$id = '';$doi = '';$emonth = '';$refnumber = '';$title = '';$titlefont = '';$authorname = '';$authornamefont = '';$abstract = '';$abstractfont = '';$keywords = '';$description = '';$subject = '';$country = '';$pagenumber = '';$comment = '';$mobile = '';$email = '';$retractcontent = '';$conference = '';$shortnotes = '';
$doistatus = 'enabled';$retractstatus = 'disabled';$specialissue = 'N';$status = 'enabled';
$mobileEmailField = 'hidden';
$params = explode('.', $opt2);
$year = $fn->element(0, $params);
$volume = $fn->element(1, $params);
$issue = $fn->element(2, $params);
$part = $fn->element(3, $params);
$stmt = $mysqli->prepare("SELECT month, specialissue, conference FROM $table WHERE (year = ? AND volume = ? AND issue = ? AND part = ?) ORDER BY $firstcol DESC LIMIT 1") or die($mysqli->error);
$stmt->bind_param('siss', $year, $volume, $issue, $part);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($emonth, $specialissue, $econference);
$stmt->fetch();
$stmt->close();
endif;
$issue = preg_replace('/[^0-9]/', '', $issue);
$doistatus = $doistatus === 'enabled' ? 'checked' : '';
$retractstatus = $retractstatus === 'enabled' ? 'checked' : '';
$specialissue = $specialissue === 'Y' ? 'checked' : '';
$status = $status === 'enabled' ? 'checked' : '';
$emonth = explode('-', $emonth);
$month1 = $fn->element(0, $emonth);
$month2 = $fn->element(1, $emonth);
$fmonth = months($month1);
$smonth = months($month2);
$subjects = subjects();
$countries = countries();
$titlefont = font($titlefont);
$authornamefont = font($authornamefont);
$abstractfont = font($abstractfont);
if($opt1 === 'add'):
$stmt = $mysqli->prepare("SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ?") or die($mysqli->error);
$stmt->bind_param('ss', $dbname, $table);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($nextarchivesid);
$stmt->fetch();
$stmt->close();
else:
$nextarchivesid = $opt2;
endif;
$nextdoi = $doilink.'.'.$year.'.v'.$volume.'.i'.$issue.strtolower($part).'.'.$nextarchivesid;
echo <<<EOJ
<input type="hidden" name="dataid" value="{$opt2}" readonly />
<div class="head">
<button type="button" class="waves-effect btn-flat" onclick="history.back()"><i class="material-icons">keyboard_return</i></button>
<button type="submit" class="waves-effect btn-flat blue accent-4 white-text" onclick="_sopt('{$opt1}')">Submit</button>
<input type="text" name="uploadedfileurl" placeholder="Uploaded file URL" class="grey lighten-2 right url" onfocus="this.select()" readonly />
</div>
<div class="body">
<div class="row">
<div class="col s12 m6 l6" style="margin-top:16px">
<div class="flex">
<label for="doistatus" class="chklab left"><input type="checkbox" name="doistatus" value="enabled" id="doistatus" {$doistatus} />doi status</label>
<label for="status" class="chklab left"><input type="checkbox" name="status" value="enabled" id="status" {$status} />status</label>
<label for="renamepdf" class="chklab left"><input type="checkbox" name="renamepdf" value="enabled" id="renamepdf" checked />rename pdf</label>
</div>
</div>
<div class="col s12 m2 l2">
<label for="fmonth">first month<b class="red-text right">*</b></label>
<select name="fmonth" id="fmonth" class="browser-default">
<option value="" selected="selected">Select first month</option>
{$fmonth}
</select>
</div>
<div class="col s12 m2 l2">
<label for="smonth">second month</label>
<select name="smonth" id="smonth" class="browser-default">
<option value="" selected="selected">Select second month</option>
{$smonth}
</select>
</div>
<div class="col s12 m2 l2">
<label for="year">year<b class="red-text right">*</b></label>
<input type="text" name="year" value="{$year}" maxlength="4" pattern="[0-9]+" id="year" class="int" onpaste="return false" />
</div>
</div>
<div class="row">
<div class="col s12 m3 l2">
<label for="refnumber">reference number<b class="red-text right">*</b></label>
<input type="text" name="refnumber" value="{$refnumber}" id="refnumber" onpaste="return false" />
</div>
<div class="col s12 m3 l4">
<label for="doi">doi number</label>
<div class="flex">
<input type="text" name="doi" value="{$doi}" id="doi" />
<label for="allotdoi" class="chklab left" style="width:80px"><input type="checkbox" name="allotdoi" value="Y" id="allotdoi" onchange="if(this.checked){ $('#doi').val('{$nextdoi}'); } else { $('#doi').val(''); }" />allot</label>
</div>
</div>
<div class="col s12 m2 l2">
<label for="volume">volume number<b class="red-text right">*</b></label>
<input type="text" name="volume" value="{$volume}" maxlength="3" pattern="[0-9]+" id="volume" class="int" onpaste="return false" />
</div>
<div class="col s12 m2 l2">
<label for="issue">issue number<b class="red-text right">*</b></label>
<input type="text" name="issue" value="{$issue}" maxlength="3" pattern="[0-9]+" id="issue" onpaste="return false" />
</div>
<div class="col s12 m2 l2">
<label for="part">part<b class="red-text right">*</b></label>
<input type="text" name="part" value="{$part}" maxlength="4" pattern="[A-Z]+" id="part" onpaste="return false" />
</div>
</div>
<div class="row">
<div class="col s12 m12 l12">
<label for="title">title<b class="red-text right">*</b></label><br clear="all">
<textarea rows="25" cols="25" name="title" class="htmleditor">{$title}</textarea>
</div>
</div>
<div class="row">
<div class="col s12 m12 l12">
<label for="authorname">author name<b class="red-text right">*</b></label>
<input type="text" name="authorname" value="{$authorname}" id="authorname" />
</div>
</div>
<div class="row">
<div class="col s12 m12 l12 md">
<label for="abstract">abstract</label><br clear="all">
<textarea rows="25" cols="25" name="abstract" class="htmleditor">{$abstract}</textarea>
</div>
</div>
<div class="row">
<div class="col s12 m6 l6">
<label for="description">meta description</label>
<input type="text" name="description" value="{$description}" id="description" />
</div>
<div class="col s12 m6 l6">
<label for="keywords">meta keywords</label>
<input type="text" name="keywords" value="{$keywords}" id="keywords" />
</div>
</div>
<div class="row">
<div class="col s12 m3 l3" style="margin-bottom:0">
<label for="mainfile">main file</label>
<input type="file" name="mainfile" id="mainfile" style="height:158px" />
</div>
<div class="col s12 m3 l3" style="margin-bottom:0">
<label for="mainfile">supplementary file</label>
<input type="file" name="suppfile" id="suppfile" style="height:158px" />
</div>
<div class="col s12 m6 l6">
<div class="row">
<div class="col s12 m6 l6">
<label for="subject">subject</label>
<input type="text" name="subject" value="{$subject}" id="subject" list="subjectlist" />
</div>
<div class="col s12 m6 l6">
<label for="subjects">subjects</label>
<select name="subjects" id="subjects" class="browser-default" onchange="this.form.subject.value=this.value;">
<option value="" selected>Select subject</potion>
{$subjects}
</select>
</div>
</div>
<div class="row">
<div class="col s12 m6 l6">
<label for="country">country<b class="red-text right">*</b></label>
<input type="text" name="country" value="{$country}" id="country" readonly />
</div>
<div class="col s12 m6 l6">
<label for="countries">countries</label>
<select name="countries" id="countries" class="browser-default" onchange="this.form.country.value=this.value;">
<option value="" selected>Select country</potion>
{$countries}
</select>
</div>
</div>
<div class="row">
<div class="col s12 m12 l12" style="margin-bottom:0">
<label for="pagenumber">page number<b class="red-text right">*</b></label>
<input type="text" name="pagenumber" value="{$pagenumber}" pattern="[0-9-]+" id="pagenumber" onpaste="return false" />
</div>
</div>
</div>
</div>
<div class="row" {$mobileEmailField}>
<div class="col s12 m6 l6">
<label for="mobile">mobile</label>
<input type="text" name="mobile" value="{$mobile}" id="mobile" />
</div>
<div class="col s12 m6 l6">
<label for="email">email</label>
<input type="text" name="email" value="{$email}" id="email" />
</div>
</div>
<div class="row">
<div class="col s12 m4 l4">
<label for="titlefont">title font</label>
<select name="titlefont" class="browser-default">
<option value="" selected="selected">Select title font</option>
{$titlefont}
</select>
</div>
<div class="col s12 m4 l4">
<label for="authornamefont">author name font</label>
<select name="authornamefont" class="browser-default">
<option value="" selected="selected">Select author name font</option>
{$authornamefont}
</select>
</div>
<div class="col s12 m4 l4">
<label for="abstractfont">abstract font</label>
<select name="abstractfont" class="browser-default">
<option value="" selected="selected">Select abstract font</option>
{$abstractfont}
</select>
</div>
</div>
<div class="row">
<div class="col s12 m12 l12">
<label for="comment">comment</label>
<input type="text" name="comment" value="{$comment}" id="comment" />
</div>
</div>
<div class="row">
<div class="col s12 m12 l12">
<label for="retractcontent">retract content</label>
<div class="flex">
<input type="text" name="retractcontent" value="{$retractcontent}" id="retractcontent" />
<label for="retractstatus" class="chklab right" style="width:140px"><input type="checkbox" name="retractstatus" value="enabled" id="retractstatus" {$retractstatus} />retract status</label>
</div>
</div>
</div>
<div class="row">
<div class="col s12 m12 l12">
<label for="conference">conference name</label>
<div class="flex">
<input type="text" name="conference" value="{$conference}" id="conference" />
<label for="specialissue" class="chklab right" style="width:125px"><input type="checkbox" name="specialissue" value="Y" id="specialissue" {$specialissue} />special issue</label>
</div>
</div>
</div>
<div class="row">
<div class="col s12 m12 l12">
<label for="shortnotes">short notes</label>
<input type="text" name="shortnotes" value="{$shortnotes}" id="shortnotes" />
</div>
</div>
</div>
<div class="fixed-action-btn">
<button type="button" class="btn-floating blue accent-4" onclick="$('.upf').show(0);"><i class="material-icons">file_upload</i></button>
</div>
<br clear="all">
<br clear="all">
EOJ;
if($opt1 === 'edit' && $opt2):
echo <<<EOJ
<div id="authormodal" style="width:700px;height:360px;background:#fff;border-radius:8px;position:fixed;top:50px;left:0;right:0;z-index:9999;margin:auto;box-shadow:0 10px 25px #333;overflow-y:scroll;" hidden>
<div style="padding:12px 8px;display:flex;align-items:center">
<h6>Add Author</h6>
<div style="margin-left:auto;">
<button type="button" class="waves-effect btn-flat grey lighten-1 left" style="height:auto;line-height:normal;padding:8px 12px;" onclick="addauthorsinmodal()">Add Author</button>
<button type="button" class="waves-effect btn-flat grey lighten-1 left" style="height:auto;line-height:normal;padding:8px 12px;margin-left:10px !important;" onclick="fetchauthors('fetchauthorsforedit')">Fetch</button>
<button type="button" class="waves-effect btn-flat grey lighten-1 left" style="height:auto;line-height:normal;padding:8px 12px;margin-left:10px !important;" onclick="authormodal.hidden = true;">Close</button>
<button type="submit" class="waves-effect btn-flat blue accent-3 white-text right" style="height:auto;line-height:normal;padding:8px 12px;margin-left:10px !important;" onclick="_sopt('addauthors')">Submit</button>
</div>
</div>
<table class="table">
<thead id="fetchedauthors">
<tr>
<th>name</th>
<th>email</th>
<th>phone</th>
<th style="with:60px;" nowrap></th>
</tr>
<tr>
<td><input type="text" name="new_aa_authorname[]" class="form-control" /></td>
<td><input type="text" name="new_aa_authoremail[]" class="form-control" /></td>
<td><input type="text" name="new_aa_authorphone[]" class="form-control" /></td>
<td nowrap style="width:70px;">
<button class="btn-control" style="width:60px;padding:.375rem 0!important;" type="button" onclick="$(this).closest('tr').remove()">Remove</button>
</td>
</tr>
</thead>
<tbody id="multiauthors"></tbody>
</table>
</div>
<button type="button" class="btn-control" onclick="authormodal.hidden = false" style="margin:0 5px 0 10px !important;">Add New</button>
<button type="submit" class="btn-control h" style="display:none" onclick="_sopt('deleteauthors', 'Do you really want to delete?')">Delete</button>
<br clear="all">
<br clear="all">
<table class="table">
<thead>
<tr>
<th class="xs center-align"><input type="checkbox" name="checkall" value="" class="checkall" /></th>
<th>name</th>
<th>email</th>
<th>phone</th>
<th colspan="3" nowrap style="background-color:#d5d5d5;">
<div style="display:flex;align-items:center;justify-content:center;">
<div class="switch">
<label>
<input type="checkbox" onchange="if(this.checked){ $('.mailCheckbox').val(1) }else{ $('.mailCheckbox').val('') }" />
<span class="lever"></span>
</label>
</div>
send email
</div>
</th>
<th colspan="2" nowrap style="background-color:#d5d5d5;">
<div style="display:flex;align-items:center;justify-content:center;">
<div class="switch">
<label>
<input type="checkbox" onchange="if(this.checked){ $('.waCheckbox').val(1) }else{ $('.waCheckbox').val('') }" />
<span class="lever"></span>
</label>
</div>
send whatsapp
</div>
</th>
</tr>
EOJ;
$stmt = $mysqli->prepare("SELECT id, name, email, phone FROM archiveauthors WHERE archiveid = ?") or die($mysqli->error);
$stmt->bind_param('i', $opt2);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($aa_id, $aa_name, $aa_email, $aa_phone);
while($stmt->fetch()):
echo <<<EOJ
<tr>
<td class="center-align" style="position:relative">
<input type="checkbox" name="archiveauthorid[]" value="{$aa_id}" class="checkbox" />
</td>
<td><input value="{$aa_name}" type="text" name="aa_authorname[{$aa_id}]" class="form-control" /></td>
<td><input value="{$aa_email}" type="text" name="aa_authoremail[{$aa_id}]" class="form-control" /></td>
<td><input value="{$aa_phone}" type="text" name="aa_authorphone[{$aa_id}]" class="form-control" /></td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;background-color:#d5d5d5;">
<input style="width:36px;padding:0;text-align:center;" class="mailCheckbox form-control" type="text" name="sendmail[{$aa_id}]" maxlength="1" /><br clear="all">Mail
</td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;width:80px;background-color:#d5d5d5;">
<input style="width:36px;padding:0;text-align:center;" class="mailCheckbox form-control" type="text" name="sendcertificate[{$aa_id}]" maxlength="1" /><br clear="all">Certificate
</td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;background-color:#d5d5d5;">
<input style="width:36px;padding:0;text-align:center;" class="mailCheckbox form-control" type="text" name="sendcopyrightform[{$aa_id}]" maxlength="1" /><br clear="all">Copyright
</td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;background-color:#c5c5c5;">
<input style="width:36px;padding:0;text-align:center;" class="waCheckbox form-control" type="text" name="sendwamessage[{$aa_id}]" maxlength="1" /><br clear="all">Message
</td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;background-color:#c5c5c5;">
<input style="width:36px;padding:0;text-align:center;" class="waCheckbox form-control" type="text" name="sendwaadvertisement[{$aa_id}]" maxlength="1" /><br clear="all">Advertisement
</td>
</tr>
EOJ;
endwhile;
$stmt->close();
echo <<<EOJ
</thead>
</table>
<br clear="all">
<br clear="all">
<br clear="all">
EOJ;
else:
echo <<<EOJ
<button type="button" class="btn-control" onclick="fetchauthors('fetchauthorsforadd')" style="margin:0 5px 0 10px !important;">Fetch</button>
<button type="button" class="btn-control" onclick="addauthors()">Add Author</button>
<br clear="all">
<br clear="all">
<table class="table">
<thead id="fetchedauthors">
<tr>
<th>name</th>
<th>email</th>
<th>phone</th>
<th colspan="3" nowrap style="background-color:#d5d5d5;">
<div style="display:flex;align-items:center;justify-content:center;">
<div class="switch">
<label>
<input type="checkbox" onchange="if(this.checked){ $('.mailCheckbox').val(1) }else{ $('.mailCheckbox').val('') }" />
<span class="lever"></span>
</label>
</div>
send email
</div>
</th>
<th colspan="2" nowrap style="background-color:#d5d5d5;">
<div style="display:flex;align-items:center;justify-content:center;">
<div class="switch">
<label>
<input type="checkbox" onchange="if(this.checked){ $('.waCheckbox').val(1) }else{ $('.waCheckbox').val('') }" />
<span class="lever"></span>
</label>
</div>
send whatsapp
</div>
</th>
<th class="center-align" style="with:60px;" nowrap></th>
</tr>
<tr>
<td><input type="text" name="aa_authorname[]" class="form-control" /></td>
<td><input type="text" name="aa_authoremail[]" class="form-control" /></td>
<td><input type="text" name="aa_authorphone[]" class="form-control" /></td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;background-color:#d5d5d5;">
<input style="width:36px;padding:0;text-align:center;" class="mailCheckbox form-control" type="text" name="sendmail[]" maxlength="1" /><br clear="all">Mail
</td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;width:80px;background-color:#d5d5d5;">
<input style="width:36px;padding:0;text-align:center;" class="mailCheckbox form-control" type="text" name="sendcertificate[]" maxlength="1" /><br clear="all">Certificate
</td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;background-color:#d5d5d5;">
<input style="width:36px;padding:0;text-align:center;" class="mailCheckbox form-control" type="text" name="sendcopyrightform[]" maxlength="1" /><br clear="all">Copyright
</td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;background-color:#c5c5c5;">
<input style="width:36px;padding:0;text-align:center;" class="waCheckbox form-control" type="text" name="sendwamessage[]" maxlength="1" /><br clear="all">Message
</td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;background-color:#c5c5c5;">
<input style="width:36px;padding:0;text-align:center;" class="waCheckbox form-control" type="text" name="sendwaadvertisement[]" maxlength="1" /><br clear="all">Advertisement
</td>
<td nowrap style="width:70px;">
<button class="btn-control" style="width:60px;padding:.375rem 0!important;" type="button" onclick="$(this).closest('tr').remove()">Remove</button>
</td>
</tr>
</thead>
<tbody id="multiauthors"></tbody>
</table>
<br clear="all">
<br clear="all">
<br clear="all">
EOJ;
endif;
elseif($opt1 === 'list' OR $opt1 === 'search'):
function countgraphics($id)
{
global $mysqli, $firstcol;
$stmt = $mysqli->prepare("SELECT * FROM graphics WHERE $firstcol = ?") or die($mysqli->error);
$stmt->bind_param('i', $id);
$stmt->execute();
$stmt->store_result();
$count_rows = $stmt->num_rows();
$stmt->close();
return $count_rows;
}
$params = explode('.', $opt2);
$urlyear = $fn->element(0, $params);
$urlvolume= $fn->element(1, $params);
$urlissue = $fn->element(2, $params);
$urlpart = $fn->element(3, $params);
if($opt1 === 'search'):
$url = 'add';
$filesbutton = '';
$indexbutton = '';
$issuebutton = '';
else:
$url = 'add/'.$opt2;
$filesbutton = '<button type="submit" class="waves-effect btn-flat" onclick="_sopt(\'downloadfiles\')"><i class="material-icons left">file_download</i>Files</button>';
$indexbutton = '<button type="submit" class="waves-effect btn-flat h" onclick="_sopt(\'generateindexpage\')"><i class="material-icons left">file_download</i>Index page</button>';
$issuebutton = '<button type="button" class="waves-effect btn-flat right" style="margin:0">'.$urlyear.', Vol. '.$urlvolume.', Issue '.$urlissue.', Part '.$urlpart.'</button>';
endif;
echo <<<EOJ
<input type="hidden" name="params" value="{$opt2}" readonly />
<div class="head">
<button type="button" class="waves-effect btn-flat" onclick="history.back()"><i class="material-icons">keyboard_return</i></button>
<button type="button" class="waves-effect btn-flat green white-text" onclick="_curl('{$url}')">Add new</button>
<button type="submit" class="waves-effect btn-flat" onclick="_sopt('downloademails')"><i class="material-icons left">file_download</i>Emails</button>
{$filesbutton}
<button type="submit" class="waves-effect btn-flat" onclick="_sopt('checkdoi')">check doi</button>
<button type="submit" class="waves-effect btn-flat h" onclick="_sopt('downloadcertificate')"><i class="material-icons left">file_download</i>Certificate</button>
{$indexbutton}
<button type="submit" class="waves-effect btn-flat h" onclick="_sopt('downloaddoixml')"><i class="material-icons left">file_download</i>DOI XML</button>
<button type="submit" class="waves-effect btn-flat red h" onclick="_sopt('delete', 'Do you really want to delete?')"><i class="material-icons white-text">delete</i></button>
{$issuebutton}
</div>
<table class="table">
<thead>
<tr>
<th class="xs center-align" nowrap><input type="checkbox" name="checkall" value="" class="checkall" /></th>
<th class="xs center-align" nowrap>s. no.</th>
<th style="width:80px" nowrap>ref. num.</th>
<th class="center-align" style="width:75px" nowrap>doi active</th>
<th>title</th>
<th class="center-align" style="width:80px" nowrap>pages</th>
<th class="center-align" style="width:70px" nowrap>mail</th>
<th class="center-align" style="width:70px" nowrap>cert.</th>
<th class="center-align" style="width:70px">message</th>
<th class="center-align" style="width:100px">advertisement</th>
<th class="lg right-align" nowrap>modification</th>
<th class="lg right-align" nowrap>creation</th>
<th class="sm center-align" nowrap>action</th>
</tr>
</thead>
<tbody>
EOJ;
if($opt1 === 'search'):
$stmt = $mysqli->prepare("SELECT archive.archivesid, archive.doi, archive.doiactive, archive.year, archive.refnumber, archive.volume, archive.issue, archive.part, archive.title, archive.titlefont, archive.file, archive.pagenumber, archive.status, archive.mailstatus, archive.certificatemailstatus, archive.wa_message_send, archive.wa_advertisement_send, archive.modification, archive.creation, archive.specialissue, archive.countdoixmldownload FROM $table as archive LEFT JOIN archiveauthors as archiveauthor ON archive.archivesid = archiveauthor.archiveid WHERE (archive.doi LIKE ? OR archive.refnumber = ? OR STRIP_TAGS(archive.title) LIKE ? OR archive.authorname LIKE ? OR archive.abstract LIKE ? OR archive.keywords LIKE ? OR archive.description LIKE ? OR archive.country LIKE ? OR archive.mobile LIKE ? OR archive.email LIKE ? OR archiveauthor.name LIKE ? OR archiveauthor.email LIKE ? OR archiveauthor.phone LIKE ?) GROUP BY archive.archivesid ORDER BY LENGTH(archive.pagenumber),archive.pagenumber ASC") or die($mysqli->error);
$stmt->bind_param('sssssssssssss', $keyword, $equal, $keyword, $keyword, $keyword, $keyword, $keyword, $keyword, $keyword, $keyword, $keyword, $keyword, $keyword);
else:
$stmt = $mysqli->prepare("SELECT $firstcol, doi, doiactive, year, refnumber, volume, issue, part, title, titlefont, file, pagenumber, status, mailstatus, certificatemailstatus, wa_message_send, wa_advertisement_send, modification, creation, specialissue, countdoixmldownload FROM $table WHERE (year = ? AND volume = ? AND issue = ? AND part = ?) ORDER BY LENGTH(pagenumber),pagenumber ASC") or die($mysqli->error);
$stmt->bind_param('siss', $urlyear, $urlvolume, $urlissue, $urlpart);
endif;
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows() > 0):
$stmt->bind_result($id, $doi, $doiactive, $year, $refnumber, $volume, $issue, $part, $title, $titlefont, $file, $pagenumber, $status, $mailstatus, $certificatemailstatus, $wa_message_send, $wa_advertisement_send, $modification, $creation, $specialissue, $countdoixmldownload);
while($stmt->fetch()):
$snum = $snum + 1;
$refnocolor = $file && file_exists($uploadpath.$page.'/'.$file) ? '' : 'red-text';
$titlecolor = $status === 'disabled' ? 'red-text' : '';
$title = strip_tags($title, '<i><em><sup><sub><img>');
$title = $equal ? $title.'<b class="right" style="margin-top:2px;font-size:11px">'.$year.', VOL. '.$volume.', ISSUE '.$issue.', PART '.$part.'</b>' : $title;
$title = $titlefont ? '<span style="font-family:'.$titlefont.' !important;font-size:16px;">'.$title.'</span>' : $title;
$title = html_entity_decode($title);
$countgraphics = countgraphics($id);
$doibg = $doi ? '2d8024' : 'f00';
$countdoixmldownload = $countdoixmldownload ?: '0';
$doiactive = $doiactive === 'Y' ? '<i class="material-icons green-text" style="font-size:18px;">check</i>' : '<i class="material-icons red-text" style="font-size:18px;">clear</i>';
echo <<<EOJ
<tr>
<td class="center-align" nowrap><input type="checkbox" name="dataid[]" value="{$id}" class="checkbox" /></td>
<td class="center-align" nowrap>{$snum}</td>
<td class="{$refnocolor}" nowrap><a href="https://doi.org/{$doi}" target="_blank" class="white-text" style="background-color:#{$doibg};height:13px;line-height:14px;padding:0 3px;border-radius:2px;font-size:10px;position:absolute;top:0;right:0">DOI: {$countdoixmldownload}</a>{$refnumber}</td>
<td class="center-align" nowrap>{$doiactive}</td>
<td class="{$titlecolor}">{$title}</td>
<td class="center-align" nowrap>{$pagenumber}</td>
<td class="center-align" nowrap>{$mailstatus}</td>
<td class="center-align" nowrap>{$certificatemailstatus}</td>
<td class="center-align">{$wa_message_send}</td>
<td class="center-align">{$wa_advertisement_send}</td>
<td class="right-align" nowrap>{$fn->nice_date($modification)}</td>
<td class="right-align" nowrap>{$fn->nice_date($creation)}</td>
<td class="center-align" nowrap>
<button type="button" onclick="_curl('addgraphics/{$id}')">graphics ({$countgraphics})</button><br clear="all">
<button type="button" class="blue-text text-accent-4" onclick="_curl('edit/{$id}')">edit</button>
</td>
</tr>
EOJ;
endwhile;
else:
echo '<tr><td colspan="13" class="center-align">MySQL returned an empty result set (i.e. zero rows).</td></tr>';
endif;
$stmt->close();
echo '</tbody>';
echo '</table>';
elseif($opt1 === 'addgraphics' && $opt2):
echo <<<EOJ
<input type="hidden" name="dataid" value="{$opt2}" readonly />
<div class="head">
<button type="button" class="waves-effect btn-flat" onclick="history.back()"><i class="material-icons">keyboard_return</i></button>
<button type="submit" class="waves-effect btn-flat blue accent-4 white-text" onclick="_sopt('{$opt1}')">Submit</button>
</div>
<div class="body">
<div class="row">
<div class="col s12 m12 l12">
<label for="picture">picture</label>
<div class="flex">
<div class="file-field" style="width:100%;margin-right:10px">
<div class="btn btn-flat grey lighten-1">
<span>picture</span>
<input type="file" name="picture[]" multiple />
</div>
<div class="file-path-wrapper">
<input type="text" placeholder="Only JPG, JPEG, PNG and GIF allowed." class="file-path" />
</div>
</div>
<button type="button" class="waves-effect btn-flat grey lighten-1 addgraphics" style="width:36px;height:32px;line-height:32px;padding:0"><i class="material-icons">add</i></button>
</div>
</div>
</div>
<div class="row">
<div class="col s12 m12 l12">
<label for="alternative_text">alternative text</label><br clear="all">
<textarea rows="25" cols="25" name="alt[]" class="htmleditor" multiple></textarea>
</div>
</div>
<div class="morefield"></div>
</div>
<div class="row graphics">
EOJ;
$stmt = $mysqli->prepare("SELECT graphicsid, file, graphicsalt FROM graphics WHERE archivesid = ?") or die($mysqli->error);
$stmt->bind_param('i', $opt2);
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows() > 0):
$stmt->bind_result($graphicsid, $file, $graphicsalt);
while($stmt->fetch()):
$graphics = ($file && file_exists($graphicsuploadpath.$opt2.'/'.$file)) ? $graphicsdir.$opt2.'/'.$file : $imageurl.'avatar_2x.png';
echo <<<EOJ
<div class="col s6 m3 l2">
<div class="card">
<div class="card-image"><img src="{$graphics}" alt="{$graphicsalt}" /></div>
<div class="card-action">
<button type="button" class="waves-effect btn-flat grey lighten-2" onclick="_curl('editgraphics/{$graphicsid}')"><i class="material-icons">edit</i></button>
<button type="submit" class="waves-effect btn-flat grey lighten-2 right" onclick="_sopt('deletegraphics', 'Do you really want to delete?');$('input#graphicsid{$graphicsid}').attr('checked', true);"><i class="material-icons">delete</i></button>
<input type="radio" name="graphicsid" value="{$graphicsid}" id="graphicsid{$graphicsid}" readonly />
</div>
</div>
</div>
EOJ;
endwhile;
endif;
$stmt->close();
echo '</div>';
elseif($opt1 === 'editgraphics' && $opt2):
$stmt = $mysqli->prepare("SELECT archivesid, file, graphicsalt FROM graphics WHERE graphicsid = ? LIMIT 1") or die($mysqli->error);
$stmt->bind_param('i', $opt2);
$stmt->execute();
$stmt->store_result();
$count_rows = $stmt->num_rows();
$stmt->bind_result($archivesid, $file, $graphicsalt);
$stmt->fetch();
$stmt->close();
if($count_rows == 1):
$graphics = ($file && file_exists($graphicsuploadpath.$archivesid.'/'.$file)) ? $graphicsdir.$archivesid.'/'.$file : $imageurl.'avatar_2x.png';
echo <<<EOJ
<input type="hidden" name="dataid" value="{$opt2}" readonly />
<div class="head">
<button type="button" class="waves-effect btn-flat" onclick="history.back()"><i class="material-icons">keyboard_return</i></button>
<button type="submit" class="waves-effect btn-flat blue accent-4 white-text">Submit</button>
</div>
<div class="body">
<div class="row">
<div class="col s12 m12 l12">
<label for="graphics">graphics</label><div class="clearfix"></div>
<div class="file-field">
<div class="btn btn-flat grey lighten-1 white-text">
<span>graphics</span>
<input type="file" name="graphics" id="graphics" />
</div>
<div class="file-path-wrapper">
<input type="text" placeholder="Only JPG, JPEG, PNG and GIF allowed." class="file-path" />
</div>
</div>
</div>
</div>
<div class="row">
<div class="col s12 m12 l12">
<label for="alternative_text">alternative text</label><br clear="all">
<textarea rows="25" cols="25" name="alt" class="htmleditor">{$graphicsalt}</textarea>
</div>
</div>
</div>
<div class="row graphics">
<div class="col s6 m3 l2">
<div class="card">
<div class="card-image"><img src="{$graphics}" alt="{$graphicsalt}" /></div>
</div>
</div>
</div>
EOJ;
endif;
elseif($opt1 === 'settings'):
echo <<<EOJ
<div class="head">
<button type="button" class="waves-effect btn-flat" onclick="history.back()"><i class="material-icons">keyboard_return</i></button>
<button type="submit" class="waves-effect btn-flat blue accent-4 white-text">Submit</button>
</div>
<div class="body">
<div class="row">
<div class="col s12 m12 l12">
<div class="chkwrap left">
<label for="doi" class="chklab left" style="margin:0;padding-right:2px"><input type="radio" name="mode" value="doi" id="doi" /></label>
<label for="doistatus" class="chklab left"><input type="checkbox" name="doistatus" value="enabled" id="doistatus" onclick="this.form.mode[0].checked=true" onchange="this.form.mode[0].checked=true" />doi status</label>
</div>
<div class="chkwrap left">
<label for="status" class="chklab left" style="margin:0 0 0 10px;padding-right:2px"><input type="radio" name="mode" value="status" id="status" /></label>
<label for="changestatus" class="chklab left"><input type="checkbox" name="status" value="enabled" id="changestatus" onclick="this.form.mode[1].checked=true" onchange="this.form.mode[1].checked=true" />change status</label>
</div>
</div>
</div>
</div>
EOJ;
elseif($opt1 === 'import'):
echo <<<EOJ
<div class="head">
<button type="button" class="waves-effect btn-flat" onclick="history.back()"><i class="material-icons">keyboard_return</i></button>
<button type="submit" class="waves-effect btn-flat blue accent-4 white-text">Submit & download</button>
</div>
<div class="body">
<div class="row">
<div class="col s12 m12 l12">
<div class="file-field">
<div class="btn btn-flat grey lighten-1 white-text">
<span>excel file</span>
<input type="file" name="file" />
</div>
<div class="file-path-wrapper">
<input type="text" placeholder="Only excel file allowed." class="file-path" />
</div>
</div>
</div>
</div>
</div>
EOJ;
else:
function countpaper($year, $volume = '', $issue = '', $part = '')
{
global $mysqli, $table;
$stmt = $mysqli->prepare("SELECT (SELECT COUNT(*) AS totalyearpaper FROM $table WHERE year = ?), (SELECT COUNT(*) AS totalissuepaper FROM $table WHERE (year = ? AND volume = ? AND issue = ?)), (SELECT COUNT(*) AS totalpartpaper FROM $table WHERE (year = ? AND volume = ? AND issue = ? AND part = ?))") or die($mysqli->error);
$stmt->bind_param('ssississ', $year, $year, $volume, $issue, $year, $volume, $issue, $part);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($totalyearpaper, $totalissuepaper, $totalpartpaper);
$stmt->fetch();
$stmt->close();
return array(str_pad($totalyearpaper, 4, 0, STR_PAD_LEFT), str_pad($totalissuepaper, 4, 0, STR_PAD_LEFT), str_pad($totalpartpaper, 4, 0, STR_PAD_LEFT));
}
function issues($year)
{
global $mysqli, $table;$html = '';
$stmt = $mysqli->prepare("SELECT volume, issue FROM $table WHERE year = ? GROUP BY volume, issue ORDER BY volume DESC, CONVERT(issue, DECIMAL) DESC") or die($mysqli->error);
$stmt->bind_param('s', $year);
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows() > 0):
$stmt->bind_result($volume, $issue);
while($stmt->fetch()):
$countpaper = countpaper($year, $volume, $issue);
$html .= 'Volume '.$volume.' Issue '.str_pad($issue, 2, 0, STR_PAD_LEFT).' <span class="red-text"> - ['.$countpaper[1].']</span><br clear="all"><br clear="all">';
$html .= '<div class="row">'.parts($year, $volume, $issue).'</div><br clear="all">';
endwhile;
endif;
$stmt->close();
return $html;
}
function parts($year, $volume, $issue)
{
global $mysqli, $table, $pageurl;$html = '';
$stmt = $mysqli->prepare("SELECT part FROM $table WHERE (year = ? AND volume = ? AND issue = ?) GROUP BY part ORDER BY LENGTH(part), part ASC") or die($mysqli->error);
$stmt->bind_param('sis', $year, $volume, $issue);
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows() > 0):
$stmt->bind_result($part);
while($stmt->fetch()):
$countpaper = countpaper($year, $volume, $issue, $part);
$html .= '<div class="col s6 m4 l2"><a href="'.$pageurl.'/list/'.$year.'.'.$volume.'.'.$issue.'.'.$part.'" class="teal-text">part '.$part.' - <span class="red-text">['.$countpaper[2].']</span></a></div>';
endwhile;
endif;
$stmt->close();
return $html;
}
echo <<<EOJ
<div class="head">
<button type="button" class="waves-effect btn-flat green white-text" onclick="_curl('add')">Add new</button>
<button type="button" class="waves-effect btn-flat" onclick="_curl('import')"><i class="material-icons left">file_upload</i>Import</button>
<button type="submit" class="waves-effect btn-flat" onclick="_sopt('downloademails')"><i class="material-icons left">file_download</i>Emails</button>
</div>
<div class="body">
<ul class="collapsible z-depth-0">
EOJ;
$stmt = $mysqli->prepare("SELECT year FROM $table GROUP BY year ORDER BY year DESC") or die($mysqli->error);
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows() > 0):
$stmt->bind_result($year);
while($stmt->fetch()):
$countpaper = countpaper($year);
echo '<li>';
echo '<div class="collapsible-header white">'.$year.' <span class="red-text">['.$countpaper[0].']</span></div>';
echo '<div class="collapsible-body white">'.issues($year).'</div>';
echo '</li>';
endwhile;
else:
echo '<li class="center-align" style="padding:5px;border-bottom:1px solid #ddd;text-transform:none">MySQL returned an empty result set (i.e. zero rows).</li>';
endif;
$stmt->close();
echo <<<EOJ
</ul>
</div>
EOJ;
endif;
?>
<style>
.btn-control {
margin-left: 10px;
display: inline-block;
font-weight: 400;
line-height: 1.5;
color: #212529 !important;
font-weight: 500;
text-align: center;
text-transform: uppercase;
vertical-align: middle;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
background-color: #bbb !important;
border: 1px solid transparent;
padding: 0.375rem 0.75rem !important;
font-size: 12px !important;
border-radius: 0.25rem;
text-decoration: none !important;
}
.table td input.form-control,.table td input.form-control:focus {
display: inline-block;
width: 100%;
padding: 0.375rem 0.5rem !important;
font-size: 12px !important;
font-weight: 400;
line-height: 1.5;
color: #212529;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da !important;
border-radius: 0.25rem;
box-sizing: border-box;
}
</style>