Location: PHPKode > projects > Web-Analiser > view/view.php
<?php

require("./set_cokie.php");

 if(isset($_GET['afid']))
   {
      $nomber_id=trim($_GET['afid']);
          SetCookie ("afid",$nomber_id,date('U')+7000000,"/");
   }
//////////////////////////////////////////////////////////////////////////
//  Script:        view.php	        					                //
//									                                    //
//  Source:	http://www.web-script.com			                        //
//			                                                            //
//	YOU CANNOT EDIT OR THAT SOMETHING TO CHANGE IN THE GIVEN SCRIPT		//
//                                                                      //
//  Copyright:	(c) 2002-2004 Web-Script Company. All rights reserved.  //
//                                      				                //
//////////////////////////////////////////////////////////////////////////



echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Web-Analiser PRO-Demo(Lite)</title>
	<LINK href="main.css" type=text/css rel=stylesheet>
</head>
<body>';


$micr1=microtime();
$dat1=date("U");

require("../modules/class_view.php");	

require("../modules/const.php");

$db=new base_view();

$db->password=100;
if ($auntif==1) $db->password=1;

$db->ba_init ();

if ( $db->password==1)
{
$dat5=$dat1+($db->time_zone*3600);


echo' <table  width="780"
cellSpacing=2 cellPadding=3 border=0>

<tr valign="top" ><td colspan="3" height="30">

<table border="0" cellpadding="0" cellspacing="0"  width="100%">
      <tr>
	  
       <td rowspan="3" valign="bottom">&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://web-script.com"><img src="../images/logo/logo36.gif" alt="http://web-script.com" border=0></a></td>
   

       <td class=version nowrap valign="bottom" >'.$db->vr_version.' 0.72 &nbsp;</td>
	   <td width="100%" height="30"  valign="bottom" align="center"   ><span  class="copy"> '; echo date('H:i, j F Y  ',$dat5); echo '</span></td>
   
       <td rowspan="3" valign="bottom" align="right" >
        <table border="0" cellpadding="0" cellspacing="0">
         <tr>';
	 


echo'<td valign=bottom width="16"><img border=0 src=../images/menu/menu3.gif width=8 height=17></td><td nowrap class=tablink bgcolor="47487D" valign=bottom><span class="menu2">'.$db->vr_menu_adm1.'</span></td>

<td valign=bottom width="16"><img border=0 src=../images/menu/menu2.gif width=10 height=17></td><td nowrap bgcolor="47487D"  valign=bottom><a class=tablink href=../view/htmcode.php> '.$db->vr_menu_adm2.' </a></td>


<td valign=bottom width="16"><img border=0  src=../images/menu/menu2.gif width=10 height=17></td><td nowrap bgcolor="47487D"  valign=bottom><a class=tablink href=../view/view_par.php >'.$db->vr_menu_adm3.'</td>

<td valign=bottom width="16"><img border=0  src=../images/menu/menu2.gif width=10 height=17></td><td nowrap bgcolor="47487D"  valign=bottom><a class=tablink href="http://www.web-script.com/analiser/contact.php" >'.$db->vr_menu_adm4.'</a></td>
<td valign=bottom width="16"><img border=0  src=../images/menu/menu4.gif width=6 height=17></td>';

echo'
         </tr>
        </table>
       </td>
      </tr>
	  
      <tr>
       <td valign="bottom" colspan="2" ><img src="../images/line21.gif" width=100% height=1></td>
      </tr>

     </table>
	 </td></tr>
<tr valign="top" ><td  height="100"  colspan="3">';

require("../menu_stats/host1.php");
echo'</td></tr>';

$db->file_q();

if ($db->it_table==5)
{

    $db->real_count();    //îïðåäåëåíèå êîëè÷åñòâà ñòðàíèö , îò ÷èñëà ëèíèé
	
    $quere = $db->quere;
	
    $result=$db->analis_var($quere);
	
	
    $db->host_tab($result); //äëÿ ãëàâíîé ñòðàíèöû
	echo '</form>';
	
}


//else require("../struct/no_data.php");

$micr2=microtime();
$dat2=date("U");

if ($dat2>$dat1) {$micr3=1.0-$micr1+$micr2; $dat3=($dat2-$dat1-1);}
else {$dat3=0; $micr3=$micr2-$micr1;}

$generet=abs($dat3+$micr3);

}
elseif ($db->password==2) 
{  
     $error[0]=$error[1]=$error[2]=$error[3]=$error[4]=$error[5]=$error[6]=0;
	   require("../admin/data_valid.php");
	   
       if (isset($_POST['domain'])) $t[0]=$_POST['domain']; else $t[0]="localhost";
	   if (isset($_POST['login_sql'])) {$t[1]=$_POST['login_sql']; } else {$t[1]="";}
	   if (isset($_POST['name'])) $t[2]=$_POST['name'];else $t[2]="";
	   if (isset($_POST['password'])) $t[3]=$_POST['password'];else $t[3]="";
	   if (isset($_POST['passwd2'])) $t[4]=$_POST['passwd2'];else $t[4]="";
	   if (isset($_POST['base'])) $t[5]=$_POST['base']; else $t[5]="";
	   if (isset($_POST['pasw_sql'])) $t[6]=$_POST['pasw_sql']; else $t[6]="";
	   
	   
  if (isset($_POST['domain']) && $_POST['domain']=="") $error[0]=1;
  else $error[0]=0;
  if (isset($_POST['login_sql']) && $_POST['login_sql']=="") $error[1]=1;
  else $error[1]=0;
  if (isset($_POST['name']) && $_POST['name']=="") $error[2]=1;
  else $error[2]=0;
  if (isset($_POST['password']) && $_POST['password']=="") $error[3]=1;
  else $error[3]=0;
  if (isset($_POST['passwd2']) && $_POST['passwd2']=="") $error[4]=1;
  else $error[4]=0;
  if (isset($_POST['base']) && $_POST['base']=="") $error[5]=1;
  else $error[5]=0;
  $error[7]=0;$error[8]=0;$error[9]=0;$error[10]=0;$error[11]=0;$error[12]=0;
  
 
   if (strlen($t[5])>0 && strlen($t[0])>0 && strlen($t[1])>0 && strlen( $t[2])>0 && strlen( $t[3])>0 && strlen($t[4])>0)
	 { 
       
			 if (valid_domain($t[0])) $error[0]=0;
			 else $error[0]=1;
			 if (valid_password($t)) $error[3]=0; // ïðîâåðêà ïàðîëÿ
			 else $error[3]=1;
			 if (valid_name($t[2])) $error[2]=0; // ïðîâåðêà èìåíè
			 else $error[2]=1;
			 if (valid_base($t[5])) $error[5]=0; // ïðîâåðêà èìåíè
			 else $error[5]=1;

	      if ($error[0]==1 || $error[1]==1 || $error[2]==1 || $error[3]==1 || $error[4]==1 || $error[5]==1)
	       require("../admin/admin_new.php");	
		    
	     if (strlen($t[5])>0) 
	       {
		     
	          //çàíåñòè â áàçó äàííûå
			  $db->host=addslashes($t[0]);       
			  $db->user=addslashes($t[2]);
			  $password=addslashes($t[3]);
			  $base=$db->dbase=addslashes($t[5]);
			  $passw_sql=addslashes($t[6]);
			  $login_sql=addslashes($t[1]);
			  $db->connect=0;
			  $base=trim($db->dbase);
              $table=$db->table="p_base";
			   //---------------------------------------------------
		          $mysql =@mysql_connect($db->host,$login_sql,$passw_sql);
				  
				  if ($mysql)
				  { 
				  
				     $db->conect=$mysql;
					 $quere1="name char(25) not null, host_serv char(70) not null, host_login char(70) not null, host_pasw char(70) not null, user char(25) not null, passw char(17) not null, tab1 tinyint not null, tab2 tinyint not null, view tinyint not null, graphics tinyint not null, language tinyint not null, nline tinyint not null, display tinyint not null, ref_url tinyint not null, update_script tinyint not null"; 
				     $mysql =@mysql_select_db($db->dbase);
					// echo $mysql;
					
					 if (!$mysql)
					  {
					   
					    $mysql=@mysql_create_db($db->dbase);
					    if($mysql)
		                  {
						 
						    $mysql =@mysql_connect($db->host,$login_sql,$passw_sql);
							$mysqlt=0;
							if ($mysql) {$db->conect=$mysql; $mysqlt =@mysql_select_db($db->dbase);}
							if ($mysqlt) 
							{ 
					          $query = "create table p_base (".$quere1.")";
	                          $result =@mysql_query($query,$db->conect);
						      if ($result) $db->connect=1;
			                }
						  }	
						else $error[9]=1;  
					  }
				      else	
					  { 
	    	             $result =mysql_listtables ($db->dbase);	
                         $i = 0;$prizn=0;
			             if ($result)
			               {
                              while ($i < mysql_num_rows ($result))
                              {
                                $tb_names =mysql_tablename($result, $i);
                                if ($tb_names==$table) $prizn=1;
                                $i++;
                              }   
                              if ($prizn!=1)
                              {
	                            $query = "create table p_base ($quere1)";
	                            $result = @mysql_query($query,$db->conect);
								if ($result) $db->connect=1;
	                          }
							  else {$db->connect=2;}
			              } 
					  }
				  }

			  //---------------------------------------------------
			  $error[11]=0;$error[12]=0;
			  
			    if ($db->connect==1 || $db->connect==2)
				  {
				 
				         $quere="insert into p_base (name,host_serv,host_login,host_pasw,user,passw,tab1,tab2,nline,ref_url,update_script,display) values ('".$db->dbase."','".$db->host."','".$login_sql."','".$passw_sql."','".$db->user."','".$password."',3,3,50,1,5,1)";
			             $result =@mysql_query($quere,$db->conect);
						 
						 if (!$result)  $error[11]==1;
						 else
						 {  
						   
                            $quere="update p_base set display='1'" ;
				            $result = @mysql_query($quere,$db->conect);
							if (!$result)  $error[11]==1;
							else
							{
							     $quere="delete from p_base where  nline>0";
					             $result =@mysql_query($quere,$db->conect);
								 if (!$result) $error[11]==1;
							}
							
						 }
						 
                         $result =@mysql_query("lock tables p_base write",$db->conect);
						  
						 if (!$result) $error[12]==1; else $result =@mysql_query("unlock tables",$db->conect);

						 
				        if ($db->connect==1 && $error[11]==0 &&  $error[12]==0)
					      {
			                $quere="insert into p_base (name,host_serv,host_login,host_pasw,user,passw,tab1,tab2,nline,ref_url,update_script,display) values ('".$db->dbase."','".$db->host."','".$login_sql."','".$passw_sql."','".$db->user."','".$password."',3,3,50,1,5,1)";
			                $result = @mysql_query($quere,$db->conect);
                          }
					    elseif ($error[11]==0 && $error[12]==0)
					      {
					        $quere="delete from p_base where  nline>0";
					        $result = @mysql_query($quere,$db->conect);
					        if ($result)
					         { 
						       $quere="insert into p_base (name,host_serv,host_login,host_pasw,user,passw,tab1,tab2,nline,ref_url,update_script,display) values ('".$db->dbase."','".$db->host."','".$login_sql."','".$passw_sql."','".$db->user."','".$password."',3,3,50,1,5,1)";
			                   $result = @mysql_query($quere,$db->conect);
						 }
				 }		 

			      if ($result &&  $error[11]==0 && $error[12]==0) 
			             {
						    
			                  $str='<? $this->dbase = "'. $base.'"; $this->host="'.$db->host.'"; $this->host_login = "'.$login_sql.'"; $this->host_pasw="'.$passw_sql.'";  ?>';
				              $est=file_exists("../admin/init.php");
							  if (!$est)
							   {
      	                         $fp =@fopen("../admin/init.php", "w+");
								 if ($fp)
								   {
	                                 fputs( $fp,$str);
	                                 fclose($fp);
								   }
								 else $error[8]=1; 
							   }	 
				              $str='<? $dbase = "'. $base.'"; $host="'.$db->host.'"; $user = "'.$login_sql.'"; $password="'.$passw_sql.'";  ?>';
							   
							   
							 $est=file_exists("../admin/init_cokie.php");
							 
							 if (!$est)
							  {   
      	                          $fp = @fopen("../admin/init_cokie.php", "w+");
								  if ($fp)
								    {
	                                  fputs( $fp,$str);
	                                  fclose($fp);
								    }
								  else $error[8]=1;	
							  }	
							  
							 if ($error[8]==0 )
							  {
				                echo "<table width='600'><tr><td class='host'><br>";
				                echo " &nbsp;&nbsp;&nbsp;&nbsp; ".$db->vr_reg_ok1.".<br> &nbsp;&nbsp;&nbsp;&nbsp; ".$db->vr_reg_ok2." &nbsp;&nbsp;<a href='./view.php'>".$db->vr_reg_ok3."</a>";
				                echo "</td></tr></table>";
							  }	
							 else require("../admin/admin_new.php");
	                    }	
				      else {$error[10]=1;require("../admin/admin_new.php");}
				  }		
				 else 
				 {
				   $error[7]=1;require("../admin/admin_new.php");
				 }    
	       } 
     }
  else require("../admin/admin_new.php");
}   
else {require("../admin/admin.php");}
if ($db->password!=2&& $db->password!=100)
{
;
   echo '<tr><td colspan=3 width="100%"><img src="../images/line22.gif" width=100% height=1></td></tr>';
   echo '<tr><td colspan=3 class="time" align="right">&nbsp Copyright (c) 2003-2006 <a  style="color: #13196D" href="http://www.web-script.com/" target="_blank">Web-Script.com</a> &nbsp  All Rights Reserved.</td></tr>';
}
?>

</body>
</html>
Return current item: Web-Analiser