Пример #1
0
 public function desuscribirse(array $datos)
 {
     $fecha = isset($datos["fecha"]) ? $datos["fecha"] : date('Y-m-d H:i:s');
     // guardo la desuscripcion
     $sql = "update acsa_tickets_suscripcion set estado='0' where ticket_id = '" . mysql_real_escape_string($datos['ticket_id']) . "' and staff_id = '" . mysql_real_escape_string($datos['staff_id']) . "'";
     executeQuery($sql, $this->conn);
     // guardo el historial
     $historial = new Historial();
     $historial->guardarHistorial(array('ticket_id' => $datos['ticket_id'], 'staff_id' => $datos['staff_id'], 'descripcion' => 'Desuscripción al Trámite'));
 }
Пример #2
0
 public function guardarCitacion(array $datos)
 {
     $fecha = isset($datos["fecha"]) ? $datos["fecha"] : 'now()';
     // guardo la citacion
     $sql = "insert into acsa_citacion(id,cliente_id,citacion_tipo,citacion_plantilla,citacion_email,ticket_id,staff_id,fecha) values (\r\n                '',\r\n                '" . mysql_real_escape_string($datos['cliente_id']) . "',\r\n                '" . mysql_real_escape_string($datos['citacion_tipo']) . "',\r\n                '" . mysql_real_escape_string($datos['citacion_plantilla']) . "',\r\n                '" . mysql_real_escape_string($datos['citacion_email']) . "',\r\n                '" . mysql_real_escape_string($datos['ticket_id']) . "',\r\n                '" . mysql_real_escape_string($datos['staff_id']) . "',\r\n                '" . mysql_real_escape_string($fecha) . "'\r\n                )";
     executeQuery($sql, $this->conn);
     $var_citacion_id = mysql_insert_id($this->conn);
     $this->cargarCitacion($var_citacion_id);
     // guardo el historial
     $historial = new Historial();
     $historial->guardarHistorial(array('citacion_id' => $var_citacion_id, 'cliente_id' => $datos['cliente_id'], 'ticket_id' => $datos['ticket_id'], 'staff_id' => $datos['staff_id'], 'descripcion' => 'Se creo una nueva Citacion al ticket'));
     // envio el mail
     if ($datos['citacion_tipo'] == 2) {
         $this->enviarEmail();
     }
 }
Пример #3
0
 public function historial($option)
 {
     $historial = new Historial();
     switch ($option) {
         case '1':
             $historial->basicsProductos();
             break;
         case '2':
             echo Estado::optionEstados();
             break;
         case '3':
             echo $historial->basicsRemitos();
             break;
         default:
             # code...
             break;
     }
 }
Пример #4
0
 public function guardarAlarma(array $datos)
 {
     // formatear fecha y hora
     if ($datos["alarmaInput"] != "") {
         $alarmaFecha = explode('/', $datos["alarmaInput"]);
         $alarmaFecha = $alarmaFecha[2] . '-' . $alarmaFecha[1] . '-' . $alarmaFecha[0] . ' ' . $datos["alarmaInput_hora"] . ':' . $datos["alarmaInput_min"] . ':00';
     } else {
         $alarmaFecha = '0000-00-00 00:00:00';
     }
     if ($datos["alarmaInput_1"] != "") {
         $alarmaAviso = explode('/', $datos["alarmaInput_1"]);
         $alarmaAviso = $alarmaAviso[2] . '-' . $alarmaAviso[1] . '-' . $alarmaAviso[0] . ' ' . $datos["alarmaInput_1_hora"] . ':' . $datos["alarmaInput_1_min"] . ':00';
     } else {
         $alarmaAviso = '0000-00-00 00:00:00';
     }
     // guardo la alarma
     $sql = "update sptbl_tickets SET\r\n                alarmaFecha = '" . mysql_real_escape_string($alarmaFecha) . "',\r\n                alarmaAviso = '" . mysql_real_escape_string($alarmaAviso) . "'\r\n                where nTicketId = '" . $datos["ticket_id"] . "'";
     executeQuery($sql, $this->conn);
     // guardo el historial
     $historial = new Historial();
     $historial->guardarHistorial(array('ticket_id' => $datos['ticket_id'], 'staff_id' => $datos['staff_id'], 'descripcion' => 'Se creo una nueva Alarma al ticket', 'show_in_ticket' => $datos["var_show_ticket"]));
 }
Пример #5
0
        $contrato       = mysql_fetch_array( $result_contra );
    }

    // asesor
    if ( $var_asesor != 0 ) {
        $sql_user       = "******". mysql_real_escape_string($var_asesor) ."' limit 1";
        $result_user    = executeSelect( $sql_user, $conn );
        $asesor         = mysql_fetch_array( $result_user );
    }

    // citacion
    $citacion       = new Citacion();
    $var_citacion   = $citacion->cargarCitacion('',mysql_real_escape_string($var_ticketid));

    // historial
    $historial      = new Historial();
    $var_historial  = $historial->cargarHistorial('',mysql_real_escape_string($var_ticketid),'','','',1);

    // suscriptos
    $suscripcion    = new Suscripcion();
    $suscriptores   = $suscripcion->getSuscriptores( mysql_real_escape_string($var_ticketid) );


}//if main


$consultaCom = "Select * from sptbl_datosContratos where idContrato=". $var_contrato_totvs;
$rsCom = executeSelect($consultaCom,$conn);

print_r($rsCom);
Пример #6
0
<?php

require_once 'inc/header.php';
if (isset($_POST['submit'])) {
    $collection = Historial::filtrar();
} else {
    $historial = new Historial();
    $collection = $historial->getById();
}
?>
		
	<!--detalle productos-->
	<div class="historial-productos col-xs-12 col-sm-12 col-md-12 ol-lg-12">

		<!--head-page-->
		<div class="head-page col-xs-12 col-sm-12 col-md-12 ol-lg-12">
		<form action="" method="POST">
			<div class="filtros">
				<p class="text-uppercase">filtro</p>
				<select name="" id="findBy">
					<option value="">Seleccione una opcíon</option>
					<option class="opciones" value="1">Productos</option>
					<option class="opciones" value="2">Estado</option>
					<option class="opciones" value="3">Remito</option>
					<option class="opciones" value="4">Fecha</option>
				</select>
				<select name="dynamicName" id="results">
					
				</select>
				<input type="date" class="hidden" id="date" name="date">
			</div>
Пример #7
0
    }
});
Route::post("/ajax", function () {
    if (User::Auth()) {
        switch (Input::get('get')) {
            case 'categorias':
                Categoria::Ajax(Input::get('func'));
                break;
            case 'productos':
                Producto::Ajax(Input::get('func'));
                break;
            case 'pedidos':
                Pedido::Ajax(Input::get('func'));
                break;
            case 'historial':
                Historial::Ajax(Input::get('func'));
                break;
            default:
                # code...
                break;
        }
    }
});
Route::post("/auth", function () {
    switch (Input::get('get')) {
        case 'login':
            $credentials = array("email" => e(Input::get("username")), "password" => e(Input::get("password")));
            if (Auth::attempt($credentials, true, true)) {
                echo "true";
            } else {
                echo "false";
Пример #8
0
 private function getParametros(Historial $mat)
 {
     $parametros = array(':idPersona' => $mat->getIdPersona(), ':idMateria' => $mat->getIdMateria(), ':jornada' => $mat->getJornada(), ':definitiva' => $mat->getDefinitiva(), ':anoLectivo' => $this->getAnoLectivo());
     return $parametros;
 }
<?php

require_once '../data/dataBase.php';
require_once '../clases/cRenovacion.php';
require_once '../clases/cHistorial.php';
//variables POST
$renovacion = new Renovacion();
$historial = new Historial();
$numSolRen = $_POST['idRen'];
$estado_idEst = 7;
$estado_M = 3;
$numFactRen = $_POST['numFactRen'];
$fchaPagRen = $_POST['fchaPagRen'];
$montoRen = $_POST['montoRen'];
$banco_idBanc = $_POST['banco_idBanc'];
$miembro_nisMiem = $_POST['miembro_nisMiem'];
$grupo_idGrup = $_POST['idGrup'];
$usuario = $_POST['usuario'];
$obserCamEst = "Validacion de Renovacion";
try {
    //subida de imagen
    $ruta_carpeta = "../../";
    $ruta_DB = "../";
    $archivo = $_FILES['imagen']['tmp_name'];
    $nombreArchivo = $_FILES['imagen']['name'];
    move_uploaded_file($archivo, $ruta_carpeta . "imagenes/" . $nombreArchivo);
    $rutag = $ruta_DB . "imagenes/" . $nombreArchivo;
    //arrays
    $reg = array($estado_idEst, $numFactRen, $fchaPagRen, $montoRen, $banco_idBanc, $rutag, $miembro_nisMiem);
    $renovacion->actualizar_renovacion($reg);
    $estado = array($estado_M, $miembro_nisMiem);
Пример #10
0
}
if ($_GET["nota"] == 2) {
    cambiarEstadoTramite('insertarNota');
}
if ($_GET["nota"] == 3) {
    cambiarEstadoTramite('eliminarNota');
}
// +----------------------------------------------------------------------+
// | Eliminar Archivo                                                     |
// +----------------------------------------------------------------------+
if ($_GET["delFil"] != "") {
    $ruta = 'uploads/' . $_GET["tk"];
    try {
        @unlink($ruta . '/' . $_GET["delFil"]);
        // guardo el historial
        $historial = new Historial();
        $historial->guardarHistorial(array('ticket_id' => $_GET["tk"], 'staff_id' => $_SESSION["sess_staffid"], 'descripcion' => "Se borro el Archivo " . $_GET['delFil'], 'show_in_ticket' => 1));
        // redirijo
        header("Location: viewticket.php?limitval=0&mt=y&tk=" . $_GET["tk"] . "&us=" . $_GET["us"] . "&stylename=" . $_GET["stylename"] . "&styleminus=" . $_GET["styleminus"] . "&styleplus=" . $_GET["styleplus"] . "&delFilS=1");
        die;
    } catch (Exception $e) {
        // redirijo
        header("Location: viewticket.php?limitval=0&mt=y&tk=" . $_GET["tk"] . "&us=" . $_GET["us"] . "&stylename=" . $_GET["stylename"] . "&styleminus=" . $_GET["styleminus"] . "&styleplus=" . $_GET["styleplus"] . "&delFilE=1");
        die;
    }
}
// +----------------------------------------------------------------------+
// | Eliminar Archivo                                                     |
// +----------------------------------------------------------------------+
include "../includes/docheader.php";
?>
Пример #11
0
 function despublicar()
 {
     Doctrine_Manager::connection()->beginTransaction();
     //Marco el maestro como publicado
     $this->publicado = 0;
     $this->publicado_at = NULL;
     $this->actualizable = 0;
     $this->save();
     //Despublico las versiones;
     $versiones = $this->Versiones;
     foreach ($versiones as $v) {
         if ($v->publicado == 1) {
             $v->publicado = 0;
             $v->publicado_at = NULL;
             $v->save();
             $versionactualizada = $v;
         }
     }
     //Lo escribo en el log
     $log = new Historial();
     $log->descripcion = '<strong>Actualización de Estado de Publicación</strong><br />Versión despublicada';
     $log->Ficha = $this;
     $log->FichaVersion = $versionactualizada;
     $log->UsuarioBackend = UsuarioBackendSesion::usuario();
     $log->save();
     Doctrine_Manager::connection()->commit();
 }
Пример #12
0
     } else {
         // solo una
         if ($citacion["citacion_cliente"] == 1) {
             $citacion["cliente_id"] = $var_userid;
         } elseif ($citacion["citacion_cliente"] == 2) {
             $citacion["cliente_id"] = $var_userid_dos;
         } else {
             // busco el cliente compuesto
             $citacion["cliente_id"] = citacionClienteCompuesto($citacion["citacion_cliente"]);
         }
         $citacionClass->guardarCitacion(array('citacion_tipo' => $citacion["citacion_tipo"], 'citacion_plantilla' => $citacion["citacion_plantilla"], 'ticket_id' => $var_insert_id, 'staff_id' => $var_staffid, 'cliente_id' => $citacion["cliente_id"]));
     }
 }
 // historial de derivar
 if ($derivar_sector != 0) {
     $historial = new Historial();
     $historial->guardarHistorial(array('ticket_id' => $var_ticketid, 'staff_id' => $var_staffid, 'descripcion' => 'El Trámite ha sido derivado', 'derivado' => $derivar_sector, 'show_in_ticket' => 1));
 }
 insertStattics($var_ticketid);
 //update reference number
 //	modified on 15-11-06 by roshith	for constant length ref.no.
 // 'zero' added for 2 digit companyid
 if ($var_compid < 10) {
     $var_compid = "0" . $var_compid;
 }
 $dept_id = $deptid;
 // to send mail
 // 'zero' added for 2 digit departmentid
 if ($deptid < 10) {
     $deptid = "0" . $deptid;
 }
Пример #13
0
 public function consolidadoHistorialIndividualGalois($idSalon, $anio)
 {
     $pdf = new FPDF('P', 'cm', 'Letter');
     $salon = new Salon();
     $sal = $salon->leerSalonePorId($idSalon);
     $grado = new Grado();
     $grad = $grado->leerGradoPorId($sal->getIdGrado());
     $vec = array();
     if ($grad->getIdGrado() == 'p1' || $grad->getIdGrado() == 'p2' || $grad->getIdGrado() == 'p3') {
         $seccion = 'PREESCOLAR';
         $vec = ["PMAT", "PLEC", "ING", "PCN", "PCS", "ER", "EV", "ART", "EF", "COM"];
     } else {
         if ($grad->getIdGrado() == '1' || $grad->getIdGrado() == '2' || $grad->getIdGrado() == '3' || $grad->getIdGrado() == '4' || $grad->getIdGrado() == '5') {
             $seccion = 'BASICA PRIMARIA';
             $vec = ["MAT", "ING", "LC", "CN", "CS", "ER", "INF", "EF", "ART", "EV", "COM"];
         } else {
             if ($grad->getIdGrado() == '6' || $grad->getIdGrado() == '7' || $grad->getIdGrado() == '8' || $grad->getIdGrado() == '9' || $grad->getIdGrado() == '10' || $grad->getIdGrado() == '11') {
                 $seccion = 'BASICA SECUNDARIA';
                 if ($grad->getIdGrado() == '6' || $grad->getIdGrado() == '7' || $grad->getIdGrado() == '8') {
                     $vec = ["AYG", "EST", "ING", "LC", "CN", "GEO", "HIS", "CONS", "ER", "INF", "EF", "ART", "EV", "COM"];
                 } else {
                     if ($grad->getIdGrado() == '9') {
                         $vec = ["ALYG", "EST", "ING", "LC", "CN", "GEO", "HIS", "CONS", "ER", "INF", "EF", "ART", "EV", "COM"];
                     } else {
                         if ($grad->getIdGrado() == '10') {
                             $vec = ["TRI", "EST", "ING", "LC", "QUI", "FIS", "FIL", "CS", "ER", "INF", "EF", "ART", "EV", "COM"];
                         } else {
                             if ($grad->getIdGrado() == '11') {
                                 $vec = ["CALC", "EST", "ING", "LC", "QUI", "FIS", "FIL", "CS", "ER", "INF", "EF", "ART", "EV", "COM"];
                             }
                         }
                     }
                 }
             }
         }
     }
     $persona = new Persona();
     $personas = $persona->leerPorSalonYAnio($idSalon, $anio);
     foreach ($personas as $per) {
         $pdf->AddPage();
         $pdf->SetFont("Arial", "B", 18);
         $pdf->SetXY(1, 1);
         $pdf->cell(19, 1, utf8_decode("CONSOLIDADO FINAL ACADEMICO"), 0, 0, "C");
         $pdf->SetFont("Arial", "B", 15);
         $pdf->SetXY(1, 2);
         $pdf->SetTextColor(255, 0, 0);
         $pdf->cell(19, 1, utf8_decode($per->getPApellido() . " " . $per->getNombres()), 0, 0, "C");
         $pdf->SetXY(1, 3);
         $pdf->SetTextColor(0, 0, 0);
         $pdf->cell(19, 1, utf8_decode("AÑO: " . $anio . ", SALÓN: " . $idSalon), 0, 0, "C");
         //_____________________________
         $x = 6.5;
         $y = 5;
         $pdf->SetXY($x, $y);
         $pdf->SetFont("Arial", "B", 10);
         $pdf->Cell(6, 1, "MATERIA", 1, 0, "C");
         $pdf->SetXY($x + 6, $y);
         $pdf->SetFont("Arial", "B", 10);
         $pdf->Cell(2, 1, "NOTA", 1, 0, "C");
         $cont = 0;
         $sum = 0;
         foreach ($vec as $v) {
             $y++;
             $cont++;
             $pdf->SetFont("Arial", "", 10);
             $nota = new Historial();
             $not = $nota->leerNotaEstudiante($anio, $per->getIdPersona(), $v);
             $mate = new Materia();
             $materias = $mate->leerMateriaPorId($v);
             foreach ($materias as $materia) {
                 $nombreMateria = $materia->getNombreMateria();
             }
             $pdf->SetXY($x, $y);
             $pdf->SetFont("Arial", "B", 10);
             $pdf->Cell(6, 1, $nombreMateria, 1, 0, "C");
             $n = $not->getDefinitiva();
             $pdf->SetXY($x, $y);
             if ($n < 30) {
                 $pdf->SetTextColor(255, 0, 0);
             }
             $pdf->SetXY($x + 6, $y);
             $pdf->SetFont("Arial", "", 10);
             $pdf->Cell(2, 1, $n, 1, 0, "C");
             $pdf->SetTextColor(0, 0, 0);
             $sum += $n;
         }
         $y++;
         $prom = round($sum / $cont, 2);
         $pdf->SetFont("Arial", "B", 14);
         $pdf->SetXY(1, $y);
         $pdf->cell(19, 1, utf8_decode("Promedio: " . $prom), 0, 0, "C");
     }
     $pdf->Output("Consolidado " . $idSalon, "I");
 }
Пример #14
0
function cambiarEstadoTramite($val)
{
    global $conn;
    $query = "";
    $sql_comentario = "";
    $sql = "";
    $sql2 = "";
    if ($val == 'cerrarT') {
        $accion = 'cerrarT';
        $contratoTotvs = mysql_real_escape_string($_GET["ctotvs"]);
        $sector = mysql_real_escape_string($_GET["sector"]);
        //$Recno           =    mysql_real_escape_string($_GET["recno"]);
        $mensaje = mysql_real_escape_string($_GET["mensaje"]);
        $fecha = date("d-m-Y H:i:s");
        if (strlen($mensaje) < 1) {
            $mensaje = "Cerrado el " . $fecha;
        }
        //$sql2 = "DELETE FROM sptbl_datosContratos WHERE idContrato = ".$contratoTotvs;
        $sql2 = "UPDATE sptbl_datosContratos SET cantidadHijos = 0, estadoContrato = 'A' WHERE idContrato =  " . $contratoTotvs;
        $contratoTotvs = trim(sprintf("%06d", $contratoTotvs));
        $sql = "Update sptbl_tickets set vStatus='closed', nClosedStaff='" . $_SESSION["sess_staffid"] . "', nLockStatus='1'\r\n               Where vStatus = 'open' and seccion_id = 6 AND tipo_tramite_id = 24 and nTicketId   < '" . mysql_real_escape_string($_GET["tk"]) . "'\r\n                                                          and contratoTotvs = '" . mysql_real_escape_string($_GET["ctotvs"]) . "' ";
        $sql_comentario = "Update sptbl_tickets set vStatus='closed', nClosedStaff='" . $_SESSION["sess_staffid"] . "', nLockStatus='1', comentario ='" . $mensaje . "' Where nTicketId= ' " . mysql_real_escape_string($_GET["tk"]) . " '";
        $descripcion = $contratoTotvs . 'Se cerraron todos los tickets abiertos del contrato';
        // SI ES DE JURIDICA CREA LA QUERY
        $query = "UPDATE Z30010 SET Z30_ESTADO = 'A', Z30_BLQIMP = 'N' WHERE Z30_CODIGO  =  " . $contratoTotvs . " AND Z30_ESTADO = 'J' ";
        $query2 = "UPDATE SE1010 SET E1_XJURIDI = '' WHERE E1_XJURIDI = 1 and E1_XCONTRA   =  " . $contratoTotvs . " ' ";
        if (mysql_real_escape_string($_GET["hijo"]) >= 0) {
            $descripcion = ' Se cerro el Ticket y los anteriores del contrato, Nota: ' . $mensaje;
        } else {
            $descripcion = ' Se cierra el Ticket, Nota: ' . $mensaje;
        }
    } elseif ($val == 'cerrar') {
        $contratoTotvs = mysql_real_escape_string($_GET["ctotvs"]);
        $sector = mysql_real_escape_string($_GET["sector"]);
        $Recno = mysql_real_escape_string($_GET["recno"]);
        $mensaje = mysql_real_escape_string($_GET["mensaje"]);
        $intimado = mysql_real_escape_string($_GET["intimado"]);
        $registroComen = mysql_real_escape_string($_GET["rComen"]);
        $fecha = date("d-m-Y H:i:s");
        if (strlen($mensaje) < 1) {
            $mensaje = "Cerrado el " . $fecha;
        }
        //$sql2     = "DELETE FROM sptbl_datosContratos WHERE idContrato = ".$contratoTotvs;
        $contratoTotvs = trim(sprintf("%06d", $contratoTotvs));
        $sql = "Update sptbl_tickets set vStatus='closed', nClosedStaff='" . $_SESSION["sess_staffid"] . "', nLockStatus='1', comentario ='" . $mensaje . "' Where nTicketId= ' " . mysql_real_escape_string($_GET["tk"]) . " '";
        $descripcion = 'Se cerro el ticket';
        // SI ES DE JURIDICA CREA LA QUERY
        if ($sector == 6) {
            if ($registroComen == true) {
                $sql2 = "UPDATE sptbl_datosContratos SET cantidadHijos = 0 , estadoContrato = 'A' WHERE idContrato =  " . $contratoTotvs;
            }
            $accion = 'cerrar';
            $query = "UPDATE Z30010 SET Z30_ESTADO = 'A', Z30_BLQIMP = 'N' WHERE Z30_CODIGO  =  " . $contratoTotvs . " AND Z30_ESTADO = 'J' ";
            $query2 = "UPDATE SE1010 SET E1_XJURIDI = '' WHERE R_E_C_N_O_ = " . $Recno;
            if ($intimado == 1) {
                $descripcion = 'Se cerro el ticket y se quito el Contrato de Juridica, Nota: ' . $mensaje;
            } else {
                $descripcion = 'Se cerro el ticket, Nota: ' . $mensaje;
            }
        }
    } elseif ($val == 'reabrir') {
        $dato = 0;
        $contratoTotvs = mysql_real_escape_string($_GET["ctotvs"]);
        $sector = mysql_real_escape_string($_GET["sector"]);
        $intimado = mysql_real_escape_string($_GET["intimado"]);
        $ticketId = mysql_real_escape_string($_GET["tk"]);
        if (intval(mysql_real_escape_string($_GET["dato"])) > 0) {
            $dato = mysql_real_escape_string($_GET["dato"]);
        }
        if ($sector == 6) {
            $accion = 'reabrir';
            $sql = "Update sptbl_tickets set vStatus='open', nClosedStaff='0', nLockStatus='1', comentario = '' Where nTicketId between " . $dato . " and " . $ticketId . " and contratoTotvs = " . $contratoTotvs . " and seccion_id = " . $sector;
            if ($intimado == 1) {
                $descripcion = 'Se reabrió el ticket, contrato vuelve a Juridica ';
                $query = "UPDATE Z30010 SET Z30_ESTADO = 'J', Z30_BLQIMP = 'S' WHERE Z30_CODIGO =  " . $contratoTotvs . " AND Z30_ESTADO = 'A' ";
                $sql4 = "UPDATE sptbl_datosContratos SET  estadoContrato = 'J' WHERE idContrato =  " . $contratoTotvs;
            } else {
                $descripcion = 'Se reabrió el ticket';
            }
            $sql3 = "Update sptbl_tickets set tramite_hijo = 0 Where nTicketId = " . $ticketId . " and contratoTotvs = " . $contratoTotvs . " and seccion_id = " . $sector;
            $sql2 = "INSERT INTO sptbl_datosContratos(idContrato,cantidadHijos) VALUES('" . $contratoTotvs . "',\r\n                        (select count(nTicketId) from sptbl_tickets where contratoTotvs ='" . $contratoTotvs . "' and vStatus = 'open' and seccion_id = 6))";
            // SI ESTA INTIMADO
            // no se esta ejecutando
            if ($intimado == 1) {
                $descripcion = 'Se reabrió el ticket, contrato vuelve a Juridica ';
            } else {
                $descripcion = 'Se reabrió el ticket';
            }
        } else {
            $sql = "Update sptbl_tickets set vStatus='open', nClosedStaff='0', nLockStatus='1' Where nTicketId = " . $ticketId;
        }
    } elseif ($val == 'intimar') {
        $accion = 'intimar';
        $fecha = date("Y-m-d H:i:s");
        $contratoTotvs = mysql_real_escape_string($_GET["ctotvs"]);
        $cantidad = mysql_real_escape_string($_GET["cantidadcomen"]);
        $sql = "Update sptbl_tickets set intimado = 1 where contratoTotvs = " . $contratoTotvs . " and vStatus = 'open'";
        if ($cantidad != 0) {
            $sql2 = "Update sptbl_datosContratos SET fchIntimado = '" . $fecha . "', estadoContrato = 'J' where idContrato = '" . $contratoTotvs . " ' ";
        } else {
            $sql2 = "INSERT INTO sptbl_datosContratos(fchIntimado,idContrato) VALUES('" . $fecha . "'," . $contratoTotvs . ")";
        }
        $query = "UPDATE Z30010 SET Z30_ESTADO = 'J', Z30_BLQIMP = 'S' WHERE Z30_CODIGO =  " . $contratoTotvs . " AND Z30_ESTADO = 'A' ";
        $descripcion = "Se Intimo el Ticket, el contrato esta en Juridica";
    } elseif ($val == 'desacerIntimacion') {
        $accion = 'sacarIntimacion';
        $contratoTotvs = mysql_real_escape_string($_GET["ctotvs"]);
        $sql = "Update sptbl_tickets set intimado = 0 where contratoTotvs = " . $contratoTotvs . " and vStatus = 'open'";
        $sql2 = "Update sptbl_datosContratos SET fchIntimado = '', estadoContrato = 'A' where idContrato = '" . $contratoTotvs . " ' ";
        $descripcion = 'Se saco intimacion al Ticket, el contrato sale de Juridica';
        $query = "UPDATE Z30010 SET Z30_ESTADO = 'A', Z30_BLQIMP = 'N' WHERE Z30_CODIGO = " . $contratoTotvs . " AND Z30_ESTADO = 'J' ";
    } elseif ($val == 'eliminarNota') {
        $contratoTotvs = mysql_real_escape_string($_GET["ctotvs"]);
        $sector = mysql_real_escape_string($_GET["sector"]);
        $idCliente = mysql_real_escape_string($_GET["cliente"]);
        if (intval($sector) == 4 && intval($idCliente) != 0) {
            $sql = "UPDATE sptbl_users SET comentario_atencionInquilinos = '' WHERE userIdAcsa = " . $idCliente;
        } else {
            if (intval($sector) == 6) {
                $sql = "UPDATE sptbl_datosContratos SET comentario = '' WHERE idContrato = " . $contratoTotvs;
            }
        }
        $descripcion = 'Se elimina el comentario del contrato';
    } elseif ($val == 'modificarNota') {
        $mensaje = mysql_real_escape_string($_GET["mensaje"]);
        $contratoTotvs = mysql_real_escape_string($_GET["ctotvs"]);
        $orden = mysql_real_escape_string($_GET["ordenCon"]);
        $sector = mysql_real_escape_string($_GET["sector"]);
        $mensaje = str_replace("<br/>", ";", $mensaje);
        $idCliente = mysql_real_escape_string($_GET["cliente"]);
        print_r($_GET);
        if ($orden == 0) {
            $orden = 5;
        }
        if (strlen($mensaje) > 0) {
            if (intval($sector) == 6) {
                $sql = "UPDATE sptbl_datosContratos SET comentario = '" . $mensaje . "', orden = " . $orden . " WHERE idContrato = " . $contratoTotvs;
            }
            $mensaje = str_replace(";", "<br/>", $mensaje);
            $descripcion = 'Se cambia el comentario del contrato por:' . $mensaje;
        }
    } elseif ($val == 'insertarNota') {
        $mensaje = mysql_real_escape_string($_GET["mensaje"]);
        $contratoTotvs = mysql_real_escape_string($_GET["ctotvs"]);
        $orden = mysql_real_escape_string($_GET["ordenCon"]);
        $cantidad = mysql_real_escape_string($_GET["cantidadcomen"]);
        $sector = mysql_real_escape_string($_GET["sector"]);
        $mensaje = str_replace("<br/>", ";", $mensaje);
        $idCliente = mysql_real_escape_string($_GET["cliente"]);
        if ($orden == 0) {
            $orden = 5;
        }
        if (intval($sector) == 6) {
            if ($cantidad != 0) {
                $sql = "UPDATE sptbl_datosContratos SET comentario = '" . $mensaje . "', orden = " . $orden . " WHERE idContrato = " . $contratoTotvs;
            } else {
                $sql = "INSERT INTO sptbl_datosContratos(idContrato,comentario,orden) VALUES(" . $contratoTotvs . ",'" . $mensaje . "'," . $orden . ")";
            }
        }
        if ($mensaje != '') {
            $mensaje = str_replace(";", "<br/>", $mensaje);
            $descripcion = 'Se inserta en el contrato el comentario: ' . $mensaje;
        } else {
            $descripcion = 'Se Modifico el orden del contrato';
        }
    } else {
        return false;
    }
    // actualizar en totvs
    if ($query != '') {
        executeQueryTotvs($query);
    }
    /*
        // comprobar si funcionaron los update
    
    
                if($accion == 'intimar')
                {
                    $consulta   =  "SELECT Z30_ESTADO FROM Z30010 WHERE Z30_CODIGO = ".$contratoTotvs." AND Z30_ESTADO = 'J' AND Z30_BLQIMP = 'S' ";
                    $resultado  =  executeSelectTotvs($consulta);
    
                    if(mssql_num_rows($resultado) > 0) $update_totvs = TRUE;
                    else                               $update_totvs = FALSE;
    
                }
                if($accion == 'cerrarT' || $accion == 'cerrar')
                {
                    $consulta   =  "SELECT TOP 1 COUNT(Z30_CODIGO) FROM Z30010 WHERE Z30_CODIGO = ".$contratoTotvs." AND Z30_ESTADO = 'A' AND Z30_BLQIMP = 'N' ";
                    $resultado  =  executeSelectTotvs($consulta);
    
                    if(mssql_num_rows($resultado) > 0) $update_totvs = TRUE;
                    else                               $update_totvs = FALSE;
    
                }
                if($accion == 'reabrir')
                {
                    $consulta   =  "SELECT count(intimado) as intimado FROM sptbl_tickets where contratoTotvs = ".$contratoTotvs." and intimado = 1 LIMIT 1  ";
                    echo $consulta ;
                    $result     = executeSelect($consulta,$conn);
    
    
                       while($row = mysql_fetch_array($result)){ $cantidad = $row['intimado']; }
    
    
                    if($cantidad <= 0)
                        $consulta   =  "SELECT Z30_ESTADO FROM Z30010 WHERE Z30_CODIGO = ".$contratoTotvs." AND Z30_ESTADO = 'A' AND Z30_BLQIMP = 'N' ";
                    else
                        $consulta   =  "SELECT Z30_ESTADO FROM Z30010 WHERE Z30_CODIGO = ".$contratoTotvs." AND Z30_ESTADO = 'J' AND Z30_BLQIMP = 'S' ";
    
    
                /*
                    // guardo el historial
                    $historial = new Historial();
                    $historial->guardarHistorial( array('ticket_id' => $_GET["tk"], 'staff_id' => $_SESSION["sess_staffid"], 'descripcion' => $cantidad, 'show_in_ticket' => 1) );
                    $resultado  =  executeSelectTotvs($consulta);
    
                    if(mssql_num_rows($resultado) >0) $update_totvs = TRUE;
                    else                               $update_totvs = FALSE;
    
    
                    $update_totvs = TRUE;
                }
                if($accion == 'sacarIntimacion')
                {
                    $consulta   =  "SELECT Z30_ESTADO FROM Z30010 WHERE Z30_CODIGO = ".$contratoTotvs." AND Z30_ESTADO = 'A' AND Z30_BLQIMP = 'N' ";
                    $resultado  =  executeSelectTotvs($consulta);
    
                    if(mssql_num_rows($resultado) > 0) $update_totvs = TRUE;
                    else                               $update_totvs = FALSE;
    
                }
    */
    if ($query2 != "") {
        // actualizar en totvs
        $result = executeSelectTotvs($query2);
    }
    //if($update_totvs || $query=""){
    if ($sql != "") {
        executeQuery($sql, $conn);
    }
    if ($sql2 != "") {
        executeQuery($sql2, $conn);
    }
    if ($sql3 != "") {
        executeQuery($sql3, $conn);
    }
    if ($sql4 != "") {
        executeQuery($sql4, $conn);
    }
    if ($sql_comentario != "") {
        executeQuery($sql_comentario, $conn);
    }
    // guardo el historial
    $historial = new Historial();
    $historial->guardarHistorial(array('ticket_id' => $_GET["tk"], 'staff_id' => $_SESSION["sess_staffid"], 'descripcion' => $descripcion, 'show_in_ticket' => 1));
    // redirijo
    header("Location: viewticket.php?limitval=0&mt=y&tk=" . $_GET["tk"] . "&us=" . $_GET["us"] . "&stylename=" . $_GET["stylename"] . "&styleminus=" . $_GET["styleminus"] . "&styleplus=" . $_GET["styleplus"]);
    die;
}
Пример #15
0
 public function consultaHistorialEstudiante()
 {
     try {
         $idPersona = isset($_POST['idPersona']) ? $_POST['idPersona'] : NULL;
         $persona = new Persona();
         $estudiante = $persona->leerPorId($idPersona);
         if ($estudiante == NULL) {
             $this->setVista('mensaje');
             $msj = "El Número de Documento no existe en el sistema";
             $this->vista->set('msj', $msj);
         } else {
             $rol = new Rol();
             $roles = $rol->leerRoles($idPersona);
             $band = 0;
             foreach ($roles as $ro) {
                 if ($ro->getIdRol() == 'E') {
                     $band = 1;
                 }
             }
             if ($band != 1) {
                 $this->setVista('mensaje');
                 $msj = "El Número de Documento ingresado no corresponde al de un estudiante";
                 $this->vista->set('msj', $msj);
             } else {
                 $historial = new Historial();
                 $anios = $historial->leerAniosEstudiante($idPersona);
                 $this->vista->set('anios', $anios);
                 $this->vista->set('idPersona', $idPersona);
             }
         }
         return $this->vista->imprimir();
     } catch (Exception $exc) {
         $this->setVista('mensaje');
         $msj = "ERROR... La consulta no se pudo ejecutar.. !";
         $this->vista->set('msj', $msj);
         return $this->vista->imprimir();
     }
 }
Пример #16
0
<?php

require_once "./includes/applicationheader.php";
include "./includes/functions/miscfunctions.php";
$conn = getConnection();
if (isset($_POST["submit"]) and isset($_GET)) {
    if ($_POST["var_ticket"] != '' and $_POST["edit_user_totvs"] != '' and $_POST["edit_user_dire"] != '' and $_POST["edit_user_tele"] != '') {
        // staff id
        $var_staffid = $_SESSION["sess_staffid"];
        $var_show_ticket = 0;
        // usuario
        $sql_insert_user = "******";
        $sql_insert_user .= "    vEmail      = '" . mysql_real_escape_string($_POST["edit_user_email"]) . "'  ,  ";
        $sql_insert_user .= "    vTelefono   = '" . mysql_real_escape_string($_POST["edit_user_tele"]) . "'  ,  ";
        $sql_insert_user .= "    vDireccion  = '" . mysql_real_escape_string($_POST["edit_user_dire"]) . "'  ,  ";
        $sql_insert_user .= "    comentario_atencionInquilinos = '" . mysql_real_escape_string($_POST["edit_user_observ"]) . "' ";
        $sql_insert_user .= "WHERE userIdAcsa = '" . $_POST["edit_user_totvs"] . "'";
        executeQuery($sql_insert_user, $conn);
        // guardo el historial
        $historial = new Historial();
        $historial->guardarHistorial(array('ticket_id' => $_POST["var_ticket"], 'staff_id' => $var_staffid, 'descripcion' => 'Se editaron los datos del Usuario', 'show_in_ticket' => $var_show_ticket));
        // vuelvo al ticket
        header("Location: viewticket.php?limitval=" . $_GET['limitval'] . "&mt=y&tk=" . $_GET['tk'] . "&us=" . $_GET['us'] . "&stylename=" . $_GET['stylename'] . "&styleminus=" . $_GET['styleminus'] . "&styleplus=" . $_GET['styleplus'] . "&editUser=1");
        die;
    } else {
        // vuelvo al ticket con el error
        header("Location: viewticket.php?limitval=" . $_GET['limitval'] . "&mt=y&tk=" . $_GET['tk'] . "&us=" . $_GET['us'] . "&stylename=" . $_GET['stylename'] . "&styleminus=" . $_GET['styleminus'] . "&styleplus=" . $_GET['styleplus'] . "&editUser=2");
        die;
    }
}
Пример #17
0
                        $lienzo = imagecreatetruecolor($miniatura_ancho, $miniatura_alto);
                        imagecopyresampled($lienzo, $imagen, 0, 0, 0, 0, $miniatura_ancho, $miniatura_alto, $imagen_ancho, $imagen_alto);
                        imagejpeg($lienzo, "{$uploads_dir}/thumbs_{$name}", 80);
                        // elimino la imagen original
                        @unlink("{$uploads_dir}/{$name}");
                    }
                }
                // guardo el historial
                $historial = new Historial();
                $historial->guardarHistorial(array('ticket_id' => $var_ticketid, 'staff_id' => $var_staffid, 'descripcion' => 'Se adjunto el archivo ' . $name, 'show_in_ticket' => 1));
                $result['success'][$key] = true;
            } else {
                $result['error'][$key] = true;
            }
        }
    } else {
        if ($_FILES["file"]['error'] == 0) {
            $tmp_name = $_FILES["file"]["tmp_name"];
            $name = $_FILES["file"]["name"];
            move_uploaded_file($tmp_name, "{$uploads_dir}/{$name}");
            // guardo el historial
            $historial = new Historial();
            $historial->guardarHistorial(array('ticket_id' => $var_ticketid, 'staff_id' => $var_staffid, 'descripcion' => 'Se adjunto el archivo ' . $name, 'show_in_ticket' => 1));
            $result['success'] = true;
        } else {
            $result['error'] = true;
        }
    }
    return json_decode($result);
    die;
}