Ejemplo n.º 1
0
    $fileName = quote_smart($_FILES['imagen']['name'], $connection);
    $tmpName = $_FILES['imagen']['tmp_name'];
    $fileSize = quote_smart($_FILES['imagen']['size'], $connection);
    $fileType = quote_smart($_FILES['imagen']['type'], $connection);
    $fp = fopen($tmpName, 'r');
    $content = fread($fp, filesize($tmpName));
    $content = addslashes($content);
    fclose($fp);
    $insertTicket = "INSERT INTO INSTANT_WIN (descripcion, mensaje, inicio, fin, name, type, size, content) \r\n\t\t\tVALUES ({$descripcion}, {$mensaje}, {$inicio}, {$fin}, {$fileName}, {$fileType}, {$fileSize}, '{$content}')";
    $res = mysql_query($insertTicket, $connection);
    // or die ("Error en insert ".mysql_error()."\n".$query);
    mysql_close($connection);
    header("Location: boPremiosInstantaneos.php");
} else {
    $query = "SELECT IW.*, UNIX_TIMESTAMP(IW.FIN) FIN_UNIX, TI.ticket, SU.id systemUserID, SU.nombre, SU.apellido\r\n\t\tFROM INSTANT_WIN IW \r\n\t\tLEFT JOIN TICKETS TI ON (IW.ticketID = TI.id) \t\t\r\n\t\tLEFT JOIN SYSTEMUSER SU ON (TI.systemUserID = SU.id) \r\n\t\tORDER BY IW.inicio";
    $res = doSelect($query);
    ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Finca Las Moras - Premia tu forma de disfrutar la vida - BACKOFFICE</title>
<meta name="keywords" content="Vino, Tinto, Blanco, Finca Las Moras, Beber con moderaci�n" />
<meta name="description" content="Finca Las Moras recompensa tu forma de disfrutar la vida" />
<meta name="AUTHOR" content="That Day in London - Agencia Interactiva & Dise�o - para Publiquest" />
<link rel="icon" href="./favicon.ico" type="icon"/>
<!-- Contact Form CSS files -->
<link type='text/css' href='css/tdil.css' rel='stylesheet' media='screen' />
<style>
	#content #page {
	width: 850px;
	padding: 0px;
Ejemplo n.º 2
0
/**
 *
 *
 * @param unknown $queryType
 */
function doQuery($queryType)
{
    global $currentTag;
    global $BBox;
    global $tables;
    global $fields;
    global $values;
    global $wheres;
    global $filters;
    global $limits;
    global $disjoints;
    global $resultType;
    global $notDisjoints;
    global $disjointCoords;
    global $notDisjointCoords;
    global $WKTfilters;
    global $filterPropertyNames;
    global $postgisObject;
    global $srs;
    global $useWktToGmlInPHP;
    global $postgisschema;
    global $tableObj;
    global $timeSlice;
    global $user;
    global $parentUser;
    global $layerObj;
    global $dbSplit;
    global $fieldConfArr;
    global $geometryColumnsObj;
    if (!$srs) {
        makeExceptionReport("You need to specify a srid in the URL.");
    }
    switch ($queryType) {
        case "Select":
            foreach ($tables as $table) {
                $HTTP_FORM_VARS["TYPENAME"] = $table;
                include_once "inc/http_basic_authen_subuser.php";
                $tableObj = new table($postgisschema . "." . $table);
                $primeryKey = $tableObj->getPrimeryKey($postgisschema . "." . $table);
                $fieldConfArr = (array) json_decode($geometryColumnsObj->getValueFromKey("{$postgisschema}.{$table}.the_geom", "fieldconf"));
                $sql = "SELECT ";
                if ($resultType != "hits") {
                    if (!empty($fields[$table])) {
                        $fields[$table] = substr($fields[$table], 0, strlen($fields[$table]) - 1);
                        $fieldsArr[$table] = explode(",", $fields[$table]);
                    } else {
                        foreach ($postgisObject->getMetaData($table) as $key => $value) {
                            if ($key != $primeryKey['attname']) {
                                $fieldsArr[$table][] = $key;
                            }
                        }
                    }
                    // We add "" around field names in sql, so sql keywords don't mess things up
                    foreach ($fieldsArr[$table] as $key => $value) {
                        $fieldsArr[$table][$key] = "\"{$value}\"";
                    }
                    $sql = $sql . implode(",", $fieldsArr[$table]) . ",\"{$primeryKey['attname']}\" as fid";
                    foreach ($tableObj->metaData as $key => $arr) {
                        if ($arr['type'] == "geometry") {
                            if ($useWktToGmlInPHP) {
                                $sql = str_replace("\"{$key}\"", "public.ST_AsText(public.ST_Transform(\"" . $key . "\"," . $srs . ")) as " . $key, $sql);
                            } else {
                                $sql = str_replace("\"{$key}\"", "ST_AsGml(public.ST_Transform(\"" . $key . "\"," . $srs . ")) as " . $key, $sql);
                            }
                            $sql2 = "SELECT public.ST_Xmin(public.ST_Extent(public.ST_Transform(\"" . $key . "\",{$srs}))) AS TXMin,public.ST_Xmax(public.ST_Extent(public.ST_Transform(\"" . $key . "\",{$srs}))) AS TXMax, public.ST_Ymin(public.ST_Extent(public.ST_Transform(\"" . $key . "\",{$srs}))) AS TYMin,public.ST_Ymax(public.ST_Extent(public.ST_Transform(\"" . $key . "\",{$srs}))) AS TYMax ";
                        }
                        if ($arr['type'] == "bytea") {
                            $sql = str_replace("\"{$key}\"", "encode(\"" . $key . "\",'escape') as " . $key, $sql);
                        }
                    }
                } else {
                    $sql .= "count(*) as count";
                }
                $from = " FROM {$postgisschema}.{$table}";
                if ($tableObj->versioning && $timeSlice != false && $timeSlice != "all") {
                    $from .= ",(SELECT gc2_version_gid as _gc2_version_gid,max(gc2_version_start_date) as max_gc2_version_start_date from {$postgisschema}.{$table} where gc2_version_start_date <= '{$timeSlice}' GROUP BY gc2_version_gid) as gc2_join";
                }
                if (!empty($BBox) || !empty($wheres[$table]) || !empty($filters[$table])) {
                    $from .= " WHERE ";
                    $wheresFlag = true;
                }
                if (!empty($wheres[$table])) {
                    $from .= "(" . $wheres[$table] . ")";
                }
                if ($tableObj->versioning && $timeSlice != "all") {
                    if (!$wheresFlag) {
                        $from .= " WHERE ";
                    } else {
                        $from .= " AND ";
                    }
                    if (!$timeSlice) {
                        $from .= "gc2_version_end_date is null";
                    } else {
                        $from .= "gc2_join._gc2_version_gid = gc2_version_gid AND gc2_version_start_date = gc2_join.max_gc2_version_start_date";
                    }
                }
                if ($tableObj->workflow && $parentUser == false) {
                    $roleObj = $layerObj->getRole($postgisschema, $table, $user);
                    $role = $roleObj["data"][$user];
                    switch ($role) {
                        case "author":
                            $from .= " AND (gc2_status = 3 OR gc2_workflow @> 'author => {$user}')";
                            break;
                        case "reviewer":
                            $from .= "";
                            break;
                        case "publisher":
                            $from .= "";
                            break;
                        default:
                            $from .= " AND (gc2_status = 3)";
                            break;
                    }
                }
                //die($from);
                if (!empty($BBox) || !empty($wheres[$table])) {
                    //$from =dropLastChrs($from, 5);
                    //$from.=")";
                }
                if (!empty($limits[$table])) {
                    //$from .= " LIMIT " . $limits[$table];
                }
                //die($sql.$from);
                doSelect($table, $sql, $sql2, $from);
            }
            break;
        default:
            break;
    }
}
Ejemplo n.º 3
0
/**
 *
 *
 * @param unknown $queryType
 */
function doQuery($queryType)
{
    global $currentTag;
    global $BBox;
    global $tables;
    global $fields;
    global $values;
    global $wheres;
    global $filters;
    global $limits;
    global $disjoints;
    global $notDisjoints;
    global $disjointCoords;
    global $notDisjointCoords;
    global $WKTfilters;
    global $filterPropertyNames;
    global $postgisObject;
    global $srs;
    global $useWktToGmlInPHP;
    global $postgisschema;
    global $tableObj;
    global $fieldConfArr;
    global $geometryColumnsObj;
    if (!$srs) {
        makeExceptionReport("You need to specify a srid in the URL.");
    }
    switch ($queryType) {
        case "Select":
            foreach ($tables as $table) {
                $tableObj = new table($postgisschema . "." . $table);
                $primeryKey = $tableObj->getPrimeryKey($postgisschema . "." . $table);
                $fieldConfArr = (array) json_decode($geometryColumnsObj->getValueFromKey("{$postgisschema}.{$table}.the_geom", "fieldconf"));
                $sql = "SELECT ";
                if (!empty($fields[$table])) {
                    $fields[$table] = substr($fields[$table], 0, strlen($fields[$table]) - 1);
                    $fieldsArr[$table] = explode(",", $fields[$table]);
                } else {
                    foreach ($postgisObject->getMetaData($table) as $key => $value) {
                        if ($key != $primeryKey['attname']) {
                            $fieldsArr[$table][] = $key;
                        }
                    }
                }
                // We add "" around field names in sql, so sql keywords don't mess things up
                foreach ($fieldsArr[$table] as $key => $value) {
                    $fieldsArr[$table][$key] = "\"{$value}\"";
                }
                $sql = $sql . implode(",", $fieldsArr[$table]) . ",{$primeryKey['attname']} as fid";
                foreach ($tableObj->metaData as $key => $arr) {
                    if ($arr['type'] == "geometry") {
                        if ($useWktToGmlInPHP) {
                            $sql = str_replace("\"{$key}\"", "public.ST_AsText(public.ST_Transform(" . $key . "," . $srs . ")) as " . $key, $sql);
                        } else {
                            $sql = str_replace("\"{$key}\"", "ST_AsGml(public.ST_Transform(" . $key . "," . $srs . ")) as " . $key, $sql);
                        }
                        $sql2 = "SELECT public.ST_Xmin(public.ST_Extent(public.ST_Transform(" . $key . ",{$srs}))) AS TXMin,public.ST_Xmax(public.ST_Extent(public.ST_Transform(" . $key . ",{$srs}))) AS TXMax, public.ST_Ymin(public.ST_Extent(public.ST_Transform(" . $key . ",{$srs}))) AS TYMin,public.ST_Ymax(public.ST_Extent(public.ST_Transform(" . $key . ",{$srs}))) AS TYMax ";
                    }
                }
                $from = " FROM {$postgisschema}.{$table}";
                if (!empty($BBox) || !empty($wheres[$table]) || !empty($filters[$table])) {
                    $from .= " WHERE ";
                }
                if (!empty($wheres[$table])) {
                    $from .= "(" . $wheres[$table] . ")";
                    // White spaces HAS TO BE THERE
                }
                if (!empty($BBox) || !empty($wheres[$table])) {
                    //$from =dropLastChrs($from, 5);
                    //$from.=")";
                }
                if (!empty($limits[$table])) {
                    //$from .= " LIMIT " . $limits[$table];
                }
                doSelect($table, $sql, $sql2, $from);
            }
            break;
        default:
            break;
    }
}
Ejemplo n.º 4
0
}
echo "<div class='g'></div>\n";
echo divClass("prefconflict", "hotradiorelation");
doRadio('a', 'prefconflict', 'Assign conflicts when PC members have review preferences of &minus;100 or less');
echo "</div>\n";
echo divClass("lead", "hotradiorelation");
doRadio('a', 'lead', 'Assign discussion lead from reviewers, preferring&nbsp; ');
doSelect('leadscore', $scoreselector);
echo "</div>\n";
echo divClass("shepherd", "hotradiorelation");
doRadio('a', 'shepherd', 'Assign shepherd from reviewers, preferring&nbsp; ');
doSelect('shepherdscore', $scoreselector);
echo "</div>\n";
echo "<div class='g'></div>", divClass("clear", "hotradiorelation");
doRadio('a', 'clear', 'Clear all &nbsp;');
doSelect('cleartype', array(REVIEW_PRIMARY => "primary", REVIEW_SECONDARY => "secondary", REVIEW_PC => "optional", "conflict" => "conflict", "lead" => "discussion lead", "shepherd" => "shepherd"));
echo " &nbsp;assignments for selected papers and PC members";
echo "<div class='g'></div>", divClass("discorder", "hotradiorelation");
doRadio("a", "discorder", "Create discussion order in tag #");
echo Ht::entry("discordertag", get($Qreq, "discordertag", "discuss"), array("size" => 12, "onfocus" => 'autosub(false,this)')), ", grouping papers with similar PC conflicts</div>";
echo "</div>\n";
// PC
echo "<h3>PC members</h3><table><tr><td class=\"nw\">";
doRadio("pctyp", "all", "");
echo "</td><td>", Ht::label("Use entire PC", "pctyp_all"), "</td></tr>\n";
echo "<tr><td class=\"nw\">";
doRadio('pctyp', 'sel', '');
echo "</td><td>", Ht::label("Use selected PC members:", "pctyp_sel"), " &nbsp; (select ";
$pctyp_sel = array(array("all", 1, "all"), array("none", 0, "none"));
$pctags = pcTags();
if (count($pctags)) {