<?php
include("config.php");
// ----------- 12aprl2025 sk

 //2minut 45 second
      $table =  $_REQUEST['table'];
      $checkdata = "SELECT * FROM ". $table." WHERE id=5
      ";
      $start_que_start = mysqli_query($connect,$checkdata);
      $startData = mysqli_fetch_array($start_que_start);
      if(($startData["value"] == "1")){ // if 1 then set 0
      
	     $sqllock = "UPDATE ". $table." SET value = 'Unlocked' WHERE id=6";
	     
	     //echo $sqllock ; 
	     $queryUpdateSMS=mysqli_query($connect,$sqllock);
	     
	     $sqloff = "UPDATE ". $table." SET value = '0' WHERE id=5";
	     $sqloffquery =mysqli_query($connect,$sqloff);
	      
	  }
       