<?php
require("connect.php");
if(isset($_GET['type']) && isset($_GET['year']))
{
$typetype = $_GET['type'];
if($typetype == "dl")
{
$typetype1 = "download";
}
else
{
$typetype1 = $typetype;
}
}
else
{
header("location: index.php");
}
if(isset($_GET['arch_id']))
{
$idid = $_GET['arch_id'];
$hello = "&arch_id=$idid";
}
else
{
$hello = "";
}
$year = $_GET['year'];
$to = "$year-01-01";
$onta = date("Y", strtotime($to));
if(!isset($_GET['arch_id']))
{
$query = mysql_query("SELECT arch_id,arch_name FROM archive WHERE arch_id IN (SELECT DISTINCT arch_id FROM issue WHERE pub ='1')ORDER BY arch_name");
}
else
{
if($_GET['arch_id'] != "All")
{
$query = mysql_query("SELECT arch_id FROM archive WHERE arch_id ='$idid' ORDER BY arch_name");
}
else
{
$query = mysql_query("SELECT arch_id FROM archive WHERE arch_id IN (SELECT DISTINCT arch_id FROM issue WHERE pub ='1')ORDER BY arch_name");
}
}
$list = "";
while($row = mysql_fetch_assoc($query))
{
$list .= $row['arch_id'].",";
}
$list = substr($list,0,-1);
?>
<!DOCTYPE HTML>
<title>ADMIN | Analytics
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!--
jQuery(document).ready(function($) {
$(".scroll").click(function(event){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top},1200);
});
});
.styled-select.slate {
background: url(../img/arrow.jpg) no-repeat right center;
height: 47px;
}
<?php
if(isset($_GET['arch_id']) && $_GET['arch_id'] != "All")
{
?>
var chart;
var chart = AmCharts.makeChart("linegraph",
{
"type": "serial",
/* "colors": ['#FF6600', '#FCD202', '#B0DE09', '#0D8ECF', '#2A0CD0', '#CD0D74', '#CC0000', '#00CC00', '#0000CC', '#DDDDDD', '#999999', '#333333', '#990000'], */
"categoryField": "date",
"dataDateFormat": "YYYY-MM",
"categoryAxis": {
"minPeriod": "MM",
"parseDates": true
},
"chartCursor": {
"cursorAlpha": 1,
"zoomable": true,
"categoryBalloonEnabled": true,
"categoryBalloonDateFormat": "MMM YYYY"
},
"export": {
"enabled": true
},
"chartScrollbar": {
"scrollbarHeight": 30,
"color": "#000000",
"autoGridCount": true,
},
"trendLines": [],
"graphs": [
<?php
$query6 = mysql_query("SELECT arch_name FROM archive WHERE arch_id='$idid'");
while($row6 = mysql_fetch_assoc($query6))
{
$dbarch_name = $row6['arch_name'];
echo'
{
"bullet": "round",
"id": "AmGraph-'.$idid.'",
"title": "'.$dbarch_name.'",
"valueField": "'.$dbarch_name.'"
},
';
}
?>
],
"guides": [],
"valueAxes": [
{
"id": "ValueAxis-1",
"title": "<?php echo $typetype1; ?> Count"
}
],
"allLabels": [],
"balloon": {},
"legend": {
"useGraphSettings": true
},
"titles": [
{
"id": "Title-1",
"size": 15,
"text": "Journal <?php echo ucfirst($typetype1); ?> Report (<?php echo date("Y",strtotime($to)); ?>)"
}
],
"dataProvider": [
<?php
$ttutal = "0";
for($z=1;$z<=12;$z++)
{
if($z <10)
{
$jeff = "0".$z;
}
else
{
$jeff = $z;
}
if($typetype == "hits")
{
$query1 = mysql_query("SELECT (SUM(arch_id_count) + SUM(iis_count) + SUM(artid_count)) as 'Total' FROM count WHERE arch_id='$idid' AND treg LIKE '$year-$jeff%'");
}
elseif($typetype == "dl")
{
$query1 = mysql_query("SELECT SUM(dl) as 'Total' FROM count WHERE arch_id='$idid' AND treg LIKE '$year-$jeff%'");
}
elseif($typetype == "read")
{
$query1 = mysql_query("SELECT SUM(view) as 'Total' FROM count WHERE arch_id='$idid' AND treg LIKE '$year-$jeff%'");
}
$num1 = mysql_num_rows($query1);
$row1 = mysql_fetch_array($query1);
$tutal1 = $row1['Total'];
if($tutal1 != NULL && $tutal1 != "0")
{
echo'
{
"date": "'.$year.'-'.$jeff.'",
"'.$dbarch_name.'": '.$tutal1.',
},
';
$ttutal = $ttutal + $tutal1;
}
}
?>
]
}
);
}
<?php
}
?>
AmCharts.makeChart("piegraph",
{
"type": "pie",
"backgroundColor": "#FFFFFF",
"labelsEnabled": false,
"autoMargins": false,
"marginBottom": 0,
"marginLeft": 0,
"sequencedAnimation" : true,
"startEffect" : "elastic",
"innerRadius" : "30%",
"startDuration" : 2,
/* "labelRadius" : -30,
"labelText" : "[[percents]]%", */
"depth3D" :10,
"angle" : 15,
"export": {
"enabled": true
},
"marginRight": 0,
/* "balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>", */
"outlineThickness": 9,
"titleField": "Country",
"valueField": "Hits",
"theme": "none",
/* "colors": ['#FF6600', '#FCD202', '#B0DE09', '#0D8ECF', '#2A0CD0', '#CD0D74', '#CC0000', '#00CC00', '#0000CC', '#DDDDDD', '#999999', '#333333', '#990000'], */
"balloon": {},
"titles": [
{
"id": "Title-1",
"size": 15,
"text": "Country <?php echo ucfirst($typetype1); ?> Overview (<?php echo $year; ?>)"
}
],
"legend": {
"markerType": "circle",
"position": "bottom",
"marginRight": 80,
"autoMargins": true
},
"dataProvider": [
<?php
$tbilang = "0";
$query8 = mysql_query("SELECT DISTINCT country_code FROM count");
$num8 = mysql_num_rows($query8);
while($row8 = mysql_fetch_assoc($query8))
{
$country_code = $row8['country_code'];
$query9 = mysql_query("SELECT country_name FROM countries WHERE country_code = '$country_code'");
$num9 = mysql_num_rows($query9);
if($num9 == "")
{
$country_name = "Unknown";
}
else
{
while($row9 = mysql_fetch_assoc($query9))
{
$country_name = $row9['country_name'];
}
}
//echo $country_name;
$bilang = "0";
$bilang1 = "0";
$bilang2 = "0";
$query10 = mysql_query("SELECT arch_id_count,iis_count,artid_count,dl,view FROM count WHERE arch_id IN ($list) AND country_code = '$country_code' AND treg LIKE '$year%'");
while($row10 = mysql_fetch_assoc($query10))
{
if($typetype == "hits")
{
$arch_id_count = $row10['arch_id_count'];
$iis_count = $row10['iis_count'];
$artid_count = $row10['artid_count'];
$bilang = $bilang + $arch_id_count + $iis_count + $artid_count;
}
elseif($typetype == "dl")
{
$dl = $row10['dl'];
$bilang = $bilang + $dl;
}
elseif($typetype == "read")
{
$view = $row10['view'];
$bilang = $bilang + $view;
}
}
if($bilang != "0")
{
echo'
{
"Country": "'.$country_name.'",
"Hits": '.$bilang.',
},
';
}
$tbilang = $tbilang + $bilang;
}
?>
]
}
);
<?php include("include/header.php"); ?>
<div class="top-nav">
<a href="#" id="w3-menu-trigger"> </a>
<ul class="nav-list">
<li class="nav-item"><a href="access.php">Accessibility</a></li>
<li class="nav-item"><a href="archives.php">Archives</a></li>
<li class="nav-item"><a href="analytics.php?type=hits&year=%3C?php%20echo%20date(">">Analytics</a></li>
<li class="nav-item"><a href="publisher.php">Publisher</a></li>
<li class="nav-item"><a href="author.php">Author</a></li>
<li class="nav-item"><a href="category.php">Category</a></li>
<li class="nav-item"><a href="institution.php">Institution</a></li>
<li class="nav-item"><a href="packages.php">Packages</a></li>
<li class="nav-item"><a href="../function/logout.php">Logout</a></li>
</ul>
<div class="clear"> </div>
</div>
<div class="clear"></div>
<?php include("include/link1.php"); ?>
<div class="main_bg">
<div class="wrap">
<div class="contact-form">
<div class="grids_of_3">
<div class="grid1_of_3">
<h3><?php echo ucfirst($typetype1); ?> Report</h3>
</div>
</div>
</div><br>
<div class="contact-form">
<div class="grids_of_4">
<div class="grid4_of_4">
<div class="grid1_of_4">
<div class="jeff">
<span>
All
<?php
$query11 = mysql_query("SELECT * FROM archive WHERE arch_id IN (SELECT DISTINCT arch_id FROM issue WHERE pub ='1') ORDER BY arch_name");
while($row11 = mysql_fetch_assoc($query11))
{
$archid = $row11['arch_id'];
$archname = $row11['arch_name'];
echo"$archname";
}
?>
</span>
</div>
</div>
<div class="grid1_of_4">
</div>
</div>
</div>
<div class="clear"></div>
</div>
<?php
if(isset($_GET['arch_id']) && $_GET['arch_id'] != "All")
{
$query21 = mysql_query("SELECT DISTINCT YEAR(year) as taon FROM issue WHERE arch_id = '$idid' ORDER BY year LIMIT 1");
$row21 = mysql_fetch_array($query21);
$taon = $row21['taon'];
$taon = $onta - $taon;
$myauthorlist = "";
$tcount_cite = "0";
$myartidlist = "";
$query1 = mysql_query("SELECT * FROM article WHERE iis IN (SELECT DISTINCT iis FROM issue WHERE arch_id = '$idid' AND year <= '$to')");
$num1 = mysql_num_rows($query1);
if($num1 != "0")
{
while($row1 = mysql_fetch_assoc($query1))
{
$myauthor = $row1['author'];
$myartidlist .= $row1['artid'].",";
if($myauthor != "" || $myauthor != NULL)
{
$myauthorlist .= $myauthor.",";
}
}
$myauthorlist = substr($myauthorlist,0,-1);
$myartidlist = substr($myartidlist,0,-1);
$query2 = mysql_query("SELECT cite_count FROM cited WHERE artid IN ($myartidlist)");
$num2 = mysql_num_rows($query2);
if($num2 != "0")
{
while($row2 = mysql_fetch_assoc($query2))
{
$cite_count = $row2['cite_count'];
$tcount_cite = $tcount_cite + $cite_count;
}
}
$query19 = mysql_query("SELECT DISTINCT aid FROM author WHERE aid IN ($myauthorlist)");
$num19 = mysql_num_rows($query19);
$query20 = mysql_query("SELECT article.artid, article.iis, SUM( cited.cite_count ) AS jeff FROM article LEFT JOIN cited ON ( article.artid = cited.artid ) WHERE article.artid IN ($myartidlist) GROUP BY article.artid, cited.artid ORDER BY jeff DESC");
$num20 = mysql_num_rows($query20);
$query21 = mysql_query("SELECT DISTINCT artid FROM article WHERE artid IN ($myartidlist)");
$num21 = mysql_num_rows($query21);
$ouchouch = "0";
$tabatsoy = "1";
$tabatsoy1 = "1";
$citeyeart = 0;
$cabs = "0";
$taba = "0";
while($row20 = mysql_fetch_assoc($query20))
{
$ouch = $row20['jeff'];
$iis = $row20['iis'];
$query22 = mysql_query("SELECT YEAR(year) as bagong FROM issue WHERE iis = '$iis'");
$row22 = mysql_fetch_array($query22);
$year1 = $row22['bagong'];
$citeyear = "0";
if($ouch == NULL)
{
$ouch = "0";
}
$ouchouch = $ouchouch + $ouch;
if($ouch == "0")
{
$citeyear = "0";
}
else
{
$citeyear = $ouch/$year1;
}
$year1 = $onta - $year1;
$cabs = $cabs + $ouch;
$citeyeart = $citeyeart + $citeyear ;
$tabatsoy2 = $tabatsoy1 * $tabatsoy1;
$taba = "";
if($tcount_cite != "0")
{
if($cabs >= $tabatsoy2)
{
$tabaoink = $tabatsoy1;
}
}
if($tabatsoy <= $ouch)
{
$tabatsoy++;
}
$tabatsoy1++;
}
$tabatsoy = $tabatsoy - 1;
$citeyeart = $citeyeart/$tabatsoy1;
if($ouchouch == "0")
{
$tabaoink = "0";
}
?>
<div class="grids_of_3">
<div class="grid1_of_3">
<h3>Journal Impact</h3>
</div>
</div>
<div class="grids_of_4">
<div class="grid4_of_4">
<table><tbody><tr><td>Papers</td><td><?php echo $num21; ?></td><td>Cites/Paper</td><td><?php printf ("%6.2f",$ouchouch/$num21); ?></td><td>Cites/Auth/Year</td><td><?php printf ("%6.3f",$ouchouch/$num19/$taon); ?></td></tr><tr><td>Citations</td><td><?php echo $ouchouch; ?></td><td>Cites/Author</td><td><?php printf ("%6.2f",$ouchouch/$num19); ?></td><td>h-index</td><td><?php printf ($tabatsoy); ?></td></tr><tr><td>Year(s)</td><td><?php echo $taon; ?></td><td>Papers/Author</td><td><?php printf ("%6.2f",$num21/$num19); ?></td><td>g-index</td><td><?php echo $tabaoink; //echo $tcount_cite/$taon; ?></td></tr><tr><td>Cite/Year</td><td><?php printf ("%6.2f",$ouchouch/$taon); ?></td><td>Authors/Papers</td><td><?php printf ("%6.2f",$num19/$num21); ?></td><td>hI,annual</td><td><?php printf ("%6.2f",$citeyeart); ?></td></tr></tbody></table>
</div>
</div>
<?php
}
}
?>
<div class="contact-form">
<div class="grids_of_3">
<div class="grids3_of_3">
.jeffrey{
display: block;
overflow: auto;
width: 100%;
}
.headcol{
position: absolute;
}
<?php
for($x=1;$x<=12;$x++)
{
if($x<10)
{
$month = "0".$x;
}
else
{
$month = $x;
}
$date = "$year-$month";
$myear = date("M", strtotime($date."-01"));
echo"";
}
?>
<?php
if(!isset($_GET['arch_id']))
{
$query = mysql_query("SELECT arch_id,arch_name FROM archive WHERE arch_id IN (SELECT DISTINCT arch_id FROM issue WHERE pub ='1')ORDER BY arch_name");
}
else
{
if($_GET['arch_id'] != "All")
{
$query = mysql_query("SELECT arch_id,arch_name FROM archive WHERE arch_id ='$idid' ORDER BY arch_name");
}
else
{
$query = mysql_query("SELECT arch_id,arch_name FROM archive WHERE arch_id IN (SELECT DISTINCT arch_id FROM issue WHERE pub ='1')ORDER BY arch_name");
}
}
while($row = mysql_fetch_assoc($query))
{
$arch_name = $row['arch_name'];
$arch_id = $row['arch_id'];
?>
<?php
$totaltotal = 0;
for($z=1;$z<=12;$z++)
{
if($z <10)
{
$jeff = "0".$z;
}
else
{
$jeff = $z;
}
if($typetype == "hits")
{
$query1 = mysql_query("SELECT (SUM(arch_id_count) + SUM(iis_count) + SUM(artid_count)) as 'Total' FROM count WHERE arch_id='$arch_id' AND treg LIKE '$year-$jeff%'");
}
elseif($typetype == "dl")
{
$query1 = mysql_query("SELECT SUM(dl) as 'Total' FROM count WHERE arch_id='$arch_id' AND treg LIKE '$year-$jeff%'");
}
elseif($typetype == "read")
{
$query1 = mysql_query("SELECT SUM(view) as 'Total' FROM count WHERE arch_id='$arch_id' AND treg LIKE '$year-$jeff%'");
}
$row1 = mysql_fetch_array($query1);
$total = $row1['Total'];
if($total == NULL)
{
$total = 0;
}
if(!isset($tutal[$z]))
{
$tutal[$z] = $total;
}
else
{
$tutal[$z] = $tutal[$z] + $total;
}
$totaltotal = $totaltotal + $total;
echo"";
}
echo "";
$jeff1 = count($tutal);
?>
<?
}
if($totaltotal != "0")
{
if($_GET['arch_id'] != "All")
{
$artid_list = "";
if($typetype == "dl")
{
$query1 = mysql_query("SELECT DISTINCT artid FROM count WHERE arch_id IN (SELECT arch_id FROM issue WHERE arch_id='$arch_id' AND pub='1') AND dl!='0' AND treg LIKE '$year%'");
$num1 = mysql_num_rows($query1);
}
elseif($typetype == "read")
{
$query1 = mysql_query("SELECT DISTINCT artid FROM count WHERE arch_id IN (SELECT arch_id FROM issue WHERE arch_id='$arch_id' AND pub='1') AND view!='0' AND treg LIKE '$year%'");
$num1 = mysql_num_rows($query1);
}
else
{
$num1 = "0";
}
}
if($num1 != "0")
{
while($row1 = mysql_fetch_assoc($query1))
{
$artid_list .= $row1['artid'].",";
}
$artid_list1 = "";
$artid_list = substr($artid_list,0,-1);
$query = mysql_query("SELECT * FROM article WHERE artid IN ($artid_list) ORDER BY art_name");
while($row = mysql_fetch_assoc($query))
{
$artid_list1 .= $row['artid'].",";
}
$artid_list1 = substr($artid_list1,0,-1);
$artid_list = explode(",",$artid_list1);
foreach($artid_list as $art_id)
{
$query3 = mysql_query("SELECT art_name FROM article WHERE artid='$art_id'");
$row3 = mysql_fetch_array($query3);
$artname = $row3['art_name'];
echo"";
$totaltotal = 0;
for($z=1;$z<=12;$z++)
{
if($z <10)
{
$jeff = "0".$z;
}
else
{
$jeff = $z;
}
if($typetype == "dl")
{
$query2 = mysql_query("SELECT artid,SUM(dl) as 'Total' FROM count WHERE artid ='$art_id' AND treg LIKE '$year-$jeff%'");
}
elseif($typetype == "read")
{
$query2 = mysql_query("SELECT artid,SUM(view) as 'Total' FROM count WHERE artid ='$art_id' AND treg LIKE '$year-$jeff%'");
}
$row2 = mysql_fetch_array($query2);
$total = $row2['Total'];
if($total == NULL)
{
$total = 0;
}
if(!isset($tatol[$z]))
{
$tatol[$z] = $total;
}
else
{
$tatol[$z] = $tatol[$z] + $total;
}
$totaltotal = $totaltotal + $total;
echo"";
}
echo "";
echo "";
}
}
}
echo"";
$totaltotal1 = "0";
for($z=1;$z<=12;$z++)
{
$oink = $tutal[$z];
echo"";
$totaltotal1 = $totaltotal1 + $oink;
}
echo"";
?>
<table class="jeffrey"><thead><tr><td style="font-weight: bold">Journals <?php echo ucfirst($typetype1);?> (<?php echo $year; ?>)</td><th>$myear</th><th>TOTAL</th></tr></thead><tbody><tr><td style="font-weight: bold"><?php echo $arch_name; ?></td><td>$total</td><th>$totaltotal</th></tr><tr><td>$artname</td><td>$total</td><th>$totaltotal</th></tr><tr><td style="font-weight: bold">TOTAL</td><th>$oink</th><th style="color: red; font-weight: bolder">$totaltotal1</th></tr></tbody></table>
</div>
<?php
if(isset($_GET['arch_id']) && $_GET['arch_id'] != "All")
{
if($ttutal != "0")
{
?>
<div class="grids_of_4">
<div class="grid4_of_4">
<div id="linegraph" style="width: 100%; height: 800px; background-color: #FFFFFF"></div>
</div>
</div>
<?php
}
}
if($tbilang != "0")
{
?>
<div class="contact-form">
<div class="grid4_of_4">
<div id="piegraph" style="width: 100%; height: 800px; background-color: #FFFFFF"></div>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
<?php include("include/footer.php"); ?>
What I have tried:
i tried adding closed braket and parentesis but nothing happened.