if ($requete["erreur"] == 0) {
        if (isOK($requete["id_insert"], 'id_hotel', $bdd) == false) {
            header('Location:ajouthotel.php?retour=ajoutbbsitting&id=' . $requete["id_insert"]);
            // afficheRetour($requete);
        } else {
            if (isOK($requete['id_insert'], 'id_famille', $bdd) == false) {
                header('Location:ajoutfamille.php?retour=ajoutbbsitting&id=' . $requete["id_insert"]);
                // afficheRetour($requete);
            }
        }
    } else {
        afficheRetour($requete);
    }
} else {
    if (isset($_GET["source"]) && $_GET["source"] == "ajouthotel" && isset($_GET["id"])) {
        if (isOK($_GET["id"], 'id_famille', $bdd) == false) {
            header('Location:ajoutfamille.php?retour=ajoutbbsitting&id=' . $_GET["id"]);
            // afficheRetour($requete);
        }
    } else {
        if (isset($_GET["source"]) && $_GET["source"] == "ajoutfamille" && isset($_GET["id"])) {
            header('Location:fichebbsitting.php?id=' . $_GET["id"]);
        }
    }
}
if (isset($_POST["validation"]) && $_POST["validation"] == "modification") {
    // print_r($_POST["francais"]); echo "  ";print_r($_POST["id_langue"]); die;
    $requete = modifBabysitting($_POST["idbbsitting"], $_POST["idfamille"], $_POST["nom_famille"], $_POST["nombre_enfants"], $_POST["idlangue1"], $_POST["pays"], $_POST["francais"], $bdd);
    header('Location:fichebbsitting.php?id=' . $requete["id_modif"]);
} else {
    $hotel_bdd = $bdd->query('select * from hotel');
Example #2
0
<?php

require '../inc/conf.php';
$rs = $db->select('SELECT id FROM map_activity WHERE map_id=' . $_POST['mapId'] . ' AND date=' . (time() - time() % 86400) . ' AND type="vote"');
if ($rs['total'] == 0) {
    $db->insert('INSERT INTO map_activity SET map_id=' . $_POST['mapId'] . ', date=' . (time() - time() % 86400) . ', total=1, type="vote"');
} else {
    $db->update('UPDATE map_activity SET total=total+1 WHERE id=' . $rs['result'][0]['id']);
}
if (!isOK($_SESSION['ratting'])) {
    $_SESSION['ratting'] = '';
}
$_SESSION['ratting'] .= '.' . $_POST['mapId'] . '-' . $_POST['n'];
$rs = $db->select('SELECT * FROM map_ratting WHERE map_id=' . $_POST['mapId']);
if ($rs['total'] == 0) {
    echo $_POST['s'];
    $db->insert('INSERT INTO map_ratting SET map_id=' . $_POST['mapId'] . ', point_' . $_POST['n'] . '=' . $_POST['s'] . ', hint_' . $_POST['n'] . '=1');
} else {
    $db->update('UPDATE map_ratting SET point_' . $_POST['n'] . '=point_' . $_POST['n'] . '+' . $_POST['s'] . ', hint_' . $_POST['n'] . '=hint_' . $_POST['n'] . '+1 WHERE map_id=' . $_POST['mapId']);
    echo round(($rs['result'][0]['point_' . $_POST['n']] + $_POST['s']) / ($rs['result'][0]['hint_' . $_POST['n']] + 1));
}
$avgHint = 0;
$avgPoint = 0;
for ($i = 0; $i < 5; $i++) {
    $avgHint += $rs['result'][0]['hint_' . $i];
    $avgPoint += $rs['result'][0]['point_' . $i];
}
$db->update('UPDATE map SET ratting = ' . ($avgHint == 0 ? 0 : $avgPoint / $avgHint) . ' WHERE id=' . $_POST['mapId']);
Example #3
0
if ($rs['total'] != 0) {
    if (!isOK($_GET['q']) && !isOK($_GET['game']) && !isOK($_GET['gametype'])) {
        $inPageTitle = 'Latest maps';
        $pageTitle = 'Map Factory - the game map database';
        $pageDescriptiom = 'Download custom Maps for your favorit FPS (First Person Shooters) games, and submit your own maps.';
    } else {
        $pageTitle = '';
        if (isOK($_GET['q'])) {
            $pageTitle .= 'Results for "' . utf8_encode(htmlspecialchars(rawurldecode(stripslashes($_GET['q'])))) . '"';
            $pageDescriptiom = 'Search results for ' . utf8_encode(htmlspecialchars(rawurldecode(stripslashes($_GET['q']))));
        } else {
            $pageDescriptiom = 'Download a large selection of the best';
        }
        if (isOK($_GET['game'])) {
            $rs = $db->select('SELECT name FROM game WHERE guid="' . $_GET['game'] . '"');
            $pageTitle .= (isOK($_GET['q']) ? ' in ' : '') . $rs['result'][0]['name'];
            $pageDescriptiom .= (isOK($_GET['q']) ? ' in ' : ' ') . $rs['result'][0]['name'];
            $pageKeyword = $rs['result'][0]['name'] . ', ' . $pageKeyword;
        }
        if (isOK($_GET['gametype'])) {
            $rs = $db->select('SELECT name FROM gametype WHERE guid="' . $_GET['gametype'] . '"');
            $pageTitle .= ' ' . $rs['result'][0]['name'];
            $pageDescriptiom .= ' ' . $rs['result'][0]['name'];
            $pageKeyword = $rs['result'][0]['name'] . ', ' . $pageKeyword;
        }
        $pageTitle .= ' maps';
        $pageDescriptiom .= ' maps';
        $inPageTitle = $pageTitle;
    }
}
$tpl->assignVar(array('page_title' => encodeCurly($inPageTitle), 'PAGE_TITLE' => encodeCurly($pageTitle), 'PAGE_DESCRIPTION' => encodeCurly($pageDescriptiom), 'PAGE_KEYWORDS' => encodeCurly($pageKeyword)));
Example #4
0
<?php

require_once '../inc/conf.php';
header('Content-Type: application/json; charset=utf-8');
header("Cache-Control: no-cache");
$rs = $db->select('SELECT ' . ($_POST['fullLoad'] ? '*' : 'id, ' . $_POST['previewField'] . ', status') . ' FROM ' . $_POST['type'] . (isOk($_POST['parent_id']) ? ' WHERE ' . $_POST['parent_type'] . '_id = ' . $_POST['parent_id'] : '') . ' ORDER BY ' . $_POST['orderBy'] . ' ' . $_POST['sortOrder'] . (isOK($_POST['limit']) ? ' LIMIT 0,' . $_POST['limit'] : ''));
echo json_encode($rs['result']);
/**
 * Unbinds a channel identifier from a database.
 * Makes two requests: first with 'com.metaio.junaio', second with 'com.metaio.junaio-ipad' as appIdentifier.
 * If first one has an error, second one is not made.
 * @param $email login email address at the license portal
 * @param $password password at the license portal
 * @param $dbName name of the new database
 * @param $channelID channel identifier
 * @return Zend_Http_Response HTTP response
 */
function deleteChannel($email, $password, $dbName, $channelID)
{
    $postResponse = doPost("deleteApplication.php", array('timeout' => SHORT_OPERATION_TIMEOUT), array('email' => $email, 'password' => md5($password), 'dbName' => $dbName, 'appIdentifier' => 'com.metaio.junaio', 'channelId' => $channelID));
    if (isOK($postResponse) && !isError($postResponse->getBody())) {
        $postResponse = doPost("deleteApplication.php", array('timeout' => SHORT_OPERATION_TIMEOUT), array('email' => $email, 'password' => md5($password), 'dbName' => $dbName, 'appIdentifier' => 'com.metaio.junaio-ipad', 'channelId' => $channelID));
    }
    return $postResponse;
}
Example #6
0
        FROM              map             AS m
        JOIN              game            AS g    ON m.game_id = g.id
        JOIN              gametype        AS t    ON m.gametype_id = t.id
        JOIN              author          AS a    ON m.author_id = a.id
        JOIN              map_file        AS f    ON m.id = f.parent_id
        LEFT OUTER JOIN   map_comment     AS c    ON c.map_id=m.id AND c.status=1

        WHERE     m.id = ' . $_GET['map'] . '
        AND       m.date < ' . time() . '
        AND       m.status = 1
        AND       g.status = 1
        AND       t.status = 1
        AND       a.status = 1

        GROUP BY m.id');
if (isOK($rs['result'][0]['id'])) {
    foreach ($rs['result'] as $item) {
        $tpl->assignVar(array('page_title' => $item['game'] . ' - ' . $item['title']));
        $tpl->assignVar(array('id' => $item['id'], 'title' => encodeCurly($item['title']), 'game' => encodeCurly($item['game']), 'gametype' => encodeCurly($item['gametype']), 'author' => encodeCurly($item['author']), 'author_id' => $item['author_id'], 'image' => $item['image'], 'description' => encodeCurly($item['description']), 'download' => $item['download'], 'download_s' => $item['download'] > 1 ? 's' : '', 'comment' => $item['comment'], 'map_guid' => $item['guid'], 'game_guid' => $item['game_guid'], 'gametype_guid' => $item['gametype_guid'], 'author_guid' => $item['author_guid']));
        if (!empty($item['description'])) {
            $tpl->assignSection('description');
        }
        $authorId = $item['author_id'];
        $gameId = $item['game_id'];
        $imageId = $item['image'];
        $fileId = $item['file_id'];
        $authorName = $item['author'];
        $gameName = $item['game'];
        $gametypeName = $item['gametype'];
        $mapTitle = $item['title'];
    }