function duplicate($id, $dest)
 {
     // there really should be an action method to do this
     $response = new HTML_AJAX_Action();
     $response->insertScript("\r\n\t\t\tvar newNode = document.getElementById('{$id}').cloneNode(true);\r\n\t\t\tnewNode.id = 'newNode';\r\n\t\t\tdocument.getElementById('{$dest}').appendChild(newNode);");
     return $response;
 }
Esempio n. 2
0
 function getUsuarios($id, $depeCodi)
 {
     // there really should be an action method to do this
     $response = new HTML_AJAX_Action();
     $response->insertScript("\n\t\t document.getElementById('{$depeCodi}').appendChild(new\n\t\t Option('ppGammaridae ','Gammaridae'));");
     return $response;
 }
Esempio n. 3
0
 /**
  *  Metodo que busca los ciudadanos
  *  @documento string Documento del Ciudadano
  **/
 function getBuscarCiuDoc($idObjetoHtml, $documento)
 {
     $response = new HTML_AJAX_Action();
     $iSql = "select tdid_codi,sgd_ciu_codigo,sgd_ciu_nombre,sgd_ciu_direccion,sgd_ciu_apell1,sgd_ciu_apell2,sgd_ciu_telefono,sgd_ciu_email,muni_codi,dpto_codi,sgd_ciu_cedula,id_cont,id_pais from SGD_CIU_CIUDADANO where cast(SGD_CIU_CEDULA as varchar(200)) like '%" . $documento . "%'";
     $iSql .= " ORDER BY SGD_CIU_CEDULA, SGD_CIU_NOMBRE ";
     //return $iSql;
     //ECHO "$isql";
     $rsUs = $this->db->conn->Execute($iSql);
     $j = 0;
     $cadena = 'valor = "<table width=550>";';
     while (!$rsUs->EOF) {
         $ciuNomb = utf8_encode($rsUs->fields["SGD_CIU_NOMBRE"]);
         $ciuApell1 = utf8_encode($rsUs->fields["SGD_CIU_APELL1"]);
         $ciuApell2 = utf8_encode($rsUs->fields["SGD_CIU_APELL2"]);
         $ciuDireccion = utf8_encode($rsUs->fields["SGD_CIU_DIRECCION"]);
         $ciuMail = utf8_encode($rsUs->fields["SGD_CIU_EMAIL"]);
         $ciuDocX = $rsUs->fields["SGD_CIU_CODIGO"];
         $ciuDoc = $rsUs->fields["SGD_CIU_CEDULA"];
         $ciuTelefono = utf8_encode($rsUs->fields["SGD_CIU_TELEFONO"]);
         $cadena .= 'valor=  valor + "<tr><td  class=listado1><SPAN onClick=seleccionarDir(' . $ciuDocX . ');> <label>Seleccionar</label></SPAN> </td><td class=listado1>' . $ciuDoc . '</td><td class=listado1>' . $ciuNomb . ' ' . $ciuApell1 . ' </td><td class=listado1>' . $ciuDireccion . '</td></tr>";';
         $rsUs->MoveNext();
     }
     $cadena .= 'valor = valor + "<option value=usNuevo> </table>";';
     $cadena .= 'document.getElementById("dirBusqueda").innerHTML=valor;';
     //echo "alert('$cadena');";
     $response->insertScript($cadena);
     //return $iSql;
     return $response;
 }
 /**
  * Checks if the passed values are correct.
  *
  * @param array the form object
  */
 function validate($arrayForm)
 {
     //--------------------------------------------------
     // Initialize function
     //--------------------------------------------------
     // Array to hold the messages
     $arrMessages = array();
     // Set all form values that they validated. Could be improved by analyzing
     // the values passed in $objForm and setting values accordingly.
     $arrValidated = array();
     $arrValidated['value_550'] = true;
     $arrValidated['value_552'] = true;
     $arrValidated['mail_from'] = true;
     $arrValidated['value_553'] = true;
     // Never trust the values passed by users :)
     $objForm = new stdClass();
     $objForm->value_550 = trim($arrayForm['value_550']);
     $objForm->value_552 = trim($arrayForm['value_552']);
     $objForm->value_553 = trim($arrayForm['value_553']);
     $objForm->mail_from = trim($arrayForm['mail_from']);
     //--------------------------------------------------
     // Check values
     //--------------------------------------------------
     // Check mail_from
     if ($objForm->mail_from == '') {
         $arrMessages[] = ERR_EMAIL_EMPTY;
         $arrValidated['mail_from'] = false;
     } else {
         if ($this->_checkEmail($objForm->mail_from) == false) {
             $arrMessages[] = ERR_EMAIL_INVALID;
             $arrValidated['mail_from'] = false;
         }
     }
     // Check value_550
     if ($objForm->value_550 == '') {
         $arrMessages[] = ERR_USERNAME_EMPTY;
         $arrValidated['value_550'] = false;
     }
     // Check value_552
     if ($objForm->value_552 == '') {
         $arrMessages[] = ERR_TITLE_EMPTY;
         $arrValidated['value_552'] = false;
     }
     // Check value_553
     if ($objForm->value_553 == '') {
         $arrMessages[] = ERR_CONTENT_EMPTY;
         $arrValidated['value_553'] = false;
     }
     //--------------------------------------------------
     // Finalize function
     //--------------------------------------------------
     // Create the message list
     $strMessages = '';
     if (count($arrMessages) > 0) {
         $strMessages = '<ul>';
         foreach ($arrMessages as $strTemp) {
             $strMessages .= '<li>' . $strTemp . '</li>';
         }
         $strMessages .= '</ul>';
     }
     // Create a response object
     $objResponse = new HTML_AJAX_Action();
     // Assign the messages
     $objResponse->assignAttr('messages', 'innerHTML', $strMessages);
     $objResponse->insertScript("toggleElement('messages', " . ($strMessages != '' ? 1 : 0) . ");");
     // Generate the scripts to update the form elements' label and input element
     foreach ($arrValidated as $strKey => $blnValue) {
         $objResponse->insertScript("setElement('" . $strKey . "', " . ($blnValue ? '1' : '0') . ");");
     }
     // Test for no messages
     if ($strMessages == "") {
         @extract($arrayForm);
         $MailBody = "";
         for ($i = 550; $i < 600; $i++) {
             $MailKey = "key_" . $i;
             $MailValue = "value_" . $i;
             if (${$MailKey} || ${$MailValue}) {
                 $MailBody .= "\r\n" . ${$MailKey} . " : " . ${$MailValue} . "\r\n";
             }
         }
         $MailBody = mb_convert_encoding($MailBody, "GB2312", "UTF-8");
         $dates = date("Y/m/d H:i:s");
         $subject = "一封从您网站反馈过来的信息";
         $from_name = "网站反馈信使";
         $Message = "\n\t\t\t 尊敬管理员 ,您好:\n\t\t\t\n\t\t\t 一封从您网站反馈过来的信息如下:\n\t\t\t\n\t\t\t {$MailBody}\n\t\t\t\n\t\t\t \n\t\t\t\n\t\t\t 日期 :{$dates}\n\t\t\t\n\t\t\t 非常感谢,\n\t\t\t-----------------------------------------------------------------------\n\t\t\t\t\t\t\t\t您的网站反馈信使\n\t\t\t\t\t";
         $return_data = sendEmail($mail_to, $mail_from, $from_name, $mail_from, $subject, $Message, nl2br($Message));
         $objResponse->insertAlert(mb_convert_encoding("您的消息已经发送成功,感谢您的反馈!", "UTF-8", "GB2312") . $MailBody . implode(",", $arrayForm) . implode(",", $return_data));
     }
     // And ready! :)
     return $objResponse;
 }
Esempio n. 5
0
 function borrarInformado($idObjetoHtml, $radicado, $loginOrigen, $depeCodi, $usuaCodi, $depeCodiBorrar, $usuaCodiBorrar, $observacion)
 {
     $response = new HTML_AJAX_Action();
     $iSql = "select * from usuario where depe_codi={$depeCodi}";
     $rsUs = $this->db->conn->Execute($iSql);
     $radicados[] = $depeCodiDestino . "-" . $radicado;
     //$var1 = "--> $idObjetoHtml+$radicados+$depeCodiOrigen+$usuaCodiOrigen+$depeCodiDestino+$usuaCodiDestino+{$observacion}";
     $this->depeCodi = $depeCodi;
     $this->usuaCodi = $usuaCodi;
     $ruta_raiz = $this->ruta_raiz;
     include "{$ruta_raiz}/include/tx/Tx.php";
     $tx = new Tx($this->db);
     //$depeCodi = $this->depeCodi;
     //$usuaCodi = $this->usuaCodi;
     $rta = $tx->borrarInformado($radicados, $loginOrigen, $depeCodi, $depeCodiBorrar, $usuaCodi, $usuaCodiBorrar, $observacion);
     $cadena = $this->listaInformados($radicado, $idObjetoHtml);
     $response->insertScript($cadena);
     return $response;
 }
Esempio n. 6
0
 /**
  *  trae los Usuarios de una dependencia
  *  @txAccion bool Si es true entonces carga solo los jefe. txAccion es la accion a realizar Informar o reasignar
  **/
 function newRadicadoAjax($idObjetoHtml, $asunto, $tipoRadicado, $radiDepeRadi, $radiDepeActu, $dependenciaSecuencia, $radiUsuaRadi, $radiUsuaActu, $usuaDoc, $cuentai, $docUs3 = 0, $mRecCodi = 0, $radiFechOficio, $radicadoPadre, $radPais, $tipoDocumento = 0, $carpetaPer = 0, $carpetaCodi, $tDidCodi = 0, $tipoRemitente = 0, $ane = '', $radiPath = '')
 {
     //echo "alert('<!-- $carpetaCodi -- $docUs3 "." -->'); ";
     $response = new HTML_AJAX_Action();
     $this->radiTipoDeri = 0;
     $this->radiCuentai = "" . trim($cuentai) . "";
     $this->eespCodi = $docUs3;
     $this->mrecCodi = $mRecCodi;
     $fecha_gen_doc_YMD = substr($radiFechOficio, 6, 4) . "-" . substr($radiFechOficio, 3, 2) . "-" . substr($radiFechOficio, 0, 2);
     $this->radiFechOfic = $fecha_gen_doc_YMD;
     if (!$radicadopadre) {
         $radicadopadre = "'0'";
     }
     $this->radiNumeDeri = trim($radicadopadre);
     $this->radiPais = $radPais;
     $this->descAnex = $ane;
     $this->raAsun = utf8_decode($asunto);
     $this->radiDepeActu = $radiDepeActu;
     $this->radiDepeRadi = $radiDepeRadi;
     $this->radiUsuaActu = $radiUsuaActu;
     $this->radiUsuaRadi = $radiUsuaRadi;
     $this->usuaCodi = $radiUsuaRadi;
     $this->eespCodi = $docUs3;
     $this->trteCodi = $tipoRemitente;
     $this->tdocCodi = $tipoDocumento;
     $this->tdidCodi = $tDidCodi;
     $this->carpCodi = $carpetaCodi;
     $this->carPer = $carpetaPer;
     $this->usuaDoc = $usuaDoc;
     $this->noDigitosRad = 6;
     $this->dependencia = $radiDepeRadi;
     if ($radiPath) {
         $this->radiPath = $radiPath;
     }
     //$this->trteCodi  = $tip_rem;
     //return "$tipoRadicado,$dependenciaSecuencia";
     $noRad = $this->newRadicado($tipoRadicado, $dependenciaSecuencia);
     if ($noRad <= 1) {
         $errorNewRadicado = "<font size=1 color=red>Error al Generar el Radicado." . $this->errorNewRadicado . "</font>";
     }
     //$rtaDirecciones = $this->insertDireccionAjax($noRad, 1,0);
     //grabarDirecciones(document.getElementById('numeroRadicado').value);
     $cadena = "seleccion = document.getElementById('{$idObjetoHtml}'); ";
     //if($noRad>=1)
     //{
     $cadena1 = "document.getElementById('numeroRadicado').value=" . $noRad . "; grabarDirecciones(document.getElementById('numeroRadicado').value);";
     $cadena1 .= "document.getElementById('Submit33').style.visibility='hidden'; ";
     $cadena1 .= "document.getElementById('grabarDir').style.visibility='visible'; ";
     //$cadena1 .= "verDatosRad(".$noRad."); ";
     $cadena .= 'valor="<table wdith=50%><tr class=titulos1><td><img src=../imagenes/gnu.png width=50 alt=GNU/GPL title=GNU/GPL></td><td><center><font size=4>Radicado No ' . $noRad . ' - - ' . htmlspecialchars($errorNewRadicado) . '</font></center></td></tr></table><SCRIPT>verDatosRad(' . $noRad . ');</SCRIPT>";';
     //echo "<!-- alert('<!-- $carpetaCodi -- $noRad "." -->'); -->";
     //}else{
     //$cadena .= 'valor="'.$errorNewRadicado.'";';
     //}
     include_once "../../tx/Historico.php";
     $historico = new Historico($this->db);
     $radicados[] = $noRad;
     $resHistorico = $historico->insertarHistorico($radicados, $radiDepeRadi, $radiUsuaRadi, $radiDepeActu, $radiUsuaActu, '', 2);
     $cadena .= " {$cadena1} seleccion.innerHTML=valor;";
     //$cadena .= " alert('".$resHistorico."');";
     $response->insertScript($cadena);
     return $response;
 }
Esempio n. 7
0
 /**
  * Checks if the passed values are correct.
  *
  * @param array the form object
  */
 function validate($arrayForm)
 {
     //--------------------------------------------------
     // Initialize function
     //--------------------------------------------------
     // Array to hold the messages
     $arrMessages = array();
     // Set all form values that they validated. Could be improved by analyzing
     // the values passed in $objForm and setting values accordingly.
     $arrValidated = array();
     $arrValidated['username'] = true;
     $arrValidated['password'] = true;
     $arrValidated['email'] = true;
     // Never trust the values passed by users :)
     $objForm = new stdClass();
     $objForm->username = trim($arrayForm['username']);
     $objForm->password = trim($arrayForm['password']);
     $objForm->email = trim($arrayForm['email']);
     //--------------------------------------------------
     // Check values
     //--------------------------------------------------
     // Check username
     if ($objForm->username == '') {
         $arrMessages[] = ERR_USERNAME_EMPTY;
         $arrValidated['username'] = false;
     } else {
         if ($objForm->username != 'peter') {
             $arrMessages[] = ERR_USERNAME_INVALID;
             $arrValidated['username'] = false;
         }
     }
     // Check password
     if ($objForm->password == '') {
         $arrMessages[] = ERR_PASSWORD_EMPTY;
         $arrValidated['password'] = false;
     } else {
         if ($objForm->password != 'gabriel') {
             $arrMessages[] = ERR_PASSWORD_INVALID;
             $arrValidated['password'] = false;
         }
     }
     // Check email
     if ($objForm->email == '') {
         $arrMessages[] = ERR_EMAIL_EMPTY;
         $arrValidated['email'] = false;
     } else {
         if ($this->_checkEmail($objForm->email) == false) {
             $arrMessages[] = ERR_EMAIL_INVALID;
             $arrValidated['email'] = false;
         }
     }
     //--------------------------------------------------
     // Finalize function
     //--------------------------------------------------
     // Create the message list
     $strMessages = '';
     if (count($arrMessages) > 0) {
         $strMessages = '<ul>';
         foreach ($arrMessages as $strTemp) {
             $strMessages .= '<li>' . $strTemp . '</li>';
         }
         $strMessages .= '</ul>';
     }
     // Create a response object
     $objResponse = new HTML_AJAX_Action();
     // Assign the messages
     $objResponse->assignAttr('messages', 'innerHTML', $strMessages);
     $objResponse->insertScript("toggleElement('messages', " . ($strMessages != '' ? 1 : 0) . ");");
     // Generate the scripts to update the form elements' label and input element
     foreach ($arrValidated as $strKey => $blnValue) {
         $objResponse->insertScript("setElement('" . $strKey . "', " . ($blnValue ? '1' : '0') . ");");
     }
     // Test for no messages
     if ($strMessages == "") {
         $objResponse->insertAlert("Well done chap!");
     }
     // And ready! :)
     return $objResponse;
 }
Esempio n. 8
0
 function editEntry($id)
 {
     $data = $_SESSION['entries'][$id];
     $response = new HTML_AJAX_Action();
     //send to the form
     $response->assignAttr('name', 'value', $data['name']);
     $response->assignAttr('email', 'value', $data['email']);
     $response->assignAttr('website', 'value', $data['website']);
     $response->assignAttr('comments', 'value', $data['comments']);
     $response->assignAttr('submit', 'value', 'Edit Entry');
     $response->createNode('submit', 'input', array('id' => 'key', 'name' => 'key', 'type' => 'hidden', 'value' => $id), 'insertBefore');
     return $response;
 }
Esempio n. 9
0
 /**
  * Metodo que borrar Derivados de Un Radicado
  *
  * 
  * @param string $radicado Numero de Radicado o Registro al cual se le buscaran los Usuarios Informados
  * @return string Retorna la cadena con la tabla de los informados.
  * @autor Jairo Losada 2009 - Correlibre.org
  *        Modificado en DNP 2010 
  * 
  **/
 function borrarDerivado($idObjetoHtml, $radicado, $depeCodi, $usuaCodi, $depeCodiBorrar, $usuaCodiBorrar, $idDerivado, $observacion)
 {
     $response = new HTML_AJAX_Action();
     $iSql = "select * from usuario where depe_codi={$depeCodi}";
     $rsUs = $this->db->conn->Execute($iSql);
     $radicados[] = $depeCodiBorrar . "-" . $radicado;
     $radicados[] = $radicado;
     $this->depeCodi = $depeCodi;
     $this->usuaCodi = $usuaCodi;
     $ruta_raiz = $this->ruta_raiz;
     //$depeCodi = $this->depeCodi;
     //$usuaCodi = $this->usuaCodi;
     $isql = "DELETE FROM SGD_RG_MULTIPLE where ID={$idDerivado} AND RADI_NUME_RADI in({$radicado})";
     $ruta_raiz = $this->ruta_raiz;
     $this->db->conn->Execute($isql);
     include "{$ruta_raiz}/include/tx/Tx.php";
     $tx = new Tx($this->db);
     $radicados[0] = $radicado;
     $rrr = $tx->insertarHistorico($radicados, $depeCodi, $usuaCodi, $depeCodiBorrar, $usuaCodiBorrar, $observacion, 70);
     //echo "alert('Resultado $rrr >".$this->strSql."')";
     $cadena = $this->listaDerivados($radicado, 'usuariosReasignados');
     //echo "alert ('".$isql."');" ;
     $response->insertScript($cadena);
     return $response;
 }
 function updateSelect($id)
 {
     $response = new HTML_AJAX_Action();
     $attr = array('id' => $id, 'name' => $id);
     $response->replaceNode($id, 'select', $attr);
     for ($i = 1; $i <= 10; $i++) {
         $attr = array('value' => $i, 'innerHTML' => 'Option ' . $i);
         $response->createNode($id, 'option', $attr, 'append');
     }
     return $response;
 }