first commit

pull/1/head
dev@siliconpin.com 2025-08-07 11:53:41 +05:30
commit a3067c5ad4
4795 changed files with 782758 additions and 0 deletions

6
.directory Normal file
View File

@ -0,0 +1,6 @@
[Dolphin]
Timestamp=2021,9,10,20,38,35
Version=4
[Settings]
HiddenFilesShown=true

35
.gitignore vendored Normal file
View File

@ -0,0 +1,35 @@
# ---> Prestashop
# Private files
# The following files contain your database credentials and other personal data.
config/settings.*.php
# Cache, temp and generated files
# The following files are generated by PrestaShop.
admin-dev/autoupgrade/
/cache/
!/cache/index.php
!/cache/cachefs/index.php
!/cache/purifier/index.php
!/cache/push/index.php
!/cache/sandbox/index.php
!/cache/smarty/index.php
!/cache/tcpdf/index.php
config/xml/*.xml
/log/*
*sitemap.xml
themes/*/cache/
modules/*/config*.xml
# Site content
# The following folders contain product images, virtual products, CSV's, etc.
admin-dev/backups/
admin-dev/export/
admin-dev/import/
download/
/img/*
upload/
CONFIG/config.php

6
.htaccess Normal file
View File

@ -0,0 +1,6 @@
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php

2
.htpasswd Normal file
View File

@ -0,0 +1,2 @@
seo:$apr1$X1Xy39UL$mxr5A27s3iyymTIAaAgzP/

9
CONFIG/config-local.php Normal file
View File

@ -0,0 +1,9 @@
<?php
$GLOBALS['host']="localhost";
$GLOBALS['user']="dev_arif";
$GLOBALS['pass']="Simple2pass";
$GLOBALS['db']="dev_arif";
$GLOBALS['arif_ac']="arif_ac";
$GLOBALS['arif_tran']="arif_tran";
$GLOBALS['arif_users']="arif_users";
?>

5
CONFIG/settings.php Normal file
View File

@ -0,0 +1,5 @@
<?php
include "../DIZ/DirectAccess-preventer.php";
?>

0
CONFIG/test@tst.com.txt Normal file
View File

View File

@ -0,0 +1,32 @@
<?php
function D_news_entry($news){
//var_dump($news);
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$qq="SELECT id FROM `".$GLOBALS['table1']."`";
$query = $conn->query($qq);
if ($query->num_rows > 0) $news["news_link"]=$news["news_link"].time();
mysqli_set_charset($conn,"utf8");
$stmt = $conn->prepare("INSERT INTO ".$GLOBALS['table1']." (`N_TITLE`, `N_LINK`, `N_CONTENT`, `PICS`, `LANG`, `N_DATE`,`N_CATEGORY`) VALUES (?, ?, ?, ?, ?, ?, ?)");
$N_DATE=date('Y-m-d H:i:s');
$stmt->bind_param("sssssss", $news["news_title"],$news["news_link"],$news["news_content"],$news["image"],$news["lang"],$N_DATE,$news["news_category"]);
if($stmt->execute()){
$GLOBALS['alert_info']= '<div class="alert alert-dismissible alert-info">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>Yes!</strong> Entry Saved successfully
<br> Title :'.$news["news_title"].'
<br> Link :'.$news["news_link"].'
<br> Image :'.$news["image"].'
</div>';
}else{
$GLOBALS['alert_info']= '<div class="alert alert-dismissible alert-danger">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>Sorry!</strong> Unable to process db</div>';
}
$stmt->close();
$conn->close();
}
?>

View File

@ -0,0 +1,29 @@
<div class="container">
<h2>Provide Details to login</h2>
<form class="form-horizontal" method="post" enctype="multipart/form-data" ><input type="hidden" name="FORM_NAME" value="pa_login">
<div class="form-group">
<label class="control-label col-sm-2" for="email">Email:</label>
<div class="col-sm-10">
<input type="email" class="form-control" placeholder="Enter email" name="email">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="pwd">Password:</label>
<div class="col-sm-10">
<input type="password" class="form-control" placeholder="Enter password" name="pwd">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label><input type="checkbox" name="remember"> Remember me</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Login</button>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,28 @@
<div class="container">
<h2>Provide Details to Create a New Acount</h2>
<form class="form-horizontal" method="post" enctype="multipart/form-data" ><input type="hidden" name="FORM_NAME" value="pa_Signup">
<div class="form-group">
<label class="control-label col-sm-2" > Name:</label>
<div class="col-sm-10">
<input type="text" class="form-control" placeholder="Full Name" name="name">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="email">Email:</label>
<div class="col-sm-10">
<input type="email" class="form-control" placeholder="Enter email" name="email">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="pwd">Password:</label>
<div class="col-sm-10">
<input type="password" class="form-control" placeholder="Enter password" name="pwd">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Signup</button>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,26 @@
<?php
//var_dump($_POST);exit();
// if(isset($_POST["add_i"]) && isset($_POST["AA_ACNO"]) && is_numeric($_POST["add_i"]) && $_POST["add_i"] > 2) {
// $conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
// if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
// if($conn->query("UPDATE `".$GLOBALS['arif_ac']."` SET `AA_BAL` = `AA_BAL`+".$_POST["add_i"]." , `AA_NO_OF_PAYPAID` = `AA_NO_OF_PAYPAID`+1 WHERE `AA_ACNO` = '".$_POST["AA_ACNO"]."'"))
// //Add entry to Transaction
// {
// $AT_USER="Admin";
// if($conn->query("INSERT INTO `".$GLOBALS['arif_tran']."` (`AT_ID`, `AT_TIMESTAMP`, `AT_ADMIN`, `AT_ACID`, `AT_AMOUNT`) VALUES (NULL, CURRENT_TIMESTAMP, '".$AT_USER."', '".$_POST["AA_ACNO"]."', '".$_POST["add_i"]."')"))
// $GLOBALS['post_info']="Transaction Success!";
// else $GLOBALS['post_info']="Error! Config or server";
// /*
// INSERT INTO `arif_tran` (`AT_ID`, `AT_TIMESTAMP`, `AT_ADMIN`, `AT_ACID`, `AT_AMOUNT`) VALUES (NULL, CURRENT_TIMESTAMP, '', '000', '32');
// $stmt = $conn->prepare("INSERT INTO `".$GLOBALS['arif_tran']."` (`AT_USER`,`AT_ACID`,`AT_AMOUNT`) VALUES (?, ?, ?)");
// $stmt->bind_param("ssi" ,$AT_USER,$_POST["AA_ACNO"],$_POST["add_i"]);
// if($stmt->execute()){
// $GLOBALS['post_info']="Transaction Success!";
// } else $GLOBALS['post_info']="Error! Config or server";
// */
// }
// $conn->close();
// }else $GLOBALS['post_info']="Error! Check input details";
?>

View File

@ -0,0 +1,37 @@
<?php
if(isset($_POST["ac_type"]) && isset($_POST["ac_name"]) && $_POST["ac_name"]!=""){
$ca["ac_type"]=$_POST["ac_type"];
$ca["ac_name"]=$_POST["ac_name"];
$ca["ac_phone"]=$_POST["ac_phone"];
$ca["ac_mail"]=$_POST["ac_mail"];
$ca["ac_address"]=$_POST["ac_address"];
$ca["ac_no"]="GV".$_POST["ac_type"].date("Ymd");
//GC_new_entry($ca);
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
mysqli_set_charset($conn,"utf8");
$stmt = $conn->prepare("INSERT INTO ".$GLOBALS['arif_ac']." (`AA_ACTYPE`,`AA_NAME`, `AA_PHONE`, `AA_EMAIL`, `AA_ADDRESS`) VALUES (?, ?, ?, ?, ?)");
$stmt->bind_param("sssss" ,$ca["ac_type"],$ca["ac_name"],$ca["ac_phone"],$ca["ac_mail"],$ca["ac_address"]);
if($stmt->execute()){
$lid=$conn->insert_id;$ca["ac_no"]=$ca["ac_no"].$lid;
if($conn->query("UPDATE `".$GLOBALS['arif_ac']."` SET `AA_ACNO` = '".$ca["ac_no"]."' WHERE `AA_ID` =".$lid.";"))
$GLOBALS['alert_info']= '<div class="alert alert-dismissible alert-info">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>Yes!</strong> Entry Saved successfully </div>';
}else{
$GLOBALS['alert_info']= '<div class="alert alert-dismissible alert-danger">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>Sorry!</strong> Unable to process db</div>';
}
$stmt->close();
$conn->close();
}
?>

View File

@ -0,0 +1,16 @@
<?php
if(isset($_POST["FORM_NAME"]) && $_POST["FORM_NAME"]=="new_news_entry"){
$D_image_upload1=D_image_upload1("photo_news","NEWS","",400000); //POST name,Path,target_file_name,max_size
if($D_image_upload1["D_image_upload1"]=="ok")
{
//var_dump($D_image_upload1);
$news["image"]=$D_image_upload1["name"];
$news["news_category"]=$_POST["news_category"];
$news["lang"]=$_POST["lang"];
$news["news_link"]=$_POST["news_link"];$news["news_link"]=preg_replace('~[^a-zA-Z0-9]+~', '-', $news["news_link"]);
$news["news_title"]=$_POST["news_title"];
$news["news_content"]=$_POST["news_content"];
D_news_entry($news);
}
}
?>

View File

@ -0,0 +1,10 @@
</body>
<script src="/CONTENT/cal_GV.js"></script>
<script>
//document.getElementsByName("CA_No_Of_Payment")[0].addEventListener("input", cal_mature);
</script>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Gramin Venture POS Portal</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/asset/css/bootstrap.min.css">
<script src="/asset/js/jquery.min.js"></script>
<script src="/asset/js/bootstrap.min.js"></script>
<script src="/asset/js/angular.min.js"></script>
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>-->
</head>
<body>

View File

@ -0,0 +1,51 @@
<?php
include(__DIR__ . '/auth.php');
require_login();
// Don't send ANY HTML or echo above this line
?>
<style>
.logo {
display: inline-block;
margin: auto;
vertical-align: middle;
}
</style>
<!-- nav start -->
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a href="/Admin/"><img class="img-responsive logo" style="height:50px" src="/asset/images/logo.webp" alt=""></a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- <a class="navbar-brand" href="/Admin/">Gramin Venture</a> -->
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li ><a href="/Admin/Create_AC_Recurring">New Recurring </a></li>
<li ><a href="/Admin/Create_AC_FD">New FD </a></li>
<li ><a href="/Admin/Create_AC_Loan">New Loan </a></li>
<li ><a href="/Admin/Add_group">Add New Group </a></li>
<li><a href="/Admin/View_AC?Type=Recurring">View A/C</a></li>
<li><a href="/Admin/Trans_New">Transaction</a></li> <!-- Added -->
<li><a href="/Admin/Report">Report</a></li>
<li><a href="/Admin/Due">Due</a></li>
<li><a href="/Admin/Revert">Revert</a></li>
<li><a href="/Admin/agent_View_report">Commission</a></li>
<li><a href="/Admin/Settings_Agent">Agent Settings</a></li>
</ul>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="/Admin/Signout">Signout</a></li>
</ul>
</div>
</div>
</nav>

View File

@ -0,0 +1,42 @@
<style>
.navbar-default {
background-color: #0b208e;
border-color: #0b208e;
border-radius: 0;
}
.logo {
display: inline-block;
margin: auto;
vertical-align: middle;
}
</style>
<!-- nav start -->
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a href="/Admin/"><img class="img-responsive logo" style="height:50px" src="/asset/images/logo.webp" alt=""></a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- <a class="navbar-brand" href="/Admin/">Gramin Venture</a> -->
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="/Admin/Agent_Trans_New">NEW Transaction</a></li> <!-- Added -->
<li><a href="/Admin/View_ac?Type=Loan">View AC</a></li> <!-- Added -->
<!-- <li><a href="/Admin/View_trans">View Transaction</a></li> -->
<!-- <li><a href="/Admin/View_report">Report</a></li> -->
<li><a href="/Admin/View_report">Commission</a></li>
</ul>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="/Admin/Signout">Signout</a></li>
</ul>
</div>
</div>
</nav>

View File

@ -0,0 +1,65 @@
<div class="container">
<h3>Add New Group</h3><hr>
<div class="form-group">
<input type="text" class="form-control text-capitalize" id="group_name" name="group_name" placeholder="Enter Group Name" required>
</div>
<div class="form-group">
<button type="button" class="btn btn-success" onclick="addNewGroup()">Add Group</button>
</div>
<div class="row">
<div class="col-md-6">
<h3>List of currently available groups</h3><hr>
<ul class="list-group text-capitalize">
<?php
foreach (glob(__DIR__."/group_names/*") as $filename) {
$filename = explode('/', $filename);
$filename = end($filename);
echo '<li class="list-group-item d-flex justify-content-between align-items-center">'.$filename. '<span class="badge badge-warning badge-pill" onclick="deleteGroup('."'$filename'".')">X</span></li>';
}
?>
</ul>
</div>
</div>
</div>
<style>
.badge-warning {
background: red;
cursor: pointer;
}
</style>
<script>
function addNewGroup() {
var gname = document.getElementById("group_name").value,
inFolder = 'group_names',
path ='/api/create_file?filename='+gname+'&inFolder='+inFolder;
fetch(path)
.then(function(response) { return response.json(); })
.then(function(json) {
if(json.status=='success') {
// createButton(fname,inFolder,inDiv);
console.log(json.status);
alert(json.msg);
location.reload(true);
}
});
console.log(gname);
}
function deleteGroup(fname) {
var inFolder = 'group_names',
f='/api/delete_file?name='+fname+'&folder=/CONTENT/ROOT_URI/Admin/'+inFolder;
fetch(f)
.then(function(response) { return response.json(); })
.then(function(json) {
if(json.status=='success'){
// removeModal(fname);
console.log(json.status);
alert(json.msg);
location.reload(true);
}
});
}
</script>

View File

@ -0,0 +1,128 @@
<div class="container">
<?php
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
if(isset($_POST["ac_type"]) && isset($_POST["ac_name"]) && $_POST["ac_name"]!="" && is_numeric($_POST["Mature_Value"]) ) {
$return_json['NotiFi'] = "";$return_json['NotiFi_m'] = "";$return_json['NotiFi_d'] = "";
$ca["ac_type"]=$_POST["ac_type"];
$ca["ac_name"]=$_POST["ac_name"];
$ca["ac_phone"]=$_POST["ac_phone"];
$ca["ac_mail"]=$_POST["ac_mail"];
$ca["ac_address"]=$_POST["ac_address"];
$ca["ac_no"]="GV".$_POST["ac_type"].date("Ymd")."F";
$ca["ac_agent"] = $_POST["ac_agent"] ?? null;
//GC_new_entry($ca);
$t="FD";
$stmt = $conn->prepare("INSERT INTO ".$GLOBALS['arif_ac']." (`AA_ICARD_NO`,`AA_NOMINEE_DETAILS`,`AA_INTEREST`,`AA_DATE`, `AA_DATE_MATURE`, `AA_NO_OF_PAYMENT`,`AA_AMOUNT`, `AA_MATURE_VALUE`, `AA_TYPE`,`AA_ACTYPE`,`AA_NAME`, `AA_PHONE`, `AA_EMAIL`, `AA_ADDRESS`, `AA_ADMIN`, `AA_AGENT`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("ssssssssssssssss" ,$_POST["AA_ICARD_NO"],$_POST["AA_NOMINEE_DETAILS"],$_POST["CA_interest"], $_POST["date_today"],$_POST["date_mature"],$_POST["CA_No_Of_Payment"],$_POST["CA_Amount"],$_POST["Mature_Value"], $t,$ca["ac_type"],$ca["ac_name"],$ca["ac_phone"],$ca["ac_mail"],$ca["ac_address"],$_SESSION["EMAIL"], $ca["ac_agent"]);
if($stmt->execute()){
$lid=$conn->insert_id;$ca["ac_no"]=$ca["ac_no"].$lid;
if($conn->query("UPDATE `".$GLOBALS['arif_ac']."` SET `AA_ACNO` = '".$ca["ac_no"]."' WHERE `AA_ID` =".$lid.";"))
{$return_json['NotiFi'] = "OK";$return_json['NotiFi_m'] = "New FD A/C Created !";$return_json['NotiFi_d'] = "<a href='./Details?no=".$ca["ac_no"]."'>A/C NO- ".$ca["ac_no"]."</a>";}
else{$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error Creating New Recurring A/C !";$return_json['NotiFi_d'] = "Failed in Secondary Execution";}
}else printf("Error: %s.\n", $stmt->error);
$stmt->close();
$conn->close();
echo $return_json['NotiFi'],$return_json['NotiFi_m'],$return_json['NotiFi_d'];
} //else {$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error on input !";$return_json['NotiFi_d'] = "Check Input Details";}
//echo json_encode($return_json);
$getAgentListsQuery = "SELECT * FROM " . $GLOBALS['arif_users'];
$result = $conn->query($getAgentListsQuery);
$agentList = [];
if ($result && $result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$agentList[] = $row;
}
} else {
echo "No agents found.";
}
?>
</div>
<div class="container">
<form method="post" enctype="multipart/form-data" id="new_fd">
<input type="hidden" name="ac_type" value="F">
<div class="form-group">
<input type="text" class="form-control text-capitalize" name="ac_name" placeholder="Name" >
<small id="emailHelp" class="form-text text-muted">A/C Holder Name*</small>
</div>
<div class="form-group">
<input type="text" class="form-control text-uppercase" name="AA_ICARD_NO" placeholder="I-CARD NO" required>
</div>
<table><tr>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_Amount" oninput="cal_FD();">
<small id="emailHelp" class="form-text text-muted">Amount*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_interest" value="8">
<small id="emailHelp" class="form-text text-muted">interest*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_No_Of_Payment" oninput="cal_FD();cal_FD_md();" >
<small id="emailHelp" class="form-text text-muted">Month*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="Mature_Value" id="Mature_Value" value="">
<small id="emailHelp" class="form-text text-muted">Mature Value*</small>
</div></td>
<td>
<div class="form-group">
<select class="form-control" name="ac_agent">
<option>-Dedicate Agent-</option>
<?php foreach ($agentList as $agent): ?>
<option Value="<?php echo htmlspecialchars($agent['user_id']) ?>"><?php echo htmlspecialchars($agent['user_id']); ?></option>
<?php endforeach; ?>
</select>
<small class="form-text text-muted">Dedicate a Agent</small>
</div>
</td>
</tr></table>
<div class="form-group">
<input type="text" class="form-control" id="date_today" name="date_today" value="<?php echo date('Y-m-d');?>" >
<small id="emailHelp" class="form-text text-muted">Date*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="date_mature" >
<small id="emailHelp" class="form-text text-muted">Mature Date*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_phone" placeholder="Phone No">
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_mail" placeholder="Email">
</div>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="ac_address" placeholder="Address"></textarea>
</div>
<hr>
<small class="form-text text-muted"><u>Nominee details*</u></small>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="AA_NOMINEE_DETAILS" required>Name:
DOB:
Relation:
ID:
</textarea>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-md-offset-5 col-sm-12 col-xs-12">
<button type="submit" class="btn btn-primary">Create New FD A/C</button>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,161 @@
<div class="container">
<?php
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
if(isset($_POST["ac_type"]) && isset($_POST["ac_name"]) && $_POST["ac_name"]!="" && is_numeric($_POST["Mature_Value"]) ) { // echo '<script> alert("h");</script> ';
$return_json['NotiFi'] = "";$return_json['NotiFi_m'] = "";$return_json['NotiFi_d'] = "";
$ca["ac_type"]=$_POST["ac_type"];
$ca["ac_name"]=$_POST["ac_name"];
$ca["ac_phone"]=$_POST["ac_phone"];
$ca["ac_mail"]=$_POST["ac_mail"];
$ca["ac_address"]=$_POST["ac_address"];
$ca["ac_no"]="GV".$_POST["ac_type"].date("Ymd")."L";
$AA_BAL=$_POST["Mature_Value"];$AA_BAL=$AA_BAL-($AA_BAL*2);
$ca["ac_agent"] = $_POST["ac_agent"] ?? null;
//GC_new_entry($ca);
//echo $GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db'];
$t="Loan";
$stmt = $conn->prepare("INSERT INTO ".$GLOBALS['arif_ac']." (`AA_BAL`,`AA_G1_DETAILS`,`AA_G2_DETAILS`,`AA_INSTALLMENT`,`AA_ICARD_NO`,`AA_INTEREST`,`AA_DATE`,`AA_DATE_MATURE`,`AA_NO_OF_PAYMENT`,`AA_AMOUNT`,`AA_MATURE_VALUE`,`AA_TYPE`,`AA_ACTYPE`,`AA_NAME`, `AA_PHONE`, `AA_EMAIL`, `AA_ADDRESS`, `AA_ADMIN`, `AA_AGENT`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("issssssssssssssssss" ,$AA_BAL,$_POST["AA_G1_DETAILS"],$_POST["AA_G2_DETAILS"],$_POST["CA_installment"],$_POST["AA_ICARD_NO"],$_POST["CA_interest"],$_POST["date_today"],$_POST["date_mature"],$_POST["CA_No_Of_Payment"],$_POST["CA_Amount"],$_POST["Mature_Value"], $t,$ca["ac_type"],$ca["ac_name"],$ca["ac_phone"],$ca["ac_mail"],$ca["ac_address"],$_SESSION["EMAIL"], $ca["ac_agent"]);
if($stmt->execute()){
$lid=$conn->insert_id;$ca["ac_no"]=$ca["ac_no"].$lid;
if($conn->query("UPDATE `".$GLOBALS['arif_ac']."` SET `AA_ACNO` = '".$ca["ac_no"]."' WHERE `AA_ID` =".$lid.";"))
{$return_json['NotiFi'] = "OK";$return_json['NotiFi_m'] = "New Loan A/C Created !";$return_json['NotiFi_d'] = "<a href='./Details?no=".$ca["ac_no"]."'>A/C NO- ".$ca["ac_no"]."</a>";}
else{$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error Creating New Recurring A/C !";$return_json['NotiFi_d'] = "Failed in Secondary Execution";}
}
$stmt->close();
$conn->close();
echo $return_json['NotiFi'],$return_json['NotiFi_m'],$return_json['NotiFi_d'];
} //else {$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error on input !";$return_json['NotiFi_d'] = "Check Input Details";}
//echo json_encode($return_json);
$getAgentListsQuery = "SELECT * FROM " . $GLOBALS['arif_users'];
$result = $conn->query($getAgentListsQuery);
$agentList = [];
if ($result && $result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$agentList[] = $row;
}
} else {
echo "No agents found.";
}
?>
</div>
<div class="container">
<form method="post" enctype="multipart/form-data" id="new_loan">
<!--<div ng-app="myApp" ng-controller="myCtrl" class="form-group">-->
<select class="form-control" name="ac_type" onchange="cal_loan_type();">
<option value="D">Day</option>
<option value="W">Week</option>
<option value="M">Month</option>
</select>
<small class="form-text text-muted">A/C Type*</small>
<!--</div>-->
</br>
<div class="form-group">
<input type="text" class="form-control text-capitalize" name="ac_name" placeholder="Name" >
<small class="form-text text-muted">A/C Holder Name*</small>
</div>
<div class="form-group">
<input type="text" class="form-control text-uppercase" name="AA_ICARD_NO" placeholder="ICARD No" >
<small class="form-text text-muted">A/C Holder's ID No*</small>
</div>
<div class="form-group">
<input type="text" class="form-control text-capitalize" name="Father" placeholder="Father" >
<small class="form-text text-muted">A/C Holder's Father*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_phone" placeholder="Phone No">
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_mail" placeholder="Email">
</div>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="ac_address" placeholder="Address"></textarea>
</div>
<table><tr>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_Amount" oninput="cal_loan();">
<small class="form-text text-muted">Principle Amount*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_interest" value="20" oninput="cal_loan();">
<small class="form-text text-muted">interest*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_No_Of_Payment" oninput="cal_loan();cal_Re_md();" >
<small class="form-text text-muted">Tenure no of <span id="DWM">Day</span>*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_installment" >
<small class="form-text text-muted">installment Amount*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="Mature_Value" >
<small class="form-text text-muted">Total Amount*</small>
</div></td>
<td>
<div class="form-group">
<select class="form-control" name="ac_agent">
<option>-Dedicate Agent-</option>
<?php foreach ($agentList as $agent): ?>
<option Value="<?php echo htmlspecialchars($agent['user_id']) ?>"><?php echo htmlspecialchars($agent['user_id']); ?></option>
<?php endforeach; ?>
</select>
<small class="form-text text-muted">Dedicate a Agent</small>
</div>
</td>
</tr></table>
<div class="form-group">
<input type="text" class="form-control" id="date_today" name="date_today" value="<?php echo date('Y-m-d');?>" >
<small id="emailHelp" class="form-text text-muted">Date*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="date_mature" >
<small id="emailHelp" class="form-text text-muted">Mature Date*</small>
</div>
<hr/>
<h4>Guaranter</h4>
<hr>
<small class="form-text text-muted"><u>1st Guaranter details*</u></small>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="6" name="AA_G1_DETAILS" required>Name:
ID:
Father:
Phone:
Relation:
Address: </textarea>
</div>
<hr>
<small class="form-text text-muted"><u>2nd Guaranter details*</u></small>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="6" name="AA_G2_DETAILS" required>Name:
ID:
Father:
Phone:
Relation:
Address:</textarea>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-md-offset-5 col-sm-12 col-xs-12">
<button type="submit" class="btn btn-primary" >Create New Loan A/C</button>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,137 @@
<div class="container">
<?php
$start = time();
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
if(isset($_POST["ac_type"]) && isset($_POST["ac_name"]) && $_POST["ac_name"]!="" && is_numeric($_POST["Mature_Value"]) ) {
$return_json['NotiFi'] = "";$return_json['NotiFi_m'] = "";$return_json['NotiFi_d'] = "";
$ca["ac_type"]=$_POST["ac_type"];
$ca["ac_name"]=$_POST["ac_name"];
$ca["ac_phone"]=$_POST["ac_phone"];
$ca["ac_mail"]=$_POST["ac_mail"];
$ca["ac_address"]=$_POST["ac_address"];
$ca["ac_no"]="GV".$_POST["ac_type"].date("Ymd")."R";
$ca["ac_agent"] = $_POST["ac_agent"] ?? null;
$t="Recurring";
$stmt = $conn->prepare("INSERT INTO ".$GLOBALS['arif_ac']." (`AA_INTEREST`,`AA_DATE`,`AA_ICARD_NO`,`AA_DATE_MATURE`,`AA_NO_OF_PAYMENT`,`AA_INSTALLMENT`,`AA_MATURE_VALUE`,`AA_TYPE`,`AA_ACTYPE`,`AA_NAME`, `AA_PHONE`, `AA_EMAIL`, `AA_ADDRESS`, `AA_NOMINEE_DETAILS`, `AA_ADMIN`, `AA_AGENT`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("ssssssssssssssss" ,$_POST["CA_interest"],$_POST["date_today"],$_POST["AA_ICARD_NO"],$_POST["date_mature"],$_POST["CA_No_Of_Payment"],$_POST["CA_Amount"],$_POST["Mature_Value"], $t,$ca["ac_type"],$ca["ac_name"],$ca["ac_phone"],$ca["ac_mail"],$ca["ac_address"],$_POST["AA_NOMINEE_DETAILS"],$_SESSION["EMAIL"], $ca["ac_agent"]);
if($stmt->execute()){
$lid=$conn->insert_id;$ca["ac_no"]=$ca["ac_no"].$lid;
if($conn->query("UPDATE `".$GLOBALS['arif_ac']."` SET `AA_ACNO` = '".$ca["ac_no"]."' WHERE `AA_ID` =".$lid.";"))
{$return_json['NotiFi'] = "OK";$return_json['NotiFi_m']="New Recurring A/C Created !";$return_json['NotiFi_d'] = "<a href='./Details?no=".$ca["ac_no"]."'>A/C NO- ".$ca["ac_no"]."</a>";}
else{$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error Creating New Recurring A/C !";$return_json['NotiFi_d'] = "Failed in Secondary Execution";}
}else{
echo $stmt->error;
}
$stmt->close();
$conn->close();
//$e_time= time() - $start; echo $start."<br>".time()."<br>".$e_time."<br>";
echo $return_json['NotiFi'],$return_json['NotiFi_m'],$return_json['NotiFi_d'];
}// else {$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error on input !";$return_json['NotiFi_d'] = "Check Input Details";}
$getAgentListsQuery = "SELECT * FROM " . $GLOBALS['arif_users'];
$result = $conn->query($getAgentListsQuery);
$agentList = [];
if ($result && $result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$agentList[] = $row;
}
} else {
echo "No agents found.";
}
?>
</div>
<div class="container">
<form method="post" enctype="multipart/form-data" id="New_Recurring">
<div class="form-group">
<!--<div ng-app="myApp" ng-controller="myCtrl" class="form-group">-->
<select class="form-control" name="ac_type">
<option value="D">Day</option>
<option value="W">Week</option>
<option value="M">Month</option>
</select>
<small class="form-text text-muted">A/C Type*</small>
<!--</div>-->
</div><br>
<div class="form-group">
<input type="text" class="form-control text-capitalize" name="ac_name" placeholder="Name" required>
<small class="form-text text-muted">A/C Holder Name*</small>
</div>
<div class="form-group">
<input type="text" class="form-control text-uppercase" name="AA_ICARD_NO" placeholder="I-CARD NO" required>
</div>
<table class="space-x-2"><tr>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_Amount" oninput="cal_rec();" required>
<small class="form-text text-muted">Amount*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_interest" value="8" oninput="cal_rec();" required>
<small class="form-text text-muted">Interest*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_No_Of_Payment" oninput="cal_rec();cal_Re_md();" required>
<small class="form-text text-muted">No Of Payment*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="Mature_Value" required>
<small class="form-text text-muted">Mature Value*</small>
</div></td>
<td>
<div class="form-group">
<select class="form-control" name="ac_agent">
<option>-Dedicate Agent-</option>
<?php foreach ($agentList as $agent): ?>
<option Value="<?php echo htmlspecialchars($agent['user_id']) ?>"><?php echo htmlspecialchars($agent['user_id']); ?></option>
<?php endforeach; ?>
</select>
<small class="form-text text-muted">Dedicate a Agent</small>
</div>
</td>
</tr></table>
<div class="form-group">
<input type="text" class="form-control" id="date_today" name="date_today" value="<?php echo date('Y-m-d');?>" required>
<small class="form-text text-muted">Date*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="date_mature" required>
<small class="form-text text-muted">Mature Date*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_phone" placeholder="Phone No" required>
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_mail" placeholder="Email">
</div>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="ac_address" placeholder="Address" required></textarea>
</div>
<hr>
<small class="form-text text-muted"><u>Nominee details*</u></small>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="AA_NOMINEE_DETAILS" required>Name:
DOB:
Relation:
ID:
</textarea>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-md-offset-5 col-sm-12 col-xs-12">
<button type="submit" class="btn btn-primary" >Create New Recurring A/C</button>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,106 @@
<div class="container">
<?php
$start = time();
if(isset($_POST["ac_type"]) && isset($_POST["ac_name"]) && $_POST["ac_name"]!="" && is_numeric($_POST["Mature_Value"]) ) {
$return_json['NotiFi'] = "";$return_json['NotiFi_m'] = "";$return_json['NotiFi_d'] = "";
$ca["ac_type"]=$_POST["ac_type"];
$ca["ac_name"]=$_POST["ac_name"];
$ca["ac_phone"]=$_POST["ac_phone"];
$ca["ac_mail"]=$_POST["ac_mail"];
$ca["ac_address"]=$_POST["ac_address"];
$ca["ac_no"]="GV".$_POST["ac_type"].date("Ymd")."R";
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$t="Recurring";
$stmt = $conn->prepare("INSERT INTO ".$GLOBALS['arif_ac']." (`AA_INTEREST`,`AA_DATE`,`AA_ICARD_NO`,`AA_DATE_MATURE`,`AA_NO_OF_PAYMENT`,`AA_INSTALLMENT`,`AA_MATURE_VALUE`,`AA_TYPE`,`AA_ACTYPE`,`AA_NAME`, `AA_PHONE`, `AA_EMAIL`, `AA_ADDRESS`, `AA_NOMINEE_DETAILS`, `AA_ADMIN`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("sssssssssssssss" ,$_POST["CA_interest"],$_POST["date_today"],$_POST["AA_ICARD_NO"],$_POST["date_mature"],$_POST["CA_No_Of_Payment"],$_POST["CA_Amount"],$_POST["Mature_Value"], $t,$ca["ac_type"],$ca["ac_name"],$ca["ac_phone"],$ca["ac_mail"],$ca["ac_address"],$_POST["AA_NOMINEE_DETAILS"],$_SESSION["EMAIL"]);
if($stmt->execute()){
$lid=$conn->insert_id;$ca["ac_no"]=$ca["ac_no"].$lid;
if($conn->query("UPDATE `".$GLOBALS['arif_ac']."` SET `AA_ACNO` = '".$ca["ac_no"]."' WHERE `AA_ID` =".$lid.";"))
{$return_json['NotiFi'] = "OK";$return_json['NotiFi_m']="New Recurring A/C Created !";$return_json['NotiFi_d'] = "<a href='./Details?no=".$ca["ac_no"]."'>A/C NO- ".$ca["ac_no"]."</a>";}
else{$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error Creating New Recurring A/C !";$return_json['NotiFi_d'] = "Failed in Secondary Execution";}
}
$stmt->close();
$conn->close();
//$e_time= time() - $start; echo $start."<br>".time()."<br>".$e_time."<br>";
echo $return_json['NotiFi'],$return_json['NotiFi_m'],$return_json['NotiFi_d'];
}// else {$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error on input !";$return_json['NotiFi_d'] = "Check Input Details";}
?>
</div>
<div class="container">
<form method="post" enctype="multipart/form-data" id="New_Recurring">
<div class="form-group">
<!--<div ng-app="myApp" ng-controller="myCtrl" class="form-group">-->
<select class="form-control" name="ac_type">
<option value="D">Day</option>
<option value="W">Week</option>
<option value="M">Month</option>
</select>
<small class="form-text text-muted">A/C Type*</small>
<!--</div>-->
</div>
<br>
<div class="form-group">
<input type="text" class="form-control text-capitalize" name="ac_name" placeholder="Name" required>
<small class="form-text text-muted">A/C Holder Name*</small>
</div>
<div class="form-group">
<input type="text" class="form-control text-uppercase" name="AA_ICARD_NO" placeholder="I-CARD NO" required>
</div>
<table><tr>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_Amount" oninput="cal_rec();" required>
<small class="form-text text-muted">Amount*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_interest" value="8" oninput="cal_rec();" required>
<small class="form-text text-muted">Interest*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_No_Of_Payment" oninput="cal_rec();cal_Re_md();" required>
<small class="form-text text-muted">No Of Payment*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="Mature_Value" required>
<small class="form-text text-muted">Mature Value*</small>
</div></td>
</tr></table>
<div class="form-group">
<input type="text" class="form-control" id="date_today" name="date_today" value="<?php echo date('Y-m-d');?>" required>
<small class="form-text text-muted">Date*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="date_mature" required>
<small class="form-text text-muted">Mature Date*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_phone" placeholder="Phone No" required>
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_mail" placeholder="Email">
</div>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="ac_address" placeholder="Address" required></textarea>
</div>
<hr>
<small class="form-text text-muted"><u>Nominee details*</u></small>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="AA_NOMINEE_DETAILS" required>Name:
DOB:
Relation:
ID:
</textarea>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-md-offset-5 col-sm-12 col-xs-12">
<button type="submit" class="btn btn-primary" >Create New Recurring A/C</button>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,392 @@
<div class="container" style="text-align: center;">
<h3> ACCOUNT DETAILS</h3><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<?php
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
$conn->set_charset("utf8");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Handle agent assignment if submitted
if (isset($_POST['assign_agent']) && $_SESSION['type'] === 'admin') {
$ac_no = $_POST['ac_no'];
$agent_id = $_POST['ac_agent'];
$updateSql = "UPDATE `{$GLOBALS['arif_ac']}` SET AA_AGENT = ? WHERE AA_ACNO = ?";
$stmt = $conn->prepare($updateSql);
$stmt->bind_param("ss", $agent_id, $ac_no);
if ($stmt->execute()) {
echo "<div class='alert alert-success'>Agent assigned successfully!</div>";
} else {
echo "<div class='alert alert-danger'>Failed to assign agent: " . $conn->error . "</div>";
}
$stmt->close();
}
// Handle loan closing
if (isset($_POST['sp_loan_close_submit']) && !empty($_POST['sp_close_acno'])) {
$spTargetAcno = $_POST['sp_close_acno'];
$spNewStatus = 'closed';
$spClosingDate = date('Y-m-d');
$spSql = "UPDATE `{$GLOBALS['arif_ac']}` SET STATUS = ?, CLOSING_DATE = ? WHERE AA_ACNO = ?";
$spStmt = $conn->prepare($spSql);
if (!$spStmt) {
die("Prepare failed: " . $conn->error);
}
$spStmt->bind_param("sss", $spNewStatus, $spClosingDate, $spTargetAcno);
if ($spStmt->execute()) {
echo "<div class='alert alert-success'>Loan A/C <strong>{$spTargetAcno}</strong> closed successfully.</div>";
} else {
echo "<div class='alert alert-danger'>Failed to close Loan A/C <strong>{$spTargetAcno}</strong>.</div>";
}
$spStmt->close();
}
// Get agent list for dropdown
// $getAgentListsQuery = "SELECT * FROM " . $GLOBALS['arif_users'] . " WHERE type = 'agent'";
$getAgentListsQuery = "SELECT * FROM " . $GLOBALS['arif_users'] . "";
$agentResult = $conn->query($getAgentListsQuery);
$agentList = [];
if ($agentResult && $agentResult->num_rows > 0) {
while ($row = $agentResult->fetch_assoc()) {
$agentList[] = $row;
}
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO`= '".$_GET["no"]."'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
if($row["AA_ACTYPE"]=="D") $AA_ACTYPE="Day";
if($row["AA_ACTYPE"]=="M") $AA_ACTYPE="Month";
if($row["AA_ACTYPE"]=="W") $AA_ACTYPE="Week";
if ($row["AA_TYPE"]== "FD") {
echo "
<tr><th colspan='2'><span class='text-center'>Fixed Deposit A/C of ".$row["AA_NAME"]. "</span></th></tr>
<tr>
<th>ACCOUNT NO.</th>
<td>".$row["AA_ACNO"]. "</td>
</tr>
<tr>
<th>A/C Created</th>
<td>".$row["AA_TIMESTAMP"]. "</td>
</tr>
<tr>
<th>EFFECTIVE DATE</th>
<td>".$row["AA_DATE"]. "</td>
</tr>
<tr>
<th>ACCOUNT HOLDER</th>
<td>".$row["AA_NAME"]. "</td>
</tr>
<tr>
<th>ACCOUNT HOLDER's ID/CARD NO</th>
<td>".$row["AA_ICARD_NO"]. "</td>
</tr>
<tr>
<th>EMAIL ID</th>
<td>".$row["AA_EMAIL"]. "</td>
</tr>
<tr>
<th>PHONE NO.</th>
<td>".$row["AA_PHONE"]. "</td>
</tr>
<tr>
<th>ADDRESS</th>
<td>".$row["AA_ADDRESS"]. "</td>
</tr>
<tr>
<th>ACCOUNT TYPE</th>
<td>Fixed Deposit</td>
</tr>";
// Agent row - show current agent or allow assignment
echo "<tr>
<th>AGENT</th>
<td>";
if ($_SESSION['type'] === 'admin') {
echo "<form method='post' class='form-inline'>
<input type='hidden' name='ac_no' value='".$row["AA_ACNO"]."'>
<select class='form-control form-control-sm' name='ac_agent'>";
if (!empty($row["AA_AGENT"])) {
echo "<option value='".$row["AA_AGENT"]."'>Current: ".$row["AA_AGENT"]."</option>";
} else {
echo "<option value=''>- Select Agent -</option>";
}
foreach ($agentList as $agent) {
echo "<option value='".$agent['user_id']."'>".$agent['user_id']."</option>";
}
echo "</select>
<button type='submit' name='assign_agent' class='btn btn-sm btn-primary ml-2'>Assign</button>
</form>";
} else {
echo !empty($row["AA_AGENT"]) ? $row["AA_AGENT"] : "Not assigned";
}
echo "</td></tr>";
echo "
<tr>
<th>RATE OF INTEREST</th>
<td>".$row["AA_INTEREST"]. "</td>
</tr>
<tr>
<th>AMOUNT PAID</th>
<td>".$row["AA_AMOUNT"]. "</td>
</tr>
<tr>
<th>MATURITY DATE</th>
<td>".$row["AA_DATE_MATURE"]. "</td>
</tr>
<tr>
<th>NOMINEE DETAILS</th>
<td>".$row["AA_NOMINEE_DETAILS"]. "</td>
</tr>";
} elseif ($row["AA_TYPE"]== "Recurring") {
echo "
<tr><th colspan='2'><span class='text-center'>Recurring A/C of ".$row["AA_NAME"]. "</span></th></tr>
<tr>
<th>ACCOUNT NO.</th>
<td>".$row["AA_ACNO"]. "</td>
</tr>
<tr>
<th>ACCOUNT TYPE</th>
<td>".$row["AA_TYPE"]. "</td>
</tr>
<tr>
<th>PAYMENT TERM</th>
<td>".$AA_ACTYPE. "</td>
</tr>
<tr>
<th>A/C Created</th>
<td>".$row["AA_TIMESTAMP"]. "</td>
</tr>
<tr>
<th>EFFECTIVE DATE</th>
<td>".$row["AA_DATE"]. "</td>
</tr>
<tr>
<th>ACCOUNT BALANCE</th>
<td>".$row["AA_BAL"]. "</td>
</tr>
<tr>
<th>ACCOUNT HOLDER</th>
<td>".$row["AA_NAME"]. "</td>
</tr>
<tr>
<th>ID CARD NO</th>
<td>".$row["AA_ICARD_NO"]. "</td>
</tr>
<tr>
<th>EMAIL ID</th>
<td>".$row["AA_EMAIL"]. "</td>
</tr>
<tr>
<th>PHONE NO.</th>
<td>".$row["AA_PHONE"]. "</td>
</tr>
<tr>
<th>ADDRESS</th>
<td>".$row["AA_ADDRESS"]. "</td>
</tr>";
// Agent row - show current agent or allow assignment
echo "<tr>
<th>AGENT</th>
<td>";
if ($_SESSION['type'] === 'admin') {
echo "<form method='post' class='form-inline'>
<input type='hidden' name='ac_no' value='".$row["AA_ACNO"]."'>
<select class='form-control form-control-sm' name='ac_agent'>";
if (!empty($row["AA_AGENT"])) {
echo "<option value='".$row["AA_AGENT"]."'>Current: ".$row["AA_AGENT"]."</option>";
} else {
echo "<option value=''>- Select Agent -</option>";
}
foreach ($agentList as $agent) {
echo "<option value='".$agent['user_id']."'>".$agent['user_id']."</option>";
}
echo "</select>
<button type='submit' name='assign_agent' class='btn btn-sm btn-primary ml-2'>Assign</button>
</form>";
} else {
echo !empty($row["AA_AGENT"]) ? $row["AA_AGENT"] : "Not assigned";
}
echo "</td></tr>";
echo "
<tr>
<th>INTEREST</th>
<td>".$row["AA_INTEREST"]. "</td>
</tr>
<tr>
<th>INSTALLMENT AMOUNT</th>
<td>".$row["AA_INSTALLMENT"]. "</td>
</tr>
<tr>
<th>TOTAL NUMBER OF INSTALLMENTS</th>
<td>".$row["AA_NO_OF_PAYMENT"]. "</td>
</tr>
<tr>
<th>NUMBER OF INSTALLMENTS PAID</th>
<td>".$row["AA_NO_OF_PAYPAID"]. "</td>
</tr>
<tr>
<th>MATURITY DATE</th>
<td>".$row["AA_DATE_MATURE"]. "</td>
</tr>
<tr>
<th>MATURITY AMOUNT</th>
<td>".$row["AA_MATURE_VALUE"]. "</td>
</tr>
<tr>
<th>DATE</th>
<td>".$row["AA_DATE"]. "</td>
</tr>
<tr>
<th>NOMINEE DETAILS</th>
<td>".$row["AA_NOMINEE_DETAILS"]. "</td>
</tr>";
} else {
echo "
<tr>
<th style='vertical-align: middle;'>Loan A/C of {$row["AA_NAME"]}</th>
<td style='vertical-align: middle; text-align: right;'>
<form method='post' style='display: inline;'>
<input type='hidden' name='sp_close_acno' value='{$row["AA_ACNO"]}'>
<button type='submit' name='sp_loan_close_submit' class='btn " . ($row["STATUS"] === 'closed' ? 'btn-success' : 'btn-danger') . "'>" . ($row['STATUS'] === 'closed' ? 'Closed' : 'Close this Account') . "</button><br/>
" . ($row["STATUS"] === 'closed' ? "<span>" . date('d-m-Y', strtotime($row["CLOSING_DATE"])) . "</span>" : "") . "
</form>
</td>
</tr>
<tr>
<th>ACCOUNT NO.</th>
<td>".$row["AA_ACNO"]. "</td>
</tr>
<tr>
<th>PAYMENT TERM</th>
<td>".$AA_ACTYPE. "</td>
</tr>
<tr>
<th>ACCOUNT TYPE</th>
<td>".$row["AA_TYPE"]. "</td>
</tr>";
// Agent row - show current agent or allow assignment
echo "<tr>
<th>AGENT</th>
<td>";
if ($_SESSION['type'] === 'admin') {
echo "<form method='post' class='form-inline'>
<input type='hidden' name='ac_no' value='".$row["AA_ACNO"]."'>
<select class='form-control form-control-sm' name='ac_agent'>";
if (!empty($row["AA_AGENT"])) {
echo "<option value='".$row["AA_AGENT"]."'>Current: ".$row["AA_AGENT"]."</option>";
} else {
echo "<option value=''>- Select Agent -</option>";
}
foreach ($agentList as $agent) {
echo "<option value='".$agent['user_id']."'>".$agent['user_id']."</option>";
}
echo "</select>
<button type='submit' name='assign_agent' class='btn btn-sm btn-primary ml-2'>Assign</button>
</form>";
} else {
echo !empty($row["AA_AGENT"]) ? $row["AA_AGENT"] : "Not assigned";
}
echo "</td></tr>";
echo "
<tr>
<th>A/C Created</th>
<td>".$row["AA_TIMESTAMP"]. "</td>
</tr>
<tr>
<th>EFFECTIVE DATE</th>
<td>".$row["AA_DATE"]. "</td>
</tr>
<tr>
<th>ACCOUNT BALANCE</th>
<td>".$row["AA_BAL"]. "</td>
</tr>
<tr>
<th>ACCOUNT HOLDER</th>
<td>".$row["AA_NAME"]. "</td>
</tr>
<tr>
<th>ID CARD NO</th>
<td>".$row["AA_ICARD_NO"]. "</td>
</tr>
<tr>
<th>EMAIL ID</th>
<td>".$row["AA_EMAIL"]. "</td>
</tr>
<tr>
<th>PHONE NO.</th>
<td>".$row["AA_PHONE"]. "</td>
</tr>
<tr>
<th>ADDRESS</th>
<td>".$row["AA_ADDRESS"]. "</td>
</tr>
<tr>
<th>INTEREST</th>
<td>".$row["AA_INTEREST"]. "</td>
</tr>
<tr>
<th>INSTALLMENT AMOUNT</th>
<td>".$row["AA_INSTALLMENT"]. "</td>
</tr>
<tr>
<th>LOAN AMOUNT</th>
<td>".$row["AA_AMOUNT"]. "</td>
</tr>
<tr>
<th>NUMBER OF PAYMENT</th>
<td>".$row["AA_NO_OF_PAYMENT"]. "</td>
</tr>
<tr>
<th>TERM ENDING DATE</th>
<td>".$row["AA_DATE_MATURE"]. "</td>
</tr>
<tr>
<th>1st GUARANTER DETAILS</th>
<td>".$row["AA_G1_DETAILS"]. "</td>
</tr>
<tr>
<th>2nd GUARANTER DETAILS</th>
<td>".$row["AA_G2_DETAILS"]. "</td>
</tr>";
}
}
} else {
echo "<tr><td colspan='2'>0 results</td></tr>";
}
$conn->close();
?>
</table>
</div>

View File

@ -0,0 +1,46 @@
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>SL</th>
<th>Type</th>
<th>AC No</th>
<th>Name</th>
<th>Account Creation Date</th>
<th>Maturity Value</th>
<th>Balance</th>
<th>No Of Installment</th>
<th>No Of Paid Installment</th>
<th>Installment Amount</th>
</tr>
<?php
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `" . $GLOBALS['arif_ac'] . "` WHERE `AA_BAL` < 0 ORDER BY `AA_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
$tt = $row["AA_ID"] - 10;
echo "
<tr>
<td>" . $tt . "</td>
<td>" . $row["AA_ACTYPE"] . "," . $row["AA_TYPE"] . "</td>
<td><a href='./Details?no=" . $row["AA_ACNO"] . "&type=" . $row["AA_TYPE"] . "'>" . $row["AA_ACNO"] . "</a> &nbsp;&nbsp; <a href='./Trans_New?no=" . $row["AA_ACNO"] . "&type=" . $row["AA_TYPE"] . "'>Transact</a></td>
<td>" . $row["AA_NAME"] . "</td>
<td>" . $row["AA_DATE"] . "</td>
<td>" . $row["AA_MATURE_VALUE"] . "</td>
<td>" . $row["AA_BAL"] . "</td>
<td>" . $row["AA_NO_OF_PAYMENT"] . "</td>
<td>" . $row["AA_NO_OF_PAYPAID"] . "</td>
<td>" . $row["AA_INSTALLMENT"] . "</td>
</tr>";
}
} else {
echo "0 results";
};
$conn->close();
?>

View File

@ -0,0 +1,102 @@
<div class="container">
<table>
<!-- <tr>
<td>
<form>
<input type="date" name="tday">
<input type="submit" class="btn-info" value="Daily Report">
</form>
</td>
<td>
<form>
<input type="date" name="tmonth">
<input type="submit" class="btn-info" value="Monthly Report">
</form>
</td>
</tr> -->
<tr><td>.</td><td>.</td></tr>
<tr>
<td colspan="2">
<form>
<label for="">From </label><input type="date" name="dFrom">
<label for="">To </label><input type="date" name="dTo">
<input type="submit" class="btn-info" value="Report">
</form>
</td>
</tr>
</table>
</div>
<?php
function report_view($type,$dt) {
$dateFrom=$dt;
if($type!="month" || $type!="day") {
$dateFrom= strtotime($dt); $dateFrom = date("Y-m-d", $dateFrom);
$dateTo= strtotime('+1 day', strtotime($type)); $dateTo = date("Y-m-d", $dateTo);
}
//$dateFrom=$dt;
else{
if($type=="month") {$dateFrom= strtotime('-1 day', strtotime($dt)); $dateFrom = date("Y-m-d", $dateFrom);}
$dateTo = strtotime('+1 '.$type, strtotime($dt));
$dateTo = date("Y-m-d", $dateTo);
}
echo '<div class="container"> <h3>'.$dateFrom." -> ".$dateTo."(Up to)</h3> </div>";
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$totalAmount=0;
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW REPORT::::::::</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>Transaction ID</th>
<th>Time</th>
<th>AC No</th>
<th>Name</th>
<th>Amount</th>
</tr>';
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` INNER JOIN `".$GLOBALS['arif_ac']."` ON `".$GLOBALS['arif_tran']."`.`AT_ACID`=`".$GLOBALS['arif_ac']."`.`AA_ACNO` WHERE `AT_TIMESTAMP` BETWEEN '".$dateFrom." 00:00:00.000000' AND '".$dateTo." 00:00:00.000000' ORDER BY `arif_tran`.`AT_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
// $tt=$row["AT_ID"]-10;
echo "
<tr>
<td>".$row["AT_ID"]. "</td>
<td>".$row["AT_TIMESTAMP"]. "</td>
<td>".$row["AT_ACID"]. "</td>
<td>".$row["AA_NAME"]. "</td>
<td>".$row["AT_AMOUNT"]. "</td>
</tr>";$totalAmount+=$row["AT_AMOUNT"];
}
} else {
echo "0 results";
}
$conn->close();
echo '
</table>
<hr> <h2> Total Transaction amount : '.$totalAmount.'</h2>
</div>
';
}
if(isset($_GET['tday']) && $_GET['tday']!="") report_view('day',$_GET['tday']);
if(isset($_GET['tmonth']) && $_GET['tmonth']!="") report_view('month',$_GET['tmonth']);
if(isset($_GET['dFrom']) && $_GET['dTo']!="") report_view($_GET['dTo'],$_GET['dFrom']);
//if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
// if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
// if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,76 @@
<div class="container">
<form>
<input type="date" name="tday">
<input type="submit" class="btn-info" value="Daily Report">
</form>
<form>
<input type="date" name="tmonth">
<input type="submit" class="btn-info" value="Monthly Report">
</form>
</div>
<?php
function report_view($type,$dt) {
// $dateTo=$dt;
// $dateFrom = strtotime('-1 '.$type, strtotime($dt));
// $dateFrom = date("Y-m-d", $dateFrom);
$dateFrom=$dt;
if($type=="month") {$dateFrom= strtotime('-1 day', strtotime($dt)); $dateFrom = date("Y-m-d", $dateFrom);}
$dateTo = strtotime('+1 '.$type, strtotime($dt));
$dateTo = date("Y-m-d", $dateTo);
echo $dateFrom." -> ".$dateTo."(Up to)";
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$totalAmount=0;
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW REPORT::::::::</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>Transaction ID</th>
<th>Time</th>
<th>AC No</th>
<th>Amount</th>
</tr>';
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_TIMESTAMP` BETWEEN '".$dateFrom." 00:00:00.000000' AND '".$dateTo." 00:00:00.000000' ORDER BY `arif_tran`.`AT_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
// $tt=$row["AT_ID"]-10;
echo "
<tr>
<td>".$row["AT_ID"]. "</td>
<td>".$row["AT_TIMESTAMP"]. "</td>
<td>".$row["AT_ACID"]. "</td>
<td>".$row["AT_AMOUNT"]. "</td>
</tr>";$totalAmount+=$row["AT_AMOUNT"];
}
} else {
echo "0 results";
}
$conn->close();
echo '
</table>
<hr> <h2> Total Transaction amount : '.$totalAmount.'</h2>
</div>
';
}
if(isset($_GET['tday']) && $_GET['tday']!="") report_view('day',$_GET['tday']);
if(isset($_GET['tmonth']) && $_GET['tmonth']!="") report_view('month',$_GET['tmonth']);
//if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
// if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
// if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,100 @@
<div class="container">
<table>
<!-- <tr>
<td>
<form>
<input type="date" name="tday">
<input type="submit" class="btn-info" value="Daily Report">
</form>
</td>
<td>
<form>
<input type="date" name="tmonth">
<input type="submit" class="btn-info" value="Monthly Report">
</form>
</td>
</tr> -->
<tr><td>.</td><td>.</td></tr>
<tr>
<td colspan="2">
<form>
<label for="">From </label><input type="date" name="dFrom">
<label for="">To </label><input type="date" name="dTo">
<input type="submit" class="btn-info" value="Report">
</form>
</td>
</tr>
</table>
</div>
<?php
function report_view($type,$dt) {
$dateFrom=$dt;
if($type!="month" || $type!="day") {
$dateFrom= strtotime($dt); $dateFrom = date("Y-m-d", $dateFrom);
$dateTo= strtotime('+1 day', strtotime($type)); $dateTo = date("Y-m-d", $dateTo);
}
//$dateFrom=$dt;
else{
if($type=="month") {$dateFrom= strtotime('-1 day', strtotime($dt)); $dateFrom = date("Y-m-d", $dateFrom);}
$dateTo = strtotime('+1 '.$type, strtotime($dt));
$dateTo = date("Y-m-d", $dateTo);
}
echo $dateFrom." -> ".$dateTo."(Up to)";
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$totalAmount=0;
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW REPORT::::::::</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>Transaction ID</th>
<th>Time</th>
<th>AC No</th>
<th>Amount</th>
</tr>';
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_TIMESTAMP` BETWEEN '".$dateFrom." 00:00:00.000000' AND '".$dateTo." 00:00:00.000000' ORDER BY `arif_tran`.`AT_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
// $tt=$row["AT_ID"]-10;
echo "
<tr>
<td>".$row["AT_ID"]. "</td>
<td>".$row["AT_TIMESTAMP"]. "</td>
<td>".$row["AT_ACID"]. "</td>
<td>".$row["AT_AMOUNT"]. "</td>
</tr>";$totalAmount+=$row["AT_AMOUNT"];
}
} else {
echo "0 results";
}
$conn->close();
echo '
</table>
<hr> <h2> Total Transaction amount : '.$totalAmount.'</h2>
</div>
';
}
if(isset($_GET['tday']) && $_GET['tday']!="") report_view('day',$_GET['tday']);
if(isset($_GET['tmonth']) && $_GET['tmonth']!="") report_view('month',$_GET['tmonth']);
if(isset($_GET['dFrom']) && $_GET['dTo']!="") report_view($_GET['dTo'],$_GET['dFrom']);
//if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
// if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
// if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,37 @@
<div class="container">
<h1>Cancel Transaction</h1><hr>
</div>
<?php
if(isset($_POST["canc_trans"]) && isset($_POST["acc_no"]) && $_POST["acc_no"]!="" && isset($_POST["trans_amt"]) && is_numeric($_POST["trans_amt"]) ) {
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
if ($conn->query("UPDATE `".$GLOBALS['arif_ac']."` SET `AA_BAL` = `AA_BAL` - ".$_POST["trans_amt"]." WHERE `AA_ACNO` = '".$_POST["acc_no"]."'")){
$AT_USER = "Admin";
if ($conn->query("INSERT INTO `" . $GLOBALS['arif_tran'] . "` (`AT_ID`, `AT_TIMESTAMP`, `AT_ADMIN`, `AT_ACID`, `AT_AMOUNT`) VALUES (NULL, CURRENT_TIMESTAMP, '" . $AT_USER . "', '" . $_POST["acc_no"] . "', '" . $_POST["trans_amt"] . "')")) {
echo "<div class='container alert alert-success alert-dismissible fade in'><a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a><p><strong>Transaction cancelled successfully!!</strong></p><p>Account No: ".$_POST['acc_no']."</p><p>Amount deducted : Rs. ".$_POST['trans_amt']."</p></div>";
} else {
echo "<div class='container alert alert-danger alert-dismissible fade in'><a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a><p><strong>Error in Transaction!!</strong></p></div>";
}
}
else {
echo "Error in Transaction!!";
}
$conn->close();
}
?>
<div class="container">
<form method="post" enctype="multipart/form-data" id="cancelTransaction">
<input type="hidden" name="canc_trans">
<div class="form-group">
<label for="">Enter Account No:</label>
<input class="form-control" type="text" name="acc_no">
</div>
<div class="form-group">
<label for="">Enter Amount:</label>
<input class="form-control" type="number" name="trans_amt">
</div>
<button type="submit" class="btn btn-success">Submit</button>
</form>
</div>

View File

@ -0,0 +1,199 @@
<div class="container">
<div class="alert fade in" id="notif_box" style="display:none;">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong id="notif" style="font-size:30px;"></strong>
</div>
</div>
<div class="container">
<h3>Add New Agent</h3><hr>
<div class="form-group">
<input type="email" class="form-control" id="group_name" name="group_name" placeholder="Enter Group Name" required>
</div>
<div class="form-group">
<button type="button" class="btn btn-success" onclick="addNewUser()">Add Agent</button>
</div>
<div class="row">
<div class="col-md-6">
<h3>List of currently allowed Agents</h3><hr>
<ul class="list-group">
<?php
if(count(glob(__DIR__."/users/*")) === 0) {
echo 'No users found.';
} else {
foreach (glob(__DIR__."/users/*") as $filename) {
$filename = explode('/', $filename);
$filename = end($filename);
echo '<li class="list-group-item d-flex justify-content-between align-items-center">'.$filename. '<span class="badge badge-warning badge-pill" onclick="deleteUser('."'$filename'".')">X</span></li>';
}
}
?>
</ul>
</div>
</div>
</div>
<style>
.badge-warning {
background: red;
cursor: pointer;
}
</style>
<script>
function addNewUser() {
var gname = document.getElementById("group_name").value,
inFolder = 'users',
path ='/api/add_user?filename='+gname+'&inFolder='+inFolder;
fetch(path)
.then(function(response) { return response.json(); })
.then(function(json) {
if(json.status=='success') {
// console.log(json.status);
// alert(json.msg);
notification(json.status, json.msg);
location.reload(true);
} else notification(json.status, json.msg);
});
// console.log(gname);
}
function deleteUser(fname) {
var inFolder = 'users',
f='/api/delete_user?name='+fname+'&folder=/CONTENT/ROOT_URI/Admin/'+inFolder;
fetch(f)
.then(function(response) { return response.json(); })
.then(function(json) {
if(json.status=='success'){
// removeModal(fname);
// console.log(json.status);
notification(json.status, json.msg);
// location.reload(true);
}
});
}
function notification(res_status, res_txt) {
var notif_box = document.getElementById('notif_box');
var notif = document.getElementById('notif');
notif_box.style.display = 'block';
if (res_status == 'success') {
notif_box.classList.add('alert-success');
} else {
notif_box.classList.add('alert-danger');
}
notif.innerHTML = res_txt;
}
</script>
<center> <h2>Dedicate Agent to A/C </h2> </center>
<?php
// Update dedicated agent to A/C
if(isset($_POST['agentmail']) && isset($_POST['aaid']) && $_POST['agentmail']!="Select"){
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "UPDATE `".$GLOBALS['arif_ac']."` SET `AA_AGENT` = '".$_POST['agentmail']."' WHERE `arif_ac`.`AA_ID` = '".$_POST['aaid']."'";
// if( $result = $conn->query($sql) ) echo $_POST['agentmail'] , $_POST['aaid'], "Successfully Added!";
$result = $conn->query($sql);
}
function view_list_ac($type) {
$agentMails='<select name="agentmail"><option>Select</option>';
if(count(glob(__DIR__."/users/*")) === 0) {
$agentMails=$agentMails. 'No users found.';
} else {
foreach (glob(__DIR__."/users/*") as $filename) {
$filename = explode('/', $filename);
$filename = end($filename);
$agentMails=$agentMails. '<option>'.$filename. '</option>';
}
}
$agentMails=$agentMails."</select>"; //echo $agentMails;
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW CUSTOMERS</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>SL</th>
<th>Type</th>
<th>AC No</th>
<th>Name</th>
<th>Account Creation Date</th>
<th>Loan Amount</th>
<th>PHONE</th>
<th>Balance</th>
<th>Dedicated Agent</th>
<th>Dedicate an Agent</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_TYPE`='".$type."' ORDER BY `AA_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
$tt=$row["AA_ID"]-10;
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if($type === 'Loan'){
$no_paid_inst = ($row["AA_MATURE_VALUE"] + $row["AA_BAL"]) / $row["AA_INSTALLMENT"];
} else {
$no_paid_inst = $row["AA_BAL"] / $row["AA_INSTALLMENT"];
}
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
echo "
<tr>
<td>".$tt."</td>
<td>".$row["AA_ACTYPE"].",".$row["AA_TYPE"]."</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_DATE"]."</td>
<td>".$row["AA_MATURE_VALUE"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_AGENT"].'</td>
<td><form method="post"> <input type="hidden" name="aaid" value="'.$row["AA_ID"].'">'.$agentMails.' <input type="submit" value="Dedicete"></form></td>
</tr>';
}
} else {
echo "0 results";
};
$conn->close();
echo '
</table>
</div>
';
}
view_list_ac('Loan');
view_list_ac('Recurring');
//
// if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
// if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
// if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,323 @@
<?php
// Database connection
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
$conn->set_charset("utf8");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// grafinn01
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$user_id = $_POST['user_id'];
if (empty($_POST['user_name']) || empty($_POST['user_phone']) || empty($_POST['password'])) {
die("All fields are required.");
}
$user_name = $_POST['user_name'];
$user_phone = $_POST['user_phone'];
$type = $_POST['type'] ?? 'agent';
$password = password_hash($_POST['password'], PASSWORD_DEFAULT);
if (!preg_match("/^[0-9]{10}$/", $user_phone)) {
die("Invalid phone number format");
}
$table = $GLOBALS['arif_users'] ?? 'arif_users';
$sql = "INSERT INTO `$table` (user_id, password, type, user_name, user_phone) VALUES (?, ?, ?, ?, ?)";
$stmt = $conn->prepare($sql);
if (!$stmt) {
die("Prepare failed: " . $conn->error);
}
$stmt->bind_param("sssss", $user_id, $password, $type, $user_name, $user_phone);
if ($stmt->execute()) {
echo "<div class='alert alert-success'>User <strong>{$user_name}</strong> added successfully.</div>";
} else {
echo "<div class='alert alert-danger'>Failed to add user <strong>{$user_name}</strong>. Error: " . $stmt->error . "</div>";
}
$stmt->close();
$conn->close();
}
$getAgentListsQuery = "SELECT * FROM " . $GLOBALS['arif_users'] . " ORDER BY type, user_id";
$agentResult = $conn->query($getAgentListsQuery);
$agentList = [];
if ($agentResult && $agentResult->num_rows > 0) {
while ($row = $agentResult->fetch_assoc()) {
$agentList[] = $row;
}
}
?>
<div class="container">
<div class="alert fade in" id="notif_box" style="display:none;">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong id="notif" style="font-size:30px;"></strong>
</div>
</div>
<div class="container">
<h3>Add New Agent</h3><hr>
<form method="post">
<div class="row">
<!-- Left Column -->
<div class="col-md-6">
<div class="form-group">
<label for="user_name">Full Name</label>
<input type="text" class="form-control" id="user_name" name="user_name" placeholder="Enter Full Name" required>
</div>
<div class="form-group">
<label for="user_phone">Phone Number</label>
<input type="tel" class="form-control" id="user_phone" name="user_phone" placeholder="Enter Phone Number" required>
</div>
<div class="form-group">
<label for="user_id">User ID</label>
<input class="form-control" type="text" name="user_id" id="user_id" placeholder="Enter unique User ID"/>
</div>
<div class="form-group">
<label for="type">User Type</label>
<select class="form-control" id="type" name="type" required>
<option value="agent" selected>Agent</option>
<option value="admin">Admin</option>
<option value="supervisor">Supervisor</option>
</select>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" class="form-control" id="password" name="password" placeholder="Enter Password" required>
</div>
<div class="form-group">
<button type="submit" class="btn btn-success w-100">Add Agent</button>
</div>
</div>
<!-- Right Column (empty for now) -->
<div class="col-md-6">
<!-- You can add more form fields here -->
</div>
</div>
</form>
<div class="container">
<h3>User Management</h3>
<hr>
<table class="table table-striped table-bordered table-hover">
<thead class="thead-dark">
<tr>
<th>ID</th>
<th>User ID</th>
<th>User Type</th>
<th>Name</th>
<th>Phone</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php if (!empty($agentList)): ?>
<?php foreach ($agentList as $user): ?>
<tr>
<td><?php echo htmlspecialchars($user['id']); ?></td>
<td><?php echo htmlspecialchars($user['user_id']); ?></td>
<td>
<span class="badge <?php echo $user['type'] === 'admin' ? 'badge-primary' : 'badge-secondary'; ?>">
<?php echo htmlspecialchars($user['type']); ?>
</span>
</td>
<td><?php echo htmlspecialchars($user['user_name']); ?></td>
<td><?php echo htmlspecialchars($user['user_phone']); ?></td>
<td>
<a href="edit_user?id=<?php echo $user['id']; ?>" class="btn btn-sm btn-warning">Edit</a>
<a href="delete_user?id=<?php echo $user['id']; ?>" class="btn btn-sm btn-danger" onclick="return confirm('Are you sure?')">Delete</a>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="6" class="text-center">No users found</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php if ($_SESSION['type'] === 'admin'): ?>
<div class="text-right mb-3">
<a href="add_user.php" class="btn btn-primary">Add New User</a>
</div>
<?php endif; ?>
</div>
<?php $conn->close(); ?>
</div>
<style>
.badge-warning {
background: red;
cursor: pointer;
}
</style>
<script>
function addNewUser() {
var gname = document.getElementById("group_name").value,
inFolder = 'users',
path ='/api/add_user?filename='+gname+'&inFolder='+inFolder;
fetch(path)
.then(function(response) { return response.json(); })
.then(function(json) {
if(json.status=='success') {
// console.log(json.status);
// alert(json.msg);
notification(json.status, json.msg);
location.reload(true);
} else notification(json.status, json.msg);
});
// console.log(gname);
}
function deleteUser(fname) {
var inFolder = 'users',
f='/api/delete_user?name='+fname+'&folder=/CONTENT/ROOT_URI/Admin/'+inFolder;
fetch(f)
.then(function(response) { return response.json(); })
.then(function(json) {
if(json.status=='success'){
// removeModal(fname);
// console.log(json.status);
notification(json.status, json.msg);
// location.reload(true);
}
});
}
function notification(res_status, res_txt) {
var notif_box = document.getElementById('notif_box');
var notif = document.getElementById('notif');
notif_box.style.display = 'block';
if (res_status == 'success') {
notif_box.classList.add('alert-success');
} else {
notif_box.classList.add('alert-danger');
}
notif.innerHTML = res_txt;
}
</script>
<center> <h2>Dedicate Agent to A/C </h2> </center>
<?php
// Update dedicated agent to A/C
if(isset($_POST['agentmail']) && isset($_POST['aaid']) && $_POST['agentmail']!="Select"){
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "UPDATE `".$GLOBALS['arif_ac']."` SET `AA_AGENT` = '".$_POST['agentmail']."' WHERE `arif_ac`.`AA_ID` = '".$_POST['aaid']."'";
// if( $result = $conn->query($sql) ) echo $_POST['agentmail'] , $_POST['aaid'], "Successfully Added!";
$result = $conn->query($sql);
}
function view_list_ac($type) {
$agentMails='<select name="agentmail"><option>Select</option>';
if(count(glob(__DIR__."/users/*")) === 0) {
$agentMails=$agentMails. 'No users found.';
} else {
foreach (glob(__DIR__."/users/*") as $filename) {
$filename = explode('/', $filename);
$filename = end($filename);
$agentMails=$agentMails. '<option>'.$filename. '</option>';
}
}
$agentMails=$agentMails."</select>"; //echo $agentMails;
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW CUSTOMERS</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>SL</th>
<th>Type</th>
<th>AC No</th>
<th>Name</th>
<th>Account Creation Date</th>
<th>Loan Amount</th>
<th>PHONE</th>
<th>Balance</th>
<th>Dedicated Agent</th>
<th>Dedicate an Agent</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_TYPE`='".$type."' ORDER BY `AA_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
$tt=$row["AA_ID"]-10;
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if($type === 'Loan'){
$no_paid_inst = ($row["AA_MATURE_VALUE"] + $row["AA_BAL"]) / $row["AA_INSTALLMENT"];
} else {
$no_paid_inst = $row["AA_BAL"] / $row["AA_INSTALLMENT"];
}
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
echo "
<tr>
<td>".$tt."</td>
<td>".$row["AA_ACTYPE"].",".$row["AA_TYPE"]."</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_DATE"]."</td>
<td>".$row["AA_MATURE_VALUE"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_AGENT"].'</td>
<td><form method="post"> <input type="hidden" name="aaid" value="'.$row["AA_ID"].'">'.$agentMails.' <input type="submit" value="Dedicete"></form></td>
</tr>';
}
} else {
echo "0 results";
};
$conn->close();
echo '
</table>
</div>
';
}
view_list_ac('Loan');
view_list_ac('Recurring');
//
// if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
// if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
// if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,17 @@
<?php
session_start();
// Destroy all session data
$_SESSION = [];
session_unset();
session_destroy();
// Remove EMAIL cookie if exists
if (isset($_COOKIE['EMAIL'])) {
setcookie('EMAIL', '', time() - 3600, '/'); // expire the cookie
}
// Redirect to login page or home
echo '<script>window.location.href = "/Admin/";</script>';
exit;
?>

View File

@ -0,0 +1,290 @@
<script>
function calculateFine() {
var due_amount = document.getElementById('due_amount'),
inst_no = document.getElementById('inst_no').value,
inst_amount = document.getElementById('inst_amount').value,
total_rec = document.getElementById('total_rec').value,
// rec_amount = document.getElementById('rec_amount'),
fine = document.getElementById('fine');
due_amount = parseInt(due_amount.value);
fine = parseInt(fine.value);
// document.getElementById('due_amount').value = due_amount;
// document.getElementById('rec_amount').value = due_amount + fine;
document.getElementById('total_amount').value = inst_amount * inst_no + fine;
document.getElementById('hidden_total_rec').value = inst_amount * inst_no;
document.getElementById('total_rec').value = inst_amount * inst_no;
}
function calculateAmount() {
var inst_amount = document.getElementById('inst_amount').value,
// rec_amount = document.getElementById('rec_amount').value,
inst_no = document.getElementById('inst_no').value;
show_amount = document.getElementById('show_amount').value;
// document.getElementById('rec_amount').value = inst_amount * inst_no;
// document.getElementById('show_amount').value = inst_amount * inst_no;
document.getElementById('total_amount').value = inst_amount * inst_no;
document.getElementById('hidden_total_amount').value = inst_amount * inst_no;
}
</script>
<div class="container" style="margin-top: 20px;margin-bottom:20px;">
<form method="get" action="Trans_New">
<div class="form-group">
<input class="form-control" type="text" placeholder="input A/C no and enter" name="no">
</div>
</form>
</div>
<?php
if(isset($_GET["no"]) && isset($_GET["type"])&&$_GET["type"]=="Loan"){
echo '
<div class="container" style="margin-top: 20px;"> <h5>New Transaction : '.$GLOBALS['post_info'].' </h5><hr></div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Remaining Amount</th>
<th>Installment</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $_GET['type'] == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 40) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo'
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT']. '" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
if(isset($_GET["no"]) && isset($_GET["type"])&&$_GET["type"]=="Recurring"){
echo '
<div class="container" style="margin-top: 10px;"> <h5>New Transaction : '.$GLOBALS['post_info'].' </h5><hr></div>
<div class="container table-responsive">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Total Deposit</th>
<th>Installment</th>
<th>Receive Amount</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$row["AA_NAME"]. "</td>
<td>".$row["AA_PHONE"]. "</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_INSTALLMENT"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $_GET['type'] == "Recurring") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 20) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo '
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
?>
<div class="container" style="margin-top: 70px;">
<div class="row">
<div class="col-md-2">
<h5>Past Transactions::::</h5>
</div>
<div class="col-md-2">
<button class="btn btn-success" onclick="window.location.reload()">Refresh</button>
</div>
</div><hr>
</div>
<?php
if(isset($_GET["no"])){
echo '
<div class="container table-responsive">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>SL</th>
<th>Tr No</th>
<th>TimeStamp</th>
<th>User</th>
<th>A/C No</th>
<th>Amount</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
// $sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_ACID` = '".$_GET['no']."'";
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_ACID` = '".$_GET['no']."' ORDER BY `".$GLOBALS['arif_tran']."`.`AT_ID` DESC";
$result = $conn->query($sql);
$rowcount=mysqli_num_rows($result);//$rowcount++;
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$rowcount. "</td>
<td>".$row["AT_ID"]. "</td>
<td>".$row["AT_TIMESTAMP"]. "</td>
<td>".$row["AT_ADMIN"]. "</td>
<td>".$row["AT_ACID"]. "</td>
<td>".$row["AT_AMOUNT"]. "</td>
</tr>";
$rowcount--;
}
} else echo "No Past record Found";
mysqli_free_result($result);$conn->close();
echo '</table></div>';
}
?>
<script>
var submitInstallment = document.getElementById("submitInstallment");
function sendData(event) {
event.preventDefault();
var XHR = new XMLHttpRequest();
var FD = new FormData(submitInstallment);
XHR.addEventListener("load", function (event) {
var obj = JSON.parse(event.target.responseText);
// console.log(obj);
alert(obj.statusmsg);
// window.location.reload(true);
window.history.back();
});
XHR.addEventListener("error", function () {
alert('Error', 'Ooops!! Something went wrong.');
});
console.log(FD);
XHR.open("POST", "/exe/receive_amount/");
XHR.send(FD);
}
</script>

View File

@ -0,0 +1,289 @@
<script>
function calculateFine() {
var due_amount = document.getElementById('due_amount'),
inst_no = document.getElementById('inst_no').value,
inst_amount = document.getElementById('inst_amount').value,
total_rec = document.getElementById('total_rec').value,
// rec_amount = document.getElementById('rec_amount'),
fine = document.getElementById('fine');
due_amount = parseInt(due_amount.value);
fine = parseInt(fine.value);
// document.getElementById('due_amount').value = due_amount;
// document.getElementById('rec_amount').value = due_amount + fine;
document.getElementById('total_amount').value = inst_amount * inst_no + fine;
document.getElementById('hidden_total_rec').value = inst_amount * inst_no;
document.getElementById('total_rec').value = inst_amount * inst_no;
}
function calculateAmount() {
var inst_amount = document.getElementById('inst_amount').value,
// rec_amount = document.getElementById('rec_amount').value,
inst_no = document.getElementById('inst_no').value;
show_amount = document.getElementById('show_amount').value;
// document.getElementById('rec_amount').value = inst_amount * inst_no;
// document.getElementById('show_amount').value = inst_amount * inst_no;
document.getElementById('total_amount').value = inst_amount * inst_no;
document.getElementById('hidden_total_amount').value = inst_amount * inst_no;
}
</script>
<div class="container" style="margin-top: 20px;margin-bottom:20px;">
<form method="get" action="Trans_New">
<div class="form-group">
<input class="form-control" type="text" placeholder="input A/C no and enter" name="no">
</div>
</form>
</div>
<?php
if(isset($_GET["no"]) && isset($_GET["type"])&&$_GET["type"]=="Loan"){
echo '
<div class="container" style="margin-top: 20px;"> <h5>New Transaction : '.$GLOBALS['post_info'].' </h5><hr></div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Remaining Amount</th>
<th>Installment</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $_GET['type'] == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 40) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo'
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT']. '" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
if(isset($_GET["no"]) && isset($_GET["type"])&&$_GET["type"]=="Recurring"){
echo '
<div class="container" style="margin-top: 10px;"> <h5>New Transaction : '.$GLOBALS['post_info'].' </h5><hr></div>
<div class="container table-responsive">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Total Deposit</th>
<th>Installment</th>
<th>Receive Amount</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$row["AA_NAME"]. "</td>
<td>".$row["AA_PHONE"]. "</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_INSTALLMENT"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $_GET['type'] == "Recurring") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 20) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo '
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
?>
<div class="container" style="margin-top: 70px;">
<div class="row">
<div class="col-md-2">
<h5>Past Transactions::::</h5>
</div>
<div class="col-md-2">
<button class="btn btn-success" onclick="window.location.reload()">Refresh</button>
</div>
</div><hr>
</div>
<?php
if(isset($_GET["no"])){
echo '
<div class="container table-responsive">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>SL</th>
<th>Tr No</th>
<th>TimeStamp</th>
<th>User</th>
<th>A/C No</th>
<th>Amount</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
// $sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_ACID` = '".$_GET['no']."'";
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_ACID` = '".$_GET['no']."' ORDER BY `".$GLOBALS['arif_tran']."`.`AT_ID` DESC";
$result = $conn->query($sql);
$rowcount=mysqli_num_rows($result);//$rowcount++;
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$rowcount. "</td>
<td>".$row["AT_ID"]. "</td>
<td>".$row["AT_TIMESTAMP"]. "</td>
<td>".$row["AT_ADMIN"]. "</td>
<td>".$row["AT_ACID"]. "</td>
<td>".$row["AT_AMOUNT"]. "</td>
</tr>";
$rowcount--;
}
} else echo "No Past record Found";
mysqli_free_result($result);$conn->close();
echo '</table></div>';
}
?>
<script>
var submitInstallment = document.getElementById("submitInstallment");
function sendData(event) {
event.preventDefault();
var XHR = new XMLHttpRequest();
var FD = new FormData(submitInstallment);
XHR.addEventListener("load", function (event) {
var obj = JSON.parse(event.target.responseText);
// console.log(obj);
alert(obj.statusmsg);
window.location.reload(true);
});
XHR.addEventListener("error", function () {
alert('Error', 'Ooops!! Something went wrong.');
});
console.log(FD);
XHR.open("POST", "/exe/receive_amount/");
XHR.send(FD);
}
</script>

View File

@ -0,0 +1,114 @@
<div class="container" style="background-color:#e0a3a3;padding:8px;">
<ul class="nav nav-pills nav-justified">
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="FD") echo'class="active"';?>><a href="View_AC?Type=FD">Fixed Deposits</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Loan") echo'class="active"';?>><a href="View_AC?Type=Loan">Loan A/C</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Recurring") echo'class="active"';?>><a href="View_AC?Type=Recurring">Recurring A/Cs</a></li>
</ul>
</div>
<?php
function view_list_ac($type) {
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW CUSTOMERS</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>SL</th>
<th>Type</th>
<th>AC No</th>
<th>Name</th>
<th>Account Creation Date</th>
<th>Loan Amount</th>
<th>PHONE</th>
<th>Balance</th>
<th>Total No Of Installment to be paid</th>
<th>No Of Paid Installment</th>
<th>No of Expected Installment till today</th>
<th>Installment Amount</th>
<th>Due Installment</th>
<th>Due Amount</th>
<th>Due after Fine</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_TYPE`='".$type."' ORDER BY `AA_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
$tt=$row["AA_ID"]-10;
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if($type === 'Loan'){
$no_paid_inst = ($row["AA_MATURE_VALUE"] + $row["AA_BAL"]) / $row["AA_INSTALLMENT"];
} else {
$no_paid_inst = $row["AA_BAL"] / $row["AA_INSTALLMENT"];
}
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
echo "
<tr>
<td>".$tt."</td>
<td>".$row["AA_ACTYPE"].",".$row["AA_TYPE"]."</td>
<td><a href='./Details?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>".$row["AA_ACNO"]."</a> &nbsp;&nbsp; <a href='./Trans_New?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>Transact</a></td>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_DATE"]."</td>
<td>".$row["AA_MATURE_VALUE"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_NO_OF_PAYMENT"]."</td>
<td>".$no_paid_inst."</td>
<td>".$diff."</td>
<td>".$row["AA_INSTALLMENT"]."</td>
<td>".$due_i."</td>";
if ($due_i > 0) {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
else {
$due_amount = 'All Clear';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
if ($due_i > 0 && $type == "Recurring") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = (($due_amount) * 20)/100;
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
elseif ($due_i > 0 && $type == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = (($due_amount) * 40)/100;
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
else {
$due_amount = 'Up to Date!!';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
echo "</tr>";
}
} else {
echo "0 results";
};
$conn->close();
echo '
</table>
</div>
';
}
if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,122 @@
<div class="container" style="background-color:#e0a3a3;padding:8px;">
<ul class="nav nav-pills nav-justified">
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="FD") echo'class="active"';?>><a href="View_AC?Type=FD">Fixed Deposits</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Loan") echo'class="active"';?>><a href="View_AC?Type=Loan">Loan A/C</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Recurring") echo'class="active"';?>><a href="View_AC?Type=Recurring">Recurring A/Cs</a></li>
</ul>
</div>
<?php
function view_list_ac($type) {
if($type=="Loan") $matNloan="Loan Amount"; else $matNloan= "Matured Amount";
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW CUSTOMERS</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>SL</th>
<th>Type</th>
<th>AC No</th>
<th>Name</th>
<th>Account Creation Date</th>
<th>'.$matNloan.'</th>
<th>PHONE</th>
<th>Balance</th>
<th>Total No Of Installment to be paid</th>
<th>No Of Paid Installment</th>
<th>No of Expected Installment till today</th>
<th>Installment Amount</th>
<!-- <th>Due Installment</th> -->
<th>Due Amount</th>
<!-- <th>Due after Fine</th> -->
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_TYPE`='".$type."' ORDER BY `AA_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
$AC_STATUS="";
$tt=$row["AA_ID"]-10;
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if($type === 'Loan'){
$no_paid_inst = ($row["AA_MATURE_VALUE"] + $row["AA_BAL"]) / $row["AA_INSTALLMENT"];
} else {
$no_paid_inst = $row["AA_BAL"] / $row["AA_INSTALLMENT"];
}
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
// if($type=="Loan"){ if($row["AA_BAL"]<0)$DueAmount=$row["AA_MATURE_VALUE"]+$row["AA_BAL"]; elseif($row["AA_MATURE_VALUE"]+$row["AA_BAL"]==0) $DueAmount=["AA_MATURE_VALUE"]; else $DueAmount=0; if($row["AA_BAL"]==0)$AC_STATUS="Completed";} else {$DueAmount=$row["AA_MATURE_VALUE"]-$row["AA_BAL"];}
if($type=="Loan"){ if($row["AA_BAL"]==0) {$AC_STATUS="Completed";$DueAmount=0;} elseif($row["AA_BAL"]<0) $DueAmount=$row["AA_BAL"]; else $DueAmount=$row["AA_MATURE_VALUE"]+$row["AA_BAL"]; }
$due_i=$DueAmount/$row["AA_INSTALLMENT"];
$ExpectedInstallment = $row["AA_NO_OF_PAYMENT"]-$no_paid_inst;
echo "
<tr>
<td>".$tt."</td>
<td>".$row["AA_ACTYPE"].",".$row["AA_TYPE"]."</td>
<td><a href='./Details?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>".$row["AA_ACNO"]."</a> &nbsp;&nbsp;";
if($AC_STATUS=="Completed") echo "AC Completed"; else echo "<a href='./Trans_New?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>Transact</a></td>";
echo"
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_DATE"]."</td>
<td>".$row["AA_MATURE_VALUE"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_NO_OF_PAYMENT"]."</td>
<td>".$no_paid_inst."</td>
<td>".$ExpectedInstallment."</td>
<td>".$row["AA_INSTALLMENT"]."</td>";
//<td>".$due_i."</td>"; //<td>".$DueAmount."</td>";
if ($due_i < 0) {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
else {
$due_amount = 'All Clear';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
// if ($due_i < 0 && $type == "Recurring") {
// $due_amount = $due_i * $row["AA_INSTALLMENT"];
// $due_amount = (($due_amount) * 20)/100;
// echo "<td class='alert danger text-danger'>".$due_amount."</td>";
// }
// elseif ($due_i < 0 && $type == "Loan") {
// $due_amount = $due_i * $row["AA_INSTALLMENT"];
// $due_amount = (($due_amount) * 40)/100;
// echo "<td class='alert danger text-danger'>".$due_amount."</td>";
// }
// else {
// $due_amount = 'Up to Date!!';
// echo "<td class='alert success text-success'>".$due_amount."</td>";
// }
echo "</tr>";
}
} else {
echo "0 results";
};
$conn->close();
echo '
</table>
</div>
';
}
if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,155 @@
<div class="container" style="background-color:#e0a3a3;padding:8px;">
<ul class="nav nav-pills nav-justified">
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="FD") echo'class="active"';?>><a href="View_AC?Type=FD">Fixed Deposits</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Loan") echo'class="active"';?>><a href="View_AC?Type=Loan">Loan A/C</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Recurring") echo'class="active"';?>><a href="View_AC?Type=Recurring">Recurring A/Cs</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Closed-Acc") echo'class="active"';?>><a href="View_AC?Type=Closed-Acc">Closed A/C</a></li>
</ul>
</div>
<?php
function view_list_ac($type) {
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW CUSTOMERS</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>SL</th>
<th>Type</th>
';
if ($_SESSION['type'] === 'admin') {
echo '<th>Agent</th>';
}
echo '
<th>AC No</th>
<th>Name</th>
<th>Account Creation Date</th>
<th>Loan Amount</th>
<th>PHONE</th>
<th>Balance</th>
<th>Total No Of Installment to be paid</th>
<th>No Of Paid Installment</th>
<th>No of Expected Installment till today</th>
<th>Installment Amount</th>
<th>Due Installment</th>
<th>Due Amount</th>
<th>Due after Fine</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Build SQL query based on user type and account type
if($_SESSION['type'] === 'agent') {
if($type === 'Closed-Acc') {
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `STATUS`='Closed' AND `AA_AGENT`='".$_SESSION['user_id']."' ORDER BY `AA_ID` DESC";
} else {
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_TYPE`='".$type."' AND `AA_AGENT`='".$_SESSION['user_id']."' ORDER BY `AA_ID` DESC";
}
} elseif($_SESSION['type'] === 'admin') {
if($type === 'Closed-Acc') {
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `STATUS`='Closed' ORDER BY `AA_ID` DESC";
} else {
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_TYPE`='".$type."' ORDER BY `AA_ID` DESC";
}
}
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$tt = $row["AA_ID"] - 10;
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if($type === 'Loan') {
$no_paid_inst = ($row["AA_MATURE_VALUE"] + $row["AA_BAL"]) / $row["AA_INSTALLMENT"];
} else {
$no_paid_inst = $row["AA_BAL"] / $row["AA_INSTALLMENT"];
}
if ($row["AA_ACTYPE"] == 'D') {
$diff = $diff->format("%a");
$diff = (int)$diff;
$due_i = $diff - $no_paid_inst;
} else {
$diff = $diff->format("%m");
$diff = (int)$diff;
$due_i = $diff - $no_paid_inst;
}
echo "<tr>
<td>".$tt."</td>
<td>".$row["AA_ACTYPE"].",".$row["AA_TYPE"]."</td>";
// Only show Agent column for admin users
if ($_SESSION['type'] === 'admin') {
echo "<td>".$row["AA_AGENT"]."</td>";
}
echo "<td><a href='./Details?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>".$row["AA_ACNO"]."</a> &nbsp;&nbsp; <a href='./Trans_New?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>Transact</a></td>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_DATE"]."</td>
<td>".$row["AA_MATURE_VALUE"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_NO_OF_PAYMENT"]."</td>
<td>".$no_paid_inst."</td>
<td>".$diff."</td>
<td>".$row["AA_INSTALLMENT"]."</td>
<td>".$due_i."</td>";
if ($due_i > 0) {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
} else {
$due_amount = 'All Clear';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
if ($due_i > 0 && $type == "Recurring") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = (($due_amount) * 20)/100;
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
} elseif ($due_i > 0 && $type == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = (($due_amount) * 40)/100;
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
} else {
$due_amount = 'Up to Date!!';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
echo "</tr>";
}
} else {
echo "<tr><td colspan='".($_SESSION['type'] === 'admin' ? '15' : '14')."'>0 results</td></tr>";
}
$conn->close();
echo '</table></div>';
}
if(isset($_GET['Type'])) {
switch($_GET['Type']) {
case "Loan":
view_list_ac('Loan');
break;
case "Recurring":
view_list_ac('Recurring');
break;
case "FD":
view_list_ac('FD');
break;
case "Closed-Acc":
view_list_ac('Closed-Acc');
break;
}
}
?>

View File

@ -0,0 +1,110 @@
<div class="container" style="background-color:#e0a3a3;padding:8px;">
<ul class="nav nav-pills nav-justified">
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="FD") echo'class="active"';?>><a href="View_AC?Type=FD">Fixed Deposits</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Loan") echo'class="active"';?>><a href="View_AC?Type=Loan">Loan A/C</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Recurring") echo'class="active"';?>><a href="View_AC?Type=Recurring">Recurring A/Cs</a></li>
</ul>
</div>
<?php
function view_list_ac($type) {
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW CUSTOMERS</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>SL</th>
<th>Type</th>
<th>AC No</th>
<th>Name</th>
<th>Account Creation Date</th>
<th>Maturity Value</th>
<th>PHONE</th>
<th>Balance</th>
<th>Total No Of Installment to be paid</th>
<th>No Of Paid Installment</th>
<th>No of Expected Installment till today</th>
<th>Installment Amount</th>
<th>Due Installment</th>
<th>Due Amount</th>
<th>Due after Fine</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_TYPE`='".$type."' ORDER BY `AA_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
$tt=$row["AA_ID"]-10;
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
$no_paid_inst = $row["AA_BAL"] / $row["AA_INSTALLMENT"];
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
echo "
<tr>
<td>".$tt."</td>
<td>".$row["AA_ACTYPE"].",".$row["AA_TYPE"]."</td>
<td><a href='./Details?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>".$row["AA_ACNO"]."</a> &nbsp;&nbsp; <a href='./Trans_New?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>Transact</a></td>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_DATE"]."</td>
<td>".$row["AA_MATURE_VALUE"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_NO_OF_PAYMENT"]."</td>
<td>".$no_paid_inst."</td>
<td>".$diff."</td>
<td>".$row["AA_INSTALLMENT"]."</td>
<td>".$due_i."</td>";
if ($due_i > 0) {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
else {
$due_amount = 'All Clear';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
if ($due_i > 0 && $type == "Recurring") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = (($due_amount) * 20)/100;
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
elseif ($due_i > 0 && $type == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = (($due_amount) * 40)/100;
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
else {
$due_amount = 'Up to Date!!';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
echo "</tr>";
}
} else {
echo "0 results";
};
$conn->close();
echo '
</table>
</div>
';
}
if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,156 @@
<script>
function calculateFine() {
var due_amount = document.getElementById('due_amount'),
inst_no = document.getElementById('inst_no').value,
inst_amount = document.getElementById('inst_amount').value,
total_rec = document.getElementById('total_rec').value,
// rec_amount = document.getElementById('rec_amount'),
fine = document.getElementById('fine');
due_amount = parseInt(due_amount.value);
fine = parseInt(fine.value);
// document.getElementById('due_amount').value = due_amount;
// document.getElementById('rec_amount').value = due_amount + fine;
document.getElementById('total_amount').value = inst_amount * inst_no + fine;
document.getElementById('hidden_total_rec').value = inst_amount * inst_no;
document.getElementById('total_rec').value = inst_amount * inst_no;
}
function calculateAmount() {
var inst_amount = document.getElementById('inst_amount').value,
// rec_amount = document.getElementById('rec_amount').value,
inst_no = document.getElementById('inst_no').value;
show_amount = document.getElementById('show_amount').value;
// document.getElementById('rec_amount').value = inst_amount * inst_no;
// document.getElementById('show_amount').value = inst_amount * inst_no;
document.getElementById('total_amount').value = inst_amount * inst_no;
document.getElementById('hidden_total_amount').value = inst_amount * inst_no;
}
</script>
<div class="container" style="margin-top: 20px;margin-bottom:20px;">
<form method="get" action="Agent_Trans_New">
<div class="form-group">
<input class="form-control" type="text" placeholder="Input A/C no and press enter" name="no">
</div>
</form>
</div>
<?php
if(isset($_GET["no"])) {
echo '
<div class="container" style="margin-top: 20px;"> <h3>New Transaction</h3><hr></div>
<div class="container">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Remaining Amount</th>
<th>Installment</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){
$diff = $diff->format("%a");
$diff = (int)$diff;
$due_i = $diff - $row["AA_NO_OF_PAYPAID"];
} else {
$diff = $diff->format("%m");
$diff = (int)$diff;
$due_i = $diff - $row["AA_NO_OF_PAYPAID"];
}
echo "
<tr>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $row["AA_TYPE"] == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 40) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo'
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT']. '" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
?>
<script>
var submitInstallment = document.getElementById("submitInstallment");
function sendData(event) {
event.preventDefault();
var XHR = new XMLHttpRequest();
var FD = new FormData(submitInstallment);
XHR.addEventListener("load", function (event) {
var obj = JSON.parse(event.target.responseText);
// console.log(obj);
alert(obj.statusmsg);
// alert(obj.status);
window.location.reload(true);
});
XHR.addEventListener("error", function () {
alert('Error', 'Ooops!! Something went wrong.');
});
// console.log(FD);
XHR.open("POST", "/exe/receive_amount/");
XHR.send(FD);
}
</script>

View File

@ -0,0 +1,157 @@
<script>
function calculateFine() {
var due_amount = document.getElementById('due_amount'),
inst_no = document.getElementById('inst_no').value,
inst_amount = document.getElementById('inst_amount').value,
total_rec = document.getElementById('total_rec').value,
// rec_amount = document.getElementById('rec_amount'),
fine = document.getElementById('fine');
due_amount = parseInt(due_amount.value);
fine = parseInt(fine.value);
// document.getElementById('due_amount').value = due_amount;
// document.getElementById('rec_amount').value = due_amount + fine;
document.getElementById('total_amount').value = inst_amount * inst_no + fine;
document.getElementById('hidden_total_rec').value = inst_amount * inst_no;
document.getElementById('total_rec').value = inst_amount * inst_no;
}
function calculateAmount() {
var inst_amount = document.getElementById('inst_amount').value,
// rec_amount = document.getElementById('rec_amount').value,
inst_no = document.getElementById('inst_no').value;
show_amount = document.getElementById('show_amount').value;
// document.getElementById('rec_amount').value = inst_amount * inst_no;
// document.getElementById('show_amount').value = inst_amount * inst_no;
document.getElementById('total_amount').value = inst_amount * inst_no;
document.getElementById('hidden_total_amount').value = inst_amount * inst_no;
}
</script>
<div class="container" style="margin-top: 20px;margin-bottom:20px;">
<form method="get" action="Agent_Trans_New">
<div class="form-group">
<input class="form-control" type="text" placeholder="Input A/C no and press enter" name="no">
</div>
</form>
</div>
<?php
if(isset($_GET["no"])) {
echo '
<div class="container" style="margin-top: 20px;"> <h3>New Transaction</h3><hr></div>
<div class="container">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Remaining Amount</th>
<th>Installment</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){
$diff = $diff->format("%a");
$diff = (int)$diff;
$due_i = $diff - $row["AA_NO_OF_PAYPAID"];
} else {
$diff = $diff->format("%m");
$diff = (int)$diff;
$due_i = $diff - $row["AA_NO_OF_PAYPAID"];
}
echo "
<tr>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $row["AA_TYPE"] == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 40) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<!-- changed the line to disable fine change for agents <input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()"> -->
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" disabled">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo'
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT']. '" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
?>
<script>
var submitInstallment = document.getElementById("submitInstallment");
function sendData(event) {
event.preventDefault();
var XHR = new XMLHttpRequest();
var FD = new FormData(submitInstallment);
XHR.addEventListener("load", function (event) {
var obj = JSON.parse(event.target.responseText);
// console.log(obj);
alert(obj.statusmsg);
// alert(obj.status);
window.location.reload(true);
});
XHR.addEventListener("error", function () {
alert('Error', 'Ooops!! Something went wrong.');
});
// console.log(FD);
XHR.open("POST", "/exe/receive_amount/");
XHR.send(FD);
}
</script>

View File

@ -0,0 +1,9 @@
<?php
session_unset();
if(isset($_COOKIE['EMAIL'])){
header_remove();
setcookie('EMAIL', $_POST['EMAIL'], time() - (86400 * 30), "/");
echo '<script>window.location.relode();</script>';
}
else echo '<script>window.location.assign("/Admin/");</script>';
?>

View File

@ -0,0 +1,4 @@
<?php
include("Trans_New.php");
?>

View File

@ -0,0 +1,293 @@
<script>
function calculateFine() {
var due_amount = document.getElementById('due_amount'),
inst_no = document.getElementById('inst_no').value,
inst_amount = document.getElementById('inst_amount').value,
total_rec = document.getElementById('total_rec').value,
// rec_amount = document.getElementById('rec_amount'),
fine = document.getElementById('fine');
due_amount = parseInt(due_amount.value);
fine = parseInt(fine.value);
// document.getElementById('due_amount').value = due_amount;
// document.getElementById('rec_amount').value = due_amount + fine;
document.getElementById('total_amount').value = inst_amount * inst_no + fine;
document.getElementById('hidden_total_rec').value = inst_amount * inst_no;
document.getElementById('total_rec').value = inst_amount * inst_no;
}
function calculateAmount() {
var inst_amount = document.getElementById('inst_amount').value,
// rec_amount = document.getElementById('rec_amount').value,
inst_no = document.getElementById('inst_no').value;
show_amount = document.getElementById('show_amount').value;
// document.getElementById('rec_amount').value = inst_amount * inst_no;
// document.getElementById('show_amount').value = inst_amount * inst_no;
document.getElementById('total_amount').value = inst_amount * inst_no;
document.getElementById('hidden_total_amount').value = inst_amount * inst_no;
}
</script>
<div class="container" style="margin-top: 20px;margin-bottom:20px;">
<form method="get" action="Trans_New">
<div class="form-group">
<input class="form-control" type="text" placeholder="input A/C no and enter" name="no">
</div>
</form>
</div>
<?php
if(isset($_GET["no"]) && isset($_GET["type"])&&$_GET["type"]=="Loan"){
echo '
<div class="container" style="margin-top: 20px;"> <h5>New Transaction : '.$GLOBALS['post_info'].' </h5><hr></div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Remaining Amount</th>
<th>Installment</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $_GET['type'] == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 40) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<!-- change this line to disable change fine <input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()"> -->
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" disabled">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo'
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT']. '" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
if(isset($_GET["no"]) && isset($_GET["type"])&&$_GET["type"]=="Recurring"){
echo '
<div class="container" style="margin-top: 10px;"> <h5>New Transaction : '.$GLOBALS['post_info'].' </h5><hr></div>
<div class="container table-responsive">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Total Deposit</th>
<th>Installment</th>
<th>Receive Amount</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$row["AA_NAME"]. "</td>
<td>".$row["AA_PHONE"]. "</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_INSTALLMENT"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $_GET['type'] == "Recurring") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 20) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo '
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
?>
<div class="container" style="margin-top: 70px;">
<div class="row">
<div class="col-md-2">
<h5>Past Transactions::::</h5>
</div>
<div class="col-md-2">
<button class="btn btn-success" onclick="window.location.reload()">Refresh</button>
</div>
</div><hr>
</div>
<?php
if(isset($_GET["no"])){
echo '
<div class="container table-responsive">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>SL</th>
<th>Tr No</th>
<th>TimeStamp</th>
<th>User</th>
<th>A/C No</th>
<th>Amount</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
// $sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_ACID` = '".$_GET['no']."'";
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_ACID` = '".$_GET['no']."' ORDER BY `".$GLOBALS['arif_tran']."`.`AT_ID` DESC";
$result = $conn->query($sql);
$rowcount=mysqli_num_rows($result);//$rowcount++;
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$rowcount. "</td>
<td>".$row["AT_ID"]. "</td>
<td>".$row["AT_TIMESTAMP"]. "</td>
<td>".$row["AT_ADMIN"]. "</td>
<td>".$row["AT_ACID"]. "</td>
<td>".$row["AT_AMOUNT"]. "</td>
</tr>";
$rowcount--;
}
} else echo "No Past record Found";
mysqli_free_result($result);$conn->close();
echo '</table></div>';
}
?>
<script>
var submitInstallment = document.getElementById("submitInstallment");
function sendData(event) {
event.preventDefault();
var XHR = new XMLHttpRequest();
var FD = new FormData(submitInstallment);
XHR.addEventListener("load", function (event) {
var obj = JSON.parse(event.target.responseText);
// console.log(obj);
alert(obj.statusmsg);
// window.location.reload(true);
window.history.back();
});
XHR.addEventListener("error", function () {
alert('Error', 'Ooops!! Something went wrong.');
});
console.log(FD);
XHR.open("POST", "/exe/receive_amount/");
XHR.send(FD);
}
</script>

View File

@ -0,0 +1,112 @@
<div class="container" style="background-color:#e0a3a3;padding:8px;">
<ul class="nav nav-pills nav-justified">
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="FD") echo'class="active"';?>><a href="View_ac?Type=FD">Fixed Deposits</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Loan") echo'class="active"';?>><a href="View_ac?Type=Loan">Loan A/C</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Recurring") echo'class="active"';?>><a href="View_ac?Type=Recurring">Recurring A/Cs</a></li>
</ul>
</div>
<?php
// var_dump($_SESSION['EMAIL']);
function view_list_ac($type) {
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW CUSTOMERS</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>SL</th>
<th>Type</th>
<th>AC No</th>
<th>Name</th>
<th>Account Creation Date</th>
<th>Loan Amount</th>
<th>PHONE</th>
<th>Balance</th>
<th>Total No Of Installment to be paid</th>
<th>No Of Paid Installment</th>
<th>No of Expected Installment till today</th>
<th>Installment Amount</th>
<th>Due Installment</th>
<th>Due Amount</th>
<th>Due after Fine</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_TYPE`='".$type."' AND `AA_AGENT`='".$_SESSION['EMAIL']."' ORDER BY `AA_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
$tt=$row["AA_ID"]-10;
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if($type === 'Loan'){
$no_paid_inst = ($row["AA_MATURE_VALUE"] + $row["AA_BAL"]) / $row["AA_INSTALLMENT"];
} else {
if($row["AA_INSTALLMENT"]==0)$no_paid_inst = "NaN"; else $no_paid_inst = $row["AA_BAL"] / $row["AA_INSTALLMENT"];
}
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
echo "
<tr>
<td>".$tt."</td>
<td>".$row["AA_ACTYPE"].",".$row["AA_TYPE"]."</td>
<td><a href='./Details?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>".$row["AA_ACNO"]."</a> &nbsp;&nbsp; <a href='./Trans_New?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>Transact</a></td>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_DATE"]."</td>
<td>".$row["AA_MATURE_VALUE"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_NO_OF_PAYMENT"]."</td>
<td>".$no_paid_inst."</td>
<td>".$diff."</td>
<td>".$row["AA_INSTALLMENT"]."</td>
<td>".$due_i."</td>";
if ($due_i > 0) {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
else {
$due_amount = 'All Clear';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
if ($due_i > 0 && $type == "Recurring") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = (($due_amount) * 20)/100;
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
elseif ($due_i > 0 && $type == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = (($due_amount) * 40)/100;
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
else {
$due_amount = 'Up to Date!!';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
echo "</tr>";
}
} else {
echo "0 results";
};
$conn->close();
echo '
</table>
</div>
';
}
if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,120 @@
<div class="container">
<table>
<!-- <tr>
<td>
<form>
<input type="date" name="tday">
<input type="submit" class="btn-info" value="Daily Report">
</form>
</td>
<td>
<form>
<input type="date" name="tmonth">
<input type="submit" class="btn-info" value="Monthly Report">
</form>
</td>
</tr> -->
<tr><td>.</td><td>.</td></tr>
<tr>
<td colspan="2">
<form method="post">
<select name="Agent">
<option value=""> Select Agent </option>
<?php
$users = glob(APP_DIR.'/CONTENT/ROOT_URI/Admin/users/*');
$user_arr = array();
for($i = 0; $i < count($users); $i++) {
$new_user = explode('/', $users[$i]);
$new_user = end($new_user);
echo '<option value="'.$new_user.'">'.$new_user.'</option>';
// $user_arr[$i] = $new_user;
}
?>
</select>
<label for="">From </label><input type="date" name="dFrom">
<label for="">To </label><input type="date" name="dTo">
<input type="submit" class="btn-info" value="Report">
</form>
</td>
</tr>
</table>
</div>
<?php
function report_view($type,$dt) {
$dateFrom=$dt;
if($type!="month" || $type!="day") {
$dateFrom= strtotime($dt); $dateFrom = date("Y-m-d", $dateFrom);
$dateTo= strtotime('+1 day', strtotime($type)); $dateTo = date("Y-m-d", $dateTo);
}
//$dateFrom=$dt;
else{
if($type=="month") {$dateFrom= strtotime('-1 day', strtotime($dt)); $dateFrom = date("Y-m-d", $dateFrom);}
$dateTo = strtotime('+1 '.$type, strtotime($dt));
$dateTo = date("Y-m-d", $dateTo);
}
echo '<div class="container"> <h3>'.$dateFrom." -> ".$dateTo."(Up to)</h3> </div>";
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$totalAmount=0;
$agent="";if(isset($_POST['Agent'])) $agent=$_POST['Agent']; else $agent=$_SESSION['EMAIL'];
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW REPORT:::::::: </h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>Transaction ID</th>
<th>Time</th>
<th>AC No</th>
<th>Name</th>
<th>Amount</th>
<th>commission</th>
</tr>';
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` INNER JOIN `".$GLOBALS['arif_ac']."` ON `".$GLOBALS['arif_tran']."`.`AT_ACID`=`".$GLOBALS['arif_ac']."`.`AA_ACNO` WHERE `AT_TIMESTAMP` BETWEEN '".$dateFrom." 00:00:00.000000' AND '".$dateTo." 00:00:00.000000'
AND `AA_AGENT`= '".$agent."' ORDER BY `AT_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
// $tt=$row["AT_ID"]-10;
echo "
<tr>
<td>".$row["AT_ID"]. "</td>
<td>".$row["AT_TIMESTAMP"]. "</td>
<td>".$row["AT_ACID"]. "</td>
<td>".$row["AA_NAME"]. "</td>
<td>".$row["AT_AMOUNT"]. "</td>
<td>".$row["AT_AMOUNT"]/100*2.5 . "</td>
</tr>";$totalAmount+=$row["AT_AMOUNT"];
}
} else {
echo "0 results";
}
$conn->close();
echo '
</table>
<hr> <h2> Total Transaction amount : '.$totalAmount.'</h2>
<hr> <h2> Total Commission amount : '.$totalAmount/100*2.5 .'</h2>
</div>
';
}
if(isset($_POST['tday']) && $_POST['tday']!="") report_view('day',$_POST['tday']);
if(isset($_POST['tmonth']) && $_POST['tmonth']!="") report_view('month',$_POST['tmonth']);
if(isset($_POST['dFrom']) && $_POST['dTo']!="") report_view($_POST['dTo'],$_POST['dFrom']);
//if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
// if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
// if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,19 @@
<?php
function require_login() {
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
// Prevent redirect loop for login page
$current_path = $_SERVER['REQUEST_URI'];
if (strpos($current_path, '/Admin/login') !== false) {
return;
}
if (!isset($_SESSION['user_id'])) {
error_log("Redirecting to login.php from: $current_path");
header("Location: /Admin/login");
exit();
}
}

View File

@ -0,0 +1,185 @@
<?php
session_start();
// Check if user is logged in and is admin
// if (!isset($_SESSION['type']) || $_SESSION['type'] !== 'admin') {
// header("Location: login.php");
// exit();
// }
// Database connection
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
$conn->set_charset("utf8");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Get user details
$user = [];
if (isset($_GET['id'])) {
$user_id = $conn->real_escape_string($_GET['id']);
$sql = "SELECT * FROM `".$GLOBALS['arif_users']."` WHERE id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("i", $user_id);
$stmt->execute();
$result = $stmt->get_result();
$user = $result->fetch_assoc();
$stmt->close();
if (!$user) {
die("User not found");
}
}
// Handle form submission
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$id = $_POST['id'];
$user_name = $_POST['user_name'];
$user_phone = $_POST['user_phone'];
$type = $_POST['type'];
$user_id = $_POST['user_id'];
// Validate inputs
if (empty($user_name) || empty($user_phone) || empty($user_id)) {
$error = "All fields are required except password";
} elseif (!preg_match("/^[0-9]{10}$/", $user_phone)) {
$error = "Invalid phone number format";
} else {
// Update query
if (!empty($_POST['password'])) {
// Update with password
$password = password_hash($_POST['password'], PASSWORD_DEFAULT);
$sql = "UPDATE `".$GLOBALS['arif_users']."` SET
user_id = ?,
user_name = ?,
user_phone = ?,
type = ?,
password = ?
WHERE id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("sssssi", $user_id, $user_name, $user_phone, $type, $password, $id);
} else {
// Update without password
$sql = "UPDATE `".$GLOBALS['arif_users']."` SET
user_id = ?,
user_name = ?,
user_phone = ?,
type = ?
WHERE id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("ssssi", $user_id, $user_name, $user_phone, $type, $id);
}
if ($stmt->execute()) {
$success = "User updated successfully!";
// Refresh user data
$sql = "SELECT * FROM `".$GLOBALS['arif_users']."` WHERE id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("i", $id);
$stmt->execute();
$result = $stmt->get_result();
$user = $result->fetch_assoc();
$stmt->close();
} else {
$error = "Error updating user: " . $conn->error;
}
}
}
?>
<div>
<div class="container">
<h3>Edit User</h3>
<hr>
<?php if (isset($error)): ?>
<div class="alert alert-danger"><?php echo htmlspecialchars($error); ?></div>
<?php endif; ?>
<?php if (isset($success)): ?>
<div class="alert alert-success"><?php echo htmlspecialchars($success); ?></div>
<?php endif; ?>
<?php if (!empty($user)): ?>
<form method="post">
<input type="hidden" name="id" value="<?php echo htmlspecialchars($user['id']); ?>">
<div class="row">
<div class="col-md-6">
<div class="form-group mb-3">
<label for="user_id" class="form-label">User ID</label>
<input type="text" class="form-control" id="user_id" name="user_id"
value="<?php echo htmlspecialchars($user['user_id']); ?>" required>
</div>
<div class="form-group mb-3">
<label for="user_name" class="form-label">Full Name</label>
<input type="text" class="form-control" id="user_name" name="user_name"
value="<?php echo htmlspecialchars($user['user_name']); ?>" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group mb-3">
<label for="user_phone" class="form-label">Phone Number</label>
<input type="tel" class="form-control" id="user_phone" name="user_phone"
value="<?php echo htmlspecialchars($user['user_phone']); ?>" required>
</div>
<div class="form-group mb-3">
<label for="type" class="form-label">User Type</label>
<select class="form-control" id="type" name="type" required>
<option value="agent" <?php echo $user['type'] === 'agent' ? 'selected' : ''; ?>>Agent</option>
<option value="admin" <?php echo $user['type'] === 'admin' ? 'selected' : ''; ?>>Admin</option>
<option value="supervisor" <?php echo $user['type'] === 'supervisor' ? 'selected' : ''; ?>>Supervisor</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group mb-3">
<label for="password" class="form-label">New Password (leave blank to keep current)</label>
<input type="password" class="form-control" id="password" name="password">
<small class="text-muted">Password must be at least 8 characters long</small>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<button type="submit" class="btn btn-primary">Update User</button>
<a href="/Admin/Settings_Agent" class="btn ">Cancel</a>
</div>
</div>
</form>
<?php else: ?>
<div class="alert alert-danger">User not found</div>
<?php endif; ?>
</div>
</div>
<script>
// Simple password strength check
document.getElementById('password').addEventListener('input', function(e) {
if (this.value.length > 0 && this.value.length < 8) {
this.setCustomValidity("Password must be at least 8 characters");
} else {
this.setCustomValidity("");
}
});
</script>
<style>
.badge-primary {
background-color: #007bff;
}
.badge-secondary {
background-color: #6c757d;
}
.badge-warning {
background-color: #ffc107;
}
.container {
max-width: 800px;
margin-top: 30px;
}
</style>
<?php $conn->close(); ?>

View File

@ -0,0 +1 @@
admin panel home

View File

@ -0,0 +1,24 @@
<?php
$lnk2 = explode('?', $lnk);
include("ADMIN_HEADER.php");
//if(isset($_SESSION['EMAIL']) && ($_SESSION['EMAIL'] =="sarkar.suvankar@gmail.com" || $_SESSION['EMAIL']=="samiran.in@gmail.com" || $_SESSION['EMAIL']=="arif.kanyashree@gmail.com") ) {
// if($_SESSION['EMAIL'] =="sarkar.suvankar@gmail.com" || $_SESSION['EMAIL']=="samiran.in@gmail.com" || $_SESSION['EMAIL']=="arif.kanyashree@gmail.com") {
// if(isset($_SESSION['EMAIL']) && ($_SESSION['EMAIL'] =="sarkar.suvankar@gmail.com" || $_SESSION['EMAIL']=="samiran.in@gmail.com" || $_SESSION['EMAIL']=="arif.kanyashree@gmail.com") ) {
include("ADMIN_nav.php");
echo "<br>";
if($lnk=="") include("home.php");
elseif(file_exists(__DIR__."/".$lnk.".php")) include($lnk.".php");
elseif(isset($lnk2[1]) && file_exists(__DIR__."/".$lnk2[0].".php") ) include($lnk2[0].".php");
else include("404.php");
/*}
elseif(get_user() == true){
include("AGENT_nav.php");
echo "<br>";
if($lnk=="") include("home.php");
elseif(file_exists(__DIR__."/agent_".$lnk.".php")) include("agent_".$lnk.".php");
elseif(isset($lnk2[1]) && file_exists(__DIR__."/agent_".$lnk2[0].".php") ) include("agent_".$lnk2[0].".php");
else include("404.php");
} else echo '<center><h2>Provide Details to login</h2> <a href="https://siliconpin.com/id/auth"><button class="btn btn-default">Login</button></a></center>'; */
include("ADMIN_FOOTER.php");
?>

View File

@ -0,0 +1,23 @@
<?php
$lnk2 = explode('?', $lnk);
include("ADMIN_HEADER.php");//print file_get_contents('http://www.example.com/');var_dump(gethostbyaddr($_SERVER['HTTP_REFERER']));// echo $lnk."c";
/*
echo $_SERVER['HTTP_USER_AGENT'] . "\n\n";
$browser = get_browser(null, true);
print_r($browser);echo $_SERVER['HTTP_REFERER'];*/
// include("ADMIN_nav.php");
if(isset($_SESSION['EMAIL']) || isset($_COOKIE['EMAIL']) ){
include("ADMIN_nav.php");
echo "<br>";
if($lnk=="") include("home.php");
elseif(file_exists(__DIR__."/".$lnk.".php")) include($lnk.".php");
elseif(isset($lnk2[1]) && file_exists(__DIR__."/".$lnk2[0].".php") ) include($lnk2[0].".php");
else include("404.php");
}else echo '<center>
<h2>Provide Details to login</h2> <a href="https://siliconpin.com/id/auth"><button class="btn btn-default">Login</button></a> </center>';
include("ADMIN_FOOTER.php");
?>

View File

@ -0,0 +1,77 @@
<?php
session_start();
// DB Connection
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
// Handle form submission
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$userId = trim($_POST['user_id'] ?? '');
$password = $_POST['pwd'] ?? '';
if (empty($userId) || empty($password)) {
echo "<div class='alert alert-danger'>Please fill in all fields.</div>";
} else {
// Prepare statement to prevent SQL injection
$stmt = $conn->prepare("SELECT * FROM " . $GLOBALS['arif_users'] . " WHERE user_id = ?");
$stmt->bind_param("s", $userId);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows === 1) {
$user = $result->fetch_assoc();
if (password_verify($password, $user['password'])) {
// Login successful
$_SESSION['user_id'] = $user['user_id'];
$_SESSION['type'] = $user['type'];
echo "<div class='alert alert-success'>Login successful. Redirecting...</div>";
echo "<script>setTimeout(() => { window.location.href = '/Admin/View_AC?Type=Loan'; }, 2000);</script>";
} else {
echo "<div class='alert alert-danger'>Invalid password.</div>";
}
} else {
echo "<div class='alert alert-danger'>No account found with this User ID.</div>";
}
$stmt->close();
}
}
?>
<!-- Gradient Background -->
<div class="bg-gradient" style=" min-height: 100vh;">
<div class="container py-5">
<div class="mx-auto" style="max-width: 420px; margin: auto; margin-top: 100px; background: linear-gradient(135deg, #f5f7fa, #d9dce0ff);">
<div class="card shadow-lg border-0 rounded-4 p-4" style="padding: 20px;">
<h4 class="text-center mb-4 fw-semibold text-primary">Login to Your Account</h4>
<form method="post" enctype="multipart/form-data">
<div class="mb-3">
<label for="user_id" class="form-label">User ID:</label>
<input type="email" class="form-control form-control-lg rounded-3 shadow-sm" id="user_id" name="user_id" placeholder="Enter your email" required>
</div>
<div class="mb-3">
<label for="pwd" class="form-label">Password</label>
<input type="password" class="form-control form-control-lg rounded-3 shadow-sm" id="pwd" name="pwd" placeholder="Enter your password" required>
</div>
<div class="form-check mb-3">
<input type="checkbox" class="form-check-input" id="remember" name="remember">
<label class="form-check-label" for="remember">Remember me</label>
</div>
<div class="d-grid">
<button type="submit" class="btn btn-md btn-primary">Login</button>
</div>
</form>
<div class="text-center mt-3">
<a href="#" class="text-decoration-none text-secondary">Forgot password?</a>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,58 @@
<div class="container">
<?php echo $GLOBALS['alert_info'] ?>
</div>
<div class="container">
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="FORM_NAME" value="new_news_entry">
<input type="hidden" name="lang" value="BN">
<div ng-app="myApp" ng-controller="myCtrl" class="form-group">
<select class="form-control" name="news_category"><option ng-repeat="x in names">{{x}}</option></select>
</select>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.names = [<?php include APP_DIR."/CONTENT/VARIABLES/news_type_list_en.php";?>];
});
</script>
<div class="form-group">
<input type="text" class="form-control" name="news_link" placeholder="Meta/Link for this news entry">
<small id="emailHelp" class="form-text text-muted">Alphanumeric(A-Z,a-z,0-9).</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="news_title" placeholder="Title for this new">
</div>
<div class="form-group">
<textarea class="form-control" rows="5" name="news_content" placeholder="News content text"></textarea>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<label class="btn btn-default btn-file">
<input name="photo_news" type="file" >
</label>
<!-- Multiple upload not needed for now! <div class="fileinput fileinput-new" data-provides="fileinput">
<span class="btn btn-default btn-file"><span></span><input type="file" multiple /></span>
<span class="fileinput-filename"></span><span class="fileinput-new"></span>
</div>-->
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input">
Check me out
</label>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
<!--<div class="row">
<iframe width="100%" height="350" src="https://www.youtube.com/embed/UXJTvnf-meU" frameborder="0" allowfullscreen></iframe>
</div>-->
</form>
</div>

View File

@ -0,0 +1,57 @@
<div class="container">
<?php echo $GLOBALS['alert_info'] ?>
</div>
<div class="container">
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="FORM_NAME" value="new_news_entry">
<input type="hidden" name="lang" value="EN">
<div ng-app="myApp" ng-controller="myCtrl" class="form-group">
<select class="form-control" name="news_category"><option ng-repeat="x in names">{{x}}</option></select>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.names = [<?php include APP_DIR."/CONTENT/VARIABLES/news_type_list_en.php";?>];
});
</script>
<div class="form-group">
<input type="text" class="form-control" name="news_link" placeholder="Meta/Link for this news entry">
<small id="emailHelp" class="form-text text-muted">Alphanumeric(A-Z,a-z,0-9).</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="news_title" placeholder="Title for this new">
</div>
<div class="form-group">
<textarea class="form-control" rows="5" name="news_content" placeholder="News content text"></textarea>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<label class="btn btn-default btn-file">
<input name="photo_news" type="file" >
</label>
<!-- Multiple upload not needed for now! <div class="fileinput fileinput-new" data-provides="fileinput">
<span class="btn btn-default btn-file"><span></span><input type="file" multiple /></span>
<span class="fileinput-filename"></span><span class="fileinput-new"></span>
</div>-->
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input">
Check me out
</label>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
<!--<div class="row">
<iframe width="100%" height="350" src="https://www.youtube.com/embed/UXJTvnf-meU" frameborder="0" allowfullscreen></iframe>
</div>-->
</form>
</div>

View File

@ -0,0 +1,11 @@
<?php echo $_POST["name"]; ?><br>
<?php echo $_POST["email"]; ?>
<div class="container">
<form method="POST">
<input type="text" name="name" placeholder="name" class="frist"/>
<input type="text" name="email" placeholder="email"/>
<input type="submit" value="submit" />
</form>
</div>

View File

@ -0,0 +1,3 @@
<div class="container">
</div>

View File

@ -0,0 +1,129 @@
<script>
function update_pri(id) {
var idn='pri'+id;
if (id.length == 0) {
alert("Input Error!");
return;
} else {
var pri=document.getElementById(idn).value;
document.getElementById(idn).disabled = true;
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById(idn).disabled = false;
document.getElementById(idn).value = this.responseText;
}
};
xmlhttp.open("GET", "/execute.php?id=" + id + "&pri="+pri, true);
xmlhttp.send();
}
}
</script>
<script>
function switch_state(id) {
var idn='act'+id;
if (id.length == 0) {
alert("Input Error!");
return;
} else {
var active=document.getElementById(idn).value;
document.getElementById(idn).disabled = true;
console.log(idn);
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById(idn).disabled = false;
document.getElementById(idn).value = this.responseText;
}
};
xmlhttp.open("GET", "/execute2.php?id=" + id + "&active="+active, true);
xmlhttp.send();
}
}
</script>
<div class="container table-responsive">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>ID</th>
<th>TITLE</th>
<th>DATE</th>
<th>CATEGORY</th>
<th>PRIORITY</th>
<th>STATE</th>
</tr>
<?php
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
$conn->set_charset("utf8");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM ".$GLOBALS['table1'];
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//echo "id: " . $row["N_TITLE"]. " - Name: " . $row["N_DATE"]. " " . $row["N_CATEGORY"]." " . $row["pri"]. "<br>";
$ID=$row["id"];
echo "
<tr>
<td>" . $ID. "</td>
<td>" . $row["N_TITLE"]. "</td>
<td>" . $row["N_DATE"]. "</td>
<td>" . $row["N_CATEGORY"]. "</td>
<td>
<form method='post'>
<input type='number' name='pri' id='pri" .$ID. "' value='" . $row["pri"]. "'>
<input type='hidden' name='id' value='" .$ID. "'>
<input class='btn btn-success' type='button' name='priority' value='SAVE' onclick='update_pri(" .'"'.$ID.'"'. ")'>
</form>
</td>
<td>
<select name='state' id='act" .$ID. "' onchange='switch_state(" .'"'.$ID.'"'. ")' >
<option>".$row['ACTIVE']."</option>
<option>0</option>
<option>1</option>
</select>
</td>
</tr>";
}
} else {
echo "0 results";
};
$conn->close();
?>
<?php
if(isset($_POST['priority']) && $_POST['priority']=='SUBMIT')
{
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "UPDATE `".$GLOBALS["table1"]."` SET `pri` = '".$_POST['pri']."' WHERE `news`.`id` =".$_POST['id'];
$result = $conn->query($sql);
if(!$result) echo mysqli_error(); else echo "Successfully Updated! <br />";
$conn->close();
}
?>
<?php
if(isset($_POST['statebtn']) && $_POST['statebtn']=='SUBMIT')
{
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "UPDATE `".$GLOBALS["table1"]."` SET `ACTIVE` = '".$_POST['active']."' WHERE `news`.`id` =".$_POST['id'];
$result = $conn->query($sql);
if(!$result) echo mysqli_error(); else echo "Successfully Updated! <br />";
$conn->close();
}
?>
</table>
</div>

View File

@ -0,0 +1,10 @@
</body>
<script src="/CONTENT/cal_GV.js"></script>
<script>
//document.getElementsByName("CA_No_Of_Payment")[0].addEventListener("input", cal_mature);
</script>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Gramin Venture POS Portal</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/asset/css/bootstrap.min.css">
<script src="/asset/js/jquery.min.js"></script>
<script src="/asset/js/bootstrap.min.js"></script>
<script src="/asset/js/angular.min.js"></script>
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>-->
</head>
<body>

View File

@ -0,0 +1,42 @@
<style>
.logo {
display: inline-block;
margin: auto;
vertical-align: middle;
}
</style>
<!-- nav start -->
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a href="/Admin/"><img class="img-responsive logo" style="height:50px" src="/asset/images/logo.webp" alt=""></a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- <a class="navbar-brand" href="/Admin/">Gramin Venture</a> -->
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li ><a href="/Admin/Create_AC_Recurring">New Recurring </a></li>
<li ><a href="/Admin/Create_AC_FD">New FD </a></li>
<li ><a href="/Admin/Create_AC_Loan">New Loan </a></li>
<li ><a href="/Admin/Add_group">Add New Group </a></li>
<li><a href="/Admin/View_AC?Type=Recurring">View A/C</a></li>
<li><a href="/Admin/Trans_New">Transaction</a></li> <!-- Added -->
<li><a href="/Admin/Report">Report</a></li>
<li><a href="/Admin/Due">Due</a></li>
<li><a href="/Admin/Revert">Revert</a></li>
<li><a href="/Admin/Settings_Agent">Agent Settings</a></li>
</ul>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="/Admin/Signout">Signout</a></li>
</ul>
</div>
</div>
</nav>

View File

@ -0,0 +1,42 @@
<style>
.navbar-default {
background-color: #0b208e;
border-color: #0b208e;
border-radius: 0;
}
.logo {
display: inline-block;
margin: auto;
vertical-align: middle;
}
</style>
<!-- nav start -->
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a href="/Admin/"><img class="img-responsive logo" style="height:50px" src="/asset/images/logo.webp" alt=""></a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- <a class="navbar-brand" href="/Admin/">Gramin Venture</a> -->
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="/Admin/Agent_Trans_New">NEW Transaction</a></li> <!-- Added -->
<li><a href="/Admin/View_ac?Type=Loan">View AC</a></li> <!-- Added -->
<li><a href="/Admin/View_trans">View Transaction</a></li>
<!-- <li><a href="/Admin/View_report">Report</a></li> -->
<li><a href="/Admin/View_report">Commission</a></li>
</ul>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="/Admin/Signout">Signout</a></li>
</ul>
</div>
</div>
</nav>

View File

@ -0,0 +1,65 @@
<div class="container">
<h3>Add New Group</h3><hr>
<div class="form-group">
<input type="text" class="form-control text-capitalize" id="group_name" name="group_name" placeholder="Enter Group Name" required>
</div>
<div class="form-group">
<button type="button" class="btn btn-success" onclick="addNewGroup()">Add Group</button>
</div>
<div class="row">
<div class="col-md-6">
<h3>List of currently available groups</h3><hr>
<ul class="list-group text-capitalize">
<?php
foreach (glob(__DIR__."/group_names/*") as $filename) {
$filename = explode('/', $filename);
$filename = end($filename);
echo '<li class="list-group-item d-flex justify-content-between align-items-center">'.$filename. '<span class="badge badge-warning badge-pill" onclick="deleteGroup('."'$filename'".')">X</span></li>';
}
?>
</ul>
</div>
</div>
</div>
<style>
.badge-warning {
background: red;
cursor: pointer;
}
</style>
<script>
function addNewGroup() {
var gname = document.getElementById("group_name").value,
inFolder = 'group_names',
path ='/api/create_file?filename='+gname+'&inFolder='+inFolder;
fetch(path)
.then(function(response) { return response.json(); })
.then(function(json) {
if(json.status=='success') {
// createButton(fname,inFolder,inDiv);
console.log(json.status);
alert(json.msg);
location.reload(true);
}
});
console.log(gname);
}
function deleteGroup(fname) {
var inFolder = 'group_names',
f='/api/delete_file?name='+fname+'&folder=/CONTENT/ROOT_URI/Admin/'+inFolder;
fetch(f)
.then(function(response) { return response.json(); })
.then(function(json) {
if(json.status=='success'){
// removeModal(fname);
console.log(json.status);
alert(json.msg);
location.reload(true);
}
});
}
</script>

View File

@ -0,0 +1,105 @@
<div class="container">
<?php
if(isset($_POST["ac_type"]) && isset($_POST["ac_name"]) && $_POST["ac_name"]!="" && is_numeric($_POST["Mature_Value"]) ) {
$return_json['NotiFi'] = "";$return_json['NotiFi_m'] = "";$return_json['NotiFi_d'] = "";
$ca["ac_type"]=$_POST["ac_type"];
$ca["ac_name"]=$_POST["ac_name"];
$ca["ac_phone"]=$_POST["ac_phone"];
$ca["ac_mail"]=$_POST["ac_mail"];
$ca["ac_address"]=$_POST["ac_address"];
$ca["ac_no"]="GV".$_POST["ac_type"].date("Ymd")."F";
//GC_new_entry($ca);
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$t="FD";
$stmt = $conn->prepare("INSERT INTO ".$GLOBALS['arif_ac']." (`AA_ICARD_NO`,`AA_NOMINEE_DETAILS`,`AA_INTEREST`,`AA_DATE`, `AA_DATE_MATURE`, `AA_NO_OF_PAYMENT`,`AA_AMOUNT`, `AA_MATURE_VALUE`, `AA_TYPE`,`AA_ACTYPE`,`AA_NAME`, `AA_PHONE`, `AA_EMAIL`, `AA_ADDRESS`, `AA_ADMIN`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("sssssssssssssss" ,$_POST["AA_ICARD_NO"],$_POST["AA_NOMINEE_DETAILS"],$_POST["CA_interest"], $_POST["date_today"],$_POST["date_mature"],$_POST["CA_No_Of_Payment"],$_POST["CA_Amount"],$_POST["Mature_Value"], $t,$ca["ac_type"],$ca["ac_name"],$ca["ac_phone"],$ca["ac_mail"],$ca["ac_address"],$_SESSION["EMAIL"]);
if($stmt->execute()){
$lid=$conn->insert_id;$ca["ac_no"]=$ca["ac_no"].$lid;
if($conn->query("UPDATE `".$GLOBALS['arif_ac']."` SET `AA_ACNO` = '".$ca["ac_no"]."' WHERE `AA_ID` =".$lid.";"))
{$return_json['NotiFi'] = "OK";$return_json['NotiFi_m'] = "New FD A/C Created !";$return_json['NotiFi_d'] = "<a href='./Details?no=".$ca["ac_no"]."'>A/C NO- ".$ca["ac_no"]."</a>";}
else{$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error Creating New Recurring A/C !";$return_json['NotiFi_d'] = "Failed in Secondary Execution";}
}else printf("Error: %s.\n", $stmt->error);
$stmt->close();
$conn->close();
echo $return_json['NotiFi'],$return_json['NotiFi_m'],$return_json['NotiFi_d'];
} //else {$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error on input !";$return_json['NotiFi_d'] = "Check Input Details";}
//echo json_encode($return_json);
?>
</div>
<div class="container">
<form method="post" enctype="multipart/form-data" id="new_fd">
<input type="hidden" name="ac_type" value="F">
<div class="form-group">
<input type="text" class="form-control text-capitalize" name="ac_name" placeholder="Name" >
<small id="emailHelp" class="form-text text-muted">A/C Holder Name*</small>
</div>
<div class="form-group">
<input type="text" class="form-control text-uppercase" name="AA_ICARD_NO" placeholder="I-CARD NO" required>
</div>
<table><tr>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_Amount" oninput="cal_FD();">
<small id="emailHelp" class="form-text text-muted">Amount*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_interest" value="8">
<small id="emailHelp" class="form-text text-muted">interest*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_No_Of_Payment" oninput="cal_FD();cal_FD_md();" >
<small id="emailHelp" class="form-text text-muted">Month*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="Mature_Value" id="Mature_Value" value="">
<small id="emailHelp" class="form-text text-muted">Mature Value*</small>
</div></td>
</tr></table>
<div class="form-group">
<input type="text" class="form-control" id="date_today" name="date_today" value="<?php echo date('Y-m-d');?>" >
<small id="emailHelp" class="form-text text-muted">Date*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="date_mature" >
<small id="emailHelp" class="form-text text-muted">Mature Date*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_phone" placeholder="Phone No">
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_mail" placeholder="Email">
</div>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="ac_address" placeholder="Address"></textarea>
</div>
<hr>
<small class="form-text text-muted"><u>Nominee details*</u></small>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="AA_NOMINEE_DETAILS" required>Name:
DOB:
Relation:
ID:
</textarea>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-md-offset-5 col-sm-12 col-xs-12">
<button type="submit" class="btn btn-primary">Create New FD A/C</button>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,136 @@
<div class="container">
<?php
if(isset($_POST["ac_type"]) && isset($_POST["ac_name"]) && $_POST["ac_name"]!="" && is_numeric($_POST["Mature_Value"]) ) {
$return_json['NotiFi'] = "";$return_json['NotiFi_m'] = "";$return_json['NotiFi_d'] = "";
$ca["ac_type"]=$_POST["ac_type"];
$ca["ac_name"]=$_POST["ac_name"];
$ca["ac_phone"]=$_POST["ac_phone"];
$ca["ac_mail"]=$_POST["ac_mail"];
$ca["ac_address"]=$_POST["ac_address"];
$ca["ac_no"]="GV".$_POST["ac_type"].date("Ymd")."L";
$AA_BAL=$_POST["Mature_Value"];$AA_BAL=$AA_BAL-($AA_BAL*2);
//GC_new_entry($ca);
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$t="Loan";
$stmt = $conn->prepare("INSERT INTO ".$GLOBALS['arif_ac']." (`AA_BAL`,`AA_G1_DETAILS`,`AA_G2_DETAILS`,`AA_INSTALLMENT`,`AA_ICARD_NO`,`AA_INTEREST`,`AA_DATE`,`AA_DATE_MATURE`,`AA_NO_OF_PAYMENT`,`AA_AMOUNT`,`AA_MATURE_VALUE`,`AA_TYPE`,`AA_ACTYPE`,`AA_NAME`, `AA_PHONE`, `AA_EMAIL`, `AA_ADDRESS`, `AA_ADMIN`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("isssssssssssssssss" ,$AA_BAL,$_POST["AA_G1_DETAILS"],$_POST["AA_G2_DETAILS"],$_POST["CA_installment"],$_POST["AA_ICARD_NO"],$_POST["CA_interest"],$_POST["date_today"],$_POST["date_mature"],$_POST["CA_No_Of_Payment"],$_POST["CA_Amount"],$_POST["Mature_Value"], $t,$ca["ac_type"],$ca["ac_name"],$ca["ac_phone"],$ca["ac_mail"],$ca["ac_address"],$_SESSION["EMAIL"]);
if($stmt->execute()){
$lid=$conn->insert_id;$ca["ac_no"]=$ca["ac_no"].$lid;
if($conn->query("UPDATE `".$GLOBALS['arif_ac']."` SET `AA_ACNO` = '".$ca["ac_no"]."' WHERE `AA_ID` =".$lid.";"))
{$return_json['NotiFi'] = "OK";$return_json['NotiFi_m'] = "New Loan A/C Created !";$return_json['NotiFi_d'] = "<a href='./Details?no=".$ca["ac_no"]."'>A/C NO- ".$ca["ac_no"]."</a>";}
else{$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error Creating New Recurring A/C !";$return_json['NotiFi_d'] = "Failed in Secondary Execution";}
}
$stmt->close();
$conn->close();
echo $return_json['NotiFi'],$return_json['NotiFi_m'],$return_json['NotiFi_d'];
} //else {$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error on input !";$return_json['NotiFi_d'] = "Check Input Details";}
//echo json_encode($return_json);
?>
</div>
<div class="container">
<form method="post" enctype="multipart/form-data" id="new_loan">
<!--<div ng-app="myApp" ng-controller="myCtrl" class="form-group">-->
<select class="form-control" name="ac_type" onchange="cal_loan_type();">
<option value="D">Day</option>
<option value="W">Week</option>
<option value="M">Month</option>
</select>
<small class="form-text text-muted">A/C Type*</small>
<!--</div>-->
</br>
<div class="form-group">
<input type="text" class="form-control text-capitalize" name="ac_name" placeholder="Name" >
<small class="form-text text-muted">A/C Holder Name*</small>
</div>
<div class="form-group">
<input type="text" class="form-control text-uppercase" name="AA_ICARD_NO" placeholder="ICARD No" >
<small class="form-text text-muted">A/C Holder's ID No*</small>
</div>
<div class="form-group">
<input type="text" class="form-control text-capitalize" name="Father" placeholder="Father" >
<small class="form-text text-muted">A/C Holder's Father*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_phone" placeholder="Phone No">
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_mail" placeholder="Email">
</div>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="ac_address" placeholder="Address"></textarea>
</div>
<table><tr>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_Amount" oninput="cal_loan();">
<small class="form-text text-muted">Principle Amount*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_interest" value="20" oninput="cal_loan();">
<small class="form-text text-muted">interest*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_No_Of_Payment" oninput="cal_loan();cal_Re_md();" >
<small class="form-text text-muted">Tenure no of <span id="DWM">Day</span>*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_installment" >
<small class="form-text text-muted">installment Amount*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="Mature_Value" >
<small class="form-text text-muted">Total Amount*</small>
</div></td>
</tr></table>
<div class="form-group">
<input type="text" class="form-control" id="date_today" name="date_today" value="<?php echo date('Y-m-d');?>" >
<small id="emailHelp" class="form-text text-muted">Date*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="date_mature" >
<small id="emailHelp" class="form-text text-muted">Mature Date*</small>
</div>
<hr/>
<h4>Guaranter</h4>
<hr>
<small class="form-text text-muted"><u>1st Guaranter details*</u></small>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="6" name="AA_G1_DETAILS" required>Name:
ID:
Father:
Phone:
Relation:
Address: </textarea>
</div>
<hr>
<small class="form-text text-muted"><u>2nd Guaranter details*</u></small>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="6" name="AA_G2_DETAILS" required>Name:
ID:
Father:
Phone:
Relation:
Address:</textarea>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-md-offset-5 col-sm-12 col-xs-12">
<button type="submit" class="btn btn-primary" >Create New Loan A/C</button>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,109 @@
<div class="container">
<?php
$start = time();
if(isset($_POST["ac_type"]) && isset($_POST["ac_name"]) && $_POST["ac_name"]!="" && is_numeric($_POST["Mature_Value"]) ) {
$return_json['NotiFi'] = "";$return_json['NotiFi_m'] = "";$return_json['NotiFi_d'] = "";
$ca["ac_type"]=$_POST["ac_type"];
$ca["ac_name"]=$_POST["ac_name"];
$ca["ac_phone"]=$_POST["ac_phone"];
$ca["ac_mail"]=$_POST["ac_mail"];
$ca["ac_address"]=$_POST["ac_address"];
$ca["ac_no"]="GV".$_POST["ac_type"].date("Ymd")."R";
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$t="Recurring";
$stmt = $conn->prepare("INSERT INTO ".$GLOBALS['arif_ac']." (`AA_INTEREST`,`AA_DATE`,`AA_ICARD_NO`,`AA_DATE_MATURE`,`AA_NO_OF_PAYMENT`,`AA_INSTALLMENT`,`AA_MATURE_VALUE`,`AA_TYPE`,`AA_ACTYPE`,`AA_NAME`, `AA_PHONE`, `AA_EMAIL`, `AA_ADDRESS`, `AA_NOMINEE_DETAILS`, `AA_ADMIN`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("sssssssssssssss" ,$_POST["CA_interest"],$_POST["date_today"],$_POST["AA_ICARD_NO"],$_POST["date_mature"],$_POST["CA_No_Of_Payment"],$_POST["CA_Amount"],$_POST["Mature_Value"], $t,$ca["ac_type"],$ca["ac_name"],$ca["ac_phone"],$ca["ac_mail"],$ca["ac_address"],$_POST["AA_NOMINEE_DETAILS"],$_SESSION["EMAIL"]);
if($stmt->execute()){
$lid=$conn->insert_id;$ca["ac_no"]=$ca["ac_no"].$lid;
if($conn->query("UPDATE `".$GLOBALS['arif_ac']."` SET `AA_ACNO` = '".$ca["ac_no"]."' WHERE `AA_ID` =".$lid.";"))
{$return_json['NotiFi'] = "OK";$return_json['NotiFi_m']="New Recurring A/C Created !";$return_json['NotiFi_d'] = "<a href='./Details?no=".$ca["ac_no"]."'>A/C NO- ".$ca["ac_no"]."</a>";}
else{$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error Creating New Recurring A/C !";$return_json['NotiFi_d'] = "Failed in Secondary Execution";}
}
else{
echo $stmt->error;
}
$stmt->close();
$conn->close();
//$e_time= time() - $start; echo $start."<br>".time()."<br>".$e_time."<br>";
echo $return_json['NotiFi'],$return_json['NotiFi_m'],$return_json['NotiFi_d'];
}// else {$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error on input !";$return_json['NotiFi_d'] = "Check Input Details";}
?>
</div>
<div class="container">
<form method="post" enctype="multipart/form-data" id="New_Recurring">
<div class="form-group">
<!--<div ng-app="myApp" ng-controller="myCtrl" class="form-group">-->
<select class="form-control" name="ac_type">
<option value="D">Day</option>
<option value="W">Week</option>
<option value="M">Month</option>
</select>
<small class="form-text text-muted">A/C Type*</small>
<!--</div>-->
</div>
<br>
<div class="form-group">
<input type="text" class="form-control text-capitalize" name="ac_name" placeholder="Name" required>
<small class="form-text text-muted">A/C Holder Name*</small>
</div>
<div class="form-group">
<input type="text" class="form-control text-uppercase" name="AA_ICARD_NO" placeholder="I-CARD NO" required>
</div>
<table><tr>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_Amount" oninput="cal_rec();" required>
<small class="form-text text-muted">Amount*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_interest" value="8" oninput="cal_rec();" required>
<small class="form-text text-muted">Interest*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_No_Of_Payment" oninput="cal_rec();cal_Re_md();" required>
<small class="form-text text-muted">No Of Payment*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="Mature_Value" required>
<small class="form-text text-muted">Mature Value*</small>
</div></td>
</tr></table>
<div class="form-group">
<input type="text" class="form-control" id="date_today" name="date_today" value="<?php echo date('Y-m-d');?>" required>
<small class="form-text text-muted">Date*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="date_mature" required>
<small class="form-text text-muted">Mature Date*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_phone" placeholder="Phone No" required>
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_mail" placeholder="Email">
</div>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="ac_address" placeholder="Address" required></textarea>
</div>
<hr>
<small class="form-text text-muted"><u>Nominee details*</u></small>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="AA_NOMINEE_DETAILS" required>Name:
DOB:
Relation:
ID:
</textarea>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-md-offset-5 col-sm-12 col-xs-12">
<button type="submit" class="btn btn-primary" >Create New Recurring A/C</button>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,106 @@
<div class="container">
<?php
$start = time();
if(isset($_POST["ac_type"]) && isset($_POST["ac_name"]) && $_POST["ac_name"]!="" && is_numeric($_POST["Mature_Value"]) ) {
$return_json['NotiFi'] = "";$return_json['NotiFi_m'] = "";$return_json['NotiFi_d'] = "";
$ca["ac_type"]=$_POST["ac_type"];
$ca["ac_name"]=$_POST["ac_name"];
$ca["ac_phone"]=$_POST["ac_phone"];
$ca["ac_mail"]=$_POST["ac_mail"];
$ca["ac_address"]=$_POST["ac_address"];
$ca["ac_no"]="GV".$_POST["ac_type"].date("Ymd")."R";
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$t="Recurring";
$stmt = $conn->prepare("INSERT INTO ".$GLOBALS['arif_ac']." (`AA_INTEREST`,`AA_DATE`,`AA_ICARD_NO`,`AA_DATE_MATURE`,`AA_NO_OF_PAYMENT`,`AA_INSTALLMENT`,`AA_MATURE_VALUE`,`AA_TYPE`,`AA_ACTYPE`,`AA_NAME`, `AA_PHONE`, `AA_EMAIL`, `AA_ADDRESS`, `AA_NOMINEE_DETAILS`, `AA_ADMIN`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("sssssssssssssss" ,$_POST["CA_interest"],$_POST["date_today"],$_POST["AA_ICARD_NO"],$_POST["date_mature"],$_POST["CA_No_Of_Payment"],$_POST["CA_Amount"],$_POST["Mature_Value"], $t,$ca["ac_type"],$ca["ac_name"],$ca["ac_phone"],$ca["ac_mail"],$ca["ac_address"],$_POST["AA_NOMINEE_DETAILS"],$_SESSION["EMAIL"]);
if($stmt->execute()){
$lid=$conn->insert_id;$ca["ac_no"]=$ca["ac_no"].$lid;
if($conn->query("UPDATE `".$GLOBALS['arif_ac']."` SET `AA_ACNO` = '".$ca["ac_no"]."' WHERE `AA_ID` =".$lid.";"))
{$return_json['NotiFi'] = "OK";$return_json['NotiFi_m']="New Recurring A/C Created !";$return_json['NotiFi_d'] = "<a href='./Details?no=".$ca["ac_no"]."'>A/C NO- ".$ca["ac_no"]."</a>";}
else{$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error Creating New Recurring A/C !";$return_json['NotiFi_d'] = "Failed in Secondary Execution";}
}
$stmt->close();
$conn->close();
//$e_time= time() - $start; echo $start."<br>".time()."<br>".$e_time."<br>";
echo $return_json['NotiFi'],$return_json['NotiFi_m'],$return_json['NotiFi_d'];
}// else {$return_json['NotiFi'] = "Error";$return_json['NotiFi_m'] = "Error on input !";$return_json['NotiFi_d'] = "Check Input Details";}
?>
</div>
<div class="container">
<form method="post" enctype="multipart/form-data" id="New_Recurring">
<div class="form-group">
<!--<div ng-app="myApp" ng-controller="myCtrl" class="form-group">-->
<select class="form-control" name="ac_type">
<option value="D">Day</option>
<option value="W">Week</option>
<option value="M">Month</option>
</select>
<small class="form-text text-muted">A/C Type*</small>
<!--</div>-->
</div>
<br>
<div class="form-group">
<input type="text" class="form-control text-capitalize" name="ac_name" placeholder="Name" required>
<small class="form-text text-muted">A/C Holder Name*</small>
</div>
<div class="form-group">
<input type="text" class="form-control text-uppercase" name="AA_ICARD_NO" placeholder="I-CARD NO" required>
</div>
<table><tr>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_Amount" oninput="cal_rec();" required>
<small class="form-text text-muted">Amount*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_interest" value="8" oninput="cal_rec();" required>
<small class="form-text text-muted">Interest*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="CA_No_Of_Payment" oninput="cal_rec();cal_Re_md();" required>
<small class="form-text text-muted">No Of Payment*</small>
</div></td>
<td><div class="form-group">
<input type="text" class="form-control" name="Mature_Value" required>
<small class="form-text text-muted">Mature Value*</small>
</div></td>
</tr></table>
<div class="form-group">
<input type="text" class="form-control" id="date_today" name="date_today" value="<?php echo date('Y-m-d');?>" required>
<small class="form-text text-muted">Date*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="date_mature" required>
<small class="form-text text-muted">Mature Date*</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_phone" placeholder="Phone No" required>
</div>
<div class="form-group">
<input type="text" class="form-control" name="ac_mail" placeholder="Email">
</div>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="ac_address" placeholder="Address" required></textarea>
</div>
<hr>
<small class="form-text text-muted"><u>Nominee details*</u></small>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="AA_NOMINEE_DETAILS" required>Name:
DOB:
Relation:
ID:
</textarea>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-md-offset-5 col-sm-12 col-xs-12">
<button type="submit" class="btn btn-primary" >Create New Recurring A/C</button>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,247 @@
<div class="container" style="text-align: center;">
<h3> ACCOUNT DETAILS</h3><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<?php
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
$conn->set_charset("utf8");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO`= '".$_GET["no"]."'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) { if($row["AA_ACTYPE"]=="D")$AA_ACTYPE="Day";if($row["AA_ACTYPE"]=="M")$AA_ACTYPE="Month";if($row["AA_ACTYPE"]=="W")$AA_ACTYPE="Week";
if ($row["AA_TYPE"]== "FD")
echo "
<tr><th colspan='2'><span class='text-center'>Fixed Diposite A/C of ".$row["AA_NAME"]. "</span></tr><tr>
<tr>
<th>ACCOUNT NO.</th>
<td>".$row["AA_ACNO"]. "</td>
</tr>
<tr>
<th>A/C Created</th>
<td>".$row["AA_TIMESTAMP"]. "</td>
</tr>
<tr>
<th>EFFECTIVE DATE</th>
<td>".$row["AA_DATE"]. "</td>
</tr>
<tr>
<th>ACCOUNT HOLDER</th>
<td>".$row["AA_NAME"]. "</td>
</tr>
<tr>
<th>ACCOUNT HOLDER's ID/CARD NO</th>
<td>".$row["AA_ICARD_NO"]. "</td>
</tr>
<tr>
<th>EMAIL ID</th>
<td>".$row["AA_EMAIL"]. "</td>
</tr>
<tr>
<th>PHONE NO.</th>
<td>".$row["AA_PHONE"]. "</td>
</tr>
<tr>
<th>ADDRESS</th>
<td>".$row["AA_ADDRESS"]. "</td>
</tr>
<tr>
<th>ACCOUNT TYPE</th>
<td>Fixed Diposite</td>
</tr>
<tr>
<th>RATE OF INTEREST</th>
<td>".$row["AA_INTEREST"]. "</td>
</tr>
<tr>
<th>AMOUNT PAID</th>
<td>".$row["AA_AMOUNT"]. "</td>
</tr>
<tr>
<th>MATURITY DATE</th>
<td>".$row["AA_DATE_MATURE"]. "</td>
</tr>
<tr>
<th>NOMINEE DETAILS</th>
<td>".$row["AA_NOMINEE_DETAILS"]. "</td>
</tr>
";
elseif ($row["AA_TYPE"]== "Recurring")
echo "
<tr><th colspan='2'><span class='text-center'>Recurring A/C of ".$row["AA_NAME"]. "</span></tr><tr>
<tr>
<th>ACCOUNT NO.</th>
<td>".$row["AA_ACNO"]. "</td>
</tr>
<tr>
<th>ACCOUNT TYPE</th>
<td>".$row["AA_TYPE"]. "</td>
</tr>
<tr>
<th>PAYMENT TERM</th>
<td>".$AA_ACTYPE. "</td>
</tr>
<tr>
<th>A/C Created</th>
<td>".$row["AA_TIMESTAMP"]. "</td>
</tr>
<tr>
<th>EFFECTIVE DATE</th>
<td>".$row["AA_DATE"]. "</td>
</tr>
<tr>
<th>ACCOUNT BALANCE</th>
<td>".$row["AA_BAL"]. "</td>
</tr>
<tr>
<th>ACCOUNT HOLDER</th>
<td>".$row["AA_NAME"]. "</td>
</tr>
<tr>
<th>ID CARD NO</th>
<td>".$row["AA_ICARD_NO"]. "</td>
</tr>
<tr>
<th>EMAIL ID</th>
<td>".$row["AA_EMAIL"]. "</td>
</tr>
<tr>
<th>PHONE NO.</th>
<td>".$row["AA_PHONE"]. "</td>
</tr>
<tr>
<th>ADDRESS</th>
<td>".$row["AA_ADDRESS"]. "</td>
</tr>
<tr>
<th>INTEREST</th>
<td>".$row["AA_INTEREST"]. "</td>
</tr>
<tr>
<th>INSTALLMENT AMOUNT</th>
<td>".$row["AA_INSTALLMENT"]. "</td>
</tr>
<tr>
<th>TOTAL NUMBER OF INSTALLMENTS</th>
<td>".$row["AA_NO_OF_PAYMENT"]. "</td>
</tr>
<tr>
<th>NUMBER OF INSTALLMENTS PAID</th>
<td>".$row["AA_NO_OF_PAYPAID"]. "</td>
</tr>
<tr>
<th>MATURITY DATE</th>
<td>".$row["AA_DATE_MATURE"]. "</td>
</tr>
<tr>
<th>MATURITY AMOUNT</th>
<td>".$row["AA_MATURE_VALUE"]. "</td>
</tr>
<tr>
<th>DATE</th>
<td>".$row["AA_DATE"]. "</td>
</tr>
<tr>
<th>NOMINEE DETAILS</th>
<td>".$row["AA_NOMINEE_DETAILS"]. "</td>
</tr>
";
else
echo "
<tr><th colspan='2'><span class='text-center'>Loan A/C of ".$row["AA_NAME"]. "</span></tr><tr>
<tr>
<th>ACCOUNT NO.</th>
<td>".$row["AA_ACNO"]. "</td>
</tr>
<tr>
<th>PAYMENT TERM</th>
<td>".$AA_ACTYPE. "</td>
</tr>
<tr>
<th>ACCOUNT TYPE</th>
<td>".$row["AA_TYPE"]. "</td>
</tr>
<tr>
<th>A/C Created</th>
<td>".$row["AA_TIMESTAMP"]. "</td>
</tr>
<tr>
<th>EFFECTIVE DATE</th>
<td>".$row["AA_DATE"]. "</td>
</tr>
<tr>
<th>ACCOUNT BALANCE</th>
<td>".$row["AA_BAL"]. "</td>
</tr>
<tr>
<th>ACCOUNT HOLDER</th>
<td>".$row["AA_NAME"]. "</td>
</tr>
<tr>
<th>ID CARD NO</th>
<td>".$row["AA_ICARD_NO"]. "</td>
</tr>
<tr>
<th>EMAIL ID</th>
<td>".$row["AA_EMAIL"]. "</td>
</tr>
<tr>
<th>PHONE NO.</th>
<td>".$row["AA_PHONE"]. "</td>
</tr>
<tr>
<th>ADDRESS</th>
<td>".$row["AA_ADDRESS"]. "</td>
</tr>
<tr>
<th>INTEREST</th>
<td>".$row["AA_INTEREST"]. "</td>
</tr>
<tr>
<th>INSTALLMENT AMOUNT</th>
<td>".$row["AA_INSTALLMENT"]. "</td>
</tr>
<tr>
<th>LOAN AMOUNT</th>
<td>".$row["AA_AMOUNT"]. "</td>
</tr>
<tr>
<th>NUMBER OF PAYMENT</th>
<td>".$row["AA_NO_OF_PAYMENT"]. "</td>
</tr>
<tr>
<th>TERM ENDING DATE</th>
<td>".$row["AA_DATE_MATURE"]. "</td>
</tr>
<tr>
<th>1st GUARANTER DETAILS</th>
<td>".$row["AA_G1_DETAILS"]. "</td>
</tr>
<tr>
<th>2nd GUARANTER DETAILS</th>
<td>".$row["AA_G2_DETAILS"]. "</td>
</tr>
";
}
} else {
echo "0 results";
};
$conn->close();
?>
</table>
</div>

View File

@ -0,0 +1,46 @@
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>SL</th>
<th>Type</th>
<th>AC No</th>
<th>Name</th>
<th>Account Creation Date</th>
<th>Maturity Value</th>
<th>Balance</th>
<th>No Of Installment</th>
<th>No Of Paid Installment</th>
<th>Installment Amount</th>
</tr>
<?php
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `" . $GLOBALS['arif_ac'] . "` WHERE `AA_BAL` < 0 ORDER BY `AA_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
$tt = $row["AA_ID"] - 10;
echo "
<tr>
<td>" . $tt . "</td>
<td>" . $row["AA_ACTYPE"] . "," . $row["AA_TYPE"] . "</td>
<td><a href='./Details?no=" . $row["AA_ACNO"] . "&type=" . $row["AA_TYPE"] . "'>" . $row["AA_ACNO"] . "</a> &nbsp;&nbsp; <a href='./Trans_New?no=" . $row["AA_ACNO"] . "&type=" . $row["AA_TYPE"] . "'>Transact</a></td>
<td>" . $row["AA_NAME"] . "</td>
<td>" . $row["AA_DATE"] . "</td>
<td>" . $row["AA_MATURE_VALUE"] . "</td>
<td>" . $row["AA_BAL"] . "</td>
<td>" . $row["AA_NO_OF_PAYMENT"] . "</td>
<td>" . $row["AA_NO_OF_PAYPAID"] . "</td>
<td>" . $row["AA_INSTALLMENT"] . "</td>
</tr>";
}
} else {
echo "0 results";
};
$conn->close();
?>

View File

@ -0,0 +1,102 @@
<div class="container">
<table>
<!-- <tr>
<td>
<form>
<input type="date" name="tday">
<input type="submit" class="btn-info" value="Daily Report">
</form>
</td>
<td>
<form>
<input type="date" name="tmonth">
<input type="submit" class="btn-info" value="Monthly Report">
</form>
</td>
</tr> -->
<tr><td>.</td><td>.</td></tr>
<tr>
<td colspan="2">
<form>
<label for="">From </label><input type="date" name="dFrom">
<label for="">To </label><input type="date" name="dTo">
<input type="submit" class="btn-info" value="Report">
</form>
</td>
</tr>
</table>
</div>
<?php
function report_view($type,$dt) {
$dateFrom=$dt;
if($type!="month" || $type!="day") {
$dateFrom= strtotime($dt); $dateFrom = date("Y-m-d", $dateFrom);
$dateTo= strtotime('+1 day', strtotime($type)); $dateTo = date("Y-m-d", $dateTo);
}
//$dateFrom=$dt;
else{
if($type=="month") {$dateFrom= strtotime('-1 day', strtotime($dt)); $dateFrom = date("Y-m-d", $dateFrom);}
$dateTo = strtotime('+1 '.$type, strtotime($dt));
$dateTo = date("Y-m-d", $dateTo);
}
echo '<div class="container"> <h3>'.$dateFrom." -> ".$dateTo."(Up to)</h3> </div>";
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$totalAmount=0;
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW REPORT::::::::</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>Transaction ID</th>
<th>Time</th>
<th>AC No</th>
<th>Name</th>
<th>Amount</th>
</tr>';
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` INNER JOIN `".$GLOBALS['arif_ac']."` ON `".$GLOBALS['arif_tran']."`.`AT_ACID`=`".$GLOBALS['arif_ac']."`.`AA_ACNO` WHERE `AT_TIMESTAMP` BETWEEN '".$dateFrom." 00:00:00.000000' AND '".$dateTo." 00:00:00.000000' ORDER BY `arif_tran`.`AT_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
// $tt=$row["AT_ID"]-10;
echo "
<tr>
<td>".$row["AT_ID"]. "</td>
<td>".$row["AT_TIMESTAMP"]. "</td>
<td>".$row["AT_ACID"]. "</td>
<td>".$row["AA_NAME"]. "</td>
<td>".$row["AT_AMOUNT"]. "</td>
</tr>";$totalAmount+=$row["AT_AMOUNT"];
}
} else {
echo "0 results";
}
$conn->close();
echo '
</table>
<hr> <h2> Total Transaction amount : '.$totalAmount.'</h2>
</div>
';
}
if(isset($_GET['tday']) && $_GET['tday']!="") report_view('day',$_GET['tday']);
if(isset($_GET['tmonth']) && $_GET['tmonth']!="") report_view('month',$_GET['tmonth']);
if(isset($_GET['dFrom']) && $_GET['dTo']!="") report_view($_GET['dTo'],$_GET['dFrom']);
//if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
// if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
// if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,76 @@
<div class="container">
<form>
<input type="date" name="tday">
<input type="submit" class="btn-info" value="Daily Report">
</form>
<form>
<input type="date" name="tmonth">
<input type="submit" class="btn-info" value="Monthly Report">
</form>
</div>
<?php
function report_view($type,$dt) {
// $dateTo=$dt;
// $dateFrom = strtotime('-1 '.$type, strtotime($dt));
// $dateFrom = date("Y-m-d", $dateFrom);
$dateFrom=$dt;
if($type=="month") {$dateFrom= strtotime('-1 day', strtotime($dt)); $dateFrom = date("Y-m-d", $dateFrom);}
$dateTo = strtotime('+1 '.$type, strtotime($dt));
$dateTo = date("Y-m-d", $dateTo);
echo $dateFrom." -> ".$dateTo."(Up to)";
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$totalAmount=0;
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW REPORT::::::::</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>Transaction ID</th>
<th>Time</th>
<th>AC No</th>
<th>Amount</th>
</tr>';
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_TIMESTAMP` BETWEEN '".$dateFrom." 00:00:00.000000' AND '".$dateTo." 00:00:00.000000' ORDER BY `arif_tran`.`AT_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
// $tt=$row["AT_ID"]-10;
echo "
<tr>
<td>".$row["AT_ID"]. "</td>
<td>".$row["AT_TIMESTAMP"]. "</td>
<td>".$row["AT_ACID"]. "</td>
<td>".$row["AT_AMOUNT"]. "</td>
</tr>";$totalAmount+=$row["AT_AMOUNT"];
}
} else {
echo "0 results";
}
$conn->close();
echo '
</table>
<hr> <h2> Total Transaction amount : '.$totalAmount.'</h2>
</div>
';
}
if(isset($_GET['tday']) && $_GET['tday']!="") report_view('day',$_GET['tday']);
if(isset($_GET['tmonth']) && $_GET['tmonth']!="") report_view('month',$_GET['tmonth']);
//if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
// if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
// if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,100 @@
<div class="container">
<table>
<!-- <tr>
<td>
<form>
<input type="date" name="tday">
<input type="submit" class="btn-info" value="Daily Report">
</form>
</td>
<td>
<form>
<input type="date" name="tmonth">
<input type="submit" class="btn-info" value="Monthly Report">
</form>
</td>
</tr> -->
<tr><td>.</td><td>.</td></tr>
<tr>
<td colspan="2">
<form>
<label for="">From </label><input type="date" name="dFrom">
<label for="">To </label><input type="date" name="dTo">
<input type="submit" class="btn-info" value="Report">
</form>
</td>
</tr>
</table>
</div>
<?php
function report_view($type,$dt) {
$dateFrom=$dt;
if($type!="month" || $type!="day") {
$dateFrom= strtotime($dt); $dateFrom = date("Y-m-d", $dateFrom);
$dateTo= strtotime('+1 day', strtotime($type)); $dateTo = date("Y-m-d", $dateTo);
}
//$dateFrom=$dt;
else{
if($type=="month") {$dateFrom= strtotime('-1 day', strtotime($dt)); $dateFrom = date("Y-m-d", $dateFrom);}
$dateTo = strtotime('+1 '.$type, strtotime($dt));
$dateTo = date("Y-m-d", $dateTo);
}
echo $dateFrom." -> ".$dateTo."(Up to)";
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$totalAmount=0;
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW REPORT::::::::</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>Transaction ID</th>
<th>Time</th>
<th>AC No</th>
<th>Amount</th>
</tr>';
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_TIMESTAMP` BETWEEN '".$dateFrom." 00:00:00.000000' AND '".$dateTo." 00:00:00.000000' ORDER BY `arif_tran`.`AT_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
// $tt=$row["AT_ID"]-10;
echo "
<tr>
<td>".$row["AT_ID"]. "</td>
<td>".$row["AT_TIMESTAMP"]. "</td>
<td>".$row["AT_ACID"]. "</td>
<td>".$row["AT_AMOUNT"]. "</td>
</tr>";$totalAmount+=$row["AT_AMOUNT"];
}
} else {
echo "0 results";
}
$conn->close();
echo '
</table>
<hr> <h2> Total Transaction amount : '.$totalAmount.'</h2>
</div>
';
}
if(isset($_GET['tday']) && $_GET['tday']!="") report_view('day',$_GET['tday']);
if(isset($_GET['tmonth']) && $_GET['tmonth']!="") report_view('month',$_GET['tmonth']);
if(isset($_GET['dFrom']) && $_GET['dTo']!="") report_view($_GET['dTo'],$_GET['dFrom']);
//if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
// if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
// if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,37 @@
<div class="container">
<h1>Cancel Transaction</h1><hr>
</div>
<?php
if(isset($_POST["canc_trans"]) && isset($_POST["acc_no"]) && $_POST["acc_no"]!="" && isset($_POST["trans_amt"]) && is_numeric($_POST["trans_amt"]) ) {
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
if ($conn->query("UPDATE `".$GLOBALS['arif_ac']."` SET `AA_BAL` = `AA_BAL` - ".$_POST["trans_amt"]." WHERE `AA_ACNO` = '".$_POST["acc_no"]."'")){
$AT_USER = "Admin";
if ($conn->query("INSERT INTO `" . $GLOBALS['arif_tran'] . "` (`AT_ID`, `AT_TIMESTAMP`, `AT_ADMIN`, `AT_ACID`, `AT_AMOUNT`) VALUES (NULL, CURRENT_TIMESTAMP, '" . $AT_USER . "', '" . $_POST["acc_no"] . "', '" . $_POST["trans_amt"] . "')")) {
echo "<div class='container alert alert-success alert-dismissible fade in'><a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a><p><strong>Transaction cancelled successfully!!</strong></p><p>Account No: ".$_POST['acc_no']."</p><p>Amount deducted : Rs. ".$_POST['trans_amt']."</p></div>";
} else {
echo "<div class='container alert alert-danger alert-dismissible fade in'><a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a><p><strong>Error in Transaction!!</strong></p></div>";
}
}
else {
echo "Error in Transaction!!";
}
$conn->close();
}
?>
<div class="container">
<form method="post" enctype="multipart/form-data" id="cancelTransaction">
<input type="hidden" name="canc_trans">
<div class="form-group">
<label for="">Enter Account No:</label>
<input class="form-control" type="text" name="acc_no">
</div>
<div class="form-group">
<label for="">Enter Amount:</label>
<input class="form-control" type="number" name="trans_amt">
</div>
<button type="submit" class="btn btn-success">Submit</button>
</form>
</div>

View File

@ -0,0 +1,199 @@
<div class="container">
<div class="alert fade in" id="notif_box" style="display:none;">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong id="notif" style="font-size:30px;"></strong>
</div>
</div>
<div class="container">
<h3>Add New Agent</h3><hr>
<div class="form-group">
<input type="email" class="form-control" id="group_name" name="group_name" placeholder="Enter Group Name" required>
</div>
<div class="form-group">
<button type="button" class="btn btn-success" onclick="addNewUser()">Add Agent</button>
</div>
<div class="row">
<div class="col-md-6">
<h3>List of currently allowed Agents</h3><hr>
<ul class="list-group">
<?php
if(count(glob(__DIR__."/users/*")) === 0) {
echo 'No users found.';
} else {
foreach (glob(__DIR__."/users/*") as $filename) {
$filename = explode('/', $filename);
$filename = end($filename);
echo '<li class="list-group-item d-flex justify-content-between align-items-center">'.$filename. '<span class="badge badge-warning badge-pill" onclick="deleteUser('."'$filename'".')">X</span></li>';
}
}
?>
</ul>
</div>
</div>
</div>
<style>
.badge-warning {
background: red;
cursor: pointer;
}
</style>
<script>
function addNewUser() {
var gname = document.getElementById("group_name").value,
inFolder = 'users',
path ='/api/add_user?filename='+gname+'&inFolder='+inFolder;
fetch(path)
.then(function(response) { return response.json(); })
.then(function(json) {
if(json.status=='success') {
// console.log(json.status);
// alert(json.msg);
notification(json.status, json.msg);
location.reload(true);
} else notification(json.status, json.msg);
});
// console.log(gname);
}
function deleteUser(fname) {
var inFolder = 'users',
f='/api/delete_user?name='+fname+'&folder=/CONTENT/ROOT_URI/Admin/'+inFolder;
fetch(f)
.then(function(response) { return response.json(); })
.then(function(json) {
if(json.status=='success'){
// removeModal(fname);
// console.log(json.status);
notification(json.status, json.msg);
// location.reload(true);
}
});
}
function notification(res_status, res_txt) {
var notif_box = document.getElementById('notif_box');
var notif = document.getElementById('notif');
notif_box.style.display = 'block';
if (res_status == 'success') {
notif_box.classList.add('alert-success');
} else {
notif_box.classList.add('alert-danger');
}
notif.innerHTML = res_txt;
}
</script>
<center> <h2>Dedicate Agent to A/C </h2> </center>
<?php
// Update dedicated agent to A/C
if(isset($_POST['agentmail']) && isset($_POST['aaid']) && $_POST['agentmail']!="Select"){
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "UPDATE `".$GLOBALS['arif_ac']."` SET `AA_AGENT` = '".$_POST['agentmail']."' WHERE `arif_ac`.`AA_ID` = '".$_POST['aaid']."'";
// if( $result = $conn->query($sql) ) echo $_POST['agentmail'] , $_POST['aaid'], "Successfully Added!";
$result = $conn->query($sql);
}
function view_list_ac($type) {
$agentMails='<select name="agentmail"><option>Select</option>';
if(count(glob(__DIR__."/users/*")) === 0) {
$agentMails=$agentMails. 'No users found.';
} else {
foreach (glob(__DIR__."/users/*") as $filename) {
$filename = explode('/', $filename);
$filename = end($filename);
$agentMails=$agentMails. '<option>'.$filename. '</option>';
}
}
$agentMails=$agentMails."</select>"; //echo $agentMails;
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW CUSTOMERS</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>SL</th>
<th>Type</th>
<th>AC No</th>
<th>Name</th>
<th>Account Creation Date</th>
<th>Loan Amount</th>
<th>PHONE</th>
<th>Balance</th>
<th>Dedicated Agent</th>
<th>Dedicate an Agent</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_TYPE`='".$type."' ORDER BY `AA_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
$tt=$row["AA_ID"]-10;
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if($type === 'Loan'){
$no_paid_inst = ($row["AA_MATURE_VALUE"] + $row["AA_BAL"]) / $row["AA_INSTALLMENT"];
} else {
$no_paid_inst = $row["AA_BAL"] / $row["AA_INSTALLMENT"];
}
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
echo "
<tr>
<td>".$tt."</td>
<td>".$row["AA_ACTYPE"].",".$row["AA_TYPE"]."</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_DATE"]."</td>
<td>".$row["AA_MATURE_VALUE"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_AGENT"].'</td>
<td><form method="post"> <input type="hidden" name="aaid" value="'.$row["AA_ID"].'">'.$agentMails.' <input type="submit" value="Dedicete"></form></td>
</tr>';
}
} else {
echo "0 results";
};
$conn->close();
echo '
</table>
</div>
';
}
view_list_ac('Loan');
view_list_ac('Recurring');
//
// if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
// if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
// if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,9 @@
<?php
session_unset();
if(isset($_COOKIE['EMAIL'])){
header_remove();
setcookie('EMAIL', $_POST['EMAIL'], time() - (86400 * 30), "/");
echo '<script>window.location.relode();</script>';
}
else echo '<script>window.location.assign("/Admin/");</script>';
?>

View File

@ -0,0 +1,290 @@
<script>
function calculateFine() {
var due_amount = document.getElementById('due_amount'),
inst_no = document.getElementById('inst_no').value,
inst_amount = document.getElementById('inst_amount').value,
total_rec = document.getElementById('total_rec').value,
// rec_amount = document.getElementById('rec_amount'),
fine = document.getElementById('fine');
due_amount = parseInt(due_amount.value);
fine = parseInt(fine.value);
// document.getElementById('due_amount').value = due_amount;
// document.getElementById('rec_amount').value = due_amount + fine;
document.getElementById('total_amount').value = inst_amount * inst_no + fine;
document.getElementById('hidden_total_rec').value = inst_amount * inst_no;
document.getElementById('total_rec').value = inst_amount * inst_no;
}
function calculateAmount() {
var inst_amount = document.getElementById('inst_amount').value,
// rec_amount = document.getElementById('rec_amount').value,
inst_no = document.getElementById('inst_no').value;
show_amount = document.getElementById('show_amount').value;
// document.getElementById('rec_amount').value = inst_amount * inst_no;
// document.getElementById('show_amount').value = inst_amount * inst_no;
document.getElementById('total_amount').value = inst_amount * inst_no;
document.getElementById('hidden_total_amount').value = inst_amount * inst_no;
}
</script>
<div class="container" style="margin-top: 20px;margin-bottom:20px;">
<form method="get" action="Trans_New">
<div class="form-group">
<input class="form-control" type="text" placeholder="input A/C no and enter" name="no">
</div>
</form>
</div>
<?php
if(isset($_GET["no"]) && isset($_GET["type"])&&$_GET["type"]=="Loan"){
echo '
<div class="container" style="margin-top: 20px;"> <h5>New Transaction : '.$GLOBALS['post_info'].' </h5><hr></div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Remaining Amount</th>
<th>Installment</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $_GET['type'] == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 40) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo'
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT']. '" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
if(isset($_GET["no"]) && isset($_GET["type"])&&$_GET["type"]=="Recurring"){
echo '
<div class="container" style="margin-top: 10px;"> <h5>New Transaction : '.$GLOBALS['post_info'].' </h5><hr></div>
<div class="container table-responsive">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Total Deposit</th>
<th>Installment</th>
<th>Receive Amount</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$row["AA_NAME"]. "</td>
<td>".$row["AA_PHONE"]. "</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_INSTALLMENT"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $_GET['type'] == "Recurring") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 20) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo '
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
?>
<div class="container" style="margin-top: 70px;">
<div class="row">
<div class="col-md-2">
<h5>Past Transactions::::</h5>
</div>
<div class="col-md-2">
<button class="btn btn-success" onclick="window.location.reload()">Refresh</button>
</div>
</div><hr>
</div>
<?php
if(isset($_GET["no"])){
echo '
<div class="container table-responsive">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>SL</th>
<th>Tr No</th>
<th>TimeStamp</th>
<th>User</th>
<th>A/C No</th>
<th>Amount</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
// $sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_ACID` = '".$_GET['no']."'";
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_ACID` = '".$_GET['no']."' ORDER BY `".$GLOBALS['arif_tran']."`.`AT_ID` DESC";
$result = $conn->query($sql);
$rowcount=mysqli_num_rows($result);//$rowcount++;
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$rowcount. "</td>
<td>".$row["AT_ID"]. "</td>
<td>".$row["AT_TIMESTAMP"]. "</td>
<td>".$row["AT_ADMIN"]. "</td>
<td>".$row["AT_ACID"]. "</td>
<td>".$row["AT_AMOUNT"]. "</td>
</tr>";
$rowcount--;
}
} else echo "No Past record Found";
mysqli_free_result($result);$conn->close();
echo '</table></div>';
}
?>
<script>
var submitInstallment = document.getElementById("submitInstallment");
function sendData(event) {
event.preventDefault();
var XHR = new XMLHttpRequest();
var FD = new FormData(submitInstallment);
XHR.addEventListener("load", function (event) {
var obj = JSON.parse(event.target.responseText);
// console.log(obj);
alert(obj.statusmsg);
// window.location.reload(true);
window.history.back();
});
XHR.addEventListener("error", function () {
alert('Error', 'Ooops!! Something went wrong.');
});
console.log(FD);
XHR.open("POST", "/exe/receive_amount/");
XHR.send(FD);
}
</script>

View File

@ -0,0 +1,289 @@
<script>
function calculateFine() {
var due_amount = document.getElementById('due_amount'),
inst_no = document.getElementById('inst_no').value,
inst_amount = document.getElementById('inst_amount').value,
total_rec = document.getElementById('total_rec').value,
// rec_amount = document.getElementById('rec_amount'),
fine = document.getElementById('fine');
due_amount = parseInt(due_amount.value);
fine = parseInt(fine.value);
// document.getElementById('due_amount').value = due_amount;
// document.getElementById('rec_amount').value = due_amount + fine;
document.getElementById('total_amount').value = inst_amount * inst_no + fine;
document.getElementById('hidden_total_rec').value = inst_amount * inst_no;
document.getElementById('total_rec').value = inst_amount * inst_no;
}
function calculateAmount() {
var inst_amount = document.getElementById('inst_amount').value,
// rec_amount = document.getElementById('rec_amount').value,
inst_no = document.getElementById('inst_no').value;
show_amount = document.getElementById('show_amount').value;
// document.getElementById('rec_amount').value = inst_amount * inst_no;
// document.getElementById('show_amount').value = inst_amount * inst_no;
document.getElementById('total_amount').value = inst_amount * inst_no;
document.getElementById('hidden_total_amount').value = inst_amount * inst_no;
}
</script>
<div class="container" style="margin-top: 20px;margin-bottom:20px;">
<form method="get" action="Trans_New">
<div class="form-group">
<input class="form-control" type="text" placeholder="input A/C no and enter" name="no">
</div>
</form>
</div>
<?php
if(isset($_GET["no"]) && isset($_GET["type"])&&$_GET["type"]=="Loan"){
echo '
<div class="container" style="margin-top: 20px;"> <h5>New Transaction : '.$GLOBALS['post_info'].' </h5><hr></div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Remaining Amount</th>
<th>Installment</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $_GET['type'] == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 40) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo'
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT']. '" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
if(isset($_GET["no"]) && isset($_GET["type"])&&$_GET["type"]=="Recurring"){
echo '
<div class="container" style="margin-top: 10px;"> <h5>New Transaction : '.$GLOBALS['post_info'].' </h5><hr></div>
<div class="container table-responsive">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Total Deposit</th>
<th>Installment</th>
<th>Receive Amount</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$row["AA_NAME"]. "</td>
<td>".$row["AA_PHONE"]. "</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_INSTALLMENT"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $_GET['type'] == "Recurring") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 20) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo '
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
?>
<div class="container" style="margin-top: 70px;">
<div class="row">
<div class="col-md-2">
<h5>Past Transactions::::</h5>
</div>
<div class="col-md-2">
<button class="btn btn-success" onclick="window.location.reload()">Refresh</button>
</div>
</div><hr>
</div>
<?php
if(isset($_GET["no"])){
echo '
<div class="container table-responsive">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>SL</th>
<th>Tr No</th>
<th>TimeStamp</th>
<th>User</th>
<th>A/C No</th>
<th>Amount</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
// $sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_ACID` = '".$_GET['no']."'";
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_ACID` = '".$_GET['no']."' ORDER BY `".$GLOBALS['arif_tran']."`.`AT_ID` DESC";
$result = $conn->query($sql);
$rowcount=mysqli_num_rows($result);//$rowcount++;
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$rowcount. "</td>
<td>".$row["AT_ID"]. "</td>
<td>".$row["AT_TIMESTAMP"]. "</td>
<td>".$row["AT_ADMIN"]. "</td>
<td>".$row["AT_ACID"]. "</td>
<td>".$row["AT_AMOUNT"]. "</td>
</tr>";
$rowcount--;
}
} else echo "No Past record Found";
mysqli_free_result($result);$conn->close();
echo '</table></div>';
}
?>
<script>
var submitInstallment = document.getElementById("submitInstallment");
function sendData(event) {
event.preventDefault();
var XHR = new XMLHttpRequest();
var FD = new FormData(submitInstallment);
XHR.addEventListener("load", function (event) {
var obj = JSON.parse(event.target.responseText);
// console.log(obj);
alert(obj.statusmsg);
window.location.reload(true);
});
XHR.addEventListener("error", function () {
alert('Error', 'Ooops!! Something went wrong.');
});
console.log(FD);
XHR.open("POST", "/exe/receive_amount/");
XHR.send(FD);
}
</script>

View File

@ -0,0 +1,114 @@
<div class="container" style="background-color:#e0a3a3;padding:8px;">
<ul class="nav nav-pills nav-justified">
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="FD") echo'class="active"';?>><a href="View_AC?Type=FD">Fixed Deposits</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Loan") echo'class="active"';?>><a href="View_AC?Type=Loan">Loan A/C</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Recurring") echo'class="active"';?>><a href="View_AC?Type=Recurring">Recurring A/Cs</a></li>
</ul>
</div>
<?php
function view_list_ac($type) {
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW CUSTOMERS</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>SL</th>
<th>Type</th>
<th>AC No</th>
<th>Name</th>
<th>Account Creation Date</th>
<th>Loan Amount</th>
<th>PHONE</th>
<th>Balance</th>
<th>Total No Of Installment to be paid</th>
<th>No Of Paid Installment</th>
<th>No of Expected Installment till today</th>
<th>Installment Amount</th>
<th>Due Installment</th>
<th>Due Amount</th>
<th>Due after Fine</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_TYPE`='".$type."' ORDER BY `AA_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
$tt=$row["AA_ID"]-10;
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if($type === 'Loan'){
$no_paid_inst = ($row["AA_MATURE_VALUE"] + $row["AA_BAL"]) / $row["AA_INSTALLMENT"];
} else {
$no_paid_inst = $row["AA_BAL"] / $row["AA_INSTALLMENT"];
}
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
echo "
<tr>
<td>".$tt."</td>
<td>".$row["AA_ACTYPE"].",".$row["AA_TYPE"]."</td>
<td><a href='./Details?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>".$row["AA_ACNO"]."</a> &nbsp;&nbsp; <a href='./Trans_New?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>Transact</a></td>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_DATE"]."</td>
<td>".$row["AA_MATURE_VALUE"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_NO_OF_PAYMENT"]."</td>
<td>".$no_paid_inst."</td>
<td>".$diff."</td>
<td>".$row["AA_INSTALLMENT"]."</td>
<td>".$due_i."</td>";
if ($due_i > 0) {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
else {
$due_amount = 'All Clear';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
if ($due_i > 0 && $type == "Recurring") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = (($due_amount) * 20)/100;
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
elseif ($due_i > 0 && $type == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = (($due_amount) * 40)/100;
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
else {
$due_amount = 'Up to Date!!';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
echo "</tr>";
}
} else {
echo "0 results";
};
$conn->close();
echo '
</table>
</div>
';
}
if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,110 @@
<div class="container" style="background-color:#e0a3a3;padding:8px;">
<ul class="nav nav-pills nav-justified">
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="FD") echo'class="active"';?>><a href="View_AC?Type=FD">Fixed Deposits</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Loan") echo'class="active"';?>><a href="View_AC?Type=Loan">Loan A/C</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Recurring") echo'class="active"';?>><a href="View_AC?Type=Recurring">Recurring A/Cs</a></li>
</ul>
</div>
<?php
function view_list_ac($type) {
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW CUSTOMERS</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>SL</th>
<th>Type</th>
<th>AC No</th>
<th>Name</th>
<th>Account Creation Date</th>
<th>Maturity Value</th>
<th>PHONE</th>
<th>Balance</th>
<th>Total No Of Installment to be paid</th>
<th>No Of Paid Installment</th>
<th>No of Expected Installment till today</th>
<th>Installment Amount</th>
<th>Due Installment</th>
<th>Due Amount</th>
<th>Due after Fine</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_TYPE`='".$type."' ORDER BY `AA_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
$tt=$row["AA_ID"]-10;
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
$no_paid_inst = $row["AA_BAL"] / $row["AA_INSTALLMENT"];
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
echo "
<tr>
<td>".$tt."</td>
<td>".$row["AA_ACTYPE"].",".$row["AA_TYPE"]."</td>
<td><a href='./Details?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>".$row["AA_ACNO"]."</a> &nbsp;&nbsp; <a href='./Trans_New?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>Transact</a></td>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_DATE"]."</td>
<td>".$row["AA_MATURE_VALUE"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_NO_OF_PAYMENT"]."</td>
<td>".$no_paid_inst."</td>
<td>".$diff."</td>
<td>".$row["AA_INSTALLMENT"]."</td>
<td>".$due_i."</td>";
if ($due_i > 0) {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
else {
$due_amount = 'All Clear';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
if ($due_i > 0 && $type == "Recurring") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = (($due_amount) * 20)/100;
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
elseif ($due_i > 0 && $type == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = (($due_amount) * 40)/100;
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
else {
$due_amount = 'Up to Date!!';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
echo "</tr>";
}
} else {
echo "0 results";
};
$conn->close();
echo '
</table>
</div>
';
}
if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,156 @@
<script>
function calculateFine() {
var due_amount = document.getElementById('due_amount'),
inst_no = document.getElementById('inst_no').value,
inst_amount = document.getElementById('inst_amount').value,
total_rec = document.getElementById('total_rec').value,
// rec_amount = document.getElementById('rec_amount'),
fine = document.getElementById('fine');
due_amount = parseInt(due_amount.value);
fine = parseInt(fine.value);
// document.getElementById('due_amount').value = due_amount;
// document.getElementById('rec_amount').value = due_amount + fine;
document.getElementById('total_amount').value = inst_amount * inst_no + fine;
document.getElementById('hidden_total_rec').value = inst_amount * inst_no;
document.getElementById('total_rec').value = inst_amount * inst_no;
}
function calculateAmount() {
var inst_amount = document.getElementById('inst_amount').value,
// rec_amount = document.getElementById('rec_amount').value,
inst_no = document.getElementById('inst_no').value;
show_amount = document.getElementById('show_amount').value;
// document.getElementById('rec_amount').value = inst_amount * inst_no;
// document.getElementById('show_amount').value = inst_amount * inst_no;
document.getElementById('total_amount').value = inst_amount * inst_no;
document.getElementById('hidden_total_amount').value = inst_amount * inst_no;
}
</script>
<div class="container" style="margin-top: 20px;margin-bottom:20px;">
<form method="get" action="Agent_Trans_New">
<div class="form-group">
<input class="form-control" type="text" placeholder="Input A/C no and press enter" name="no">
</div>
</form>
</div>
<?php
if(isset($_GET["no"])) {
echo '
<div class="container" style="margin-top: 20px;"> <h3>New Transaction</h3><hr></div>
<div class="container">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Remaining Amount</th>
<th>Installment</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){
$diff = $diff->format("%a");
$diff = (int)$diff;
$due_i = $diff - $row["AA_NO_OF_PAYPAID"];
} else {
$diff = $diff->format("%m");
$diff = (int)$diff;
$due_i = $diff - $row["AA_NO_OF_PAYPAID"];
}
echo "
<tr>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $row["AA_TYPE"] == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 40) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo'
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT']. '" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
?>
<script>
var submitInstallment = document.getElementById("submitInstallment");
function sendData(event) {
event.preventDefault();
var XHR = new XMLHttpRequest();
var FD = new FormData(submitInstallment);
XHR.addEventListener("load", function (event) {
var obj = JSON.parse(event.target.responseText);
// console.log(obj);
alert(obj.statusmsg);
// alert(obj.status);
window.location.reload(true);
});
XHR.addEventListener("error", function () {
alert('Error', 'Ooops!! Something went wrong.');
});
// console.log(FD);
XHR.open("POST", "/exe/receive_amount/");
XHR.send(FD);
}
</script>

View File

@ -0,0 +1,157 @@
<script>
function calculateFine() {
var due_amount = document.getElementById('due_amount'),
inst_no = document.getElementById('inst_no').value,
inst_amount = document.getElementById('inst_amount').value,
total_rec = document.getElementById('total_rec').value,
// rec_amount = document.getElementById('rec_amount'),
fine = document.getElementById('fine');
due_amount = parseInt(due_amount.value);
fine = parseInt(fine.value);
// document.getElementById('due_amount').value = due_amount;
// document.getElementById('rec_amount').value = due_amount + fine;
document.getElementById('total_amount').value = inst_amount * inst_no + fine;
document.getElementById('hidden_total_rec').value = inst_amount * inst_no;
document.getElementById('total_rec').value = inst_amount * inst_no;
}
function calculateAmount() {
var inst_amount = document.getElementById('inst_amount').value,
// rec_amount = document.getElementById('rec_amount').value,
inst_no = document.getElementById('inst_no').value;
show_amount = document.getElementById('show_amount').value;
// document.getElementById('rec_amount').value = inst_amount * inst_no;
// document.getElementById('show_amount').value = inst_amount * inst_no;
document.getElementById('total_amount').value = inst_amount * inst_no;
document.getElementById('hidden_total_amount').value = inst_amount * inst_no;
}
</script>
<div class="container" style="margin-top: 20px;margin-bottom:20px;">
<form method="get" action="Agent_Trans_New">
<div class="form-group">
<input class="form-control" type="text" placeholder="Input A/C no and press enter" name="no">
</div>
</form>
</div>
<?php
if(isset($_GET["no"])) {
echo '
<div class="container" style="margin-top: 20px;"> <h3>New Transaction</h3><hr></div>
<div class="container">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Remaining Amount</th>
<th>Installment</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){
$diff = $diff->format("%a");
$diff = (int)$diff;
$due_i = $diff - $row["AA_NO_OF_PAYPAID"];
} else {
$diff = $diff->format("%m");
$diff = (int)$diff;
$due_i = $diff - $row["AA_NO_OF_PAYPAID"];
}
echo "
<tr>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $row["AA_TYPE"] == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 40) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<!-- changed the line to disable fine change for agents <input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()"> -->
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" disabled">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo'
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT']. '" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
?>
<script>
var submitInstallment = document.getElementById("submitInstallment");
function sendData(event) {
event.preventDefault();
var XHR = new XMLHttpRequest();
var FD = new FormData(submitInstallment);
XHR.addEventListener("load", function (event) {
var obj = JSON.parse(event.target.responseText);
// console.log(obj);
alert(obj.statusmsg);
// alert(obj.status);
window.location.reload(true);
});
XHR.addEventListener("error", function () {
alert('Error', 'Ooops!! Something went wrong.');
});
// console.log(FD);
XHR.open("POST", "/exe/receive_amount/");
XHR.send(FD);
}
</script>

View File

@ -0,0 +1,9 @@
<?php
session_unset();
if(isset($_COOKIE['EMAIL'])){
header_remove();
setcookie('EMAIL', $_POST['EMAIL'], time() - (86400 * 30), "/");
echo '<script>window.location.relode();</script>';
}
else echo '<script>window.location.assign("/Admin/");</script>';
?>

View File

@ -0,0 +1,4 @@
<?php
include("Trans_New.php");
?>

View File

@ -0,0 +1,293 @@
<script>
function calculateFine() {
var due_amount = document.getElementById('due_amount'),
inst_no = document.getElementById('inst_no').value,
inst_amount = document.getElementById('inst_amount').value,
total_rec = document.getElementById('total_rec').value,
// rec_amount = document.getElementById('rec_amount'),
fine = document.getElementById('fine');
due_amount = parseInt(due_amount.value);
fine = parseInt(fine.value);
// document.getElementById('due_amount').value = due_amount;
// document.getElementById('rec_amount').value = due_amount + fine;
document.getElementById('total_amount').value = inst_amount * inst_no + fine;
document.getElementById('hidden_total_rec').value = inst_amount * inst_no;
document.getElementById('total_rec').value = inst_amount * inst_no;
}
function calculateAmount() {
var inst_amount = document.getElementById('inst_amount').value,
// rec_amount = document.getElementById('rec_amount').value,
inst_no = document.getElementById('inst_no').value;
show_amount = document.getElementById('show_amount').value;
// document.getElementById('rec_amount').value = inst_amount * inst_no;
// document.getElementById('show_amount').value = inst_amount * inst_no;
document.getElementById('total_amount').value = inst_amount * inst_no;
document.getElementById('hidden_total_amount').value = inst_amount * inst_no;
}
</script>
<div class="container" style="margin-top: 20px;margin-bottom:20px;">
<form method="get" action="Trans_New">
<div class="form-group">
<input class="form-control" type="text" placeholder="input A/C no and enter" name="no">
</div>
</form>
</div>
<?php
if(isset($_GET["no"]) && isset($_GET["type"])&&$_GET["type"]=="Loan"){
echo '
<div class="container" style="margin-top: 20px;"> <h5>New Transaction : '.$GLOBALS['post_info'].' </h5><hr></div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Remaining Amount</th>
<th>Installment</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $_GET['type'] == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 40) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<!-- change this line to disable change fine <input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()"> -->
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" disabled">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo'
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT']. '" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
if(isset($_GET["no"]) && isset($_GET["type"])&&$_GET["type"]=="Recurring"){
echo '
<div class="container" style="margin-top: 10px;"> <h5>New Transaction : '.$GLOBALS['post_info'].' </h5><hr></div>
<div class="container table-responsive">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>Name</th>
<th>Phone</th>
<th>AC No</th>
<th>Total Deposit</th>
<th>Installment</th>
<th>Receive Amount</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_ACNO` = '".$_GET["no"]."' ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$row["AA_NAME"]. "</td>
<td>".$row["AA_PHONE"]. "</td>
<td>".$row["AA_ACNO"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_INSTALLMENT"]. '</td>
<td>
<form method="post" enctype="multipart/form-data" id="submitInstallment">
<input type="hidden" name="FORM_NAME" value="add_installment">';
if ($due_i > 0 && $_GET['type'] == "Recurring") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = intval($due_amount);
$fine_amount = ($due_amount * 20) / 100;
$total_amount = $row["AA_INSTALLMENT"] + $fine_amount;
$total_rec = $row["AA_INSTALLMENT"] * 1;
echo '
<table class="table table-bordered">
<tr>
<td>
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO'].'">
<input type="hidden" name="ins_no" value="'.$due_i. '">
<small>Due Amount:</small>
<input type="text" id="due_amount" value="'.$due_amount. '" disabled style="width:50px;border:1px solid red">
<small>Installment Amount:</small>
<input type="text" id="inst_amount" value="' . $row['AA_INSTALLMENT'] . '" style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateFine()">
<small>Total received:</small>
<input type="number" id="total_rec" value="'.$total_rec.'" style="width:50px;" onchange="calculateFine()" disabled>
</td>
</tr>
<tr>
<td>
<input type="hidden" id="hidden_total_rec" value="'.$total_rec.'" name="add_i" style="width:50px;" onchange="calculateFine()">
<small>Fine:</small>
<input type="number" id="fine" name="fine_amount" value="'.$fine_amount.'" min="0" style="width:50px;border:1px solid red" onchange="calculateFine()">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$total_amount. '" disabled style="width:50px;border:1px solid red">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">
</td>
</tr>
</table>';
} else
echo '
<input type="hidden" id="inst_amount" value="'.$row['AA_INSTALLMENT']. '">
<small>Amount:</small>
<input type="text" id="show_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<small>No:</small>
<input type="number" id="inst_no" value="1" min="1" style="width:50px;" onchange="calculateAmount()">
<input type="hidden" name="AA_ACNO" value="'.$row['AA_ACNO']. '">
<small>Total:</small>
<input type="text" id="total_amount" value="'.$row['AA_INSTALLMENT'].'" disabled style="width:50px;">
<input type="hidden" id="hidden_total_amount" name="add_i" value="'.$row['AA_INSTALLMENT'].'">
<input type="submit" class="btn-info" value="Receive" onclick="sendData(event)">';
echo '</form></td></tr>';
}
} else {echo "Check A/C no.";};
$conn->close();
echo '</table></div>';
}
?>
<div class="container" style="margin-top: 70px;">
<div class="row">
<div class="col-md-2">
<h5>Past Transactions::::</h5>
</div>
<div class="col-md-2">
<button class="btn btn-success" onclick="window.location.reload()">Refresh</button>
</div>
</div><hr>
</div>
<?php
if(isset($_GET["no"])){
echo '
<div class="container table-responsive">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>SL</th>
<th>Tr No</th>
<th>TimeStamp</th>
<th>User</th>
<th>A/C No</th>
<th>Amount</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
// $sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_ACID` = '".$_GET['no']."'";
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` WHERE `AT_ACID` = '".$_GET['no']."' ORDER BY `".$GLOBALS['arif_tran']."`.`AT_ID` DESC";
$result = $conn->query($sql);
$rowcount=mysqli_num_rows($result);//$rowcount++;
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
echo "
<tr>
<td>".$rowcount. "</td>
<td>".$row["AT_ID"]. "</td>
<td>".$row["AT_TIMESTAMP"]. "</td>
<td>".$row["AT_ADMIN"]. "</td>
<td>".$row["AT_ACID"]. "</td>
<td>".$row["AT_AMOUNT"]. "</td>
</tr>";
$rowcount--;
}
} else echo "No Past record Found";
mysqli_free_result($result);$conn->close();
echo '</table></div>';
}
?>
<script>
var submitInstallment = document.getElementById("submitInstallment");
function sendData(event) {
event.preventDefault();
var XHR = new XMLHttpRequest();
var FD = new FormData(submitInstallment);
XHR.addEventListener("load", function (event) {
var obj = JSON.parse(event.target.responseText);
// console.log(obj);
alert(obj.statusmsg);
// window.location.reload(true);
window.history.back();
});
XHR.addEventListener("error", function () {
alert('Error', 'Ooops!! Something went wrong.');
});
console.log(FD);
XHR.open("POST", "/exe/receive_amount/");
XHR.send(FD);
}
</script>

View File

@ -0,0 +1,112 @@
<div class="container" style="background-color:#e0a3a3;padding:8px;">
<ul class="nav nav-pills nav-justified">
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="FD") echo'class="active"';?>><a href="View_ac?Type=FD">Fixed Deposits</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Loan") echo'class="active"';?>><a href="View_ac?Type=Loan">Loan A/C</a></li>
<li <?php if(isset($_GET['Type']) && $_GET['Type']=="Recurring") echo'class="active"';?>><a href="View_ac?Type=Recurring">Recurring A/Cs</a></li>
</ul>
</div>
<?php
// var_dump($_SESSION['EMAIL']);
function view_list_ac($type) {
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW CUSTOMERS</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>SL</th>
<th>Type</th>
<th>AC No</th>
<th>Name</th>
<th>Account Creation Date</th>
<th>Loan Amount</th>
<th>PHONE</th>
<th>Balance</th>
<th>Total No Of Installment to be paid</th>
<th>No Of Paid Installment</th>
<th>No of Expected Installment till today</th>
<th>Installment Amount</th>
<th>Due Installment</th>
<th>Due Amount</th>
<th>Due after Fine</th>
</tr>';
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$GLOBALS['arif_ac']."` WHERE `AA_TYPE`='".$type."' AND `AA_AGENT`='".$_SESSION['EMAIL']."' ORDER BY `AA_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
$tt=$row["AA_ID"]-10;
$date1 = date_create($row["AA_DATE"]);
$date2 = date_create(date("Y/m/d"));
$diff = date_diff($date1, $date2);
if($type === 'Loan'){
$no_paid_inst = ($row["AA_MATURE_VALUE"] + $row["AA_BAL"]) / $row["AA_INSTALLMENT"];
} else {
if($row["AA_INSTALLMENT"]==0)$no_paid_inst = "NaN"; else $no_paid_inst = $row["AA_BAL"] / $row["AA_INSTALLMENT"];
}
if ($row["AA_ACTYPE"] == 'D'){$diff = $diff->format("%a"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];} else {$diff=$diff->format("%m"); $diff=(int)$diff;$due_i=$diff-$row["AA_NO_OF_PAYPAID"];}
echo "
<tr>
<td>".$tt."</td>
<td>".$row["AA_ACTYPE"].",".$row["AA_TYPE"]."</td>
<td><a href='./Details?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>".$row["AA_ACNO"]."</a> &nbsp;&nbsp; <a href='./Trans_New?no=".$row["AA_ACNO"]."&type=".$row["AA_TYPE"]."'>Transact</a></td>
<td>".$row["AA_NAME"]."</td>
<td>".$row["AA_DATE"]."</td>
<td>".$row["AA_MATURE_VALUE"]."</td>
<td>".$row["AA_PHONE"]."</td>
<td>".$row["AA_BAL"]. "</td>
<td>".$row["AA_NO_OF_PAYMENT"]."</td>
<td>".$no_paid_inst."</td>
<td>".$diff."</td>
<td>".$row["AA_INSTALLMENT"]."</td>
<td>".$due_i."</td>";
if ($due_i > 0) {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
else {
$due_amount = 'All Clear';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
if ($due_i > 0 && $type == "Recurring") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = (($due_amount) * 20)/100;
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
elseif ($due_i > 0 && $type == "Loan") {
$due_amount = $due_i * $row["AA_INSTALLMENT"];
$due_amount = (($due_amount) * 40)/100;
echo "<td class='alert danger text-danger'>".$due_amount."</td>";
}
else {
$due_amount = 'Up to Date!!';
echo "<td class='alert success text-success'>".$due_amount."</td>";
}
echo "</tr>";
}
} else {
echo "0 results";
};
$conn->close();
echo '
</table>
</div>
';
}
if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1,105 @@
<div class="container">
<table>
<!-- <tr>
<td>
<form>
<input type="date" name="tday">
<input type="submit" class="btn-info" value="Daily Report">
</form>
</td>
<td>
<form>
<input type="date" name="tmonth">
<input type="submit" class="btn-info" value="Monthly Report">
</form>
</td>
</tr> -->
<tr><td>.</td><td>.</td></tr>
<tr>
<td colspan="2">
<form>
<label for="">From </label><input type="date" name="dFrom">
<label for="">To </label><input type="date" name="dTo">
<input type="submit" class="btn-info" value="Report">
</form>
</td>
</tr>
</table>
</div>
<?php
function report_view($type,$dt) {
$dateFrom=$dt;
if($type!="month" || $type!="day") {
$dateFrom= strtotime($dt); $dateFrom = date("Y-m-d", $dateFrom);
$dateTo= strtotime('+1 day', strtotime($type)); $dateTo = date("Y-m-d", $dateTo);
}
//$dateFrom=$dt;
else{
if($type=="month") {$dateFrom= strtotime('-1 day', strtotime($dt)); $dateFrom = date("Y-m-d", $dateFrom);}
$dateTo = strtotime('+1 '.$type, strtotime($dt));
$dateTo = date("Y-m-d", $dateTo);
}
echo '<div class="container"> <h3>'.$dateFrom." -> ".$dateTo."(Up to)</h3> </div>";
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
$totalAmount=0;
echo '
<div class="container" style="margin-top: 70px;">
<h5>VIEW REPORT::::::::</h5><hr>
</div>
<div class="container">
<table class="table table-striped table-bordered table-hover table-responsive">
<tr>
<th>Transaction ID</th>
<th>Time</th>
<th>AC No</th>
<th>Name</th>
<th>Amount</th>
<th>commission</th>
</tr>';
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` INNER JOIN `".$GLOBALS['arif_ac']."` ON `".$GLOBALS['arif_tran']."`.`AT_ACID`=`".$GLOBALS['arif_ac']."`.`AA_ACNO` WHERE `AT_TIMESTAMP` BETWEEN '".$dateFrom." 00:00:00.000000' AND '".$dateTo." 00:00:00.000000' AND `AA_AGENT`= '".$_SESSION['EMAIL']."' ORDER BY `AT_ID` DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//$ID=$row["GC_ID"];
// $tt=$row["AT_ID"]-10;
echo "
<tr>
<td>".$row["AT_ID"]. "</td>
<td>".$row["AT_TIMESTAMP"]. "</td>
<td>".$row["AT_ACID"]. "</td>
<td>".$row["AA_NAME"]. "</td>
<td>".$row["AT_AMOUNT"]. "</td>
<td>".$row["AT_AMOUNT"]/100*2.5 . "</td>
</tr>";$totalAmount+=$row["AT_AMOUNT"];
}
} else {
echo "0 results";
}
$conn->close();
echo '
</table>
<hr> <h2> Total Transaction amount : '.$totalAmount.'</h2>
<hr> <h2> Total Commission amount : '.$totalAmount/100*2.5 .'</h2>
</div>
';
}
if(isset($_GET['tday']) && $_GET['tday']!="") report_view('day',$_GET['tday']);
if(isset($_GET['tmonth']) && $_GET['tmonth']!="") report_view('month',$_GET['tmonth']);
if(isset($_GET['dFrom']) && $_GET['dTo']!="") report_view($_GET['dTo'],$_GET['dFrom']);
//if(isset($_GET['Type']) && $_GET['Type']=="Loan") view_list_ac('Loan');
// if(isset($_GET['Type']) && $_GET['Type']=="Recurring") view_list_ac('Recurring');
// if(isset($_GET['Type']) && $_GET['Type']=="FD") view_list_ac('FD');
?>

View File

@ -0,0 +1 @@
admin panel home

View File

@ -0,0 +1,33 @@
<?php
function get_user() {
$users = glob(APP_DIR.'/CONTENT/ROOT_URI/Admin/users/*');
$user_arr = array();
for($i = 0; $i < count($users); $i++) {
$new_user = explode('/', $users[$i]);
$new_user = end($new_user);
$user_arr[$i] = $new_user;
}
if(isset($_SESSION['EMAIL']) && in_array($_SESSION['EMAIL'], $user_arr)){
return true;
} else return false;
}
$lnk2 = explode('?', $lnk);
include("ADMIN_HEADER.php");
if($_SESSION['EMAIL'] =="sarkar.suvankar@gmail.com" || $_SESSION['EMAIL']=="samiran.in@gmail.com" || $_SESSION['EMAIL']=="arif.kanyashree@gmail.com") {
include("ADMIN_nav.php");
echo "<br>";
if($lnk=="") include("home.php");
elseif(file_exists(__DIR__."/".$lnk.".php")) include($lnk.".php");
elseif(isset($lnk2[1]) && file_exists(__DIR__."/".$lnk2[0].".php") ) include($lnk2[0].".php");
else include("404.php");
}
elseif(get_user() == true){
include("AGENT_nav.php");
echo "<br>";
if($lnk=="") include("home.php");
elseif(file_exists(__DIR__."/agent_".$lnk.".php")) include("agent_".$lnk.".php");
elseif(isset($lnk2[1]) && file_exists(__DIR__."/agent_".$lnk2[0].".php") ) include("agent_".$lnk2[0].".php");
else include("404.php");
} else echo '<center><h2>Provide Details to login</h2> <a href="https://siliconpin.com/id/auth"><button class="btn btn-default">Login</button></a></center>';
include("ADMIN_FOOTER.php");
?>

View File

@ -0,0 +1,23 @@
<?php
$lnk2 = explode('?', $lnk);
include("ADMIN_HEADER.php");//print file_get_contents('http://www.example.com/');var_dump(gethostbyaddr($_SERVER['HTTP_REFERER']));// echo $lnk."c";
/*
echo $_SERVER['HTTP_USER_AGENT'] . "\n\n";
$browser = get_browser(null, true);
print_r($browser);echo $_SERVER['HTTP_REFERER'];*/
// include("ADMIN_nav.php");
if(isset($_SESSION['EMAIL']) || isset($_COOKIE['EMAIL']) ){
include("ADMIN_nav.php");
echo "<br>";
if($lnk=="") include("home.php");
elseif(file_exists(__DIR__."/".$lnk.".php")) include($lnk.".php");
elseif(isset($lnk2[1]) && file_exists(__DIR__."/".$lnk2[0].".php") ) include($lnk2[0].".php");
else include("404.php");
}else echo '<center>
<h2>Provide Details to login</h2> <a href="https://siliconpin.com/id/auth"><button class="btn btn-default">Login</button></a> </center>';
include("ADMIN_FOOTER.php");
?>

View File

@ -0,0 +1,58 @@
<div class="container">
<?php echo $GLOBALS['alert_info'] ?>
</div>
<div class="container">
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="FORM_NAME" value="new_news_entry">
<input type="hidden" name="lang" value="BN">
<div ng-app="myApp" ng-controller="myCtrl" class="form-group">
<select class="form-control" name="news_category"><option ng-repeat="x in names">{{x}}</option></select>
</select>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.names = [<?php include APP_DIR."/CONTENT/VARIABLES/news_type_list_en.php";?>];
});
</script>
<div class="form-group">
<input type="text" class="form-control" name="news_link" placeholder="Meta/Link for this news entry">
<small id="emailHelp" class="form-text text-muted">Alphanumeric(A-Z,a-z,0-9).</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="news_title" placeholder="Title for this new">
</div>
<div class="form-group">
<textarea class="form-control" rows="5" name="news_content" placeholder="News content text"></textarea>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<label class="btn btn-default btn-file">
<input name="photo_news" type="file" >
</label>
<!-- Multiple upload not needed for now! <div class="fileinput fileinput-new" data-provides="fileinput">
<span class="btn btn-default btn-file"><span></span><input type="file" multiple /></span>
<span class="fileinput-filename"></span><span class="fileinput-new"></span>
</div>-->
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input">
Check me out
</label>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
<!--<div class="row">
<iframe width="100%" height="350" src="https://www.youtube.com/embed/UXJTvnf-meU" frameborder="0" allowfullscreen></iframe>
</div>-->
</form>
</div>

View File

@ -0,0 +1,57 @@
<div class="container">
<?php echo $GLOBALS['alert_info'] ?>
</div>
<div class="container">
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="FORM_NAME" value="new_news_entry">
<input type="hidden" name="lang" value="EN">
<div ng-app="myApp" ng-controller="myCtrl" class="form-group">
<select class="form-control" name="news_category"><option ng-repeat="x in names">{{x}}</option></select>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.names = [<?php include APP_DIR."/CONTENT/VARIABLES/news_type_list_en.php";?>];
});
</script>
<div class="form-group">
<input type="text" class="form-control" name="news_link" placeholder="Meta/Link for this news entry">
<small id="emailHelp" class="form-text text-muted">Alphanumeric(A-Z,a-z,0-9).</small>
</div>
<div class="form-group">
<input type="text" class="form-control" name="news_title" placeholder="Title for this new">
</div>
<div class="form-group">
<textarea class="form-control" rows="5" name="news_content" placeholder="News content text"></textarea>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<label class="btn btn-default btn-file">
<input name="photo_news" type="file" >
</label>
<!-- Multiple upload not needed for now! <div class="fileinput fileinput-new" data-provides="fileinput">
<span class="btn btn-default btn-file"><span></span><input type="file" multiple /></span>
<span class="fileinput-filename"></span><span class="fileinput-new"></span>
</div>-->
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input">
Check me out
</label>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
<!--<div class="row">
<iframe width="100%" height="350" src="https://www.youtube.com/embed/UXJTvnf-meU" frameborder="0" allowfullscreen></iframe>
</div>-->
</form>
</div>

View File

@ -0,0 +1,11 @@
<?php echo $_POST["name"]; ?><br>
<?php echo $_POST["email"]; ?>
<div class="container">
<form method="POST">
<input type="text" name="name" placeholder="name" class="frist"/>
<input type="text" name="email" placeholder="email"/>
<input type="submit" value="submit" />
</form>
</div>

View File

@ -0,0 +1,3 @@
<div class="container">
</div>

View File

@ -0,0 +1,129 @@
<script>
function update_pri(id) {
var idn='pri'+id;
if (id.length == 0) {
alert("Input Error!");
return;
} else {
var pri=document.getElementById(idn).value;
document.getElementById(idn).disabled = true;
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById(idn).disabled = false;
document.getElementById(idn).value = this.responseText;
}
};
xmlhttp.open("GET", "/execute.php?id=" + id + "&pri="+pri, true);
xmlhttp.send();
}
}
</script>
<script>
function switch_state(id) {
var idn='act'+id;
if (id.length == 0) {
alert("Input Error!");
return;
} else {
var active=document.getElementById(idn).value;
document.getElementById(idn).disabled = true;
console.log(idn);
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById(idn).disabled = false;
document.getElementById(idn).value = this.responseText;
}
};
xmlhttp.open("GET", "/execute2.php?id=" + id + "&active="+active, true);
xmlhttp.send();
}
}
</script>
<div class="container table-responsive">
<table class="table table-striped table-bordered table-hover">
<tr>
<th>ID</th>
<th>TITLE</th>
<th>DATE</th>
<th>CATEGORY</th>
<th>PRIORITY</th>
<th>STATE</th>
</tr>
<?php
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
$conn->set_charset("utf8");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM ".$GLOBALS['table1'];
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
//echo "id: " . $row["N_TITLE"]. " - Name: " . $row["N_DATE"]. " " . $row["N_CATEGORY"]." " . $row["pri"]. "<br>";
$ID=$row["id"];
echo "
<tr>
<td>" . $ID. "</td>
<td>" . $row["N_TITLE"]. "</td>
<td>" . $row["N_DATE"]. "</td>
<td>" . $row["N_CATEGORY"]. "</td>
<td>
<form method='post'>
<input type='number' name='pri' id='pri" .$ID. "' value='" . $row["pri"]. "'>
<input type='hidden' name='id' value='" .$ID. "'>
<input class='btn btn-success' type='button' name='priority' value='SAVE' onclick='update_pri(" .'"'.$ID.'"'. ")'>
</form>
</td>
<td>
<select name='state' id='act" .$ID. "' onchange='switch_state(" .'"'.$ID.'"'. ")' >
<option>".$row['ACTIVE']."</option>
<option>0</option>
<option>1</option>
</select>
</td>
</tr>";
}
} else {
echo "0 results";
};
$conn->close();
?>
<?php
if(isset($_POST['priority']) && $_POST['priority']=='SUBMIT')
{
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "UPDATE `".$GLOBALS["table1"]."` SET `pri` = '".$_POST['pri']."' WHERE `news`.`id` =".$_POST['id'];
$result = $conn->query($sql);
if(!$result) echo mysqli_error(); else echo "Successfully Updated! <br />";
$conn->close();
}
?>
<?php
if(isset($_POST['statebtn']) && $_POST['statebtn']=='SUBMIT')
{
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "UPDATE `".$GLOBALS["table1"]."` SET `ACTIVE` = '".$_POST['active']."' WHERE `news`.`id` =".$_POST['id'];
$result = $conn->query($sql);
if(!$result) echo mysqli_error(); else echo "Successfully Updated! <br />";
$conn->close();
}
?>
</table>
</div>

View File

@ -0,0 +1 @@
404

Some files were not shown because too many files have changed in this diff Show More