<?php
session_start();
if($_SESSION["username"]=="")
{
 	echo "You are not Logged in Please <a href='index.html'>Sign in </a> First ";
}
else
{

$today=date("Y-m-d");
			$month = date("m",strtotime($today));
		$year = date("Y",strtotime($today));
		 $month_name = date("F", mktime(0, 0, 0, $month, 10));
		 $my=$month_name . " " . $year;
?>
<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->

<head>
   <?php include("includes/header.php") ?>
   <script>
function myFunction() {
  // Get the text field
  var copyText = document.getElementById("myInput");

  // Select the text field
  copyText.select();
  copyText.setSelectionRange(0, 99999); // For mobile devices

  // Copy the text inside the text field
  navigator.clipboard.writeText(copyText.value);
  
  // Alert the copied text
 
}
</script>
</head>

<body>


    <!-- Left Panel -->

   <!-- /#left-panel -->

    <!-- Left Panel -->

    <!-- Right Panel -->

    <div id="right-panel" class="right-panel">

        <!-- Header-->
        
        <!-- Header-->

        

        <div class="content mt-3">
            <div class="animated fadeIn">
                <div class="row">

                    <div class="col-md-14">
                        <div class="card">
						<div class="page-title">
                        <h2><center><? echo "" . $_SESSION["userid"]; ?></center></h2>
                    </div>
                            <div class="card-header">
							
                                <strong class="card-title"><center>Whatsapp All Fee Pending Dues Sms</center> </strong>
								
								
                            </div>
                            <div class="card-body">
							<?php

include 'dbc.php';


$userid=$_SESSION["userid"];
$cname=$_REQUEST["cname"];

?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
								
                                    <thead>
									
									<?php
                                       
echo "<tr>";
 echo "<th width=30% colspan=6>" ."Class Name". "</th>";
  echo "<th width=30% colspan=6>" ."Cell#". "</th>";
   echo "<th width=30% colspan=6>" ."Total Students". "</th>";
 echo "</tr>";
$sql = "SELECT * FROM addclass where  cname='$cname' and user_id='$userid'";
$result=$conn->query($sql);
  while($row = $result->fetch_assoc())
   {
   $cname=$row["cname"];
  $trecord1=0;
$tmfee1=0;
?>
                                    </thead>
									
                                    <tbody>
									<?php
                                     
 $cells="";
  $sql1 = "SELECT * FROM admission where class_name = '$cname' and user_id='$userid' and bal > 0";
$result1=$conn->query($sql1);
while($row1 = $result1->fetch_assoc())
   {
$trecord1=$trecord1 + 1;
$cell_1= $row1['cell_1'];
$cells= $cells . $cell_1 . ","; 
  }
   echo "<tr>";
 echo "<th width=30% colspan=6>" .$cname. "</th>";
  echo "<th width=30% colspan=6>"?>
  <input type="text" value="<? echo $cells ?>" id="myInput" size="100">
<button onClick="myFunction()">Copy Cell No</button>

<?php
"</th>";
   echo "<th width=30% colspan=6>" .$trecord1. "</th>";
 echo "</tr>";
 
  }
  
  
  ?>
  
                                       
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>


                </div>
            </div><!-- .animated -->
        </div> <!-- .content -->
    </div><!-- /#right-panel -->

    <!-- Right Panel -->

   <?php include("includes/footermenu.php") ?>

</body>

</html>
<?php
}
?>