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/accounts/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u926327694/domains/smsoft.in/public_html/demo/accounts/t_balance.php
<?php 

    // First we execute our common code to connection to the database and start the session 
    //  require("../common.php"); 
     session_start();
    // 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: ../index.php"); 
         
        // Remember that this die statement is absolutely critical.  Without it, 
        // people can view your members-only content without logging in. 
        die("Redirecting to ../index.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/config.php";
 
$income_sql_res = "SELECT * FROM `vochers` WHERE `Type` = 'Recipt' and `Cr_Ledger_Type` !='Liabilirties' and `Cr_Ledger_Type` !='Assets' ORDER BY `vochers`.`Cr_Ledger` ASC";
$expenditure_sql_res = "SELECT * FROM `vochers` WHERE `Type` = 'Payment' and `Cr_Ledger_Type` !='Liabilirties' and `Cr_Ledger_Type` !='Assets' ORDER BY `vochers`.`Cr_Ledger` ASC";




?>


<!DOCTYPE html>
<html lang="en">


<?php //include "html-head.php"; ?>

<?php include "html-head.php"; ?>
<body>

    




        <!-- Navigation -->
        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                
                    <h3 style="margin-left: 20px;margin-bottom: 20px;color: Red" href="#"><b><?php include "Name.txt"; ?></b></h3>

            </div>
            <!-- /.navbar-header -->

            
            <!-- /.navbar-top-links -->

            <?php
            include "header.php";
            $Particular=array();
            $dr_amount=array();
            $cr_amount=array();
            $closing_amount=array();

            ?>
            <!-- /.navbar-static-side -->
        </nav>


          <div id="wrapper">
         <div id="page-wrapper">
            <br>
 



         <div class="tab-content">
    <div  class="tab-pane fade in active">


      
                <div class="row">
                    <div class="col-lg-12">
                    


                    <div class="panel panel-default">


                        <div class="panel-heading">
                           <center> Trial Balance</center>
                        </div>

                    
                        <div class="panel-body">
                            <?php 
                            $FromDate=date('Y-m-01', strtotime("now"));
                            $ToDate=date('Y-m-t', strtotime("now"));
                            if(isset($_POST['btnSubmit']))
                            {
                                $FromDate=$_POST['FromDate'];
                                $ToDate=$_POST['ToDate'];
                            }
                            ?>
                            <form action="" method="POST">
                                <div class="row">
                                    <div class="col-lg-3 col-md-3 col-xs-12 col-sm-12">
                                        <div class="form-group">
                                            <label>From Date</label>
                                            <input type="date" name="FromDate" class="form-control" required value="<?php echo $FromDate; ?>" />
                                        </div>
                                    </div>
                                    <div class="col-lg-3 col-md-3 col-xs-12 col-sm-12">
                                        <div class="form-group">
                                            <label>To Date</label>
                                            <input type="date" name="ToDate" class="form-control" required value="<?php echo $ToDate; ?>" />
                                        </div>
                                    </div>
                                    <div class="col-lg-3 col-md-3 col-xs-12 col-sm-12">
                                        <div class="form-group">
                                            <label style="width:100%">&nbsp;</label>
                                            <button type="submit" class="btn btn-primary" name="btnSubmit">Submit</button>
                                        </div>
                                    </div>
                                </div>
                            </form>
                                <?php
                                $i=0;
                                $ledger_list_res=mysqli_query($con,"SELECT * FROM `ledger` ORDER BY `Name` ASC") or die(mysqli_error($con));
                                while($ledger_list=mysqli_fetch_array($ledger_list_res))
                                {
                                     
                                $Present_Payment_res=mysqli_query($con,"SELECT SUM(`Cr_Amount`) FROM `vochers` WHERE `Cr_Ledger` = '$ledger_list[Name]' AND (Date between '$FromDate' And '$ToDate') ORDER BY `vochers`.`Cr_Ledger` ASC")or die(mysqli_error($con));
                                
                                $Present_Payment=mysqli_fetch_array($Present_Payment_res);

                                $Present_Recipt_res=mysqli_query($con,"SELECT SUM(`Cr_Amount`) FROM `vochers` WHERE `Dr_Ledger` = '$ledger_list[Name]' AND (Date between '$FromDate' And '$ToDate') ORDER BY `vochers`.`Cr_Ledger` ASC");
                                $Present_Recipt=mysqli_fetch_array($Present_Recipt_res);
                                        
                                        if($Present_Recipt[0] != "" || $Present_Payment[0] != "")
                                        {
                                        

                                          $Particular[$i] =$ledger_list['Name'];  
                                         $dr_amount[$i]=$Present_Recipt['0']; 
                                      $cr_amount[$i]=$Present_Payment['0']; 
                                         
                                        $Closig_Balance=$Present_Recipt[0]-$Present_Payment[0];
                                        if($Closig_Balance < 0)
                                        {
                                                $sign="Cr";
                                        }
                                        else
                                                $sign="Dr";  
                                    
                                      $closing_amount[$i]  = abs($Closig_Balance)."   "."$sign"; 
                                  
                                  $i++;
                                 }
                                    
                                }
                                ?>



                                   <table width="100%" class="table table-striped table-bordered table-hover" id="example">


                                <thead>
                                    <tr>
                                    <th>Particular</th>
                                    <th>Debit</th>
                                    <th>Credit</th>
                                    <th>Closing Balance</th>
                                    
                                </tr>
                            </thead>
                            <tbody> 
                                <?php
                                for($i=0;$i<Sizeof($Particular);$i++)
                                {
                                    ?>

                                    <tr>
                                        <td><?php echo $Particular[$i]; ?></td>
                                        <td><?php echo $dr_amount[$i]; ?></td>
                                        <td><?php echo $cr_amount[$i]; ?></td>
                                        <td><?php echo $closing_amount[$i]; ?></td>
                                    </tr>

                                    <?php
                                }
                                ?>

                                </tbody>
 
                            </table>
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>

               <!-- /.ROW -->
     


    </div>


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

    </div>
    <!-- /#wrapper -->

<?php  include "html-footer.php" ?>
    
</body>

</html>

MMCT - 2023