Esempio n. 1
0
<?php

include_once 'dataCommon.php';
/*
 * dataCommon.php comparte los datos mas relevantes y los 
 * objetos mas utilizados como session,adodb, etc.
 */
$mensaje1 = "<br/><font color='red'><b>El comentario tiene menos de 20 caracteres</b></font>";
$mensaje2 = "<br/><font color='#377584'><b>Se creo el nuevo soporte</b></font>";
echo $come_sop;
$coment = strValido($come_sop);
$fechasistema = $db->conn->OffsetDate(0, $db->conn->sysTimeStamp);
if (strlen($coment) > 20) {
    switch ($db->driver) {
        case 'oci8':
            $sqlIns = " INSERT INTO         \n                                SGD_SOP_SOPORTE(\n                                       SGD_SOP_ID\n                                     , USUA_CODI\n                                     , DEPE_CODI\n                                     , SGD_SOP_COMENT                                 \n                                     , SGD_TSOP_ID\n                                     , SGD_SOP_FECHAINI)\n                    \n                                VALUES (\n                                       SEC_SOP_ID.nextval \n                                     , {$codusuario}\n                                     , {$depenUsua}\n                                     , '{$coment}'\n                                     , {$selectTipSop}\n                                     , (select sysdate from dual)                                 \n                                    )";
        default:
            $sqlIns = " INSERT INTO         \n                                SGD_SOP_SOPORTE(\n                                       SGD_SOP_ID\n                                     , USUA_CODI\n                                     , DEPE_CODI\n                                     , SGD_SOP_COMENT                                 \n                                     , SGD_TSOP_ID\n                                     , SGD_SOP_FECHAINI)\n                    \n                                VALUES (\n                                       nextval('sgd_sop_soporte_sgd_sop_id_seq')\n                                     , {$codusuario}\n                                     , {$depenUsua}\n                                     , '{$coment}'\n                                     , {$selectTipSop}\n                                     , {$fechasistema}\n                                    )";
    }
    $result = $db->conn->Execute($sqlIns);
    if ($result->EOF) {
        print $mensaje2;
        exit;
    }
} else {
    print $mensaje1;
}
Esempio n. 2
0
//Muestra si existe error
function salirError($mensaje)
{
    $accion = array('respuesta' => false, 'mensaje' => utf8_encode($mensaje));
    print_r(json_encode($accion));
}
//Filtrar caracteres extraños en textos
function strValido($string)
{
    $arr = array('/[^\\w:()\\sáéíóúÁÉÍÓÚ=#\\-,.;ñÑ]+/', '/[\\s]+/');
    $asu = preg_replace($arr[0], '', $string);
    return strtoupper(preg_replace($arr[1], ' ', $asu));
}
//Seleccionar numero del expediente y texto cuando se realiza
//la busqueda de un expediente
$query = strValido($query);
$var1 = strspn($query, "1234567890eE");
$nuExpediente = trim(substr($query, 0, $var1));
//Filtros para buscar y cambiar nombres de expedientes
$selectSerie = empty($selectSerie) ? '' : "SE.SGD_SRD_CODIGO  =  {$selectSerie} \tAND";
$selectSubSerie = empty($selectSubSerie) ? '' : "SE.SGD_SBRD_CODIGO =  {$selectSubSerie} AND";
$ano_busq = empty($ano_busq) ? '' : "SE.SGD_SEXP_ANO \t =  {$ano_busq} \t\tAND";
$selectDepe = empty($selectDepe) ? '' : "SE.DEPE_CODI \t\t =  {$selectDepe} \tAND";
$todos = !empty($todos) ? '' : "SE.SGD_SEXP_ESTADO = \t0 \t\t\t\tAND";
//Filtra los expedientes activos
//Ejecuta acciones que llegan desde adm_nombreTemasExp.js
switch ($evento) {
    case 1:
        //Buscar expedientes
        $query = preg_replace('/^\\s/', '', $query);
        if (strlen($query) == 0) {
Esempio n. 3
0
         print "{$result[$i]}\n";
     }
     break;
     /**
      * buscar nombres a partir del numero del expediente
      * 
      */
 /**
  * buscar nombres a partir del numero del expediente
  * 
  */
 case 5:
     if (empty($nomb_Expe_search)) {
         return;
     }
     $nomb_Expe_search = trim(strValido($nomb_Expe_search));
     $var1 = strspn($nomb_Expe_search, "1234567890eE");
     $nuExpediente = trim(substr($nomb_Expe_search, 0, $var1));
     $sqlE = "\n\t\t\t\t\tSELECT      SE.SGD_SEXP_PAREXP1\n\t\t\t\t\t\t|| ' ' || SE.SGD_SEXP_PAREXP2\n\t\t\t\t\t\t|| ' ' || SE.SGD_SEXP_PAREXP3\n\t\t\t\t\t\t|| ' ' || SE.SGD_SEXP_PAREXP4\n\t\t\t\t\t\t|| ' ' || SE.SGD_SEXP_PAREXP5\n\t\t\t\t\t\tAS EXPEDIENTE\n\t\t\t\t\tFROM SGD_SEXP_SECEXPEDIENTES SE\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t{$com_todos}\n\t\t\t\t\t\t{$com_selectSerie}\t\t\t\t\t\t\n\t\t\t\t\t\t{$com_selectSubSerie}\t\t\n\t\t\t\t\t\t{$com_ano_busq}\t\t\t\n\t\t\t\t\t\t{$com_selectDepe}\t\n\t\t\t\t\t\tSE.SGD_EXP_NUMERO LIKE '{$nuExpediente}'";
     /* Original Julian $sqlE  = "
                        SELECT      SE.SGD_SEXP_PAREXP1
                                || ' ' || SE.SGD_SEXP_PAREXP2
                                || ' ' || SE.SGD_SEXP_PAREXP3
                                || ' ' || SE.SGD_SEXP_PAREXP4
                                || ' ' || SE.SGD_SEXP_PAREXP5
                                AS EXPEDIENTE
                        FROM SGD_SEXP_SECEXPEDIENTES SE
                        WHERE
                                $com_todos
                                $com_selectSerie
                                $com_selectSubSerie
Esempio n. 4
0
<?php

include_once 'dataCommon.php';
/*
 * dataCommon.php comparte los datos mas relevantes y los 
 * objetos mas utilizados como session,adodb, etc.
 */
$mensaje1 = "<br/><font color='red'><b>El comentario tiene menos de 20 caracteres</b></font>";
$mensaje2 = "<br/><font color='#377584'><b>Se creo el nuevo comentario</b></font>";
$mensaje3 = "<br/><font color='red'><b>No se cerro el ticket</b></font>";
$mensaje4 = "<br/><font color='#377584'><b>Se cerro el ticket</b></font>";
$coment = strValido($comentario);
$accion = $ticket . '_coment';
$fechasistema = $db->conn->OffsetDate(0, $db->conn->sysTimeStamp);
/** 
    if(strlen($coment) < 20){
        print($mensaje1);
        exit;
    }
    **/
$id_Sec = $db->conn->GenID('sgd_csop_coment_sgd_csop_id_seq');
$sqlIns = " INSERT INTO         \n                        SGD_CSOP_COMENT(\n                               SGD_CSOP_ID\n                              ,USUA_CODI\n                              ,DEPE_CODI                                  \n                              ,SGD_CSOP_COMENT\n                              ,SGD_CSOP_FECHA\n                              ,SGD_SOP_ID)\n            \n                        VALUES (\n                               {$id_Sec}\n                             , {$codusuario}\n                             , {$depenUsua}\n                             , '{$coment}'\n                             , {$fechasistema}\n                             , {$ticket}                                                                  \n                            )";
$result = $db->conn->Execute($sqlIns);
if ($result->EOF) {
    print $mensaje2;
}
if ('Comentar' != ${$accion}) {
    $sqlInsE = "  UPDATE \n                            SGD_SOP_SOPORTE\n                        SET \n                            SGD_SOP_EST = 1,\n                            SGD_SOP_FECHAFIN = {$fechasistema} \n                        WHERE \n                            SGD_SOP_ID = {$ticket}";
    $result2 = $db->conn->Execute($sqlInsE);
    if ($result2->EOF) {
        print $mensaje4;