|
Server IP : 2a02:4780:3:1493:0:3736:a38e:7 / Your IP : 216.73.216.174 Web Server : LiteSpeed System : Linux sg-nme-web1393.main-hosting.eu 4.18.0-553.84.1.lve.el8.x86_64 #1 SMP Tue Nov 25 18:33:03 UTC 2025 x86_64 User : u926327694 ( 926327694) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : ON Directory (0755) : /home/u926327694/domains/smsoft.in/public_html/demo/src/../staticjs/../accounts/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?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";
function closingBalance($ledger) {
include 'config/config.php';
$cr_res=mysqli_query($con,"SELECT sum(`Cr_Amount`) FROM `vochers` WHERE `Cr_Ledger` = '$ledger'")or die(mysqli_error($con));
$dr_res=mysqli_query($con,"SELECT sum(`Dr_Amount`) FROM `vochers` WHERE `Dr_Ledger` = '$ledger'")or die(mysqli_error($con));
$cr_amount=mysqli_fetch_array($cr_res);
$dr_amount=mysqli_fetch_array($dr_res);
$closing_bal=$dr_amount[0]-$cr_amount[0];
return $closing_bal;
//echo $closing_bal;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<!--<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>-->
<!-- Bootstrap Core CSS -->
<title>E_Vi Accounts</title>
<!-- Bootstrap Core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- MetisMenu CSS -->
<link href="vendor/metisMenu/metisMenu.min.css" rel="stylesheet">
<!-- DataTables CSS -->
<link href="vendor/datatables-plugins/dataTables.bootstrap.css" rel="stylesheet">
<!-- DataTables Responsive CSS -->
<link href="vendor/datatables-responsive/dataTables.responsive.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="dist/css/sb-admin-2.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<link href="dist/css/select2.min.css" rel="stylesheet" />
<style type="text/css">
/* The Modal (background) */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
padding-top: 60px;
}
/* Modal Content/Box */
.modal-content {
background-color: #fefefe;
margin: 5% auto 15% auto; /* 5% from the top, 15% from the bottom and centered */
border: 1px solid #888;
width: 80%; /* Could be more or less, depending on screen size */
}
/* The Close Button (x) */
.close {
position: absolute;
right: 25px;
top: 0;
color: #000;
font-size: 35px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: red;
cursor: pointer;
}
/* Add Zoom Animation */
.animate {
-webkit-animation: animatezoom 0.6s;
animation: animatezoom 0.6s
}
@-webkit-keyframes animatezoom {
from {-webkit-transform: scale(0)}
to {-webkit-transform: scale(1)}
}
@keyframes animatezoom {
from {transform: scale(0)}
to {transform: scale(1)}
}
/* Change styles for span and cancel button on extra small screens */
@media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
</style>
<script type="text/javascript">
function myFunction() {
var val=document.getElementById("v_type").value;
if(val == "Recipt")
{
<?php
$r5=mysqli_query($con,"SELECT * FROM `ledger` where `Type` = 'Current Assets'");
while($row5=mysqli_fetch_array($r5))
{
$para=$row5['Name'];
?>
var x = document.createElement("OPTION");
x.setAttribute("value", "<?php echo $row5['Name']; ?>");
var t = document.createTextNode("<?php echo $row5['Name']." (Type :".$row5['Type']."- Closing Balnce Rs : ".closingBalance($para).")"; ?>");
x.appendChild(t);
document.getElementById("dr_ledger").appendChild(x);
<?php
}
?>
<?php
$r5=mysqli_query($con,"SELECT * FROM `ledger`");
while($row5=mysqli_fetch_array($r5))
{
$para=$row5['Name'];
?>
var x = document.createElement("OPTION");
x.setAttribute("value", "<?php echo $row5['Name']; ?>");
var t = document.createTextNode("<?php echo $row5['Name']." (Type :".$row5['Type']."- Closing Balnce Rs : ".closingBalance($para).")"; ?>");
x.appendChild(t);
document.getElementById("cr_ledger").appendChild(x);
<?php
}
?>
}
if(val == "Payment")
{
<?php
$r5=mysqli_query($con,"SELECT * FROM `ledger` where `Type` = 'Current Assets'");
while($row5=mysqli_fetch_array($r5))
{
//$ledger=$row5['Name'];
$para=$row5['Name'];
?>
var x = document.createElement("OPTION");
x.setAttribute("value", "<?php echo $row5['Name']; ?>");
var t = document.createTextNode("<?php echo $row5['Name']." (Type :".$row5['Type']."- Closing Balnce Rs : ".closingBalance($para).")"; ?>");
x.appendChild(t);
document.getElementById("cr_ledger").appendChild(x);
<?php
}
?>
<?php
$r5=mysqli_query($con,"SELECT * FROM `ledger`");
while($row5=mysqli_fetch_array($r5))
{
$para=$row5['Name'];
?>
var x = document.createElement("OPTION");
x.setAttribute("value", "<?php echo $row5['Name']; ?>");
var t = document.createTextNode("<?php echo $row5['Name']." (Type :".$row5['Type']."- Closing Balnce Rs : ".closingBalance($para).")"; ?>");
x.appendChild(t);
document.getElementById("dr_ledger").appendChild(x);
<?php
}
?>
}
if(val == "Contra")
{
<?php
$r5=mysqli_query($con,"SELECT * FROM `ledger` where `Type` = 'Current Assets'");
while($row5=mysqli_fetch_array($r5))
{
$para=$row5['Name'];
?>
var x = document.createElement("OPTION");
x.setAttribute("value", "<?php echo $row5['Name']; ?>");
var t = document.createTextNode("<?php echo $row5['Name']." (Type :".$row5['Type']."- Closing Balnce Rs : ".closingBalance($para).")"; ?>");
x.appendChild(t);
document.getElementById("cr_ledger").appendChild(x);
<?php
}
?>
<?php
$r5=mysqli_query($con,"SELECT * FROM `ledger` where `Type` = 'Current Assets'");
while($row5=mysqli_fetch_array($r5))
{
$para=$row5['Name'];
?>
var x = document.createElement("OPTION");
x.setAttribute("value", "<?php echo $row5['Name']; ?>");
var t = document.createTextNode("<?php echo $row5['Name']." (Type :".$row5['Type']."- Closing Balnce Rs : ".closingBalance($para).")"; ?>");
x.appendChild(t);
document.getElementById("dr_ledger").appendChild(x);
<?php
}
?>
}
if(val == "Jornals")
{
<?php
$r5=mysqli_query($con,"SELECT * FROM `ledger`");
while($row5=mysqli_fetch_array($r5))
{
$para=$row5['Name'];
?>
var x = document.createElement("OPTION");
x.setAttribute("value", "<?php echo $row5['Name']; ?>");
var t = document.createTextNode("<?php echo $row5['Name']." (Type :".$row5['Type']."- Closing Balnce Rs : ".closingBalance($para).")"; ?>");
x.appendChild(t);
document.getElementById("cr_ledger").appendChild(x);
<?php
}
?>
<?php
$r5=mysqli_query($con,"SELECT * FROM `ledger`");
while($row5=mysqli_fetch_array($r5))
{
$para=$row5['Name'];
?>
var x = document.createElement("OPTION");
x.setAttribute("value", "<?php echo $row5['Name']; ?>");
var t = document.createTextNode("<?php echo $row5['Name']." (Type :".$row5['Type']."- Closing Balnce Rs : ".closingBalance($para).")"; ?>");
x.appendChild(t);
document.getElementById("dr_ledger").appendChild(x);
<?php
}
?>
}
}
</script>
</head>
<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 Vocher</center>
</div>
<div class="panel-body">
<!-- Form Content Start -->
<form role="form" action="vocher_new.php" method="post">
<div class="col-lg-6">
<div class="form-group">
<label>Date</label>
<input type="date" class="form-control" name="date" required value="<?php echo Date('Y-m-d'); ?>">
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label>Vocher Type</label>
<select class="form-control" name="v_type" onchange="myFunction();" id="v_type" required ">
<option></option>
<option value="Recipt">Receipt</option>
<option value="Payment">Payment</option>
<option value="Contra">Contra</option>
<option value="Jornals">Jornals</option>
</select>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label>Cr Ledger</label>
<select class="form-control select2" name="cr_ledger" id="cr_ledger" required >
<option></option>
</select>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label>Dr Ledger</label>
<select class="form-control select2" name="dr_ledger" id="dr_ledger" required >
<option></option>
</select>
</div>
</div>
<div class="col-lg-4">
</div>
<div class="col-lg-4">
<div class="form-group">
<label>Amount</label>
<input type="text" class="form-control" name="v_amount" required>
</div>
</div>
<div class="col-lg-4">
</div>
<br>
<div class="col-lg-12">
<div class="form-group">
<label>Narration</label><br>
<textarea name="nrtn" cols="120"></textarea>
</div>
</div>
<div class="col-lg-12">
<center>
<button type="submit" class="btn btn-default">Submit Button</button></a>
<button type="reset" class="btn btn-default">Reset Button</button>
</center>
</div>
</form>
<!-- Form Content Start -->
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.ROW -->
</div>
</div></div>
</div>
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="vendor/jquery/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!-- Metis Menu Plugin JavaScript -->
<script src="vendor/metisMenu/metisMenu.min.js"></script>
<!-- DataTables JavaScript -->
<script src="vendor/datatables/js/jquery.dataTables.min.js"></script>
<script src="vendor/datatables-plugins/dataTables.bootstrap.min.js"></script>
<script src="vendor/datatables-responsive/dataTables.responsive.js"></script>
<!-- Custom Theme JavaScript -->
<script src="dist/js/sb-admin-2.js"></script>
<script src="dist/js/select2.min.js"></script>
<script>
$(".select2").select2();
</script>
<!-- Page-Level Demo Scripts - Tables - Use for reference -->
<script>
$(document).ready(function() {
$('#dataTables-example').DataTable({
responsive: true
});
});
</script>
</body>
</html>