This commit is contained in:
ns77@siliconpin.com
2025-08-23 13:42:14 +00:00
parent 45a9baf3fa
commit 4e14a361f0
5 changed files with 1287 additions and 3 deletions

View File

@@ -13,5 +13,13 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>-->
<!-- <style>
* {
text-transform: uppercase;
}
</style> -->
</head>
<body>

View File

@@ -52,7 +52,7 @@
<form method="post" enctype="multipart/form-data" id="new_fd">
<input type="hidden" name="ac_type" value="F">
<div class="form-group">
<input type="text" class="form-control text-capitalize" name="ac_name" placeholder="Name" >
<input type="text" class="form-control" name="ac_name" placeholder="Name" >
<small id="emailHelp" class="form-text text-muted">A/C Holder Name*</small>
</div>
<div class="form-group">
@@ -105,12 +105,12 @@
</div>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="ac_address" placeholder="Address"></textarea>
<textarea class="form-control" rows="5" name="ac_address" placeholder="Address"></textarea>
</div>
<hr>
<small class="form-text text-muted"><u>Nominee details*</u></small>
<div class="form-group">
<textarea class="form-control text-capitalize" rows="5" name="AA_NOMINEE_DETAILS" required>Name:
<textarea class="form-control" rows="5" name="AA_NOMINEE_DETAILS" required>Name:
DOB:
Relation:
ID:

View File

@@ -0,0 +1,85 @@
<?php
// Session check
if (!isset($_SESSION['user_id'])) {
die("Unauthorized access. Please login first.");
}
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
$conn->set_charset("utf8");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$user_id = $_SESSION['user_id'];
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$current_pass = $_POST['current_password'] ?? '';
$new_pass = $_POST['new_password'] ?? '';
$confirm_pass = $_POST['confirm_password'] ?? '';
if (empty($current_pass) || empty($new_pass) || empty($confirm_pass)) {
$error = "All fields are required.";
} elseif ($new_pass !== $confirm_pass) {
$error = "New passwords do not match.";
} else {
$table = $GLOBALS['arif_users'] ?? 'arif_users';
// Check current password
$sql = "SELECT password FROM `$table` WHERE user_id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $user_id);
$stmt->execute();
$stmt->bind_result($hashed_password);
$stmt->fetch();
$stmt->close();
if (!$hashed_password || !password_verify($current_pass, $hashed_password)) {
$error = "Current password is incorrect.";
} else {
// Update password
$new_hashed = password_hash($new_pass, PASSWORD_DEFAULT);
$sql = "UPDATE `$table` SET password=? WHERE user_id=?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("ss", $new_hashed, $user_id);
if ($stmt->execute()) {
$success = "Password updated successfully!";
} else {
$error = "Failed to update password. Try again.";
}
$stmt->close();
}
}
}
?>
<div class="bg-light">
<div class="container mt-5">
<div class="card shadow p-4">
<h3 class="mb-3">Update Password</h3>
<?php if (isset($error)): ?>
<div class="alert alert-danger"><?= htmlspecialchars($error) ?></div>
<?php endif; ?>
<?php if (isset($success)): ?>
<div class="alert alert-success"><?= htmlspecialchars($success) ?></div>
<?php endif; ?>
<form method="POST">
<div class="form-group">
<label>Current Password</label>
<input type="password" name="current_password" class="form-control" required>
</div>
<div class="form-group">
<label>New Password</label>
<input type="password" name="new_password" class="form-control" required>
</div>
<div class="form-group">
<label>Confirm New Password</label>
<input type="password" name="confirm_password" class="form-control" required>
</div>
<button type="submit" class="btn btn-primary">Update Password</button>
</form>
</div>
</div>
</div>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,93 @@
<?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/export/index.twig */
class __TwigTemplate_fcc63079290e004734d85e2d4403849d extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'title' => [$this, 'block_title'],
];
}
protected function doGetParent(array $context)
{
// line 1
return "export.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
// line 11
ob_start(function () { return ''; });
// line 12
echo " ";
echo _gettext("@SERVER@ will become the server name, @DATABASE@ will become the database name and @TABLE@ will become the table name.");
$context["filename_hint"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
// line 1
$this->parent = $this->loadTemplate("export.twig", "table/export/index.twig", 1);
$this->parent->display($context, array_merge($this->blocks, $blocks));
}
// line 3
public function block_title($context, array $blocks = [])
{
$macros = $this->macros;
// line 4
echo " ";
if ((($context["export_type"] ?? null) == "raw")) {
// line 5
echo " ";
// l10n: A query that the user has written freely
echo _gettext("Exporting a raw query");
// line 6
echo " ";
} else {
// line 7
echo " ";
echo twig_escape_filter($this->env, twig_sprintf(_gettext("Exporting rows from \"%s\" table"), ($context["table"] ?? null)), "html", null, true);
echo "
";
}
}
public function getTemplateName()
{
return "table/export/index.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 67 => 7, 64 => 6, 60 => 5, 57 => 4, 53 => 3, 48 => 1, 44 => 12, 42 => 11, 35 => 1,);
}
public function getSourceContext()
{
return new Source("", "table/export/index.twig", "/home/suvo/web/graffin.ns77.siliconpin.com/public_html/pma/templates/table/export/index.twig");
}
}