����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 216.73.216.116 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/application/customer2/ |
Upload File : |
<?php session_start(); 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 = []; //get_contract if($method == 'get_contract'){ $contract = $_POST['id_item']; $pos = new pos(); $list = $pos->getByIdClientContract($contract); //print_r($list[1]['contract']); //comparamos contrato si existe if($list[1]['contract'] == $contract){ $retval['error'] = true; }else{ $retval['error'] = false; } $retval['status'] = $list[0]; $retval['data'] = $list[1]; echo json_encode($retval); } //editamos el aval datos generales if($method == 'editAval'){ $indice_aval = $_POST['indice_aval']; $contract = $_POST['contract']; $name = $_POST['name']; $relationship = $_POST['relationship']; $direction = $_POST['direction']; $country = $_POST['country']; $colonia = $_POST['colonia']; $phone = $_POST['phone']; $pos = new pos(); $edit = $pos->updateAval($name,$relationship,$colonia,$direction,$country,$phone,$contract,$indice_aval); $retval['result'] = $edit[0]; $retval['message'] = $edit[1]; echo json_encode($retval); } //editamos el cliente datos generales if($method == 'agregar_aval2'){ $contract = $_POST['contract']; $pos = new pos(); $dataD = $pos->getEndorsementContract2($contract); //print_r($dataD); $pos = new pos(); $data = $pos->getEndorsementAval2($dataD[1]["aval2"]); $retval['result'] = $data[0]; $retval['data'] = $data[1]; echo json_encode($retval); } if($method == 'check_cancelC'){ /* contract:contract, crud:crud, fechab:fechab, txtreason: txtreason, */ $contract = $_POST['contract']; $fechab = $_POST['fechab']; $txtreason = $_POST['txtreason']; if($_POST['crud']=='B'){ $pos = new pos(); //registramos en tabla customer_terminated $delete = $pos->saveTerminatedCustomer($contract,$txtreason,$fechab); //actualizamos cancelacion $posU = new pos(); $array = $posU->updatecustomer($contract,$fechab); } $retval['result2'] = $array[0]; $retval['error'] = $array[1]; $retval['result'] = $delete[0]; $retval['message'] = $delete[1]; echo json_encode($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); } //lista de datos de emplo de cliente 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 == 'getdataJob' ){ $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->getByIdClientContract($key['contract']); $nombre = $cliente[1]; if( $key['payment_frequency'] == 1 ) {$periodo = "semanal";} if( $key['payment_frequency'] == 2 ) {$periodo = "Catorcena";} if( $key['payment_frequency'] == 3 ) {$periodo = "Quincenal";} if( $key['payment_frequency'] == 4 ) {$periodo = "Mensual";} if( $key['payment_frequency'] == 0 ) {$periodo = "semanal";} $data[$i]['payment_frequency'] = '<a>'.$periodo."</a>"; $data[$i]['contract'] = '<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); } //traemos el registro ultimo de aval id if($method == 'get_avalActual_id'){ $avalActual_id = $_POST['avalActual_id']; $posA = new pos(); $resultA = array(); $queryA = $posA->getMaxAval(); $dataA = $queryA[1]; //aumentamos en 1 para el proximo id $idMax = $dataA['id'] + 1; $retval['result'] = $insert[0]; $retval['error'] = $insert[1]; $retval['idMax'] = $idMax; echo json_encode($retval); } //editamos el cliente datos generales if($method == 'edit_customer_collector'){ $contract = $_POST['contract']; $colector_id = $_POST['colector_id']; $pos = new pos(); $edit = $pos->updateClient_colector($contract,$colector_id); $retval['status'] = $edit[0]; $retval['message'] = $edit[1]; echo json_encode($retval); } //editamos el cliente datos generales if($method == 'edit_customer'){ $id_cust = $_POST['id_cust']; $contract = $_POST['contract']; $nombre = $_POST['name']; $conyugue = $_POST['conyugue']; $direccion= $_POST['direccion']; $come_in = $_POST['come_in']; $telefono = $_POST['phone']; $credito = $_POST['cbo_credit']; $poblacion = $_POST['poblacion']; $pos = new pos(); $edit = $pos->updateClient($id_cust,$contract,$nombre,$conyugue,$direccion,$come_in,$telefono,$credito,$poblacion); $retval['status'] = $edit[0]; $retval['message'] = $edit[1]; echo json_encode($retval); } //editamos datos adicionales de empleo de cliente if($method == 'edit_cobranza'){ $cont = $_POST['cont']; $workplace = $_POST['workplace']; $laborOld = $_POST['laborOld']; $laborOld_periodicity = $_POST['laborOld_periodicity']; $salary= $_POST['salary']; $payment_periodicity = $_POST['payment_periodicity']; $pos = new pos(); $edit = $pos->updateCobranza1($cont,$workplace,$laborOld,$laborOld_periodicity,$salary,$payment_periodicity); $retval['status'] = $edit[0]; $retval['message'] = $edit[1]; echo json_encode($retval); } //editamos datos adicionales de empleo de cliente if($method == 'edit_cobranza1'){ $contract = $_POST['cont']; $txtclientA = $_POST['txtclientA']; $salary = $_POST['txtsalary']; $workplace = $_POST['txtworkplace']; $laborOld = $_POST['txtlaborOld']; $laborOld_periodicity = $_POST['txtlaborOld_periodicity']; $payment_periodicity= $_POST['txtpayment_periodicity']; $pos = new pos(); //(cont,txtclientA,txtworkplace,txtsalary,txtlaborOld,txtlaborOld_periodicity,txtpayment_periodicity) $edit = $pos->updateCobranza1($contract,$workplace,$salary,$laborOld,$laborOld_periodicity,$payment_periodicity); $retval['status'] = $edit[0]; $retval['message'] = $edit[1]; echo json_encode($retval); } //editamos datos adicionales de empleo de cliente if($method == 'edit_cobranzaADI'){ /* id_client : id_client, payday : payday, min_pay:min_pay, paydate:paydate, payment_period:payment_period */ $contract = $_POST['cont']; $payday = $_POST['payday']; $min_pay = $_POST['min_pay']; $paydate = $_POST['paydate']; $payment_period= $_POST['payment_period']; $pos = new pos(); $edit = $pos->updateCobranza2($contract,$payday,$min_pay,$paydate,$payment_period); $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') { $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']; $id_collector = $_POST['id_seller']; $pos = new pos(); if($_POST['crud'] == 'N') { $array = $pos->saveClient($nombre,$contrato,$id_collector,$conyugue,$direccion,$come,$credito,$poblacion, $telefono); if($array[0] == true) { $result['ceksat'] = true; //obtenemos el ultimo id de cliente que se acaba de generar por contrato $posCustomer = new pos(); $ClienteID = $posCustomer->getCustomer($contrato); //print_r($ClienteID[1]); } $result['result'] = $array[0]; } else { $id_cust = $_POST['id_cust']; $array = $pos->updateClient($id_cust,$nombre,$contrato,$conyugue,$direccion,$come,$credito,$poblacion, $telefono); $result['result'] = $array[0]; echo "Aqui"; } $result['error'] = $array[1]; $result['crud'] = $_POST['crud']; $result['id_client'] =$ClienteID[1]['id_cust']; 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']; $contract= $_POST['contract']; $pos = new pos(); $insert = $pos->saveAval($name,$relationship,$colonia,$direction,$customer_id,$country,$phone,$contract); $retval['result'] = $insert[0]; $retval['error'] = $insert[1]; //$retval['xsale_id'] = $insert[2]; echo json_encode($retval); } //registro de datos de trabajo del cliente if($method == 'saveadicionales') { //$id_cust = $_POST['txtcode']; $id_client = $_POST['id_client']; $workplace = $_POST['workplace']; $laborOld = $_POST['laborOld']; $salary = $_POST['salary']; $avales= "Avales"; $payment_frequency= $_POST['payment_periodicity']; //$laborOld_periodicity= $_POST['laborOld_periodicity']; $id_user = $_SESSION['pos_id']; $created_at=date('Y-m-d'); $endorsenments1="Aval 1"; $endorsenments2="Aval 2"; $pos = new pos(); $insert = $pos->saveJob($workplace,$id_client,$laborOld,$salary,$payment_frequency ,$endorsenments1,$endorsenments2,$id_user,$created_at); $retval['result'] = $insert[0]; $retval['error'] = $insert[1]; echo json_encode($retval); } //datos para guardar registro en tabla collection if($method == 'saveadicionales2') { // contrato $contrato = $_POST['contract']; $id_cust = $_POST['id_client']; $payday = $_POST['payday']; $payment_period = $_POST['payment_period']; $min_pay = $_POST['min_pay']; $paydate = $_POST['paydate']; $pos = new pos(); $insert = $pos->saveAdicionales2($id_cust, $payday,$payment_period,$min_pay,$contrato,$paydate); $retval['result'] = $insert[0]; $retval['error'] = $insert[1]; $retval['id_client'] = $contrato; echo json_encode($retval); } //datos de cobranza collection //datos de cobranza if($method == 'getdataColecction' ){ $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'] = $periodo; $data[$i]['dias'] = $dia; $data[$i]['cliente'] = '<a href="#">'.$nombre['name'].'</a>'; $data[$i]['button'] = '<button type="submit" id_item="'.$key['id_cust'].'" title="Eliminar Registro" 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); } }else{ header("HTTP/1.1 401 Unauthorized"); exit; }