����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 216.73.216.229 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/muebles/mueblesOLDMAYO/applicationOLD/customer2/ |
Upload File : |
<?php include "../model/dbconn.php"; include "../model/clientes.php"; require_once ("../model/pos.php"); function display_to_sql($date){ return substr($date,6,4).'-'.substr($date,3,2).'-'.substr($date,0,2); } if( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && ( $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' ) ) { $method=$_POST['method']; $dtbs = new sql(); $retval = []; if($method == 'list_customer'){ $list = $dtbs->list_customer(); $retval['status'] = $list[0]; $retval['message'] = $list[1]; $retval['data'] = $list[2]; echo json_encode($retval); } if($method == 'list_customer2'){ $list = $dtbs->list_customer2(); $retval['status'] = $list[0]; $retval['message'] = $list[1]; $retval['data'] = $list[2]; echo json_encode($retval); } if($method == 'list_job'){ $list = $dtbs->list_job(); $retval['status'] = $list[0]; $data = $list[2]; $retval['message'] = $list[1]; $retval['data'] = $list[2]; echo json_encode($retval); } //datos de empleo de cliente if($method == 'getdata' ){ $list = $dtbs->list_job(); $retval['status'] = $list[0]; $data = $list[2]; $i=0; foreach ($data as $key) { //hacemos consulta de cliente por nombre $posUser = new pos(); $cliente = $posUser->getByIdClient($key['id_client']); $nombre = $cliente[1]; if( $key['payment_periodicity'] == 1 ) {$periodo = "semanal";} if( $key['payment_periodicity'] == 2 ) {$periodo = "Catorcena";} if( $key['payment_periodicity'] == 3 ) {$periodo = "Quincenal";} if( $key['payment_periodicity'] == 4 ) {$periodo = "Mensual";} $data[$i]['payment_periodicity'] = '<a>'.$periodo."</a>"; $data[$i]['cliente'] = '<a>'.$nombre['name']."</a>"; $data[$i]['button'] = ' <button type="submit" id_item="'.$key['id_cust'].'" unit="'.$key['id_cust'].'" class="btn btn-primary btndelete btn-sm" id="btndeletes'.$key['id_cust'].'" ><i class="fa fa-remove"></i></button>'; $i++; } $datax = array('data' => $data); echo json_encode($datax); } //datos de cobranza if($method == 'getdataC' ){ $list = $dtbs->list_col(); $retval['status'] = $list[0]; $data = $list[2]; $i=0; foreach ($data as $key) { //hacemos consulta de cliente por nombre $posUser = new pos(); $cliente = $posUser->getByIdClient($key['id_client']); $nombre = $cliente[1]; $dia="No-asignado"; if( $key['payday'] == 1 ) {$dia = "lunes";} if( $key['payday'] == 2 ) {$dia = "martes";} if( $key['payday'] == 3 ) {$dia = "miercoles";} if( $key['payday'] == 4 ) {$dia = "jueves";} if( $key['payday'] == 5 ) {$dia = "viernes";} if( $key['payday'] == 6 ) {$dia = "sabado";} if( $key['payday'] == 7 ) {$dia = "domingo";} $periodo="No-asignado"; if( $key['txtpayment_period'] == 1 ) {$periodo = "semanal";} if( $key['txtpayment_period'] == 2 ) {$periodo = "Catorcena";} if( $key['txtpayment_period'] == 3 ) {$periodo = "Quincenal";} if( $key['txtpayment_period'] == 4 ) {$periodo = "Mensual";} $data[$i]['periodo'] = '<a href="#" class="client_details"<u>'.$periodo."</u></a>"; $data[$i]['dias'] = '<a href="#" class="client_details"<u>'.$dia."</u></a>"; $data[$i]['cliente'] = '<a>'.$nombre['name']."</a>"; $data[$i]['button'] = ' <button type="submit" id_item="'.$key['id_cust'].'" unit="'.$key['id_cust'].'" class="btn btn-primary btndelete btn-sm" id="btndeletes'.$key['id_cust'].'" ><i class="fa fa-remove"></i></button>'; $i++; } $datax = array('data' => $data); echo json_encode($datax); } //datos de avales de cliente if($method == 'getdataAvales' ){ $list = $dtbs->list_customer(); $retval['status'] = $list[0]; $data = $list[2]; $i=0; foreach ($data as $key) { $data[$i]['cliente'] = '<a>'.$key['name']."</a>"; $data[$i]['aval'] = '<a>'.$key['conyugue']."</a>"; $data[$i]['direccion'] = '<button type="submit" class="client_details"<a>'.$key['direccion']."</a></button>"; $data[$i]['Parentezco'] = "<span>Familiar</span>"; $data[$i]['Direccion'] = '<span>'.$key['poblacion']."</span>"; $data[$i]['Telefono'] = '<span>'.$key['phone']."</span>"; $data[$i]['Ciudad'] = '<span class="client_details"<a>'.$key['poblacion']."</span>"; $data[$i]['button'] = ' <button type="submit" id_item="'.$key['id_cust'].'" unit="'.$key['id_cust'].'" class="btn btn-primary btndelete btn-sm" id="btndeletes'.$key['id_cust'].'" ><i class="fa fa-remove"></i></button>'; $i++; } $datax = array('data' => $data); echo json_encode($datax); } //editamos el cliente datos generales if($method == 'edit_customer'){ $contract = $_POST['contract']; $nombre = $_POST['nombre']; $conyugue = $_POST['conyugue']; $direccion= $_POST['direccion']; $come_in = $_POST['come_in']; $telefono = $_POST['telefono']; $credito = $_POST['credito']; $poblacion = $_POST['poblacion']; $edit = $dtbs->edit_client($contract,$nombre,$conyugue,$direccion,$come_in,$telefono,$credito,$poblacion); $retval['status'] = $edit[0]; $retval['message'] = $edit[1]; echo json_encode($retval); } if($method == 'delete_customer'){ $id_cust = $_POST['id_cust']; $delete = $dtbs->delete_customer($id_cust); $retval['status'] = $delete[0]; $retval['message'] = $delete[1]; echo json_encode($retval); } if($method == 'saveClient') { $id_cust = $_POST['txtcode']; $contrato = $_POST['contrato']; $nombre = $_POST['nombre']; $conyugue = $_POST['conyugue']; $direccion= $_POST['direccion']; $come = $_POST['come']; $telefono = $_POST['telefono']; $credito = $_POST['credito']; $poblacion = $_POST['poblacion']; $crud=$_POST['crud']; $pos = new pos(); if($_POST['crud'] == 'N') { $array = $pos->saveClient($nombre,$contrato,$conyugue,$direccion,$come,$credito,$poblacion, $telefono); if($array[0] == true) { $result['ceksat'] = true; } $result['result'] = $array[0]; } else { if($price>0){ $array = $pos->updateClient($id_cust,$nombre,$contrato,$conyugue,$direccion,$come,$credito,$poblacion, $telefono); $result['result'] = $array[0]; }else{ $result['result'] = false; } } $result['error'] = $array[1]; $result['crud'] = $_POST['crud']; echo json_encode($result); } if($method == 'saveAval') { $name = $_POST['name']; $relationship= $_POST['relationship']; $colonia= $_POST['colonia']; $direction= $_POST['direction']; $customer_id= $_POST['customer_id']; $country= $_POST['country']; $phone= $_POST['phone']; $pos = new pos(); $insert = $pos->saveAval($name,$relationship,$colonia,$direction,$customer_id,$country,$phone); $retval['result'] = $insert[0]; $retval['error'] = $insert[1]; //$retval['xsale_id'] = $insert[2]; echo json_encode($retval); } if($method == 'saveadicionales') { $id_cust = $_POST['txtcode']; $id_client = $_POST['id_client']; $workplace = $_POST['workplace']; $laborOld = $_POST['laborOld']; $salary = $_POST['salary']; $avales= $_POST['avales']; $payment_periodicity= $_POST['payment_periodicity']; $pos = new pos(); $insert = $pos->saveAdicionales($workplace,$laborOld,$salary,$payment_periodicity,$avales, $id_client); $retval['result'] = $insert[0]; $retval['error'] = $insert[1]; $retval['xsale_id'] = $insert[2]; echo json_encode($retval); } if($method == 'saveadicionales2') { $id_client = $_POST['id_client']; $payday = $_POST['payday']; $payment_period = $_POST['payment_period']; $min_pay = $_POST['min_pay']; $pos = new pos(); $insert = $pos->saveAdicionales2($id_client, $payday,$payment_period,$min_pay); $retval['result'] = $insert[0]; $retval['error'] = $insert[1]; $retval['id_client'] = $_POST['id_client']; echo json_encode($retval); } }else{ header("HTTP/1.1 401 Unauthorized"); exit; }