Файловый менеджер - Редактировать - /home2/cocinasdalloway/public_html/administrador/Home/QuotesNew_all.php
Назад
<?php function sumasdiasemana($fecha,$dias) { $datestart= strtotime($fecha); $datesuma = 15 * 86400; $diasemana = date('N',$datestart); $totaldias = $diasemana+$dias; $findesemana = intval( $totaldias/6) *1 ; $diasabado = $totaldias % 6 ; if ($diasabado==6) $findesemana++; if ($diasabado==0) $findesemana=$findesemana-1; $total = (($dias+$findesemana) * 86400)+$datestart ; return $fechafinal = date('d-m-Y', $total); } $area=$IdAreasUs; /* $query_area = " SELECT * FROM areas WHERE id IN ($area)"; $consu_area = $conexion -> query($query_area); $execu_area = $consu_area->fetch_array(MYSQLI_BOTH); $nombre_area = $execu_area["descripcion"]; */ ?> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/r/dt/jq-2.1.4,jszip-2.5.0,pdfmake-0.1.18,dt-1.10.9,af-2.0.0,b-1.0.3,b-colvis-1.0.3,b-html5-1.0.3,b-print-1.0.3,se-1.0.1/datatables.min.css"/> <script type="text/javascript" src="https://cdn.datatables.net/r/dt/jq-2.1.4,jszip-2.5.0,pdfmake-0.1.18,dt-1.10.9,af-2.0.0,b-1.0.3,b-colvis-1.0.3,b-html5-1.0.3,b-print-1.0.3,se-1.0.1/datatables.min.js"></script> <div class="page-title"> <div class="title_left"> <h3>Cotizaciones<small> <?php //echo $nombre_area;?></small></h3> </div> <div class="title_right"> <div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search"> </div> </div> </div> <div class="clearfix"></div> <div class="row"> <div class="col-md-12"> <div class="x_panel"> <div class="x_content"> <div class="row"> <div class="col-sm-12"> <div class="card-box table-responsive"> <!--<table id="datatable-buttons" class="table table-striped table-bordered" style="width:100%">--> <table id="datatable-buttons1" class="table table-striped table-bordered" style="width:100%"> <thead> <tr> <th>#Cot</th> <th>Referencia</th> <th>Cliente</th> <th>Direccion</th> <th>Email</th> <th>F.Creada</th> <th>Total</th> <th>Procesar</th> </tr> </thead> <tbody> <?php $query_ordenes = " SELECT * FROM quotes ORDER BY fecha_creacion DESC"; $consu_ordenes = $conexion -> query($query_ordenes); while($execu_ordenes = $consu_ordenes->fetch_array(MYSQLI_BOTH)){ $cont=0; $email_cliente="N/A"; $nombre_cliente="N/A"; if($execu_ordenes["telefono"]!=''){ $telefono = $execu_ordenes["telefono"]; }else{ $telefono="N/A"; } if($execu_ordenes["id_envio"]!=''){ $direccion = $execu_ordenes["id_envio"]; $query_clientesd = " SELECT * FROM clientes_ship WHERE id =".$direccion; $consu_clientesd = $conexion -> query($query_clientesd); $execu_clientesd = $consu_clientesd->fetch_array(MYSQLI_BOTH); $direccion_cliente = $execu_clientesd["calle"].' '.$execu_clientesd["numero"]; //$email_cliente = $execu_clientes["correo"]; }else{ $direccion_cliente="N/A"; } if($execu_ordenes["id_cliente"]!=null){ $cliente = $execu_ordenes["id_cliente"]; $query_clientes = " SELECT * FROM clientes WHERE id =".$cliente; $consu_clientes = $conexion -> query($query_clientes); $execu_clientes = $consu_clientes->fetch_array(MYSQLI_BOTH); $nombre_cliente = $execu_clientes["nombre"].' '.$execu_clientes["a_paterno"].' '.$execu_clientes["a_materno"]; $email_cliente = $execu_clientes["correo"]; $cont++; }else{ $cliente="N/A"; $nombre_cliente="Contacto: ".$execu_ordenes["contacto"]."<br/>Telefono: ".$execu_ordenes["telefono"]."<br/>Email: ".$execu_ordenes["email"]; } if($execu_ordenes["total"]!='' && $execu_ordenes["total"]!=null){ $total = $execu_ordenes["total"]; }else{ $total="N/A"; } if($execu_ordenes["fecha_creacion"]!=''){ $fecha_creacion = $execu_ordenes["fecha_creacion"]; }else{ $fecha_creacion="N/A"; } if($execu_ordenes["referencia"]!=''){ $referencia = $execu_ordenes["referencia"]; }else{ $referencia="N/A"; } $cont=0; $query_ordenes1 = " SELECT * FROM quote_lines WHERE id_cotizacion='".$execu_ordenes["id_cotizacion"]."'"; $consu_ordenes1 = $conexion -> query($query_ordenes1); $cont = mysqli_num_rows($consu_ordenes1); if( $cont > 0 ){ $Color="#D5FFCC"; }else{ $Color="#FFCCCC"; } ?> <tr style="background-color:<?php echo $Color;?>"> <td> <a <?php if( $cont <= 0 ){?> href="index.php?md=14&IdC=<?php echo $execu_ordenes['id_cotizacion']?>" <?php }else{?> href="index.php?md=14&IdC=<?php echo $execu_ordenes['id_cotizacion']?>&ED=SI" <?php }?> >C<?php echo str_pad($execu_ordenes['id_cotizacion'], 5, "0", STR_PAD_LEFT);?> </a> </td> <td><?php echo $referencia?></td> <td><?php echo $nombre_cliente?></td> <td><?php echo $direccion_cliente?></td> <td><?php echo $email_cliente?></td> <td data-sort='" <?php strtotime( $fecha_creacion ) ?> "'><?php echo date('d-m-Y H:i',strtotime($fecha_creacion))?></td> <td><?php if($execu_ordenes["total"]!='' && $execu_ordenes["total"]!=null){ echo "$".number_format($total,2); }else{ echo $total; }?> </td> <td> <?php if( $cont > 0 ){ ?> <a href="javascript:void(0);" onclick="ConfirmarPedido(<?php echo $execu_ordenes['id_cotizacion']?>)" > <i class="fa fa-refresh"></i> </a> <?php }else{ ?> test <?php } ?> </td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> <script> $(document).ready(function() { $("#datatable-buttons1").DataTable({ "bPaginate": true, order: [[5, 'desc']], "pageLength": 25, dom: "lBfp", //lfrti "buttons": [ { extend: 'collection', text: 'Exportar', buttons: [ 'copy', 'excel', 'csv', 'pdf', 'print' ], className: "btn btn-round btn-success" } ] }); }); function ConfirmarPedido(IdOrden){ if(IdOrden!=''){ let Resp = confirm("¿Estas seguro que deseas procesa a pedido esta cotizacion?"); if(Resp){ var fda = new FormData(); fda.append("IdOrden", IdOrden); $.ajax({ url: '../models/orders/ProcesarOrder.php', type: 'post', data: fda, contentType: false, processData: false, dataType: 'json', async:false, success: function(response){ if(response.detail != 'success'){ toastr.error(response.message); $("#loading_spinner").css({"display":"none"}); }else{ $("#loading_spinner").css({"display":"none"}); var delayInMilliseconds = 1000; toastr.success(response.message); setTimeout(function() { window.location.href="index.php?md=2&Dep=1"; }, delayInMilliseconds); } } }); } }else{ toastr.error('Ingrese ID de orden'); } } </script>
| ver. 1.4 |
Github
|
.
| PHP 8.2.22 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка