Location: PHPKode > projects > Pointter PHP CMS > pointtercms_package/pointtercms_package/pointtercms/admin/statistics.php
<?php 

/***************************************************************************
 * Product Name			: Pointter PHP Content Management System
 * Version 			: V 1.2
 * Release Date			: 01/02/11
 * Copyright			: (C) 2011 PangramSoft / Murat Cevik
 * Program URL			: http://www.pointter.com
 * Company URL			: http://www.pangramsoft.com
 * Email Address                : hide@address.com
 
 ***************************************************************************/
 

/****************************************************************************

Pointter PHP Content Management System is licensed under Creative Commons Attribution Non-commercial No Derivatives 3.0 Unported (by-nc-nd) License.
To view a copy of this license, (a) visit http://creativecommons.org/licenses/by-nc-nd/3.0/ or (b) send a letter to Creative Commons, 171 2nd Street, 
Suite 300, San Francisco, California, 94105, USA.” 

You must not remove/modify/alter the copyright informations both visible and invisible forms in the source code and you must not remove/modify/alter 
the copyright informations in the footer part of the script including the Pointter image (png format file), hard link and title tag.

Please contact the copyright holder PangramSoft / Murat Cevik for a commercial license to remove the copyright information in the footer part of the script.


*****************************************************************************/

if (!isset($_COOKIE[auser]) OR !isset($_COOKIE[apass]))
{
header("location:index.php");
}
else
include 'cookiecheck.php';

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!--This website has been created by Pointter PHP Content Management System and copyrighted by PangramSoft / Murat Cevik.  
    Please visit http://www.pointter.com for a FREE DOWNLOAD.--> 

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link type="text/css" rel="stylesheet" href="style.css"/>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"/>
<title>Pointter PHP Content Management System Admin Panel: Statistics</title>
</head>

<body>

<table class="main" style="width:950px;" align="center" cellspacing="0" cellpadding="10">
<tr style="background-color:#ffffff;height:80px;">
<td colspan="2" style="border-width:1px;border-bottom-style:dotted;border-color:#272727;"><img src="pointter.png" alt="Pointter Logo"/></td></tr>


<tr><td style="border-width:1px;border-right-style:dotted;border-color:#272727;height:700px;width:180px;" valign="top">
<font style="font:bold 12px Arial;">CREATE MENU</font>
<ul class="main_menu">
<li class="main_menu"><img src="siteicons/box_add.png" align="left" alt="box icon"/>&ensp;<a class="menu" href="box.php" title="Create A Box To Wrap Static Pages"> Create Box</a></li>
<li class="main_menu"><img src="siteicons/category_add.png" align="left" alt="category add icon"/>&ensp;<a class="menu" href="category.php" title="Create A Main Or Sub Category"> Create Category</a></li>
<li class="main_menu"><img src="siteicons/product_add.png" align="left" alt="product add icon"/>&ensp;<a class="menu" href="product.php" title="Create A Product Page For Categories"> Create Product Page</a></li>
<li class="main_menu"><img src="siteicons/page_add.png" align="left" alt="page add icon"/>&ensp;<a class="menu" href="staticpage.php" title="Create A Static Page"> Create Static Page</a></li>
</ul> 

<br/><br/>
<font style="font:bold 12px Arial;">EDIT MENU</font>
<ul class="main_menu">
<li class="main_menu"><img src="siteicons/index_edit.png" align="left" alt="index edit icon"/>&ensp;<a class="menu" href="indexeditor.php" title="Edit Index Page Of The Website"> Edit Index Page</a></li>
<li class="main_menu"><img src="siteicons/box_edit.png" align="left" alt="box edit icon"/>&ensp;<a class="menu" href="editbox.php" title="Edit All The Boxes Of The Website"> Edit Box</a></li>
<li class="main_menu"><img src="siteicons/category_edit.png" align="left" alt="category edit icon"/>&ensp;<a class="menu" href="editcategory.php" title="Edit All The Categories Of The Website"> Edit Category</a></li>
<li class="main_menu"><img src="siteicons/product_edit.png" align="left" alt="product edit icon"/>&ensp;<a class="menu" href="editproduct.php" title="Edit All The Product Pages Of The Website"> Edit Product Page</a></li>
<li class="main_menu"><img src="siteicons/page_edit.png" align="left" alt="page edit icon"/>&ensp;<a class="menu" href="editstaticpage.php" title="Edit All The Static Pages Of The Website"> Edit Static Page</a></li>
</ul>

<br/><br/>
<font style="font:bold 12px Arial;">DELETE MENU</font>
<ul class="main_menu">
<li class="main_menu"><img src="siteicons/box_delete.png" align="left" alt="box delete icon"/>&ensp;<a class="menu" href="deletebox.php" title="Delete The Boxes Of The Website"> Delete Box</a></li>
<li class="main_menu"><img src="siteicons/category_delete.png" align="left" alt="category delete icon"/>&ensp;<a class="menu" href="deletecategory.php" title="Delete The Categories Of The Website"> Delete Category</a></li>
<li class="main_menu"><img src="siteicons/product_delete.png" align="left" alt="product delete icon"/>&ensp;<a class="menu" href="deleteproduct.php" title="Delete The Product Pages Of The Website"> Delete Product Page</a></li>
<li class="main_menu"><img src="siteicons/page_delete.png" align="left" alt="page delete icon"/>&ensp;<a class="menu" href="deletestaticpage.php" title="Delete The Static Pages Of The Website"> Delete Static Page</a></li>
</ul>

<br/><br/>
<font style="font:bold 12px Arial;">SETTINGS MENU</font>
<ul class="main_menu">
<li class="main_menu"><img src="siteicons/general_settings.png" align="left" alt="general settings icon"/>&ensp;<a class="menu" href="settings.php" title="General Settings Of The Website"> General Settings</a></li>
<li class="main_menu"><img src="siteicons/design_settings.png" align="left" alt="design settings icon"/>&ensp;<a class="menu" href="editbody.php" title="Design Settings Of The Website"> Design Settings</a></li>
</ul> 

<br/><br/>
<font style="font:bold 12px Arial;">SEO MENU</font>
<ul class="main_menu">
<li class="main_menu"><img src="siteicons/metatags.png" align="left" alt="metatags icon"/>&ensp;<a class="menu" href="metatags.php" title="Metatags For All The Pages Of The Website"> Metatags</a></li>
<li class="main_menu"><img src="siteicons/footer.png" align="left" alt="footer icon"/>&ensp;<a class="menu" href="footeredit.php" title="Footer Part Editor"> Footer Editor</a></li>
<li class="main_menu"><img src="siteicons/header.png" align="left" alt="header icon"/>&ensp;<a class="menu" href="headeredit.php" title="Header Part Editor"> Header Editor</a></li>
</ul> 

<br/><br/>
<font style="font:bold 12px Arial;">SYSTEM MENU</font>
<ul class="main_menu">
<li class="main_menu"><img src="siteicons/statistics.png" align="left" alt="statistics icon"/>&ensp;<a class="menu" href="statistics.php" title="Page Statistics Of The Website"> Statistics</a></li>
<li class="main_menu"><img src="siteicons/members.png" align="left" alt="members icon"/>&ensp;<a class="menu" href="members.php" title="Registered Members Of The Website"> Members</a></li>
<li class="main_menu"><img src="siteicons/massmail.png" align="left" alt="massmail icon"/>&ensp;<a class="menu" href="massmail.php" title="Send Mass Mail And Newsletter"> Mass Mail</a></li>
</ul> 

</td><td valign="top">
<br/>

<div align="right">
<ul class="main_menu">
<li class="main_menu"><img src="siteicons/home.png" align="left" alt="home icon"/>&ensp;<a class="menu" href="menu.php" title="Home"> Home</a></li>
<li class="main_menu"><img src="siteicons/logout.png" align="left" alt="log out icon"/>&ensp;<a class="menu" href="index.php" title="Log Out"> Log Out</a></li>
</ul>
</div>

<br/><br/>

<div class="box">

<table cellpadding="5" cellspacing="0" style="border-width:1px;border-bottom-style:dotted;border-right-style:solid;border-left-style:solid;border-color:#3399FF;width:700px;"><tr style="background-color:#3399FF;"><td>
<font size="3" color="#ffffff">Statistics</font>
</td></tr><tr style="background-color:#ffffff;height:50px;"><td>
<img src="siteicons/information.png" align="left" alt="information icon"/>&ensp;
You can check the complete list of your website's pages here. Please click on an attribute to sort the pages by Page Type, Page Name, Page URL and Number Of Views.
</td></tr></table>

<table style="border-width:1px;border-left-style:solid;border-color:#3399FF;width:700px;" cellspacing="0">

<?php

include '../configset/conn.php';

$sort=htmlentities($_GET[sort]);

if ($sort=="name")
  { 

  //Algorithm For Page Indexing

  $m_total=mysql_query("SELECT * FROM Views ORDER BY Name ASC");
  $num_total=mysql_num_rows($m_total);
  $num_pages=$num_total/30;
  $add=$num_total%30;

  if ($add!=0)
  $num_pages++;

  //Index Pages

  $page=$_GET[page];
  if ($_GET[page]=="")
  $page=1;
  $start=$page*30 - 30;

  $data=mysql_query("SELECT * FROM Views ORDER BY Name ASC LIMIT $start,30");

     echo '<tr style="height:30px;"><td class="headlist" width="100"><a class="headlist" href="statistics.php" title="Sort By Page Type">Page Type:</a></td>';
     echo '<td class="headlist" width="250"><a class="headlist" href="statistics.php?sort=name" title="Sort By Page Name">Page Name:</a></td>';
     echo '<td class="headlist" width="250"><a class="headlist" href="statistics.php?sort=url" title="Sort By Page Url">Page URL:</a></td>';
     echo '<td class="headlist" width="100"><a class="headlist" href="statistics.php?sort=view" title="Sort By Number Of Views">Views:</a></td></tr>';

  while ($row=mysql_fetch_array($data))
  {
    echo '<tr class="list" style="height:20px;">';
    echo '<td class="list">'.$row[Type].'</td><td class="list">'.$row[Name].'</td>';
    echo '<td class="list">'.$row[Url].'</td><td class="list">'.$row[Number].'</td></tr>';
  }

  //Print Indexed Page Links

  if ($num_total>30)
  {
   $prev=$page-1;
   $next=$page+1;
   echo '<td align="center" style="color:#ffffff;font-size:8pt;background-color:#3399FF;border-width:1px;border-bottom-style:dotted;border-right-style:dotted;border-color:#3399FF;height:30px;" colspan="4">';

   if ($page>1)
   {
    echo '<a href="statistics.php?sort=name&page='.$prev.'" title="Go To Previous Page">';
    echo '<img src="siteicons/arrow_left.png" border="0" align="left" alt="arrow left icon"/></a>&ensp;';
   }

   for ($i==0;$i<=$num_pages;$i++)
   {
     if ($i==$page)
     echo '<a class="headlist" href="statistics.php?sort=name&page='.$i.'">'.$i.'</a>&ensp;';
      else
       echo '<a class="headlist" href="statistics.php?sort=name&page='.$i.'"><u>'.$i.'</u></a>&ensp;';
   }

   if ($next<=$num_pages)
   {
    echo '&ensp;<a href="statistics.php?sort=name&page='.$next.'" title="Go To Next Page">';
    echo '<img src="siteicons/arrow_right.png" border="0" align="right" alt="arrow right icon"/></a>';
   }

   echo '</td></tr>';
  }

echo '</table>';

  }
   else if ($sort=="url")
    { 

    //Algorithm For Page Indexing

    $m_total=mysql_query("SELECT * FROM Views ORDER BY Url ASC");
    $num_total=mysql_num_rows($m_total);
    $num_pages=$num_total/30;
    $add=$num_total%30;

    if ($add!=0)
    $num_pages++;

    //Index Pages

    $page=$_GET[page];
    if ($_GET[page]=="")
    $page=1;
    $start=$page*30 - 30;

    $data=mysql_query("SELECT * FROM Views ORDER BY Url ASC LIMIT $start,30");

     echo '<tr style="height:30px;"><td class="headlist" width="100"><a class="headlist" href="statistics.php" title="Sort By Page Type">Page Type:</a></td>';
     echo '<td class="headlist" width="250"><a class="headlist" href="statistics.php?sort=name" title="Sort By Page Name">Page Name:</a></td>';
     echo '<td class="headlist" width="250"><a class="headlist" href="statistics.php?sort=url" title="Sort By Page Url">Page URL:</a></td>';
     echo '<td class="headlist" width="100"><a class="headlist" href="statistics.php?sort=view" title="Sort By Number Of Views">Views:</a></td></tr>';

    while ($row=mysql_fetch_array($data))
    {
      echo '<tr class="list" style="height:20px;">';
      echo '<td class="list">'.$row[Type].'</td><td class="list">'.$row[Name].'</td>';
      echo '<td class="list">'.$row[Url].'</td><td class="list">'.$row[Number].'</td></tr>';
    }

    //Print Indexed Page Links
 
    if ($num_total>30)
    {
     $prev=$page-1;
     $next=$page+1;
     echo '<td align="center" style="color:#ffffff;font-size:8pt;background-color:#3399FF;border-width:1px;border-bottom-style:dotted;border-right-style:dotted;border-color:#3399FF;height:30px;" colspan="4">';

     if ($page>1)
     {
      echo '<a href="statistics.php?sort=url&page='.$prev.'" title="Go To Previous Page">';
      echo '<img src="siteicons/arrow_left.png" align="left" border="0" alt="arrow left icon"/></a>&ensp;';
     }

     for ($i==0;$i<=$num_pages;$i++)
     {
       if ($i==$page)
       echo '<a class="headlist" href="statistics.php?sort=url&page='.$i.'">'.$i.'</a>&ensp;';
        else
         echo '<a class="headlist" href="statistics.php?sort=url&page='.$i.'"><u>'.$i.'</u></a>&ensp;';
     }

     if ($next<=$num_pages)
     {
      echo '&ensp;<a href="statistics.php?sort=url&page='.$next.'" title="Go To Next Page">';
      echo '<img src="siteicons/arrow_right.png" border="0" align="right" alt="arrow right icon"/></a>';
     }

     echo '</td></tr>';
    }

  echo '</table>';

  }
   else if ($sort=="view")
    { 

    //Algorithm For Page Indexing

    $m_total=mysql_query("SELECT * FROM Views ORDER BY Number DESC");
    $num_total=mysql_num_rows($m_total);
    $num_pages=$num_total/30;
    $add=$num_total%30;

   if ($add!=0)
   $num_pages++;

   //Index Pages

   $page=$_GET[page];
   if ($_GET[page]=="")
   $page=1;
   $start=$page*30 - 30;

   $data=mysql_query("SELECT * FROM Views ORDER BY Number DESC LIMIT $start,30");

     echo '<tr style="height:30px;"><td class="headlist" width="100"><a class="headlist" href="statistics.php" title="Sort By Page Type">Page Type:</a></td>';
     echo '<td class="headlist" width="250"><a class="headlist" href="statistics.php?sort=name" title="Sort By Page Name">Page Name:</a></td>';
     echo '<td class="headlist" width="250"><a class="headlist" href="statistics.php?sort=url" title="Sort By Page Url">Page URL:</a></td>';
     echo '<td class="headlist" width="100"><a class="headlist" href="statistics.php?sort=view" title="Sort By Number Of Views">Views:</a></td></tr>';

   while ($row=mysql_fetch_array($data))
   {
     echo '<tr class="list" style="height:20px;">';
     echo '<td class="list">'.$row[Type].'</td><td class="list">'.$row[Name].'</td>';
     echo '<td class="list">'.$row[Url].'</td><td class="list">'.$row[Number].'</td></tr>';
   }

   //Print Indexed Page Links

   if ($num_total>30)
   {
    $prev=$page-1;
    $next=$page+1;
    echo '<td align="center" style="color:#ffffff;font-size:8pt;background-color:#3399FF;border-width:1px;border-bottom-style:dotted;border-right-style:dotted;border-color:#3399FF;height:30px;" colspan="4">';

    if ($page>1)
    {
     echo '<a href="statistics.php?sort=view&page='.$prev.'" title="Go To Previous Page">';
     echo '<img src="siteicons/arrow_left.png" align="left" border="0" alt="arrow left icon"/></a>&ensp;';
    }

    for ($i==0;$i<=$num_pages;$i++)
    {
      if ($i==$page)
      echo '<a class="headlist" href="statistics.php?sort=view&page='.$i.'">'.$i.'</a>&ensp;';
       else
        echo '<a class="headlist" href="statistics.php?sort=view&page='.$i.'"><u>'.$i.'</u></a>&ensp;';
    }

    if ($next<=$num_pages)
    {
     echo '&ensp;<a href="statistics.php?sort=view&page='.$next.'" title="Go To Next Page">';
     echo '<img src="siteicons/arrow_right.png" border="0" align="right" alt="arrow right icon"/></a>';
    }

    echo '</td></tr>';
   }

   echo '</table>';

  }
   else
    {


     //Algorithm For Page Indexing
 
     $m_total=mysql_query("SELECT * FROM Views ORDER BY Type ASC,Name ASC");
     $num_total=mysql_num_rows($m_total);
     $num_pages=$num_total/30;
     $add=$num_total%30;

     if ($add!=0)
     $num_pages++;

     //Index Pages

     $page=$_GET[page];
     if ($_GET[page]=="")
     $page=1;
     $start=$page*30 - 30;

     $data=mysql_query("SELECT * FROM Views ORDER BY Type ASC,Name ASC LIMIT $start,30");

     echo '<tr style="height:30px;"><td class="headlist" width="100"><a class="headlist" href="statistics.php" title="Sort By Page Type">Page Type:</a></td>';
     echo '<td class="headlist" width="250"><a class="headlist" href="statistics.php?sort=name" title="Sort By Page Name">Page Name:</a></td>';
     echo '<td class="headlist" width="250"><a class="headlist" href="statistics.php?sort=url" title="Sort By Page Url">Page URL:</a></td>';
     echo '<td class="headlist" width="100"><a class="headlist" href="statistics.php?sort=view" title="Sort By Number Of Views">Views:</a></td></tr>';

     while ($row=mysql_fetch_array($data))
     {
      echo '<tr class="list" style="height:20px;">';
      echo '<td class="list">'.$row[Type].'</td><td class="list">'.$row[Name].'</td>';
      echo '<td class="list">'.$row[Url].'</td><td class="list">'.$row[Number].'</td></tr>';
     }

    //Print Indexed Page Links

    if ($num_total>30)
    {
    $prev=$page-1;
    $next=$page+1;
    echo '<td align="center" style="color:#ffffff;font-size:8pt;background-color:#3399FF;border-width:1px;border-bottom-style:dotted;border-right-style:dotted;border-color:#3399FF;height:30px;" colspan="4">';

    if ($page>1)
    {
    echo '<a href="statistics.php?page='.$prev.'" title="Go To Previous Page">';
    echo '<img src="siteicons/arrow_left.png" align="left" border="0" alt="arrow left icon"/></a>&ensp;';
    }

   for ($i==0;$i<=$num_pages;$i++)
   {
    if ($i==$page)
    echo '<a class="headlist" href="statistics.php?page='.$i.'">'.$i.'</a>&ensp;';
    else
    echo '<a class="headlist" href="statistics.php?page='.$i.'"><u>'.$i.'</u></a>&ensp;';
   }

   if ($next<=$num_pages)
   {
   echo '&ensp;<a href="statistics.php?page='.$next.'" title="Go To Next Page">';
   echo '<img src="siteicons/arrow_right.png" border="0" align="right" alt="arrow right icon"/></a>';
   }

   echo '</td></tr>';
   }
  
   echo '</table>';

   }

mysql_close($connect);

?>

</div>

</td></tr></table>

<table style="color:#272727;font-family:'Helvetica';font-size:8pt;border-width:1px;border-style:solid;border-top-style:none;border-color:#000000;width:950px;height:30px;" align="center" cellspacing="0" cellpadding="5"><tr><td align="center">
Pointter is a trademark of <a href="http://www.pangramsoft.com" title="PangramSoft">PangramSoft.</a> Copyright © 2011 PangramSoft
</td></tr></table>
</body>
</html>
Return current item: Pointter PHP CMS