コード例 #1
0
ファイル: Document.php プロジェクト: sapray/ampersand-models
}
$buttons = "";
if (isset($_REQUEST['new'])) {
    $new = true;
} else {
    $new = false;
}
if (isset($_REQUEST['edit']) || $new) {
    $edit = true;
} else {
    $edit = false;
}
$del = isset($_REQUEST['del']);
if (isset($_REQUEST['Document'])) {
    if (!$del || !delDocument($_REQUEST['Document'])) {
        $Document = readDocument($_REQUEST['Document']);
    } else {
        $Document = false;
    }
    // delete was a succes!
} else {
    if ($new) {
        $Document = new Document();
    } else {
        $Document = false;
    }
}
if ($Document) {
    writeHead("<TITLE>Document - VIRO - ADL Prototype</TITLE>" . ($edit ? '<SCRIPT type="text/javascript" src="edit.js"></SCRIPT>' : '<SCRIPT type="text/javascript" src="navigate.js"></SCRIPT>') . "\n");
    if ($edit) {
        echo '<FORM name="editForm" action="' . $_SERVER['PHP_SELF'] . '" method="POST" class="Edit">';
コード例 #2
0
ファイル: r.php プロジェクト: elyaagoubimhamed/THYP-1516
<?php

include_once 'connect.php';
switch ($_GET["table"]) {
    case "scores":
        readScore($_GET);
        break;
    case "personnes":
        readPersonne($_GET);
        break;
    case "documents":
        readDocument($_GET);
        break;
    default:
        break;
}
function readScore($data)
{
    global $conn;
    $sql = "SELECT * FROM scores";
    $result = $conn->query($sql);
    //echo $sql;
    $lists = array();
    if ($result->num_rows > 0) {
        // output data of each row
        while ($row = $result->fetch_assoc()) {
            $lists[] = $row;
        }
        echo json_encode($lists);
    } else {
        echo "0 results";
コード例 #3
0
ファイル: r.php プロジェクト: elyaagoubimhamed/THYP-1516
<?php

include_once 'connect.php';
switch ($_GET["table"]) {
    case "score":
        createScore($_GET);
        break;
    case "personne":
        readPersonne($_GET);
        break;
    case "personnes":
        readAllPersonne($_GET);
        break;
    case "document":
        readDocument();
        break;
    default:
        break;
}
function readDocument()
{
    global $DBH;
    $rows = array();
    try {
        $sth = $DBH->prepare("SELECT id_doc,nom,url,AsText(latlng) FROM documents");
        $sth->execute();
        while ($result = $sth->fetch(PDO::FETCH_ASSOC)) {
            preg_match('#\\((.*?)\\)#', $result['AsText(latlng)'], $match);
            $result['lat'] = substr($match[1], 0, strpos($match[1], ' '));
            $result['lng'] = substr($match[1], strpos($match[1], ' '));
            unset($result['AsText(latlng)']);