Viewing File: /home/quiczmwg/public_html/admin/manage-plan.php

<?php
if(isset($_POST['btnSave'])){
//   include 'register-process.php';
}
?>
<?php 
include 'head.php';
include 'header.php';
?>

<body class="skin-default fixed-layout" >
    <div id="main-wrapper" >
        <?php 
        include 'sidebar.php';
        // include 'config.php';
        
        // $sql = $conn->query("SELECT * FROM dcategory, ORDER BY id DESC");
        ?>
        <div class="page-wrapper">
            <div class="container-fluid">
                <?php include 'nav.php'; ?>

       <!-- Button to Open the Modal -->
       <div class="container">
            <div class="text-right my-3">
                <button type="button" class="btn text-white" data-toggle="modal" data-target="#myModal" style="background: rgb(2, 2, 83);">
                    <i class="bi bi-plus"></i> Add Investment Plan
                </button>
            </div>
        </div>

          <!-- The Modal -->
          <div class="modal fade" id="myModal">
            <div class="modal-dialog">
              <div class="modal-content">
              
                <!-- Modal Header -->
                <div class="modal-header">
                  <h4 class="modal-title">Manage Plan</h4>
                  <button type="button" class="close" data-dismiss="modal">&times;</button>
                </div>
                
                <!-- Modal body -->
                <div class="modal-body">
                  <form action="manage-plan-process.php" method="post">
                
                  <div class="form-group">
                    <input name="plan_title"  class="form-control my-2" placeholder="Enter Plan" required>
                  </div>

                  <div class="form-group">
                    <input name="minimum" type="number" class="form-control my-2" placeholder="Mimimum" required>
                  </div>

                  <div class="form-group">
                    <input name="maximum" type="number"  class="form-control my-2" placeholder="Maximum" required>
                  </div>

                  <div class="form-group">
                    <input name="profit" type="number"  class="form-control my-2" placeholder="profit" required>
                  </div>

                  <div class="form-group">
                    <input name="roi" type="number"  class="form-control my-2" placeholder="Return on investment percentage" required>
                  </div>

                  <div class="form-group">
                    <input name="days" type="number"  class="form-control my-2" placeholder="days" required>
                  </div>
 
                </div>
                
                <!-- Modal footer -->
                <div class="modal-footer">
                  <button type="submit" name="btnSave"  class="btn btn-success bg-warn">Submit</button>
                  <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
                </div>
                </form>
              </div>
            </div>
        </div>

    <section>
    <div class="d-flex justify-content-end align-items-center">
            <div class="container-fluid">
                <div class="card">
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table">
                                <thead>
                                    <th>#</th>
                                    <th>Plan</th>
                                    <th>Mimimum</th>
                                    <th>Maximum</th>
                                    <th>Profit</th>
                                    <th>ROI</th>
                                    <th>Days</th>
                                    <th>----</th>
                                </thead><br>

                                
                                <tbody>
                                  <?php
                                // Modify the SQL query to order by a column (e.g., registration date)
                                      $sql = $conn->query("SELECT * FROM plans ORDER BY id ASC");

                                      // Check if there are any rows returned by the query
                                      if ($sql !== false && $sql->num_rows > 0) {
                                          $num = 1;
                                          // Fetch each row from the result set
                                          while ($row = $sql->fetch_assoc()) {
                                              ?>
                                              <!-- Your HTML code here -->
                                            
                                                          <tr>
                                        
                                        <td><?php echo $num++; ?></td>  
                                        <td><?php echo $row['plan_title']; ?></td>
                                        <td><?php echo '$' .number_format($row['minimum'],2.); ?></td>
                                        <td><?php echo '$' .number_format($row['maximum'],2.); ?></td>
                                        <td><?php echo '$' .number_format($row['profit'],2.); ?></td>
                                        <!-- <td><?php echo $row['profit']; ?></td> -->
                                        <td><?php echo $row['roi']; ?>%</td>
                                        <td><?php echo $row['days']; ?></td>
                                        
                                        <td>
                                        <a href="edit_plan.php?id=<?php echo $row['id']; ?>" class="btn btn-info btn-sm">Edit</a>
                                       

                                        <!-- <a href="" class="btn btn-danger btn-sm" data-toggle="modal" data-target="#myModalxx">Delete</a> -->
                                        <a href="plan-controller.php?delete=<?php echo $row['id']; ?>" class="btn btn-danger" onclick="return confirm('are you sure you want to delete this?');"><i class="bi bi-trash3-fill"></i> Delete</a>
                                        <?php } }?>
                                         <!-- DELETE MODAL -->
                                      
                                    </td><br>
                                    </tr>

                                </tbody>
                             </table>
                        </div>
                    </div>
                </div>
            </div>
      </div>
    </section>
</div>
</div>
</div>


    <?php
    include 'footer.php';
    ?>


         

               
        

           

        
        



       
        
Back to Directory File Manager
<