PX : code

Hyip monitor page code by Wall Xu
Download this code


<?php
/***************************************************************************
 *                                pg_hyip_all.php
 *                            -------------------
 *   begin                : Sunday, jan 1, 2006
 *   copyright            : (C) 2001 The ShowHyip Group
 *   email                : root@checkouthyip.com
 *
 *   $Id: pg_hyip_all.php,v 0.0.0.1 2005/10/31 07:31:06 acydburn Exp $
 *
 ***************************************************************************/
/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/
echo '
<HTML><HEAD><TITLE>hyip monitors example</TITLE></HEAD>
<STYLE type=text/css>
TD.hatitle {FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 14px; FONT-FAMILY: Verdana;}
</STYLE><BODY>
'
;

define("dc_ha_count","dcount");
define("dc_ha_id","did");
define("dc_ha_name","dname");
define("dc_ha_status","dstatus");
define("dc_ha_url","durl");
define("dc_ha_arate","darate");
define("dc_ha_urate","durate");
define("dc_ha_adate","dadate");
define("dc_ha_udate","dudate");
define("dc_ha_infocount","dinfocount");
define("dc_ha_kw1","dkw1");
define("dc_ha_kw2","dkw2");
define("dc_ha_kw3","dkw3");
define("dc_ha_kw4","dkw4");
define("dc_ha_kw5","dkw5");
define("dc_ha_value","dvalue");
define("dc_ha_site","dsite");

define("dc_ha_desc","ddesc");

define("d_ha_table_cfg","ha_cfg");
define("d_ha_table_all","ha_all");

define("d_ha_cfg_count","dcfg_count");
define("d_ha_cfg_utime","dcfg_utime");
if (
1) {$hyip_mysql_host "localhost";  $hyip_mysql_user "root";      $hyip_mysql_pwd "";          $hyip_mysql_db "xv6692235";}
class 
CPHPMysql{
  var 
$link,$select;
  function 
CPHPMysql(){$this->link 0;$this->select 0;$this->Connect();$this->DbSelect();}
  function 
Connect() {
    if (
$this->link) { return FALSE;}
    global 
$hyip_mysql_host,$hyip_mysql_user,$hyip_mysql_pwd;
    
$this->link mysql_connect($hyip_mysql_host$hyip_mysql_user$hyip_mysql_pwd);
    if (!
$this->link){die('Could not connect: '$hyip_mysql_host mysql_error());return TRUE;}
    return 
FALSE;
  }
  function 
DbSelect(){
    if (
$this->select){return FALSE;}
    global 
$hyip_mysql_db;
    
$this->select mysql_select_db($hyip_mysql_db$this->link);
    if (
$this->select){return FALSE;}
    else {
      
$sql "CREATE DATABASE $hyip_mysql_db";
      if (
mysql_query($sql$this->link)){
         
$this->select mysql_select_db($hyip_mysql_db$this->link);
         if (
$this->select){return FALSE;}
         else {return 
TRUE;}
      }
      else {return 
TRUE;}
    }
  }
  function 
DbQuery($sql){
    
$resource mysql_query($sql$this->link);
    if (
0){echo "SQL:$sql<br>";if ($resource) {echo "DbQuery successfully<br>\n";} else {echo 'DbQuery:',mysql_error()."<br>\n";}}
    return 
$resource;
  }
}
$g_mysql = new CPHPMysql();

function 
HaFavCreate(){
  global 
$g_mysql;
  
$test sprintf("select * from %s"d_fav_table);
  
$resource $g_mysql->DbQuery($test);
  if (!
$resource){
    
$sql sprintf("CREATE TABLE %s (%s INTEGER NOT NULL AUTO_INCREMENT UNIQUE PRIMARY KEY, %s VARCHAR(32), %s VARCHAR(64), %s INT ZEROFILL)",
      
d_fav_table"id"d_fav_userd_fav_hyipnamed_fav_adate);
    
$g_mysql->DbQuery($sql);
  }
}
function 
HaFavAdd($user$hyipname){
  global 
$g_mysql;
  
$test "select * from ".d_fav_table." where ".d_fav_user."=\"".$user."\" and ".d_fav_hyipname."=\"".$hyipname."\"";
  
$resource $g_mysql->DbQuery($test);
  if (
$resource){$row mysql_fetch_array($resource);if ($row){return 0;};}else{HaFavCreate();}
  
$sql sprintf("INSERT INTO %s(%s,%s,%s) VALUES( \"%s\",\"%s\", %d)",
    
d_fav_table,d_fav_user,d_fav_hyipname,d_fav_adate,$user,$hyipname,time());
  
$g_mysql->DbQuery($sql);
}
//HaAllCountSet();
$sql sprintf("select * from %s"d_ha_table_cfg);
$res $g_mysql->DbQuery($sql);
if (
$res){
  while(
$row mysql_fetch_array($res)){
  if (
$row[dc_ha_name] == d_ha_cfg_count)  $ha_all_count intval($row[dc_ha_value]);
  if (
$row[dc_ha_name] == d_ha_cfg_utime)  $ha_all_utime $row[dc_ha_value];
  }
}
$cur_page 0;          if (isset($_GET['pg']))   {$cur_page intval($_GET['pg']); }
$ha_kw "";            if (isset($_GET["kw"]))   {$ha_kw $_GET["kw"];  }
$ha_parm dc_ha_urate; if (isset($_GET["parm"])) {$ha_parm $_GET["parm"]; }
function 
HaAllShow($start 0){
  global 
$g_mysql,$ha_all_count,$ha_parm,$ha_kw;
  
$page_name_fav="pg_hyip_all.php?parm=$ha_parm&kw=$ha_kw&pg=$start";
  if (
$ha_parm != dc_ha_name){$test sprintf("select * from %s ORDER BY %s DESC "d_ha_table_all$ha_parm);}
  else{
$test sprintf("select * from %s ORDER BY %s "d_ha_table_all$ha_parm);}
  if (
$start >= 0){$test .=  " limit " $start ",10";}
  
$resource $g_mysql->DbQuery($test);
  echo 
"<table cellspacing=3 cellpadding=3><tr>";
  if (
$resource){
    while (
$row mysql_fetch_array($resource)){
      
$ps="Paid";
      if (
$row[dc_ha_status] == 4$ps="Paid";
      if (
$row[dc_ha_status] == 3$ps="Waiting";
      if (
$row[dc_ha_status] == 2$ps="Problem";
      if (
$row[dc_ha_status] == 1$ps="Not Paid";
      echo 
"<tr><td class=hatitle>""<a href=\""$row[dc_ha_url], "\" target=_blank><b>"$row[dc_ha_name], "</b></a></td>";
      echo 
"<tr><td>worst status:<font color=#ff0000>",$ps,"</font>,max website rate:<font color=#ff0000>",intval($row[dc_ha_arate]),"%</font>,max user rate:<font color=#ff0000>",intval($row[dc_ha_urate]),"%</font></td>";
      echo 
"<tr><td>",base64_decode($row[dc_ha_desc]),"</td>";
      echo 
"<tr><td><br><td>";
    }
  }
  echo 
"</tr></table>";
}
function 
HaAllSearch($start 0){
  global 
$g_mysql,$ha_all_count,$ha_parm,$ha_kw;
  
$page_name_fav="pg_hyip_all.php?parm=$ha_parm&kw=$ha_kw&pg=$start";
  
$sep " \t+-_";
  
$ok1 strtok($ha_kw$sep);if (!$ok1) {return;}
  
$ok2 strtok($sep); $ok3 strtok($sep); $ok4 strtok($sep); $ok5 strtok($sep);
  
$sql "select * from ".d_ha_table_all;
  
$sql .= " where "        .dc_ha_kw1."=\"".$ok1."\" or ".dc_ha_kw2."=\"".$ok1."\" or ".dc_ha_kw3."=\"".$ok1."\" or ".dc_ha_kw4."=\"".$ok1."\" or ".dc_ha_kw5."=\"".$ok1."\"";
  if (
$ok2){ $sql .= " or ".dc_ha_kw1."=\"".$ok2."\" or ".dc_ha_kw2."=\"".$ok2."\" or ".dc_ha_kw3."=\"".$ok2."\" or ".dc_ha_kw4."=\"".$ok2."\" or ".dc_ha_kw5."=\"".$ok2."\"";}
  if (
$ok3){ $sql .= " or ".dc_ha_kw1."=\"".$ok3."\" or ".dc_ha_kw2."=\"".$ok3."\" or ".dc_ha_kw3."=\"".$ok3."\" or ".dc_ha_kw4."=\"".$ok3."\" or ".dc_ha_kw5."=\"".$ok3."\"";}
  if (
$ok4){ $sql .= " or ".dc_ha_kw1."=\"".$ok4."\" or ".dc_ha_kw2."=\"".$ok4."\" or ".dc_ha_kw3."=\"".$ok4."\" or ".dc_ha_kw4."=\"".$ok4."\" or ".dc_ha_kw5."=\"".$ok4."\"";}
  if (
$ok5){ $sql .= " or ".dc_ha_kw1."=\"".$ok5."\" or ".dc_ha_kw2."=\"".$ok5."\" or ".dc_ha_kw3."=\"".$ok5."\" or ".dc_ha_kw4."=\"".$ok5."\" or ".dc_ha_kw5."=\"".$ok5."\"";}
  if (
$ha_parm != dc_ha_name){$sql .= " ORDER BY ".$ha_parm." DESC";}else{$sql .= " ORDER BY ".$ha_parm;}
  
$res $g_mysql->DbQuery($sql);
  echo 
"<table><tr>";
  
$count 0;
  if (
$res){
    
$ha_all_count mysql_num_rows($res);
    while (
$row mysql_fetch_array($res)){
      if (
$count >= $start  && $count  <  $start 10){
        if (
$row[dc_ha_status] == 4$ps="Paid";
        if (
$row[dc_ha_status] == 3$ps="Waiting";
        if (
$row[dc_ha_status] == 2$ps="Problem";
        if (
$row[dc_ha_status] == 1$ps="Not Paid";
        echo 
"<tr><td class=hatitle>""<a href=\""$row[dc_ha_url], "\" target=_blank><b>"$row[dc_ha_name], "</b></a></td>";
        echo 
"<tr><td>worst status:<font color=#ff0000>",$ps,"</font>,max website rate:<font color=#ff0000>",intval($row[dc_ha_arate]),"%</font>,max user rate:<font color=#ff0000>",intval($row[dc_ha_urate]),"%</font></td>";
        echo 
"<tr><td>",base64_decode($row[dc_ha_desc]),"</td>";
        echo 
"<tr><td><br><td>";
      }
      
$count ++;
    }
    if (
$count == 0) echo "<tr><td>Not find.</td>";
  }
  echo 
"</tr></table>";
}
function 
ShowIndex($cur_page 0){
   global 
$ha_all_count,$ha_parm,$ha_kw;
   
$page_name="pg_hyip_all.php?parm=$ha_parm&kw=$ha_kw";
   if (
$ha_all_count 10) {$pages intval($ha_all_count 10)+1;} else {$pages intval($ha_all_count 10);}
   if (
$cur_page 5$start_page $cur_page 5;  else $start_page 0;
   
$stop_page $start_page 10;
   if (
$stop_page $pages) {$stop_page $pages$start_page $stop_page 10; if ($start_page 0) {$start_page 0;}}
   echo 
"<table><tr><td>Total $pages pages.</td><td>";
   for (
$i $start_page$i $stop_page$i ++){
     if (
$i == $cur_page){echo "<a href=\"",$page_name,"&pg=$i\"><font color=#ff0000>",$i+1,"<font></a>&nbsp;";}
     else {echo 
"<a href=\"",$page_name,"&pg=$i\">",$i+1,"</a>&nbsp;";}
   }
   echo 
"</td>";
   if (
$cur_page 0){echo "<td><a href=\"",$page_name,"&pg=",$cur_page 1,"\">prev</a>&nbsp;</td>";}
   if (
$cur_page $pages 1){echo "<td><a href=\"",$page_name,"&pg=",$cur_page 1,"\">next</a>&nbsp;</td>";}
   echo 
"<td><a href=\"",$page_name,"&pg=",0,"\">head</a>&nbsp;</td>";
   echo 
"<td><a href=\"",$page_name,"&pg=",$pages-1,"\">tail</a>&nbsp;</td>";
   echo 
"<td><a href=\"",$page_name,"&pg=-1\">all</a></td>";
   echo 
"</tr></table>";
}
echo 
'<TABLE bgcolor=#ffffff width=100% align=center border=0 cellspacing="0" cellpadding="0"><TBODY><TR><TD vAlign=top align=left width=100%>';
echo 
'<table width=100%>
      <tr><td><form method="PUT" action="pg_hyip_all.php"><input type=hidden value="'
,$ha_kw,'" name=kw>List By:<select size="1" name="parm">';
if (
$ha_parm){
  if (
$ha_parm == dc_ha_name) echo '<option value="',dc_ha_name,'">name</option>';
  if (
$ha_parm == dc_ha_arate) echo '<option value="',dc_ha_arate,'">website rate</option>';
  if (
$ha_parm == dc_ha_urate) echo '<option value="',dc_ha_urate,'">user rate</option>';
  if (
$ha_parm == dc_ha_infocount) echo '<option value="',dc_ha_infocount,'">enterprise</option>';
  if (
$ha_parm == dc_ha_status) echo '<option value="',dc_ha_status,'">pay status</option>';
}
echo 
'
<option value="'
,dc_ha_name,'">name</option><option value="',dc_ha_arate,'">website rate</option>
<option value="'
,dc_ha_urate,'">user rate</option><option value="',dc_ha_infocount,'">enterprise</option>
<option value="'
,dc_ha_status,'">pay status</option>
</select>&nbsp;<input type="submit" value="List" name="list">
</form></td>
<td><form method="PUT" action="pg_hyip_all.php"><input type=hidden value="'
,$ha_parm'" name=parm>Find:<input type="text" name="kw" size="32" value="',$ha_kw,'">&nbsp;<input type="submit" value="Go" name="s"></form>
</td></tr></table>'
;
if (
$ha_kw){HaAllSearch($cur_page*10); ShowIndex($cur_page);}else{ShowIndex($cur_page);HaAllShow($cur_page*10);ShowIndex($cur_page);}
echo 
'</TD></TR></TBODY></TABLE>',"\n";
echo 
'</BODY></HTML>';
?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.