<?php
require_once("achieved/config.php");
require_once("achieved/db.php");
require_once("achieved/db2.php");

date_default_timezone_set('Africa/Lagos');



	$query=$conn->query("select * from settings  ORDER BY id DESC LIMIT 1");
			while($row=$query->fetch()){

				$SFEE=$row['SFEE'];
				$buy_rate=$row['buy_rate'];
					$btc_rate=$row['btc_rate'];
						$timer=$row['timer'];
?>
<?php }?>






<?php
//require_once("db.php");
//require_once("functions.php");

require_once("achieved/db.php");
require_once("achieved/functions.php");
date_default_timezone_set('Africa/Lagos'); 
$weekday = date('w');
$sqll = mysql_query("SELECT * FROM logins WHERE pint >0 ");

$hrand=rand (0,9);

$curt=date("H:i:s");
$opent=date("00:00:00");
$closet=date("23:00:00");

if($weekday =7){

if($curt >= $opent && $curt < $closet){
    
    while($numrow=mysql_fetch_assoc($sqll)){
        
        $logid=$numrow['id'];
        
        $asset= rand(1,10);
        
        if($asset==1){
            $fd='77';
            $ld='79';
            $dd='0';
        }elseif($asset==2){
            $fd='86';
            $ld='88';
            $dd='0';
        }elseif($asset==3){
            $fd='58';
            $ld='60';
            $dd='1';
        }elseif($asset==4){
            $fd='50';
            $ld='53';
            $dd='132';
        }elseif($asset==5){
            $fd='23';
            $ld='25';
            $dd='1';
        }elseif($asset==6){
            $fd='02';
            $ld='04';
            $dd='152';
        }elseif($asset==7){
            $fd='41';
            $ld='43';
            $dd='1';
        }elseif($asset==8){
            $fd='25';
            $ld='27';
            $dd='1';
        }elseif($asset==9){
            $fd='95';
            $ld='97';
            $dd='0';
        }elseif($asset==10){
            $fd='20';
            $ld='22';
            $dd='107';
        }
        $roptions= rand(1,2);
        $entryt=date("Y-m-d H:i:s");

        $numbers=array(60);
        $rtime= $numbers[array_rand($numbers)];
        $expiryt=date("Y-m-d H:i:s",strtotime("+".$rtime." minutes"));
        
        
         $pint=$numrow['pint'];
        
        
           
          $otp=rand(1000000,10000000);    
       
         
         $pint=$numrow['pint'];
         $pint=$otp;
            
        $sql=mysql_query("UPDATE logins SET pint='$pint' WHERE id='$logid'");
        echo mysql_error();
       
       
       
        $sql = mysql_query("INSERT INTO pint (log_id,pint) 
                         VALUES('$logid', '$pint')") ; 
        echo mysql_error();
      
      
      
        // echo $returnr;
        // echo $hrand;
        // $success="<div class='success' align='center' style='margin-bottom:50px;'><img src='images/download.png'>Request Successful</div>";
    }
    echo $success;
}
}
?>




<?php
$date=date_create(date("jS F Y g.iA"));
date_add($date,date_interval_create_from_date_string("30 minutes"));
echo date_format($date,"jS F Y g.iA");
?>
