예제 #1
0
function main($txt, $cmd)
{
    global $SIDU;
    $eng = $SIDU['eng'];
    $txt = @strip($txt, 1, 0, 1);
    if ($txt && $cmd) {
        $err = @save_data($SIDU, $txt, $eng);
    }
    if (!$txt) {
        $txt = "CREATE TABLE " . ($eng == 'my' ? "`{$SIDU['1']}`.`table_name`" : ($eng == 'pg' ? "\"{$SIDU['2']}\".\"table_name\"" : "table_name")) . "(\ncolname int" . ($eng == 'my' ? "(8)" : "") . ($eng == 'sl' ? "" : " NOT NULL DEFAULT 0") . " PRIMARY KEY,\n\n)";
    }
    echo "<div class='web'><p class='b dot'>", @lang(4101), " <span class='red'>", $eng == 'my' ? $SIDU[1] : "{$SIDU['1']}.{$SIDU['2']}", "</span></p>";
    if ($err) {
        echo "<p class='err'>{$err}</p>";
    }
    echo "<form action='tab-new.php?id={$SIDU['0']},{$SIDU['1']},{$SIDU['2']},{$SIDU['3']},{$SIDU['4']},{$SIDU['5']},{$SIDU['6']}' method='post' name='myform'>\n\t<table><tr><td valign='top'>" . @html_form("textarea", "txt", $txt, 420, 320, "spellcheck='false' class='box'") . "<br /><br />" . @html_form("submit", "cmd", @lang(4102)) . "</td><td valign='top' style='padding-left:10px'>";
    $str = "9|0|smallint|smallint(5)\n0|1|32768|smallint(5) unsigned NOT NULL DEFAULT 0\n1|0|int|int(9)\n0|1|2,147,483,647|int(9) unsigned NOT NULL DEFAULT 0\n1|0|numeric|numeric(7,2)\n0|1|(7,2)|numeric(7,2) unsigned NOT NULL DEFAULT 0.00\n2|0|char|char(255)\n0|1|255|char(255) NOT NULL DEFAULT \\'\\'\n0|0|binary|char(255) binary NOT NULL DEFAULT \\'\\'\n1|0|varchar|varchar(255)\n0|1|255|varchar(255) NOT NULL DEFAULT \\'\\'\n0|0|binary|varchar(255) binary NOT NULL DEFAULT \\'\\'\n1|0|text|text\n0|1|65535|text NOT NULL DEFAULT \\'\\'\n2|0|date|date\n0|1|YYYY-MM-DD|date NOT NULL DEFAULT \\'0000-00-00\\'\n1|0|timestamp|timestamp\n0|1|YmdHis|timestamp NOT NULL DEFAULT \\'0000-00-00 00:00:00\\'\n0|0|now|timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP\n2|0|auto|auto_increment\n0|1|!null|NOT NULL\n0|0|PK|NOT NULL auto_increment PRIMARY KEY\n1|0|PK|PRIMARY KEY\n0|1|PK(a)|PRIMARY KEY (col1,col2)\n0|0|UK|UNIQUE uk (col1,col2)\n0|1|idx|INDEX idx (col1,col2)\n2|0|MyISAM|ENGINE = MyISAM\n0|1|InnoDB|ENGINE = InnoDB";
    if ($eng == 'pg') {
        $str = @strtr($str, @array("smallint(5)" => "smallint", "int(9)" => "int", " DEFAULT \\'0000-00-00\\'" => "", " DEFAULT \\'0000-00-00 00:00:00\\'" => "", "CURRENT_TIMESTAMP" => "now()", "auto|auto_increment" => "serial|serial", "NOT NULL auto_increment" => "serial NOT NULL", "0|0|binary|char(255) binary NOT NULL DEFAULT \\'\\'" => "", "0|0|binary|varchar(255) binary NOT NULL DEFAULT \\'\\'" => "", "MyISAM|ENGINE = MyISAM" => "With OID|WITH (OIDS=TRUE)", "0|1|InnoDB|ENGINE = InnoDB" => "", " unsigned" => "", "PRIMARY KEY (" => "CONSTRAINT pk PRIMARY KEY (", "UNIQUE uk (" => "CONSTRAINT uk UNIQUE (", "idx|INDEX idx (col1,col2)" => "FK|CONSTRAINT fk FOREINGN KEY (col) REFERENCES tab(pk) MATCH SIMPLE\\n\\tON UPDATE NO ACTION ON DELETE NO ACTION"));
    } elseif ($eng == 'sl') {
        $str = "9|0|int|int,\\n\n0|1|PK|int PRIMARY KEY\n1|0|text|text,\\n\n1|0|real|real,\\n";
    }
    $arr = @explode("\n", $str);
    foreach ($arr as $v) {
        @main_add_txt(@trim($v));
    }
    if ($eng == 'my') {
        @main_add_txt("2|0|enum(Y,N)|enum(\\'Y\\',\\'N\\') NOT NULL DEFAULT \\'Y\\',\\n");
    }
    echo "</td></tr></table></form></div>";
}
예제 #2
0
function load($config, $mode = 'photostack')
{
    if (strpos($config, 'config.php') === false) {
        echo 'You are trying to load something other than a configuration file!';
        return false;
        exit;
    } else {
        if (include $config) {
            define('config', 'yes');
            #Stripslashes from input if needed.
            $_GET = strip($_GET);
            $_POST = strip($_POST);
            #define
            define('siteName', $siteName);
            define('author', $author);
            define('separator', $separator);
            define('photosName', $photosName);
            define('dateFormat', $dateFormat);
            define('webDir', preg_replace('/(.*)\\/$/', '$1', $webDir));
            define('dirRoot', dirname($dirRoot));
            define('storageDir', $storageDir);
            define('pageName', $pageName);
            define('photostackUsername', $photostackUsername);
            define('photostackPassword', $photostackPassword);
            define('ftpUsername', $ftpUsername);
            define('ftpPassword', $ftpPassword);
            define('ftpHost', $ftpHost);
            define('ftpDir', $ftpDir);
            define('webConfigURL', $webConfigURL);
            define('templateIndex', $templateIndex);
            define('templateDisplay', $templateDisplay);
            define('templateSyndicateIndex', $templateSyndicateIndex);
            define('templateSyndicateDisplay', $templateSyndicateDisplay);
            define('templateSearch', $templateSearch);
            define('albumsSortNatural', $albumsSortNatural);
            define('photosSortNatural', $photosSortNatural);
            define('photosSortReverse', $photosSortReverse);
            define('photosSortByDesc', $photosSortByDesc);
            define('photosSortByDate', $photosSortByDate);
            define('skipIfContains', $skipIfContains);
            define('imageScale', $imageScale);
            define('thumbHeight', $thumbHeight);
            define('thumbWidth', $thumbWidth);
            define('fullSize', $fullSize);
            define('caching', $caching);
            define('thumbnails', $thumbnails);
            define('syndicationType', $syndicationType);
            define('timeLimit', $timeLimit);
            define('gd2', $gd2);
            define('albumListing', $albumListing);
            define('photoDesc', $photoDesc);
            define('imageDir', $imageDir);
            define('tagName', $tagName);
            $photostack = new $mode();
        }
        return true;
    }
}
예제 #3
0
 public function send($from, $to, $subject, $content)
 {
     $from = strip($from);
     if (is_array($to)) {
         $to = implode(";", $to);
     }
     $to = strip($to);
     $headers = 'MIME-Version: 1.0' . "\n";
     $headers .= 'Content-Type: text/html; charset=gbk' . "\n";
     //$headers .= "To: $to \n";
     $headers .= 'From: ' . $from . "\n";
     $subject = "=?gbk?B?" . base64_encode($subject) . "?=";
     $result = mail($to, $subject, $content, $headers);
     if ($result) {
         return true;
     } else {
         Flow::Log()->w($result);
         return false;
     }
 }
예제 #4
0
function PRESTAMO_show_dtl()
{
    global $db;
    global $sAction;
    global $sForm;
    global $sFileName;
    global $sPRESTAMOErr;
    global $styles;
    $fldPRES_ID = "";
    $fldRADI_NUME_RADI = "";
    $fldUSUA_LOGIN_ACTU = "";
    $fldDEPE_CODI = "";
    $fldUSUA_LOGIN_PRES = "";
    $fldPRES_DESC = "";
    $fldPRES_FECH_PRES = "";
    $fldPRES_FECH_DEVO = "";
    //-------------------------------
    // PRESTAMO Show begin
    //-------------------------------
    $sFormTitle = "Detalle Préstamo";
    $sWhere = "";
    $bPK = true;
    ?>
   
   <table class="FormTABLE">
   <form method="POST" action="<?php 
    echo $sFileName;
    ?>
" name="PRESTAMO">
   <tr><td class="FormHeaderTD" colspan="2"><font class="FormHeaderFONT"><?php 
    echo $sFormTitle;
    ?>
</font></td></tr>
   <?php 
    if ($sPRESTAMOErr) {
        ?>
		<tr><td class="DataTD" colspan="2"><font class="DataFONT"><?php 
        echo $sPRESTAMOErr;
        ?>
</font></td></tr>
	 <?php 
    }
    //-------------------------------
    // Load primary key and form parameters
    //-------------------------------
    if ($sPRESTAMOErr == "") {
        $fldPRES_ID = get_param("PRES_ID");
        $pPRES_ID = get_param("PRES_ID");
    } else {
        $fldPRES_ID = strip(get_param("PRES_ID"));
        $pPRES_ID = get_param("PK_PRES_ID");
    }
    //-------------------------------
    //-------------------------------
    // Load all form fields
    //-------------------------------
    //-------------------------------
    // Build WHERE statement
    //-------------------------------
    if (!strlen($pPRES_ID)) {
        $bPK = false;
    }
    $sWhere .= "PRES_ID=" . tosql($pPRES_ID, "Number");
    //-------------------------------
    //-------------------------------
    // PRESTAMO Open Event begin
    // PRESTAMO Open Event end
    //-------------------------------
    //-------------------------------
    // Build SQL statement and execute query
    //-------------------------------
    $sSQL = "select * from PRESTAMO where " . $sWhere;
    // Execute SQL statement
    $db->conn->SetFetchMode(ADODB_FETCH_ASSOC);
    $rs = $db->query($sSQL);
    $bIsUpdateMode = $bPK && !($sAction == "insert" && $sForm == "PRESTAMO") && ($rs && !$rs->EOF);
    //-------------------------------
    //-------------------------------
    // Load all fields into variables from recordset or input parameters
    //-------------------------------
    if ($bIsUpdateMode) {
        $fldDEPE_CODI = $rs->fields["DEPE_CODI"];
        $fldPRES_DESC = $rs->fields["PRES_DESC"];
        $fldPRES_FECH_DEVO = $rs->fields["PRES_FECH_DEVO"];
        $fldPRES_FECH_PRES = $rs->fields["PRES_FECH_PRES"];
        $fldPRES_ID = $rs->fields["PRES_ID"];
        $fldRADI_NUME_RADI = $rs->fields["RADI_NUME_RADI"];
        $fldUSUA_LOGIN_ACTU = $rs->fields["USUA_LOGIN_ACTU"];
        $fldUSUA_LOGIN_PRES = $rs->fields["USUA_LOGIN_PRES"];
        //-------------------------------
        // PRESTAMO ShowEdit Event begin
        // PRESTAMO ShowEdit Event end
        //-------------------------------
    } else {
        if ($sPRESTAMOErr == "") {
            $fldPRES_ID = tohtml(get_param("PRES_ID"));
        }
        //-------------------------------
        // PRESTAMO ShowInsert Event begin
        // PRESTAMO ShowInsert Event end
        //-------------------------------
    }
    //-------------------------------
    // PRESTAMO Show Event begin
    // PRESTAMO Show Event end
    //-------------------------------
    //-------------------------------
    // Show form field
    //-------------------------------
    ?>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Radicado</font>
       </td>
       <td class="DataTD">
         <font class="DataFONT">
      <?php 
    echo tohtml($fldRADI_NUME_RADI);
    ?>
&nbsp;</font>
       </td>
     </tr>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Usuario</font>
       </td>
       <td class="DataTD">
         <font class="DataFONT">
      <?php 
    echo tohtml($fldUSUA_LOGIN_ACTU);
    ?>
&nbsp;</font>
       </td>
     </tr>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Dependencia</font>
       </td>
       <td class="DataTD">
         <font class="DataFONT">
      <?php 
    echo tohtml($fldDEPE_CODI);
    ?>
&nbsp;</font>
       </td>
     </tr>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Prestó</font>
       </td>
       <td class="DataTD">
         <font class="DataFONT">
      <?php 
    echo tohtml($fldUSUA_LOGIN_PRES);
    ?>
&nbsp;</font>
       </td>
     </tr>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Descripcion</font>
       </td>
       <td class="DataTD">
         <font class="DataFONT">
      <?php 
    echo tohtml($fldPRES_DESC);
    ?>
&nbsp;</font>
       </td>
     </tr>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Fecha de préstamo</font>
       </td>
       <td class="DataTD">
         <font class="DataFONT">
      <?php 
    echo tohtml($fldPRES_FECH_PRES);
    ?>
&nbsp;</font>
       </td>
     </tr>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Fecha de devolución</font>
       </td>
       <td class="DataTD">
         <font class="DataFONT">
      <?php 
    echo tohtml($fldPRES_FECH_DEVO);
    ?>
&nbsp;</font>
       </td>
     </tr>
    <tr><td colspan="2" align="right">
  <input type="submit" value="O.K." onclick="document.PRESTAMO.FormAction.value = 'cancel';">
  <input type="hidden" name="FormName" value="PRESTAMO">
  
  <input type="hidden" name="PK_PRES_ID" value="<?php 
    echo $pPRES_ID;
    ?>
">  
  <input type="hidden" name="PRES_ID" value="<?php 
    echo tohtml($fldPRES_ID);
    ?>
">
  <input type="hidden" value="cancel" name="FormAction">
  
  </td></tr>
  </form>
  </table>
<?php 
    //-------------------------------
    // PRESTAMO Close Event begin
    // PRESTAMO Close Event end
    //-------------------------------
    //-------------------------------
    // PRESTAMO Show end
    //-------------------------------
}
function DMR_DM_PRESTAMO_show()
{
    global $db;
    global $sAction;
    global $sForm;
    global $sFileName;
    global $sPRESTAMOErr;
    global $styles;
    global $login_err;
    $fldPRES_ID = "";
    $fldRADI_NUME_RADI = "";
    $fldUSUA_LOGIN_ACTU = "";
    $fldDEPE_CODI = "";
    $fldPRES_FECH_PEDI = "";
    $fldPRES_REQUERIMIENTO = "";
    $fldUSUA_LOGIN_PRES = "";
    $fldPRES_FECH_PRES = "";
    $fldPRES_DESC = "";
    $fldPRES_ESTADO = "";
    //-------------------------------
    // PRESTAMO Show begin
    //-------------------------------
    $sFormTitle = "Devolución Masiva";
    $sWhere = "";
    $bPK = true;
    $fldPRES_FECH_DEVO = Date('d/m/Y h:i');
    ?>
   
   <table class="FormTABLE">
   <form method="POST" action="<?php 
    echo $sFileName;
    ?>
" name="PRESTAMO">
   <tr><td class="FormHeaderTD" colspan="2"><font class="FormHeaderFONT"><?php 
    echo $sFormTitle;
    ?>
</font></td></tr>
   <?php 
    if ($sPRESTAMOErr) {
        ?>
		<tr><td class="DataTD" colspan="2"><font class="ErrorFONT"><?php 
        echo $sPRESTAMOErr;
        ?>
</font></td></tr>
	 <?php 
    }
    ?>
    <?php 
    if (strlen($login_err)) {
        ?>
    <tr><td colspan="2"><font Class="ErrorFONT"><?php 
        echo $login_err;
        ?>
</font></td></tr>
    <?php 
    }
    ?>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Fecha de devolución</font>
       </td>
       <td class="DataTD">
         <font class="DataFONT"><input type="hidden" name="PRES_FECH_DEVO" maxlength="15" value="<?php 
    echo tohtml($fldPRES_FECH_DEVO);
    ?>
" size="15" ><?php 
    echo $fldPRES_FECH_DEVO;
    ?>
</font>
       </td>
     </tr>

<?php 
    //-------------------------------
    // PRESTAMO Show Event begin
    // PRESTAMO Show Event end
    //-------------------------------
    //-------------------------------
    // Load primary key and form parameters
    //-------------------------------
    if ($sPRESTAMOErr == "") {
        $rqd_PRES_ID = get_param("PRES_ID");
        $pPRES_ID = get_param("PRES_ID");
        $fldUSUA_LOGIN_ACTU = strip(strtoupper(get_param("usuario")));
    } else {
        $fldUSUA_LOGIN_PRES = strip(get_param("USUA_LOGIN_PRES"));
        $fldUSUA_LOGIN_ACTU = strip(get_param("USUA_LOGIN_ACTU"));
        $fldPRES_FECH_PRES = strip(get_param("PRES_FECH_PRES"));
        $pPRES_ID = get_param("PK_PRES_ID");
    }
    //-------------------------------
    //-------------------------------
    // Load all form fields
    //-------------------------------
    //-------------------------------
    // Build WHERE statement
    //-------------------------------
    $usuario = get_param("usuario");
    $usuario = strtoupper($usuario);
    if (!strlen($usuario)) {
        $bPK = false;
    }
    $sWhere .= "USUA_LOGIN_ACTU=" . tosql($usuario, "text") . " AND (PRES_ESTADO=2 OR PRES_ESTADO=5)";
    // Prestado = 2...
    //-------------------------------
    //-------------------------------
    // PRESTAMO Open Event begin
    // PRESTAMO Open Event end
    //-------------------------------
    //-------------------------------
    // Build SQL statement and execute query
    //-------------------------------
    $radiATexto = $db->conn->numToString("RADI_NUME_RADI");
    $sSQL = "select PRES_ID,\n\t\t\t{$radiATexto} as RADI_NUME_RADI,\n\t\t\tUSUA_LOGIN_ACTU,\n\t\t\tDEPE_CODI,\n\t\t\tUSUA_LOGIN_PRES,\n\t\t\tPRES_DESC,\n\t\t\tPRES_FECH_PRES,\n\t\t\tPRES_FECH_DEVO,\n\t\t\tPRES_FECH_PEDI,\n\t\t\tPRES_ESTADO,\n\t\t\tPRES_REQUERIMIENTO,\n\t\t\tPRES_DEPE_ARCH,\n\t\t\tPRES_FECH_VENC\n   from PRESTAMO where " . $sWhere;
    // Execute SQL statement
    $db->conn->SetFetchMode(ADODB_FETCH_ASSOC);
    $rs = $db->query($sSQL);
    $db->conn->SetFetchMode(ADODB_FETCH_NUM);
    //-------------------------------
    //-------------------------------
    // Load lists of values
    //-------------------------------
    $aPRES_REQUERIMIENTO = split(";", "1;Documento;2;Anexo");
    //-------------------------------
    //-------------------------------
    // Load all fields into variables from recordset or input parameters
    //-------------------------------
    $contador = 0;
    while ($bPK && ($rs && !$rs->EOF)) {
        $contador++;
        $fldDEPE_CODI = $rs->fields["DEPE_CODI"];
        $fldPRES_FECH_PEDI = $rs->fields["PRES_FECH_PEDI"];
        $fldPRES_FECH_VENC = $rs->fields["PRES_FECH_VENC"];
        $fldPRES_ID = $rs->fields["PRES_ID"];
        $fldPRES_REQUERIMIENTO = $rs->fields["PRES_REQUERIMIENTO"];
        $fldRADI_NUME_RADI = $rs->fields["RADI_NUME_RADI"];
        $fldUSUA_LOGIN_ACTU = $rs->fields["USUA_LOGIN_ACTU"];
        //-------------------------------
        // Load data from recordset when form displayed first time
        //-------------------------------
        if ($sPRESTAMOErr == "") {
            $fldUSUA_LOGIN_PRES = $rs->fields["USUA_LOGIN_PRES"];
            $fldPRES_FECH_PRES = $rs->fields["PRES_FECH_PRES"];
            $fldPRES_DESC = $rs->fields["PRES_DESC"];
            $fldPRES_ESTADO = $rs->fields["PRES_ESTADO"];
        } else {
            $fldPRES_DESC = strip(get_param("PRES_DESC_" . $contador));
            $fldPRES_ESTADO = strip(get_param("PRES_ESTADO_" . $contador));
            $fldPRES_ID = strip(get_param("PRES_ID_" . $contador));
        }
        //-------------------------------
        // Set lookup fields
        //-------------------------------
        $fldDEPE_CODI = get_db_value("SELECT DEPE_NOMB FROM DEPENDENCIA WHERE DEPE_CODI=" . tosql($fldDEPE_CODI, "Number"));
        //-------------------------------
        // Show form field
        //-------------------------------
        ?>

<tr><td colspan="2"><HR></td></tr>
	<tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Radicado</font>
       </td>
       <td class="DataTD">
         <font class="DataFONT">
      <?php 
        echo tohtml($fldRADI_NUME_RADI);
        ?>
&nbsp;</font>
       </td>
     </tr>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Fecha de Vencimiento</font>
       </td>
       <td class="DataTD">
         <font class="DataFONT"><?php 
        echo $fldPRES_FECH_VENC;
        ?>
</font>
       </td>
     </tr>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Requerimiento</font>
       </td>
       <td class="DataTD">
         <font class="DataFONT">
      <?php 
        $fldPRES_REQUERIMIENTO = get_lov_value($fldPRES_REQUERIMIENTO, $aPRES_REQUERIMIENTO);
        ?>
      <?php 
        echo tohtml($fldPRES_REQUERIMIENTO);
        ?>
&nbsp;</font>
       </td>
     </tr>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Observaciones extras</font>
       </td>
       <td class="DataTD"><?php 
        $nombreCampo = "PRES_DESC_" . $contador;
        ?>
         <font class="DataFONT"><textarea name="<?php 
        echo $nombreCampo;
        ?>
" cols="50" rows="5"><?php 
        echo tohtml($fldPRES_DESC);
        ?>
</textarea></font>
       </td>
     </tr>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Estado</font>
       </td>
       <td class="DataTD"><?php 
        $nombreCampo = "PRES_ESTADO_" . $contador;
        ?>
         <font class="DataFONT"><select name="<?php 
        echo $nombreCampo;
        ?>
">
<?php 
        $LOV = split(";", "3;Devolver;1;No hacer nada;");
        if (sizeof($LOV) % 2 != 0) {
            $array_length = sizeof($LOV) - 1;
        } else {
            $array_length = sizeof($LOV);
        }
        for ($i = 0; $i < $array_length; $i = $i + 2) {
            if ($LOV[$i] == $fldPRES_ESTADO) {
                $option = "<option SELECTED value=\"" . $LOV[$i] . "\">" . $LOV[$i + 1];
            } else {
                $option = "<option value=\"" . $LOV[$i] . "\">" . $LOV[$i + 1];
            }
            echo $option;
        }
        ?>
</select></font>
       </td>
     </tr>

<?php 
        $nombreCampo = "PRES_ID_" . $contador;
        ?>
  <input type="hidden" name="<?php 
        echo $nombreCampo;
        ?>
" value="<?php 
        echo tohtml($fldPRES_ID);
        ?>
">
<?php 
        $rs->MoveNext();
    }
    if ($contador == 0) {
        ?>
	<tr><td colspan="2"><HR></td></tr>
	<tr><td colspan="2"><font class="DataFONT">No hay documentos para prestar</font></td></tr>
<?php 
    }
    ?>

    <tr><td colspan="2" align="right">
<?php 
    if ($bPK && $contador != 0) {
        ?>
  <input type="hidden" value="update" name="FormAction"/>
  <input type="submit" value="Devolver/Cancelar" onclick="document.PRESTAMO.FormAction.value = 'update';">
<?php 
    }
    ?>
  <input type="submit" value="No hacer nada" onclick="document.PRESTAMO.FormAction.value = 'cancel';">
  <input type="hidden" name="FormName" value="DEVOLVER">
  <input type="hidden" name="NumContador" value="<?php 
    echo $contador;
    ?>
">
  
  </td></tr>
  </form>
  </table>
<?php 
    //-------------------------------
    // PRESTAMO Close Event begin
    // PRESTAMO Close Event end
    //-------------------------------
    //-------------------------------
    // PRESTAMO Show end
    //-------------------------------
}
	    </tr>		
		<tr>
	      <td width="100%">
	          <table border="1" cellpadding="0" cellspacing="0" width="100%">
	            <tr class="trform">
	              <td width="100%">&nbsp;<?php 
echo _ADMIN_ADD_EDIT_CONTACT_1_OTHER;
?>
</td>
				</tr>
				<tr>
	              <td width="30%" class="tdinput" align="center">
					<textarea name="other" cols="40" rows="5">
					<?php 
if ($action == "update") {
    echo strip($contact->studentcontact_other);
} else {
    echo $_POST['other_1'];
}
?>
					</textarea>
		          </td>
	            </tr>
	          </table>
		  </td>
	    </tr>		
      </td>
    </tr>
    <tr>
      <td width="100%" align="right">
	   <input type="submit" name="sumbit" value="<?php 
예제 #7
0
 /**
  * Access control: Abstract (original)
  * @return string
  */
 public function getExcerptAttribute($value)
 {
     return strip($value);
 }
예제 #8
0
 /**
  * 生成图像
  *
  * @param  string  $phrase
  * @return resource
  * @throws Exception
  */
 public function generateImage($phrase = null)
 {
     null == $phrase && ($phrase = $this->generatePhrase());
     extract($this->_options);
     //解出参数到变量
     $image = $this->_createImage();
     //创建图像
     $defaultSize = min($width, $height * 2) / (strlen($phrase) + 1);
     $spacing = (int) ($width * 0.9 / strlen($phrase));
     empty($fonts) && ($fonts = YUN_Io::scan(strip($fontDir)));
     if (empty($fonts)) {
         throw new Exception('未找到任何有效的字体文件');
     }
     for ($i = 0, $strlen = strlen($phrase); $i < $strlen; $i++) {
         $font = $fontDir . '/' . $fonts[array_rand($fonts)];
         $color = imagecolorallocate($image, mt_rand(0, 160), mt_rand(0, 160), mt_rand(0, 160));
         $angle = mt_rand(-30, 30);
         $size = $defaultSize / 10 * mt_rand(12, 14);
         $box = imageftbbox($size, $angle, $font, $phrase[$i]);
         $x = $spacing / 4 + $i * $spacing + 2;
         $y = $height / 2 + ($box[2] - $box[5]) / 4;
         imagefttext($image, $size, $angle, $x, $y, $color, $font, $phrase[$i]);
     }
     $this->_image = $image;
     return $this->_image;
 }
예제 #9
0
 /**
  * Prints out a table containing the method name and its
  * properties.
  * 
  * @param string $name The name of the method.
  * @param array $methodproperties The method properties, the information in the method table.
  */
 function _printMethod($name, $methodproperties, $selected)
 {
     // header - Method name and link
     $method = '<div id="methods">';
     $method .= '<table class="methodTable" style="width:100%" cellspacing="2" cellpadding="3">';
     $method .= '<tr class="header"><td class="header" colspan=2>';
     $method .= $name . ' - ' . substr($methodproperties['description'], 0, 80) . '</td>';
     $method .= '</td></tr>';
     foreach ($methodproperties as $property => $value) {
         if (!is_array($value)) {
             $method .= $this->_printMethodProp($property, $value);
         } else {
             $method .= $this->_printArgs($property, $value);
         }
     }
     $methodName = $name;
     if ($methodproperties['access'] == 'remote') {
         $arguments = $this->testMethod($name);
         $method .= '<form action="' . $_SERVER['PHP_SELF'] . '?class=' . substr($this->_classpath, 0, -4) . '&method=' . $name . '&action=exec" method="POST" id="form">' . "\n";
         $method .= '<tr><td class="formcaption" colspan="2">Arguments</td></tr>' . "\n";
         $key = 0;
         foreach ($arguments as $key => $name) {
             $method .= '<tr class="caption"><td class="key">' . $name . '</td><td><input class="inputbox" type="text" name="' . $methodName . '_arguments[]" maxlength="65535" value="' . htmlspecialchars(strip($_POST[$methodName . "_arguments"][$key])) . '"/></td></tr>' . "\n";
         }
         //$method .= '<tr><td class="formcaption" colspan="2">Optional arguments</td></tr>';
         //for($i = 0; $i < 5; $i++) {
         //    $method .= '<tr class="inputrow"><td class="key">arg' . ($i + 1) . '</td><td><input class="inputbox" type="text" name="' . $methodName . '_arguments[]" maxlength="65535" value="' . htmlspecialchars(strip($_POST[$methodName . "_arguments"][$i + $key + 1])) . '"/></td></tr>'."\n";
         //}
         $method .= '<tr><td class="formcaption" colspan="2">Authentication</td></tr>' . "\n";
         $method .= '<tr class="inputrow"><td class="key">Username</td><td><input class="inputbox" type="text" name="username" maxlength="65535" value="' . htmlspecialchars(strip($_POST['username'])) . '"/></td></tr>' . "\n";
         $method .= '<tr class="inputrow"><td class="key">Password</td><td><input class="inputbox" type="text" name="password" maxlength="65535" value="' . htmlspecialchars(strip($_POST['password'])) . '"/></td></tr>' . "\n";
         $method .= '<tr class="inputrow"><td colspan="2" class="submitbtn"><input type="submit">' . "\n";
         $method .= '</td></tr></form>' . "\n";
     }
     $method .= '</table></div>';
     return $method;
 }
예제 #10
0
function D_PRESTAMO_show()
{
    global $db;
    global $sAction;
    global $sForm;
    global $sFileName;
    global $sPRESTAMOErr;
    global $styles;
    $fldPRES_ID = "";
    $fldPRES_FECH_DEVO = "";
    $fldPRES_DESC = "";
    $fldPRES_ESTADO = "";
    //-------------------------------
    // PRESTAMO Show begin
    //-------------------------------
    $sFormTitle = "Devolucion";
    $sWhere = "";
    $bPK = true;
    ?>
   
   <table class="FormTABLE">
   <form method="POST" action="<?php 
    echo $sFileName;
    ?>
" name="PRESTAMO">
   <tr><td class="FormHeaderTD" colspan="2"><font class="FormHeaderFONT"><?php 
    echo $sFormTitle;
    ?>
</font></td></tr>
   <?php 
    if ($sPRESTAMOErr) {
        ?>
		<tr><td class="DataTD" colspan="2"><font class="DataFONT"><?php 
        echo $sPRESTAMOErr;
        ?>
</font></td></tr>
	 <?php 
    }
    //-------------------------------
    // Load primary key and form parameters
    //-------------------------------
    if ($sPRESTAMOErr == "") {
        $fldPRES_ID = get_param("PRES_ID");
        $pPRES_ID = get_param("PRES_ID");
    } else {
        $fldPRES_ID = strip(get_param("PRES_ID"));
        $fldPRES_FECH_DEVO = strip(get_param("PRES_FECH_DEVO"));
        $fldPRES_DESC = strip(get_param("PRES_DESC"));
        $fldPRES_ESTADO = strip(get_param("PRES_ESTADO"));
        $pPRES_ID = get_param("PK_PRES_ID");
    }
    //-------------------------------
    //-------------------------------
    // Load all form fields
    //-------------------------------
    //-------------------------------
    // Build WHERE statement
    //-------------------------------
    if (!strlen($pPRES_ID)) {
        $bPK = false;
    }
    $sWhere .= "PRES_ID=" . tosql($pPRES_ID, "Number");
    //-------------------------------
    //-------------------------------
    // PRESTAMO Open Event begin
    // PRESTAMO Open Event end
    //-------------------------------
    //-------------------------------
    // Build SQL statement and execute query
    //-------------------------------
    $sSQL = "select * from PRESTAMO where " . $sWhere;
    // Execute SQL statement
    $rs = $db->query($sSQL);
    $bIsUpdateMode = $bPK && !($sAction == "insert" && $sForm == "PRESTAMO") && ($rs && !$rs->EOF);
    //-------------------------------
    //-------------------------------
    // Load all fields into variables from recordset or input parameters
    //-------------------------------
    if ($bIsUpdateMode) {
        $fldPRES_ID = $rs->fields["PRES_ID"];
        //-------------------------------
        // Load data from recordset when form displayed first time
        //-------------------------------
        if ($sPRESTAMOErr == "") {
            $fldPRES_FECH_DEVO = $rs->fields["PRES_FECH_DEVO"];
            $fldPRES_DESC = $rs->fields["PRES_DESC"];
            $fldPRES_ESTADO = $rs->fields["PRES_ESTADO"];
        }
        //-------------------------------
        // PRESTAMO ShowEdit Event begin
        // PRESTAMO ShowEdit Event end
        //-------------------------------
    } else {
        if ($sPRESTAMOErr == "") {
            $fldPRES_ID = tohtml(get_param("PRES_ID"));
            $fldPRES_FECH_DEVO = Date('d-M-y');
        }
        //-------------------------------
        // PRESTAMO ShowInsert Event begin
        // PRESTAMO ShowInsert Event end
        //-------------------------------
    }
    if ($sPRESTAMOErr == "") {
        //-------------------------------
        // PRESTAMO Show Event begin
        $fldPRES_FECH_DEVO = Date('d/m/Y h:i');
        // PRESTAMO Show Event end
        //-------------------------------
    }
    //-------------------------------
    // Show form field
    //-------------------------------
    ?>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Fecha de devolución</font>
       </td>
       <td class="DataTD">
         <font class="DataFONT"><input type="hidden" name="PRES_FECH_DEVO" maxlength="15" value="<?php 
    echo tohtml($fldPRES_FECH_DEVO);
    ?>
" size="15" ><?php 
    echo $fldPRES_FECH_DEVO;
    ?>
</font>
       </td>
     </tr>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Observaciones extras</font>
       </td>
       <td class="DataTD">
         <font class="DataFONT"><textarea name="PRES_DESC" cols="50" rows="5"><?php 
    echo tohtml($fldPRES_DESC);
    ?>
</textarea></font>
       </td>
     </tr>
      <tr>
       <td class="FieldCaptionTD">
         <font class="FieldCaptionFONT">Estado</font>
       </td>
       <td class="DataTD">
         <font class="DataFONT"><select name="PRES_ESTADO">
<?php 
    $LOV = split(";", "3;Devuelto;");
    if (sizeof($LOV) % 2 != 0) {
        $array_length = sizeof($LOV) - 1;
    } else {
        $array_length = sizeof($LOV);
    }
    for ($i = 0; $i < $array_length; $i = $i + 2) {
        if ($LOV[$i] == $fldPRES_ESTADO) {
            $option = "<option SELECTED value=\"" . $LOV[$i] . "\">" . $LOV[$i + 1];
        } else {
            $option = "<option value=\"" . $LOV[$i] . "\">" . $LOV[$i + 1];
        }
        echo $option;
    }
    ?>
</select></font>
       </td>
     </tr>
    <tr><td colspan="2" align="right">
<?php 
    if ($bIsUpdateMode) {
        ?>
  <input type="hidden" value="update" name="FormAction"/>
  <input type="submit" value="Devolver" onclick="document.PRESTAMO.FormAction.value = 'update';">
<?php 
    }
    ?>
  <input type="submit" value="Cancelar" onclick="document.PRESTAMO.FormAction.value = 'cancel';">
  <input type="hidden" name="FormName" value="PRESTAMO">
  
  <input type="hidden" name="PK_PRES_ID" value="<?php 
    echo $pPRES_ID;
    ?>
">  
  <input type="hidden" name="PRES_ID" value="<?php 
    echo tohtml($fldPRES_ID);
    ?>
">
  </td></tr>
  </form>
  </table>
<?php 
    //-------------------------------
    // PRESTAMO Close Event begin
    // PRESTAMO Close Event end
    //-------------------------------
    //-------------------------------
    // PRESTAMO Show end
    //-------------------------------
}
예제 #11
0
파일: sql.php 프로젝트: abdeljawwad/sedr
function run_sqls()
{
    global $SIDU;
    $conn = $SIDU['conn'][$SIDU[0]];
    $eng = $conn[1];
    $cook = $SIDU['cook'][$SIDU[0]];
    @tm_use_db($cook[1], $cook[2]);
    if ($_GET['sql'] == 'show vars') {
        $_POST['sqlcur'] = $eng == 'pg' ? 'SHOW ALL' : 'SHOW VARIABLES';
    } elseif (@substr($_GET['sql'], 0, 6) == 'FLUSH ') {
        if ($_GET['sql'] == 'FLUSH ALL') {
            $_POST['sqlcur'] = "FLUSH LOGS;\nFLUSH HOSTS;\nFLUSH PRIVILEGES;\nFLUSH TABLES;\nFLUSH STATUS;\nFLUSH DES_KEY_FILE;\nFLUSH QUERY CACHE;\nFLUSH USER_RESOURCES;\nFLUSH TABLES WITH READ LOCK";
        } else {
            $_POST['sqlcur'] = $_GET['sql'];
        }
    } elseif (@substr($_GET['sql'], 0, 9) == 'STATScol:') {
        $_POST['sqlcur'] = "SELECT " . @goodname(@substr($_GET['sql'], 9)) . ",count(*) FROM " . @goodname($cook[4]) . " GROUP BY 1 ORDER BY 2 DESC,1 LIMIT 20";
    } elseif ($_GET['sql']) {
        $_POST['sqlcur'] = $_GET['sql'];
    }
    $arr = @explode(chr(10), @strip($_POST['sqlcur'], 1, 0, 1));
    foreach ($arr as $v) {
        $v = @trim($v);
        if ($v) {
            $arr2[] = $v;
        }
    }
    $txt = @implode(chr(10), $arr2);
    $arr = @explode(";" . chr(10), $txt);
    foreach ($arr as $i => $sql) {
        $time_start = @microtime(true);
        $res = $eng == 'my' ? @mysql_query($sql) : ($eng == 'pg' ? @pg_query($sql) : @sqlite_query($SIDU['dbL'], $sql));
        $time_end = @microtime(true);
        $time = @round(($time_end - $time_start) * 1000);
        $SIDU[5] += $time;
        $err = @sidu_err(1);
        $RES[$i][0] = $sql;
        if ($err) {
            $RES[$i][1] = $err;
            $SIDU[8]++;
        } else {
            $RES[$i][3] = $eng == 'my' ? @mysql_num_rows($res) : ($eng == 'pg' ? @pg_num_rows($res) : @sqlite_num_rows($res));
            if ($eng == 'pg' && !$RES[$i][3]) {
                $RES[$i][2] = @pg_affected_rows($res);
                if (!$RES[$i][2]) {
                    unset($RES[$i][2]);
                }
            }
            //there is no function: sqlite_affected_rows()
            if ($RES[$i][3] === false && $eng == 'my') {
                $RES[$i][2] = @mysql_affected_rows();
            }
            if (!isset($SIDU[6]) && $RES[$i][3] !== false) {
                $SIDU[6] = $i;
                $RES[$i][5] = @get_sql_col($res, $eng);
                $RES[$i][6] = @get_sql_data($res, $eng);
            } elseif ($_POST['sqlmore'] && $RES[$i][3] !== false) {
                $RES[$i][5] = @get_sql_col($res, $eng);
                $RES[$i][6] = @get_sql_data($res, $eng);
            }
            $RES[$i][4] = $time;
        }
        @tm_his_log('S', $sql, $time, $err);
    }
    $SIDU[7] = ++$i;
    $SIDU['RES'] = $RES;
    //reset cookie
    if ($eng == 'my') {
        $db = @mysql_fetch_row(@mysql_query("SELECT database()"));
        if ($db[0] != $cook[1]) {
            $ck = @array($conn[0], $db[0]);
        }
    } elseif ($eng == 'pg') {
        $db[0] = @pg_dbname();
        if ($db[0] != $cook[1]) {
            $ck = @array($conn[0], $db[0]);
        } else {
            //sch
            $sch = pg_fetch_row(pg_query("SHOW search_path"));
            if (@substr($sch[0], 0, 8) == '"$user",') {
                $sch[0] = @substr($sch[0], 8);
            }
            $sch[0] = @str_replace('"', '', $sch[0]);
            if ($sch[0] != $cook[2]) {
                $ck = @array($conn[0], $cook[1], $sch[0]);
            }
        }
    }
    if (isset($ck)) {
        @update_sidu_cook($ck);
    }
}
예제 #12
0
function Pedidos_Show()
{
    // De sesi�n
    global $db;
    global $krd;
    //usuario actual
    global $dependencia;
    //dependencia del usuario actual
    global $ruta_raiz;
    // Control de visualizaci�n
    global $sFileName;
    global $opcionMenu;
    global $pageAnt;
    // Pagina de la cual viene
    // Valores
    global $fechaFinal;
    global $fechaInicial;
    // Set variables with search parameters
    $ps_PRES_ESTADO = strip(get_param("s_PRES_ESTADO"));
    $ps_RADI_NUME_RADI = strip(trim(get_param("s_RADI_NUME_RADI")));
    $ps_USUA_LOGIN = strip(trim(get_param("s_USUA_LOGIN")));
    $ps_DEPE_NOMB = strip(get_param("s_DEPE_NOMB"));
    $ps_USUA_NOMB = strip(get_param("s_USUA_NOMB"));
    $ps_hora_limite = strip(get_param("s_hora_limite"));
    $ps_minuto_limite = strip(get_param("s_minuto_limite"));
    $ps_meridiano = strip(get_param("s_meridiano"));
    $ps_PRES_REQUERIMIENTO = strip(get_param("s_PRES_REQUERIMIENTO"));
    if (strlen($pageAnt) == 0) {
        // Build SQL
        include_once $ruta_raiz . "/include/query/prestamo/builtSQL1.inc";
        include_once $ruta_raiz . "/include/query/prestamo/builtSQL2.inc";
        include_once $ruta_raiz . "/include/query/prestamo/builtSQL3.inc";
        // Build ORDER statement
        $iSort = strip(get_param("FormPedidos_Sorting"));
        $iSorted = strip(get_param("FormPedidos_Sorted"));
        $sDirection = strip(get_param("s_Direction"));
        if ($iSorted != $iSort) {
            $sDirection = " DESC ";
        } else {
            if (strcasecmp($sDirection, " DESC ") == 0) {
                $sDirection = " ASC ";
            } else {
                $sDirection = " DESC ";
            }
        }
        $sOrder = " order by " . $iSort . $sDirection . ",PRESTAMO_ID";
        // Inicializa el titulo y la visibilidad de los resultados
        include_once "inicializarRTA.inc";
        // Execute SQL statement
        $db->conn->SetFetchMode(ADODB_FETCH_ASSOC);
        $rs = $db->query($sSQL . $sOrder);
        $db->conn->SetFetchMode(ADODB_FETCH_NUM);
        // Process empty recordset
        if (!$rs || $rs->EOF) {
            ?>
            <p align="center" class="titulosError2">NO HAY REGISTROS SELECCIONADOS</p>
<?php 
            return;
        }
        // Build parameters for order
        $form_params_search = "s_RADI_NUME_RADI=" . tourl($ps_RADI_NUME_RADI) . "&s_USUA_LOGIN="******"&s_DEPE_NOMB=" . tourl($ps_DEPE_NOMB) . "&s_USUA_NOMB=" . tourl($ps_USUA_NOMB) . "&s_PRES_REQUERIMIENTO=" . tourl($ps_PRES_REQUERIMIENTO) . "&s_PRES_ESTADO=" . tourl($ps_PRES_ESTADO) . "&fechaInicial=" . tourl($fechaInicial) . "&fechaFinal=" . tourl($fechaFinal) . "&s_hora_limite=" . tourl($ps_hora_limite) . "&s_minuto_limite=" . tourl($ps_minuto_limite) . "&s_meridiano=" . tourl($ps_meridiano);
        $form_params_page = "&FormPedidos_Page=1&FormStarPage=1&FormSiguiente=0";
        $form_params = $form_params_search . $form_params_page . "&opcionMenu=" . tourl($opcionMenu) . "&krd=" . tourl($krd) . "&FormPedidos_Sorted=" . tourl($iSort) . "&s_Direction=" . tourl($sDirection) . "&FormPedidos_Sorting=";
        // HTML column prestamo headers
        ?>
      <form method="post" action="prestamo.php" name="rta">
         <input type="hidden"  value='<?php 
        echo $krd;
        ?>
' name="krd">					 					 					 		 
         <input type="hidden" value=" " name="radicado">  	 
         <input type="hidden" value="" name="prestado">  	 
	     <input type="hidden" name="opcionMenu" value="<?php 
        echo $opcionMenu;
        ?>
">	  
         <!-- orden de presentaci�n del resultado en el formulario de envio !-->	  		 		 
   	     <input type="hidden" name="FormPedidos_Sorting" value="<?php 
        echo $iSort;
        ?>
">
	     <input type="hidden" name="FormPedidos_Sorted" value="<?php 
        echo $iSorted;
        ?>
">
         <input type="hidden" name="s_Direction" value="<?php 
        echo $sDirection;
        ?>
">
         <table border=0 cellpadding=0 cellspacing=2 class='borde_tab' width="100%">
         <tr>
            <td class="titulos4" colspan="<?php 
        echo $numCol;
        ?>
"><a name="Search"><?php 
        echo $tituloRespuesta[$opcionMenu];
        ?>
</a></td>
         </tr>		   	  	  		 		 		 	  
<?php 
        // Titulos de las columnas
        include_once "inicializarTabla.inc";
        //----------------------
        // Process page scroller
        //----------------------
        // Initialize records per page
        $iRecordsPerPage = 15;
        // Inicializa el valor de la pagina actual
        $iPage = intval(get_param("FormPedidos_Page"));
        // Inicializa los registros a presentar seg�n la p�gina actual
        $iCounter = 0;
        $ant = "";
        if ($iPage > 1) {
            do {
                $new = $rs->fields["PRESTAMO_ID"];
                if ($new != $ant) {
                    $iCounter++;
                    $ant = $new;
                }
                $rs->MoveNext();
            } while ($iCounter < ($iPage - 1) * $iRecordsPerPage && !$rs->EOF);
        }
        $iCounterIni = $iCounter;
        // Display grid based on recordset
        $y = 0;
        // Cantidad de registros presentados
        include_once "getRtaSQLAntIn.inc";
        //Une en un solo campo los expedientes
        while ($rs && !$rs->EOF && $y < $iRecordsPerPage) {
            // Inicializa las variables con los resultados
            include "getRtaSQL.inc";
            if ($antfldPRESTAMO_ID != $fldPRESTAMO_ID) {
                //Une en un solo campo los expedientes
                if ($y != 0) {
                    include "cuerpoTabla.inc";
                }
                // Fila de la tabla con los resultados
                include "getRtaSQLAnt.inc";
                $y++;
            } else {
                if ($antfldEXP != "") {
                    $antfldEXP .= "<br>";
                    $antfldARCH .= "<br>";
                }
                $antfldEXP .= $fldEXP;
                if ($fldARCH == 'SI') {
                    $encabARCH = session_name() . "=" . session_id() . "&buscar_exp=" . tourl($fldEXP) . "&krd={$krd}&tipo_archivo=&nomcarpeta=";
                    $antfldARCH .= "<a href='javascript: void(0)' onclick=\"popup('{$ruta_raiz}/expediente/datos_expediente.php?{$encabARCH}&num_expediente=" . tourl($fldEXP) . "&ent=1&nurad=" . tourl($antfldRADICADO) . "')\" class='vinculos'>" . $fldARCH . "</a>";
                    //href="javascript: void(0)" onclick="popup('popup.html')"
                } else {
                    $antfldARCH .= $fldARCH;
                }
            }
            $rs->MoveNext();
        }
        if ($y != 0) {
            include "cuerpoTabla.inc";
            // Fila de la tabla con lso resultados
            $y++;
        }
        $cantRegPorPagina = $y;
        $iCounter = $iCounter + $y;
        ?>
        <script>
		   // Inicializa el arreglo con los radicados a procesar
		   var cantRegPorPagina=<?php 
        echo $cantRegPorPagina - 1;
        ?>
;	   		   
		   // Marca todas las casillas si la del titulo es marcada
		   function seleccionarRta() {
		      valor=document.rta.rta_.checked;
<?php 
        for ($j = 0; $j < $cantRegPorPagina; $j++) {
            ?>
              document.rta.rta_<?php 
            echo $j;
            ?>
.checked=valor;			  
<?php 
        }
        ?>
           }
		   // Valida y envia el formulario
		   function enviar() {			  
		      var cant=0;
			  for (i=0; i<cantRegPorPagina; i++) {
			     if (eval('document.rta.rta_'+i+'.checked')==true){ 
				    cant=1;
					break;
				}
			  }
			  if (cant==0) { alert("Debe seleccionar al menos un radicado"); }
			  else { 
			     document.rta.prestado.value=cantRegPorPagina;			  			  
			     document.rta.action="formEnvio.php";
				 document.rta.submit();
			  }
		   }
		   // Regresa al men� de pr�stamos
		   function regresar() {
		       document.rta.opcionMenu.value="";
               document.rta.action="menu_prestamo.php";			   			   
               document.rta.submit();
		   }		
        </script>  
<?php 
        // Build parameters for page
        if (strcasecmp($sDirection, " DESC ") == 0) {
            $sDirectionPages = " ASC ";
        } else {
            $sDirectionPages = " DESC ";
        }
        $form_params_page = $form_params_search . "&opcionMenu=" . tourl($opcionMenu) . "&FormPedidos_Sorted=" . tourl($iSort) . "&s_Direction=" . tourl($sDirectionPages) . "&krd=" . tourl($krd) . "&FormPedidos_Sorting=" . tourl($iSort);
        // N�mero total de registros
        $ant = $antfldPRESTAMO_ID;
        while ($rs && !$rs->EOF) {
            $new = $rs->fields["PRESTAMO_ID"];
            //para el manejo de expedientes
            if ($new != $ant) {
                $ant = $new;
                $iCounter++;
            }
            $rs->MoveNext();
        }
        $iCounter--;
        // Inicializa p�ginas visualizables
        $iNumberOfPages = 10;
        // Inicializa cantidad de p�ginas
        $iHasPages = intval($iCounter / $iRecordsPerPage);
        if ($iCounter % $iRecordsPerPage != 0) {
            $iHasPages++;
        }
        // Determina la p�gina inicial del intervalo
        $iStartPages = 1;
        $FormSiguiente = get_param("FormSiguiente");
        //Indica si (1) el n�mero de p�ginas es mayor al visualizable
        if ($FormSiguiente == 0) {
            $iStartPages = get_param("FormStarPage");
        } elseif ($FormSiguiente == -1) {
            $iStartPages = $iPage;
        } else {
            if ($iPage > $iNumberOfPages) {
                $iStartPages = $iPage - $iNumberOfPages + 1;
            }
        }
        // Genera las p�ginas visualizables
        $sPages = "";
        if ($iHasPages > $iNumberOfPages) {
            if ($iStartPages == 1) {
                $sPages .= "|<  <<   ";
            } else {
                $sPages .= "<a href=\"{$sFileName}?{$form_params_page}&FormPedidos_Page=1&FormStarPage=1&FormSiguiente=0&\">\n\t\t\t             <font class=\"ColumnFONT\" title=\"Ver la primera p&aacute;gina\">|<</font></a>&nbsp;";
                $sPages .= "&nbsp;<a href=\"{$sFileName}?{$form_params_page}&FormPedidos_Page=" . tourl($iStartPages - 1) . "&FormStarPage=" . tourl($iStartPages - 1) . "&FormSiguiente=-1&\"><font class=\"ColumnFONT\" title=\"Ver la p&aacute;gina " . ($iStartPages - 1) . "\"><<</font></a>&nbsp;&nbsp;&nbsp;";
            }
        }
        for ($iPageCount = $iStartPages; $iPageCount < $iStartPages + $iNumberOfPages; $iPageCount++) {
            if ($iPageCount <= $iHasPages) {
                $sPages .= "<a href=\"{$sFileName}?{$form_params_page}&FormPedidos_Page={$iPageCount}&FormStarPage=" . tourl($iStartPages) . "&FormSiguiente=0&\">\n\t\t\t             <font class=\"ColumnFONT\" title=\"Ver la p&aacute;gina " . $iPageCount . "\">" . $iPageCount . "</font></a>&nbsp;";
            } else {
                break;
            }
        }
        if ($iHasPages > $iNumberOfPages) {
            if ($iPageCount - 1 < $iHasPages) {
                $sPages .= "...&nbsp;&nbsp;<a href=\"{$sFileName}?{$form_params_page}&FormPedidos_Page={$iPageCount}&FormStarPage=" . tourl($iStartPages) . "&FormSiguiente=1&\"><font class=\"ColumnFONT\" title=\"Ver la p&aacute;gina " . $iPageCount . "\">>></font></a>&nbsp;&nbsp;";
                $sPages .= "&nbsp;<a href=\"{$sFileName}?{$form_params_page}&FormPedidos_Page={$iHasPages}&FormStarPage=tourl({$iStartPages})\n                         &FormSiguiente=1&\"><font class=\"ColumnFONT\" title=\"Ver la &uacute;ltima p&aacute;gina\">>|</font></a>";
            } else {
                $sPages .= "   >>  >|";
            }
        }
        ?>
         <tr class="titulos5" align="center">		 
            <td class="leidos" colspan="<?php 
        echo $numCol + 1;
        ?>
"><center><br><?php 
        echo $sPages;
        ?>
<br><br>P&aacute;gina <?php 
        echo $iPage;
        ?>
/<?php 
        echo $iHasPages;
        ?>
<br>
														   Total de Registros: <?php 
        echo $iCounter;
        ?>
<br>&nbsp;</center></td>
         </tr>
<?php 
        // Botones para procesar
        if ($tipoRespuesta[$opcionMenu][$numRtaMax] == "") {
            ?>
						
         <tr class="titulos4" align="center">		 
            <td class="listado1" colspan="<?php 
            echo $numCol + 1;
            ?>
" align="center"><center>
			<input type="button" class='botones' value="<?php 
            echo $tituloSubmitRta[$opcionMenu];
            ?>
" onClick="javascript:enviar();">
			<input type="button" class='botones' value="Cancelar" title="Regresa al men&uacute; de pr&eacute;stamo y control de documentos" onClick="javascript:regresar();"></center>
			</td>		
         </tr>				
<?php 
        }
        ?>
							 
      </table>
      </form>	  
<?php 
    }
    //fin if
}
예제 #13
0
         $serial = fread("", "/sys/block/" . $prefix . "/../../../../../../serial");
     } else {
         $serial = "";
     }
     $vendor = fread("", "/sys/block/" . $prefix . "/device/vendor");
     $model = fread("", "/sys/block/" . $prefix . "/device/model");
     $size = fread("", "/sys/block/" . $prefix . "/size") * 512;
     $cnt = query($XMLBASE . "/disk#") + 1;
     $diskp = $XMLBASE . "/disk:" . $cnt;
     set($XMLBASE . "/count", $cnt);
     set($diskp . "/uid", toupper($prefix));
     set($diskp . "/vendor", strip($vendor));
     set($diskp . "/model", strip($model));
     set($diskp . "/mfact", strip($mfact));
     set($diskp . "/product", strip($product));
     set($diskp . "/serial", strip($serial));
     set($diskp . "/size", $size);
 }
 if ($pid != "0" || $fs != "UNKNOWN") {
     /* add new entry */
     if ($base == "") {
         $cnt = query($diskp . "/entry#") + 1;
         $base = $diskp . "/entry:" . $cnt;
     } else {
         if ($fs != "UNKNOWN") {
             $cnt = query($diskp . "/entry#");
         } else {
             return;
         }
     }
     set($diskp . "/count", $cnt);
예제 #14
0
     $SERVER['ENABLE_SOUNDS'] = 1;
 }
 $XUSER['POPUPPM'] = $r[9];
 if (isset($changeroom)) {
     if ($room != @$X2CHATR && $room != "") {
         enterroom($room);
         $senduseragreeting = 1;
         @exitroom($X2CHATR);
     }
     $X2CHATR = $room;
     @setcookie("X2CHATR", "{$room}", time() + 14000000, "{$SERVER['PATH']}");
 }
 if ((@$X2CHATR == "" || !isset($X2CHATR)) && !isset($croom1) && !isset($croom2)) {
     $listrooms = true;
 }
 $ROOMS['IN_ROOM_NAME'] = @strip($X2CHATR);
 $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}rooms WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
 $row = Do_Fetch_Row($q);
 $ROOMS['id'] = $row[0];
 if ($row[2] == 1) {
     $ROOMS['TYPE'] = "Public";
 } else {
     $ROOMS['TYPE'] = "Private";
 }
 if ($row[3] == 1) {
     $ROOMS['LOG'] = "1";
     // Used to be ENCRYPTED but since encryption isn't supported I use this field for logging
 } else {
     $ROOMS['LOG'] = "0";
 }
 $ROOMS['GREETING'] = $row[4];
예제 #15
0
}
$verrad = "";
include_once "{$ruta_raiz}/include/db/ConnectionHandler.php";
$db = new ConnectionHandler($ruta_raiz);
/*********************************************************************************
 *       Filename: menu_prestamo.php
 *       Modificado: 
 *          1/3/2006  IIAC  Menú del módulo de préstamos. Carga e inicializa los
 *                          formularios.  
 *********************************************************************************/
// prestamo CustomIncludes begin
include "common.php";
// Save Page and File Name available into variables
$sFileName = "menu_prestamo.php";
// Variables de control
$opcionMenu = strip(get_param("opcionMenu"));
?>
<html>
<head>
   <title>Archivo - Manejo de prestamos y devoluciones</title>
   <link rel="stylesheet" href="../estilos/orfeo.css" type="text/css">
</head>
<body class="PageBODY">
   <form method="post" action="prestamo.php" name="menu"> 
      <input type="hidden" name="opcionMenu" value="1">      
      <input type="hidden" name="sFileName" value="<?php 
echo $sFileName;
?>
"> 
      <input type="hidden"  value='<?php 
echo $krd;
예제 #16
0
function OtrasEmpresas_show()
{
    //-------------------------------
    // Initialize variables
    //-------------------------------
    global $db;
    global $sRADICADOErr;
    global $sFileName;
    global $styles;
    $sWhere = "";
    $sOrder = "";
    $sSQL = "";
    $sFormTitle = "Radicados encontrados por Otras Empresas";
    $HasParam = false;
    $iRecordsPerPage = 25;
    $iCounter = 0;
    $iPage = 0;
    $bEof = false;
    $iSort = "";
    $iSorted = "";
    $sDirection = "";
    $sSortParams = "";
    $iTmpI = 0;
    $iTmpJ = 0;
    $sCountSQL = "";
    $transit_params = "";
    $form_params = trim(session_name()) . "=" . trim(session_id()) . "&krd={$krd}&s_RADI_DEPE_ACTU=" . tourl(get_param("s_RADI_DEPE_ACTU")) . "&s_RADI_NOMB=" . tourl(get_param("s_RADI_NOMB")) . "&s_RADI_NUME_RADI=" . tourl(get_param("s_RADI_NUME_RADI")) . "&s_TDOC_CODI=" . tourl(get_param("s_TDOC_CODI")) . "&s_desde_dia=" . tourl(get_param("s_desde_dia")) . "&s_desde_mes=" . tourl(get_param("s_desde_mes")) . "&s_desde_ano=" . tourl(get_param("s_desde_ano")) . "&s_hasta_dia=" . tourl(get_param("s_hasta_dia")) . "&s_hasta_mes=" . tourl(get_param("s_hasta_mes")) . "&s_hasta_ano=" . tourl(get_param("s_hasta_ano")) . "&s_solo_nomb=" . tourl(get_param("s_solo_nomb")) . "&s_ciudadano=" . tourl(get_param("s_ciudadano")) . "&s_empresaESP=" . tourl(get_param("s_empresaESP")) . "&s_oEmpresa=" . tourl(get_param("s_oEmpresa")) . "&s_entrada=" . tourl(get_param("s_entrada")) . "&s_salida=" . tourl(get_param("s_salida")) . "&";
    //-------------------------------
    // Build ORDER BY statement
    //-------------------------------
    $sOrder = " order by R.RADI_NUME_RADI Asc";
    $iSort = get_param("FormOEMPRESAS_Sorting");
    $iSorted = get_param("FormOEMPRESAS_Sorted");
    $krd = strip(get_param("krd"));
    if (!$iSort) {
        $form_sorting = "";
    } else {
        if ($iSort == $iSorted) {
            $form_sorting = "";
            $sDirection = " DESC ";
            $sSortParams = "FormOEMPRESAS_Sorting=" . $iSort . "&FormOEMPRESAS_Sorted=" . $iSort . "&";
        } else {
            $form_sorting = $iSort;
            $sDirection = " ASC ";
            $sSortParams = "FormOEMPRESAS_Sorting=" . $iSort . "&FormOEMPRESAS_Sorted=" . "&";
        }
        if ($iSort == 1) {
            $sOrder = " order by r.radi_nume_radi" . $sDirection;
        }
        if ($iSort == 2) {
            $sOrder = " order by r.radi_fech_radi" . $sDirection;
        }
        if ($iSort == 3) {
            $sOrder = " order by r.ra_asun" . $sDirection;
        }
        if ($iSort == 4) {
            $sOrder = " order by td.sgd_tpr_descrip" . $sDirection;
        }
        if ($iSort == 5) {
            $sOrder = " order by r.radi_nume_hoja" . $sDirection;
        }
        if ($iSort == 6) {
            $sOrder = " order by dir.sgd_dir_direccion" . $sDirection;
        }
        if ($iSort == 7) {
            $sOrder = " order by dir.sgd_dir_telefono" . $sDirection;
        }
        if ($iSort == 8) {
            $sOrder = " order by dir.sgd_dir_mail" . $sDirection;
        }
        if ($iSort == 9) {
            $sOrder = " order by o.sgd_oem_oempresa" . $sDirection;
        }
        if ($iSort == 10) {
            $sOrder = " order by o.sgd_oem_rep_legal" . $sDirection;
        }
        if ($iSort == 11) {
            $sOrder = " order by o.sgd_oem_nit" . $sDirection;
        }
        if ($iSort == 12) {
            $sOrder = " order by o.sgd_oem_sigla" . $sDirection;
        }
        if ($iSort == 13) {
            $sOrder = " order by o.sgd_oem_direccion" . $sDirection;
        }
        if ($iSort == 14) {
            $sOrder = " order by o.sgd_oem_telefono" . $sDirection;
        }
        if ($iSort == 15) {
            $sOrder = " order by u1.usua_nomb" . $sDirection;
        }
        if ($iSort == 16) {
            $sOrder = " order by d1.depe_nomb" . $sDirection;
        }
        if ($iSort == 17) {
            $sOrder = " order by r.radi_usu_ante" . $sDirection;
        }
        //    if ($iSort == 18) $sOrder = " order by muni.muni_nomb" . $sDirection;
        //    if ($iSort == 19) $sOrder = " order by dpto.dpto_nomb" . $sDirection;
        if ($iSort == 20) {
            $sOrder = " order by r.radi_pais" . $sDirection;
        }
        if ($iSort == 21) {
            $sOrder = " order by diasr" . $sDirection;
        }
        if ($iSort == 22) {
            $sOrder = " order by dir.sgd_dir_nombre" . $sDirection;
        }
    }
    //-------------------------------
    // Encabezados HTML de las Columnas
    //-------------------------------
    ?>
     <table width="2000" class="FormTABLE">
      <tr>
       <td class="FormHeaderTD" colspan="20"><a name="RADICADO"><font class="FormHeaderFONT"><?php 
    echo $sFormTitle;
    ?>
</font></a></td>
      </tr>
      <tr>
	   <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=1&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Radicado</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=2&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Fecha Radicación</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=3&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Asunto</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=4&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Tipo de Documento</font></a></td>	   
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=5&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Numero de Hojas</font></a></td>	   
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=6&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Direccion contacto</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=7&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Teléfono contacto</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=8&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Mail Contacto</font></a></td>
	   <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=9&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Nombre de la Empresa</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=10&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Representante Legal</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=11&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">NIT</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=12&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Sigla</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=13&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Direccion Empresa</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=14&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Telefono</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=15&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Usuario Actual</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=16&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Dependencia Actual</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=17&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Usuario Anterior</font></a></td>
	   <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormCIUDADANO_Sorting=22&FormCIUDADANO_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Firmante</font></a></td>
	   <!--td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=18&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Municipio</font></a></td>
	   <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=19&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Departamento</font></a></td-->
	   <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=20&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Pais</font></a></td>
  	   <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormOEMPRESAS_Sorting=21&FormOEMPRESAS_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Dias Restantes</font></a></td>
      </tr>
<?php 
    //-------------------------------
    // Build WHERE statement
    //-------------------------------
    // Se crea la $ps_desde_RADI_FECH_RADI con los datos ingresados.
    //------------------------------------
    $ps_desde_RADI_FECH_RADI = Date('d/m/Y H:i:s', mktime(0, 0, 0, get_param("s_desde_mes"), get_param("s_desde_dia"), get_param("s_desde_ano")));
    $ps_hasta_RADI_FECH_RADI = Date('d/m/Y H:i:s', mktime(23, 59, 59, get_param("s_hasta_mes"), get_param("s_hasta_dia"), get_param("s_hasta_ano")));
    if (strlen($ps_desde_RADI_FECH_RADI) && strlen($ps_hasta_RADI_FECH_RADI)) {
        $HasParam = true;
        $sWhere = $sWhere . "r.radi_fech_radi>=to_date('" . $ps_desde_RADI_FECH_RADI . "','dd/mm/yyyy hh24:mi:ss')";
        $sWhere .= " and ";
        $sWhere = $sWhere . "r.radi_fech_radi<=to_date('" . $ps_hasta_RADI_FECH_RADI . "','dd/mm/yyyy hh24:mi:ss')";
    }
    /* Se recibe la dependencia actual para búsqueda */
    $ps_RADI_DEPE_ACTU = get_param("s_RADI_DEPE_ACTU");
    if (is_number($ps_RADI_DEPE_ACTU) && strlen($ps_RADI_DEPE_ACTU)) {
        $ps_RADI_DEPE_ACTU = tosql($ps_RADI_DEPE_ACTU, "Number");
    } else {
        $ps_RADI_DEPE_ACTU = "";
    }
    if (strlen($ps_RADI_DEPE_ACTU)) {
        if ($sWhere != "") {
            $sWhere .= " and ";
        }
        $HasParam = true;
        $sWhere = $sWhere . "r.radi_depe_actu=" . $ps_RADI_DEPE_ACTU;
    }
    /* Se recibe el número del radicado para búsqueda */
    $ps_RADI_NUME_RADI = get_param("s_RADI_NUME_RADI");
    if (strlen($ps_RADI_NUME_RADI)) {
        if ($sWhere != "") {
            $sWhere .= " and ";
        }
        $HasParam = true;
        $sWhere = $sWhere . "r.radi_nume_radi like " . tosql("%" . $ps_RADI_NUME_RADI . "%", "Text");
    }
    /* Se decide si busca en radicado de entrada o de salida o ambos */
    $ps_entrada = strip(get_param("s_entrada"));
    if (strlen($ps_entrada) && ($ps_entrada = "ENT")) {
        if ($sWhere != "") {
            $sWhere .= " and ";
        }
        $HasParam = true;
        $sWhere = $sWhere . "r.radi_nume_radi like " . tosql("%2", "Text");
    }
    $ps_salida = strip(get_param("s_salida"));
    if (strlen($ps_salida) && ($ps_salida = "SAL")) {
        if ($sWhere != "") {
            $sWhere .= " and ";
        }
        $HasParam = true;
        $sWhere = $sWhere . "r.radi_nume_radi like " . tosql("%1", "Text");
    }
    /* Se recibe el tipo de documento para la búsqueda */
    $ps_TDOC_CODI = get_param("s_TDOC_CODI");
    if (is_number($ps_TDOC_CODI) && strlen($ps_TDOC_CODI) && $ps_TDOC_CODI != "9999") {
        $ps_TDOC_CODI = tosql($ps_TDOC_CODI, "Number");
    } else {
        $ps_TDOC_CODI = "";
    }
    if (strlen($ps_TDOC_CODI)) {
        if ($sWhere != "") {
            $sWhere .= " and ";
        }
        $HasParam = true;
        $sWhere = $sWhere . "r.tdoc_codi=" . $ps_TDOC_CODI;
    }
    /* Se recibe la caadena a buscar y el tipo de busqueda (All) (Any)  
     bod.nombre_de_la_empresa,bod.nombre_rep_legal,bod.nit_de_la_empresa,bod.sigla_de_la_empresa,bod.direccion,bod.telefono_1,bod.telefono_2,bod.telefono_3,
    */
    $ps_RADI_NOMB = strip(get_param("s_RADI_NOMB"));
    $ps_solo_nomb = get_param("s_solo_nomb");
    $yaentro = false;
    if (strlen($ps_RADI_NOMB) && $ps_solo_nomb == "All") {
        if ($sWhere != "") {
            $sWhere .= " and (";
        }
        $HasParam = true;
        $sWhere .= "dir.sgd_oem_codigo IN (SELECT sgd_oem_codigo FROM sgd_oem_oempresas d WHERE ";
        $ps_RADI_NOMB = strtoupper($ps_RADI_NOMB);
        $tok = strtok($ps_RADI_NOMB, " ");
        while ($tok) {
            if ($yaentro == true) {
                $sWhere .= " and ";
            }
            $sWhere .= "UPPER(d.sgd_oem_oempresa||d.sgd_oem_rep_legal||d.sgd_oem_nit||d.sgd_oem_sigla||d.sgd_oem_direccion||d.sgd_oem_telefono) LIKE '%" . $tok . "%' ";
            $tok = strtok(" ");
            $yaentro = true;
        }
        $sWhere .= ")";
        $sWhere .= " or (";
        $yaentro = false;
        $tok = strtok($ps_RADI_NOMB, " ");
        while ($tok) {
            if ($yaentro == true) {
                $sWhere .= " and ";
            }
            $sWhere .= "UPPER(r.ra_asun||dir.sgd_dir_nombre) LIKE '%" . $tok . "%' ";
            $tok = strtok(" ");
            $yaentro = true;
        }
        $sWhere .= "))";
    }
    if (strlen($ps_RADI_NOMB) && $ps_solo_nomb == "Any") {
        if ($sWhere != "") {
            $sWhere .= " and (";
        }
        $HasParam = true;
        $sWhere .= "dir.sgd_oem_codigo IN (SELECT sgd_oem_codigo FROM sgd_oem_oempresas d WHERE ";
        $ps_RADI_NOMB = strtoupper($ps_RADI_NOMB);
        $tok = strtok($ps_RADI_NOMB, " ");
        while ($tok) {
            if ($yaentro == true) {
                $sWhere .= " or ";
            }
            $sWhere .= "UPPER(d.sgd_oem_oempresa||d.sgd_oem_rep_legal||d.sgd_oem_nit||d.sgd_oem_sigla||d.sgd_oem_direccion||d.sgd_oem_telefono) LIKE '%" . $tok . "%' ";
            $tok = strtok(" ");
            $yaentro = true;
        }
        $sWhere .= ")";
        $sWhere .= " or (";
        $yaentro = false;
        $tok = strtok($ps_RADI_NOMB, " ");
        while ($tok) {
            if ($yaentro == true) {
                $sWhere .= " or ";
            }
            $sWhere .= "UPPER(r.ra_asun||dir.sgd_dir_nombre) LIKE '%" . $tok . "%' ";
            $tok = strtok(" ");
            $yaentro = true;
        }
        $sWhere .= "))";
    }
    if ($HasParam) {
        $sWhere = " AND (" . $sWhere . ") ";
    }
    //-------------------------------
    // Build base SQL statement
    //-------------------------------
    $sSQL = "SELECT r.radi_nume_radi, r.radi_fech_radi, r.ra_asun,r.radi_pais, r.radi_nume_hoja, \nr.radi_path, r.radi_usu_ante,\ntd.sgd_tpr_descrip, ROUND(((r.radi_fech_radi+(td.sgd_tpr_termino * 7/5))-SYSDATE)) AS diasr, \nu1.usua_login AS login_actu, u1.usua_nomb AS nomb_actu, d1.depe_nomb AS depe_actu,\ndir.sgd_dir_direccion, dir.sgd_dir_telefono, dir.sgd_dir_mail,dir.sgd_dir_nombre,\no.sgd_oem_oempresa,o.sgd_oem_rep_legal,o.sgd_oem_nit, o.sgd_oem_sigla,o.sgd_oem_direccion,o.sgd_oem_telefono\nFROM sgd_dir_drecciones dir, radicado r, sgd_tpr_tpdcumento td, usuario u1, dependencia d1, \nsgd_oem_oempresas o\nWHERE dir.SGD_DIR_TIPO = 1 AND dir.radi_nume_radi=r.radi_nume_radi AND r.tdoc_codi=td.sgd_tpr_codigo\nAND r.radi_usua_actu=u1.usua_codi AND r.radi_depe_actu=u1.depe_codi AND u1.depe_codi=d1.depe_codi\nAND (dir.sgd_oem_codigo=o.sgd_oem_codigo AND NVL(dir.sgd_oem_codigo,0)!=0 AND NVL(dir.sgd_ciu_codigo,0)=0 AND NVL(dir.sgd_esp_codi,0)=0) \n";
    //-------------------------------
    //-------------------------------
    // Assemble full SQL statement
    //-------------------------------
    $sSQL .= $sWhere . $sOrder;
    //-------------------------------
    // Execute SQL statement
    //-------------------------------
    $db->query($sSQL);
    $next_record = $db->next_record();
    //-------------------------------
    // Process empty recordset
    //-------------------------------
    if (!$next_record) {
        ?>
     <tr>
      <td colspan="20" class="DataTD"><font class="DataFONT">No hay resultados</font></td>
     </tr>
<?php 
        //-------------------------------
        //  The insert link.
        //-------------------------------
        ?>
    <tr>
     <td colspan="20" class="ColumnTD"><font class="ColumnFONT">
<?php 
        ?>
  </table>
<?php 
        return;
    }
    //-------------------------------
    ?>
     <!--tr>
      <td colspan="10" class="DataTD"><font class="DataFONT"><b>Total Registros Encontrados: <?php 
    echo $fldTotal;
    ?>
</b></font></td>
     </tr-->

<?php 
    //-------------------------------
    // Initialize page counter and records per page
    //-------------------------------
    $iCounter = 0;
    //-------------------------------
    //-------------------------------
    // Process page scroller
    //-------------------------------
    $iPage = get_param("FormOEMPRESAS_Page");
    if (!strlen($iPage)) {
        $iPage = 1;
    } else {
        if ($iPage == "last") {
            $db_count = get_db_value($sCountSQL);
            $dResult = intval($db_count) / $iRecordsPerPage;
            $iPage = intval($dResult);
            if ($iPage < $dResult) {
                $iPage++;
            }
        } else {
            $iPage = intval($iPage);
        }
    }
    if (($iPage - 1) * $iRecordsPerPage != 0) {
        do {
            $iCounter++;
        } while ($iCounter < ($iPage - 1) * $iRecordsPerPage && $db->next_record());
        $next_record = $db->next_record();
    }
    $iCounter = 0;
    //-------------------------------
    //$ruta_raiz ="..";
    //include "../config.php";
    //include "../jh_class/funciones_sgd.php";
    //-------------------------------
    // Display grid based on recordset
    //-------------------------------.
    while ($next_record && $iCounter < $iRecordsPerPage) {
        //-------------------------------
        // Create field variables based on database fields
        //-------------------------------
        $fldRADI_NUME_RADI = $db->f("RADI_NUME_RADI");
        $fldRADI_FECH_RADI = $db->f("RADI_FECH_RADI");
        $fldASUNTO = $db->f("RA_ASUN");
        $fldTIPO_DOC = $db->f("SGD_TPR_DESCRIP");
        $fldNUME_HOJAS = $db->f("RADI_NUME_HOJA");
        $fldRADI_PATH = $db->f("RADI_PATH");
        $fldDIRECCION_C = $db->f("SGD_DIR_DIRECCION");
        $fldTELEFONO_C = $db->f("SGD_DIR_TELEFONO");
        $fldMAIL_C = $db->f("SGD_DIR_MAIL");
        $fldNOMBRE_EMPRESA = $db->f("SGD_OEM_OEMPRESA");
        $fldREP_LEGAL = $db->f("SGD_OEM_REP_LEGAL");
        $fldNIT_EMPRESA = $db->f("SGD_OEM_NIT");
        $fldSIGLA_EMPRESA = $db->f("SGD_OEM_SIGLA");
        $fldDIRECCION = $db->f("SGD_OEM_DIRECCION");
        $fldTELEFONO = $db->f("SGD_OEM_TELEFONO");
        $fldUSUA_ACTU = $db->f("NOMB_ACTU") . " - (" . $db->f("LOGIN_ACTU") . ")";
        $fldDEPE_ACTU = $db->f("DEPE_ACTU");
        $fldUSUA_ANTE = $db->f("RADI_USU_ANTE");
        //    $fldMUNI_NOMB = $db->f("MUNI_NOMB");
        //    $fldDPTO_NOMB = $db->f("DPTO_NOMB");
        $fldPAIS = $db->f("RADI_PAIS");
        $fldDIASR = $db->f("DIASR");
        $fldFirmante = $db->f("sgd_dir_nombre");
        $next_record = $db->next_record();
        //-------------------------------
        // Show begin
        //-------------------------------
        //-------------------------------
        // Process the HTML controls
        //-------------------------------
        ?>
      <tr>
       <td class="DataTD"><font class="DataFONT">
	  <?php 
        if (strlen($fldRADI_PATH)) {
            $iii = $iii + 1;
            ?>
  <a href='../bodega<?php 
            echo $fldRADI_PATH;
            ?>
' target='Imagen<?php 
            echo $iii;
            ?>
'><?php 
        }
        ?>
	   <font class="DataFONT"><?php 
        echo $fldRADI_NUME_RADI;
        ?>
</font>
	  <?php 
        if (strlen($fldRADI_PATH)) {
            ?>
</a><?php 
        }
        ?>
&nbsp;</font></td>
       <td class="DataTD"><font class="DataFONT"><a href="../verradicado.php?verrad=<?php 
        echo $fldRADI_NUME_RADI . "&" . session_name() . "=" . session_id() . "&krd={$krd}&carpeta=8&nomcarpeta=Busquedas&tipo_carp=0";
        ?>
">
      <?php 
        echo tohtml($fldRADI_FECH_RADI);
        ?>
&nbsp;</a></font></td>
	   <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldASUNTO);
        ?>
&nbsp;</font></td>
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldTIPO_DOC);
        ?>
&nbsp;</font></td>
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldNUME_HOJAS);
        ?>
&nbsp;</font></td>
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldDIRECCION_C);
        ?>
&nbsp;</font></td>
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldTELEFONO_C);
        ?>
&nbsp;</font></td>
	   <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldMAIL_C);
        ?>
&nbsp;</font></td>
	   <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldNOMBRE_EMPRESA);
        ?>
&nbsp;</font></td>
	   <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldREP_LEGAL);
        ?>
&nbsp;</font></td>
	   <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldNIT_EMPRESA);
        ?>
&nbsp;</font></td>
	   <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldSIGLA_EMPRESA);
        ?>
&nbsp;</font></td>
	   <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldDIRECCION);
        ?>
&nbsp;</font></td>
	   <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldTELEFONO);
        ?>
&nbsp;</font></td>
	   <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldUSUA_ACTU);
        ?>
&nbsp;</font></td>
	   <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldDEPE_ACTU);
        ?>
&nbsp;</font></td>
	   <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldUSUA_ANTE);
        ?>
&nbsp;</font></td>
	   <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldFirmante);
        ?>
&nbsp;</font></td>
       <!--td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldMUNI_NOMB);
        ?>
&nbsp;</font></td>	  
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldDPTO_NOMB);
        ?>
&nbsp;</font></td--> 
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldPAIS);
        ?>
&nbsp;</font></td>	  
      <td class="DataTD"><font class="DataFONT">
      <?php 
        if ($fldRADI_DEPE_ACTU != 999) {
            echo tohtml($fldDIASR);
        } else {
            echo "Sal";
        }
        ?>
&nbsp;</font></td>	  
     </tr>
	  <?php 
        $iCounter++;
    }
    //-------------------------------
    //  Record navigator.
    //-------------------------------
    ?>
    <tr>
     <td colspan="20" class="ColumnTD"><font class="ColumnFONT">
<?php 
    // Navigation begin
    $bEof = $next_record;
    if ($bEof || $iPage != 1) {
        $iCounter = 1;
        $iHasPages = $iPage;
        $sPages = "";
        $iDisplayPages = 0;
        $iNumberOfPages = 30;
        /* El número de páginas que aparecerán en el navegador al pie de la página */
        while ($next_record && $iHasPages < $iPage + $iNumberOfPages) {
            if ($iCounter == $iRecordsPerPage) {
                $iCounter = 0;
                $iHasPages = $iHasPages + 1;
            }
            $iCounter++;
            $next_record = $db->next_record();
        }
        if (!$next_record && $iCounter > 1) {
            $iHasPages++;
        }
        if ($iHasPages - $iPage < intval($iNumberOfPages / 2)) {
            $iStartPage = $iHasPages - $iNumberOfPages;
        } else {
            $iStartPage = $iPage - $iNumberOfPages + intval($iNumberOfPages / 2);
        }
        if ($iStartPage < 0) {
            $iStartPage = 0;
        }
        for ($iPageCount = $iPageCount + 1; $iPageCount <= $iPage - 1; $iPageCount++) {
            $sPages .= "<a href=" . $sFileName . "?" . $form_params . $sSortParams . "FormOEMPRESAS_Page=" . $iPageCount . "#RADICADO\"><font " . "class=\"ColumnFONT\"" . ">" . $iPageCount . "</font></a>&nbsp;";
            $iDisplayPages++;
        }
        $sPages .= "<font " . "class=\"ColumnFONT\"" . "><b>" . $iPage . "</b></font>&nbsp;";
        $iDisplayPages++;
        $iPageCount = $iPage + 1;
        while ($iDisplayPages < $iNumberOfPages && $iStartPage + $iDisplayPages < $iHasPages) {
            $sPages .= "<a href=\"" . $sFileName . "?" . $form_params . $sSortParams . "FormOEMPRESAS_Page=" . $iPageCount . "#RADICADO\"><font " . "class=\"ColumnFONT\"" . ">" . $iPageCount . "</font></a>&nbsp;";
            $iDisplayPages++;
            $iPageCount++;
        }
        if ($iPage == 1) {
            ?>
        <font class="ColumnFONT">Primero</font>
        <font class="ColumnFONT">Anterior</font>
<?php 
        } else {
            ?>
        <a href="<?php 
            echo $sFileName;
            ?>
?<?php 
            echo $form_params;
            echo $sSortParams;
            ?>
FormOEMPRESAS_Page=1#RADICADO"><font class="ColumnFONT">Primero</font></a>
        <a href="<?php 
            echo $sFileName;
            ?>
?<?php 
            echo $form_params;
            echo $sSortParams;
            ?>
FormOEMPRESAS_Page=<?php 
            echo $iPage - 1;
            ?>
#RADICADO"><font class="ColumnFONT">Anterior</font></a>
<?php 
        }
        echo "&nbsp;[&nbsp;" . $sPages . "]&nbsp;";
        if (!$bEof) {
            ?>
        <font class="ColumnFONT">Siguiente</font>
        <font class="ColumnFONT">Ultimo</font>
<?php 
        } else {
            ?>
        <a href="<?php 
            echo $sFileName;
            ?>
?<?php 
            echo $form_params;
            echo $sSortParams;
            ?>
FormOEMPRESAS_Page=<?php 
            echo $iPage + 1;
            ?>
#RADICADO"><font class="ColumnFONT">Siguiente</font></a>
        <a href="<?php 
            echo $sFileName;
            ?>
?<?php 
            echo $form_params;
            echo $sSortParams;
            ?>
FormOEMPRESAS_Page=last#RADICADO"><font class="ColumnFONT">Ultimo</font></a>
<?php 
        }
    }
    //-------------------------------
    // Navigation end
    //-------------------------------
    ?>
      </font></td></tr>
    </table>
  <?php 
}
예제 #17
0
function buscar_prueba($nivelus, $tpRemDes, $whereFlds)
{
    global $ruta_raiz;
    $db = new ConnectionHandler($ruta_raiz);
    //$db->conn->debug=true;
    //constrimos las  condiciones dependiendo de los parametros de busqueda seleccionados
    $ps_desde_RADI_FECH_RADI = mktime(0, 0, 0, get_param("s_desde_mes"), get_param("s_desde_dia"), get_param("s_desde_ano"));
    $ps_hasta_RADI_FECH_RADI = mktime(23, 59, 59, get_param("s_hasta_mes"), get_param("s_hasta_dia"), get_param("s_hasta_ano"));
    $where = " AND (R.RADI_FECH_RADI BETWEEN " . $db->conn->DBDate($ps_desde_RADI_FECH_RADI) . " AND " . $db->conn->DBDate($ps_hasta_RADI_FECH_RADI) . ")";
    // se rescantan los parametros de busqueda
    $ps_RADI_NUME_RADI = trim(get_param("s_RADI_NUME_RADI"));
    $ps_DOCTO = trim(get_param("s_DOCTO"));
    $ps_RADI_DEPE_ACTU = get_param("s_RADI_DEPE_ACTU");
    $ps_SGD_EXP_SUBEXPEDIENTE = trim(get_param("s_SGD_EXP_SUBEXPEDIENTE"));
    $ps_solo_nomb = get_param("s_solo_nomb");
    $ps_RADI_NOMB = trim(strip(get_param("s_RADI_NOMB")));
    $ps_entrada = strip(get_param("s_entrada"));
    $ps_TDOC_CODI = get_param("s_TDOC_CODI");
    $ps_METADATO = trim(strip(get_param("s_METADATO")));
    //parametro de metadato
    $ps_salida = strip(get_param("s_salida"));
    $sFormTitle = "Radicados encontrados {$tpRemDesNombre}";
    $ps_RADI_DEPE_ACTU = is_number($ps_RADI_DEPE_ACTU) && strlen($ps_RADI_DEPE_ACTU) ? tosql($ps_RADI_DEPE_ACTU, "Number") : "";
    $where = strlen($ps_RADI_DEPE_ACTU) > 0 ? $where . " AND R.RADI_DEPE_ACTU = " . $ps_RADI_DEPE_ACTU : $where;
    $where = strlen($ps_RADI_NUME_RADI) ? $where . " AND R.RADI_NUME_RADI  LIKE " . tosql("%" . trim($ps_RADI_NUME_RADI) . "%", "Text") : $where;
    switch ($tpRemDes) {
        case 1:
            $tpRemDesNombre = "Por Ciudadano";
            $where .= " and dir.sgd_trd_codigo = {$whereFlds}  ";
            break;
        case 2:
            $tpRemDesNombre = "Por Otras Empresas";
            $where .= " and dir.sgd_trd_codigo = {$whereFlds}  ";
            break;
        case 3:
            $tpRemDesNombre = "Por Entidad";
            $where .= " and dir.sgd_trd_codigo = {$whereFlds}  ";
            break;
        case 4:
            $tpRemDesNombre = "Por Funcionario";
            $where .= " and dir.sgd_trd_codigo = {$whereFlds}  ";
            break;
        case 9:
            $tpRemDesNombre = "";
    }
    $where = strlen($ps_DOCTO) ? " AND  DIR.SGD_DIR_DOC = '{$ps_DOCTO}' " : $where;
    if (strlen($ps_SGD_EXP_SUBEXPEDIENTE) != 0) {
        $min = "INNER JOIN SGD_EXP_EXPEDIENTE MINEXP ON R.RADI_NUME_RADI=MINEXP.RADI_NUME_RADI";
        $where = $where . " AND MINEXP.SGD_EXP_ESTADO <> 2";
        $where = $where . " AND (\n        \t    SEXP.SGD_EXP_NUMERO LIKE '%" . str_replace('\'', '', tosql($ps_SGD_EXP_SUBEXPEDIENTE, "Text")) . "%' \n        \t\tOR SEXP.SGD_SEXP_PAREXP1 LIKE UPPER( '%" . str_replace('\'', '', tosql($ps_SGD_EXP_SUBEXPEDIENTE, "Text")) . "%') \n        \t\tOR SEXP.SGD_SEXP_PAREXP2 LIKE UPPER( '%" . str_replace('\'', '', tosql($ps_SGD_EXP_SUBEXPEDIENTE, "Text")) . "%') \n        \t\tOR SEXP.SGD_SEXP_PAREXP3 LIKE UPPER( '%" . str_replace('\'', '', tosql($ps_SGD_EXP_SUBEXPEDIENTE, "Text")) . "%')\n        \t\tOR SEXP.SGD_SEXP_PAREXP4 LIKE UPPER( '%" . str_replace('\'', '', tosql($ps_SGD_EXP_SUBEXPEDIENTE, "Text")) . "%')\n        \t\tOR SEXP.SGD_SEXP_PAREXP5 LIKE UPPER( '%" . str_replace('\'', '', tosql($ps_SGD_EXP_SUBEXPEDIENTE, "Text")) . "%'))";
    } else {
        $min = "LEFT JOIN\n    \t(SELECT RADI_NUME_RADI,MIN(SGD_EXP_FECH) FECHA FROM SGD_EXP_EXPEDIENTE GROUP BY SGD_EXP_NUMERO, RADI_NUME_RADI)\n    \t MINE ON MINE.RADI_NUME_RADI=R.RADI_NUME_RADI LEFT JOIN SGD_EXP_EXPEDIENTE MINEXP ON (MINE.RADI_NUME_RADI=MINEXP.RADI_NUME_RADI AND MINE.FECHA=MINEXP.SGD_EXP_FECH)";
    }
    $where = $ps_entrada != "9999" ? $where . " AND R.RADI_NUME_RADI like " . tosql("%" . trim($ps_entrada), "Text") . ")" : $where;
    /* Se decide si busca en radicado de entrada o de salida o ambos */
    $eLen = strlen($ps_entrada);
    $sLen = strlen($ps_salida);
    $where = is_number($ps_TDOC_CODI) && strlen($ps_TDOC_CODI) && $ps_TDOC_CODI != "9999" ? $where . " AND R.TDOC_CODI=" . tosql($ps_TDOC_CODI, "Number") : $where;
    /* Se recibe la caadena a buscar y el tipo de busqueda (All) (Any) */
    if (strlen($ps_RADI_NOMB)) {
        //&& $ps_solo_nomb == "Any")
        $ps_RADI_NOMB = strtoupper($ps_RADI_NOMB);
        $concatenacion = "UPPER(" . $db->conn->Concat("R.RA_ASUN", "R.RADI_CUENTAI", "DIR.SGD_DIR_TELEFONO", "DIR.SGD_DIR_DIRECCION") . ") LIKE '%";
        $tok = explode(" ", $ps_RADI_NOMB);
        $where .= " AND ((UPPER(dir.sgd_dir_nomremdes) LIKE '%" . implode("%' AND UPPER(dir.sgd_dir_nomremdes) LIKE '%", $tok) . "%') ";
        $where .= "OR ( UPPER(dir.sgd_dir_nombre) LIKE '%" . implode("%' AND UPPER(dir.sgd_dir_nombre) LIKE '%", $tok) . "%')";
        $where .= " OR (" . $concatenacion . implode("%' AND " . $concatenacion, $tok) . "%'))";
    }
    //-------------------------------
    // Build base SQL statement
    //-------------------------------
    include "{$ruta_raiz}/include/query/busqueda/busquedaPiloto1.php";
    require_once "{$ruta_raiz}/include/myPaginador.inc.php";
    $titulos = array("#", "1#RADICADO", "3#FECHA RADICACION", "2#EXPEDIENTE", "4#ASUNTO", "14#TIPO DE DIOCUMENTO", "21#TIPO", "7#NO DE HOJAS", "15#DIRECCION CONTACTO", "18#TELEFONO CONTACTO", "16#MAIL CONTACTO ", "20#DIGNATARIO", "17#NOMBRE", "19#DOCUMENTO", "22#USUARIO ACTUAL", "10#DEPENDENCIA ACTUAL", "23#USUARIO ANTERIOR", "11#PAIS", "13#DIAS RESTANTES");
    $sSQL = "select\n\t        R.RADI_NUME_RADI,MINEXP.SGD_EXP_NUMERO," . $db->conn->SQLDate('Y-m-d H:i:s', 'R.RADI_FECH_RADI') . " AS RADI_FECH_RADI,\n\t        R.RA_ASUN,\n\t        R.RADI_NUME_HOJA,R.RADI_PATH,R.RADI_USUA_ACTU,R.CODI_NIVEL, \n\t        R.SGD_SPUB_CODIGO,R.RADI_DEPE_ACTU,R.RADI_PAIS,D.DEPE_NOMB,\n                                            {$redondeo} AS DIASR,TD.SGD_TPR_DESCRIP,DIR.SGD_DIR_DIRECCION, DIR.SGD_DIR_MAIL,\n\t        DIR.SGD_DIR_NOMREMDES,DIR.SGD_DIR_TELEFONO,DIR.SGD_DIR_DOC,DIR.SGD_DIR_NOMBRE,\n\t        DIR.SGD_TRD_CODIGO, U.USUA_NOMB USUARIO_ACTUAL, AL.USUA_NOMB USUARIO_ANTERIOR,\n\t        U.CODI_NIVEL USUA_NIVEL,SGD_EXP_PRIVADO\n        FROM RADICADO R INNER JOIN SGD_DIR_DRECCIONES DIR ON R.RADI_NUME_RADI=DIR.RADI_NUME_RADI \n\t        INNER JOIN SGD_TPR_TPDCUMENTO TD ON R.TDOC_CODI=TD.SGD_TPR_CODIGO \n\t        INNER JOIN USUARIO U ON R.RADI_USUA_ACTU=U.USUA_CODI AND R.RADI_DEPE_ACTU=U.DEPE_CODI \n\t        LEFT JOIN USUARIO AL ON R.RADI_USU_ANTE=AL.USUA_LOGIN \n\t        LEFT JOIN DEPENDENCIA D ON D.DEPE_CODI=R.RADI_DEPE_ACTU \n                                            {$min}\n\t        LEFT JOIN SGD_SEXP_SECEXPEDIENTES SEXP ON MINEXP.SGD_EXP_NUMERO=SEXP.SGD_EXP_NUMERO\n                                    \n\t    WHERE DIR.SGD_DIR_TIPO = 1 \n                                            " . $where;
    echo "<table >\n\t\t\t<tr>\n\t\t\t<td class=\"titulos4\" colspan=\"20\" width=\"2000\" ><a name=\"RADICADO\">{$sFormTitle}</a></td>\n\t\t\t</tr>\n\t\t </table>";
    //$db->conn->debug=true;
    $paginador = new myPaginador($db, strtoupper($sSQL), null, "", 25);
    $paginador->setImagenASC($ruta_raiz . "iconos/flechaasc.gif");
    $paginador->setImagenDESC($ruta_raiz . "iconos/flechadesc.gif");
    $paginador->setFuncionFilas("pintarResultadoConsultas");
    $paginador->setpropiedadesTabla(array('width' => "2000", 'border' => '0', 'cellpadding' => '5', 'cellspacing' => '5', 'class' => 'borde_tab'));
    $paginador->setPie($pie);
    echo $paginador->generarPagina($titulos, "titulos3");
}
예제 #18
0
function Search_show()
{
    global $styles;
    global $sForm;
    $sFormTitle = "Búsqueda";
    $sActionFileName = "pedidos.php";
    $ss_DEPE_CODIDisplayValue = "";
    //-------------------------------
    // Search Open Event begin
    // Search Open Event end
    //-------------------------------
    //-------------------------------
    // Set variables with search parameters
    //-------------------------------
    $flds_RADI_NUME_RADI = strip(get_param("s_RADI_NUME_RADI"));
    $flds_USUA_LOGIN_ACTU = strip(get_param("s_USUA_LOGIN_ACTU"));
    $flds_DEPE_CODI = strip(get_param("s_DEPE_CODI"));
    //-------------------------------
    // Search Show begin
    //-------------------------------
    //-------------------------------
    // Search Show Event begin
    // Search Show Event end
    //-------------------------------
    ?>
    <form method="GET" action="<?php 
    echo $sActionFileName;
    ?>
" name="Search">
    <input type="hidden" name="FormName" value="Search"><input type="hidden" name="FormAction" value="search">
    <table class="FormTABLE">
     <tr>
      <td class="FormHeaderTD" colspan="7"><a name="Search"><font class="FormHeaderFONT"><?php 
    echo $sFormTitle;
    ?>
</font></a></td>
     </tr>
     <tr>
      <td class="FieldCaptionTD"><font class="FieldCaptionFONT">Radicado</font></td>
      <td class="DataTD"><input type="text" name="s_RADI_NUME_RADI" maxlength="" value="<?php 
    echo tohtml($flds_RADI_NUME_RADI);
    ?>
" size="" ></td>
     </tr>
     <tr>
      <td class="FieldCaptionTD"><font class="FieldCaptionFONT">Login Usuario</font></td>
      <td class="DataTD"><input type="text" name="s_USUA_LOGIN_ACTU" maxlength="15" value="<?php 
    echo tohtml($flds_USUA_LOGIN_ACTU);
    ?>
" size="15" ></td>
     </tr>
     <tr>
      <td class="FieldCaptionTD"><font class="FieldCaptionFONT">Dependencia</font></td>
      <td class="DataTD"><select name="s_DEPE_CODI">
<?php 
    echo "<option value=\"\">" . $ss_DEPE_CODIDisplayValue . "</option>";
    $lookup_s_DEPE_CODI = db_fill_array("select DEPE_CODI, DEPE_NOMB from DEPENDENCIA order by 2");
    if (is_array($lookup_s_DEPE_CODI)) {
        reset($lookup_s_DEPE_CODI);
        while (list($key, $value) = each($lookup_s_DEPE_CODI)) {
            if ($key == $flds_DEPE_CODI) {
                $option = "<option SELECTED value=\"{$key}\">{$value}";
            } else {
                $option = "<option value=\"{$key}\">{$value}";
            }
            echo $option;
        }
    }
    ?>
</select></td>
     </tr>
     <tr>
     <td align="right" colspan="3"><input type="submit" value="Búsqueda"></td>
    </tr>
   </table>
   </form>
<?php 
    //-------------------------------
    // Search Show end
    //-------------------------------
    //-------------------------------
    // Search Close Event begin
    // Search Close Event end
    //-------------------------------
    //===============================
}
예제 #19
0
    } else {
        $silver = TIME_NOW + $half_length * 604800;
    }
}
/// end
//==Xbt freetorrent
$freetorrent = isset($_POST['freetorrent']) && is_valid_id($_POST['freetorrent']) ? intval($_POST['freetorrent']) : 0;
$descr = strip_tags(isset($_POST['descr']) ? trim($_POST['descr']) : '');
if (!$descr) {
    stderr($lang['takeupload_failed'], $lang['takeupload_no_descr']);
}
$description = strip_tags(isset($_POST['description']) ? trim($_POST['description']) : '');
if (isset($_POST['strip']) && $_POST['strip']) {
    require_once INCL_DIR . 'strip.php';
    $descr = preg_replace("/[^\\x20-\\x7e\\x0a\\x0d]/", " ", $descr);
    strip($descr);
    //$descr = preg_replace("/\n+/","\n",$descr);
}
$catid = 0 + $_POST["type"];
if (!is_valid_id($catid)) {
    stderr($lang['takeupload_failed'], $lang['takeupload_no_cat']);
}
$request = isset($_POST['request']) && is_valid_id($_POST['request']) ? intval($_POST['request']) : 0;
$offer = isset($_POST['offer']) && is_valid_id($_POST['offer']) ? intval($_POST['offer']) : 0;
$subs = isset($_POST["subs"]) ? implode(",", $_POST['subs']) : "";
$release_group_array = array('scene' => 1, 'p2p' => 1, 'none' => 1);
$release_group = isset($_POST['release_group']) && isset($release_group_array[$_POST['release_group']]) ? $_POST['release_group'] : 'none';
$youtube = '';
if (isset($_POST['youtube']) && preg_match($youtube_pattern, $_POST['youtube'], $temp_youtube)) {
    $youtube = $temp_youtube[0];
}
예제 #20
0
require LIB_DIR . DIR_SEP . 'YUN' . DIR_SEP . 'Function.php';
// 公用函数
//关闭修正符转义
$_var = (bool) get_magic_quotes_gpc();
$value = '0';
$value = (bool) $value;
$tmp = array($_POST, $_GET, $_COOKIE, $_REQUEST);
if ($_var != $value) {
    $tmp = $value ? addslashes_deep($tmp) : stripslashes_deep($tmp);
    $_var = $value;
    list($_POST, $_GET, $_COOKIE, $_REQUEST) = $tmp;
}
/**
 * 設置類的查找路徑
 */
YUN_Core::setIncludePath(strip(LIB_DIR));
//Regulus_Core的單例模式實現
$regulusCore = YUN_Core::getInstance();
/**
 * 设定异常处理控制器 错误处理控制器
 */
set_exception_handler(array($regulusCore, 'exceptionHandler'));
set_error_handler(array($regulusCore, 'errorHandler'));
/**
 * 加载配置文件
 */
$config = YUN_Core::loadConfig('config');
Zend_Registry::set('config', $config);
$route = YUN_Core::loadConfig('route');
/**
 * Zend_Controller_Front 初始化
예제 #21
0
 function validate()
 {
     if ($this->url . strip() == "") {
         $this->errors[] = "Empty URLs are not allowed!";
     }
     $allowed_types = array("ftp", "ftps", "http", "https", "rsync", "bittorrent", "magnet", "ed2k");
     if (!in_array($this->type, $allowed_types)) {
         $this->errors[] = "Invalid URL: " . $this->url . '.';
     } elseif (in_array($this->type, array('http', 'https', 'ftp', 'ftps', 'bittorrent'))) {
         if (!preg_match('#\\w+://.+\\..+/.*#', $this->url)) {
             $this->errors[] = "Invalid URL: " . $this->url . '.';
         }
     }
     if (trim($this->location) != "") {
         $iso_locations = array("AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "KH", "CM", "CA", "CV", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "AN", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "SH", "KN", "LC", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SK", "SI", "SB", "SO", "ZA", "GS", "ES", "LK", "SD", "SR", "SJ", "SZ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW", "UK");
         if (!in_array(strtoupper($this->location), $iso_locations)) {
             $this->errors[] = $this->location . " is not a {$valid} country code.";
         }
     }
     if ($this->preference != "") {
         if (is_numeric($this->preference)) {
             $pref = intval($this->preference);
             if ($pref < 0 || $pref > 100) {
                 $this->errors[] = "Preference must be between 0 and 100, not " . $this->preference . '.';
             }
         } else {
             $this->errors[] = "Preference must be a number, between 0 and 100.";
         }
     }
     if (trim($this->conns) != "" && trim($this->conns) != "-") {
         if (is_numeric($this->conns)) {
             $conns = intval($this->conns);
             if ($conns < 1) {
                 $this->errors[] = "Max connections must be at least 1, not " . $this->conns . '.';
             } elseif ($conns > 20) {
                 $this->errors[] = "You probably don't want max connections to be as high as " . $this->conns . '!';
             }
         } else {
             $this->errors[] = "Max connections must be a positive integer, not " . $this->conns . ".";
         }
     }
     return sizeof($this->errors) == 0;
 }
예제 #22
0
function Search_show()
{
    global $db;
    global $styles;
    global $sForm;
    $sFormTitle = "Buscar";
    $sActionFileName = "devolucion.php";
    //-------------------------------
    // Search Open Event begin
    // Search Open Event end
    //-------------------------------
    //-------------------------------
    // Set variables with search parameters
    //-------------------------------
    $flds_RADI_NUME_RADI = strip(get_param("s_RADI_NUME_RADI"));
    //-------------------------------
    // Search Show begin
    //-------------------------------
    //-------------------------------
    // Search Show Event begin
    // Search Show Event end
    //-------------------------------
    ?>
    <form method="GET" action="<?php 
    echo $sActionFileName;
    ?>
" name="Search">
    <input type="hidden" name="FormName" value="Search"><input type="hidden" name="FormAction" value="search">
    <table class="FormTABLE">
     <tr>
      <td class="FormHeaderTD" colspan="3"><a name="Search"><font class="FormHeaderFONT"><?php 
    echo $sFormTitle;
    ?>
</font></a></td>
     </tr>
     <tr>
      <td class="FieldCaptionTD"><font class="FieldCaptionFONT">Radicado</font></td>
      <td class="DataTD"><input type="text" name="s_RADI_NUME_RADI" maxlength="" value="<?php 
    echo tohtml($flds_RADI_NUME_RADI);
    ?>
" size="" ></td>
     <td ><input type="submit" value="Búsqueda"></td>
    </tr>
   </table>
   </form>
<?php 
    //-------------------------------
    // Search Show end
    //-------------------------------
    //-------------------------------
    // Search Close Event begin
    // Search Close Event end
    //-------------------------------
    //===============================
}
예제 #23
0
function irc($command)
{
    global $XUSER, $SERVER, $ROOMS, $OPERATOR, $CS, $PERMISSIONS;
    // The following IRC commands are implemented
    // unban
    // devoice
    // join
    // mdeop
    // names
    // unignore
    // voice
    // kick
    // mkick
    // op
    // away
    // back
    // ignore
    // wallchop
    // ban
    // deop
    // invite
    // topic
    // wallchan
    // msg
    // admin
    // deadmin
    //       mode
    //  // +-s,+-p = Private, Public
    //  // +-m = moded
    //  // +-l <number> = user limit, number if +
    //  // +-b = ban
    //  // +-v = voice
    //  // +-o = op
    //  // +-i = ignore
    //  // +-a = Admin/noadmin
    $command = eregi_replace("/", "", $command);
    $commando = eregi_replace("/", "", $command);
    $i = 0;
    while ($token = strtok($command, " ")) {
        $command = @eregi_replace("{$token}", "", $command);
        $cmd[$i] = $token;
        $i++;
    }
    $command2 = "6439547" . $commando;
    $token = strtok($command2, " ");
    $command2 = @eregi_replace("{$token} ", "", $command2);
    if ($cmd[0] != "wallchop" && $cmd[0] != "topic" && $cmd[0] != "wallchan" && $cmd[0] != "mode" && $cmd[0] != "join" && $cmd[0] != "me") {
        $command2 = "6439547" . $command2;
        $token = strtok($command2, " ");
        $command2 = @eregi_replace("{$token}", "", $command2);
    }
    $cmd[3] = $command2;
    $cmd[1] = strip($cmd[1]);
    $qa = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}users WHERE username='******'1']}'");
    $rowa = do_Fetch_row($qa);
    if ($rowa[4] == 4 || $rowa[4] == 5) {
        $wuza = 1;
    }
    $noauth = 0;
    if ($XUSER['LEVEL'] < 3) {
        $noauth = 1;
    }
    // Start looking for the command the user ran
    if ($cmd[0] == "unban" && $noauth != 1) {
        mnotice($cmd[1], 9);
        if (eregi(".*\\..*\\..*\\..*", $cmd[1])) {
            $isip = 1;
        }
        if (isset($isip)) {
            DoQuery("DELETE FROM {$SERVER['TBL_PREFIX']}bans WHERE room='{$ROOMS['IN_ROOM_NAME']}' && ip='{$cmd['1']}'");
        } else {
            DoQuery("DELETE FROM {$SERVER['TBL_PREFIX']}bans WHERE room='{$ROOMS['IN_ROOM_NAME']}' && name='{$cmd['1']}'");
        }
    } elseif ($cmd[0] == "devoice" && $noauth != 1 && !isset($wuza)) {
        $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}online WHERE username='******'1']}'");
        $row = Do_Fetch_Row($q);
        if ($row[3] == $ROOMS['IN_ROOM_NAME']) {
            $q = DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET voice='' WHERE username='******'1']}'");
            mnotice($cmd[1], 6);
        }
    } elseif ($cmd[0] == "join") {
        sendsysmsgto("To join {$cmd['3']} <a href=\"../index.php?changeroom=set&room={$cmd['3']}\" target=\"_parent\">Click Here</a>.", "{$XUSER['NAME']}:PRIV");
    } elseif ($cmd[0] == "help") {
        function disp($mess_txt)
        {
            global $CS, $XUSER;
            $mess_txt = eregi_replace("\r\n", "", $mess_txt);
            $mess_txt = eregi_replace("\n", "", $mess_txt);
            sendsysmsgto("{$mess_txt}", "{$XUSER['NAME']}:PRIV");
        }
        if ($cmd[1] == "") {
            disp("This server accepts the following commands: ");
            disp("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n<td width=\"75\">unban</td>\n<td width=\"75\">devoice</td>\n<td width=\"75\">join</td>\n<td width=\"75\">mdeop</td>\n<td width=\"75\">names</td>\n<td width=\"75\">unignore</td>\n</tr>\n<tr>\n<td width=\"75\">voice</td>\n<td width=\"75\">kick</td>\n<td width=\"75\">mkick</td>\n<td width=\"75\">op</td>\n<td width=\"75\">away</td>\n<td width=\"75\">back</td>\n</tr>\n<tr>\n<td width=\"75\">ignore</td>\n<td width=\"75\">wallchop</td>\n<td width=\"75\">ban</td>\n<td width=\"75\">deop</td>\n<td width=\"75\">invite</td>\n<td width=\"75\">topic</td>\n</tr>\n<tr>\n<td width=\"75\">wallchan</td>\n<td width=\"75\">msg</td>\n<td width=\"75\">admin</td>\n<td width=\"75\">deadmin</td>\n<td width=\"75\">mode</td>\n<td width=\"75\">list</td>\n</tr>\n<tr>\n<td width=\"75\">me</td>\n<td width=\"75\">&nbsp;</td>\n<td width=\"75\">&nbsp;</td>\n<td width=\"75\">&nbsp;</td>\n<td width=\"75\">&nbsp;</td>\n<td width=\"75\">&nbsp;</td>\n</tr>\n</table>");
            disp("For more information type /help <i>command</i>");
            disp("Certain Commands may not be accepted if you do not have correct authorization.");
        } elseif ($cmd[1] == "unban") {
            disp("Command: unban<Br>\nSyntax: /unban <i>username</i><Br>\nAction: Unbans a username or IP address from the chat room.");
        } elseif ($cmd[1] == "devoice") {
            disp("Command: devoice<Br>\nSyntax: /devoice <i>username</i><Br>\nAction: Takes away a users voice so they can no longer send messages in a moderated chat room.");
        } elseif ($cmd[1] == "join") {
            disp("Command: join<Br>\nSyntax: /join <i>room name</i><Br>\nAction: Gives you a link to change to room <i>room name</i>.");
        } elseif ($cmd[1] == "mdeop") {
            disp("Command: mdeop<Br>\nSyntax: /mdeop<Br>\nAction: Mass De-Ops the entire room.  De-Ops all other ops but you.");
        } elseif ($cmd[1] == "names") {
            disp("Command: names<Br>\nSyntax: /names<Br>\nAction: Prints the usernames of people in chat with you.");
        } elseif ($cmd[1] == "unignore") {
            disp("Command: unignore<Br>\nSyntax: /unignore <i>username</i><Br>\nAction: Unignores the user with username <i>username</i>.");
        } elseif ($cmd[1] == "voice") {
            disp("Command: voice<Br>\nSyntax: /voice <i>username</i><Br>\nAction: Gives user <i>username</i> a voice.  This allows them to send messages to a moderated chat room");
        } elseif ($cmd[1] == "kick") {
            disp("Command: kick<Br>\nSyntax: /kick <i>username</i><Br>\nAction: This will kick (remove) a user from chat.");
        } elseif ($cmd[1] == "mkick") {
            disp("Command: mkick<Br>\nSyntax: /mkick<Br>\nAction: This kicks all users in the chat room out except for you.");
        } elseif ($cmd[1] == "op") {
            disp("Command: op<Br>\nSyntax: /op <i>username</i><Br>\nAction: Gives <i>username</i> operator status in the current chat room.");
        } elseif ($cmd[1] == "away") {
            disp("Command: away<Br>\nSyntax: /away<Br>\nAction: Sets your current status as away.");
        } elseif ($cmd[1] == "back") {
            disp("Command: back<Br>\nSyntax: /back<Br>\nAction: Sets your current stats as present.");
        } elseif ($cmd[1] == "ignore") {
            disp("Command: ignore<Br>\nSyntax: /ignore <i>username</i><Br>\nAction: Ignores <i>username</i>, you will no longer recieve messages from <i>username</i>");
        } elseif ($cmd[1] == "wallchop") {
            disp("Command: wallchop<Br>\nSyntax: /wallchop <i>message</i><Br>\nAction: Sends <i>message</i> to all the operators in the current chat room.");
        } elseif ($cmd[1] == "ban") {
            disp("Command: ban<Br>\nSyntax: /ban <i>username</i><Br>\nAction: Bans a username or IP address from the chat room.  The user will no longer be able to access this chat room.");
        } elseif ($cmd[1] == "deop") {
            disp("Command: deop<Br>\nSyntax: /deop <i>username</i><Br>\nAction: Takes operator status from a user.");
        } elseif ($cmd[1] == "invite") {
            disp("Command: invite<Br>\nSyntax: /invite <i>username</i><Br>\nAction: Invites a username to join the current chat room.");
        } elseif ($cmd[1] == "topic") {
            disp("Command: topic<Br>\nSyntax: /topic <i>topic</i><Br>\nAction: Sets the chat rooms topic to <i>topic</i>.");
        } elseif ($cmd[1] == "wallchan") {
            disp("Command: wallcan<Br>\nSyntax: /wallchan <i>message</i><Br>\nAction: Sends a message to all channels on current server.");
        } elseif ($cmd[1] == "msg") {
            disp("Command: msg<Br>\nSyntax: /msg <i>username</i> <i>message</i><Br>\nAction: Sends a private message, <i>message</i>, to <i>username</i>.");
        } elseif ($cmd[1] == "admin") {
            disp("Command: admin<Br>\nSyntax: /admin <i>username</i><Br>\nAction: Grants <i>username</i> administrator access.");
        } elseif ($cmd[1] == "deadmin") {
            disp("Command: deadmin<Br>\nSyntax: /deadmin <i>username</i><Br>\nAction: Takes <i>username</i>'s administrator access.");
        } elseif ($cmd[1] == "list") {
            disp("Command: list<Br>\nSyntax: /list<Br>\nAction: Displays list of rooms on the server.");
        } elseif ($cmd[1] == "me") {
            disp("Command: me<Br>\nSyntax: /me <i>action</i><Br>\nAction: Makes you do an action.");
        } elseif ($cmd[1] == "mode") {
            disp("Command: mode<Br>\nSyntax: /mode <i>mode</i> [<i>username</i>]<Br>\nAction: Preforms <i>mode</i> on <i>username</i>.  If <i>mode</i> is a channel\nmode then <i>username</i> may be ommited.  Placing a + in front of a mode applys it and placing\na - in from of a mode removes it.<Br><br>User Modes:<Br>\n[+|-]b: [Bans|Unbans] a user from the current chat room.<Br>\n[+|-]v: [Give Voice To|Take Voice From] a user in the current chat room.<Br>\n[+|-]o: [Ops|Deops] a user in the current chat room.<Br> \n[+|-]i: [Ignores|Unignores] a user.<Br>\n[+|-]a: [Admins|Deadmins] a user.<Br>\n<Br>Channel Modes<br>\n+p: Makes current chat room private.  Replace <i>username</i> with the password for the room.<br>\n-p: Makes a chat room public.  <i>username</i> may be ommited.<Br>\n+m: Makes a chat room moderated.  <i>username</i> may be ommited.<Br>\n-m: Makes a chat room unmoderated.  <i>username</i> may be ommited.<Br>\n+l: Sets the user limit for the current chat room.  Replace <i>username</i> with the maximum amount of users for the room.<br>\n-l: Removes the user limit from current chat room.  <i>username</i> may be ommited.<Br>\n\n");
        } else {
            disp("Sorry no help is available for that command.");
        }
    } elseif ($cmd[0] == "mdeop" && $noauth != 1) {
        $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}online WHERE roomname='{$ROOMS['IN_ROOM_NAME']}'");
        while ($row = Do_Fetch_row($q)) {
            $q2 = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}users WHERE username='******'1']}'");
            $row = Do_Fetch_row($q2);
            if ($row[4] == "3{$ROOMS['id']}" && $row[1] != $XUSER['NAME']) {
                irc("/deop {$row['1']}");
            }
        }
    } elseif ($cmd[0] == "names") {
        sendsysmsgto("Users in chat with you:", "{$XUSER['NAME']}:PRIV");
        $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}online WHERE roomname='{$ROOMS['IN_ROOM_NAME']}'");
        while ($row = Do_Fetch_row($q)) {
            sendsysmsgto("{$row['1']}", "{$XUSER['NAME']}:PRIV");
        }
    } elseif ($cmd[0] == "unignore") {
        DoQuery("DELETE FROM {$SERVER['TBL_PREFIX']}ignore WHERE user='******'NAME']}' AND toignore='{$cmd['1']}'");
    } elseif ($cmd[0] == "voice" && $noauth != 1 && !isset($wuza)) {
        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET voice='{$ROOMS['id']}' WHERE username='******'1']}'");
        mnotice($cmd[1], 5);
    } elseif ($cmd[0] == "kick" && $noauth != 1 && !isset($wuza) && $PERMISSIONS['Kick'] != 1) {
        mnotice($cmd[1], 7);
        $time = time();
        DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}bans VALUES('0','{$ROOMS['IN_ROOM_NAME']}','{$cmd['1']}','','{$time}','60')");
    } elseif ($cmd[0] == "mkick" && $noauth != 1) {
        $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}online WHERE roomname='{$ROOMS['IN_ROOM_NAME']}'");
        while ($row = Do_Fetch_row($q)) {
            if ($row[1] != $XUSER['NAME']) {
                irc("/kick {$row['1']}");
            }
        }
    } elseif ($cmd[0] == "op" && $noauth != 1 && !isset($wuza)) {
        $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}users WHERE username='******'1']}'");
        $row = Do_Fetch_Row($q);
        if (strlen($XUSER['LEVEL']) == 1) {
            $isop = 0;
        } elseif (strlen($row[4]) > 1) {
            $isop = 1;
        }
        if ($isop == 0) {
            $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}online WHERE username='******'1']}'");
            $row = Do_Fetch_Row($q);
            if ($row[3] == $ROOMS['IN_ROOM_NAME']) {
                DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET level='3{$ROOMS['id']}' WHERE username='******'1']}'");
                mnotice($cmd[1], 3);
            }
        }
    } elseif ($cmd[0] == "away") {
        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET status=2 WHERE username='******'NAME']}'");
    } elseif ($cmd[0] == "back") {
        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET status='' WHERE username='******'NAME']}'");
    } elseif ($cmd[0] == "ignore") {
        $time = time();
        DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}ignore VALUES('0','{$XUSER['NAME']}','{$cmd['1']}','{$time}','')");
    } elseif ($cmd[0] == "msg") {
        $cmd[3] = strip($cmd[3]);
        sendprivatemsg($cmd[3], $cmd[1]);
    } elseif ($cmd[0] == "wallchop") {
        $cmd[3] = strip($cmd[3]);
        $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}online WHERE roomname='{$ROOMS['IN_ROOM_NAME']}'");
        while ($row = do_fetch_row($q)) {
            $q2 = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}users WHERE username='******'1']}'");
            $row2 = do_Fetch_row($q2);
            if ($row2[4] == "3{$ROOMS['id']}") {
                sendprivatemsg($cmd[3], $row[1]);
            }
        }
    } elseif ($cmd[0] == "ban" && $noauth != 1 && !isset($wuza) && $PERMISSIONS['Ban'] != 1) {
        $time = time();
        mnotice($cmd[1], 8);
        DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}bans VALUES('0','{$ROOMS['IN_ROOM_NAME']}','{$cmd['1']}','','{$time}','0')");
    } elseif ($cmd[0] == "deop" && $noauth != 1 && !isset($wuza)) {
        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET level='1' WHERE username='******'1']}'");
        mnotice($cmd[1], 4);
    } elseif ($cmd[0] == "roll") {
        global $XUSER, $SERVER, $ROOMS;
        $SERVER['CURRENT_TIME'] = time();
        $ran1 = rand(1, 6);
        $ran2 = rand(1, 6);
        if (@$cmd[1] == 2) {
            $message = "{$XUSER['NAME']} rolls two dice and gets a {$ran1} and a {$ran2}";
        } else {
            $message = "{$XUSER['NAME']} rolls a dice and gets a {$ran1}";
        }
        DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}messages \nVALUES('0','{$ROOMS['IN_ROOM_NAME']}','System','{$SERVER['CURRENT_TIME']}','0','{$message}')");
    } elseif ($cmd[0] == "me") {
        global $XUSER, $SERVER, $ROOMS;
        $SERVER['CURRENT_TIME'] = time();
        if ($cmd[1] != "") {
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}messages \nVALUES('0','{$ROOMS['IN_ROOM_NAME']}','System','{$SERVER['CURRENT_TIME']}','0','{$XUSER['NAME']} {$cmd['3']}')");
        }
    } elseif ($cmd[0] == "invite") {
        $SERVER['CURRENT_TIME'] = time();
        DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}messages \nVALUES('0','{$cmd['1']}:PRIV','System','{$SERVER['CURRENT_TIME']}','0','{$XUSER['NAME']} has invited you to join the chatroom <a href=\"../index.php?changeroom=set&room={$ROOMS['IN_ROOM_NAME']}\" target=\"_parent\">{$ROOMS['IN_ROOM_NAME']}</a>')");
    } elseif ($cmd[0] == "topic" && $noauth != 1) {
        $cmd[3] = strip($cmd[3]);
        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}rooms SET topic='{$cmd['3']}' WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
        mnotice($cmd[3], 12);
    } elseif ($cmd[0] == "wallchan" && $PERMISSIONS['Send_Sys_Message'] == 1) {
        sendsysmsg($cmd[3]);
    } elseif ($cmd[0] == "admin" && $PERMISSIONS['Make_Admins'] == 1) {
        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET level='4',time='0' WHERE username='******'1']}'");
        mnotice($cmd[1], 1);
    } elseif ($cmd[0] == "deadmin" && $PERMISSIONS['Make_Admins'] == 1) {
        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET level='1',time='0' WHERE username='******'1']}'");
        mnotice($cmd[1], 2);
    } elseif ($cmd[0] == "list") {
        $r = listrooms("dark");
        $r = eregi_replace("\r\n", "", $r);
        sendsysmsgto($r, "{$XUSER['NAME']}:PRIV");
    } elseif ($cmd[0] == "mode") {
        $error = 0;
        if (eregi("-", $cmd[1], $match)) {
            $type = "-";
        } else {
            $type = "+";
        }
        if ($cmd[3] == $cmd[1]) {
            $cmd[3] = "";
        }
        $temp = eregi_replace("\\+", "\\+", $cmd[1]);
        $temp = eregi_replace("\\-", "\\-", $temp);
        $cmd[3] = eregi_replace("{$temp}", "", $cmd[3]);
        $cmd[3] = eregi_replace("^ ", "", $cmd[3]);
        $cmd[3] = eregi_replace(" \$", "", $cmd[3]);
        if (eregi("p", $cmd[1], $match)) {
            if ($XUSER['LEVEL'] > 2) {
                if ($type == "-") {
                    DoQuery("UPDATE {$SERVER['TBL_PREFIX']}rooms SET type='1' WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
                    mnotice("", 11);
                } else {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode +p <i>password</i>";
                    } else {
                        if ($PERMISSIONS['CR_Private'] == 1) {
                            $error = "The administrator of this server has disabled private rooms.";
                        } else {
                            DoQuery("UPDATE {$SERVER['TBL_PREFIX']}rooms SET type='2',password='******'3']}' WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
                            mnotice("", 10);
                        }
                    }
                }
            } else {
                $error = 1;
            }
        }
        if (eregi("m", $cmd[1], $match)) {
            if ($XUSER['LEVEL'] > 2) {
                if ($type == "-") {
                    DoQuery("UPDATE {$SERVER['TBL_PREFIX']}rooms SET moderated='0' WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
                    mnotice("", 15);
                } else {
                    if ($PERMISSIONS['CR_Moderated'] == 1) {
                        $error = "The administrator of this server has disabled the creation of moderated rooms.";
                    } else {
                        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}rooms SET moderated='1' WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
                        mnotice("", 14);
                    }
                }
            } else {
                $error = 1;
            }
        }
        if (eregi("l", $cmd[1], $match)) {
            if ($XUSER['LEVEL'] > 2) {
                if ($type == "-") {
                    DoQuery("UPDATE {$SERVER['TBL_PREFIX']}rooms SET maxusers='0' WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
                    mnotice("Unlimited", 13);
                } else {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode +l <i>max users</i>";
                    } else {
                        if ($cmd[3] < 2) {
                            $cmd[3] = 2;
                        }
                        DoQuery("UPDATE {$SERVER['TBL_PREFIX']}rooms SET maxusers='{$cmd['3']}' WHERE name='{$ROOMS['IN_ROOM_NAME']}'");
                        mnotice($cmd[3], 13);
                    }
                }
            } else {
                $error = 1;
            }
        }
        if (eregi("b", $cmd[1], $match)) {
            if ($XUSER['LEVEL'] > 2) {
                if ($type == "-") {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode -b <i>username</i>";
                    } else {
                        irc("/unban {$cmd['3']}");
                    }
                } else {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode +b <i>username</i>";
                    } else {
                        irc("/ban {$cmd['3']}");
                    }
                }
            } else {
                $error = 1;
            }
        }
        if (eregi("v", $cmd[1], $match)) {
            if ($XUSER['LEVEL'] > 2) {
                if ($type == "-") {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode -v <i>username</i>";
                    } else {
                        irc("/devoice {$cmd['3']}");
                    }
                } else {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode +v <i>username</i>";
                    } else {
                        irc("/voice {$cmd['3']}");
                    }
                }
            } else {
                $error = 1;
            }
        }
        if (eregi("o", $cmd[1], $match)) {
            if ($XUSER['LEVEL'] > 2) {
                if ($type == "-") {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode -o <i>username</i>";
                    } else {
                        irc("/deop {$cmd['3']}");
                    }
                } else {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode +o <i>username</i>";
                    } else {
                        irc("/op {$cmd['3']}");
                    }
                }
            } else {
                $error = 1;
            }
        }
        if (eregi("i", $cmd[1], $match)) {
            if ($type == "-") {
                if ($cmd[3] == "") {
                    $error = "Usage: /mode -i <i>username</i>";
                } else {
                    irc("/unignore {$cmd['3']}");
                }
            } else {
                if ($cmd[3] == "") {
                    $error = "Usage: /mode +i <i>username</i>";
                } else {
                    irc("/ignore {$cmd['3']}");
                }
            }
        }
        if (eregi("a", $cmd[1], $match)) {
            if ($PERMISSIONS['Make_Admins'] == 1) {
                if ($type == "-") {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode -a <i>username</i>";
                    } else {
                        irc("/deadmin {$cmd['3']}");
                    }
                } else {
                    if ($cmd[3] == "") {
                        $error = "Usage: /mode +a <i>username</i>";
                    } else {
                        irc("/admin {$cmd['3']}");
                    }
                }
            } else {
                $error = 1;
            }
        }
        if ($error == 1) {
            sendsysmsgto("You do not have permission to use that command.", "{$XUSER['NAME']}:PRIV");
        } elseif ($error != "0") {
            sendsysmsgto($error, "{$XUSER['NAME']}:PRIV");
        }
    } else {
        $message = "Unknown Command {$cmd['0']}";
        if (isset($wuza)) {
            $message = "Sorry, You may not preform this action on this user.";
        }
        sendsysmsgto($message, "{$XUSER['NAME']}:PRIV");
    }
}
    }
    ?>
> <?php 
    echo $subjectcode->grade_subject_desc;
    ?>
</option> <?php 
}
?>
 
		</select>
		</td>
		<!--
		<td width="35%" class="tdinput"><input type="text" name="room" 
size="15" <?php 
if ($action == "edit") {
    echo " \nvalue=" . strip($schedule->teacher_schedule_room);
}
?>
> </td> 
		-->
		<td width="30%" class="tdinput">
			<select name="room">
		<?php 
//Display rooms from table
foreach ($rooms as $room) {
    ?>
		<option value="<?php 
    echo $room->school_rooms_id;
    ?>
" 
<?php 
    $sSQL = "SELECT studentbio_lname, studentbio_fname FROM studentbio WHERE studentbio_internalid='{$internalid}'";
    $dblid = $db->get_row($sSQL);
    if (strlen($dblid->studentbio_lname)) {
        $msgFormErr .= _ADMIN_ADD_STUDENT_2_FORM_ERROR2 . $dblid->studentbio_fname . " " . $dblid->studentbio_lname . "<br>";
    }
    //Get list of states
    $states = $db->get_results("SELECT * FROM tbl_states ORDER BY state_code");
    //Get list of Salutations
    $titles = $db->get_results("SELECT * FROM tbl_titles ORDER BY title_id");
    //Get list of relations
    $relations = $db->get_results("SELECT * FROM relations_codes ORDER BY relation_codes_desc");
    //Get default values
    $config = $db->get_row("SELECT * FROM tbl_config WHERE id=1");
    $set_state = $config->default_state;
    $set_city = strip($config->default_city);
    $set_zip = strip($config->default_zip);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title><?php 
echo _BROWSER_TITLE;
?>
</title>
<style type="text/css" media="all">@import "student-admin.css";</style>
<SCRIPT language="JavaScript">
/* Javascript function to submit form and check if field is empty */
예제 #26
0
function RADICADO_show()
{
    //-------------------------------
    // Initialize variables
    //-------------------------------
    global $db;
    global $sRADICADOErr;
    global $sFileName;
    global $styles;
    $sWhere = "";
    $sOrder = "";
    $sSQL = "";
    $sFormTitle = "Radicados";
    $HasParam = false;
    $iRecordsPerPage = 50;
    $iCounter = 0;
    $iPage = 0;
    $bEof = false;
    $iSort = "";
    $iSorted = "";
    $sDirection = "";
    $sSortParams = "";
    $iTmpI = 0;
    $iTmpJ = 0;
    $sCountSQL = "";
    $transit_params = "";
    $form_params = trim(session_name()) . "=" . trim(session_id()) . "&s_RADI_DEPE_ACTU=" . tourl(get_param("s_RADI_DEPE_ACTU")) . "&s_RADI_NOMB=" . tourl(get_param("s_RADI_NOMB")) . "&s_RADI_NUME_RADI=" . tourl(get_param("s_RADI_NUME_RADI")) . "&s_TDOC_CODI=" . tourl(get_param("s_TDOC_CODI")) . "&s_desde_dia=" . tourl(get_param("s_desde_dia")) . "&s_desde_mes=" . tourl(get_param("s_desde_mes")) . "&s_desde_ano=" . tourl(get_param("s_desde_ano")) . "&s_hasta_dia=" . tourl(get_param("s_hasta_dia")) . "&s_hasta_mes=" . tourl(get_param("s_hasta_mes")) . "&s_hasta_ano=" . tourl(get_param("s_hasta_ano")) . "&s_solo_nomb=" . tourl(get_param("s_solo_nomb")) . "&";
    //-------------------------------
    // Build ORDER BY statement
    //-------------------------------
    $sOrder = " order by R_RADI_NUME_RADI Asc";
    $iSort = get_param("FormRADICADO_Sorting");
    $iSorted = get_param("FormRADICADO_Sorted");
    if (!$iSort) {
        $form_sorting = "";
    } else {
        if ($iSort == $iSorted) {
            $form_sorting = "";
            $sDirection = " DESC";
            $sSortParams = "FormRADICADO_Sorting=" . $iSort . "&FormRADICADO_Sorted=" . $iSort . "&";
        } else {
            $form_sorting = $iSort;
            $sDirection = " ASC";
            $sSortParams = "FormRADICADO_Sorting=" . $iSort . "&FormRADICADO_Sorted=" . "&";
        }
        if ($iSort == 1) {
            $sOrder = " order by R_RADI_NUME_RADI" . $sDirection;
        }
        if ($iSort == 2) {
            $sOrder = " order by R_RADI_FECH_RADI" . $sDirection;
        }
        if ($iSort == 3) {
            $sOrder = " order by R_RADI_NOMB" . $sDirection;
        }
        if ($iSort == 4) {
            $sOrder = " order by RADI_NOMB " . $sDirection;
        }
        if ($iSort == 5) {
            $sOrder = " order by radi_path" . $sDirection;
        }
        if ($iSort == 6) {
            $sOrder = " order by RADI_NUME_IDEN" . $sDirection;
        }
        if ($iSort == 7) {
            $sOrder = " order by TDOC_DESC" . $sDirection;
        }
        if ($iSort == 8) {
            $sOrder = " order by DPTO_NOMB" . $sDirection;
        }
        if ($iSort == 9) {
            $sOrder = " order by DIASR" . $sDirection;
        }
        if ($iSort == 10) {
            $sOrder = " order by MUNI_NOMB" . $sDirection;
        }
    }
    //-------------------------------
    // Encabezados HTML de las Columnas
    //-------------------------------
    ?>
     <table width="1500" class="FormTABLE">
      <tr>
       <td class="FormHeaderTD" colspan="10"><a name="RADICADO"><font class="FormHeaderFONT"><?php 
    echo $sFormTitle;
    ?>
</font></a></td>
      </tr>
      <tr>
       <td class="ColumnTD"><font class="ColumnFONT">#</font></td>	  
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormRADICADO_Sorting=1&FormRADICADO_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Radicado</font></a></td>
       <td width="55" class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormRADICADO_Sorting=2&FormRADICADO_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Fecha Radicación</font></a></td>
       <td width="360" class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormRADICADO_Sorting=3&FormRADICADO_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">ESP</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormRADICADO_Sorting=6&FormRADICADO_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Nombre</font></a></td>	   
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormRADICADO_Sorting=6&FormRADICADO_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Identificacion</font></a></td>
       <td width="150" class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormRADICADO_Sorting=7&FormRADICADO_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Tipo Documento</font></a></td>
       <td width="150" class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormRADICADO_Sorting=4&FormRADICADO_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Usuario Actual</font></a></td>
       <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormRADICADO_Sorting=5&FormRADICADO_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Imagen</font></a></td>
	   <td width="100" class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormRADICADO_Sorting=8&FormRADICADO_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Departamento</font></a></td>
	   <td width="100" class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormRADICADO_Sorting=10&FormRADICADO_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Municipio</font></a></td>
  	   <td class="ColumnTD"><a href="<?php 
    echo $sFileName;
    ?>
?<?php 
    echo $form_params;
    ?>
FormRADICADO_Sorting=9&FormRADICADO_Sorted=<?php 
    echo $form_sorting;
    ?>
&"><font class="ColumnFONT">Dias Restantes</font></a></td>
      </tr>
<?php 
    //-------------------------------
    // Build WHERE statement
    //-------------------------------
    // Se crea la $ps_desde_RADI_FECH_RADI con los datos ingresados.
    //------------------------------------
    $ps_desde_RADI_FECH_RADI = Date('d/m/Y H:i:s', mktime(0, 0, 0, get_param("s_desde_mes"), get_param("s_desde_dia"), get_param("s_desde_ano")));
    if (strlen($ps_desde_RADI_FECH_RADI)) {
        $HasParam = true;
        $sWhere = $sWhere . "a.RADI_FECH_RADI>=to_date('" . $ps_desde_RADI_FECH_RADI . "','dd/mm/yyyy hh24:mi:ss')";
    }
    //-----------------------
    // Se reciben
    //-----------------------
    $ps_hasta_RADI_FECH_RADI = Date('d/m/Y H:i:s', mktime(23, 59, 59, get_param("s_hasta_mes"), get_param("s_hasta_dia"), get_param("s_hasta_ano")));
    if (strlen($ps_hasta_RADI_FECH_RADI)) {
        if ($sWhere != "") {
            $sWhere .= " and ";
        }
        $HasParam = true;
        $sWhere = $sWhere . "a.RADI_FECH_RADI<=to_date('" . $ps_hasta_RADI_FECH_RADI . "','dd/mm/yyyy hh24:mi:ss')";
    }
    /* Se recibe la dependencia actual para búsqueda */
    $ps_RADI_DEPE_ACTU = get_param("s_RADI_DEPE_ACTU");
    if (is_number($ps_RADI_DEPE_ACTU) && strlen($ps_RADI_DEPE_ACTU)) {
        $ps_RADI_DEPE_ACTU = tosql($ps_RADI_DEPE_ACTU, "Number");
    } else {
        $ps_RADI_DEPE_ACTU = "";
    }
    if (strlen($ps_RADI_DEPE_ACTU)) {
        if ($sWhere != "") {
            $sWhere .= " and ";
        }
        $HasParam = true;
        $sWhere = $sWhere . "a.RADI_DEPE_ACTU=" . $ps_RADI_DEPE_ACTU;
    }
    /* Se recibe el número del radicado para búsqueda */
    $ps_RADI_NUME_RADI = get_param("s_RADI_NUME_RADI");
    if (strlen($ps_RADI_NUME_RADI)) {
        if ($sWhere != "") {
            $sWhere .= " and ";
        }
        $HasParam = true;
        $sWhere = $sWhere . "a.RADI_NUME_RADI like " . tosql("%" . $ps_RADI_NUME_RADI . "%", "Text");
    }
    /* Se recibe el tipo de documento para la búsqueda */
    $ps_TDOC_CODI = get_param("s_TDOC_CODI");
    if (is_number($ps_TDOC_CODI) && strlen($ps_TDOC_CODI) && $ps_TDOC_CODI != "9999") {
        $ps_TDOC_CODI = tosql($ps_TDOC_CODI, "Number");
    } else {
        $ps_TDOC_CODI = "";
    }
    if (strlen($ps_TDOC_CODI)) {
        if ($sWhere != "") {
            $sWhere .= " and ";
        }
        $HasParam = true;
        $sWhere = $sWhere . "b.SGD_TPR_CODIGO=" . $ps_TDOC_CODI;
    }
    /*
    // Aca se recibe el texto para busqueda de texto. Se tokeniza y se busca por cada 
    // uno de las palabras individuales por AND. 
    // s_solo_nomb toma los siguientes valores: 
    // "Texto" - si hay que buscar en todo lado
    // "Nombre" - si hay que buscar solo en el nombre (radi_nomb antiguamente)
    // s_RADI_NOMB trae el parametro para busqueda, puede ser una cadena separada por espacios
    */
    $ps_RADI_NOMB = get_param("s_RADI_NOMB");
    $ps_solo_nomb = get_param("s_solo_nomb");
    $array_nombre = split(" ", strip(get_param("s_RADI_NOMB")) . "    ");
    $where_split = "";
    if (strip(get_param("s_RADI_NOMB"))) {
        if ($array_nombre[0]) {
            $where_split = " and CONCAT(CONCAT(d.sgd_ciu_nombre,d.sgd_ciu_apell1),d.sgd_ciu_apell2) LIKE '%" . $array_nombre[0] . "%' ";
        }
        if ($array_nombre[1]) {
            $where_split .= " and  CONCAT(CONCAT(d.sgd_ciu_nombre,d.sgd_ciu_apell1),d.sgd_ciu_apell2) LIKE '%" . $array_nombre[1] . "%' ";
        }
        if ($array_nombre[2]) {
            $where_split .= " and CONCAT(CONCAT(d.sgd_ciu_nombre,d.sgd_ciu_apell1),d.sgd_ciu_apell2) LIKE '%" . $array_nombre[2] . "%' ";
        }
        if ($array_nombre[3]) {
            $where_split .= " and CONCAT(CONCAT(d.sgd_ciu_nombre,d.sgd_ciu_apell1),d.sgd_ciu_apell2) LIKE '%" . $array_nombre[3] . "%' ";
        }
    }
    if ($HasParam) {
        $sWhere = " WHERE  a.radi_nume_radi =d.radi_nume_radi (+) and  a.tdoc_codi=b.sgd_tpr_codigo and a.tdoc_codi=b.sgd_tpr_codigo  AND (" . $sWhere . ")  {$where_split} ";
    }
    //-------------------------------
    // Build base SQL statement
    //-------------------------------
    $campos_ver = "a.RADI_NUME_HOJA\n\t   \t\t\t ,a.RADI_FECH_RADI as R_RADI_FECH_RADI\n\t\t\t\t ,a.RADI_NUME_RADI  as R_RADI_NUME_RADI\n\t\t\t\t ,a.RA_ASUN as R_RADI_ASUN\n\t\t\t\t ,a.RADI_PATH R_RADI_PATH\n\t\t\t\t ,a.RADI_USU_ANTE\n\t\t\t\t ,c.NOMBRE_DE_LA_EMPRESA as R_RADI_NOMB\n\t\t\t\t ,TO_CHAR(a.RADI_FECH_RADI,'DD/MM/YY   HH:MIam') AS FECHA\n\t\t\t\t ,b.sgd_tpr_descrip  as R_TDOC_DESC \n\t\t\t\t ,b.sgd_tpr_codigo\n\t\t\t\t ,b.sgd_tpr_termino,round(((radi_fech_radi+(b.sgd_tpr_termino * 7/5))-sysdate)) as diasr\n\t\t\t\t ,RADI_LEIDO\n\t\t\t\t ,RADI_TIPO_DERI\n\t\t\t\t ,RADI_NUME_DERI \n\t\t\t\t ,d.SGD_CIU_NOMBRE,d.SGD_CIU_APELL1,d.SGD_CIU_APELL2";
    $isql = "select \n\t   \t\t\t{$campos_ver}\n\t\t\t\tfrom radicado a,sgd_tpr_tpdcumento b,bodega_empresas c,\n\t\t\t\t( \n\t\t\t\t SELECT DISTINCT b.sgd_ciu_cedula,a.radi_nume_radi,b.sgd_ciu_nombre,b.sgd_ciu_apell1,b.sgd_ciu_apell2,b.sgd_ciu_codigo\n\t\t\t\t FROM SGD_DIR_DRECCIONES a,SGD_CIU_CIUDADANO b\n\t\t\t\t WHERE b.sgd_ciu_codigo  =a.sgd_ciu_codigo \n\t\t\t\t) d\n\t\t\t\t{$sWhere}\n\t\t\t\t and c.IDENTIFICADOR_EMPRESA  =  a.eesp_codi\n\t\t\t\t\n\t\t\t\t";
    $isql .= "union all \n\t            select a.RADI_NUME_HOJA,a.RADI_FECH_RADI,a.RADI_NUME_RADI,a.RA_ASUN,a.RADI_PATH,\n\t             a.RADI_USU_ANTE,'No tiene' AS NOMBRES,\n\t\t\t\t TO_CHAR(a.RADI_FECH_RADI,'DD/MM/YY   HH:MIam') AS FECHA,b.sgd_tpr_descrip,b.sgd_tpr_codigo,\n\t\t\t\t b.sgd_tpr_termino,round(((radi_fech_radi+(b.sgd_tpr_termino * 7/5))-sysdate)) as diasr,\n\t\t\t\t RADI_LEIDO,RADI_TIPO_DERI,RADI_NUME_DERI ,d.SGD_CIU_NOMBRE,d.SGD_CIU_APELL1,d.SGD_CIU_APELL2\n\t\t\t\tfrom radicado a,sgd_tpr_tpdcumento b ,\n\t\t\t\t( \n\t\t\t\t SELECT DISTINCT b.sgd_ciu_cedula,a.radi_nume_radi,b.SGD_CIU_NOMBRE,b.SGD_CIU_APELL1,b.SGD_CIU_APELL2,b.sgd_ciu_codigo\n\t\t\t\t FROM SGD_DIR_DRECCIONES a,SGD_CIU_CIUDADANO b\n\t\t\t\t WHERE b.sgd_ciu_codigo  =a.sgd_ciu_codigo \n\t\t\t\t) d\n\t\t\t\t{$sWhere}\n\t\t\t\tand a.eesp_codi=0 \t\t\t\t\n\t\t\t\t{$sOrder} ";
    $sSQL = $isql;
    //-------------------------------
    //-------------------------------
    // RADICADO Open Event begin
    // Busqueda por nivel
    /*
    $nivel = get_session("Nivel");
    if($sWhere != "") 
      $sWhere .= " and ";
    else 
      $sWhere = " where ";
    $sWhere = $sWhere . " R.CODI_NIVEL<=".$nivel ." AND R.RADI_USUA_ACTU=U.USUA_CODI AND R.RADI_DEPE_ACTU=U.DEPE_CODI ";
    */
    // Contador
    /*$sSQLCount = "Select count(*) as Total from radicado R, USUARIO U, departamento D,TIPO_DOCUMENTO B, MUNICIPIO M  " . $sWhere;
    */
    $sSQLCount1 = "select \n\t   \t\t\tcount(*) as TOTAL\n\t\t\t\tfrom radicado a,sgd_tpr_tpdcumento b,\n\t\t\t\tbodega_empresas c,\n\t\t\t\t( \n\t\t\t\t SELECT DISTINCT b.sgd_ciu_cedula,a.radi_nume_radi,b.sgd_ciu_nombre,b.sgd_ciu_apell1,b.sgd_ciu_apell2,b.sgd_ciu_codigo\n\t\t\t\t FROM SGD_DIR_DRECCIONES a,SGD_CIU_CIUDADANO b\n\t\t\t\t WHERE b.sgd_ciu_codigo=a.sgd_ciu_codigo\n\t\t\t\t) d\n\t\t\t\t{$sWhere} \n\t\t\t\t and c.IDENTIFICADOR_EMPRESA  =  a.eesp_codi";
    $sSQLCount2 = "select \n\t   \t\t\tcount(*) as TOTAL\n\t\t\t\tfrom radicado a,sgd_tpr_tpdcumento b,\n\t\t\t\t( \n\t\t\t\t SELECT DISTINCT b.sgd_ciu_cedula,a.radi_nume_radi,b.sgd_ciu_nombre,b.sgd_ciu_apell1,b.sgd_ciu_apell2,b.sgd_ciu_codigo\n\t\t\t\t FROM SGD_DIR_DRECCIONES a,SGD_CIU_CIUDADANO b\n\t\t\t\t WHERE b.sgd_ciu_codigo=a.sgd_ciu_codigo\n\t\t\t\t) d\n\t\t\t\t{$sWhere} \n\t\t\t\t and a.eesp_codi = 0\n\t\t\t\t";
    //  echo "$sSQLCount1<br><br>";
    //  echo "$sSQLCount2<br><br>";
    //  echo "$sSQL";
    /*
    $db->query($sSQLCount1);
    $next_record = $db->next_record();
    $fldTotal1 = $db->f("TOTAL"); 
    
    $db->query($sSQLCount2);
    $next_record = $db->next_record();
    $fldTotal2 = $db->f("TOTAL"); 
    
    $fldTotal = $fldTotal1 + $fldTotal2; 
    */
    // RADICADO Open Event end
    //-------------------------------
    //-------------------------------
    // Assemble full SQL statement
    //-------------------------------
    //-------------------------------
    // Execute SQL statement
    //-------------------------------
    $db->query($sSQL);
    $next_record = $db->next_record();
    //-------------------------------
    // Process empty recordset
    //-------------------------------
    if (!$next_record) {
        ?>
     <tr>
      <td colspan="10" class="DataTD"><font class="DataFONT">No hay resultados</font></td>
     </tr>
<?php 
        //-------------------------------
        //  The insert link.
        //-------------------------------
        ?>
    <tr>
     <td colspan="10" class="ColumnTD"><font class="ColumnFONT">
<?php 
        ?>
  </table>
<?php 
        return;
    }
    //-------------------------------
    ?>
     <!--tr>
      <td colspan="10" class="DataTD"><font class="DataFONT"><b>Total Registros Encontrados: <?php 
    echo $fldTotal;
    ?>
</b></font></td>
     </tr-->

<?php 
    //-------------------------------
    // Initialize page counter and records per page
    //-------------------------------
    $iRecordsPerPage = 20;
    $iCounter = 0;
    //-------------------------------
    //-------------------------------
    // Process page scroller
    //-------------------------------
    $iPage = get_param("FormRADICADO_Page");
    if (!strlen($iPage)) {
        $iPage = 1;
    } else {
        if ($iPage == "last") {
            $db_count = get_db_value($sCountSQL);
            $dResult = intval($db_count) / $iRecordsPerPage;
            $iPage = intval($dResult);
            if ($iPage < $dResult) {
                $iPage++;
            }
        } else {
            $iPage = intval($iPage);
        }
    }
    if (($iPage - 1) * $iRecordsPerPage != 0) {
        do {
            $iCounter++;
        } while ($iCounter < ($iPage - 1) * $iRecordsPerPage && $db->next_record());
        $next_record = $db->next_record();
    }
    $iCounter = 0;
    //-------------------------------
    //-------------------------------
    // Display grid based on recordset
    //-------------------------------.
    while ($next_record && $iCounter < $iRecordsPerPage) {
        //-------------------------------
        // Create field variables based on database fields
        //-------------------------------
        $fldRADI_FECH_RADI = $db->f("R_RADI_FECH_RADI");
        $fldRADI_NOMB = $db->f("R_RADI_NOMB");
        $fldRADI_NUME_IDEN = $db->f("R_RADI_NUME_IDEN");
        $fldRADI_NUME_RADI_URLLink = "detalle.php";
        $fldRADI_NUME_RADI_s_RADI_NUME_RADI = $db->f("R_RADI_NUME_RADI");
        $fldRADI_NUME_RADI = $db->f("R_RADI_NUME_RADI");
        $fldRADI_PRIM_APEL = $db->f("R_RADI_PRIM_APEL");
        $fldRADI_SEGU_APEL = $db->f("R_RADI_SEGU_APEL");
        $fldRADI_USUA_ACTU = $db->f("R_RADI_USUA_ACTU");
        $fldRADI_USUA_NOMBRE = $db->f("SGD_CIU_APELL1") . " " . $db->f("SGD_CIU_APELL2") . " " . $db->f("SGD_CIU_NOMBRE");
        $fldRADI_PATH = $db->f("R_RADI_PATH");
        $fldRADI_TDOC_DESC = $db->f("R_TDOC_DESC");
        $fldMUNI_NOMB = $db->f("M_MUNI_NOMB");
        $fldRADI_PATH1 = $db->f("R_RADI_PATH");
        $fldDPTO_CODI = $db->f("R_DPTO_CODI");
        $fldDPTO_NOMB = $db->f("D_DPTO_NOMB");
        $fldDIASR = $db->f("DIASR");
        $fldRADI_DEPE_ACTU = $db->f("RADI_DEPE_ACTU");
        $next_record = $db->next_record();
        //-------------------------------
        // RADICADO Show begin
        //-------------------------------
        //-------------------------------
        /* RADICADO Show Event begin
        */
        if (strlen($fldRADI_PATH)) {
            $iii = $iii + 1;
            $fldRADI_PATH = "<a href='../bodega{$fldRADI_PATH1}' target='Imagen{$iii}'>Si</a>";
        } else {
            $fldRADI_PATH = "No";
        }
        // RADICADO Show Event end
        //-------------------------------
        //-------------------------------
        // Process the HTML controls
        //-------------------------------
        ?>
      <tr>
       <td class="DataTD"><font class="DataFONT"><?php 
        echo $iCounter + 1 + ($iPage - 1) * $iRecordsPerPage;
        ?>
</td> 
       <td class="DataTD"><font class="DataFONT"> <a href="<?php 
        echo $fldRADI_NUME_RADI_URLLink;
        ?>
?s_RADI_NUME_RADI=<?php 
        echo $fldRADI_NUME_RADI_s_RADI_NUME_RADI;
        ?>
&"><font class="DataFONT"><?php 
        echo $fldRADI_NUME_RADI;
        ?>
</font></a>&nbsp;</font></td>
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldRADI_FECH_RADI);
        ?>
&nbsp;</font></td>
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldRADI_NOMB);
        ?>
&nbsp;</font></td>
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldRADI_USUA_NOMBRE);
        ?>
&nbsp;</font></td>
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldRADI_NUME_IDEN);
        ?>
&nbsp;</font></td>
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldRADI_TDOC_DESC);
        ?>
&nbsp;</font></td>
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldRADI_USUA_ACTU);
        ?>
&nbsp;</font></td>
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo $fldRADI_PATH;
        ?>
&nbsp;</font></td>
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldDPTO_NOMB);
        ?>
&nbsp;</font></td>	  
       <td class="DataTD"><font class="DataFONT">
      <?php 
        echo tohtml($fldMUNI_NOMB);
        ?>
&nbsp;</font></td>	  
      <td class="DataTD"><font class="DataFONT">
      <?php 
        if ($fldRADI_DEPE_ACTU != 999) {
            echo tohtml($fldDIASR);
        } else {
            echo "Sal";
        }
        ?>
&nbsp;</font></td>	  
      </tr>


	  
	  <?php 
        //-------------------------------
        // RADICADO Show end
        //-------------------------------
        //-------------------------------
        // Move to the next record and increase record counter
        //-------------------------------
        $iCounter++;
    }
    //-------------------------------
    //  Grid. The insert link and record navigator.
    //-------------------------------
    ?>
    <tr>
     <td colspan="10" class="ColumnTD"><font class="ColumnFONT">
<?php 
    // RADICADO Navigation begin
    $bEof = $next_record;
    if ($bEof || $iPage != 1) {
        $iCounter = 1;
        $iHasPages = $iPage;
        $sPages = "";
        $iDisplayPages = 0;
        $iNumberOfPages = 30;
        /* El número de páginas que aparecerán en el navegador al pie de la página */
        while ($next_record && $iHasPages < $iPage + $iNumberOfPages) {
            if ($iCounter == $iRecordsPerPage) {
                $iCounter = 0;
                $iHasPages = $iHasPages + 1;
            }
            $iCounter++;
            $next_record = $db->next_record();
        }
        if (!$next_record && $iCounter > 1) {
            $iHasPages++;
        }
        if ($iHasPages - $iPage < intval($iNumberOfPages / 2)) {
            $iStartPage = $iHasPages - $iNumberOfPages;
        } else {
            $iStartPage = $iPage - $iNumberOfPages + intval($iNumberOfPages / 2);
        }
        if ($iStartPage < 0) {
            $iStartPage = 0;
        }
        for ($iPageCount = $iPageCount + 1; $iPageCount <= $iPage - 1; $iPageCount++) {
            $sPages .= "<a href=" . $sFileName . "?" . $form_params . $sSortParams . "FormRADICADO_Page=" . $iPageCount . "#RADICADO\"><font " . "class=\"ColumnFONT\"" . ">" . $iPageCount . "</font></a>&nbsp;";
            $iDisplayPages++;
        }
        $sPages .= "<font " . "class=\"ColumnFONT\"" . "><b>" . $iPage . "</b></font>&nbsp;";
        $iDisplayPages++;
        $iPageCount = $iPage + 1;
        while ($iDisplayPages < $iNumberOfPages && $iStartPage + $iDisplayPages < $iHasPages) {
            $sPages .= "<a href=\"" . $sFileName . "?" . $form_params . $sSortParams . "FormRADICADO_Page=" . $iPageCount . "#RADICADO\"><font " . "class=\"ColumnFONT\"" . ">" . $iPageCount . "</font></a>&nbsp;";
            $iDisplayPages++;
            $iPageCount++;
        }
        if ($iPage == 1) {
            ?>
        <font class="ColumnFONT">Primero</font>
        <font class="ColumnFONT">Anterior</font>
<?php 
        } else {
            ?>
        <a href="<?php 
            echo $sFileName;
            ?>
?<?php 
            echo $form_params;
            echo $sSortParams;
            ?>
FormRADICADO_Page=1#RADICADO"><font class="ColumnFONT">Primero</font></a>
        <a href="<?php 
            echo $sFileName;
            ?>
?<?php 
            echo $form_params;
            echo $sSortParams;
            ?>
FormRADICADO_Page=<?php 
            echo $iPage - 1;
            ?>
#RADICADO"><font class="ColumnFONT">Anterior</font></a>
<?php 
        }
        echo "&nbsp;[&nbsp;" . $sPages . "]&nbsp;";
        if (!$bEof) {
            ?>
        <font class="ColumnFONT">Siguiente</font>
        <font class="ColumnFONT">Ultimo</font>
<?php 
        } else {
            ?>
        <a href="<?php 
            echo $sFileName;
            ?>
?<?php 
            echo $form_params;
            echo $sSortParams;
            ?>
FormRADICADO_Page=<?php 
            echo $iPage + 1;
            ?>
#RADICADO"><font class="ColumnFONT">Siguiente</font></a>
        <a href="<?php 
            echo $sFileName;
            ?>
?<?php 
            echo $form_params;
            echo $sSortParams;
            ?>
FormRADICADO_Page=last#RADICADO"><font class="ColumnFONT">Ultimo</font></a>
<?php 
        }
    }
    //-------------------------------
    // RADICADO Navigation end
    //-------------------------------
    //-------------------------------
    // Finish form processing
    //-------------------------------
    ?>
      </font></td></tr>
    </table>
  <?php 
    //-------------------------------
    // RADICADO Close Event begin
    // RADICADO Close Event end
    //-------------------------------
}
예제 #27
0
 function form_finish()
 {
     if ($_POST['albumselect'] == '' && empty($_POST['folder'])) {
         return $this->form_publish('Please enter the name of the new album');
     }
     if ($_POST['albumselect'] == '' && $_POST['folder'] != '') {
         $folder = strip($_POST['folder']);
         $uploaddir = SERVERPATH . '/albums/' . $folder;
         if (!is_dir($uploaddir)) {
             mkdir($uploaddir, 0777);
         }
         @chmod($uploaddir, 0777);
         $gallery = new Gallery();
         $album = new Album($gallery, $folder);
         $title = strip($_POST['albumtitle']);
         if (!empty($title)) {
             $album->setTitle($title);
         }
     } else {
         $folder = strip($_POST['albumselect']);
     }
     $this->header();
     echo '<h2>Just a moment...</h2>';
     $this->buttonsEnableBack = true;
     $this->buttonsEnableNext = true;
     $this->buttonsLastServerSidePage = true;
     $this->footer('startUpload("' . utf8::encode_javascript($folder) . '"); ');
 }
예제 #28
0
// Print the sortable stuff
zenSortablesHeader($_zp_sortable_list, 'images', 'imageOrder', 'img', "placeholder:'zensortable_img'");
echo "\n</head>";
?>


<body>

<?php 
// Create our gallery
$gallery = new Gallery();
// Create our album
if (!isset($_GET['album'])) {
    die(gettext("No album provided to sort."));
} else {
    $folder = strip($_GET['album']);
    if (!isMyAlbum($folder, EDIT_RIGHTS)) {
        die(gettext("You do not have rights to sort this album"));
    }
    $album = new Album($gallery, $folder);
    if (isset($_GET['saved'])) {
        $album->setSortType("manual");
        $album->setSortDirection('image', 0);
        $album->save();
    }
    // Layout the page
    printLogoAndLinks();
    ?>

<div id="main"><?php 
    printTabs('edit');
예제 #29
0
{
    $parts = preg_split('#//<(/?brickrouge)>#', $str, -1, PREG_SPLIT_DELIM_CAPTURE);
    # 0: before
    # 1: brickrouge
    # 2: content
    # 3: /brickrouge
    $content = '';
    foreach ($parts as $i => $part) {
        if ($i % 4 != 2) {
            continue;
        }
        $content .= $part;
    }
    return $content;
}
$path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR;
$tmp_path = $_SERVER['argv'][1];
$iterator = new \DirectoryIterator($path);
$filter = new \RegexIterator($iterator, '#\\.less$#');
$except = array('brickrouge.less', 'mixins.less', 'variables.less');
foreach ($filter as $file) {
    $filename = $file->getFilename();
    $pathname = $file->getPathname();
    if (in_array($filename, $except)) {
        copy($pathname, $tmp_path . $filename);
    } else {
        $content = file_get_contents($pathname);
        $content = strip($content);
        file_put_contents($tmp_path . $filename, $content);
    }
}
예제 #30
0
    }
}
if ($enviar == 1) {
    // Llama la p�gina que hace el procesamiento
    echo " .. ";
    echo "<form action='" . $ruta_raiz . "/solicitar/Reservar.php?<?={$encabezado}?>' method='post' name='go'> </form><br>";
    echo "<script>document.go.submit();</script>";
}
// Build SQL
$sSQLsele = " and P.PRES_ID in (" . $setFiltroSelect . ") ";
include $ruta_raiz . "/include/query/prestamo/builtSQL1.inc";
include $ruta_raiz . "/include/query/prestamo/builtSQL3.inc";
// Build ORDER statement
$iSort = strip($_POST["FormPedidos_Sorting"]);
$iSorted = strip($_POST["FormPedidos_Sorted"]);
$sDirection = strip($_POST["s_Direction"]);
if ($pageAnt != $sFileName) {
    if ($iSorted == $iSort && ($sDirection = " DESC ")) {
        $sDirection = " ASC ";
    } else {
        $sDirection = " DESC ";
    }
}
if ($iSorted != $iSort) {
    $sDirection = " DESC ";
} else {
    if (strcasecmp($sDirection, " DESC ") == 0) {
        $sDirection = " ASC ";
    } else {
        $sDirection = " DESC ";
    }