Exemplo n.º 1
0
<?php

// Récupération des fonctions
require_once "config.php";
require_once "functions.php";
$annees = array_unique(get_all_items("Année"));
?>

<!DOCTYPE>
<html>
<head>
  <title>PHP - P20</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <style>.img-mov {height: 300px;} .col-md-3 {margin-bottom: 15px;}</style>
</head>
<body>
  <div class="col-md-12">
    <h1>Question 4</h1>
    <hr />
    <div class="container">
      <ul class="row">
        <?php 
foreach ($annees as $annee) {
    ?>
          <li class="col-md-12"><?php 
    echo $annee;
    ?>
</li>
        <?php 
}
Exemplo n.º 2
0
<?php

require_once "config.php";
require_once "functions.php";
$acteurs = array_linearize(get_all_items("Acteurs"));
echo $acteurs;
?>

<!DOCTYPE>
<html>
<head>
  <title>PHP - P20</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <style>.img-mov {height: 300px;} .col-md-3 {margin-bottom: 15px;}</style>
</head>
<body>
  <div class="col-md-12">
    <h1>Question 3</h1>
    <hr />
    <div class="container">
      <ul class="row">
        <?php 
foreach ($acteurs as $acteur) {
    ?>
          <li class="col-md-12"><?php 
    echo $acteur;
    ?>
</li>
        <?php 
}
function worldmap_items_dohook($hookname, $args)
{
    global $session, $itemprefs;
    switch ($hookname) {
        case "inventory":
            //debug($args);
            if ($args['context'] == "worldmap") {
                $inv = $args['inventory'];
                $sort = $args['sort'];
                foreach ($inv as $itemid => $prefs) {
                    //debug($prefs);
                    if ($prefs['dropworldmap']) {
                        //						debug("Found something!");
                        addnav("", "inventory.php?items_context=" . $args['context'] . "&items_mapdrop=" . $prefs['itemid'] . "&items_sort={$sort}");
                        $args['inventory'][$itemid]['inventoryactions'] .= "<a href=\"inventory.php?items_context=" . $args['context'] . "&items_mapdrop=" . $prefs['itemid'] . "&items_sort={$sort}\">Drop this item on the Map</a> | ";
                        if ($args['inventory'][$itemid]['quantity'] > 1 && !$prefs['dropworldmap_blockdropall']) {
                            addnav("", "inventory.php?items_context=" . $args['context'] . "&items_mapdrop=" . $prefs['itemid'] . "&items_sort={$sort}&dropall=true");
                            $args['inventory'][$itemid]['inventoryactions'] .= "<a href=\"inventory.php?items_context=" . $args['context'] . "&items_mapdrop=" . $prefs['itemid'] . "&items_sort={$sort}&dropall=true\">Drop all</a> | ";
                        }
                        $args['inventory'][$itemid]['cannotdiscard'] = true;
                    }
                }
            }
            break;
        case "inventory-predisplay":
            if ($args['context'] == "worldmap") {
                $drop = httpget("items_mapdrop");
                if ($drop) {
                    $loc = get_module_pref("worldXYZ", "worldmapen");
                    if (httpget("dropall")) {
                        $todrop = get_all_items($drop);
                        $dropids = array();
                        foreach ($todrop as $id => $vals) {
                            $dropids[] = $id;
                        }
                        change_item_owner($dropids, "worldmap_" . $loc);
                    } else {
                        change_item_owner($drop, "worldmap_" . $loc);
                    }
                }
            }
            break;
        case "worldnav":
            $ploc = implode(",", $args);
            $squarestuff = load_inventory("worldmap_" . $ploc, true);
            $itemid = httpget('item-pickup');
            if ($itemid) {
                //Pick up iitems
                if (httpget('pickupall')) {
                    //Pick up all iitems
                    $itemtype = $squarestuff[$itemid]['item'];
                    $pickup = array();
                    foreach ($squarestuff as $sqitemid => $sqprefs) {
                        //debug($sqprefs);
                        if ($sqprefs['item'] == $itemtype) {
                            $pickup[] = $sqitemid;
                        }
                    }
                    //debug($pickup);
                    change_item_owner($pickup, $session['user']['acctid']);
                    output("`0You pick up the %s.`n", $squarestuff[$itemid]['plural']);
                } else {
                    //Pick up single iitem
                    if ($squarestuff[$itemid]) {
                        output("`0You pick up the %s.`n", $squarestuff[$itemid]['verbosename']);
                        change_item_owner($itemid, $session['user']['acctid']);
                    } else {
                        output("`0You bend over to pick up the item, but it's suddenly not there anymore!  Some crafty bastard has pinched it from right under your nose!`n");
                    }
                }
                //reload this square's inventory
                $squarestuff = load_inventory("worldmap_" . $ploc, true);
            }
            $squarestuff = group_items($squarestuff);
            //debug($squarestuff);
            foreach ($squarestuff as $sortid => $prefs) {
                $itemid = $prefs['itemid'];
                $showmsg = true;
                if ($prefs['quantity'] > 1 && !$prefs['dropworldmap_blockdropall']) {
                    addnav("Pick up items");
                    addnav(array("Pick up %s", $prefs['verbosename']), "runmodule.php?module=worldmapen&op=continue&item-pickup=" . $itemid);
                    addnav(array("Pick up all %s", $prefs['plural']), "runmodule.php?module=worldmapen&op=continue&item-pickup=" . $itemid . "&pickupall=true");
                    output("`0There are %s %s here.`n`n", $prefs['quantity'], $prefs['plural']);
                } else {
                    addnav("Pick up items");
                    addnav(array("Pick up %s", $prefs['verbosename']), "runmodule.php?module=worldmapen&op=continue&item-pickup=" . $itemid);
                    output("`0There is a %s here.`n`n", $prefs['verbosename']);
                }
            }
            if ($showmsg && $session['user']['dragonkills'] < 1 && $session['user']['level'] < 10) {
                output("`JLogs and stone are only really useful if you're building a Dwelling.  To build a Dwelling, you'll need a Land Claim stake from Improbable Central, which will set you back 100 Cigarettes.  If you're not building a Dwelling, then there's not much reason to pick them up (logs and stone are really heavy!).  This message will disappear once you've got a few more levels under your belt.`0`n");
            }
            break;
    }
    return $args;
}
Exemplo n.º 4
0
<?php

// Récupération des fonctions
require_once "config.php";
require_once "functions.php";
$acteurs = array_unique(array_linearize(get_all_items("Acteur")));
?>

<!DOCTYPE>
<html>
<head>
  <title>PHP - P20</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <style>.img-mov {height: 300px;} .col-md-3 {margin-bottom: 15px;}</style>
</head>
<body>
  <div class="col-md-12">
    <h1>Question 5</h1>
    <hr />
    <div class="container">
      <ul class="row">
        <?php 
foreach ($acteurs as $acteur) {
    ?>
          <li class="col-md-12"><?php 
    echo $acteur;
    ?>
</li>
        <?php 
}
Exemplo n.º 5
0
<?php

require_once "config.php";
require_once "functions.php";
$durees = array_unique(get_all_items("Durée"));
echo $durees;
?>

<!DOCTYPE>
<html>
<head>
  <title>PHP - P20</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <style>.img-mov {height: 300px;} .col-md-3 {margin-bottom: 15px;}</style>
</head>
<body>
  <div class="col-md-12">
    <h1>Question 4</h1>
    <hr />
    <div class="container">
      <ul class="row">
        <?php 
foreach ($durees as $duree) {
    ?>
          <li class="col-md-12"><?php 
    echo $duree;
    ?>
</li>
        <?php 
}