[ Index ] |
|
Code source de Cr@wltr@ck 2.2.1 |
1 <?php 2 //---------------------------------------------------------------------- 3 // CrawlTrack 2.2.1 4 //---------------------------------------------------------------------- 5 // Crawler Tracker for website 6 //---------------------------------------------------------------------- 7 // Author: Jean-Denis Brun 8 //---------------------------------------------------------------------- 9 // Website: www.crawltrack.fr 10 //---------------------------------------------------------------------- 11 // That script is distributed under GNU GPL license 12 //---------------------------------------------------------------------- 13 // file: admintime.php 14 //---------------------------------------------------------------------- 15 16 if (!defined('IN_CRAWLT_ADMIN')) 17 { 18 echo"<h1>Hacking attempt !!!!</h1>"; 19 exit(); 20 } 21 22 if($validlogin == 0) 23 { 24 echo"<h1>".$language['time_set_up']."</h1>\n"; 25 26 $hre=Date("H"); 27 $mn=Date("i"); 28 $day=Date("d"); 29 $month=Date("m"); 30 $year=Date("Y"); 31 32 echo "<p>".$language['server_time']." " . date("d/m/Y H:i:s") . "</p>\n"; 33 ?> 34 35 <script language="Javascript"> 36 <!-- 37 function formate2(nombre) { 38 return (nombre < 10) ? "0" + nombre : nombre; 39 } 40 41 Date.prototype.display_date_hour = function() { 42 var ch = formate2(this.getDate()) + "/" + formate2(eval(this.getMonth() + 1)) + "/" + this.getFullYear(); 43 ch += " " + formate2(this.getHours()) + ":" + formate2(this.getMinutes()) + ":" + formate2(this.getSeconds()); 44 return ch; 45 } 46 47 var localtime = new Date(); 48 var hre=localtime.getHours(); 49 var hreserv=<?php echo $hre; ?>; 50 var dayserv=<?php echo $day; ?>; 51 var monthserv=<?php echo $month; ?>; 52 var anserv=<?php echo $year; ?>; 53 var mn=localtime.getMinutes(); 54 var day=localtime.getDate(); 55 var month=localtime.getMonth()+1; 56 var an=localtime.getFullYear(); 57 58 59 60 if (mn >50 && <?php echo $mn; ?><10) 61 { 62 hre=hre+1 63 } 64 if(hre==24) 65 { 66 hre=0; 67 day=day+1; 68 } 69 if(day==32) 70 { 71 day=1; 72 month=month+1; 73 } 74 if(day==31 && (month==04 || month==06 || month==09 || month==11)) 75 { 76 day=1; 77 month=month+1; 78 } 79 if(day==29 && month==02 && an % 4 != 0) 80 { 81 day=1; 82 month=month+1; 83 } 84 if(day==30 && month==02 && an % 4 == 0) 85 { 86 day=1; 87 month=month+1; 88 } 89 90 if(month==13) 91 { 92 month=1; 93 } 94 95 if (<?php echo $mn; ?> >50 && mn<10) 96 { 97 hreserv=hreserv+1 98 } 99 if(hreserv==24) 100 { 101 hreserv=0; 102 dayserv=dayserv+1; 103 } 104 if(dayserv==32) 105 { 106 dayserv=1; 107 monthserv=monthserv+1; 108 } 109 if(dayserv==31 && (monthserv==04 || monthserv==06 || monthserv==09 || monthserv==11)) 110 { 111 dayserv=1; 112 monthserv=monthserv+1; 113 } 114 if(dayserv==29 && monthserv==02 && an % 4 != 0) 115 { 116 dayserv=1; 117 monthserv=monthserv+1; 118 } 119 if(dayserv==30 && monthserv==02 && an % 4 == 0) 120 { 121 dayserv=1; 122 monthserv=monthserv+1; 123 } 124 if(monthserv==13) 125 { 126 monthserv=1; 127 } 128 129 130 131 if ( day == dayserv) 132 { 133 var diffh = Math.round(hreserv-hre); 134 } 135 if( day > dayserv && month == monthserv) 136 { 137 var diffh = Math.round(hreserv-24-hre); 138 } 139 if ( day < dayserv && month == monthserv) 140 { 141 var diffh = Math.round(hreserv-hre+24); 142 } 143 if ( month > monthserv) 144 { 145 var diffh = Math.round(hreserv-24-hre); 146 } 147 if ( month < monthserv && month !=1) 148 { 149 var diffh = Math.round(hreserv-hre+24); 150 } 151 if ( month < monthserv && month ==1) 152 { 153 var diffh = Math.round(hreserv-24-hre); 154 } 155 156 157 document.write("<p><?php echo $language['local_time']; ?> " + localtime.display_date_hour() + "</p>"); 158 document.write("<p><?php echo $language['time_difference']; ?> " + diffh + "</p>"); 159 160 <?php 161 if ($times == 0) 162 { 163 ?> 164 document.write("<h5><?php echo $language['time_server']; ?></h5>"); 165 document.write("<h2><a href='index.php?decal=" + diffh + "&navig=6&validform=18&validlogin=1'><?php echo$language['yes']; ?></a> <a href='index.php?navig=6'><?php echo$language['no']; ?></a></h2>"); 166 <?php 167 } 168 else 169 { 170 ?> 171 document.write("<h5><?php echo $language['time_local']; ?></h5>"); 172 document.write("<h2><a href='index.php?decal=" + diffh + "&navig=6&validform=18&validlogin=2'><?php echo$language['yes']; ?></a> <a href='index.php?navig=6'><?php echo$language['no']; ?></a></h2>"); 173 <?php 174 } 175 ?> 176 <!-- 177 178 </script> 179 <noscript> 180 <?php echo"<h1> ".$language['need_javascript']." </h1>"; ?> 181 </noscript> 182 183 <?php 184 185 } 186 elseif ($validlogin == 1) 187 { 188 $decal= (int)$_GET['decal']; 189 190 //update the crawlt_config_table 191 192 //database connection 193 $connexion = mysql_connect($crawlthost,$crawltuser,$crawltpassword) or die("MySQL connection to database problem"); 194 $selection = mysql_select_db($crawltdb) or die("MySQL database selection problem"); 195 196 $sqltime ="UPDATE crawlt_config SET timeshift='".sql_quote($decal)."'"; 197 198 $requetetime = mysql_query($sqltime, $connexion) or die("MySQL query error"); 199 200 201 //emptied the cache table 202 $sqlcache = "TRUNCATE TABLE crawlt_cache"; 203 $requetecache = mysql_query($sqlcache, $connexion) or die("MySQL query error"); 204 205 206 echo"<h1>".$language['time_set_up']."</h1>\n"; 207 208 echo"<p>".$language['decal_ok']."</p><br>\n"; 209 } 210 elseif ($validlogin == 2) 211 { 212 213 //update the crawlt_config_table 214 215 //database connection 216 $connexion = mysql_connect($crawlthost,$crawltuser,$crawltpassword) or die("MySQL connection to database problem"); 217 $selection = mysql_select_db($crawltdb) or die("MySQL database selection problem"); 218 219 $sqltime2 ="UPDATE crawlt_config SET timeshift='0'"; 220 221 $requetetime2 = mysql_query($sqltime2, $connexion) or die("MySQL query error"); 222 223 //emptied the cache table 224 $sqlcache = "TRUNCATE TABLE crawlt_cache"; 225 $requetecache = mysql_query($sqlcache, $connexion) or die("MySQL query error"); 226 227 228 echo"<h1>".$language['time_set_up']."</h1>\n"; 229 230 echo"<p>".$language['nodecal_ok']."</p><br>\n"; 231 } 232 233 234 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Sep 6 14:14:11 2007 | par Balluche grâce à PHPXref 0.7 |