daily pastebin goal
94%
SHARE
TWEET

Untitled

a guest Jun 18th, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. //// GLOBALS /////
  3.  
  4. ///////////////////////////////////
  5. // SQL QUERYS /////////////////////
  6. ///////////////////////////////////
  7.  
  8. $SQL_News_Select = "SELECT * FROM `news` ORDER BY `id` DESC LIMIT 0,10";
  9. $SQL_Rdm_WhatsNew = "SELECT * FROM `whatsNew` ORDER BY `id` DESC LIMIT 0,4";
  10. $SQL_Rdm_OTW = "SELECT * FROM `onTheWay` ORDER BY `id` DESC LIMIT 0,1";
  11. $SQL_Rdm_siteStats_Check = "SELECT * FROM `Unique_Yr` WHERE `ip` = '".$_SERVER['REMOTE_ADDR']."'";
  12. $SQL_Rdm_siteStats = "SELECT * FROM `Unique_Yr`";
  13. $SQL_Rdm_siteStats_Today = "SELECT * FROM `Unique_Yr` WHERE `date` = '".date("d-M-y")."'";
  14. $SQL_Rdm_siteStats_Insert = "INSERT INTO `Unique_Yr` (ip, date) VALUES ('".$_SERVER['REMOTE_ADDR']."','".date("d-M-y")."')";
  15. $SQL_Rdm_sales = "SELECT * FROM `sales` ORDER BY `sold` DESC LIMIT 0,5";
  16. $SQL_Rdm_Testimonials = "SELECT * FROM `testimonials` LIMIT 0,8";
  17. $SQL_PDB_Gather = "SELECT * FROM `prod_priv_gather`";
  18. $SQL_PDB_Leveling = "SELECT * FROM `prod_priv_leveling`";
  19. $SQL_PDB_PVP = "SELECT * FROM `prod_priv_pvp`";
  20. $SQL_PDB_Packs = "SELECT * FROM `prod_priv_packs`";
  21. $SQL_PDB_Admisc = "SELECT * FROM `prod_admisc`";
  22.  
  23.  
  24. //////////////////////////////////
  25. // PAGES /////////////////////////
  26. //////////////////////////////////
  27.  
  28. /// WHATS NEW
  29. MySQLConnect();
  30. MySQLSelDB("reeciebo_siteroot");
  31.  
  32. $query = mysql_query($SQL_Rdm_WhatsNew) or die(mysql_error());
  33. $numRows = mysql_num_rows($query);
  34.  
  35. for ($i=0; $i < $numRows; $i++) {
  36.     $result = "<span class='specialtext'>".mysql_result($query, $i, "content")."</span><br/><span class='contenttext'>".mysql_result($query, $i, "date")."<br/>------------</span><br/>";
  37.     $whatsNew = $whatsNew.$result;
  38. }
  39.  
  40.  
  41. /// TOP SELLERS
  42. MySQLSelDB("reeciebo_customer");
  43.  
  44. $query = mysql_query($SQL_Rdm_sales) or die(mysql_error());
  45. $numRows = mysql_num_rows($query);
  46.  
  47. $counter = 1;
  48. $i = 0;
  49. while ($i < $numRows) {
  50.     $result = "<span class='specialtext' style='text-align: left;'>".$counter.". ".mysql_result($query, $i, "name")."</span><span class='contenttext'> - ".mysql_result($query, $i, "sold")."</span><br/>";
  51.     $topSellers = $topSellers.$result;
  52.     $i++;
  53.     $counter++;
  54. }
  55. /// SITE STATS
  56. MySQLSelDB("reeciebo_sitestats");
  57.  
  58.  
  59. $query = mysql_query($SQL_Rdm_siteStats_Check) or die(mysql_error());
  60. if (mysql_num_rows($query) > 0) {
  61.         $result = mysql_result($query, 0, "visits");
  62.         $result++;
  63.         $SQL_Rdm_siteStats_Update = "UPDATE `Unique_Yr` SET `date` = '".date("d-M-y")."', `visits` = '".$result."' WHERE `ip` = '".$_SERVER['REMOTE_ADDR']."'";
  64.         $query = mysql_query($SQL_Rdm_siteStats_Update) or die(mysql_error());
  65.     }else{
  66.         $query = mysql_query($SQL_Rdm_siteStats_Insert) or die(mysql_error());
  67. }
  68. $query = mysql_query($SQL_Rdm_siteStats);
  69. $totalUnique = mysql_num_rows($query);
  70. $query = mysql_query($SQL_Rdm_siteStats_Today);
  71. $totalToday = mysql_num_rows($query);
  72.  
  73. $siteStats = "<span class='specialtext'>Uniques Today: ".$totalToday."<br/>Total Uniques: ".$totalUnique."</span>";
  74.  
  75. /// ON THE WAY
  76. MySQLSelDB("reeciebo_siteroot");
  77. $query = mysql_query($SQL_Rdm_OTW) or die(mysql_error());
  78. $numRows = mysql_num_rows($query);
  79.  
  80. for ($i=0; $i < $numRows; $i++) {
  81.     $result = mysql_result($query, $i, "content");
  82.     $status = mysql_result($query, $i, "status");
  83.    
  84.     $oTw = "<span class='specialtext'>".$result." <span class='contenttext'>STATUS [".$status."%]</span><br/>";
  85. }
  86.  
  87. /// TESTIMONIALS
  88. $query = mysql_query($SQL_Rdm_Testimonials) or die(mysql_error());
  89. $numRows = mysql_num_rows($query);
  90.  
  91. for ($i=0; $i < $numRows; $i++) {
  92.     $name = mysql_result($query, $i, "name") or die(mysql_error());
  93.     $content = mysql_result($query, $i, "content") or die(mysql_error());
  94.     $content = substr($content, 0, 90)."..' <a href='index.php?p=testimonials'><span class='littletext'>Read More</span></a>";
  95.     $testimonials = "<span class='specialtext'>".$testimonials."'".$content."</span><br/><span class='contenttext'>".$name."</span><br/><br/>";
  96. }
  97. /////// NEWS///////////////
  98. if ($_GET['p'] == "news" || !$_GET['p']) {
  99.     MySQLConnect();
  100.     MySQLSelDB("reeciebo_siteroot");
  101.    
  102.     $query = mysql_query($SQL_News_Select) or die(mysql_error());
  103.     $numRows = mysql_num_rows($query);
  104.    
  105.     for ($i=0; $i < $numRows; $i++) {
  106.         $subject = mysql_result($query, $i, 'subject');
  107.         $author = mysql_result($query, $i, 'author');
  108.         $date = mysql_result($query, $i, 'date');
  109.         $news_content = mysql_result($query, $i, 'contents');
  110.        
  111.         $cont = $cont."<tr><td height='23' colspan='2' bgcolor='#90b7e2'><span class='headertext'>&nbsp;&nbsp;".$subject."</span></td></tr><tr><td bgcolor='#fbfbfb'>&nbsp;</td><td bgcolor='#fbfbfb'><span class='contenttext'>".$news_content."<br/><br/></span></td></tr><tr><td colspan='2' align='right' bgcolor='#fbfbfb'><span class='littletext'>Posted by <u>".$author."</u> on ".$date."&nbsp;<br/><br/></span></td></tr>";
  112.     }
  113.     $pageContents = Table_Create("NEWS", $cont);
  114. }
  115.  
  116. /////////////// NEWS END /////////
  117. /////// PRODUCT DATABASE /////////
  118. if ($_GET['p'] == "pdb") {
  119.     MySQLConnect();
  120.     MySQLSelDB("reeciebo_siteroot");
  121.    
  122.     $query = mysql_query($SQL_PDB_Gather);
  123.     $numRows = mysql_num_rows($query);
  124.     for ($i=0; $i < $numRows; $i++) { // Storing Data from `prod_priv_gather` in $GATHER[$i]['arg']
  125.         $GATHER[$i]['prodname'] = mysql_result($query, $i, "prodname");
  126.         $GATHER[$i]['prodcost'] = mysql_result($query, $i, "prodcost");
  127.         $GATHER[$i]['prodlink'] = mysql_result($query, $i, "prodlink");
  128.         $GATHER[$i]['proddesc'] = mysql_result($query, $i, "proddesc");
  129.         $GATHER[$i]['prodimages'] = mysql_result($query, $i, "prodimages");
  130.     }
  131.  
  132.     $query = mysql_query($SQL_PDB_Leveling);
  133.     $numRows = mysql_num_rows($query);
  134.  
  135.     for ($i=0; $i < $numRows; $i++) { // Storing Data from `prod_priv_leveling` in $LEVELING[$i]['arg']
  136.         $LEVELING[$i]['prodname'] = mysql_result($query, $i, "prodname");
  137.         $LEVELING[$i]['prodcost'] = mysql_result($query, $i, "prodcost");
  138.         $LEVELING[$i]['prodlink'] = mysql_result($query, $i, "prodlink");
  139.         $LEVELING[$i]['proddesc'] = mysql_result($query, $i, "proddesc");
  140.     }
  141.  
  142.     $query = mysql_query($SQL_PDB_PVP);
  143.     $numRows = mysql_num_rows($query);
  144.  
  145.     for ($i=0; $i < $numRows; $i++) { // Storing Data from `prod_priv_pvp` in $PVP[$i]['arg']
  146.         $PVP[$i]['prodname'] = mysql_result($query, $i, "prodname");
  147.         $PVP[$i]['prodcost'] = mysql_result($query, $i, "prodcost");
  148.         $PVP[$i]['prodlink'] = mysql_result($query, $i, "prodlink");
  149.         $PVP[$i]['proddesc'] = mysql_result($query, $i, "proddesc");
  150.     }
  151.    
  152.     $query = mysql_query($SQL_PDB_Packs);
  153.     $numRows = mysql_num_rows($query);
  154.  
  155.     for ($i=0; $i < $numRows; $i++) { // Storing Data from `prod_priv_packs` in $PACKS[$i]['arg']
  156.         $PACKS[$i]['prodname'] = mysql_result($query, $i, "prodname");
  157.         $PACKS[$i]['prodcost'] = mysql_result($query, $i, "prodcost");
  158.         $PACKS[$i]['prodlink'] = mysql_result($query, $i, "prodlink");
  159.         $PACKS[$i]['proddesc'] = mysql_result($query, $i, "proddesc");
  160.     }
  161.    
  162.     // Start Organising the tables.
  163.     /// Gathering Table
  164.  
  165.     $temp = "<tr><td bgcolor='#fbfbfb'><br/>";
  166.     $i = 0;
  167.     $x = 1;
  168.     $temp = $temp."&nbsp;&nbsp;&nbsp;<u>GATHERING</u><br/>";
  169.     while ($GATHER[$i]) {
  170.         $temp = $temp."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$x.". <a href='#".$GATHER[$i]['prodlink']."'>".$GATHER[$i]['prodname']."</a> - ".substr($GATHER[$i]['proddesc'], 0, 60).".. <a href='#".$GATHER[$i]['prodlink']."'><span class='littletext'>Read More</span></a><br/>";
  171.         $i++;
  172.         $x++;
  173.     }
  174.     /// Leveling Table
  175.     $i = 0;
  176.     $x = 1;
  177.     $temp = $temp."<br/>&nbsp;&nbsp;&nbsp;<u>LEVELING</u><br/>";
  178.     if (!$LEVELING[$i]) { $temp = $temp."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No profiles found..<br/>"; }
  179.     while ($LEVELING[$i]) {
  180.         $temp = $temp."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$x.". <a href='#".$LEVELING[$i]['prodlink']."'>".$LEVELING[$i]['prodname']."</a> - ".substr($LEVELING[$i]['proddesc'], 0, 60).".. <a href='#".$LEVELING[$i]['prodlink']."'><span class='littletext'>Read More</span></a><br/>";
  181.         $i++;
  182.         $x++;
  183.     }
  184.     /// PVP Table
  185.     $i = 0;
  186.     $x = 1;
  187.     $temp = $temp."<br/>&nbsp;&nbsp;&nbsp;<u>PVP</u><br/>";
  188.     while ($PVP[$i]) {
  189.         $temp = $temp."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$x.". <a href='#".$PVP[$i]['prodlink']."'>".$PVP[$i]['prodname']."</a> - ".substr($PVP[$i]['proddesc'], 0, 60).".. <a href='#".$PVP[$i]['prodlink']."'><span class='littletext'>Read More</span></a><br/>";
  190.         $i++;
  191.         $x++;
  192.     }
  193.     /// PACKS Table
  194.     $i = 0;
  195.     $x = 1;
  196.     $temp = $temp."<br/>&nbsp;&nbsp;&nbsp;<u>PACKS</u><br/>";
  197.     while ($PACKS[$i]) {
  198.         $temp = $temp."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$x.". <a href='#".$PACKS[$i]['prodlink']."'>".$PACKS[$i]['prodname']."</a> - ".substr($PACKS[$i]['proddesc'], 0, 60).".. <a href='#".$PACKS[$i]['prodlink']."'><span class='littletext'>Read More</span></a><br/>";
  199.         $i++;
  200.         $x++;
  201.     }
  202.     $temp = $temp."<br/></td></tr>";
  203.    
  204.     $jump2 = Table_Create("<span id='top'>PRODUCT JUMP</span>", $temp);
  205.     unset($temp);
  206.    
  207.    
  208.    
  209.     // Generate Tables for each Product
  210.     ///Gathering
  211.     $tableID = 0;
  212.     for ($i=0; is_array($GATHER[$i]); $i++) {
  213.         $temp[$i] = $temp[$i]."<tr><td bgcolor='#f5f5f5'></td><td bgcolor='#f5f5f5'>&nbsp;&nbsp;&nbsp;<span class='specialtext'>Price: €".$GATHER[$i]['prodcost']."</span></td></tr>";
  214.         $temp[$i] = $temp[$i]."<tr><td bgcolor='#fbfbfb'></td><td bgcolor='#fbfbfb'>&nbsp;&nbsp;&nbsp;Images:<p>".$GATHER[$i]['prodimages']."</p></td></tr>";
  215.         $temp[$i] = $temp[$i]."<tr><td bgcolor='#f5f5f5'></td><td bgcolor='#f5f5f5'>&nbsp;&nbsp;&nbsp;Description:<span class='specialtext'><p>".$GATHER[$i]['proddesc']."</p></span></td></tr>";
  216.         $temp[$i] = $temp[$i]."<tr><td bgcolor='#f5f5f5'></td><td bgcolor='#f5f5f5' align='right'>&nbsp;&nbsp;&nbsp;<img src='content/images/buynow.png'/></td></tr>";
  217.         $table[$tableID] = "<p><a href='#top'>Back to TOP</a></p>".Table_Create("<span id='".$GATHER[$i]['prodlink']."'>".strtoupper($GATHER[$i]['prodname'])."</span>", $temp[$i]);
  218.         $tableID++;
  219.     }
  220.     ///Leveling
  221.     for ($i=0; is_array($LEVELING[$i]); $i++) {
  222.         $temp[$i] = $temp[$i]."<tr><td bgcolor='#f5f5f5'></td><td bgcolor='#f5f5f5'>&nbsp;&nbsp;&nbsp;<span class='specialtext'>Price: €".$LEVELING[$i]['prodcost']."</span></td></tr>";
  223.         $temp[$i] = $temp[$i]."<tr><td bgcolor='#fbfbfb'></td><td bgcolor='#fbfbfb'>&nbsp;&nbsp;&nbsp;Images:<p>".$LEVELING[$i]['prodimages']."</p></td></tr>";
  224.         $temp[$i] = $temp[$i]."<tr><td bgcolor='#f5f5f5'></td><td bgcolor='#f5f5f5'>&nbsp;&nbsp;&nbsp;Description:<span class='specialtext'><p>".$LEVELING[$i]['proddesc']."</p></span></td></tr>";
  225.         $temp[$i] = $temp[$i]."<tr><td bgcolor='#f5f5f5'></td><td bgcolor='#f5f5f5' align='right'>&nbsp;&nbsp;&nbsp;<img src='content/images/buynow.png'/></td></tr>";
  226.         $table[$tableID] = "<p><a href='#top'>Back to TOP</a></p>".Table_Create("<span id='".$LEVELING[$i]['prodlink']."'>".strtoupper($LEVELING[$i]['prodname'])."</span>", $temp[$i]);
  227.         $tableID++;
  228.     }
  229.     ///PVP
  230.     unset($temp);
  231.     for ($i=0; is_array($PVP[$i]); $i++) {
  232.         $temp[$i] = $temp[$i]."<tr><td bgcolor='#f5f5f5'></td><td bgcolor='#f5f5f5'>&nbsp;&nbsp;&nbsp;<span class='specialtext'>Price: €".$PVP[$i]['prodcost']."</span></td></tr>";
  233.         $temp[$i] = $temp[$i]."<tr><td bgcolor='#fbfbfb'></td><td bgcolor='#fbfbfb'>&nbsp;&nbsp;&nbsp;Images:<p>".$PVP[$i]['prodimages']."</p></td></tr>";
  234.         $temp[$i] = $temp[$i]."<tr><td bgcolor='#f5f5f5'></td><td bgcolor='#f5f5f5'>&nbsp;&nbsp;&nbsp;Description:<span class='specialtext'><p>".$PVP[$i]['proddesc']."</p></span></td></tr>";
  235.         $temp[$i] = $temp[$i]."<tr><td bgcolor='#f5f5f5'></td><td bgcolor='#f5f5f5' align='right'>&nbsp;&nbsp;&nbsp;<img src='content/images/buynow.png'/></td></tr>";
  236.         $table[$tableID] = "<p><a href='#top'>Back to TOP</a></p>".Table_Create("<span id='".$PVP[$i]['prodlink']."'>".strtoupper($PVP[$i]['prodname'])."</span>", $temp[$i]);
  237.         $tableID++;
  238.     }
  239.    
  240.     foreach ($table as $value) {
  241.         $productTables = $productTables.$value;
  242.     }
  243.     $pageContents = $jump2.$productTables."<br/>Total Tables: ".$tableID;
  244. }
  245.  
  246.  
  247. //////////////////////////////////
  248. // FUNCTIONS /////////////////////
  249. //////////////////////////////////
  250.  
  251. function MySQLConnect() {
  252.     $host = "localhost";
  253.     $user = "removed";
  254.     $pass = "removed";
  255.       $conn = mysql_connect($host, $user, $pass) or die(mysql_error());
  256. }
  257. function MySQLSelDB($db) {
  258.     $seldb = mysql_select_db($db) or die(mysql_error());
  259. }
  260. function Table_Create($pageHeader, $pageBlob) {
  261.         return "<table width='95%' border='0' cellspacing='0' cellpadding='5'><tr><td colspan='2' align='center' height='22' background='images/navextension.jpg'><span class='headertext'>".$pageHeader."</span></td></tr>".$pageBlob."</table>";
  262.  
  263. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top