ok
Direktori : /proc/thread-self/root/home2/selectio/www/wedding-info-new/admin/ |
Current File : //proc/thread-self/root/home2/selectio/www/wedding-info-new/admin/plans.php |
<?php include 'header.php'; if(isset($_POST['d_id']) && isset($_POST['status'])) { $ids = $_POST['d_id']; $status = !$_POST['status']; $statement = $pdo->prepare("UPDATE tbl_plans SET status = ? WHERE id = ?"); $statement->execute([$status, $ids]); } $statement = $pdo->prepare("SELECT a.status as status, c.name AS category_name, b.plan_name AS plans, a.* FROM tbl_plans AS a LEFT JOIN plan_name AS b ON b.plan_id = a.plan_name LEFT JOIN categories AS c ON c.id = a.category WHERE a.category = 1"); $statement->execute(); $plans = $statement->fetchAll(PDO::FETCH_ASSOC); $statements = $pdo->prepare("SELECT a.status as status, c.name AS category_name, b.plan_name AS plans, a.* FROM tbl_plans AS a LEFT JOIN plan_name AS b ON b.plan_id = a.plan_name LEFT JOIN categories AS c ON c.id = a.category WHERE a.category = 2"); $statements->execute(); $plans2 = $statements->fetchAll(PDO::FETCH_ASSOC); $statements = $pdo->prepare("SELECT a.status as status, c.name AS category_name, b.plan_name AS plans, a.* FROM tbl_plans AS a LEFT JOIN plan_name AS b ON b.plan_id = a.plan_name LEFT JOIN categories AS c ON c.id = a.category WHERE a.category = 3"); $statements->execute(); $plans3 = $statements->fetchAll(PDO::FETCH_ASSOC); ?> <style> .card { height: 350px; /* Set the desired height for the cards */ } .card-body { display: flex; flex-direction: column; justify-content: space-between; } </style> <div class="page-wrapper"> <div class="page-content"> <center><h2>Products</h2></center> <div class="row row-cols-1 row-cols-md-2 row-cols-lg-4 row-cols-xl-4"> <?php foreach ($plans as $plan){ $status = $plan['status'] == 1 ? 'Active': 'Inactive'; ?> <form method = 'post' action=''> <div class="col"> <style> .card.border-primary.border-bottom.border-3.border-0 { border-color: <?= htmlspecialchars($plan['content']); ?> !important; } </style> <div class="card border-primary border-bottom border-3 border-0" style='background-color: #f8f9fa;'> <div class="card-body"> <input type='hidden' name='d_id' value='<?=$plan['id']?>' /> <input type='hidden' name='status' value='<?=$plan['status']?>' /> <h5 class="card-title text-primary text-center"><?php echo htmlspecialchars($plan['plans']); ?></h5> <h6 class="card-text text-center"><?php echo htmlspecialchars($plan['plan_duration']); ?> Months</h6> <p class="card-text"><?php echo htmlspecialchars($plan['content']); ?></p> <strike><p class="card-text text-center">Rs.<?php echo htmlspecialchars($plan['max_price']); ?>.00</p></strike> <p class="card-text text-center">Rs.<?php echo htmlspecialchars($plan['price']); ?>.00</p> <p class="card-text text-center">Leads : <?php echo htmlspecialchars($plan['leads']); ?></p> <div class="text-center"><a href="javascript:;" class="btn btn-inverse-primary"><?=$status?></a> </div> <div class="text-center"> <a href="javascript:;" class="btn btn-inverse-primary"><i class='bx bx-star'></i>Buy</a> <a href="plans_new.php?e_id=<?php echo $plan['id']; ?>" class="btn btn-inverse-primary"><i class='bx bx-star'></i>Edit</a> <button type='submit' class="btn btn-inverse-primary"><i class='bx bx-star'></i>Delete</button> </div> </div> </div> </div> </form> <?php } ?> </div> <center><h2>Astrologer</h2></center> <div class="row row-cols-1 row-cols-md-2 row-cols-lg-4 row-cols-xl-4"> <?php foreach ($plans2 as $plan){ $status = $plan['status'] == 1 ? 'Active': 'Inactive'; ?> <form method = 'post' action=''> <div class="col"> <style> .card.border-primary.border-bottom.border-3.border-0 { border-color: <?= htmlspecialchars($plan['content']); ?> !important; } </style> <div class="card border-primary border-bottom border-3 border-0" style='background-color: #f8f9fa;'> <div class="card-body"> <input type='hidden' name='d_id' value='<?=$plan['id']?>' /> <input type='hidden' name='status' value='<?=$plan['status']?>' /> <h5 class="card-title text-primary text-center"><?php echo htmlspecialchars($plan['plans']); ?></h5> <h6 class="card-text text-center"><?php echo htmlspecialchars($plan['plan_duration']); ?> Months</h6> <p class="card-text"><?php echo htmlspecialchars($plan['content']); ?></p> <strike><p class="card-text text-center">Rs.<?php echo htmlspecialchars($plan['max_price']); ?>.00</p></strike> <p class="card-text text-center">Rs.<?php echo htmlspecialchars($plan['price']); ?>.00</p> <p class="card-text text-center">Leads : <?php echo htmlspecialchars($plan['leads']); ?></p> <div class="text-center"><a href="javascript:;" class="btn btn-inverse-primary"><?=$status?></a> </div> <div class="text-center"> <a href="javascript:;" class="btn btn-inverse-primary"><i class='bx bx-star'></i>Buy</a> <a href="plans_new.php?e_id=<?php echo $plan['id']; ?>" class="btn btn-inverse-primary"><i class='bx bx-star'></i>Edit</a> <button type='submit' class="btn btn-inverse-primary"><i class='bx bx-star'></i>Delete</button> </div> </div> </div> </div> </form> <?php } ?> </div> <center><h2>Alliance</h2></center> <div class="row row-cols-1 row-cols-md-2 row-cols-lg-4 row-cols-xl-4"> <?php foreach ($plans3 as $plan){ $status = $plan['status'] == 1 ? 'Active': 'Inactive'; ?> <form method = 'post' action=''> <div class="col"> <style> .card.border-primary.border-bottom.border-3.border-0 { border-color: <?= htmlspecialchars($plan['content']); ?> !important; } </style> <div class="card border-primary border-bottom border-3 border-0" style='background-color: #f8f9fa;'> <div class="card-body"> <input type='hidden' name='d_id' value='<?=$plan['id']?>' /> <input type='hidden' name='status' value='<?=$plan['status']?>' /> <h5 class="card-title text-primary text-center"><?php echo htmlspecialchars($plan['plans']); ?></h5> <h6 class="card-text text-center"><?php echo htmlspecialchars($plan['plan_duration']); ?> Months</h6> <p class="card-text"><?php echo htmlspecialchars($plan['content']); ?></p> <strike><p class="card-text text-center">Rs.<?php echo htmlspecialchars($plan['max_price']); ?>.00</p></strike> <p class="card-text text-center">Rs.<?php echo htmlspecialchars($plan['price']); ?>.00</p> <p class="card-text text-center">Leads : <?php echo htmlspecialchars($plan['leads']); ?></p> <div class="text-center"><a href="javascript:;" class="btn btn-inverse-primary"><?=$status?></a> </div> <div class="text-center"> <a href="javascript:;" class="btn btn-inverse-primary"><i class='bx bx-star'></i>Buy</a> <a href="plans_new.php?e_id=<?php echo $plan['id']; ?>" class="btn btn-inverse-primary"><i class='bx bx-star'></i>Edit</a> <button type='submit' class="btn btn-inverse-primary"><i class='bx bx-star'></i>Delete</button> </div> </div> </div> </div> </form> <?php } ?> </div> </div> </div> <?php include 'footer.php'; ?>