implemented admin or bm approval functionality
parent
4a1128066d
commit
5a12de1c64
|
@ -2,6 +2,47 @@
|
|||
include(__DIR__ . '/auth.php');
|
||||
require_login();
|
||||
date_default_timezone_set('Asia/Kolkata');
|
||||
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
|
||||
if ($conn->connect_error) {
|
||||
die("Connection failed: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
$pendingCount = 0; // Default value
|
||||
|
||||
try {
|
||||
$table = 'fund_trans';
|
||||
|
||||
// Check user type and prepare appropriate query
|
||||
if ($_SESSION['type'] === 'admin') {
|
||||
// Admin can only see BM requests
|
||||
$countStmt = $conn->prepare("SELECT COUNT(*) AS pending_count FROM `$table` WHERE status = 0 AND request_usr_type = 'bm'");
|
||||
} elseif ($_SESSION['type'] === 'bm') {
|
||||
// BM can only see Admin requests
|
||||
$countStmt = $conn->prepare("SELECT COUNT(*) AS pending_count FROM `$table` WHERE status = 0 AND request_usr_type = 'admin'");
|
||||
} else {
|
||||
// Other user types see nothing
|
||||
$countStmt = false;
|
||||
$pendingCount = 0;
|
||||
}
|
||||
|
||||
if ($countStmt) {
|
||||
$countStmt->execute();
|
||||
$countResult = $countStmt->get_result();
|
||||
|
||||
if ($countResult) {
|
||||
$row = $countResult->fetch_assoc();
|
||||
$pendingCount = $row['pending_count'] ?? 0;
|
||||
}
|
||||
|
||||
$countStmt->close();
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
// Log error instead of showing to user
|
||||
error_log("Error getting pending count: " . $e->getMessage());
|
||||
}
|
||||
|
||||
$conn->close();
|
||||
?>
|
||||
<style>
|
||||
.logo {
|
||||
|
@ -19,6 +60,14 @@ date_default_timezone_set('Asia/Kolkata');
|
|||
align-items: center;
|
||||
}
|
||||
|
||||
/* Dropdown menu styling */
|
||||
.dropdown-menu > li > a {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
.navbar-nav > li > .dropdown-menu {
|
||||
border-top: 2px solid #337ab7;
|
||||
}
|
||||
|
||||
/* Mobile-specific styles */
|
||||
@media (max-width: 767px) {
|
||||
.mobile-welcome,
|
||||
|
@ -30,6 +79,21 @@ date_default_timezone_set('Asia/Kolkata');
|
|||
.navbar-right {
|
||||
display: none !important; /* hide right side in mobile */
|
||||
}
|
||||
|
||||
/* Adjust dropdown for mobile */
|
||||
.navbar-nav .open .dropdown-menu {
|
||||
position: static;
|
||||
float: none;
|
||||
width: auto;
|
||||
margin-top: 0;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
.navbar-nav .open .dropdown-menu > li > a {
|
||||
padding: 10px 15px 10px 35px;
|
||||
color: #777;
|
||||
}
|
||||
}
|
||||
|
||||
/* Desktop styles */
|
||||
|
@ -56,9 +120,6 @@ date_default_timezone_set('Asia/Kolkata');
|
|||
</button>
|
||||
|
||||
<!-- Mobile profile + welcome -->
|
||||
|
||||
|
||||
|
||||
<img class="mobile-profile"
|
||||
src="<?php echo $imagePath; ?>"
|
||||
width="40" height="40"
|
||||
|
@ -72,39 +133,45 @@ date_default_timezone_set('Asia/Kolkata');
|
|||
<?php
|
||||
$userType = $_SESSION['type'] ?? '';
|
||||
|
||||
if ($userType === 'admin') {
|
||||
if ($userType === 'admin' || $userType === 'bm') {
|
||||
?>
|
||||
<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/Trans_New">Transaction</a></li>
|
||||
<!-- Create New Dropdown Menu -->
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Create New <span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<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 role="separator" class="divider"></li>
|
||||
<li><a href="/Admin/Add_group">Add New Group</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="/Admin/View_AC?Type=Recurring">View A/C</a></li>
|
||||
<!-- Other menu items -->
|
||||
<li><a href="/Admin/Trans_New">Transaction</a></li>
|
||||
<?php if ($userType === 'admin') { ?>
|
||||
<li><a href="/Admin/agent-targets">Agent Targets</a></li>
|
||||
<li><a href="/Admin/agent_View_report">Commission</a></li>
|
||||
<?php } ?>
|
||||
<li><a href="/Admin/agent_View_report">Commission</a></li>
|
||||
<?php if ($userType === 'admin') { ?>
|
||||
<li><a href="/Admin/View_AC?Type=Recurring">View A/C</a></li>
|
||||
<li><a href="/Admin/upcoming-maturity">Upcoming Maturity</a></li>
|
||||
<?php } ?>
|
||||
<li><a href="/Admin/upcoming-maturity">Upcoming Maturity</a></li>
|
||||
<?php if ($userType === 'admin') { ?>
|
||||
<li><a href="/Admin/Report">Report</a></li>
|
||||
<li><a href="/Admin/Due">Deemand Sheet</a></li>
|
||||
<li><a href="/Admin/Settings_Agent">Agent Settings</a></li>
|
||||
<?php
|
||||
} elseif ($userType === 'bm') {
|
||||
?>
|
||||
<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/upcoming-maturity">Upcoming Maturity</a></li>
|
||||
<li><a href="/Admin/Trans_New">Transaction</a></li>
|
||||
<li><a href="/Admin/agent-targets">Agent Targets</a></li>
|
||||
<li><a href="/Admin/agent_View_report">Commission</a></li>
|
||||
<?php
|
||||
<?php } ?>
|
||||
<?php
|
||||
} elseif ($userType === 'agent') {
|
||||
?>
|
||||
<li><a href="/Admin/View_AC?Type=Recurring">View A/C</a></li>
|
||||
<li><a href="/Admin/Due">Deemand Sheet</a></li>
|
||||
<li><a href="/Admin/Report">Report</a></li>
|
||||
<li><a href="/Admin/agent_View_report">Commission</a></li>
|
||||
<?php
|
||||
?>
|
||||
<li><a href="/Admin/View_AC?Type=Recurring">View A/C</a></li>
|
||||
<li><a href="/Admin/Due">Deemand Sheet</a></li>
|
||||
<li><a href="/Admin/Report">Report</a></li>
|
||||
<li><a href="/Admin/agent_View_report">Commission</a></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
@ -136,7 +203,22 @@ date_default_timezone_set('Asia/Kolkata');
|
|||
?>
|
||||
</li>
|
||||
<li><a href="/Admin/Signout">Signout</a></li>
|
||||
<li>
|
||||
<a href="/Admin/notification" style="position: relative; display: inline-block; padding: 8px;">
|
||||
<?php if($pendingCount > 0) { ?>
|
||||
<div style="width: 18px; height: 18px; border-radius: 50%; background-color: #ff4444; position: absolute; top: 2px; right: 2px; z-index: 10; box-shadow: 0 0 0 2px rgba(255,255,255,0.8); font-size: 11px; font-weight: bold; color: white; text-align: center; line-height: 18px;">
|
||||
<?= $pendingCount > 99 ? '99+' : $pendingCount ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 64 64" fill="#4a5568" style="filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));">
|
||||
<g>
|
||||
<path fill="currentColor" d="M56,44c-1.832,0-4-2.168-4-4V20C52,8.973,43.027,0,32,0S12,8.973,12,20v20c0,1.793-2.207,4-4,4 c-2.211,0-4,1.789-4,4s1.789,4,4,4h48c2.211,0,4-1.789,4-4S58.211,44,56,44z"></path>
|
||||
<path fill="currentColor" d="M32,64c4.418,0,8-3.582,8-8H24C24,60.418,27.582,64,32,64z"></path>
|
||||
</g>
|
||||
</svg>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</nav>
|
|
@ -215,14 +215,10 @@ function calculateAmount() {
|
|||
}
|
||||
?>
|
||||
<?php
|
||||
if ($_SESSION['type'] === 'admin' && isset($_GET["no"]) && isset($_GET["type"]) && $_GET["type"] == "Recurring") {
|
||||
if (
|
||||
$_SERVER['REQUEST_METHOD'] === 'POST'
|
||||
&& isset($_POST['PAY_LOAN_EMI_FROM_RECURRING'], $_POST['PAY_LOAN_EMI_FROM_RECURRING_ID'], $_POST['DEDUCT_LOAN_AMOUNT'])
|
||||
&& $_POST['PAY_LOAN_EMI_FROM_RECURRING_ID'] === 'axakassaoxnnxsaoij34866'
|
||||
) {
|
||||
if ($_SESSION['type'] === 'admin' || $_SESSION['type'] === 'bm' && isset($_GET["no"]) && isset($_GET["type"]) && $_GET["type"] == "Recurring") {
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['PAY_LOAN_EMI_FROM_RECURRING'], $_POST['PAY_LOAN_EMI_FROM_RECURRING_ID'], $_POST['DEDUCT_LOAN_AMOUNT']) && $_POST['PAY_LOAN_EMI_FROM_RECURRING_ID'] === 'axakassaoxnnxsaoij34866') {
|
||||
$loanEMIAmount = floatval($_POST['DEDUCT_LOAN_AMOUNT']);
|
||||
$deductAmount = -$loanEMIAmount; // negative for recurring deduction
|
||||
$deductAmount = $loanEMIAmount; // negative for recurring deduction
|
||||
$paidToLoanAccountNumber = $_POST['LOAN_AC_NUMBER'];
|
||||
$accountId = $_GET['no'];
|
||||
|
||||
|
@ -259,35 +255,20 @@ if ($_SESSION['type'] === 'admin' && isset($_GET["no"]) && isset($_GET["type"])
|
|||
$conn->begin_transaction();
|
||||
|
||||
try {
|
||||
$table = $GLOBALS['arif_tran'] ?? 'arif_tran';
|
||||
$userType = 'admin';
|
||||
// $table = $GLOBALS['arif_tran'] ?? 'arif_tran';
|
||||
$table = 'fund_trans';
|
||||
|
||||
$requestBy = $_SESSION['user_id'];
|
||||
$requestUSRType = $_SESSION['type'];
|
||||
$recACNumber = $accountId;
|
||||
$loanACNumber = $paidToLoanAccountNumber;
|
||||
$transferAmount = $deductAmount;
|
||||
|
||||
|
||||
// Entry 1: Deduction from recurring
|
||||
$remarksText1 = "₹$loanEMIAmount deducted from Recurring for Loan A/c $paidToLoanAccountNumber EMI";
|
||||
$stmt = $conn->prepare("INSERT INTO `$table` (AT_ADMIN, AT_ACID, AT_AMOUNT, REMARKS) VALUES (?, ?, ?, ?)");
|
||||
$stmt->bind_param("ssds", $userType, $accountId, $deductAmount, $remarksText1);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
// Entry 2: Credit to loan account
|
||||
$remarksText2 = "₹$loanEMIAmount credited to Loan A/c $paidToLoanAccountNumber EMI (from Recurring $accountId)";
|
||||
$stmt = $conn->prepare("INSERT INTO `$table` (AT_ADMIN, AT_ACID, AT_AMOUNT, REMARKS) VALUES (?, ?, ?, ?)");
|
||||
$stmt->bind_param("ssds", $userType, $paidToLoanAccountNumber, $loanEMIAmount, $remarksText2);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
// Update Loan Account
|
||||
$ins_no = 1;
|
||||
$sql = "UPDATE `" . $GLOBALS['arif_ac'] . "` SET `AA_BAL` = `AA_BAL` + ?, `AA_NO_OF_PAYPAID` = `AA_NO_OF_PAYPAID` + ? WHERE `AA_ACNO` = ?";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bind_param("dis", $loanEMIAmount, $ins_no, $paidToLoanAccountNumber);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
// Update Recurring Account
|
||||
$sql = "UPDATE `" . $GLOBALS['arif_ac'] . "` SET `AA_BAL` = `AA_BAL` - ? WHERE `AA_ACNO` = ?";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bind_param("ds", $loanEMIAmount, $accountId);
|
||||
// $remarksText1 = "₹$loanEMIAmount deducted from Recurring for Loan A/c $paidToLoanAccountNumber EMI";
|
||||
$stmt = $conn->prepare("INSERT INTO `$table` (request_by, request_usr_type, rec_ac_number, loan_ac_number, transfer_amount) VALUES (?, ?, ?, ?, ?)");
|
||||
$stmt->bind_param("sssss", $requestBy, $requestUSRType, $recACNumber, $loanACNumber, $transferAmount);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
|
@ -310,7 +291,7 @@ if ($_SESSION['type'] === 'admin' && isset($_GET["no"]) && isset($_GET["type"])
|
|||
}
|
||||
?>
|
||||
|
||||
<?php if ($_SESSION['type'] === 'admin' && isset($_GET["no"]) && isset($_GET["type"]) && $_GET["type"] == "Recurring") { ?>
|
||||
<?php if ($_SESSION['type'] === 'admin' || $_SESSION['type'] === 'bm' && isset($_GET["no"]) && isset($_GET["type"]) && $_GET["type"] == "Recurring") { ?>
|
||||
<div class="container">
|
||||
<h4>Pay Loan EMI from Recurring balance</h4>
|
||||
<div style="display: flex; gap: 20px; flex-direction: row; max-width: 60%;">
|
||||
|
|
|
@ -0,0 +1,502 @@
|
|||
<?php
|
||||
session_start();
|
||||
date_default_timezone_set('Asia/Kolkata');
|
||||
|
||||
if (!isset($_SESSION['user_id']) || empty($_SESSION['user_id'])) {
|
||||
echo "<script>window.location.href = '/Agent/agent-login'</script>";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Database connection
|
||||
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
|
||||
if ($conn->connect_error) {
|
||||
die("Connection failed: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
// Process status update if form is submitted
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['update_status'])) {
|
||||
$id = $conn->real_escape_string($_POST['id']);
|
||||
$status = $conn->real_escape_string($_POST['status']);
|
||||
$approved_by = $_SESSION['user_id'];
|
||||
$remarks = $conn->real_escape_string($_POST['remarks'] ?? '');
|
||||
|
||||
try {
|
||||
$conn->begin_transaction();
|
||||
|
||||
// First get the transaction details
|
||||
$getStmt = $conn->prepare("SELECT * FROM fund_trans WHERE id = ?");
|
||||
$getStmt->bind_param("i", $id);
|
||||
$getStmt->execute();
|
||||
$transaction = $getStmt->get_result()->fetch_assoc();
|
||||
$getStmt->close();
|
||||
|
||||
if ($transaction) {
|
||||
// Check if the current user has permission to approve this request
|
||||
$can_approve = false;
|
||||
|
||||
// Admin can approve BM requests
|
||||
if ($_SESSION['type'] === 'admin' && $transaction['request_usr_type'] === 'bm') {
|
||||
$can_approve = true;
|
||||
}
|
||||
// BM can approve Admin requests
|
||||
elseif ($_SESSION['type'] === 'bm' && $transaction['request_usr_type'] === 'admin') {
|
||||
$can_approve = true;
|
||||
}
|
||||
|
||||
if (!$can_approve) {
|
||||
throw new Exception("You don't have permission to approve this request.");
|
||||
}
|
||||
|
||||
$updateStmt = $conn->prepare("UPDATE fund_trans SET status = ?, approved_by = ?, approved_usr_type = ?, remarks = ? WHERE id = ?");
|
||||
$updateStmt->bind_param("ssssi", $status, $approved_by, $_SESSION['type'], $remarks, $id);
|
||||
$updateStmt->execute();
|
||||
|
||||
// If approved, process the fund transfer
|
||||
if ($status == 1) {
|
||||
$transfer_amount = abs($transaction['transfer_amount']); // Make it positive
|
||||
$rec_ac_number = $transaction['rec_ac_number']; // Recurring Account Number
|
||||
$loan_ac_number = $transaction['loan_ac_number']; // Loan Account Number
|
||||
|
||||
// Check if Recurring Account has sufficient balance
|
||||
$balanceCheck = $conn->prepare("SELECT AA_BAL FROM `" . $GLOBALS['arif_ac'] . "` WHERE AA_ACNO = ?");
|
||||
$balanceCheck->bind_param("s", $rec_ac_number);
|
||||
$balanceCheck->execute();
|
||||
$balanceCheck->bind_result($current_balance);
|
||||
$balanceCheck->fetch();
|
||||
$balanceCheck->close();
|
||||
|
||||
if ($current_balance < $transfer_amount) {
|
||||
throw new Exception("Insufficient balance in Recurring Account.");
|
||||
}
|
||||
|
||||
// Deduct from Recurring Account
|
||||
$deductStmt = $conn->prepare("UPDATE `" . $GLOBALS['arif_ac'] . "` SET AA_BAL = AA_BAL - ? WHERE AA_ACNO = ?");
|
||||
$deductStmt->bind_param("ds", $transfer_amount, $rec_ac_number);
|
||||
$deductStmt->execute();
|
||||
$deductStmt->close();
|
||||
|
||||
// Add to Loan Account
|
||||
$addStmt = $conn->prepare("UPDATE `" . $GLOBALS['arif_ac'] . "` SET AA_BAL = AA_BAL + ? WHERE AA_ACNO = ?");
|
||||
$addStmt->bind_param("ds", $transfer_amount, $loan_ac_number);
|
||||
$addStmt->execute();
|
||||
$addStmt->close();
|
||||
|
||||
// Create transaction records
|
||||
$userType = $_SESSION['type'];
|
||||
$table = $GLOBALS['arif_tran'] ?? 'arif_tran';
|
||||
|
||||
// Deduction from Recurring Account
|
||||
$remarksText1 = "₹$transfer_amount transferred to Loan A/c $loan_ac_number";
|
||||
$stmt1 = $conn->prepare("INSERT INTO `$table` (AT_ADMIN, AT_ACID, AT_AMOUNT, REMARKS) VALUES (?, ?, ?, ?)");
|
||||
$negative_amount = -$transfer_amount;
|
||||
$stmt1->bind_param("ssds", $userType, $rec_ac_number, $negative_amount, $remarksText1);
|
||||
$stmt1->execute();
|
||||
$stmt1->close();
|
||||
|
||||
// Credit to Loan Account
|
||||
$remarksText2 = "₹$transfer_amount received from Recurring A/c $rec_ac_number";
|
||||
$stmt2 = $conn->prepare("INSERT INTO `$table` (AT_ADMIN, AT_ACID, AT_AMOUNT, REMARKS) VALUES (?, ?, ?, ?)");
|
||||
$stmt2->bind_param("ssds", $userType, $loan_ac_number, $transfer_amount, $remarksText2);
|
||||
$stmt2->execute();
|
||||
$stmt2->close();
|
||||
}
|
||||
|
||||
if ($updateStmt->affected_rows > 0) {
|
||||
$conn->commit();
|
||||
$success_message = "Status updated successfully!";
|
||||
} else {
|
||||
throw new Exception("No rows affected. Update failed.");
|
||||
}
|
||||
|
||||
$updateStmt->close();
|
||||
} else {
|
||||
throw new Exception("Transaction not found.");
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
$error_message = "Error updating status: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
// Get all pending items where status = 0
|
||||
$countResult = [];
|
||||
try {
|
||||
$table = 'fund_trans';
|
||||
|
||||
// Only show requests that the current user can approve
|
||||
if ($_SESSION['type'] === 'admin') {
|
||||
$countStmt = $conn->prepare("SELECT * FROM `$table` WHERE status = 0 AND request_usr_type = 'bm' ORDER BY created DESC");
|
||||
} elseif ($_SESSION['type'] === 'bm') {
|
||||
$countStmt = $conn->prepare("SELECT * FROM `$table` WHERE status = 0 AND request_usr_type = 'admin' ORDER BY created DESC");
|
||||
} else {
|
||||
// For other user types, show nothing
|
||||
$countStmt = $conn->prepare("SELECT * FROM `$table` WHERE status = 0 AND 1=0 ORDER BY created DESC");
|
||||
}
|
||||
|
||||
$countStmt->execute();
|
||||
$result = $countStmt->get_result();
|
||||
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$countResult[] = $row;
|
||||
}
|
||||
|
||||
$countStmt->close();
|
||||
} catch (Exception $e) {
|
||||
$error_message = "Error: " . $e->getMessage();
|
||||
}
|
||||
|
||||
// Get approval history
|
||||
$historyResult = [];
|
||||
try {
|
||||
if ($_SESSION['type'] === 'admin' || $_SESSION['type'] === 'bm') {
|
||||
$historyStmt = $conn->prepare("SELECT * FROM `fund_trans` WHERE status != 0 ORDER BY created DESC LIMIT 20");
|
||||
$historyStmt->execute();
|
||||
$history = $historyStmt->get_result();
|
||||
|
||||
while ($row = $history->fetch_assoc()) {
|
||||
$historyResult[] = $row;
|
||||
}
|
||||
|
||||
$historyStmt->close();
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$history_error = "Error loading history: " . $e->getMessage();
|
||||
}
|
||||
|
||||
$conn->close();
|
||||
?>
|
||||
|
||||
<!-- Notification Section -->
|
||||
<div class="container mt-4">
|
||||
<?php if (isset($success_message)): ?>
|
||||
<div class="alert alert-success alert-dismissible fade in" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<strong>Success!</strong> <?php echo $success_message; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($error_message)): ?>
|
||||
<div class="alert alert-danger alert-dismissible fade in" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<strong>Error!</strong> <?php echo $error_message; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="panel-title">
|
||||
<h4 class="pull-left">Pending Fund Transfer Requests</h4>
|
||||
<span class="badge pull-right"><?php echo count($countResult); ?> Pending</span>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php if (count($countResult) > 0): ?>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover" id="notificationTable" style="font-size: 14px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Requested By</th>
|
||||
<th>Req. User Type</th>
|
||||
<th>Recurring Account</th>
|
||||
<th>Loan Account</th>
|
||||
<th>Amount</th>
|
||||
<th>Req. On</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($countResult as $row): ?>
|
||||
<tr>
|
||||
<td><?php echo $row['id']; ?></td>
|
||||
<td><?php echo $row['request_by']; ?></td>
|
||||
<td><span class="label label-<?php echo $row['request_usr_type'] === 'admin' ? 'primary' : 'info'; ?>"><?php echo strtoupper($row['request_usr_type']); ?></span></td>
|
||||
<td><?php echo $row['rec_ac_number']; ?></td>
|
||||
<td><?php echo $row['loan_ac_number']; ?></td>
|
||||
<td class="text-danger"><strong><?php echo $row['transfer_amount']; ?></strong></td>
|
||||
<td><?php echo date("d M Y, h:i A", strtotime($row['created'])); ?></td>
|
||||
<td>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-success" onclick="openStatusModal(<?php echo $row['id']; ?>, 1)">
|
||||
<i class="glyphicon glyphicon-ok"></i> Approve
|
||||
</button>
|
||||
<button class="btn btn-danger" onclick="openStatusModal(<?php echo $row['id']; ?>, 2)">
|
||||
<i class="glyphicon glyphicon-remove"></i> Reject
|
||||
</button>
|
||||
<button class="btn btn-info" onclick="viewDetails(<?php echo $row['id']; ?>)">
|
||||
<i class="glyphicon glyphicon-eye-open"></i> View
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="alert alert-info text-center">
|
||||
<i class="glyphicon glyphicon-info-sign" style="font-size: 24px;"></i>
|
||||
<h4>No pending fund transfer requests</h4>
|
||||
<p>All requests have been processed or you don't have any requests to approve.</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Approval History Section -->
|
||||
<div class="container mt-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">Approval History</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php if (isset($history_error)): ?>
|
||||
<div class="alert alert-warning">
|
||||
<?php echo $history_error; ?>
|
||||
</div>
|
||||
<?php elseif (count($historyResult) > 0): ?>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover" id="historyTable" style="font-size: 14px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Requested By</th>
|
||||
<th>Requested User Type</th>
|
||||
<th>Approved By</th>
|
||||
<th>Approved User Type</th>
|
||||
<th>Recurring Account</th>
|
||||
<th>Loan Account</th>
|
||||
<th>Amount</th>
|
||||
<th>Status</th>
|
||||
<th>Requested On</th>
|
||||
<th>Approved On</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($historyResult as $row): ?>
|
||||
<tr>
|
||||
<td><?php echo $row['id']; ?></td>
|
||||
<td><?php echo $row['request_by']; ?></td>
|
||||
<td><span class="label label-<?php echo $row['request_usr_type'] === 'admin' ? 'primary' : 'info'; ?>"><?php echo strtoupper($row['request_usr_type']); ?></span></td>
|
||||
<td><?php echo $row['approved_by'] ?? 'N/A'; ?></td>
|
||||
<td>
|
||||
<?php if ($row['approved_usr_type']): ?>
|
||||
<span class="label label-<?php echo $row['approved_usr_type'] === 'admin' ? 'primary' : 'info'; ?>"><?php echo strtoupper($row['approved_usr_type']); ?></span>
|
||||
<?php else: ?>
|
||||
N/A
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?php echo $row['rec_ac_number']; ?></td>
|
||||
<td><?php echo $row['loan_ac_number']; ?></td>
|
||||
<td class="<?php echo $row['status'] == 1 ? 'text-success' : 'text-danger'; ?>">
|
||||
<strong><?php echo $row['transfer_amount']; ?></strong>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ($row['status'] == 1): ?>
|
||||
<span class="label label-success">Approved</span>
|
||||
<?php elseif ($row['status'] == 2): ?>
|
||||
<span class="label label-danger">Rejected</span>
|
||||
<?php else: ?>
|
||||
<span class="label label-warning">Pending</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?php echo date("d M Y, h:i A", strtotime($row['created'])); ?></td>
|
||||
<td>
|
||||
<?php if ($row['status'] != 0): ?>
|
||||
<?php echo date("d M Y, h:i A", strtotime($row['created'])); ?>
|
||||
<?php else: ?>
|
||||
N/A
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="alert alert-info text-center">
|
||||
<i class="glyphicon glyphicon-info-sign" style="font-size: 24px;"></i>
|
||||
<h4>No approval history found</h4>
|
||||
<p>There are no approved or rejected requests in the history.</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- View Details Modal -->
|
||||
<div class="modal fade" id="viewModal" tabindex="-1" role="dialog" aria-labelledby="viewModalLabel">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="viewModalLabel">Transaction Details</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<p><strong>ID:</strong> <span id="detail-id"></span></p>
|
||||
<p><strong>Requested By:</strong> <span id="detail-request-by"></span></p>
|
||||
<p><strong>User Type:</strong> <span id="detail-usr-type"></span></p>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<p><strong>Recurring Account:</strong> <span id="detail-rec-account"></span></p>
|
||||
<p><strong>Loan Account:</strong> <span id="detail-loan-account"></span></p>
|
||||
<p><strong>Amount:</strong> <span id="detail-amount" class="text-danger"><strong></strong></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-12">
|
||||
<p><strong>Requested On:</strong> <span id="detail-created"></span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Status Update Modal -->
|
||||
<div class="modal fade" id="statusModal" tabindex="-1" role="dialog" aria-labelledby="statusModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<form method="post" action="">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="statusModalLabel">Update Transaction Status</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="status-id">
|
||||
<input type="hidden" name="update_status" value="1">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="status" class="control-label">Status</label>
|
||||
<select class="form-control" id="status" name="status" required>
|
||||
<option value="1">Approve</option>
|
||||
<option value="2">Reject</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="remarks" class="control-label">Remarks (Optional)</label>
|
||||
<textarea class="form-control" id="remarks" name="remarks" rows="3"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Update Status</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// View transaction details
|
||||
function viewDetails(id) {
|
||||
<?php foreach ($countResult as $row): ?>
|
||||
if (<?php echo $row['id']; ?> === id) {
|
||||
document.getElementById('detail-id').textContent = <?php echo $row['id']; ?>;
|
||||
document.getElementById('detail-request-by').textContent = "<?php echo $row['request_by']; ?>";
|
||||
document.getElementById('detail-usr-type').textContent = "<?php echo $row['request_usr_type']; ?>";
|
||||
document.getElementById('detail-rec-account').textContent = "<?php echo $row['rec_ac_number']; ?>";
|
||||
document.getElementById('detail-loan-account').textContent = "<?php echo $row['loan_ac_number']; ?>";
|
||||
document.getElementById('detail-amount').textContent = "<?php echo $row['transfer_amount']; ?>";
|
||||
document.getElementById('detail-created').textContent = "<?php echo date("d M Y, h:i A", strtotime($row['created'])); ?>";
|
||||
}
|
||||
<?php endforeach; ?>
|
||||
|
||||
// Use Bootstrap 3 modal method
|
||||
$('#viewModal').modal('show');
|
||||
}
|
||||
|
||||
// Open status update modal
|
||||
function openStatusModal(id, status) {
|
||||
document.getElementById('status-id').value = id;
|
||||
document.getElementById('status').value = status;
|
||||
|
||||
// Use Bootstrap 3 modal method
|
||||
$('#statusModal').modal('show');
|
||||
}
|
||||
|
||||
// Initialize DataTable if we have records (if DataTable is available)
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Check if DataTable is available (if you're using it)
|
||||
if (typeof $.fn.DataTable !== 'undefined') {
|
||||
<?php if (count($countResult) > 0): ?>
|
||||
$('#notificationTable').DataTable({
|
||||
"pageLength": 10,
|
||||
"order": [[6, "desc"]],
|
||||
"language": {
|
||||
"search": "Search transactions:",
|
||||
"lengthMenu": "Show _MENU_ entries",
|
||||
"info": "Showing _START_ to _END_ of _TOTAL_ entries",
|
||||
"paginate": {
|
||||
"previous": "Previous",
|
||||
"next": "Next"
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (count($historyResult) > 0): ?>
|
||||
$('#historyTable').DataTable({
|
||||
"pageLength": 10,
|
||||
"order": [[9, "desc"]],
|
||||
"language": {
|
||||
"search": "Search history:",
|
||||
"lengthMenu": "Show _MENU_ entries",
|
||||
"info": "Showing _START_ to _END_ of _TOTAL_ entries",
|
||||
"paginate": {
|
||||
"previous": "Previous",
|
||||
"next": "Next"
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.panel {
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,0.05);
|
||||
}
|
||||
|
||||
.table th {
|
||||
font-weight: 600;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.btn-group-sm > .btn {
|
||||
padding: 5px 10px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.badge {
|
||||
background-color: #d9534f;
|
||||
font-size: 14px;
|
||||
padding: 5px 10px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 85%;
|
||||
padding: 0.2em 0.6em 0.3em;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,468 @@
|
|||
<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
|
||||
$CURRENT_RECURRING_BALANCE = 0;
|
||||
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"];
|
||||
$CURRENT_RECURRING_BALANCE = $row["AA_BAL"];
|
||||
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>';
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if ($_SESSION['type'] === 'admin' && isset($_GET["no"]) && isset($_GET["type"]) && $_GET["type"] == "Recurring") {
|
||||
if (
|
||||
$_SERVER['REQUEST_METHOD'] === 'POST'
|
||||
&& isset($_POST['PAY_LOAN_EMI_FROM_RECURRING'], $_POST['PAY_LOAN_EMI_FROM_RECURRING_ID'], $_POST['DEDUCT_LOAN_AMOUNT'])
|
||||
&& $_POST['PAY_LOAN_EMI_FROM_RECURRING_ID'] === 'axakassaoxnnxsaoij34866'
|
||||
) {
|
||||
$loanEMIAmount = floatval($_POST['DEDUCT_LOAN_AMOUNT']);
|
||||
$deductAmount = -$loanEMIAmount; // negative for recurring deduction
|
||||
$paidToLoanAccountNumber = $_POST['LOAN_AC_NUMBER'];
|
||||
$accountId = $_GET['no'];
|
||||
|
||||
if (!$accountId) {
|
||||
echo "Account number missing";
|
||||
exit;
|
||||
}
|
||||
|
||||
// ✅ DB connection
|
||||
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
|
||||
if ($conn->connect_error) {
|
||||
die("Connection failed: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
// ✅ Check recurring balance first
|
||||
$sql = "SELECT AA_BAL FROM `" . $GLOBALS['arif_ac'] . "` WHERE `AA_ACNO` = ?";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bind_param("s", $accountId);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($CURRENT_RECURRING_BALANCE);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
if ($loanEMIAmount > $CURRENT_RECURRING_BALANCE) {
|
||||
echo "<div class='container' style=' background-color: #f8d7da; color: #721c24; padding: 12px 20px; border: 1px solid #f5c6cb; border-radius: 5px; font-family: Arial, sans-serif; font-size: 15px; margin: 10px auto; position: relative;'>
|
||||
<strong>Error!</strong> Insufficient balance in Recurring account.
|
||||
<span style=\" position: absolute; top: 8px; right: 12px; color: #721c24; font-weight: bold; cursor: pointer; \" onclick=\"this.parentElement.style.display='none';\">×</span>
|
||||
</div>";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
// ✅ Begin transaction for atomicity
|
||||
$conn->begin_transaction();
|
||||
|
||||
try {
|
||||
$table = $GLOBALS['arif_tran'] ?? 'arif_tran';
|
||||
$userType = 'admin';
|
||||
|
||||
// Entry 1: Deduction from recurring
|
||||
$remarksText1 = "₹$loanEMIAmount deducted from Recurring for Loan A/c $paidToLoanAccountNumber EMI";
|
||||
$stmt = $conn->prepare("INSERT INTO `$table` (AT_ADMIN, AT_ACID, AT_AMOUNT, REMARKS) VALUES (?, ?, ?, ?)");
|
||||
$stmt->bind_param("ssds", $userType, $accountId, $deductAmount, $remarksText1);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
// Entry 2: Credit to loan account
|
||||
$remarksText2 = "₹$loanEMIAmount credited to Loan A/c $paidToLoanAccountNumber EMI (from Recurring $accountId)";
|
||||
$stmt = $conn->prepare("INSERT INTO `$table` (AT_ADMIN, AT_ACID, AT_AMOUNT, REMARKS) VALUES (?, ?, ?, ?)");
|
||||
$stmt->bind_param("ssds", $userType, $paidToLoanAccountNumber, $loanEMIAmount, $remarksText2);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
// Update Loan Account
|
||||
$ins_no = 1;
|
||||
$sql = "UPDATE `" . $GLOBALS['arif_ac'] . "` SET `AA_BAL` = `AA_BAL` + ?, `AA_NO_OF_PAYPAID` = `AA_NO_OF_PAYPAID` + ? WHERE `AA_ACNO` = ?";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bind_param("dis", $loanEMIAmount, $ins_no, $paidToLoanAccountNumber);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
// Update Recurring Account
|
||||
$sql = "UPDATE `" . $GLOBALS['arif_ac'] . "` SET `AA_BAL` = `AA_BAL` - ? WHERE `AA_ACNO` = ?";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bind_param("ds", $loanEMIAmount, $accountId);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
// ✅ Commit if everything ok
|
||||
$conn->commit();
|
||||
|
||||
echo "<div class='container' style=' background-color: #d4edda; color: #155724; padding: 12px 20px; border: 1px solid #c3e6cb; border-radius: 5px; font-family: Arial, sans-serif; font-size: 15px; margin: 10px auto; position: relative;'>
|
||||
<strong>Success!</strong> Loan EMI paid successfully!
|
||||
<span style=\" position: absolute; top: 8px; right: 12px; color: #155724; font-weight: bold; cursor: pointer; \" onclick=\"this.parentElement.style.display='none';\">×</span>
|
||||
</div>";
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
echo "Error processing EMI payment: " . $e->getMessage();
|
||||
}
|
||||
|
||||
$conn->close();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($_SESSION['type'] === 'admin' && isset($_GET["no"]) && isset($_GET["type"]) && $_GET["type"] == "Recurring") { ?>
|
||||
<div class="container">
|
||||
<h4>Pay Loan EMI from Recurring balance</h4>
|
||||
<div style="display: flex; gap: 20px; flex-direction: row; max-width: 60%;">
|
||||
<input class="form-control" type="text" id="acno" placeholder="Enter Account No" />
|
||||
<button class="btn btn-primary" onclick="getAccountDetails()">Get Details</button>
|
||||
</div>
|
||||
|
||||
|
||||
<form id="PAY_LOAN_RECURRING_FORM" method="post" style="display: none; gap: 20px; flex-direction: column; max-width: 60%; margin-top: 30px;">
|
||||
<input type="hidden" name="PAY_LOAN_EMI_FROM_RECURRING" value="1">
|
||||
<input type="hidden" name="PAY_LOAN_EMI_FROM_RECURRING_ID" value="axakassaoxnnxsaoij34866">
|
||||
|
||||
<div>
|
||||
<label for="ACCOUNT_HOLDER_NAME">Account holder Name:</label>
|
||||
<input class="form-control" id="ACCOUNT_HOLDER_NAME" name="ACCOUNT_HOLDER_NAME" type="text" readOnly />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="ACCOUNT_HOLDER_NAME">Recurring Balance:</label>
|
||||
<input class="form-control" id="ACCOUNT_HOLDER_NAME" name="ACCOUNT_HOLDER_NAME" type="text" value="<?= $CURRENT_RECURRING_BALANCE ?>" readOnly />
|
||||
</div>
|
||||
<div>
|
||||
<label for="LOAN_AC_NUMBER">Loan Account Number:</label>
|
||||
<input class="form-control" id="LOAN_AC_NUMBER" name="LOAN_AC_NUMBER" type="text" required readOnly />
|
||||
</div>
|
||||
<div>
|
||||
<label for="DEDUCT_LOAN_AMOUNT">Deduct Loan Amount:</label>
|
||||
<input class="form-control" id="DEDUCT_LOAN_AMOUNT" name="DEDUCT_LOAN_AMOUNT" type="number" required />
|
||||
</div>
|
||||
<div style="">
|
||||
<input class="btn btn-success" type="submit" value="Deduct & Pay Now" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<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"];
|
||||
$kolkataTime = date("d M Y, h:i A", strtotime($row["AT_TIMESTAMP"] . " +5 hours 30 minutes"));
|
||||
echo "
|
||||
<tr>
|
||||
<td>".$rowcount. "</td>
|
||||
<td>".$row["AT_ID"]. "</td>
|
||||
<td>".$kolkataTime. "</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>
|
||||
|
||||
function getAccountDetails() {
|
||||
let acno = document.getElementById("acno").value;
|
||||
|
||||
fetch("/exe/get-loan-details/", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
body: "AA_ACNO=" + encodeURIComponent(acno)
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
document.getElementById('PAY_LOAN_RECURRING_FORM').style.display = 'flex';
|
||||
console.log(data.data[0].AA_ACNO);
|
||||
document.getElementById('LOAN_AC_NUMBER').value = data.data[0].AA_ACNO;
|
||||
document.getElementById('DEDUCT_LOAN_AMOUNT').value = data.data[0].AA_INSTALLMENT;
|
||||
document.getElementById('ACCOUNT_HOLDER_NAME').value = data.data[0].AA_NAME;
|
||||
document.getElementById('INSTALLMENT_NUMBER').value = data.data[0].AA_BAL / data.data[0].AA_INSTALLMENT;
|
||||
|
||||
if(data.status === "Success"){
|
||||
// Example: show first record
|
||||
console.log("Account Holder: " + data.data[0].AA_NAME + "\nBalance: " + data.data[0].AA_BAL);
|
||||
} else {
|
||||
alert(data.statusmsg);
|
||||
}
|
||||
})
|
||||
.catch(err => console.error("Error:", err));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
function addACNumberToField(){
|
||||
document.getElementById('LOAN_ACC_NUMBER').value = document.getElementById('LOAN_AC_NUMBER').value;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!-- GVD20210607R519 -->
|
|
@ -0,0 +1,95 @@
|
|||
<?php
|
||||
if ($_SESSION['type'] === 'admin' && isset($_GET["no"]) && isset($_GET["type"]) && $_GET["type"] == "Recurring") {
|
||||
if (
|
||||
$_SERVER['REQUEST_METHOD'] === 'POST'
|
||||
&& isset($_POST['PAY_LOAN_EMI_FROM_RECURRING'], $_POST['PAY_LOAN_EMI_FROM_RECURRING_ID'], $_POST['DEDUCT_LOAN_AMOUNT'])
|
||||
&& $_POST['PAY_LOAN_EMI_FROM_RECURRING_ID'] === 'axakassaoxnnxsaoij34866'
|
||||
) {
|
||||
$loanEMIAmount = floatval($_POST['DEDUCT_LOAN_AMOUNT']);
|
||||
$deductAmount = -$loanEMIAmount; // negative for recurring deduction
|
||||
$paidToLoanAccountNumber = $_POST['LOAN_AC_NUMBER'];
|
||||
$accountId = $_GET['no'];
|
||||
|
||||
if (!$accountId) {
|
||||
echo "Account number missing";
|
||||
exit;
|
||||
}
|
||||
|
||||
// ✅ DB connection
|
||||
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
|
||||
if ($conn->connect_error) {
|
||||
die("Connection failed: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
// ✅ Check recurring balance first
|
||||
$sql = "SELECT AA_BAL FROM `" . $GLOBALS['arif_ac'] . "` WHERE `AA_ACNO` = ?";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bind_param("s", $accountId);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($CURRENT_RECURRING_BALANCE);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
if ($loanEMIAmount > $CURRENT_RECURRING_BALANCE) {
|
||||
echo "<div class='container' style=' background-color: #f8d7da; color: #721c24; padding: 12px 20px; border: 1px solid #f5c6cb; border-radius: 5px; font-family: Arial, sans-serif; font-size: 15px; margin: 10px auto; position: relative;'>
|
||||
<strong>Error!</strong> Insufficient balance in Recurring account.
|
||||
<span style=\" position: absolute; top: 8px; right: 12px; color: #721c24; font-weight: bold; cursor: pointer; \" onclick=\"this.parentElement.style.display='none';\">×</span>
|
||||
</div>";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
// ✅ Begin transaction for atomicity
|
||||
$conn->begin_transaction();
|
||||
|
||||
try {
|
||||
$table = $GLOBALS['arif_tran'] ?? 'arif_tran';
|
||||
$userType = 'admin';
|
||||
|
||||
// Entry 1: Deduction from recurring
|
||||
$remarksText1 = "₹$loanEMIAmount deducted from Recurring for Loan A/c $paidToLoanAccountNumber EMI";
|
||||
$stmt = $conn->prepare("INSERT INTO `$table` (AT_ADMIN, AT_ACID, AT_AMOUNT, REMARKS) VALUES (?, ?, ?, ?)");
|
||||
$stmt->bind_param("ssds", $userType, $accountId, $deductAmount, $remarksText1);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
// Entry 2: Credit to loan account
|
||||
$remarksText2 = "₹$loanEMIAmount credited to Loan A/c $paidToLoanAccountNumber EMI (from Recurring $accountId)";
|
||||
$stmt = $conn->prepare("INSERT INTO `$table` (AT_ADMIN, AT_ACID, AT_AMOUNT, REMARKS) VALUES (?, ?, ?, ?)");
|
||||
$stmt->bind_param("ssds", $userType, $paidToLoanAccountNumber, $loanEMIAmount, $remarksText2);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
// Update Loan Account
|
||||
$ins_no = 1;
|
||||
$sql = "UPDATE `" . $GLOBALS['arif_ac'] . "` SET `AA_BAL` = `AA_BAL` + ?, `AA_NO_OF_PAYPAID` = `AA_NO_OF_PAYPAID` + ? WHERE `AA_ACNO` = ?";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bind_param("dis", $loanEMIAmount, $ins_no, $paidToLoanAccountNumber);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
// Update Recurring Account
|
||||
$sql = "UPDATE `" . $GLOBALS['arif_ac'] . "` SET `AA_BAL` = `AA_BAL` - ? WHERE `AA_ACNO` = ?";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bind_param("ds", $loanEMIAmount, $accountId);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
// ✅ Commit if everything ok
|
||||
$conn->commit();
|
||||
|
||||
echo "<div class='container' style=' background-color: #d4edda; color: #155724; padding: 12px 20px; border: 1px solid #c3e6cb; border-radius: 5px; font-family: Arial, sans-serif; font-size: 15px; margin: 10px auto; position: relative;'>
|
||||
<strong>Success!</strong> Loan EMI paid successfully!
|
||||
<span style=\" position: absolute; top: 8px; right: 12px; color: #155724; font-weight: bold; cursor: pointer; \" onclick=\"this.parentElement.style.display='none';\">×</span>
|
||||
</div>";
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
echo "Error processing EMI payment: " . $e->getMessage();
|
||||
}
|
||||
|
||||
$conn->close();
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,502 @@
|
|||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
|
||||
/* columns_definitions/partitions.twig */
|
||||
class __TwigTemplate_87c8d6a9bb025f5a957415bc8c9b04bd extends Template
|
||||
{
|
||||
private $source;
|
||||
private $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = [])
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
$context["partition_options"] = [0 => "", 1 => "HASH", 2 => "LINEAR HASH", 3 => "KEY", 4 => "LINEAR KEY", 5 => "RANGE", 6 => "RANGE COLUMNS", 7 => "LIST", 8 => "LIST COLUMNS"];
|
||||
// line 12
|
||||
$context["sub_partition_options"] = [0 => "", 1 => "HASH", 2 => "LINEAR HASH", 3 => "KEY", 4 => "LINEAR KEY"];
|
||||
// line 13
|
||||
$context["value_type_options"] = [0 => "", 1 => "LESS THAN", 2 => "LESS THAN MAXVALUE", 3 => "IN"];
|
||||
// line 14
|
||||
echo "
|
||||
<table class=\"table table-borderless w-auto align-middle mb-0\" id=\"partition_table\">
|
||||
<tr class=\"align-middle\">
|
||||
<td><label for=\"partition_by\">";
|
||||
echo _gettext("Partition by:");
|
||||
// line 17
|
||||
echo "</label></td>
|
||||
<td>
|
||||
<select name=\"partition_by\" id=\"partition_by\">
|
||||
";
|
||||
// line 20
|
||||
$context['_parent'] = $context;
|
||||
$context['_seq'] = twig_ensure_traversable(($context["partition_options"] ?? null));
|
||||
foreach ($context['_seq'] as $context["_key"] => $context["option"]) {
|
||||
// line 21
|
||||
echo " <option value=\"";
|
||||
echo twig_escape_filter($this->env, $context["option"], "html", null, true);
|
||||
echo "\"";
|
||||
// line 22
|
||||
if (((($__internal_compile_0 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_0) || $__internal_compile_0 instanceof ArrayAccess ? ($__internal_compile_0["partition_by"] ?? null) : null) == $context["option"])) {
|
||||
// line 23
|
||||
echo " selected=\"selected\"";
|
||||
}
|
||||
// line 24
|
||||
echo ">
|
||||
";
|
||||
// line 25
|
||||
echo twig_escape_filter($this->env, $context["option"], "html", null, true);
|
||||
echo "
|
||||
</option>
|
||||
";
|
||||
}
|
||||
$_parent = $context['_parent'];
|
||||
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['option'], $context['_parent'], $context['loop']);
|
||||
$context = array_intersect_key($context, $_parent) + $_parent;
|
||||
// line 28
|
||||
echo " </select>
|
||||
</td>
|
||||
<td>
|
||||
(<input name=\"partition_expr\" type=\"text\"
|
||||
placeholder=\"";
|
||||
echo _gettext("Expression or column list");
|
||||
// line 32
|
||||
echo "\"
|
||||
value=\"";
|
||||
// line 33
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_1 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_1) || $__internal_compile_1 instanceof ArrayAccess ? ($__internal_compile_1["partition_expr"] ?? null) : null), "html", null, true);
|
||||
echo "\">)
|
||||
</td>
|
||||
</tr>
|
||||
<tr class=\"align-middle\">
|
||||
<td><label for=\"partition_count\">";
|
||||
echo _gettext("Partitions:");
|
||||
// line 37
|
||||
echo "</label></td>
|
||||
<td colspan=\"2\">
|
||||
<input name=\"partition_count\" type=\"number\" min=\"2\"
|
||||
value=\"";
|
||||
// line 40
|
||||
(((($__internal_compile_2 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_2) || $__internal_compile_2 instanceof ArrayAccess ? ($__internal_compile_2["partition_count"] ?? null) : null)) ? (print (twig_escape_filter($this->env, (($__internal_compile_3 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_3) || $__internal_compile_3 instanceof ArrayAccess ? ($__internal_compile_3["partition_count"] ?? null) : null), "html", null, true))) : (print ("")));
|
||||
echo "\">
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
// line 43
|
||||
if ((($__internal_compile_4 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_4) || $__internal_compile_4 instanceof ArrayAccess ? ($__internal_compile_4["can_have_subpartitions"] ?? null) : null)) {
|
||||
// line 44
|
||||
echo " <tr class=\"align-middle\">
|
||||
<td><label for=\"subpartition_by\">";
|
||||
echo _gettext("Subpartition by:");
|
||||
// line 45
|
||||
echo "</label></td>
|
||||
<td>
|
||||
<select name=\"subpartition_by\" id=\"subpartition_by\">
|
||||
";
|
||||
// line 48
|
||||
$context['_parent'] = $context;
|
||||
$context['_seq'] = twig_ensure_traversable(($context["sub_partition_options"] ?? null));
|
||||
foreach ($context['_seq'] as $context["_key"] => $context["option"]) {
|
||||
// line 49
|
||||
echo " <option value=\"";
|
||||
echo twig_escape_filter($this->env, $context["option"], "html", null, true);
|
||||
echo "\"";
|
||||
// line 50
|
||||
if (((($__internal_compile_5 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_5) || $__internal_compile_5 instanceof ArrayAccess ? ($__internal_compile_5["subpartition_by"] ?? null) : null) == $context["option"])) {
|
||||
// line 51
|
||||
echo " selected=\"selected\"";
|
||||
}
|
||||
// line 52
|
||||
echo ">
|
||||
";
|
||||
// line 53
|
||||
echo twig_escape_filter($this->env, $context["option"], "html", null, true);
|
||||
echo "
|
||||
</option>
|
||||
";
|
||||
}
|
||||
$_parent = $context['_parent'];
|
||||
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['option'], $context['_parent'], $context['loop']);
|
||||
$context = array_intersect_key($context, $_parent) + $_parent;
|
||||
// line 56
|
||||
echo " </select>
|
||||
</td>
|
||||
<td>
|
||||
(<input name=\"subpartition_expr\" type=\"text\"
|
||||
placeholder=\"";
|
||||
echo _gettext("Expression or column list");
|
||||
// line 60
|
||||
echo "\"
|
||||
value=\"";
|
||||
// line 61
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_6 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_6) || $__internal_compile_6 instanceof ArrayAccess ? ($__internal_compile_6["subpartition_expr"] ?? null) : null), "html", null, true);
|
||||
echo "\">)
|
||||
</td>
|
||||
</tr>
|
||||
<tr class=\"align-middle\">
|
||||
<td><label for=\"subpartition_count\">";
|
||||
echo _gettext("Subpartitions:");
|
||||
// line 65
|
||||
echo "</label></td>
|
||||
<td colspan=\"2\">
|
||||
<input name=\"subpartition_count\" type=\"number\" min=\"2\"
|
||||
value=\"";
|
||||
// line 68
|
||||
(((($__internal_compile_7 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_7) || $__internal_compile_7 instanceof ArrayAccess ? ($__internal_compile_7["subpartition_count"] ?? null) : null)) ? (print (twig_escape_filter($this->env, (($__internal_compile_8 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_8) || $__internal_compile_8 instanceof ArrayAccess ? ($__internal_compile_8["subpartition_count"] ?? null) : null), "html", null, true))) : (print ("")));
|
||||
echo "\">
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
// line 72
|
||||
echo "</table>
|
||||
";
|
||||
// line 73
|
||||
if (((($__internal_compile_9 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_9) || $__internal_compile_9 instanceof ArrayAccess ? ($__internal_compile_9["partition_count"] ?? null) : null) > 1)) {
|
||||
// line 74
|
||||
echo " <table class=\"table align-middle\" id=\"partition_definition_table\">
|
||||
<thead><tr>
|
||||
<th>";
|
||||
echo _gettext("Partition");
|
||||
// line 76
|
||||
echo "</th>
|
||||
";
|
||||
// line 77
|
||||
if ((($__internal_compile_10 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_10) || $__internal_compile_10 instanceof ArrayAccess ? ($__internal_compile_10["value_enabled"] ?? null) : null)) {
|
||||
// line 78
|
||||
echo " <th>";
|
||||
echo _gettext("Values");
|
||||
echo "</th>
|
||||
";
|
||||
}
|
||||
// line 80
|
||||
echo " ";
|
||||
if (((($__internal_compile_11 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_11) || $__internal_compile_11 instanceof ArrayAccess ? ($__internal_compile_11["can_have_subpartitions"] ?? null) : null) && ((($__internal_compile_12 = // line 81
|
||||
($context["partition_details"] ?? null)) && is_array($__internal_compile_12) || $__internal_compile_12 instanceof ArrayAccess ? ($__internal_compile_12["subpartition_count"] ?? null) : null) > 1))) {
|
||||
// line 82
|
||||
echo " <th>";
|
||||
echo _gettext("Subpartition");
|
||||
echo "</th>
|
||||
";
|
||||
}
|
||||
// line 84
|
||||
echo " <th>";
|
||||
echo _gettext("Engine");
|
||||
echo "</th>
|
||||
<th>";
|
||||
echo _gettext("Comment");
|
||||
// line 85
|
||||
echo "</th>
|
||||
<th>";
|
||||
echo _gettext("Data directory");
|
||||
// line 86
|
||||
echo "</th>
|
||||
<th>";
|
||||
echo _gettext("Index directory");
|
||||
// line 87
|
||||
echo "</th>
|
||||
<th>";
|
||||
echo _gettext("Max rows");
|
||||
// line 88
|
||||
echo "</th>
|
||||
<th>";
|
||||
echo _gettext("Min rows");
|
||||
// line 89
|
||||
echo "</th>
|
||||
<th>";
|
||||
echo _gettext("Table space");
|
||||
// line 90
|
||||
echo "</th>
|
||||
<th>";
|
||||
echo _gettext("Node group");
|
||||
// line 91
|
||||
echo "</th>
|
||||
</tr></thead>
|
||||
";
|
||||
// line 93
|
||||
$context['_parent'] = $context;
|
||||
$context['_seq'] = twig_ensure_traversable((($__internal_compile_13 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_13) || $__internal_compile_13 instanceof ArrayAccess ? ($__internal_compile_13["partitions"] ?? null) : null));
|
||||
foreach ($context['_seq'] as $context["_key"] => $context["partition"]) {
|
||||
// line 94
|
||||
echo " ";
|
||||
$context["rowspan"] = (( !twig_test_empty((($__internal_compile_14 = $context["partition"]) && is_array($__internal_compile_14) || $__internal_compile_14 instanceof ArrayAccess ? ($__internal_compile_14["subpartition_count"] ?? null) : null))) ? (((($__internal_compile_15 = // line 95
|
||||
$context["partition"]) && is_array($__internal_compile_15) || $__internal_compile_15 instanceof ArrayAccess ? ($__internal_compile_15["subpartition_count"] ?? null) : null) + 1)) : (2));
|
||||
// line 96
|
||||
echo " <tr>
|
||||
<td rowspan=\"";
|
||||
// line 97
|
||||
echo twig_escape_filter($this->env, ($context["rowspan"] ?? null), "html", null, true);
|
||||
echo "\">
|
||||
<input type=\"text\" name=\"";
|
||||
// line 98
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_16 = $context["partition"]) && is_array($__internal_compile_16) || $__internal_compile_16 instanceof ArrayAccess ? ($__internal_compile_16["prefix"] ?? null) : null), "html", null, true);
|
||||
echo "[name]\"
|
||||
value=\"";
|
||||
// line 99
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_17 = $context["partition"]) && is_array($__internal_compile_17) || $__internal_compile_17 instanceof ArrayAccess ? ($__internal_compile_17["name"] ?? null) : null), "html", null, true);
|
||||
echo "\">
|
||||
</td>
|
||||
";
|
||||
// line 101
|
||||
if ((($__internal_compile_18 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_18) || $__internal_compile_18 instanceof ArrayAccess ? ($__internal_compile_18["value_enabled"] ?? null) : null)) {
|
||||
// line 102
|
||||
echo " <td rowspan=\"";
|
||||
echo twig_escape_filter($this->env, ($context["rowspan"] ?? null), "html", null, true);
|
||||
echo "\" class=\"align-middle\">
|
||||
<select class=\"partition_value\"
|
||||
name=\"";
|
||||
// line 104
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_19 = $context["partition"]) && is_array($__internal_compile_19) || $__internal_compile_19 instanceof ArrayAccess ? ($__internal_compile_19["prefix"] ?? null) : null), "html", null, true);
|
||||
echo "[value_type]\">
|
||||
";
|
||||
// line 105
|
||||
$context['_parent'] = $context;
|
||||
$context['_seq'] = twig_ensure_traversable(($context["value_type_options"] ?? null));
|
||||
foreach ($context['_seq'] as $context["_key"] => $context["option"]) {
|
||||
// line 106
|
||||
echo " <option value=\"";
|
||||
echo twig_escape_filter($this->env, $context["option"], "html", null, true);
|
||||
echo "\"";
|
||||
// line 107
|
||||
if (((($__internal_compile_20 = $context["partition"]) && is_array($__internal_compile_20) || $__internal_compile_20 instanceof ArrayAccess ? ($__internal_compile_20["value_type"] ?? null) : null) == $context["option"])) {
|
||||
// line 108
|
||||
echo " selected=\"selected\"";
|
||||
}
|
||||
// line 109
|
||||
echo ">
|
||||
";
|
||||
// line 110
|
||||
echo twig_escape_filter($this->env, $context["option"], "html", null, true);
|
||||
echo "
|
||||
</option>
|
||||
";
|
||||
}
|
||||
$_parent = $context['_parent'];
|
||||
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['option'], $context['_parent'], $context['loop']);
|
||||
$context = array_intersect_key($context, $_parent) + $_parent;
|
||||
// line 113
|
||||
echo " </select>
|
||||
<input type=\"text\" class=\"partition_value\"
|
||||
name=\"";
|
||||
// line 115
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_21 = $context["partition"]) && is_array($__internal_compile_21) || $__internal_compile_21 instanceof ArrayAccess ? ($__internal_compile_21["prefix"] ?? null) : null), "html", null, true);
|
||||
echo "[value]\"
|
||||
value=\"";
|
||||
// line 116
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_22 = $context["partition"]) && is_array($__internal_compile_22) || $__internal_compile_22 instanceof ArrayAccess ? ($__internal_compile_22["value"] ?? null) : null), "html", null, true);
|
||||
echo "\">
|
||||
</td>
|
||||
";
|
||||
}
|
||||
// line 119
|
||||
echo " </tr>
|
||||
|
||||
";
|
||||
// line 121
|
||||
if (twig_get_attribute($this->env, $this->source, $context["partition"], "subpartitions", [], "array", true, true, false, 121)) {
|
||||
// line 122
|
||||
echo " ";
|
||||
$context["subpartitions"] = (($__internal_compile_23 = $context["partition"]) && is_array($__internal_compile_23) || $__internal_compile_23 instanceof ArrayAccess ? ($__internal_compile_23["subpartitions"] ?? null) : null);
|
||||
// line 123
|
||||
echo " ";
|
||||
} else {
|
||||
// line 124
|
||||
echo " ";
|
||||
$context["subpartitions"] = [0 => $context["partition"]];
|
||||
// line 125
|
||||
echo " ";
|
||||
}
|
||||
// line 126
|
||||
echo "
|
||||
";
|
||||
// line 127
|
||||
$context['_parent'] = $context;
|
||||
$context['_seq'] = twig_ensure_traversable(($context["subpartitions"] ?? null));
|
||||
foreach ($context['_seq'] as $context["_key"] => $context["subpartition"]) {
|
||||
// line 128
|
||||
echo " <tr>
|
||||
";
|
||||
// line 129
|
||||
if (((($__internal_compile_24 = ($context["partition_details"] ?? null)) && is_array($__internal_compile_24) || $__internal_compile_24 instanceof ArrayAccess ? ($__internal_compile_24["can_have_subpartitions"] ?? null) : null) && ((($__internal_compile_25 = // line 130
|
||||
($context["partition_details"] ?? null)) && is_array($__internal_compile_25) || $__internal_compile_25 instanceof ArrayAccess ? ($__internal_compile_25["subpartition_count"] ?? null) : null) > 1))) {
|
||||
// line 131
|
||||
echo " <td>
|
||||
<input type=\"text\" name=\"";
|
||||
// line 132
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_26 = $context["subpartition"]) && is_array($__internal_compile_26) || $__internal_compile_26 instanceof ArrayAccess ? ($__internal_compile_26["prefix"] ?? null) : null), "html", null, true);
|
||||
echo "[name]\"
|
||||
value=\"";
|
||||
// line 133
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_27 = $context["subpartition"]) && is_array($__internal_compile_27) || $__internal_compile_27 instanceof ArrayAccess ? ($__internal_compile_27["name"] ?? null) : null), "html", null, true);
|
||||
echo "\">
|
||||
</td>
|
||||
";
|
||||
}
|
||||
// line 136
|
||||
echo " <td>
|
||||
<select name=\"";
|
||||
// line 137
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_28 = $context["subpartition"]) && is_array($__internal_compile_28) || $__internal_compile_28 instanceof ArrayAccess ? ($__internal_compile_28["prefix"] ?? null) : null), "html", null, true);
|
||||
echo "[engine]\" aria-label=\"";
|
||||
echo _gettext("Storage engine");
|
||||
echo "\">
|
||||
<option value=\"\"></option>
|
||||
";
|
||||
// line 139
|
||||
$context['_parent'] = $context;
|
||||
$context['_seq'] = twig_ensure_traversable(($context["storage_engines"] ?? null));
|
||||
foreach ($context['_seq'] as $context["_key"] => $context["engine"]) {
|
||||
// line 140
|
||||
echo " <option value=\"";
|
||||
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["engine"], "name", [], "any", false, false, false, 140), "html", null, true);
|
||||
echo "\"";
|
||||
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["engine"], "comment", [], "any", false, false, false, 140))) {
|
||||
echo " title=\"";
|
||||
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["engine"], "comment", [], "any", false, false, false, 140), "html", null, true);
|
||||
echo "\"";
|
||||
}
|
||||
// line 141
|
||||
echo (((twig_lower_filter($this->env, twig_get_attribute($this->env, $this->source, $context["engine"], "name", [], "any", false, false, false, 141)) == twig_lower_filter($this->env, (($__internal_compile_29 = $context["subpartition"]) && is_array($__internal_compile_29) || $__internal_compile_29 instanceof ArrayAccess ? ($__internal_compile_29["engine"] ?? null) : null)))) ? (" selected") : (""));
|
||||
echo ">";
|
||||
// line 142
|
||||
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["engine"], "name", [], "any", false, false, false, 142), "html", null, true);
|
||||
// line 143
|
||||
echo "</option>
|
||||
";
|
||||
}
|
||||
$_parent = $context['_parent'];
|
||||
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['engine'], $context['_parent'], $context['loop']);
|
||||
$context = array_intersect_key($context, $_parent) + $_parent;
|
||||
// line 145
|
||||
echo " </select>
|
||||
</td>
|
||||
<td>
|
||||
<textarea name=\"";
|
||||
// line 148
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_30 = $context["subpartition"]) && is_array($__internal_compile_30) || $__internal_compile_30 instanceof ArrayAccess ? ($__internal_compile_30["prefix"] ?? null) : null), "html", null, true);
|
||||
echo "[comment]\">";
|
||||
// line 149
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_31 = $context["subpartition"]) && is_array($__internal_compile_31) || $__internal_compile_31 instanceof ArrayAccess ? ($__internal_compile_31["comment"] ?? null) : null), "html", null, true);
|
||||
// line 150
|
||||
echo "</textarea>
|
||||
</td>
|
||||
<td>
|
||||
<input type=\"text\" name=\"";
|
||||
// line 153
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_32 = $context["subpartition"]) && is_array($__internal_compile_32) || $__internal_compile_32 instanceof ArrayAccess ? ($__internal_compile_32["prefix"] ?? null) : null), "html", null, true);
|
||||
echo "[data_directory]\"
|
||||
value=\"";
|
||||
// line 154
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_33 = $context["subpartition"]) && is_array($__internal_compile_33) || $__internal_compile_33 instanceof ArrayAccess ? ($__internal_compile_33["data_directory"] ?? null) : null), "html", null, true);
|
||||
echo "\">
|
||||
</td>
|
||||
<td>
|
||||
<input type=\"text\" name=\"";
|
||||
// line 157
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_34 = $context["subpartition"]) && is_array($__internal_compile_34) || $__internal_compile_34 instanceof ArrayAccess ? ($__internal_compile_34["prefix"] ?? null) : null), "html", null, true);
|
||||
echo "[index_directory]\"
|
||||
value=\"";
|
||||
// line 158
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_35 = $context["subpartition"]) && is_array($__internal_compile_35) || $__internal_compile_35 instanceof ArrayAccess ? ($__internal_compile_35["index_directory"] ?? null) : null), "html", null, true);
|
||||
echo "\">
|
||||
</td>
|
||||
<td>
|
||||
<input type=\"number\" name=\"";
|
||||
// line 161
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_36 = $context["subpartition"]) && is_array($__internal_compile_36) || $__internal_compile_36 instanceof ArrayAccess ? ($__internal_compile_36["prefix"] ?? null) : null), "html", null, true);
|
||||
echo "[max_rows]\"
|
||||
value=\"";
|
||||
// line 162
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_37 = $context["subpartition"]) && is_array($__internal_compile_37) || $__internal_compile_37 instanceof ArrayAccess ? ($__internal_compile_37["max_rows"] ?? null) : null), "html", null, true);
|
||||
echo "\">
|
||||
</td>
|
||||
<td>
|
||||
<input type=\"number\" min=\"0\" name=\"";
|
||||
// line 165
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_38 = $context["subpartition"]) && is_array($__internal_compile_38) || $__internal_compile_38 instanceof ArrayAccess ? ($__internal_compile_38["prefix"] ?? null) : null), "html", null, true);
|
||||
echo "[min_rows]\"
|
||||
value=\"";
|
||||
// line 166
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_39 = $context["subpartition"]) && is_array($__internal_compile_39) || $__internal_compile_39 instanceof ArrayAccess ? ($__internal_compile_39["min_rows"] ?? null) : null), "html", null, true);
|
||||
echo "\">
|
||||
</td>
|
||||
<td>
|
||||
<input type=\"text\" min=\"0\" name=\"";
|
||||
// line 169
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_40 = $context["subpartition"]) && is_array($__internal_compile_40) || $__internal_compile_40 instanceof ArrayAccess ? ($__internal_compile_40["prefix"] ?? null) : null), "html", null, true);
|
||||
echo "[tablespace]\"
|
||||
value=\"";
|
||||
// line 170
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_41 = $context["subpartition"]) && is_array($__internal_compile_41) || $__internal_compile_41 instanceof ArrayAccess ? ($__internal_compile_41["tablespace"] ?? null) : null), "html", null, true);
|
||||
echo "\">
|
||||
</td>
|
||||
<td>
|
||||
<input type=\"text\" name=\"";
|
||||
// line 173
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_42 = $context["subpartition"]) && is_array($__internal_compile_42) || $__internal_compile_42 instanceof ArrayAccess ? ($__internal_compile_42["prefix"] ?? null) : null), "html", null, true);
|
||||
echo "[node_group]\"
|
||||
value=\"";
|
||||
// line 174
|
||||
echo twig_escape_filter($this->env, (($__internal_compile_43 = $context["subpartition"]) && is_array($__internal_compile_43) || $__internal_compile_43 instanceof ArrayAccess ? ($__internal_compile_43["node_group"] ?? null) : null), "html", null, true);
|
||||
echo "\">
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
$_parent = $context['_parent'];
|
||||
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['subpartition'], $context['_parent'], $context['loop']);
|
||||
$context = array_intersect_key($context, $_parent) + $_parent;
|
||||
// line 178
|
||||
echo " ";
|
||||
}
|
||||
$_parent = $context['_parent'];
|
||||
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['partition'], $context['_parent'], $context['loop']);
|
||||
$context = array_intersect_key($context, $_parent) + $_parent;
|
||||
// line 179
|
||||
echo " </table>
|
||||
";
|
||||
}
|
||||
}
|
||||
|
||||
public function getTemplateName()
|
||||
{
|
||||
return "columns_definitions/partitions.twig";
|
||||
}
|
||||
|
||||
public function isTraitable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getDebugInfo()
|
||||
{
|
||||
return array ( 478 => 179, 472 => 178, 462 => 174, 458 => 173, 452 => 170, 448 => 169, 442 => 166, 438 => 165, 432 => 162, 428 => 161, 422 => 158, 418 => 157, 412 => 154, 408 => 153, 403 => 150, 401 => 149, 398 => 148, 393 => 145, 386 => 143, 384 => 142, 381 => 141, 372 => 140, 368 => 139, 361 => 137, 358 => 136, 352 => 133, 348 => 132, 345 => 131, 343 => 130, 342 => 129, 339 => 128, 335 => 127, 332 => 126, 329 => 125, 326 => 124, 323 => 123, 320 => 122, 318 => 121, 314 => 119, 308 => 116, 304 => 115, 300 => 113, 291 => 110, 288 => 109, 285 => 108, 283 => 107, 279 => 106, 275 => 105, 271 => 104, 265 => 102, 263 => 101, 258 => 99, 254 => 98, 250 => 97, 247 => 96, 245 => 95, 243 => 94, 239 => 93, 235 => 91, 231 => 90, 227 => 89, 223 => 88, 219 => 87, 215 => 86, 211 => 85, 205 => 84, 199 => 82, 197 => 81, 195 => 80, 189 => 78, 187 => 77, 184 => 76, 179 => 74, 177 => 73, 174 => 72, 167 => 68, 162 => 65, 154 => 61, 151 => 60, 144 => 56, 135 => 53, 132 => 52, 129 => 51, 127 => 50, 123 => 49, 119 => 48, 114 => 45, 110 => 44, 108 => 43, 102 => 40, 97 => 37, 89 => 33, 86 => 32, 79 => 28, 70 => 25, 67 => 24, 64 => 23, 62 => 22, 58 => 21, 54 => 20, 49 => 17, 43 => 14, 41 => 13, 39 => 12, 37 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext()
|
||||
{
|
||||
return new Source("", "columns_definitions/partitions.twig", "/home/suvo/web/graffin.ns77.siliconpin.com/public_html/pma/templates/columns_definitions/partitions.twig");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
|
||||
/* sql/enum_column_dropdown.twig */
|
||||
class __TwigTemplate_fe9ccad84ec94f5ed3dbc0e98a30bd23 extends Template
|
||||
{
|
||||
private $source;
|
||||
private $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = [])
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
echo "<select>
|
||||
<option value=\"\"> </option>
|
||||
";
|
||||
// line 3
|
||||
$context['_parent'] = $context;
|
||||
$context['_seq'] = twig_ensure_traversable(($context["values"] ?? null));
|
||||
foreach ($context['_seq'] as $context["_key"] => $context["value"]) {
|
||||
// line 4
|
||||
echo " <option value=\"";
|
||||
echo $context["value"];
|
||||
echo "\"";
|
||||
echo ((twig_in_filter($context["value"], ($context["selected_values"] ?? null))) ? (" selected") : (""));
|
||||
echo ">";
|
||||
echo $context["value"];
|
||||
echo "</option>
|
||||
";
|
||||
}
|
||||
$_parent = $context['_parent'];
|
||||
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['value'], $context['_parent'], $context['loop']);
|
||||
$context = array_intersect_key($context, $_parent) + $_parent;
|
||||
// line 6
|
||||
echo "</select>
|
||||
";
|
||||
}
|
||||
|
||||
public function getTemplateName()
|
||||
{
|
||||
return "sql/enum_column_dropdown.twig";
|
||||
}
|
||||
|
||||
public function isTraitable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getDebugInfo()
|
||||
{
|
||||
return array ( 58 => 6, 45 => 4, 41 => 3, 37 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext()
|
||||
{
|
||||
return new Source("", "sql/enum_column_dropdown.twig", "/home/suvo/web/graffin.ns77.siliconpin.com/public_html/pma/templates/sql/enum_column_dropdown.twig");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,517 @@
|
|||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
|
||||
/* table/index_form.twig */
|
||||
class __TwigTemplate_0a7062f57794a5824975cb8d2f846971 extends Template
|
||||
{
|
||||
private $source;
|
||||
private $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = [])
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
echo "<form action=\"";
|
||||
echo PhpMyAdmin\Url::getFromRoute("/table/indexes");
|
||||
echo "\"
|
||||
method=\"post\"
|
||||
name=\"index_frm\"
|
||||
id=\"index_frm\"
|
||||
class=\"ajax\">
|
||||
|
||||
";
|
||||
// line 7
|
||||
echo PhpMyAdmin\Url::getHiddenInputs(($context["form_params"] ?? null));
|
||||
echo "
|
||||
";
|
||||
// line 8
|
||||
if (($context["is_from_nav"] ?? null)) {
|
||||
// line 9
|
||||
echo " <input type=\"hidden\" name=\"do_save_data\" value=\"1\">
|
||||
";
|
||||
}
|
||||
// line 11
|
||||
echo "
|
||||
<fieldset class=\"pma-fieldset\" id=\"index_edit_fields\">
|
||||
<div class=\"index_info\">
|
||||
<div>
|
||||
<div class=\"label\">
|
||||
<strong>
|
||||
<label for=\"input_index_name\">
|
||||
";
|
||||
echo _gettext("Index name:");
|
||||
// line 19
|
||||
echo " ";
|
||||
echo PhpMyAdmin\Html\Generator::showHint(_gettext("\"PRIMARY\" <b>must</b> be the name of and <b>only of</b> a primary key!"));
|
||||
echo "
|
||||
</label>
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
<input type=\"text\"
|
||||
name=\"index[Key_name]\"
|
||||
id=\"input_index_name\"
|
||||
size=\"25\"
|
||||
maxlength=\"64\"
|
||||
value=\"";
|
||||
// line 29
|
||||
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, ($context["index"] ?? null), "getName", [], "method", false, false, false, 29), "html", null, true);
|
||||
echo "\"
|
||||
onfocus=\"this.select()\">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class=\"label\">
|
||||
<strong>
|
||||
<label for=\"select_index_choice\">
|
||||
";
|
||||
echo _gettext("Index choice:");
|
||||
// line 38
|
||||
echo " ";
|
||||
echo PhpMyAdmin\Html\MySQLDocumentation::show("ALTER_TABLE");
|
||||
echo "
|
||||
</label>
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
<select name=\"index[Index_choice]\" id=\"select_index_choice\"";
|
||||
// line 43
|
||||
echo ((($context["create_edit_table"] ?? null)) ? (" disabled") : (""));
|
||||
echo ">
|
||||
";
|
||||
// line 44
|
||||
if (((twig_get_attribute($this->env, $this->source, ($context["index"] ?? null), "getChoice", [], "method", false, false, false, 44) == "PRIMARY") || !twig_get_attribute($this->env, $this->source, ($context["index"] ?? null), "hasPrimary", [], "method", false, false, false, 44))) {
|
||||
// line 45
|
||||
echo " <option value=\"PRIMARY\"";
|
||||
echo (((twig_get_attribute($this->env, $this->source, ($context["index"] ?? null), "getChoice", [], "method", false, false, false, 45) == "PRIMARY")) ? (" selected") : (""));
|
||||
echo ">PRIMARY</option>
|
||||
";
|
||||
}
|
||||
// line 47
|
||||
echo " <option value=\"INDEX\"";
|
||||
echo (((twig_get_attribute($this->env, $this->source, ($context["index"] ?? null), "getChoice", [], "method", false, false, false, 47) == "INDEX")) ? (" selected") : (""));
|
||||
echo ">INDEX</option>
|
||||
<option value=\"UNIQUE\"";
|
||||
// line 48
|
||||
echo (((twig_get_attribute($this->env, $this->source, ($context["index"] ?? null), "getChoice", [], "method", false, false, false, 48) == "UNIQUE")) ? (" selected") : (""));
|
||||
echo ">UNIQUE</option>
|
||||
<option value=\"SPATIAL\"";
|
||||
// line 49
|
||||
echo (((twig_get_attribute($this->env, $this->source, ($context["index"] ?? null), "getChoice", [], "method", false, false, false, 49) == "SPATIAL")) ? (" selected") : (""));
|
||||
echo ">SPATIAL</option>
|
||||
<option value=\"FULLTEXT\"";
|
||||
// line 50
|
||||
echo (((twig_get_attribute($this->env, $this->source, ($context["index"] ?? null), "getChoice", [], "method", false, false, false, 50) == "FULLTEXT")) ? (" selected") : (""));
|
||||
echo ">FULLTEXT</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
";
|
||||
// line 54
|
||||
if ((($context["default_sliders_state"] ?? null) != "disabled")) {
|
||||
// line 55
|
||||
echo " <div class=\"mb-3\">
|
||||
<button class=\"btn btn-sm btn-secondary\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#advancedOptions\" aria-expanded=\"";
|
||||
// line 56
|
||||
echo (((($context["default_sliders_state"] ?? null) == "open")) ? ("true") : ("false"));
|
||||
echo "\" aria-controls=\"advancedOptions\">
|
||||
";
|
||||
echo _gettext("Advanced options");
|
||||
// line 58
|
||||
echo " </button>
|
||||
</div>
|
||||
<div class=\"collapse mb-3";
|
||||
// line 60
|
||||
echo (((($context["default_sliders_state"] ?? null) == "open")) ? (" show") : (""));
|
||||
echo "\" id=\"advancedOptions\">
|
||||
";
|
||||
}
|
||||
// line 62
|
||||
echo "
|
||||
<div>
|
||||
<div class=\"label\">
|
||||
<strong>
|
||||
<label for=\"input_key_block_size\">
|
||||
";
|
||||
echo _gettext("Key block size:");
|
||||
// line 68
|
||||
echo " </label>
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
<input type=\"text\"
|
||||
name=\"index[Key_block_size]\"
|
||||
id=\"input_key_block_size\"
|
||||
size=\"30\"
|
||||
value=\"";
|
||||
// line 76
|
||||
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, ($context["index"] ?? null), "getKeyBlockSize", [], "method", false, false, false, 76), "html", null, true);
|
||||
echo "\">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
<div class=\"label\">
|
||||
<strong>
|
||||
<label for=\"select_index_type\">
|
||||
";
|
||||
echo _gettext("Index type:");
|
||||
// line 85
|
||||
echo " ";
|
||||
echo PhpMyAdmin\Html\MySQLDocumentation::show("ALTER_TABLE");
|
||||
echo "
|
||||
</label>
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
<select name=\"index[Index_type]\" id=\"select_index_type\">
|
||||
";
|
||||
// line 91
|
||||
$context['_parent'] = $context;
|
||||
$context['_seq'] = twig_ensure_traversable([0 => "", 1 => "BTREE", 2 => "HASH"]);
|
||||
foreach ($context['_seq'] as $context["_key"] => $context["index_type"]) {
|
||||
// line 92
|
||||
echo " <option value=\"";
|
||||
echo twig_escape_filter($this->env, $context["index_type"], "html", null, true);
|
||||
echo "\"";
|
||||
echo (((twig_get_attribute($this->env, $this->source, ($context["index"] ?? null), "getType", [], "method", false, false, false, 92) == $context["index_type"])) ? (" selected") : (""));
|
||||
echo ">";
|
||||
echo twig_escape_filter($this->env, $context["index_type"], "html", null, true);
|
||||
echo "</option>
|
||||
";
|
||||
}
|
||||
$_parent = $context['_parent'];
|
||||
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['index_type'], $context['_parent'], $context['loop']);
|
||||
$context = array_intersect_key($context, $_parent) + $_parent;
|
||||
// line 94
|
||||
echo " </select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class=\"label\">
|
||||
<strong>
|
||||
<label for=\"input_parser\">
|
||||
";
|
||||
echo _gettext("Parser:");
|
||||
// line 102
|
||||
echo " </label>
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
<input type=\"text\"
|
||||
name=\"index[Parser]\"
|
||||
id=\"input_parse\"
|
||||
size=\"30\"
|
||||
value=\"";
|
||||
// line 110
|
||||
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, ($context["index"] ?? null), "getParser", [], "method", false, false, false, 110), "html", null, true);
|
||||
echo "\">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class=\"label\">
|
||||
<strong>
|
||||
<label for=\"input_index_comment\">
|
||||
";
|
||||
echo _gettext("Comment:");
|
||||
// line 118
|
||||
echo " </label>
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
<input type=\"text\"
|
||||
name=\"index[Index_comment]\"
|
||||
id=\"input_index_comment\"
|
||||
size=\"30\"
|
||||
maxlength=\"1024\"
|
||||
value=\"";
|
||||
// line 127
|
||||
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, ($context["index"] ?? null), "getComment", [], "method", false, false, false, 127), "html", null, true);
|
||||
echo "\">
|
||||
</div>
|
||||
|
||||
";
|
||||
// line 130
|
||||
if ((($context["default_sliders_state"] ?? null) != "disabled")) {
|
||||
// line 131
|
||||
echo " </div>
|
||||
";
|
||||
}
|
||||
// line 133
|
||||
echo "
|
||||
<div class=\"clearfloat\"></div>
|
||||
|
||||
<table class=\"table align-middle\" id=\"index_columns\">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>
|
||||
";
|
||||
echo _gettext("Column");
|
||||
// line 142
|
||||
echo " </th>
|
||||
<th>
|
||||
";
|
||||
echo _gettext("Size");
|
||||
// line 145
|
||||
echo " </th>
|
||||
</tr>
|
||||
</thead>
|
||||
";
|
||||
// line 148
|
||||
$context["spatial_types"] = [0 => "geometry", 1 => "point", 2 => "linestring", 3 => "polygon", 4 => "multipoint", 5 => "multilinestring", 6 => "multipolygon", 7 => "geomtrycollection"];
|
||||
// line 158
|
||||
echo " <tbody>
|
||||
";
|
||||
// line 159
|
||||
$context['_parent'] = $context;
|
||||
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, ($context["index"] ?? null), "getColumns", [], "method", false, false, false, 159));
|
||||
foreach ($context['_seq'] as $context["_key"] => $context["column"]) {
|
||||
// line 160
|
||||
echo " <tr class=\"noclick\">
|
||||
<td>
|
||||
<span class=\"drag_icon\" title=\"";
|
||||
echo _gettext("Drag to reorder");
|
||||
// line 162
|
||||
echo "\"></span>
|
||||
</td>
|
||||
<td>
|
||||
<select name=\"index[columns][names][]\">
|
||||
<option value=\"\">
|
||||
-- ";
|
||||
echo _gettext("Ignore");
|
||||
// line 167
|
||||
echo " --
|
||||
</option>
|
||||
";
|
||||
// line 169
|
||||
$context['_parent'] = $context;
|
||||
$context['_seq'] = twig_ensure_traversable(($context["fields"] ?? null));
|
||||
foreach ($context['_seq'] as $context["field_name"] => $context["field_type"]) {
|
||||
// line 170
|
||||
echo " ";
|
||||
if ((((twig_get_attribute($this->env, $this->source, ($context["index"] ?? null), "getChoice", [], "method", false, false, false, 170) != "FULLTEXT") || twig_matches("/(char|text)/i", // line 171
|
||||
$context["field_type"])) && ((twig_get_attribute($this->env, $this->source, // line 172
|
||||
($context["index"] ?? null), "getChoice", [], "method", false, false, false, 172) != "SPATIAL") || twig_in_filter( // line 173
|
||||
$context["field_type"], ($context["spatial_types"] ?? null))))) {
|
||||
// line 174
|
||||
echo "
|
||||
<option value=\"";
|
||||
// line 175
|
||||
echo twig_escape_filter($this->env, $context["field_name"], "html", null, true);
|
||||
echo "\"";
|
||||
// line 176
|
||||
if (($context["field_name"] == twig_get_attribute($this->env, $this->source, $context["column"], "getName", [], "method", false, false, false, 176))) {
|
||||
// line 177
|
||||
echo " selected=\"selected\"";
|
||||
}
|
||||
// line 178
|
||||
echo ">
|
||||
";
|
||||
// line 179
|
||||
echo twig_escape_filter($this->env, $context["field_name"], "html", null, true);
|
||||
echo " [";
|
||||
echo twig_escape_filter($this->env, $context["field_type"], "html", null, true);
|
||||
echo "]
|
||||
</option>
|
||||
";
|
||||
}
|
||||
// line 182
|
||||
echo " ";
|
||||
}
|
||||
$_parent = $context['_parent'];
|
||||
unset($context['_seq'], $context['_iterated'], $context['field_name'], $context['field_type'], $context['_parent'], $context['loop']);
|
||||
$context = array_intersect_key($context, $_parent) + $_parent;
|
||||
// line 183
|
||||
echo " </select>
|
||||
</td>
|
||||
<td>
|
||||
<input type=\"text\"
|
||||
size=\"5\"
|
||||
onfocus=\"this.select()\"
|
||||
name=\"index[columns][sub_parts][]\"
|
||||
value=\"";
|
||||
// line 191
|
||||
(((twig_get_attribute($this->env, $this->source, // line 190
|
||||
($context["index"] ?? null), "getChoice", [], "method", false, false, false, 190) != "SPATIAL")) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, // line 191
|
||||
$context["column"], "getSubPart", [], "method", false, false, false, 191), "html", null, true))) : (print ("")));
|
||||
echo "\">
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
$_parent = $context['_parent'];
|
||||
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['column'], $context['_parent'], $context['loop']);
|
||||
$context = array_intersect_key($context, $_parent) + $_parent;
|
||||
// line 195
|
||||
echo " ";
|
||||
if ((($context["add_fields"] ?? null) > 0)) {
|
||||
// line 196
|
||||
echo " ";
|
||||
$context['_parent'] = $context;
|
||||
$context['_seq'] = twig_ensure_traversable(range(1, ($context["add_fields"] ?? null)));
|
||||
foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
|
||||
// line 197
|
||||
echo " <tr class=\"noclick\">
|
||||
<td>
|
||||
<span class=\"drag_icon\" title=\"";
|
||||
echo _gettext("Drag to reorder");
|
||||
// line 199
|
||||
echo "\"></span>
|
||||
</td>
|
||||
<td>
|
||||
<select name=\"index[columns][names][]\">
|
||||
<option value=\"\">-- ";
|
||||
echo _gettext("Ignore");
|
||||
// line 203
|
||||
echo " --</option>
|
||||
";
|
||||
// line 204
|
||||
$context["j"] = 0;
|
||||
// line 205
|
||||
echo " ";
|
||||
$context['_parent'] = $context;
|
||||
$context['_seq'] = twig_ensure_traversable(($context["fields"] ?? null));
|
||||
foreach ($context['_seq'] as $context["field_name"] => $context["field_type"]) {
|
||||
// line 206
|
||||
echo " ";
|
||||
if (($context["create_edit_table"] ?? null)) {
|
||||
// line 207
|
||||
echo " ";
|
||||
$context["col_index"] = (($__internal_compile_0 = $context["field_type"]) && is_array($__internal_compile_0) || $__internal_compile_0 instanceof ArrayAccess ? ($__internal_compile_0[1] ?? null) : null);
|
||||
// line 208
|
||||
echo " ";
|
||||
$context["field_type"] = (($__internal_compile_1 = $context["field_type"]) && is_array($__internal_compile_1) || $__internal_compile_1 instanceof ArrayAccess ? ($__internal_compile_1[0] ?? null) : null);
|
||||
// line 209
|
||||
echo " ";
|
||||
}
|
||||
// line 210
|
||||
echo " ";
|
||||
$context["j"] = (($context["j"] ?? null) + 1);
|
||||
// line 211
|
||||
echo " <option value=\"";
|
||||
echo twig_escape_filter($this->env, ((array_key_exists("col_index", $context)) ? ( // line 212
|
||||
($context["col_index"] ?? null)) : ($context["field_name"])), "html", null, true);
|
||||
echo "\"";
|
||||
// line 213
|
||||
echo (((($context["j"] ?? null) == $context["i"])) ? (" selected=\"selected\"") : (""));
|
||||
echo ">
|
||||
";
|
||||
// line 214
|
||||
echo twig_escape_filter($this->env, $context["field_name"], "html", null, true);
|
||||
echo " [";
|
||||
echo twig_escape_filter($this->env, $context["field_type"], "html", null, true);
|
||||
echo "]
|
||||
</option>
|
||||
";
|
||||
}
|
||||
$_parent = $context['_parent'];
|
||||
unset($context['_seq'], $context['_iterated'], $context['field_name'], $context['field_type'], $context['_parent'], $context['loop']);
|
||||
$context = array_intersect_key($context, $_parent) + $_parent;
|
||||
// line 217
|
||||
echo " </select>
|
||||
</td>
|
||||
<td>
|
||||
<input type=\"text\"
|
||||
size=\"5\"
|
||||
onfocus=\"this.select()\"
|
||||
name=\"index[columns][sub_parts][]\"
|
||||
value=\"\">
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
$_parent = $context['_parent'];
|
||||
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
|
||||
$context = array_intersect_key($context, $_parent) + $_parent;
|
||||
// line 228
|
||||
echo " ";
|
||||
}
|
||||
// line 229
|
||||
echo " </tbody>
|
||||
</table>
|
||||
<div class=\"add_more\">
|
||||
|
||||
<div class=\"slider\"></div>
|
||||
<div class=\"add_fields hide\">
|
||||
<input class=\"btn btn-secondary\" type=\"submit\"
|
||||
id=\"add_fields\"
|
||||
value=\"";
|
||||
// line 237
|
||||
echo twig_escape_filter($this->env, twig_sprintf(_gettext("Add %s column(s) to index"), 1), "html", null, true);
|
||||
echo "\">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
";
|
||||
// line 243
|
||||
if ( !($context["create_edit_table"] ?? null)) {
|
||||
// line 244
|
||||
echo "<fieldset class=\"pma-fieldset tblFooters\">
|
||||
<button class=\"btn btn-primary\" type=\"submit\">";
|
||||
echo _gettext("Go");
|
||||
// line 245
|
||||
echo "</button>
|
||||
<button class=\"btn btn-secondary\" type=\"submit\" id=\"preview_index_frm\">";
|
||||
echo _gettext("Preview SQL");
|
||||
// line 246
|
||||
echo "</button>
|
||||
</fieldset>";
|
||||
}
|
||||
// line 249
|
||||
echo "</form>
|
||||
";
|
||||
// line 250
|
||||
if (($context["is_from_nav"] ?? null)) {
|
||||
// line 251
|
||||
echo " ";
|
||||
echo twig_include($this->env, $context, "modals/preview_sql_modal.twig");
|
||||
echo "
|
||||
";
|
||||
}
|
||||
}
|
||||
|
||||
public function getTemplateName()
|
||||
{
|
||||
return "table/index_form.twig";
|
||||
}
|
||||
|
||||
public function isTraitable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getDebugInfo()
|
||||
{
|
||||
return array ( 491 => 251, 489 => 250, 486 => 249, 482 => 246, 478 => 245, 474 => 244, 472 => 243, 464 => 237, 454 => 229, 451 => 228, 435 => 217, 424 => 214, 420 => 213, 417 => 212, 415 => 211, 412 => 210, 409 => 209, 406 => 208, 403 => 207, 400 => 206, 395 => 205, 393 => 204, 390 => 203, 383 => 199, 378 => 197, 373 => 196, 370 => 195, 360 => 191, 359 => 190, 358 => 191, 349 => 183, 343 => 182, 335 => 179, 332 => 178, 329 => 177, 327 => 176, 324 => 175, 321 => 174, 319 => 173, 318 => 172, 317 => 171, 315 => 170, 311 => 169, 307 => 167, 299 => 162, 294 => 160, 290 => 159, 287 => 158, 285 => 148, 280 => 145, 275 => 142, 264 => 133, 260 => 131, 258 => 130, 252 => 127, 241 => 118, 230 => 110, 220 => 102, 210 => 94, 197 => 92, 193 => 91, 183 => 85, 171 => 76, 161 => 68, 153 => 62, 148 => 60, 144 => 58, 139 => 56, 136 => 55, 134 => 54, 127 => 50, 123 => 49, 119 => 48, 114 => 47, 108 => 45, 106 => 44, 102 => 43, 93 => 38, 81 => 29, 67 => 19, 57 => 11, 53 => 9, 51 => 8, 47 => 7, 37 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext()
|
||||
{
|
||||
return new Source("", "table/index_form.twig", "/home/suvo/web/graffin.ns77.siliconpin.com/public_html/pma/templates/table/index_form.twig");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue