Exemplo n.º 1
0
$localUserId = "";
$objUser = new User($dbusercat);
if (!isset($action)) {
    $PHPSESSID = $sessionId = session_id();
    $INDICE = $_GET['SCENEID'];
    #
    # Insert SESSION ID, SCENEID into Table Cart
    #
    $sqlaux = "SELECT * FROM Cart WHERE Cart.sesskey='{$PHPSESSID}' AND SceneId = '{$INDICE}'";
    if (!$dbcat->query($sqlaux)) {
        $dbcat->error($sqlaux);
    }
    $nscenes = $dbcat->numRows();
    if ($nscenes == 0) {
        $objCart = new Cart($dbcat);
        $objCart->fill($PHPSESSID, $INDICE, $PRODUTO);
        $objCart->insert();
    }
    #
}
if ($action == $strDelete) {
    $objCart = new Cart($dbcat);
    $objCart->removeId($ID);
}
// Searching for cart
$sql = "SELECT * FROM Cart WHERE Cart.sesskey='{$PHPSESSID}'";
$dbcat->query($sql) or $dbcat->error($sql);
$itens = $dbcat->numRows();
if ($itens == 0) {
    echo "<h2>Empty Cart</h2>\n";
    $strWarning = '<h2>To download images, you must either 
Exemplo n.º 2
0
// Inicializando campos
if (!isset($submitted)) {
    $shift = 0;
    $longO = $latO = 0;
    $stdLat1 = $stdLat2 = 0;
}
// Monta nome das matrizes
$corLevel = "matCorLevel" . $sat;
$resampling = "matRes" . $sat;
$format = "matFormat" . $sat;
// Monta as matrizes
echo " sat = " . $sat . " scene = " . $scene;
if ($submitted and isset($action)) {
    $submitted = 0;
    $objCart = new Cart($dbcat);
    $objCart->fill($PHPSESSID, $scene, '', '', $shift, $pcorLevel, $orientation, $res, $datum, $proj, $longO, $latO, $stdLat1, $stdLat2, $form, $inter, $media);
    $objCart->insert();
    ?>
<!-- Inicializa as funções JavaScript -->
<script type="text/javascript">
window.close();
</script>
<?php 
}
?>
</head>
<body>
<div><center class = azul>
<form name="productForm" method="POST" action="prodForm.php">
<table width="90%" border="0" cellspacing="1">
<th colspan="2"><?php 
    if (!$_SESSION['openArea']) {
        $dontshow = 1;
    }
}
#
//echo "<br> dontshow = $dontshow  usertype = $usertype Oktopurchase = $OK_to_purchase OpenArea = " . $_SESSION['openArea'] . "<br>";
if ($action == 1) {
    $sqlaux = "SELECT * FROM Cart WHERE Cart.sesskey='{$PHPSESSID}' AND SceneId = '{$SCENEID}'";
    if (!$dbcat->query($sqlaux)) {
        $dbcat->error($sqlaux);
    }
    $num_scenes = $dbcat->numRows();
    if ($num_scenes == 0) {
        $PRODUTO = "";
        $objCart = new Cart($dbcat);
        $objCart->fill($PHPSESSID, $SCENEID, $PRODUTO);
        $objCart->insert();
    }
}
// tables involved
switch ($satellite) {
    case "CB2":
        $tabprefix = "Cbers";
        $satname = "CBERS";
        $satnumber = substr($satellite, 2, 1);
        break;
    case "CB2B":
        $tabprefix = "Cbers";
        $satname = "CBERS";
        $satnumber = substr($satellite, 2, 2);
        break;
Exemplo n.º 4
0
    $var = "action" . $i;
    $var1 = "prodId" . $i;
    if (isset(${$var})) {
        $prodId = ${$var1};
        break;
    }
}
if ($action == $strCart or $prodId) {
    $sqlaux = "SELECT * FROM Cart WHERE Cart.sesskey='{$PHPSESSID}' AND SceneId = '{$SceneId}'";
    if (!$dbcat->query($sqlaux)) {
        $dbcat->error($sqlaux);
    }
    $nscenes = $dbcat->numRows();
    if ($nscenes == 0) {
        $objCart = new Cart($dbcat);
        $objCart->fill($PHPSESSID, $SceneId, $prodId);
        $objCart->insert();
    }
}
if ($ScrollAction != "") {
    if ($ScrollAction == " < ") {
        $pagina = $pagina - 1;
    } else {
        $pagina = $pagina + 1;
    }
}
// --- if ($GLOBALS["stationDebug"]) echo "<br> sql = $sql <br>\n";
if (!$dbcat->query($sql)) {
    die($dbcat->errorMessage());
}
$paginas = $dbcat->numRows();