49 lines
2.4 KiB
PHP
49 lines
2.4 KiB
PHP
<?php
|
|
require_once('/var/www/html/.hta_config/crm_config.php');
|
|
require_once('/var/www/html/.htac_header.php');
|
|
require_once('/var/www/html/.htac_nav.php');
|
|
|
|
if($_SERVER['REQUEST_METHOD']=="POST"){
|
|
try {
|
|
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
|
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
$stmt = $conn->prepare("UPDATE business_verticals SET bv = :bv WHERE id = :id");
|
|
$stmt->bindParam(':bv', $_POST['bv']);
|
|
$stmt->bindParam(':id', $_GET['id']);
|
|
$stmt->execute();
|
|
|
|
echo "Record Updated successfully";
|
|
} catch(PDOException $e) {
|
|
echo "Error: " . $e->getMessage();
|
|
}
|
|
};
|
|
|
|
try {
|
|
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
|
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
$stmt = $conn->prepare("SELECT * FROM business_verticals WHERE id=:id");
|
|
$stmt->bindParam(":id", $_GET['id']);
|
|
$stmt->execute();
|
|
$bvrows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
foreach($bvrows as $bvname){ ?>
|
|
<div class="flex flex-col place-items-center mt-40 mb-60 ">
|
|
<form method="post" class="max-w-2xl shadow-xl p-4 rounded-lg space-y-4" style="width: 100%; max-width: 600px;">
|
|
<p class="my-4" style="border-bottom: 2px solid #464E5F; border-style: dashed; font-size: 20px; font-weight: bold" >Edit Business Verticals</p>
|
|
<div style="display: flex; flex-direction: column;">
|
|
<label for="bv">Business Verticals:</label>
|
|
<input type="text" name="bv" id="bv" value="<?php echo $bvname['bv']; ?>" style="border: 1px solid #363650; border-radius: 5px; padding: 6px;" />
|
|
</div>
|
|
<div class="flex flex-col justify-center">
|
|
<input type="submit" value="Update" id="submit" name="submit" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); text-align: center; padding: 6px; color: #fff; border-radius: 6px; margin-top: 6px;" />
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
} catch (PDOException $e) {
|
|
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
|
}
|
|
|
|
?>
|