Example #1
0
<?php

include_once 'bdd.php';
$bdd = connexionbdd();
$stats = get_last();
$i = 0;
$data = [];
foreach ($stats as $key => $value) {
    //$data[$value['date']] = $value['places'];
    $data['date'][$i] = $value['date'];
    $data['places'][$i] = $value['places'];
    $data['velos'][$i] = $value['velos'];
    $i++;
}
echo json_encode($stats);
Example #2
0
         $sql = "INSERT INTO users_duty (workdate,user_id,backstamp,createstamp,updatestamp) VALUES ('" . date("Y-m-d") . "','" . $login_id . "','now','now','now')";
         $res = pg_query($conn, $sql);
     } else {
         if (get_first("users_duty", "backstamp", "workdate='" . date("Y-m-d") . "' AND user_id='" . $login_id . "'", 0) == 0) {
             $sql = "UPDATE users_duty SET backstamp='now',updatestamp='now' WHERE workdate='" . date("Y-m-d") . "' AND user_id='" . $login_id . "'";
             $res = pg_query($conn, $sql);
         }
     }
 }
 // 在席情報の更新
 // ※ ロギングしてるのでうまく使えば工程管理の実績収集なんかにつかえるかも
 if (!empty($_GET["location"]) || ($_GET["location"] == "1" || $_GET["location"] == "2")) {
     $sql = "DELETE FROM users_location WHERE updatestamp+'" . 24 * 60 . ":00'<now()";
     pg_query($conn, $sql);
     // 60日間以前のログを削除
     $lastseqno = get_last("users_location", "seqno", "user_id='" . $login_id . "'", 0);
     $seqno = $lastseqno + 1;
     $code = $_GET["location"];
     $text = get_first("locations", "name", "id=" . $code, "");
     if ($lastseqno > 0) {
         $lastcode = get_first("users_location", "code", "user_id='" . $login_id . "' AND seqno=" . $lastseqno, 0);
     } else {
         $lastcode = "";
     }
     if ($lastcode != $code) {
         $sql = "INSERT INTO users_location (seqno,user_id,code,text,updatestamp) VALUES (";
         $sql .= $seqno . ",";
         $sql .= "'" . $login_id . "',";
         $sql .= "'" . $code . "',";
         $sql .= "'" . db_textsafe($text) . "',";
         $sql .= "'now'";
Example #3
0
function html_home()
{
    global $repos, $repo_suffix;
    echo "<div class=\"git-home\">\n";
    echo "<table>\n<tr>";
    echo "<th>Project</th>";
    echo "<th>Description</th>";
    echo "<th>Owner</th>";
    echo "<th>Last Changed</th>";
    echo "<th>Download</th>";
    echo "<th>Hits</th>";
    echo "</tr>\n";
    foreach ($repos as $repo) {
        $today = 0;
        $total = 0;
        stat_get_count($repo, $today, $total);
        $desc = short_desc(file_get_contents($repo . $repo_suffix . "/description"));
        $owner = get_file_owner($repo);
        $last = get_last($repo);
        $proj = get_project_link($repo);
        $dlt = get_project_link($repo, "targz");
        $dlz = get_project_link($repo, "zip");
        echo "<tr><td>{$proj}</td><td>{$desc}</td><td>{$owner}</td><td>{$last}</td><td>{$dlt} | {$dlz}</td><td> ({$today} / {$total}) </td></tr>\n";
    }
    echo "</table>";
    echo "</div>\n";
}
function change_title_of_page($title)
{
    if (in_the_loop()) {
        global $wpdb;
        $job_id = get_last();
        if ($job_id != 0 || $job_id != '') {
            $entry = $wpdb->get_row("select * from " . $wpdb->prefix . HELIOS_TABLE . " WHERE id = '{$job_id}' and publishedStatus = 'Y'", OBJECT);
            //return ($entry->title!='')?$entry->title:$title;
            return $title;
        } else {
            return $title;
        }
    } else {
        return $title;
    }
}
Example #5
0
function html_home($repos)
{
    $str = '';
    $str .= "<table>\n";
    $str .= "<tr><th>Project</th><th>Description</th><th>Owner</th><th>Last Changed</th><th>Download</th></tr>\n";
    foreach ($repos as $repo) {
        $desc = short_desc(file_get_contents("{$repo}/description"));
        $owner = get_file_owner($repo);
        $last = get_last($repo);
        $proj = get_project_link($repo);
        $dlt = get_project_link($repo, "targz");
        $dlz = get_project_link($repo, "zip");
        $str .= "<tr><td>{$proj}</td><td>{$desc}</td><td>{$owner}</td><td>{$last}</td><td>{$dlt} | {$dlz}</td></tr>\n";
    }
    $str .= "</table>";
    return $str;
}
Example #6
0
                 $quote->hidden = false;
         }
     }
     $key = check_key();
     /* $quote->status = ($key != 0) ? 'approved' : 'pending'; */
     $quote->status = 'pending';
     $quote->ip = isset($_POST['ip']) && $key !== null ? $_POST['ip'] : $session->ip;
     $quote->api = $key;
     if ($quote->save() === false) {
         out(array('results' => array('success' => 0, 'error' => 'invalid_quote')));
     }
     $last = get_last();
     out(array('results' => array('success' => 1, 'url' => sprintf('%s%s', $settings->full_url, $last), 'permaid' => $last)));
     break;
 case 'last':
     $last = get_last();
     out(array('results' => array('url' => sprintf('%s%s', $settings->full_url, $last), 'permaid' => $last)));
     break;
 case 'read':
     required_post(array('permaid'));
     $quote = new Quote();
     $quote->permaid = $_POST['permaid'];
     $key = check_key();
     if (!$quote->read() || $key === null && $quote->status != 'approved') {
         out(array('results' => array('success' => 0, 'error' => 'no_such_quote')));
     }
     $quote = sanitize($quote);
     out(array('results' => array('success' => 1, 'data' => $quote)));
     break;
 case 'search':
     required_post(array('criteria'));