ok

Mini Shell

Direktori : /proc/thread-self/root/proc/self/root/home2/selectio/www/vijay-gases/modal/
Upload File :
Current File : //proc/thread-self/root/proc/self/root/home2/selectio/www/vijay-gases/modal/customer-edit.php

<?php
include "../config/config.php";
$ids = $_GET['id'];
    $statement = $pdo->prepare("SELECT * FROM tbl_customer e where e.id=".$ids);
    $statement->execute();
    $datas = $statement->fetchAll(PDO::FETCH_ASSOC);
    $totalData = $statement->rowCount();

if($totalData==1){
    
?>   
<style>
/*.modal-open .modal {
    overflow-x: hidden;
    overflow-y: hidden;
}*/
</style>
<div class="modal-dialog modal-lg" role="document" id="add_modal" style="overflow-x: hidden; overflow-y: hidden;">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title mt-0" id="myLargeModalLabel"><b>Update Customer Details</b></h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-top: -25px;"><i class="fa fa-times"></i></button>
            </div>
            
            <form id="add_form" method="post">
            <div id="content-div">
            
            <input type="hidden" name="ids" value="<?=$ids?>">
            
            <div class="modal-body" style="padding: 20px 40px 20px 40px;">
                
                    
                    
                    
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="control-label required" for="cus">Company Name</label>
                                <input type="text" name="cus_company_name" id="cus_company_name" value="<?=$datas[0]['cus_company_name']?>"  class="form-control" required="required" >
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="control-label required" for="cus">Customer Name</label>
                                <input type="text" name="name" id="name" value="<?=$datas[0]['customer_name']?>" class="form-control" onkeyup="this.value = this.value.toUpperCase();" required="required" >
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="control-label" for="cus">GST No</label>
                                <input type="text" name="cus_gst_no" id="cus_gst_no" value="<?=$datas[0]['gst_no']?>" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="control-label" for="cus">Aadhar no</label>
                                <input type="text" name="aadhar_no" id="aadhar_no" value="<?=$datas[0]['aadhar_no']?>" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="control-label required" for="drop_time">Mobile No 1</label>
                                <input type="text" name="mobile_no" id="mobile_no" value="<?=$datas[0]['mobile_number']?>" class="form-control" required="required">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="control-label optional" for="drop_time">Mobile No 2</label>
                                <input type="text" name="mobile_no2" id="mobile_no2" value="<?=$datas[0]['mobile_number2']?>" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="control-label optional" for="drop_time">Mobile No 3</label>
                                <input type="text" name="mobile_no3" id="mobile_no3" value="<?=$datas[0]['mobile_number3']?>" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="control-label optional" for="drop_time">Mobile No 4</label>
                                <input type="text" name="mobile_no4" id="mobile_no4" value="<?=$datas[0]['mobile_number4']?>" class="form-control" >
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="control-label optional" for="drop_time">Mobile No 5</label>
                                <input type="text" name="mobile_no5" id="mobile_no5" value="<?=$datas[0]['mobile_number5']?>" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="control-label optional" for="drop_time">Deposite Amount</label>
                                <input type="number" name="cus_dep_amt" id="cus_dep_amt" value="<?=$datas[0]['deposit_amount']?>" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="control-label optional" for="drop_time">Date</label>
                                <input type="date" name="cus_date" id="cus_date" value="<?=$datas[0]['cus_date']?>" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="control-label optional" for="drop_time">Receipt No</label>
                                <input type="text" name="receipt_no" id="receipt_no" value="<?=$datas[0]['receipt_no']?>" class="form-control">
                            </div>
                        </div>
                         <div class="col-md-4">
                            <div class="form-group">
                                <label class="required">Select The Company Name</label>
                                <select name="location" class="form-control select2" style="width:100%;" id="location" required>
                                    <option value="">Select Company Name</option>
                                <?php 
                                    $statement = $pdo->prepare("SELECT * FROM `tbl_location` WHERE status=1");
                                    $statement->execute();
                                    $result = $statement->fetchAll(PDO::FETCH_ASSOC);
                                    foreach ($result as $data) {    ?>
                                    <option value="<?=$data['id']?>" <?php if($datas[0]['location_id']==$data['id']){echo "selected";}?>><?=$data['name']?></option>
                                <?php } ?>
                                </select>
                            </div>
                        </div>
                        
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="required">Status</label>
                                <select class="form-control" name="status" id="status" required>
                                    <option value="1" <?php if($datas[0]['status']==1){echo "selected";}?>>Active</option>
                                    <option value="0" <?php if($datas[0]['status']==0){echo "selected";}?>>In-Active</option>
                                </select>
                            </div>
                        </div>
                           <div class="col-md-6">
                            <div class="form-group">
                                <label class="control-label required" for="drop_time"> Address</label>
                                <textarea type="text" name="address" id="address" class="form-control" required="required" ><?=$datas[0]['address']?></textarea>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="control-label required" for="drop_time">Delivery Address</label>
                                <textarea type="text" name="del_address" id="del_address" class="form-control" required="required" ><?=$datas[0]['del_address']?></textarea>
                            </div>
                        </div>
                       
                        
                    </div>
                    
            </div>
            
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary">Update</button>
            </div>
            
            
            </div>
            </form>
            
            
            
            <div id="loading-div" style="display: none; padding-bottom: 80px;">
                    <center> <img src="img/loading.gif" style="width: 250px;"><br><b class="blinking">Processing Please Wait...</b></center>
            </div>
            
            
            
        </div>
    </div>
<?php } ?>
<script>
    $('#add_form').on('submit', function(e){
        console.log("Click And Form Working");
                e.preventDefault();
                $('#loading-div').show();
                $('#content-div').hide();
                var formData = new FormData(this);
                formData.append('type', 'update_customer');
                            $.ajax({
                            url: 'apis/customer-add-api.php',
                            type: 'post',
                            dataType: 'json',
                            data: formData,
                            cache: false,
                            contentType: false,
                            processData: false,
                            enctype: 'multipart/form-data',
                            success: function (response) {
                                if(response['status']==200){
                                     alert(response['message']);
                                     $("#add_modal .close").click();
                                     $('#add_form').trigger("reset");
                                     emp_datas();
                                     $('#loading-div').hide();
                                     $('#content-div').show();
                                }else{
                                    alert(response['message']);
                                    $('#loading-div').hide();
                                    $('#content-div').show();
                                }
                                
                               
                            }
                        });
                
    });
</script>
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<style>
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: rgb(228, 228, 228);
    box-sizing: border-box;
    display: inline-block;
    margin-left: 5px;
    margin-top: 5px;
    position: relative;
    max-width: 100%;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space-collapse: collapse;
    text-wrap: nowrap;
    border-width: 1px;
    border-style: solid;
    border-color: rgb(170, 170, 170);
    border-image: initial;
    border-radius: 4px;
    padding: 0px 10px 0px 20px;
    overflow: hidden;
    color: black;
    font-weight: 800;
}
.select2-container--default .select2-selection--multiple {
    background-color: white;
    border: 1px solid #aaa;
    border-radius: 4px;
    cursor: text;
    height: 100px;
    padding-bottom: 5px;
    padding-right: 5px;
    position: relative;
}
</style>
<script>
    $(document).ready(function(){
        $(".select2").select2();
    });
</script>
<?php $pdo = null; ?>

Zerion Mini Shell 1.0