View file sistem/cfg_game.dat

File size: 951B
<?php
if(!file_exists("../data/statstik/akcii.dat"))
{
   $kod = '0<||>99999999999999999999999999999<||>';
   $file = fopen("../data/statstik/akcii.dat", "w+");
   flock ($file,LOCK_EX);
   fputs($file,$kod);
   flock ($file,LOCK_UN);
   fclose($file);
   @chmod("../data/statstik/akcii.dat", 0666);
}
if($file = @file("../data/statstik/akcii.dat"))
{
   $file = explode("<||>",$file[0]);
   
   $nast_time = time();
   $time_izm = $file[0];
   $cena_za_pokupku = $file[1];
   if($nast_time > $time_izm)
   {
      $time_izm = $nast_time + 600;
      $cena_za_pokupku = rand(1000,1100);
      $kod = $time_izm.'<||>'.$cena_za_pokupku.'<||>';
      $file = fopen("../data/statstik/akcii.dat", "w+");
      flock ($file,LOCK_EX);
      fputs($file,$kod);
      flock ($file,LOCK_UN);
      fclose($file);
      @chmod("../data/statstik/akcii.dat", 0666);
   }
}else{ $cena_za_pokupku = "9999999999999999999999999999"; }
?>