|
Server IP : 2a02:4780:3:1493:0:3736:a38e:7 / Your IP : 216.73.216.60 Web Server : LiteSpeed System : Linux sg-nme-web1393.main-hosting.eu 4.18.0-553.77.1.lve.el8.x86_64 #1 SMP Wed Oct 8 14:21:00 UTC 2025 x86_64 User : u926327694 ( 926327694) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u926327694/domains/smsoft.in/public_html/demo/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?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(empty($_SESSION['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.
$a=$_SESSION['user'];
include("config/dbconnect.php");
$SchoolCode=$_SESSION['code'];
$sel_school=mysqli_query($con,"select * from schools where schoolCode='$SchoolCode'");
$smsId="";
$smsAPI="";
$smsURL="";
$smsTempId="";
$smsown_num="";
$smsIsActive=0;
$schoolname="";
$schoolname1="";
while($school_row=mysqli_fetch_array($sel_school))
{
$smsId=$school_row['smsId'];
$smsAPI=$school_row['smsAPI'];
$smsURL=$school_row['smsURL'];
$smsTempId=$school_row['smsTempIdBal'];
$smsown_num=$school_row['feesAlertNumbers'];
$smsIsActive=$school_row['smsIsActive'];
$schoolname=$school_row['schoolname'];
$schoolname1=$school_row['sms_schoolname'];
}
mysqli_close($con);
?>
<?php
include "config/config.php";
if(isset($_POST['btnSendsms']))
{
if($smsIsActive=="1")
{
$heads = $_POST['Fees_id'];
$Fees_id=explode(',',$heads);
$Stud_Ids=$_POST['Stud_Ids'];
$counter=0;
foreach ($Stud_Ids as $Stud_Id)
{
$sql1="select * from `stud_basic` where `Stud_Id` = '$Stud_Id'";
$res1=mysqli_query($con,$sql1);
$ress=mysqli_fetch_array($res1);
$sql_tot="SELECT sum(`Balance`) AS TotalBalance,sum(`Paid`) AS TotalPaid,sum(`Total_Amount`) AS Total_Amount FROM `stud_basic2` WHERE `Stud_Id` = $Stud_Id and Head_Id in($heads)";
$amt_res=mysqli_query($con,$sql_tot);
$amt=mysqli_fetch_array($amt_res);
if(count($Fees_id) == 1)
{
$hd=mysqli_query($con,"select * from head where Head_Id=$heads");
$fees_hdd=mysqli_fetch_array($hd);
$Fees_name=$fees_hdd['Name'];
$Fees_name = substr($Fees_name, 0, 5);
}
else
{
$Fees_name="All Fees";
}
$receiver = $ress['Phone'];
/*if($smsown_num!="")
{
$receiver=$receiver.",".$smsown_num;
}*/
//$receiver="9898244359,8050482213";
$today= date("d-m-Y");
//$msg="Dear: ". $ress['Name']." Fees Info: ".$Fees_name." Paid:".$amt['TotalPaid']." Bal:".$amt['TotalBalance']." Make Payment as possible as soon. Thank you , ".$schoolname1." -EVIHBL";
$msg = "";
if($SchoolCode == "STJEM") {
$msg = "Dear parent ". $ress['Name']." Fees information: Bal:".$amt['TotalBalance']." Please make the payment at your earliest convenience.. Thank you , ".$schoolname1." -E vision infotech";
}
else {
$msg = "Dear parent ". $ress['Name']." Fees information: ".$Fees_name." Paid:".$amt['TotalPaid']." Bal:".$amt['TotalBalance']." Please make the payment at your earliest convenience.. Thank you , ".$schoolname1." -E vision infotech";
}
//echo $msg; exit;
$smsResult=SendSMSToUser($smsURL,$smsAPI,$smsId,$smsTempId,$receiver,$msg);
$counter++;
}
if($counter>0)
{
echo"<script>alert('SMS has been sent.');window.location='send_balance_sms.php';</script>";
}
else
{
echo"<script>alert('Please Select at least one student.');window.location='send_balance_sms.php';</script>";
}
}
else
{
echo"<script>alert('SMS Service not started please contact to administrator.');window.location='send_balance_sms.php';</script>";
}
}
if(isset($_POST['btnSendWP']))
{
$heads = $_POST['Fees_id'];
$Fees_id=explode(',',$heads);
$Stud_Ids=$_POST['Stud_Ids'];
$counter=0;
foreach ($Stud_Ids as $Stud_Id)
{
$sql1="select * from `stud_basic` where `Stud_Id` = '$Stud_Id'";
$res1=mysqli_query($con,$sql1);
$ress=mysqli_fetch_array($res1);
$sql_tot="SELECT sum(`Balance`) AS TotalBalance,sum(`Paid`) AS TotalPaid,sum(`Total_Amount`) AS Total_Amount FROM `stud_basic2` WHERE `Stud_Id` = $Stud_Id and Head_Id in($heads)";
$amt_res=mysqli_query($con,$sql_tot);
$amt=mysqli_fetch_array($amt_res);
if(count($Fees_id) == 1)
{
$hd=mysqli_query($con,"select * from head where Head_Id=$heads");
$fees_hdd=mysqli_fetch_array($hd);
$Fees_name=$fees_hdd['Name'];
$Fees_name = substr($Fees_name, 0, 5);
}
else
{
$Fees_name="All Fees";
}
$receiver = $ress['Phone'];
/*if($smsown_num!="")
{
$receiver=$receiver.",".$smsown_num;
}*/
//$receiver="9898244359,8050482213";
$today= date("d-m-Y");
//Dear {#var#} Fees Info: {#var#} Make Payment as possible as soon. Thank you , {#var#} -EVIHBL
$msg="Dear: ". $ress['Name']." Balance Fees:".$amt['TotalBalance']." Make Payment as possible as soon. Thank you , ".$schoolname1;
//echo $msg; exit; $msg="Dear: ". $ress['Name']." Fees Info: ".$Fees_name." Paid:".$amt['TotalPaid']." Bal:".$amt['TotalBalance']." Make Payment as possible as soon. Thank you , ".$schoolname1;
$smsResult=sendWhatsappWithGlobal($receiver, $msg);
$counter++;
}
if($counter>0)
{
echo"<script>alert('SMS has been sent.');window.location='send_balance_sms.php';</script>";
}
else
{
echo"<script>alert('Please Select at least one student.');window.location='send_balance_sms.php';</script>";
}
}
?>