示例#1
0
            $password = $_POST["password"];
        }
        $age = (int) $_POST["age"];
        $rights = (int) $_POST["rights"];
        $id = (int) $_GET["id"];
        $req = $bdd->prepare("UPDATE users SET password = :password, firstname = :firstName, lastname = :lastName, login = :login, email = :email, avatar = :avatar, adress = :adress, age = :age, phone = :phone, rights = :rights WHERE id = :id");
        $req->bindParam(":password", $password);
        $req->bindParam(":firstName", $_POST["firstName"]);
        $req->bindParam(":lastName", $_POST["lastName"]);
        $req->bindParam(":login", $_POST["login"]);
        $req->bindParam(":email", $_POST["email"]);
        $req->bindParam(":avatar", $_POST["avatar"]);
        $req->bindParam(":adress", $_POST["adress"]);
        $req->bindParam(":age", $age, PDO::PARAM_INT);
        $req->bindParam(":phone", $_POST["phone"]);
        $req->bindParam(":rights", $rights, PDO::PARAM_INT);
        $req->bindParam(":id", $id, PDO::PARAM_INT);
        $req->execute();
        showInputs($bdd);
        echo "Vos modifications ont bien été modifiées.";
    } else {
        ?>
    		<a title="Supprimer cet utilisateur" href="allUsers.php?delete=<?php 
        echo $_GET['id'];
        ?>
">Supprimer l'utilisateur</a>
    		<?php 
        showInputs($bdd);
    }
}
include "footer.php";
示例#2
0
function showMainboard($b, $name, $p, $processorName)
{
    global $dbconn;
    // already connected through showMotherboard0()
    echo "<center>";
    echo "<h1>{$name}</h1>\n";
    // Get the chips on the board
    $sql = "SELECT chip1, chip2, chip3 FROM boards WHERE no = {$b}";
    $result = mysql_query($sql, $dbconn);
    if (!($row = mysql_fetch_row($result))) {
        // Should not happen
        echo "Board number not found!";
        mysql_free_result($result);
        return;
    }
    $cChips = 0;
    for ($i = 0; $i < 3; $i++) {
        if ($row[$i]) {
            $chips[$cChips++] = $row[$i];
        }
    }
    mysql_free_result($result);
    if (!$cChips) {
        // Should not happen
        echo "Error in board definition!";
        return;
    }
    echo "<h2>{$processorName}</h2>\n";
    echo "<table border=\"1\"><tr>";
    echo "<td bgcolor=\"#00ff00\">lime = specific for board and processor</td>";
    echo "<td bgcolor=\"#00ffff\">aqua = specific for board</td>";
    echo "<td bgcolor=\"#ffff00\">yellow = specific for processor</td>";
    echo "<td>white = chip defaults</td>";
    echo "</tr></table>\n";
    $conf = '';
    for ($i = 0; $i < $cChips; $i++) {
        $sql = "SELECT name FROM chips WHERE no = " . $chips[$i];
        $result = mysql_query($sql, $dbconn);
        if (!($row = mysql_fetch_row($result))) {
            // Should not happen
            echo "No chip name found for chip number {$chips[$i]}!";
            mysql_free_result($result);
            return;
        }
        echo "<h3>Chip " . $row[0] . "</h3>\n";
        $conf = $conf . "\nchip \"" . $row[0] . "\"\n";
        mysql_free_result($result);
        $conf = $conf . "\n# inputs\n\n";
        showInputs($b, $chips[$i], $p, $conf);
        $conf = $conf . "\n# fans\n\n";
        showFans($b, $chips[$i], $p, $conf);
        $conf = $conf . "\n# temps\n\n";
        showTemps($b, $chips[$i], $p, $conf);
    }
    echo "</center>\n";
    echo "<pre>\n";
    echo "#------------------------------------------------\n";
    echo "# Sensors configuration file used by 'libsensors'\n";
    echo "#------------------------------------------------\n";
    echo "# Mainboard: {$name}\n";
    echo "# Processor: {$processorName}\n";
    echo "#------------------------------------------------\n";
    echo $conf;
    echo "#------------------------------------------------\n\n";
    echo "</pre>\n";
}