File "dashboard.php"

Full path: /home/fsibplc/public_html/fsib/remittance/dashboard.php
File size: 26.65 B (26.65 KB bytes)
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php

include 'all_sql.php';
include 'sidebar.php';

?>


<div class="content">

    <?php
    // Account Opening Request
    $request_sql = "SELECT COUNT(*) as total_request FROM `account_info` WHERE `status` IS NULL";
    $request_sql_result = $conn->query($request_sql);
    $request_row = $request_sql_result->fetch_assoc();
    $total_request_pending = $request_row['total_request'];



    // Account Opened but not informed
    $open_notInform_sql = "SELECT COUNT(*) as total_opened FROM `account_info` WHERE `status` = 'Approved' AND `inform` = 'No'";
    $open_notInform_sql_result = $conn->query($open_notInform_sql);
    $open_notInform_row = $open_notInform_sql_result->fetch_assoc();
    $total_open_notInform = $open_notInform_row['total_opened'];

    // Account Opened but not informed
    $completed_sql = "SELECT COUNT(*) as total_completed FROM `account_info` WHERE `inform` = 'yes'";
    $completed_sql_result = $conn->query($completed_sql);
    $completed_row = $completed_sql_result->fetch_assoc();
    $total_completed = $completed_row['total_completed'];

    ?>
    <h1>Dashboard Overview</h1>
    <div class="d-flex justify-content-start mb-5">
        <div class="">
            <div class="card" id="requestCard">
                <div class="card-body d-flex justify-content-around align-items-center">
                    <div class="left">
                        <p class="card-focus"><?= $total_request_pending; ?></p>
                        <p class="card-title">Account Request</p>
                        <p class="card-subtitle text-info">(Not Opened)</p>

                    </div>
                    <div class="right">
                        <img src="icon/request.png" alt="">
                    </div>
                </div>
            </div>
        </div>
        <div class="">
            <div class="card" id="openedCard">
                <div class="card-body d-flex justify-content-around align-items-center">
                    <div class="left">
                        <p class="card-focus"><?= $total_open_notInform; ?></p>
                        <p class="card-title">Account Opened</p>
                        <p class="card-subtitle text-primary">(Not Informed)</p>

                    </div>
                    <div class="right">
                        <img src="icon/add-account.png" alt="">
                    </div>
                </div>
            </div>
        </div>
        <div class="">
            <div class="card" id="completedCard">
                <div class="card-body d-flex justify-content-around align-items-center">
                    <div class="left">
                        <p class="card-focus"><?= $total_completed; ?></p>
                        <p class="card-title">Completed Account</p>
                        <p class="card-subtitle text-success">(Informed)</p>

                    </div>
                    <div class="right">
                        <img src="icon/completed-task.png" alt="">
                    </div>
                </div>

            </div>
        </div>


    </div>


    <div class="user-table" id="requestTable">
        <div class="table-container">
            <h3>Account Request List</h3>
            <table id="table0" class="celled table table-hover table-striped table-bordered dt-responsive" style="width:100%">
                <thead class="">
                    <tr>
                        <th rowspan="2">Sl</th>
                        <th rowspan="2">Applicant Name</th>
                        <th rowspan="2">Father Name</th>
                        <th rowspan="2">Mother Name</th>
                        <th rowspan="2">Date Of Birth</th>
                        <th colspan="2">Verified</th>
                        <th rowspan="2">Action</th>
                    </tr>
                    <tr>
                        <th>Nid</th>
                        <th>Face</th>
                    </tr>
                </thead>
                <tbody>

                    <?php
                    $results = $conn->query("SELECT * FROM `account_info` WHERE `status` IS NULL ORDER BY `id` ASC");


                    $sl = 1;
                    while ($rows = $results->fetch_assoc()) {
                    ?>
                        <tr>
                            <td><?= $rows['id']; ?></td>
                            <td><?php echo $rows['name']; ?></td>
                            <td><?php echo $rows['father_name']; ?></td>
                            <td><?php echo $rows['mother_name']; ?></td>
                            <td><?php echo $rows['dob']; ?></td>

                            <td class="text-center"><?php echo $rows['nid_verified']; ?></td>
                            <td class="text-center"><?php echo $rows['face_verified']; ?></td>
                            <td>


                                <form action="" method="post">
                                    <input type="hidden" name="row_id" value="<?php echo $rows['id']; ?>">
                                    <input type="submit" class="btn btn-info" value="Open"
                                        name="open_details_btn" id="open_details_btn"></a>
                                </form>


                            </td>

                        </tr>
                    <?php $sl++;
                    } ?>
                </tbody>
            </table>
        </div>
    </div>

    <div class="user-table" id="openedTable">
        <div class="table-container">
            <h3>Account Opened List</h3>
            <table id="table1" class="celled table table-hover table-striped table-bordered dt-responsive" style="width:100%">
                <thead class="">
                    <tr>
                        <th rowspan="2">Sl</th>
                        <th rowspan="2">Applicant Name</th>
                        <th rowspan="2">Father Name</th>
                        <th rowspan="2">Mother Name</th>
                        <th rowspan="2">Date Of Birth</th>
                        <th rowspan="2">Status</th>
                        <th colspan="2">Verified</th>
                        <th rowspan="2">Action</th>
                    </tr>
                    <tr>
                        <th>Nid</th>
                        <th>Face</th>
                    </tr>
                </thead>
                <tbody>

                    <?php
                    $result = $conn->query("SELECT * FROM `account_info` WHERE `status` = 'Approved' AND `inform` = 'No' ORDER BY `id` ASC");

                    $sl = 1;
                    while ($rows = $result->fetch_assoc()) {
                    ?>
                        <tr>
                            <td><?= $sl; ?></td>
                            <td><?php echo $rows['name']; ?></td>
                            <td><?php echo $rows['father_name']; ?></td>
                            <td><?php echo $rows['mother_name']; ?></td>
                            <td><?php echo $rows['dob']; ?></td>
                            <td class="text-center"><?php echo $rows['status']; ?></td>
                            <td class="text-center"><?php echo $rows['nid_verified']; ?></td>
                            <td class="text-center"><?php echo $rows['face_verified']; ?></td>
                            <td class="text-center">
                                <form action="" method="post">
                                    <input type="hidden" name="row_id" value="<?php echo $rows['id']; ?>">
                                    <input type="submit" class="btn btn-primary" value="Inform"
                                        name="inform_details_btn" id="inform_details_btn"></a>
                                </form>

                            </td>
                        </tr>
                    <?php $sl++;
                    } ?>
                </tbody>
            </table>
        </div>
    </div>
    <div class="user-table" id="completedTable">
        <div class="table-container">
            <h3>Account Completed List</h3>
            <table id="table2" class="celled table table-hover table-striped table-bordered dt-responsive" style="width:100%">
                <thead class="">
                    <tr>
                        <th rowspan="2">Sl</th>
                        <th rowspan="2">Applicant Name</th>
                        <th rowspan="2">Father Name</th>
                        <th rowspan="2">Mother Name</th>
                        <th rowspan="2">Date Of Birth</th>
                        <th rowspan="2">Status</th>
                        <th colspan="2">Verified</th>
                        <th rowspan="2">Informed</th>
                        <th rowspan="2">Details</th>
                    </tr>
                    <tr>
                        <th>Nid</th>
                        <th>Face</th>
                    </tr>
                </thead>
                <tbody>

                    <?php
                    $result = $conn->query("SELECT * FROM `account_info` WHERE `inform` = 'yes' ORDER BY `id` ASC");

                    $sl = 1;
                    while ($rows = $result->fetch_assoc()) {
                    ?>
                        <tr>
                            <td><?= $sl; ?></td>
                            <td><?php echo $rows['name']; ?></td>
                            <td><?php echo $rows['father_name']; ?></td>
                            <td><?php echo $rows['mother_name']; ?></td>
                            <td><?php echo $rows['dob']; ?></td>
                            <td class="text-center"><?php echo $rows['status']; ?></td>
                            <td class="text-center"><?php echo $rows['nid_verified']; ?></td>
                            <td class="text-center"><?php echo $rows['face_verified']; ?></td>
                            <td class="text-center"><?php echo $rows['inform']; ?></td>
                            <td class="text-center">
                                <form action="" method="post">
                                    <input type="hidden" name="row_id" value="<?php echo $rows['id']; ?>">
                                    <input type="submit" class="btn btn-success" value="View"
                                        name="view_details" id="view_details"></a>
                                </form>

                            </td>
                        </tr>
                    <?php $sl++;
                    } ?>
                </tbody>
            </table>
        </div>
    </div>
</div>


<form method="POST" action="" id="info_update" name="info_update"></form>
<form method="POST" action="informCustomer.php" id="informAndMail" name="informAndMail"></form>


<div class="details-content" id="details-content">
    <div class="" id="openAction">
        <div class="table-container p-5">
            <?php
            if ($single_result->num_rows > 0) { ?>
                <h3 class="text-info text-center mb-5">Customer Details</h3>

                <div class="update-content" id="update-content">
                    <?php
                    // $index = 1;
                    while ($cus_details = $single_result->fetch_assoc()) {
                        // print_r($cus_details);
                    ?>
                        <!-- <h2>Customer Details</h2> -->

                        <div class="row">
                            <div class="col-4">
                                <p><strong>Branch :</strong> <?php echo $cus_details['branch_name'] . "(" . $cus_details['branch_id'] . ")"; ?></p>
                                <p><strong>Ac Type :</strong> <?php echo $cus_details['ac_name'] . "(" . $cus_details['ac_code'] . ")"; ?></p>
                                <p><strong>Name :</strong> <?php echo $cus_details['name']; ?></p>
                                <p><strong>Father Name :</strong> <?php echo $cus_details['father_name']; ?></p>
                                <p><strong>Mother Name :</strong> <?php echo $cus_details['mother_name']; ?></p>
                                <br>
                            </div>
                            <div class="col-4">
                                <p><strong>Date Of Birth :</strong> <?php echo $cus_details['dob']; ?></p>
                                <p><strong>Gender :</strong> <?php echo $cus_details['gender']; ?></p>
                                <p><strong>Occupation :</strong> <?php echo $cus_details['occupation']; ?></p>
                                <p><strong>Mobile :</strong> <?php echo $cus_details['mobile']; ?></p>
                                <p><strong>Email :</strong> <?php echo $cus_details['email']; ?></p>
                            </div>
                            <div class="col-4">
                                <p><strong>Nationality :</strong> <?php echo $cus_details['nationality']; ?></p>
                                <p><strong>Present Address :</strong> <?php echo $cus_details['present_address']; ?></p>
                                <p><strong>Permenant Address :</strong> <?php echo $cus_details['permanent_address']; ?></p>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-4">
                                <p><strong>Customer Image :</strong><img src="uploads/<?php echo $cus_details['picture']; ?>"
                                        class="img-fluid rounded d-block img-thumbnail" alt="customer_pic"></p>
                            </div>
                            <div class="col-4">
                                <p><strong>NID :</strong> <img src="uploads/<?php echo $cus_details['user_front']; ?>"
                                        class="img-fluid rounded d-block img-thumbnail" alt="user_front"></p>
                            </div>
                            <div class="col-4">
                                <p><strong>Signature :</strong> <img src="uploads/<?php echo $cus_details['sign']; ?>"
                                        class="img-fluid rounded  d-block img-thumbnail" alt="user_front"></p>
                            </div>
                        </div>
                        <hr style="border-color:green;opacity:0.3">

                        <div class="row">

                            <div class="col-4">
                                <h4 class="text-primary mb-3">Nominee Information</h4>
                                <p><strong>Nominee Name :</strong> <?php echo $cus_details['nominee_name']; ?></p>
                                <p><strong>Relation :</strong> <?php echo $cus_details['relation']; ?></p>
                                <p><strong>Share :</strong> <?php echo $cus_details['share']; ?></p>
                            </div>
                            <div class="col-4">
                                <br>
                                <p><strong>Nominee NID/Passport(Front) :</strong><img src="uploads/<?php echo $cus_details['nominee_front']; ?>"
                                        class="img-fluid rounded  d-block img-thumbnail" alt="user_front"></p>
                            </div>
                            <div class="col-4">
                                <br>
                                <p><strong>Nominee NID/Passport(Back) :</strong><img src="uploads/<?php echo $cus_details['nominee_back']; ?>"
                                        class="img-fluid rounded d-block img-thumbnail" alt="user_front"></p>
                            </div>
                        </div>
                        <hr style="border-color:green;opacity:0.3">


                        <?php if ($cus_details['status'] != "Approved") { ?>


                            <h4 class="text-success mb-3">Verification Process</h4>





                            <!-- nid and face verification -->
                            <div class="row d-flex mb-1 p-2">

                                <?php
                                if ($cus_details['face_verified'] == 'yes') { ?>
                                    <div class="col-md-12">

                                        <input form="info_update" type="checkbox" class="" id="face_verified" name="face_verified" value="yes"
                                            onclick="return false;" checked>
                                        <label class="col-form-label text-primary fw-bold">Face Verification</label>

                                    </div>
                                <?php } else { ?>
                                    <div class="col-md-12">

                                        <input type="checkbox" class="" id="face_verified" name="face_verified" value="yes" form="info_update">
                                        <label class="col-form-label text-primary fw-bold">Face Verification</label>

                                    </div>
                                <?php } ?>
                                <?php if ($cus_details['nid_verified'] == 'yes') { ?>
                                    <div class="col-md-12">

                                        <input form="info_update" type="checkbox" class="" id="nid_verified" name="nid_verified" value="yes"
                                            onclick="return false;" checked>
                                        <label class="col-form-label text-primary fw-bold">NID Verification</label>

                                    </div>
                                <?php } else { ?>

                                    <div class="col-md-12">

                                        <input type="checkbox" class="" id="nid_verified" name="nid_verified" value="yes" form="info_update">
                                        <label class="col-form-label text-primary fw-bold">NID Verification</label>

                                    </div>

                            </div>
                        <?php } ?>
                        <!-- nid and face verification -->

                        <input form="info_update" type="hidden" name="id" value="<?php echo $id; ?>">

                        <div class="row col-md-12">
                            <div class="form-group col-5" style="margin-right: 15px;">
                                <div class="row">
                                    <label for="ac_number" class="col-5"><strong>Account Number :</strong></label>
                                    <input form="info_update" type="text" id="numberInput" class="form-control col-7" name="acc_number" minlength="15" maxlength="15"
                                        onkeypress="return event.key >= '0' && event.key <= '9' && this.value.length < 15;"

                                        value="<?php if ($cus_details['ac_number']) {
                                                    echo $cus_details['ac_number'];
                                                } else {
                                                    echo '';
                                                } ?>">
                                </div>
                            </div>

                            <!--<div class="form-group col-3">-->
                            <!--    <div class="row">-->
                            <!--        <label for="inform" class="col-9"><strong>Customer Informed :</strong></label>-->
                            <!--        <input type="checkbox" class="form-control col-3" id="cust_informed" name="cust_informed" value="yes" form="info_update">-->
                            <!--    </div>-->
                            <!--</div>-->
                            <div class="form-group col-3">
                                <input type="submit" class="btn btn-success" name="acc_update_btn" value="UPDATE" form="info_update">
                            </div>
                        </div>



                        <hr style="border-color:green;opacity:0.3">
                        <button onclick="requestTableGoBack()" class="btn btn-primary">Go Back</button>
                    <?php } else { ?>
                        <h4 class="text-success mb-3">Inform to Customer</h4>

                        <!-- nid and face verification -->
                        <div class="row d-flex mb-1 p-2">



                            <input form="informAndMail" type="hidden" name="id" value="<?php echo $id; ?>">

                            <div class="row col-md-12">


                                <div class="form-group col-3">
                                    <div class="row">
                                        <label for="inform" class="col-9"><strong>Customer Informed :</strong></label>
                                        <input type="checkbox" class="form-control col-3" id="cust_informed" name="cust_informed" value="yes" form="informAndMail">
                                    </div>
                                </div>
                                <div class="form-group col-3">
                                    <input type="submit" class="btn btn-success" name="inform_customer_btn" value="Inform" form="informAndMail">
                                </div>
                            </div>



                            <hr style="border-color:green;opacity:0.3">
                            <button onclick="openedTableGoBack()" class="btn btn-primary">Go Back</button>


                        <?php } ?>

                        </div>
                </div>
            <?php
                    }
                } else if ($view_sql_execute->num_rows > 0) { ?>
            <div class="view-content" id="view-content">
                <?php
                    // $index = 1;
                    while ($cus_details = $view_sql_execute->fetch_assoc()) {
                        // print_r($cus_details);
                ?>
                    <!-- <h2>Customer Details</h2> -->

                    <div class="row">
                        <div class="col-4">
                            <p><strong>Branch :</strong> <?php echo $cus_details['branch_name'] . "(" . $cus_details['branch_id'] . ")"; ?></p>
                            <p><strong>Ac Type :</strong> <?php echo $cus_details['ac_name'] . "(" . $cus_details['ac_code'] . ")"; ?></p>
                            <p><strong>Name :</strong> <?php echo $cus_details['name']; ?></p>
                            <p><strong>Father Name :</strong> <?php echo $cus_details['father_name']; ?></p>
                            <p><strong>Mother Name :</strong> <?php echo $cus_details['mother_name']; ?></p>
                            <p><strong style="margin-right: 10px;">Customer Informed :</strong><input type="checkbox" class="" id="cust_informed" name="cust_informed" checked></p>
                            <br>

                        </div>
                        <div class="col-4">
                            <p><strong>Date Of Birth :</strong> <?php echo $cus_details['dob']; ?></p>
                            <p><strong>Gender :</strong> <?php echo $cus_details['gender']; ?></p>
                            <p><strong>Occupation :</strong> <?php echo $cus_details['occupation']; ?></p>
                            <p><strong>Mobile :</strong> <?php echo $cus_details['mobile']; ?></p>
                            <p><strong>Email :</strong> <?php echo $cus_details['email']; ?></p>


                        </div>
                        <div class="col-4">
                            <p><strong>Nationality :</strong> <?php echo $cus_details['nationality']; ?></p>
                            <p><strong>Present Address :</strong> <?php echo $cus_details['present_address']; ?></p>
                            <p><strong>Permenant Address :</strong> <?php echo $cus_details['permanent_address']; ?></p>
                            <p><strong>Account Number :</strong> <?php echo $cus_details['ac_number']; ?></p>

                        </div>
                    </div>
                    <div class="row">
                        <div class="col-4">
                            <p><strong>Customer Image :</strong><img src="uploads/<?php echo $cus_details['picture']; ?>"
                                    class="img-fluid rounded d-block img-thumbnail" alt="customer_pic"></p>
                        </div>
                        <div class="col-4">
                            <p><strong>NID :</strong> <img src="uploads/<?php echo $cus_details['user_front']; ?>"
                                    class="img-fluid rounded d-block img-thumbnail" alt="user_front"></p>
                        </div>
                        <div class="col-4">
                            <p><strong>Signature :</strong> <img src="uploads/<?php echo $cus_details['sign']; ?>"
                                    class="img-fluid rounded  d-block img-thumbnail" alt="user_front"></p>
                        </div>
                    </div>
                    <hr style="border-color:green;opacity:0.3">

                    <div class="row">

                        <div class="col-4">
                            <h4 class="text-primary">Nominee Information</h4>
                            <p><strong>Nominee Name :</strong> <?php echo $cus_details['nominee_name']; ?></p>
                            <p><strong>Relation :</strong> <?php echo $cus_details['relation']; ?></p>
                            <p><strong>Share :</strong> <?php echo $cus_details['share']; ?></p>
                        </div>
                        <div class="col-4">
                            <br>
                            <p><strong>Nominee NID/Passport(Front) :</strong><img src="uploads/<?php echo $cus_details['nominee_front']; ?>"
                                    class="img-fluid rounded  d-block img-thumbnail" alt="user_front"></p>
                        </div>
                        <div class="col-4">
                            <br>
                            <p><strong>Nominee NID/Passport(Back) :</strong><img src="uploads/<?php echo $cus_details['nominee_back']; ?>"
                                    class="img-fluid rounded d-block img-thumbnail" alt="user_front"></p>
                        </div>
                    </div>
                    <hr style="border-color:green;opacity:0.3">




                    <button onclick="CompletedTableGoBack()" class="btn btn-primary">Go Back</button>
            </div>
    <?php
                    }
                } else {
                    echo "<tr><td colspan='8'>No customer details found.</td></tr>";
                }
    ?>
        </div>
    </div>
</div>


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