<!DOCTYPE html>
<html lang="en">


<!-- Mirrored from edumin.dexignlab.com/xhtml/add-departments.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 17 Nov 2020 13:56:15 GMT -->
<head>
    
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Rizwan </title>
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="<?php echo base_url();?>assets/images/favicon.png">
    <link rel="stylesheet" href="<?php echo base_url();?>assets/vendor/bootstrap-select/dist/css/bootstrap-select.min.css">
    <link rel="stylesheet" href="<?php echo base_url();?>assets/css/style.css">
    <!-- Pick date -->
   <link rel="stylesheet" href="<?php echo base_url();?>assets/vendor/pickadate/themes/default.css">
    <link rel="stylesheet" href="<?php echo base_url();?>assets/vendor/pickadate/themes/default.date.css">
     <link href="<?php echo base_url();?>assets/vendor/datatables/css/jquery.dataTables.min.css" rel="stylesheet">
    <!-- Custom Stylesheet -->
     

</head>

<body>

    <!--*******************
        Preloader start
    ********************-->
        <div id="preloader">
        <div class="sk-three-bounce">
            <div class="sk-child sk-bounce1"></div>
            <div class="sk-child sk-bounce2"></div>
            <div class="sk-child sk-bounce3"></div>
        </div>
    </div>
    <!--*******************
        Preloader end
    ********************-->

    <!--**********************************
        Main wrapper start
    ***********************************-->
    <div id="main-wrapper">

      <?php  $this->load->view('header'); ?>
        
        <!--**********************************
            Content body start
        ***********************************-->
        <div class="content-body">
            <!-- row -->
            <div class="container-fluid">
                    
                <div class="row page-titles mx-0">
                    <div class="col-sm-6 p-md-0">
                        <div class="welcome-text">
                            <h4>Update Delivery Challan</h4>
                        </div>
                    </div>
                    <div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                            <li class="breadcrumb-item active"><a href="javascript:void(0);">Delivery Challan</a></li>
                            <li class="breadcrumb-item active"><a href="javascript:void(0);">Add Delivery</a></li>
                        </ol>
                    </div>
                </div>
                
                <div class="row">


                    <div class="col-12">
            
                               
                            
                          <div class="col-xl-12 col-xxl-12 col-sm-12">
                             <div class="card">

                               <?php echo form_open(base_url(''),array('class'=>"form-horizontal add_sales_order", 'id'=>"add_sales_order")); ?>
                                    
                                        <?php if($this->session->flashdata('sales_order_success')){ ?>
                                <div class="alert alert-success solid" style='text-align:center;'><?php echo $this->session->flashdata('sales_order_success'); ?></div>
                            <?php } ?> 
                                <div class="card-body">
                                    <div id='sales_order_success' class='alert alert-success solid' style='display:none;'></div>
                                       <div class="row">
                                            
                                                   
                                          
                                                    <input type="hidden" value="<?php echo date('Y-m-d H:i:s'); ?>" name="modified" id="modified" class="form-control required">
                                                 
                                                    <input type="hidden" value="<?php echo $this->uri->segment(3); ?>" name="id" id="id" class="form-control required">
                                                 
                                            

                                               </div>
                                                   <div class="col-lg-5 col-md-6 col-sm-12">
                                                     <div class="form-group">
                                                        <label class="form-label">Challan No:</label>
                                                        <input type="text" name="dc_no" id="dc_no" required="required" value="<?php echo $update_dc_invoice[0]['dc_no']; ?>" readonly="readonly" class="form-control dc_no">
                                                     </div>
                                                     
                                                </div>
                                                 <div class="col-lg-5 col-md-4 col-sm-8">
                                                    <div class="form-group">
                                                        <label class="form-label">Batch No</label>
                                                        <input type="text" name="batch" id="batch" value="<?php echo $update_dc_invoice[0]['batch']; ?>" required="required" placeholder="Batch No" class="form-control batch">
                                                    </div>
                                                </div>

                                                  <div class="col-lg-5 col-md-4 col-sm-8">
                                                    <div class="form-group">
                                                        <label class="form-label">Qty</label>
                                                        <input type="text" name="qty" value="<?php echo $update_dc_invoice[0]['qty']; ?>" id="qty" required="required" placeholder="Quantity" class="form-control ">
                                                    </div>
                                                </div>


                                                 <div class="col-lg-5 col-md-4 col-sm-8">
                                                    <div class="form-group">
                                                        <label class="form-label">Remarks</label>
                                                        <textarea name="remarks" id="remarks"  placeholder="Remarks" class="form-control "><?php echo $update_dc_invoice[0]['remarks']; ?></textarea>
                                                    </div>
                                                </div>

                                        
                                              </div>

                                     <button type="submit" id="save_data" class="btn btn-primary">Save <i class="icon-arrow-right14 position-right"></i></button>
                                    </div>

                                     <?php form_close();?>
                                </div>
                           
                              
                                
                                            
                                
                            </div>


                            

                        
                        </div>
                    </div>

                   
                </div>
            </div>
       
        <!--**********************************
            Content body end
        ***********************************-->


        <!--**********************************
            Footer start
        ***********************************-->
        
        <!--**********************************
            Footer end
        ***********************************-->

        <!--**********************************
           Support ticket button start
        ***********************************-->

        <!--**********************************
           Support ticket button end
        ***********************************-->


    </div>
    <!--**********************************
        Main wrapper end
    ***********************************-->

    <!--**********************************
        Scripts
    ***********************************-->
    <!-- Required vendors -->
         <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
        <style>
        .redborder{
            border:1px solid red;
        }
        </style>

         <SCRIPT language=Javascript>
       <!--
       function isNumberKey(evt)
       {
          var charCode = (evt.which) ? evt.which : evt.keyCode;
          if (charCode != 46 && charCode > 31 
            && (charCode < 48 || charCode > 57))
             return false;

          return true;
       }
       //-->
    </SCRIPT>
    <script type='text/javascript'>

     
 


          function delete_data_so(id) { 
        var id = id;
        if (confirm('Are you sure you want to Delete.?')) {
  
         $.ajax({
                type:'POST',
                url:'<?php echo base_url('Sales_order/sales_order_delete_data/'); ?>'+id,
                data:id,
                dataType:'json',
                success:function(data){
                    console.log('first'+data.status);
                    
                        console.log('second'+data.status);
                        //debugger;
                        $('#material_danger').show().html('Deleted Successfully');
                       setTimeout(function(){location.href="<?php echo base_url('Sales_order/all_sales_order'); ?>"} , 3000);
                    
                },
                error:function(data){console.log(data.responseText);}
            });
        } else {
  
            }
        } 


  
    var add_order = $('#add_sales_order');   
    
    add_order.on('submit',function(e){

        e.preventDefault();
        $("#save_data").attr('disabled', true);
        var add_add_order = add_order.serialize();
         var id = $('#id').val();
      
            $.ajax({
                type:'POST',
                url:'<?php echo base_url('Sales_order/edit_dc_invoice'); ?>',
                data:add_add_order,
                dataType:'json',
                success:function(data){
                    console.log('first'+data.status);
                    if(data.status === 'true'){
                        console.log('second'+data.status);
                        $('#sales_order_success').show().html('Update Successfully');
                       setTimeout(function(){location.href="<?php echo base_url('Sales_order/edit_dc_invoice/'); ?>"+id} , 2000);
                    }else{
                        console.log('third'+data);          
                    }
                },
                error:function(data){console.log(data.responseText);}
            });
       // }
    });

   


    
    </script>   

       <?php  $this->load->view('footer'); ?>
        
</body>

<!-- Mirrored from edumin.dexignlab.com/xhtml/add-departments.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 17 Nov 2020 13:56:15 GMT -->
</html> 