[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: total_in_out.php
<?php include('header.php'); $show=new Oops($db); ?> <script src="tinymce/tinymce.min.js"></script> <script>tinymce.init({ selector:'textarea' });</script> <!-- page-wrapper --> <div id="page-wrapper"> <div class="row"> <div class="col-lg-6"> <?php $sq="select sum(total) as pay_in from payment where type='IN'"; $st=$con->prepare($sq); $st->execute(); while ($row = $st->fetch(PDO::FETCH_ASSOC)){ $s=$row['pay_in']; } $sq="select sum(total) as pay_out from payment where type='OUT'"; $st=$con->prepare($sq); $st->execute(); while ($row1 = $st->fetch(PDO::FETCH_ASSOC)){ $out=$row1['pay_out']; } $p_loss=$s-$out; ?> <!-- Form Elements --> <div class="panel panel-default"> <div class="panel-heading"> Total IN/OUT </div> <div class="panel-body"> <div class="row"> <div class="col-lg-6"> <form role="form" method="post"> <div class="form-group"> <label>Total IN</label> Rs. <?=$s?> </div> <div class="form-group"> <label>Total Exp</label> Rs. <?=$out?> </div> <div class="form-group"> <label>Profit/Loss</label> Rs.<?=$p_loss?> </div> </form> </div> </div> </div> </div> <!-- End Form Elements --> </div> <div class="col-lg-6"> <div class="panel panel-default"> <div class="panel-heading"> Total IN/OUT </div> <div class="panel-body"> <div class="row"> <div class="col-lg-6"> <form role="form" method="post"> <div class="form-group"> <label>Month</label> <select name="month" class="form-control" required> <option value=''>Choose</option> <?php for($i=1;$i<=12;$i++){?> <option value="<?=$i?>"><?=date("F", mktime(0, 0, 0, $i, 10)) ?></option> <?php } ?> </select> </div> <div class="form-group"> <label>Year</label> <?php // Sets the top option to be the current year. (IE. the option that is chosen by default). $currently_selected = date('Y'); // Year to start available options at $earliest_year = 2000; // Set your latest year you want in the range, in this case we use PHP to just set it to the current year. $latest_year = date('Y'); print '<select name="year" class="form-control" required><option value="">Choose</option>'; // Loops over each int[year] from current year, back to the $earliest_year [1950] foreach ( range( $latest_year, $earliest_year ) as $i ) { // Prints the option with the next year in range. print '<option value="'.$i.'"'.($i === $currently_selected ? ' selected="selected"' : '').'>'.$i.'</option>'; } print '</select>'; ?> </div> <input type="submit" name="sub" value="Show" class="btn btn-info"> </form> <?php if(isset($_POST['sub'])){ $sq="select sum(total) as pay_in from payment where type='IN' and MONTH(date)='".$_POST['month']."' and YEAR(date)='".$_POST['year']."'"; //echo $sq; $st=$con->prepare($sq); $st->execute(); while ($row = $st->fetch(PDO::FETCH_ASSOC)){ $s=$row['pay_in']; } $sq="select sum(total) as pay_out from payment where type='OUT' and MONTH(date)='".$_POST['month']."' and YEAR(date)='".$_POST['year']."'"; $st=$con->prepare($sq); $st->execute(); while ($row1 = $st->fetch(PDO::FETCH_ASSOC)){ $out=$row1['pay_out']; } $p_loss=$s-$out; echo "<table border='1'>"; echo "<tr><td><h4>Total IN </h4></td><td><h4>Rs.".$s."</h4></td></tr>"; echo "<tr><td><h4>Total Exp</h4> </td><td><h4>Rs.".$out."</h4></td></tr>"; echo "<tr><td><h4>Total Profit/Loss</h4></td><td><h4> Rs".$p_loss."</h4></td></tr>"; echo "</table>"; } ?> </div> </div> </div> </div> </div> <div class="col-lg-6"> <div class="panel panel-default"> <div class="panel-heading"> Total OUT Expense Head-wise </div> <div class="panel-body"> <div class="row"> <div class="col-lg-6"> <form role="form" method="post"> <div class="form-group"> <label>Expense Group</label> <select name="exp_group" required class="form-control"> <option value="">Choose</option> <?php $stmt=$show->readAll('expense_group'); $r=$stmt->rowCount(); if($r>0){ while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ echo "<option value='".$row['ep_group']."'>".$row['ep_group']."</option>"; } } ?> </select> </div> <div class="form-group"> <label>Month</label> <select name="month" class="form-control" required> <option value=''>Choose</option> <?php for($i=1;$i<=12;$i++){?> <option value="<?=$i?>"><?=date("F", mktime(0, 0, 0, $i, 10)) ?></option> <?php } ?> </select> </div> <div class="form-group"> <label>Year</label> <?php // Sets the top option to be the current year. (IE. the option that is chosen by default). $currently_selected = date('Y'); // Year to start available options at $earliest_year = 2000; // Set your latest year you want in the range, in this case we use PHP to just set it to the current year. $latest_year = date('Y'); print '<select name="year" class="form-control" required><option value="">Choose</option>'; // Loops over each int[year] from current year, back to the $earliest_year [1950] foreach ( range( $latest_year, $earliest_year ) as $i ) { // Prints the option with the next year in range. print '<option value="'.$i.'"'.($i === $currently_selected ? ' selected="selected"' : '').'>'.$i.'</option>'; } print '</select>'; ?> </div> <input type="submit" name="sub1" value="Show" class="btn btn-info"> </form> <?php if(isset($_POST['sub1'])){ $sq="select sum(total) as pay_out from payment where type='OUT' and MONTH(date)='".$_POST['month']."' and YEAR(date)='".$_POST['year']."' and exp_group='".$_POST['exp_group']."'"; $st=$con->prepare($sq); $st->execute(); while ($row1 = $st->fetch(PDO::FETCH_ASSOC)){ $out=$row1['pay_out']; } $p_loss=$s-$out; echo "<table border='1'>"; echo "<tr><td><h4>Total Exp(".$_POST['exp_group'].")</h4> </td><td><h4>Rs.".$out."</h4></td></tr>"; echo "</table>"; } ?> </div> </div> </div> </div> </div> </div> </div> <script src="js/bootstrap-datepicker.js"></script> <script type="text/javascript"> // When the document is ready $(document).ready(function(){ $("#date").datepicker({ format: 'dd-mm-yyyy', }); }); </script> <!--footer--> <?php include('footer.php'); ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 677.64 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619