Файл: manager1/generator2.php
Строк: 84
<?php
define('_IN_JOHNCMS', 1);
$textl = 'Менеджер';
require_once ("../incfiles/core.php");
require_once ("../incfiles/head.php");
require_once ("../incfiles/regglobals.php");
echo'<b><center>*Football MANAGER*</center></b><br/>';
if ($datauser['name'])
{
$arr=file(BASEDIR."manager3/$d/$f.dat");
$arr2=array();
for ($i=0;$i<count($arr);$i++)
{
$ex=explode("|",$arr[$i]);
$ex[2]=(int)$ex[2]; $ex[3]=(int)$ex[3]; $ex[4]=(int)$ex[4]; $ex[5]=(int)$ex[5]; $ex[6]=(int)$ex[6]; $ex[7]=(int)$ex[7]; $ex[8]=(int)$ex[8];
if ($ex[2]<=1000000)
{
$ex[3]=rand(60,73); $ex[4]=rand(60,73); $ex[5]=rand(60,73); $ex[6]=rand(60,73); $ex[7]=rand(60,73); $ex[8]=rand(60,73);
$arr2[]=$ex[0].'|'.$ex[1].'|'.$ex[2].'|'.$ex[3].'|'.$ex[4].'|'.$ex[5].'|'.$ex[6].'|'.$ex[7].'|'.$ex[8].'|';
}
if ($ex[2]==1500000)
{
$ex[3]=rand(65,73); $ex[4]=rand(65,73); $ex[5]=rand(65,73); $ex[6]=rand(65,73); $ex[7]=rand(65,73); $ex[8]=rand(65,73);
$arr2[]=$ex[0].'|'.$ex[1].'|'.$ex[2].'|'.$ex[3].'|'.$ex[4].'|'.$ex[5].'|'.$ex[6].'|'.$ex[7].'|'.$ex[8].'|';
}
if ($ex[2]==2000000 || $ex[2]==2500000 || $ex[2]==3000000 || $ex[2]==3500000)
{
$ex[3]=rand(68,74); $ex[4]=rand(68,74); $ex[5]=rand(68,74); $ex[6]=rand(68,74); $ex[7]=rand(68,74); $ex[8]=rand(68,74);
$arr2[]=$ex[0].'|'.$ex[1].'|'.$ex[2].'|'.$ex[3].'|'.$ex[4].'|'.$ex[5].'|'.$ex[6].'|'.$ex[7].'|'.$ex[8].'|';
}
if ($ex[2]==4000000 || $ex[2]==4500000 || $ex[2]==5000000 || $ex[2]==5500000)
{
$ex[3]=rand(70,78); $ex[4]=rand(70,78); $ex[5]=rand(70,78); $ex[6]=rand(70,78); $ex[7]=rand(70,78); $ex[8]=rand(70,78);
$arr2[]=$ex[0].'|'.$ex[1].'|'.$ex[2].'|'.$ex[3].'|'.$ex[4].'|'.$ex[5].'|'.$ex[6].'|'.$ex[7].'|'.$ex[8].'|';
}
if ($ex[2]==6000000 || $ex[2]==6500000 || $ex[2]==7000000 || $ex[2]==7500000)
{
$ex[3]=rand(72,80); $ex[4]=rand(72,80); $ex[5]=rand(72,80); $ex[6]=rand(72,80); $ex[7]=rand(72,80); $ex[8]=rand(72,80);
$arr2[]=$ex[0].'|'.$ex[1].'|'.$ex[2].'|'.$ex[3].'|'.$ex[4].'|'.$ex[5].'|'.$ex[6].'|'.$ex[7].'|'.$ex[8].'|';
}
if ($ex[2]==8000000 || $ex[2]==8500000 || $ex[2]==9000000 || $ex[2]==9500000)
{
$ex[3]=rand(75,83); $ex[4]=rand(75,83); $ex[5]=rand(75,83); $ex[6]=rand(75,83); $ex[7]=rand(75,83); $ex[8]=rand(75,83);
$arr2[]=$ex[0].'|'.$ex[1].'|'.$ex[2].'|'.$ex[3].'|'.$ex[4].'|'.$ex[5].'|'.$ex[6].'|'.$ex[7].'|'.$ex[8].'|';
}
if ($ex[2]==10000000 || $ex[2]==11000000 || $ex[2]==12000000 || $ex[2]==13000000 || $ex[2]==14000000 || $ex[2]==15000000 || $ex[2]==16000000 || $ex[2]==17000000 || $ex[2]==18000000 || $ex[2]==19000000)
{
$ex[3]=rand(78,90); $ex[4]=rand(78,90); $ex[5]=rand(78,90); $ex[6]=rand(78,90); $ex[7]=rand(78,90); $ex[8]=rand(78,90);
$arr2[]=$ex[0].'|'.$ex[1].'|'.$ex[2].'|'.$ex[3].'|'.$ex[4].'|'.$ex[5].'|'.$ex[6].'|'.$ex[7].'|'.$ex[8].'|';
}
if ($ex[2]>=20000000 && $ex[2]<35000000)
{
$ex[3]=rand(85,95); $ex[4]=rand(85,95); $ex[5]=rand(85,95); $ex[6]=rand(85,95); $ex[7]=rand(85,95); $ex[8]=rand(85,95);
$arr2[]=$ex[0].'|'.$ex[1].'|'.$ex[2].'|'.$ex[3].'|'.$ex[4].'|'.$ex[5].'|'.$ex[6].'|'.$ex[7].'|'.$ex[8].'|';
}
if ($ex[2]>=35000000)
{
$ex[3]=rand(90,98); $ex[4]=rand(90,98); $ex[5]=rand(90,98); $ex[6]=rand(90,98); $ex[7]=rand(90,98); $ex[8]=rand(90,98);
$arr2[]=$ex[0].'|'.$ex[1].'|'.$ex[2].'|'.$ex[3].'|'.$ex[4].'|'.$ex[5].'|'.$ex[6].'|'.$ex[7].'|'.$ex[8].'|';
}
}
print_r($arr2);
$fp=fopen(BASEDIR."manager1/$d/$f.dat","a+");
flock ($fp,LOCK_EX);
ftruncate ($fp,0);
for ($i=0;$i<count($arr2);$i++)
{
fputs($fp,$arr2[$i]."rn");
}
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);
} else {
echo 'Игра доступна только зарегистрированым пользователям';
}
echo'[<a href="main.php?'.SID.'">В панель управления</a>]<br/>';
require_once ("../incfiles/end.php");
?>