EVOLUTION-NINJA
Edit File: insert_dn.php
<?php // print_r($ram); // die(); ?> <!--error_reporting(E_ALL); ?>--> <script src="<?php echo base_url('assets/js/jquery.min.js'); ?>"></script> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/jquery.jqGrid.min.js'); ?>"></script> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/i18n/grid.locale-en.min.js'); ?>"></script> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.min.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid.min.css'); ?>" /> <script src="<?php echo base_url('assets/js/jquery-ui.min.js'); ?>" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.jquery.min.js"></script> <!-- Add these in the head section of your HTML document --> <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css" rel="stylesheet" /> <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script> <!--<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css" rel="stylesheet" />--> <script> // $(document).ready(function(){ // //Chosen // $(".from_user").chosen({}); // //Logic // }); // $(document).ready(function(){ // //Chosen // $(".to_user").chosen({}); // //Logic // }); </script> <script> $(function () { $("#orderDate").datepicker({ dateFormat: "d-m-yy", changeMonth: true, changeYear: true }); }); // $(function () { // $("#requiredDate").datepicker({ // dateFormat: "d-m-yy", // changeMonth: true, // changeYear: true // }); // }); </script> <style> .ui-jqgrid { text-transform: capitalize !important; } .tablediv { text-transform: uppercase !important; } .ui-jqgrid tr.jqgrow td{ text-transform: uppercase !important; } #ui-id-1 { width: 350px; top: 258px; overflow-x: hidden !important; overflow-y: scroll !important; height: 203px !important; } </style> <?php //include("menu.php"); ?> <!-- BEGIN CONTENT --> <div class="page-content-wrapper"> <div class="page-content"> <!-- BEGIN PAGE HEADER--> <!-- <h3 class="page-title"> Sample Request Form </h3> --> <div class="page-bar"> <ul class="page-breadcrumb"> <li><i class="fa fa-home"></i> <a href="<?php echo base_url();?>dashboard/dashboard_fun">Home</a> <i class="fa fa-angle-right"></i> </li> </ul> </div> <div class="portlet box blue-madison"> <input type="hidden" id="delete_id" class="delete_id" value="<?php if(empty($access_row)){ } else { echo $access_row->delete_id; } ?>" > <input type="hidden" id="preview_id" class="preview_id" value="<?php if(empty($access_row)){ } else { echo $access_row->preview_id; } ?>" > <!--<input type="hidden" value="<?php echo $users; ?>" id="users" >--> <input type="hidden" value="<?php echo $ref; ?>" id="ref_id" > <input type="hidden" value="<?php echo $url_val; ?>" id="url_ref" style="width: 230px;" > <form class="form-inline" enctype="multipart/form-data" method="post" id="addimage"> <input type="hidden" class="form-control ss col-sm-8" name="url_ref_val" > <input type = "hidden" name = "temp_name" id = "temp_name" value ="" /> <div class="row"> <div class="col-md-4 col-sm-12"> <div class="form-group col-sm-12 ss" id="outsource"> <input type="hidden" id="hhh" class="form-control ss col-sm-8" value="<?php echo $approved_by; ?>" name="hhh" > </div> <div class="form-group col-sm-12 ss"> <label class="col-sm-4 control-label ss">Debit Note Ref </label> <?php $date = date('d.m.y'); $case = $insert_id."/DN ".'DT'." ".$date; ?> <input type="text" name="debit_note" id="debit_note" class="form-control ss col-sm-8" value = "<?php echo $case; ?>" readonly /> </div> <div class="form-group col-sm-12 ss"> <label class="col-sm-4 control-label ss">Customer </label> <select name="customer" id="customer" class="form-control ss col-sm-8" onchange="idvalue()"> <option value=" ">Select</option> </select> </div> <!--<div class="form-group col-sm-12 ss">--> <!-- <label class="col-sm-4 control-label ss">Customer</label>--> <!-- <select name="customer" id="customer" class="form-control ss col-sm-8" onchange="idvalue()">--> <!-- Add your PHP loop to populate options here --> <!-- </select>--> <!-- </div>--> <div class="form-group col-sm-12 ss" id="out_article"> <label class="col-sm-4 control-label ss">Debit Note Date</label> <input name="note_date" id="orderDate" class="form-control ss col-sm-8 " /> </div> <div class="form-group col-sm-12 ss" id="Scale"> <label class="col-sm-4 control-label ss">Debit Note Value</label> <input type="number" name="note_value" id="note_value" class="form-control ss col-sm-8 " /> </div> <div class="form-group col-sm-12 ss" id="from_user"> <label class="col-sm-4 control-label ss">Customer DN Ref</label> <input type="text" name="note_ref" id="note_ref" class="form-control ss col-sm-8" > </div> <div class="form-group col-sm-12 ss" id="Scale"> <label class="col-sm-4 control-label ss">Remarks</label> <input type="text" name="remarks" id="remarks" class="form-control ss col-sm-8 " /> </div> <div class="form-group col-sm-12 ss" id="Scale"> <label class="col-sm-4 control-label ss">Customer ID</label> <input type="text" name="customer_id" id="customer_id" class="form-control ss col-sm-8 " readonly /> </div> <div class="form-group col-sm-12 ss" id="Scale"> <label class="col-sm-4 control-label ss">Currency</label> <select name="currency" id="currency" class="form-control ss col-sm-8 " > <option value="">Select</option> <option value="USD">USD</option> <option value="GBP">GBP</option> <option value="EUR">EUR</option> <option value="CHF">CHF</option> <option value="INR">INR</option> </select> </div> <div class="form-group col-sm-12 ss" id="Scale"> <label for="image_logo">Upload image logo</label><i onclick="clean()" class="fa fa-times" aria-hidden="true" style=" color:#ee6304;cursor: pointer;"></i><br> <input type="file" id="image_logo" name="image_logo" onchange="readURL2(this);" accept="image/pdf*"> <img src="" class="img-fluid" width="80" height="80" alt="preview image" id="blah" /> </div> </div> </div> <!--- row 1 ---> <div class="row" style="margin-top: 10px;"> <div class="col-sm-4"></div> <div class="col-sm-4"> <!-- <button type="submit" name="addnew" id="addnew" class="btn">Add New Product</button> --> <button type="submit" name="submitOrder" id="submitOrder" class="btn">Save</button> <button type="button" onclick="remove()" class="btn">Clear</button> </div> <div class="col-sm-4"></div> <div class="grid"> <!-------- GQ Grid Start ---------------------------------------------------------------------------------> <div class="container"> </div> <!-------- GQ Grid END ---------------------------------------------------------------------------------> </div> </div> <!--- row 2 ---> </form> </div> <!-- END DASHBOARD STATS --> </div> </div> </div> <!-- End BEGIN CONTAINER --> <!-- BEGIN FOOTER --> <!-- BEGIN FOOTER --> <link rel="stylesheet" href="<?php echo base_url('assets/css/code_jquery.min.css');?>"> <script src="<?php echo base_url('assets/js/jquery-ui.min.js'); ?>" type="text/javascript"></script> <!--<script src="<?php echo base_url('assets/js/jquery.min.js'); ?>" type="text/javascript"></script>--> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.min.css'); ?>" /> <script> $("#addimage").submit(function(e){ e.preventDefault(); var file_data = $('#image_logo').prop('files')[0]; var form_data = new FormData($(this)[0]); var remarks=$('#remarks').val(); var debit_note = $("#debit_note").val(); var customer = $("#customer").val(); var customer_id = $("#customer_id").val(); var currency = $("#currency").val(); var approved_by = $("#hhh").val(); // alert(approved_by); // return; var note_ref = $("#note_ref").val(); var note_value = $("#note_value").val(); var note_date = $("#orderDate").val(); form_data.append('file', file_data); $.ajax({ type: 'POST', url:"<?php echo base_url('debit_note/file_upload');?>", // <-- point to server-side PHP script dataType: 'text', // <-- what to expect back from the PHP script, if anything contentType: false, processData: false, data: form_data, success: function(php_script_response){ console.log(php_script_response); window.location.href = '<?php echo base_url();?>debit_note'; } }); }); function clean(){ $('#blah').attr('src', ''); $('#image_logo').val(null); $('#image_logo').show(); } function readURL2(input) { if(input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#blah').attr('src', e.target.result).width(80).height(80); }; reader.readAsDataURL(input.files[0]); $('#image_logo').hide(); } } </script> <style> .ss{ padding-right: 0 !important; padding-left: 0 !important; } .form-control { width:65% !important; height:27px !important; padding: 3px 12px !important; border-radius: 0px !important; //margin-bottom:15px; } label { font-weight: normal; text-align: left; } .hr-line{ border-top: 1px solid #465A81; } .well-sm { padding: 3px !important; border-radius: 0px !important; } input[type="file"] { padding-bottom: 28px !important; height: 25px !important; color:transparent; } .portlet.box.blue-madison { border: 1px solid #fff !important; border-top: 0; background:#fff !important; } .ui-jqgrid .ui-jqgrid-caption { text-align: left; background: rgb(72,91,127); color: white; } .ui-jqdialog .ui-jqdialog-titlebar { padding: .1em .1em; min-height: 35px; background: rgb(72,91,127); color: white; } .ui-jqdialog .ui-jqdialog-titlebar-close span { display: block; margin: -9px !important; } .ui-jqdialog .ui-jqdialog-titlebar-close span { display: block; margin: -9px !important; } #sData { height: 27px; } #cData { height: 27px; } #dData { height: 27px; } #eData { height: 27px; } .page-content a { color: #485b7f; float: right; } </style> </script> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/bootstrap-datepicker.min.css"/> <script src="<?php echo base_url();?>assets/js/bootstrap-datepicker.min.js"></script> <script> </script> <style type="text/css"> .ss{ padding-right: 0 !important; padding-left: 0 !important; } label { font-weight: normal; text-align: left; } .hr-line{ border-top: 1px solid #465A81; } .well-sm { padding: 3px !important; border-radius: 0px !important; } input[type="file"] { padding-bottom: 28px !important; height: 25px !important; color:transparent; } .portlet.box.blue-madison { border: 1px solid #fff !important; border-top: 0; background:#fff !important; } input[type=file] { display: none; } </style> <style> </style> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <link rel="stylesheet" href="<?php echo base_url('assets/css/code_jquery.min.css');?>"> <script src="<?php echo base_url('assets/js/jquery-ui.min.js'); ?>" type="text/javascript"></script> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.min.css'); ?>" /> <script> </script> <style> #list2_122_t { height:0px !important; } list2_136_t { height:12px !important; } .scroll { height:12px !important; } .ui-jqgrid-btable { } .ui-common-table { height:12px !important; } #refresh_list2 { display:none !important; } #client_edit { padding-right:18px !important; } #list2 { width: 1050px; height: 0px !important; } #gview_list2 { height: auto !important; } @media only screen and (min-width:320px) and (max-width:641px){ .ui-jqgrid { margin-left: 1px !important; } #jaytab{ margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 100% !important; padding-left: 0 !important; } #editmodlist2 { width:90% !important; } #sData span, #cData span { margin-left: 0 !important; } } @media only screen and (min-width:641px) and (max-width:991px){ .ui-jqgrid { margin-left: 1px !important; } #jaytab{ margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 100% !important; padding-left:0 !important; padding-right:9px !important; } } </style> <script> function remove() { var product_type=$("#product_type").val(''); var size=$("#size").val(''); var scale=$("#scale_val").val(''); var created_by=$("#by").val(''); } $(document).ready(function(){ $.ajax({ type:'post', url:'<?php echo base_url("debit_note/customer_master"); ?>', data:'', async:false, success: function (response12) { response12 = jQuery.parseJSON(response12); console.log(response12); mode +='<option value = "">Select an Option</option>'; $('#customer').append(mode); for(var i=0; i<response12.length; i++){ var mode = ''; mode +='<option>'+response12[i].customerName+'</option>'; $('#customer').append(mode); } } }); $(".customer").chosen({}); }); // function idvalue(){ // var name=$('#customer').val(); // $.ajax({ // type:'post', // url:'<?php echo base_url("debit_note/customer_id"); ?>', // data:{'name':name}, // async:false, // success: function (response12) { // var objData = jQuery.parseJSON(response12); // console.log(response12); // document.getElementById("customer_id").value = objData.customerID; // } // }); // $(".customer").chosen({}); // } </script> <script> function idvalue() { var name = $('#customer').val(); $.ajax({ type: 'post', url: '<?php echo base_url("debit_note/customer_id"); ?>', data: { 'name': name }, async: false, success: function (response12) { var objData = jQuery.parseJSON(response12); console.log(response12); // Assuming "customerID" is the correct property in your server response // Update the value of the element with ID "customer_id" $("#customer_id").val(objData.customerID); // Refresh Chosen plugin (if you're using it) $(".customer").trigger("chosen:updated"); } }); } // Initialize Chosen plugin on document ready $(document).ready(function () { $(".customer").chosen({}); }); </script> <script> $(document).ready(function () { // Apply Select2 to the customer dropdown $('#customer').select2({ placeholder: 'Select', allowClear: true, minimumResultsForSearch: 5 // You can adjust this number based on your preference }); }); </script> <style> .page-content a { float: none; } </style>