Файловый менеджер - Редактировать - /home2/cocinasdalloway/public_html/administrador/Home/QuotesNew_allDetail.php
Назад
<!-- Dropzone.js --> <link href="../../public/scripts/vendors/dropzone/dist/min/dropzone.min.css" rel="stylesheet"> <div class="row"> <div class="col-md-12 col-sm-12 "> <div class="x_panel"> <div class="x_title"> <h2>Datos <small>Generales</small></h2> <ul class="nav navbar-right panel_toolbox"> <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a> <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> <a class="dropdown-item" href="#">Settings 1</a> <a class="dropdown-item" href="#">Settings 2</a> </div> </li> <li><a class="close-link"><i class="fa fa-close"></i></a> </li> </ul> <div class="clearfix"></div> </div> <div class="x_content"> <form class="demo-form"> <div class="row"> <?php if(isset($_GET['ED']) and $_GET['ED']=='SI'){ $query_clientesd = " SELECT * FROM quotes WHERE id_cotizacion =".$_GET['IdC']; $consu_clientesd = $conexion -> query($query_clientesd); $execu_clientesd = $consu_clientesd->fetch_array(MYSQLI_BOTH); $IdClienteA = $execu_clientesd["id_cliente"]; $IdEnvioA = $execu_clientesd["id_envio"]; $IdFacturacionA = $execu_clientesd["id_facturacion"]; ?> <input type="hidden" name="IdC" id="IdC" value="<?php echo $_GET['IdC']?>"/> <div class="col-md-4"> <label>Nombre</label> <input type="hidden" name="IdC" id="IdC" value="<?php echo $_GET['IdC']?>"/> <select disabled="disabled" class="js-example-basic-single form-control" onchange="ObtenerDatosEnvio(this.value)" id="cliente" type="text" name="cliente"> <option value=""></option> <?php $query_clientes = " SELECT * FROM clientes"; $consu_clientes = $conexion -> query($query_clientes); while($execu_clientes = $consu_clientes->fetch_array(MYSQLI_BOTH)){ $nombre_cliente = $execu_clientes["nombre"].' '.$execu_clientes["a_paterno"].' '.$execu_clientes["a_materno"]; ?> <option <?php if($IdClienteA==$execu_clientes["id"]){?> selected <?php }?> value="<?php echo $execu_clientes["id"] ?>"><?php echo $nombre_cliente?></option> <?php } ?> </select> </div> <div class="col-md-4"> <label>Direccion</label> <select disabled="disabled" id="direccion" class="js-example-basic-single form-control" type="text" name="direccion"> <option value=""></option> <?php $query_clientes = " SELECT * FROM clientes_ship"; $consu_clientes = $conexion -> query($query_clientes); while($execu_clientes = $consu_clientes->fetch_array(MYSQLI_BOTH)){ ?> <option <?php if($IdEnvioA==$execu_clientes["id"]){?> selected <?php }?> value="<?php echo $execu_clientes["id"] ?>"><?php echo $execu_clientes["calle"]." ".$execu_clientes["numero"]?></option> <?php } ?> </select> </div> <div class="col-md-4"> <label>Direccion</label> <select disabled="disabled" id="facturacion" class="js-example-basic-single form-control" type="text" name="facturacion"> <option <?php if($IdFacturacionA==0){?> selected <?php }?> value="0">XAXX010101000 - Mostrador</option> <?php $query_clientes = " SELECT * FROM clientes_fact"; $consu_clientes = $conexion -> query($query_clientes); while($execu_clientes = $consu_clientes->fetch_array(MYSQLI_BOTH)){ ?> <option <?php if($IdFacturacionA==$execu_clientes["id"]){?> selected <?php }?> value="<?php echo $execu_clientes["id"] ?>"><?php echo $execu_clientes["rfc"]." ".$execu_clientes["razon_social"]?></option> <?php } ?> </select> </div> <?php }else{?> <input type="hidden" name="IdC" id="IdC" value="<?php echo $_GET['IdC']?>"/> <div class="col-md-4"> <label>Nombre</label> <select class="js-example-basic-single form-control" onchange="ObtenerDatosEnvio(this.value)" id="cliente" type="text" name="cliente"> <option value=""></option> <?php $query_clientes = " SELECT * FROM clientes"; $consu_clientes = $conexion -> query($query_clientes); while($execu_clientes = $consu_clientes->fetch_array(MYSQLI_BOTH)){ $nombre_cliente = $execu_clientes["nombre"].' '.$execu_clientes["a_paterno"].' '.$execu_clientes["a_materno"]; ?> <option value="<?php echo $execu_clientes["id"] ?>"><?php echo $nombre_cliente?></option> <?php } ?> </select> </div> <div class="col-md-4"> <label>Direccion</label> <select id="direccion" class="js-example-basic-single form-control" type="text" name="direccion"> </select> </div> <div class="col-md-4"> <label>Facturacion</label> <select id="facturacion" class="js-example-basic-single form-control" type="text" name="facturacion"> </select> </div> <?php }?> </div> <div class="row" style="margin-top:15px;"> <div class="col-lg-12" > <div class="card card-primary"> <!-- /.card-header --> <div class="card-body " > <div class="row" > <table id="tableId" class="table table-sm table-responsive-xl" > <thead> <tr> <th style="display:none"></th> <th>Codigo</th> <th style="width: 30%">Descripcion</th> <th>cantidad</th> <th>UM</th> <th>P. Unitario</th> <th>Descuento</th> <th style="width: 5%"></th> </tr> </thead> <tbody class="rows"> <?php if(isset($_GET['ED']) and $_GET['ED']=='SI'){?> <?php $IdC=$_GET['IdC']; $query_ordenes = " SELECT * FROM quote_lines WHERE activo='si' AND id_cotizacion=".$IdC; $consu_ordenes = $conexion -> query($query_ordenes); $cont=1; while($execu_ordenes = $consu_ordenes->fetch_array(MYSQLI_BOTH)){ ?> <tr> <td style="display:none"> <input value="<?php echo $execu_ordenes['id_partida'] ?>" id="id_partida<?php echo $cont?>" name="id_partida<?php echo $cont?>" class="form-control form-control-sm" type="text" placeholder="" autocomplete="off"/> </td> <td> <input value="<?php echo $execu_ordenes['codigo'] ?>" id="codigo<?php echo $cont?>" name="codigo<?php echo $cont?>" class="form-control form-control-sm" type="text" placeholder="" autocomplete="off"/> </td> <td> <textarea rows="1" id="descripcion<?php echo $cont?>" name="descripcion<?php echo $cont?>" class="form-control form-control-sm" type="text" placeholder="" autocomplete="off"/><?php echo $execu_ordenes['descripcion'] ?></textarea> </td> <td> <input value="<?php echo $execu_ordenes['cantidad'] ?>" id="cantidad<?php echo $cont?>" name="cantidad<?php echo $cont?>" class="form-control form-control-sm" type="text" placeholder="" autocomplete="off"/> </td> <td> <input value="<?php echo $execu_ordenes['um'] ?>" id="um<?php echo $cont?>" name="um<?php echo $cont?>" class="form-control form-control-sm" type="text" placeholder="" autocomplete="off"/> </td> <td> <input value="<?php echo $execu_ordenes['subtotal'] ?>" id="total<?php echo $cont?>" name="total<?php echo $cont?>" class="form-control form-control-sm" type="text" placeholder="" autocomplete="off"/> </td> <td> <input value="<?php echo $execu_ordenes['descuento'] ?>" id="descuento<?php echo $cont?>" name="descuento1<?php echo $cont?>" class="form-control form-control-sm" type="text" placeholder="" autocomplete="off"/> </td> <td><button type="button" class="col-sm-12 btn btn-round btn-danger delete text-center">-</button></td> </tr> <?php } }else{?> <tr> <td style="display:none"> <input id="id_partida1" name="id_partida1" class="form-control form-control-sm" type="text" placeholder="" autocomplete="off"/> </td> <td> <input id="codigo1" name="codigo1" class="form-control form-control-sm" type="text" placeholder="" autocomplete="off"/> </td> <td> <textarea rows="1" id="descripcion1" name="descripcion1" class="form-control form-control-sm" type="text" placeholder="" autocomplete="off"/></textarea> </td> <td> <input value="1" id="cantidad1" name="cantidad1" class="form-control form-control-sm" type="text" placeholder="" autocomplete="off"/> </td> <td> <input id="um1" name="um1" class="form-control form-control-sm" type="text" placeholder="" autocomplete="off"/> </td> <td> <input id="total1" name="total1" class="form-control form-control-sm" type="text" placeholder="" autocomplete="off"/> </td> <td> <input id="descuento1" name="descuento1" class="form-control form-control-sm" type="text" placeholder="" autocomplete="off"/> </td> <td></td> </tr> <?php $cont++; } ?> </tbody> <tfoot> <tr> <td style="display:none"></td> <td></td> <td></td> <td></td> <td colspan="1"></td> <td colspan="1"><!--<button onclick="guardar(this.value)" value="end" rel="noopener" class="btn btn-success" style="text-align:right">Finalizar <i class="center fas fa-print"></i></button> --> <a href="javascript:void(0)" onclick="guardar(this.value)" value="go" rel="noopener" class="btn btn btn-round btn-success" style="text-align:right">Guardar <i class="center fa fa-save"></i></a></td> <td><button type="button" class="col-sm-6 btn btn-round btn-info btn-sm add_form_field">+</button></td> </tr> </tfoot> </table> </div> </div> <!-- /.card-body --> </div> </div> </div> <!-- /.row --> </form> </div> </div> </div> </div> <input name="IdIndice" id="IdIndice" value="<?php echo $cont;?>" type="hidden"/> <script> function ObtenerDatosEnvio(valor){ var modulo = document.getElementById("direccion"); $(modulo).empty(); if(valor!="") { $.ajax ({ type:'post', url:'../models/clients/LoadClientShips.php', data:{IdCliente:valor}, dataType: 'json', success:function(response) { //console.log(response); if(response.detail=="success") { $(modulo).append(response.data); ObtenerDatosFacturacion(valor) } else { toastr.error(response.message); } } }); } else { toastr.warning('Error. Contacte a TI'); } } function ObtenerDatosFacturacion(valor){ var modulo1 = document.getElementById("facturacion"); $(modulo1).empty(); if(valor!="") { $.ajax ({ type:'post', url:'../models/clients/LoadClientFact.php', data:{IdCliente:valor}, dataType: 'json', success:function(response) { //console.log(response); if(response.detail=="success") { $(modulo1).append(response.data); } else { toastr.error(response.message); } } }); } else { toastr.warning('Error. Contacte a TI'); } } function guardar(act){ var partidas = []; var campoV1=0, campoV2=0, campoV3=0, campoV4=0, campoV5=0, campoV6=0, campoV7=0; $("#tableId tbody tr").each(function (index) { var campo1, campo2, campo3, campo4, campo5, campo6, campo7; $(this).children("td").each(function (index2) { switch (index2) { case 0: campo6= ($(this).find('input[type=text]').val()); if(campo6=='')campoV6++; break; case 1: campo1= ($(this).find('input[type=text]').val()); if(campo1=='')campoV1++; break; case 2: campo2 = ($(this).find('textarea').val()); if(campo2=='')campoV2++; break; case 3: campo3 =($(this).find('input[type=text]').val()); if(campo3=='')campoV3++; break; case 4: campo4 = ($(this).find('input[type=text]').val()); if(campo4=='')campoV4++; break; case 5: campo5 = ($(this).find('input[type=text]').val()); if(campo5=='')campoV5++; break; case 6: campo7 = ($(this).find('input[type=text]').val()); if(campo7=='')campoV7++; break; } //partidas=[{familia:campo1, diseno:campo2, veta:campo3, cantidad:campo4, ancho:campo5, alto:campo6, jaladera:campo7, ubicacion:campo8, fuga:campo9}]; }) partidas.push({linea:campo6, codigo:campo1, descripcion:campo2, cantidad:campo3, um:campo4, total:campo5, descuento:campo7}); }) //console.log(JSON.stringify(partidas)); if( campoV1 > 0 ){ toastr.error('Falta algun dato en la columna codigo'); } else if( campoV2 > 0 ){ toastr.error('Falta algun dato en la columna descripcion'); } else if( campoV3 > 0 ){ toastr.error('Falta algun dato en la columna cantidad'); } else if( campoV4 > 0 ){ toastr.error('Falta algun dato en la columna unidad de medida'); } else if( campoV5 > 0 ){ toastr.error('Falta algun dato en la columna total'); } else{ if(document.getElementById('cliente').value!=''){ if(document.getElementById('IdC').value!=''){ $.ajax ({ type:'post', async: false, url:'../models/orders/SaveQuoteV3.php', data:{ myData: JSON.stringify(partidas), cliente: document.getElementById('cliente').value, direccion: document.getElementById('direccion').value, facturacion: document.getElementById('facturacion').value, IdC:document.getElementById('IdC').value, Act:act, }, dataType: 'json', success:function(response) { console.log(response) if(response.detail=="success") { toastr.success(response.message); if(response.act=='end'){ window.open('QuotePrint.php?IdQuote='+response.id, '_blank'); } //window.location.target='_blank'; window.location.href="index.php?md=13"; //window.open('index.php'); } if(response.detail=="warning") { toastr.warning(response.message); } if(response.detail=="error") { toastr.error(response.message); } }, error: function (data) { toastr.error('Error. Contacte a TI. Detalles: '+data); } }); }else{ toastr.error('Error. No existe ID de cotizacion'); } }else{ toastr.error('Error. No existe cliente'); } } } $(document).ready(function() { var max_fields = 20; var wrapper = $(".rows"); var add_button = $(".add_form_field"); //var x = 2; var x = document.getElementById("IdIndice").value; $(add_button).click(function(e){ e.preventDefault(); var table = document.getElementById("tableId"); // if(x < max_fields){ $(wrapper).append('<tr>'+ '<td style="display:none"><input id="id_partida'+x+'" name="id_partida'+x+'" class="form-control form-control-sm" type="text" autocomplete="off"/></td>'+ '<td><input id="codigo'+x+'" name="codigo'+x+'" class="form-control form-control-sm" type="text" autocomplete="off"/></td>'+ '<td><textarea rows="1" id="descripcion'+x+'" name="descripcion'+x+'" class="form-control form-control-sm"></textarea></td>'+ '<td><input value="1" id="cantidad'+x+'" name="cantidad'+x+'" class="form-control form-control-sm" type="text" autocomplete="off"/></td>'+ '<td><input id="um'+x+'" name="um'+x+'" class="form-control form-control-sm" type="text" autocomplete="off"/></td>'+ '<td><input id="total'+x+'" name="total'+x+'" class="form-control form-control-sm" type="text" autocomplete="off"/></td>'+ '<td><input id="descuento'+x+'" name="descuento'+x+'" class="form-control form-control-sm" type="text" autocomplete="off"/></td>'+ '<td><button type="button" class="col-sm-12 btn btn-round btn-danger delete text-center">-</button></td>'+ '</tr>'); //console.log((tbodyRowCount)); //console.log(table.tBodies.item(0)); var tbodyRowCount = (table.tBodies[0].rows.length - 2); //console.log((tbodyRowCount)); console.log(document.getElementById('tableId').getElementsByTagName('tbody')[0].getElementsByTagName('tr')[tbodyRowCount].getElementsByTagName('td')[0].getElementsByTagName('select')[0].getAttribute('id')); var tbodyRef = document.getElementById('tableId').getElementsByTagName('tbody')[0].getElementsByTagName('tr')[tbodyRowCount].getElementsByTagName('td')[0].getElementsByTagName('select')[0].getAttribute('id'); //var tbodyRef = document.getElementById('tableId').getElementsByTagName('tbody')[0].getElementsByTagName('tr')[tbodyRowCount].getElementsByTagName('td')[0].getElementsByTagName('select')[0].value; var valorPrev = document.getElementById(tbodyRef).value; x++; /* } else { alert('You Reached the limits') } */ }); $(wrapper).on("click",".delete", function(e){ console.log($(this).parent('tr')); e.preventDefault(); $(this).closest('tr').remove(); //$(this).removeChild('tr'); //x--; }) }); </script> <div class="col-lg-12 "> <div class="card card-primary"> <div class="card-body "> <form action="project_detail_image_upload.php" class="dropzone needsclick" id="my-awesome-dropzone" > <input type="hidden" name="IdProject" id="IdProject" value="<?php echo $_GET['IdC']?>"/> <div class="dz-message needsclick"> Arrastre los documentos aqui o <span class="btn btn-link">click para seleccionarlos</></span>. <span class="note needsclick"></span> </div> </form> </div> </div> </div> <!-- /.col-md-6 --> <script src="../../public/scripts/vendors/dropzone/dist/min/dropzone.min.js"></script> <script> Dropzone.autoDiscover = false; function setup(id) { let options = { thumbnailHeight: 250, thumbnailWidth: 250, maxFilesize: 8024, maxFiles: 10, dictResponseError: "Server not Configured", dictFileTooBig: "File too big ({{filesize}}MB). Must be less than {{maxFilesize}}MB.", dictCancelUpload: "", acceptedFiles: "image/*,application/pdf,.doc,.docx,.xls,.xlsx,.csv,.tsv,.ppt,.pptx,.pages,.odt,.rtf,.rar", clickable: false, init: function() { var self = this; //New file added self.on("addedfile", function(file,response) { console.log("new file added ", file); }); // Send file starts self.on("sending", function(file) { console.log("upload started", file); }); self.on("complete", function(file, response) { if (file.name !== "442343.jpg") { //this.removeFile(file); } var newNode = document.createElement('a'); newNode.href = '../images/quotes/'+document.getElementById('IdProject').value+'/'+file.name; newNode.target = "_blank"; newNode.innerHTML = '<i class="fa fa-download"></i>'; file.previewTemplate.appendChild(newNode); }); self.on("maxfilesreached", function(file, response) { //alert("too big"); }); self.on("maxfilesexceeded", function(file, response) { this.removeFile(file); }); self.on("addedfile", function(file) { const pattern = /\d{6}(\.)(jpg|jpeg|png)/; if (!pattern.test(file.name)) { // this.removeFile(file); } }); if(document.getElementById('IdProject').value!='') { $.get('project_detail_image_upload.php?IdProject='+document.getElementById('IdProject').value, function(data,file) { $.each(data, function(key,value){ var ext = checkFileExt(value.name); // Get extension let fileAux=""; if(ext=="pdf"){ fileAux='../images/icons/icono-pdf.jpg' }else if(ext=="xls" || ext=="xlsx"){ fileAux='../images/icons/icono-excel.png' }else if(ext=="doc" || ext=="docx"){ fileAux='../images/icons/icono-word.png' }else{ fileAux='../images/quotes/'+document.getElementById('IdProject').value+'/'+value.name } var mockFile = { name: value.name, size: value.size }; self.options.addedfile.call(self, mockFile,'../images/quotes/'+document.getElementById('IdProject').value+'/'+value.name); self.options.thumbnail.call(self, mockFile, fileAux); //console.log(self.options.previewTemplate) $(".dz-progress").remove(); var newNode = document.createElement('a'); newNode.href = '../images/quotes/'+document.getElementById('IdProject').value+'/'+value.name; newNode.target = "_blank"; newNode.innerHTML = '<i class="fa fa-download"></i>'; //console.log(self.element.dropzone) self.previewsContainer.appendChild(newNode) }); }); } self.on("removedfile", function(file) { //var IdLine=document.getElementById('IdLine') var IdProject=document.getElementById('IdProject') $.ajax({ type: "POST", url: "project_detail_image_upload.php", data: { dir_file:IdProject.value+"/", target_file: file.name, delete_file: 1 } }); }); }, accept: function(file, done) { /* const pattern = /\d{1}(\.)/; if (pattern.test(file.name)) { */ done(); /*} else { done("Nombre invalido"); return false; }*/ }, previewTemplate: ` <div class="dz-preview dz-file-preview"> <div class="dz-image"><img data-dz-thumbnail /></div> <div class="dz-error-message"><i class="fa fa-warning"> </i><span data-dz-errormessage></span></div> <div class="dz-filename"><span data-dz-name></span></div> <div class="dz-progress"> <span class="dz-upload" data-dz-uploadprogress></span> </div> </div> ` }; var myDropzone = new Dropzone(`#${id}`, options); } setup("my-awesome-dropzone"); function checkFileExt(filename){ filename = filename.toLowerCase(); return filename.split('.').pop(); } $(document).ready(function() { $('.js-example-basic-single').select2(); }); </script>
| ver. 1.4 |
Github
|
.
| PHP 8.2.22 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка