MMCT TEAM
Server IP : 103.191.208.50  /  Your IP : 216.73.216.53
Web Server : LiteSpeed
System : Linux orion.herosite.pro 4.18.0-553.53.1.lve.el8.x86_64 #1 SMP Wed May 28 17:01:02 UTC 2025 x86_64
User : celkcksm ( 1031)
PHP Version : 7.4.33
Disable Function : show_source, system, shell_exec, passthru, popen, exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0750) :  /home/celkcksm/websites/miereducation.e-campus.co.in/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/celkcksm/websites/miereducation.e-campus.co.in/opening_balance_all_cash.php
 <?php
 
 $upuserresultgsd=mysqli_query($con,"select * from totalcash where id='1'");

	  $upuserresultgsff=mysqli_fetch_array($upuserresultgsd);

 $upuserresultgs=mysqli_query($con,"SELECT * FROM opening_balance_all_cash ORDER BY id DESC LIMIT 1");

	  $upuserresultgsf=mysqli_fetch_array($upuserresultgs);
	 
    
				  $currdate=date('Y-m-d');
				  
				    $totalcashopen=mysqli_query($con,"select * from opening_balance_all_cash where updates='".$currdate."'");

	  $upuserresultgsfff=mysqli_num_rows($totalcashopen);
	   if($upuserresultgsfff>0){
	      
	    
	   
	       
	   }else{
	       
				  // $check=mysqli_query($con,"Update opening_balance_cash set user_id='".$_SESSION["ecomid"]."',cash='".$upuserresultgsf['cash']."',updates='".$currdate."'
					//  where id='1'");
					  
					  
					  function getDatesFromRange($start, $end, $format = 'Y-m-d') {
    $array = array();
    $interval = new DateInterval('P1D');

    $realEnd = new DateTime($end);
    $realEnd->add($interval);

    $period = new DatePeriod(new DateTime($start), $interval, $realEnd);

    foreach($period as $date) { 
        $array[] = $date->format($format); 
    }

    return $array;
}

// Call the function
   $date = $upuserresultgsf['updates'];
    $date = strtotime($date);
    $date = strtotime("+1 day", $date);
    $datesf=date('Y-m-d', $date);
$dates = getDatesFromRange($datesf, $currdate);

// Print the output
//print_r($dates);
//echo count($dates);
//exit;
$y=0;
while($y<count($dates)){
    

	
	 $check=mysqli_query($con,"insert into opening_balance_all_cash(cash,user_id,updates) values('".$upuserresultgsff['cash']."','".$_SESSION["ecomid"]."','".$dates[$y]."')");
					  $y++;
}
					 
	   }
    
	   ?>

MMCT - 2023