예제 #1
0
파일: data.php 프로젝트: Cassioblu55/linger
<?php

include_once '../../config/config.php';
include_once $serverPath . 'utils/db_get.php';
$table = 'events';
if (!empty($_GET['get'])) {
    $get = $_GET['get'];
    if ($get == 'grid') {
        echo json_encode(getAllData($table));
    }
}
if (!empty($_GET['id'])) {
    $id = $_GET['id'];
    echo json_encode(findById($table, $id));
}
예제 #2
0
                $aData['contestants'] = array();
                foreach ($Group as $Cont) {
                    $aData['contestants'][] = (object) array('lastName' => $Cont->lastName, 'firstName' => $Cont->firstName, 'rank' => $Cont->rank, 'score' => $Cont->score, 'category' => $levelStr[$Cont->level]);
                }
                tpl("templateLetter.html", $aData, true);
            }
            $i++;
        }
        tpl("templateFooter.html", array(), true);
        self::write();
    }
    public static function addCsvRow($School, $nbAwards)
    {
        $aData = array();
        foreach (array('name', 'address', 'zipcode', 'city', 'country', 'firstName', 'lastName') as $field) {
            $aData[] = $School->{$field};
        }
        $aData[] = $nbAwards;
        fputcsv(self::$csvFile, $aData, ";");
    }
}
//updateNbAwarded(2014);
$aSchools = getAllData();
Generation::makeAll($aSchools);
/*
UPDATE `school` LEFT JOIN school_user ON (school.ID = school_user.schoolID AND school.userID = school_user.userID) SET school.userID = NULL WHERE school_user.ID IS NULL
SELECT school.* FROM school JOIN school_user ON school.ID = school_user.schoolID WHERE school.userID = 0 ORDER BY school.ID
// Mise à jour du champ school_user.ownGroupsContestants
UPDATE `school_user` JOIN SELECT SUM(`nbStudentsEffective`) as `nbContestants`, `schoolID`, `userID` FROM `group` WHERE `participationType` = 'Official' GROUP BY `schoolID`, `userID`) as `groups` ON (school_user.schoolID = `groupS`.`schoolID` AND school_user.userID = `groupS`.`userID`) SET school_user.ownGroupsContestants = `nbContestants`;
UPDATE school JOIN (SELECT schoolID, MAX(ownGroupsContestants) as maxStudents FROM school_user GROUP BY schoolID) as bestSchoolUser ON (bestSchoolUser.schoolID = school.ID) JOIN school_user ON (school.ID = school_user.schoolID AND school_user.ownGroupsContestants = bestSchoolUser.maxStudents) SET school.userID = school_user.userID WHERE school.userID = 0
*/
if (isset($_GET["delete"])) {
    $Table->deleteContestData($_GET["delete"]);
}
//kasutaja muudab andmeid
if (isset($_GET["update"])) {
    $Table->updateContestData($_GET["contest_id"], $_GET["contest_name"], $_GET["name"]);
}
$contest_array = getAllData();
$keyword = "";
if (isset($_GET["keyword"])) {
    $keyword = $_GET["keyword"];
    //otsime
    $contest_array = getAllData($keyword);
} else {
    //näitame kõik tulemused
    $contest_array = getAllData();
}
if (isset($_GET["confirm"])) {
    header("Location: confirm.php");
}
?>

<?php 
// lehe nimi
$page_title = "Osalejad";
?>

<?php 
require_once "../header.php";
?>
예제 #4
0
            $comment = "";
            echo $message;
        }
    }
}
// kuulan, kas kasutaja tahab vastata
if (isset($_GET["yes"])) {
    ///saadan kustutatava auto id
    yesAnswer($_GET["yes"]);
}
if (isset($_GET["no"])) {
    ///saadan kustutatava auto id
    noAnswer($_GET["no"]);
}
// kõik autod objektide kujul massiivis
$poll_array = getAllData();
?>
<p>
	Tere, <?php 
echo $_SESSION["logged_in_user_email"];
?>
 
		Tere, <?php 
echo $_SESSION["logged_in_user_id"];
?>
 
	<a href="login.php"> Logi välja <a> 
</p>

<h1>Nendele küsimustele saab vastata</h1>
<table border=1>
예제 #5
0
<?php

$section = null;
$pageTitle = "Pagination";
include "inc/functions.php";
include "inc/variables.php";
$division = $_SESSION['division'];
$report = $_SESSION['report'];
if ($report == 'Possible Duplicates') {
    $data = getPossibleDupsData($division, 'rows');
} else {
    if ($report == 'All Data') {
        $data = getAllData($division, 'rows');
    } else {
        $data = getSummedChecksData($division, 'rows');
    }
}
if (isset($_POST["ExportType"])) {
    switch ($_POST["ExportType"]) {
        case "export-to-excel":
            // Submission from
            $filename = "possibleDuplicates_{$division}.{$fileDate}.xls";
            header("Content-Type: application/vnd.ms-excel");
            header("Content-Disposition: attachment; filename=\"{$filename}\"");
            ExportFile($data);
            //$_POST["ExportType"] = '';
            exit;
        case "export-to-csv":
            // Submission from
            $filename = "possibleDuplicates_{$division}.{$fileDate}.csv";
            header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
예제 #6
0
파일: data.php 프로젝트: Cassioblu55/linger
<?php

include_once '../../config/config.php';
include_once $serverPath . 'utils/db_get.php';
$table = "drinks";
mysqli_set_charset(connect(), "utf8");
if (!empty($_GET['get'])) {
    $get = $_GET['get'];
    if ($get == "grid") {
        $data = getAllData($table);
        echo json_encode($data, true);
    } elseif ($get == "drink_types") {
        $queryStatement = "SELECT DISTINCT(type) FROM {$table};";
        $data = runQuery($queryStatement);
        $array = [];
        foreach ($data as $row) {
            array_push($array, $row['type']);
        }
        echo json_encode($array);
    }
}
if (!empty($_GET['id'])) {
    $id = $_GET['id'];
    echo json_encode(findById($table, $id));
}
예제 #7
0
    updateMedicalItem($_GET["update_id"], $_GET["update_cat"], $_GET["update_diagnose"], $_GET["update_comment"]);
    print_r("222");
}
//sesiooni muutujad
$role_id_for_data = $_SESSION["logged_in_user_role"];
$user_id_for_data = $_SESSION["logged_in_user_id"];
//aadressireal on otsingu keyword
if (isset($_GET["keyword"])) {
    //otsin
    $keyword = $_GET["keyword"];
    $med_array = getAllData($user_id_for_data, $role_id_for_data, $keyword);
} else {
    $keyword = "";
    // küsin kõik andmed
    //käivitan funktsiooni
    $med_array = getAllData($user_id_for_data, $role_id_for_data, $keyword);
}
?>

<h1>Sinu andmed</h1>

<H2> Lisa uus kirje</h2>

<form action="<?php 
echo htmlspecialchars($_SERVER["PHP_SELF"]);
?>
" method="post" >
	<label for="number_plate" >Kategooria</label>
	<input id="category" name="category" type="text" value="<?php 
echo $category;
?>
예제 #8
0
<?php

require_once "functions.php";
if (isset($_GET["delete"])) {
    deleteMainData($_GET["delete"]);
}
if (isset($_GET["update"])) {
    updateMainData($_GET["id"], $_GET["toode"], $_GET["ostuhind"], $_GET["myygihind"]);
}
$keyword = "";
if (isset($_GET["keyword"])) {
    $keyword = $_GET["keyword"];
    // otsime
    $main_array = getAllData($keyword);
} else {
    $main_array = getAllData();
}
?>

Tere, <?php 
echo $_SESSION['email'];
?>

<h1>Tabel</h1>

<form action="main.php" method="get">
    <input name="keyword" type="search" value="<?php 
echo $keyword;
?>
" >
    <input type="submit" value="otsi">
예제 #9
0
if(isset($_GET["delete"])) {
		deleteComment($_GET["delete"]);
	}

if(isset($_GET["accept"])) {
		acceptComment($_GET["accept"]);
	}

$keyword = "";
	if(isset($_GET["keyword"])){
		$keyword = $_GET["keyword"];

		$procomments_array = getAllData($keyword);

	}else{
		$procomments_array = getAllData();
	}
?>
<h1>Kommentaarid</h1>
	<form action="moderate.php" method="get">
		<div class="col-sm-6">
			<input class="form-control" name="keyword" type="search" value="<?=$keyword?>">
		</div>
		<div class="col-sm-1">
			<input class="btn btn-default" type="submit" value="otsi">
		</div>
	<form>
	<br><br>
	<table class="table table-striped table-hover">
	<tr>
	<th>Kommentaari id</th>
예제 #10
0
<?php 
require_once "functions.php";
if (!isset($_SESSION['logged_in_user_id'])) {
    header("Location: login.php");
}
if (isset($_GET["logout"])) {
    session_destroy();
    header("Location: login.php");
}
$bird_array = getAllData();
?>
<h1>Linnuvaatluse tabel</h1>
<table border=1>
<tr>
	
	<th>Kasutaja ID</th>
	<th>Linnuliik</th>
	<th>Vaatlusaeg</th>
	<th>Lindude arv</th>
	
</tr>
<?php 
for ($i = 0; $i < count($bird_array); $i++) {
    if (isset($_GET["edit"]) && $_GET["edit"] == $bird_array[$i]->id) {
        echo "<tr>";
        echo "<form action='table.php' method='get'>";
        echo "<input type='hidden' name='bird_id' value='" . $bird_array[$i]->id . "'>";
        echo "<td>" . $bird_array[$i]->user_id . "</td>";
        echo "<td><input name='bird_name' value='" . $bird_array[$i]->bird_name . "'></td>";
        echo "<td><input name='observed' value='" . $bird_array[$i]->observed . "'></td>";
예제 #11
0
// read params from GET and package it as an array
function getQueryObject($param)
{
    $qryObj = json_decode(stripslashes($param), true);
    $qryObj2 = array("user" => "yinxj", "product" => "armani", "type_obj" => array("searchtb037_ds" => array("search.process.time", "cluster.time", "search.state", "search.process.state", "cluster.status")), "from_ts" => "1357706040", "end_ts" => "1357709640");
    return $qryObj;
}
$qryObj = getQueryObject($_GET["param"]);
#var_dump($qryObj);
//get detail query info
$user = $qryObj["user"];
$product = $qryObj["product"];
$typeobj = $qryObj["type_obj"];
$begin_ts = $qryObj["from_ts"];
$end_ts = $qryObj["end_ts"];
$results = getAllData($user, $product, $typeobj, $begin_ts, $end_ts);
// get results from mysql and unpack it as a string
echo json_encode($results);
#system("echo ".json_encode($results).">> 1");
mysql_close($db);
// ============ Function Area =================
function startsWith($haystack, $needle)
{
    return !strncmp($haystack, $needle, strlen($needle));
}
function endsWith($haystack, $needle)
{
    $length = strlen($needle);
    if ($length == 0) {
        return true;
    }
예제 #12
0
require_once "functions.php";
require_once "edit_functions.php";
if (isset($_GET["delete"])) {
    deleteHomeworkData($_GET["delete"]);
}
if (isset($_GET["update"])) {
    updateHomeworkData($_GET["homework_id"], $_GET["homework"], $_GET["date"]);
}
$keyword = "";
if (isset($_GET["keyword"])) {
    $keyword = $_GET["keyword"];
    // otsime
    $homework_array = getAllData($keyword);
} else {
    $homework_array = getAllData();
}
if (isset($_GET["logout"])) {
    //kustutame sessiooni muutujad
    session_destroy();
    header("Location: login.php");
}
?>

Tere, <?php 
echo $_SESSION['email'];
?>

<h1>Tabel</h1>

<form action="table.php" method="get">
예제 #13
0
<?php

require_once "functions.php";
if (!isset($_SESSION["logged_in_user_id"])) {
    header("Location: login.php");
}
if (isset($_GET["logout"])) {
    session_destroy();
    header("Location: login.php");
}
$keyword = "";
if (isset($_GET["keyword"])) {
    $keyword = $_GET["keyword"];
    $orders_array = getAllData($keyword);
} else {
    $orders_array = getAllData();
}
if (isset($_GET["update"])) {
    updateOrdersData(cleanInput($_GET["orders_id"]), cleanInput($_GET["text_type"]), cleanInput($_GET["subject"]), cleanInput($_GET["target_group"]), cleanInput($_GET["description"]), cleanInput($_GET["source"]), cleanInput($_GET["length"]), cleanInput($_GET["deadline"]), cleanInput($_GET["output"]));
}
if (isset($_GET["delete"])) {
    deleteOrdersData($_GET["delete"]);
}
function cleanInput($data)
{
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
}
?>
예제 #14
0
if (!isset($_SESSION['logged_in_user_id'])) {
    header("Location: login.php");
}
if (isset($_GET["delete"])) {
    deleteTodoData($_GET["delete"]);
}
if (isset($_GET["update"])) {
    updateTodoData($_GET["todo_id"], $_GET["todo"], $_GET["date"]);
}
$keyword = "";
if (isset($_GET["keyword"])) {
    $keyword = $_GET["keyword"];
    // otsime
    $todo_array = getAllData($keyword);
} else {
    $todo_array = getAllData($keyword);
}
if (isset($_GET["logout"])) {
    //kustutame sessiooni muutujad
    session_destroy();
    header("Location: login.php");
}
$todo = $date = '';
$todo_error = $date_error = '';
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (isset($_POST["add_todo"])) {
        if (empty($_POST["todo"])) {
            $todo_error = "Ei saa mitte midagi lisada.";
        } else {
            $todo = cleanInput($_POST["todo"]);
        }
예제 #15
0
    session_destroy();
    header("Location: login.php");
}
if (isset($_GET["delete"])) {
    deleteHabitat($_GET["delete"]);
}
if (isset($_GET["update"])) {
    updateHabitat($_GET["habitat_id"], $_GET["gps_point"], $_GET["location"], $_GET["habitat_name"], $_GET["habitat_code"]);
}
$habitat_array = getAllData();
$keyword = "";
if (isset($_GET["keyword"])) {
    $keyword = $_GET["keyword"];
    $habitat_array = getAllData($keyword);
} else {
    $habitat_array = getAllData();
}
?>

<h1>Elupaikade tabel</h1>

<a href="data.php">Sisesta uus elupaik</a><br>

<br><a href="?logout=1">Logi välja!</a><br>

<br><form action="table.php" method="get">
	<input name="keyword" type="search" value="<?php 
echo $keyword;
?>
">
	<input type="submit" value="otsi">
예제 #16
0
$text = "";
$title_error = "";
$text_error = "";
if (isset($_GET["title"])) {
    if (empty($_GET["title"])) {
        $title_error = "See väli on kohustuslik!";
    } else {
        $title = cleanInput($_GET["title"]);
    }
    if (empty($_GET["text"])) {
        $text_error = "See väli on kohustuslik!";
    } else {
        $text = cleanInput($_GET["text"]);
    }
}
$note_array = getAllData();
?>

Tere, <?php 
echo $_SESSION['logged_in_user_username'];
?>
 <a href="?logout=1">Logi välja</a><br><br>
Sellel lehel saad hoida enda memosi/kirjutisi.<br>
NB! Tekst saab olla kuni 255 tähte pikk!<br><br>
<html>
<form action="<?php 
echo htmlspecialchars($_SERVER["PHP_SELF"]);
?>
" method='get'>
<textarea cols="50" rows="1" id="title" name="title" type="title" placeholder="Title..." value="<?php 
echo $title;
예제 #17
0
<?php 
require_once "functions.php";
// kuulan, kas kasutaja tahab kustutada
// ?delete=... on aadressireal
if (isset($_GET["delete"])) {
    ///saadan kustutatava auto id
    deleteGlassData($_GET["delete"]);
}
//Kasutaja muudab andmeid
if (isset($_GET["update"])) {
    //auto id, auto number, auto värv
    updateGlassData($_GET["evo_glass_id"], $_GET["prillivarv"], $_GET["materjal"]);
}
// kõik autod objektide kujul massiivis
$evo_glass_array = getAllData();
$page_title = "Prillid";
$page_file_name = "table.php";
?>

<?php 
require_once "header.php";
?>

<h1>Tabel</h1>
<table border=1>
<tr>
    <th>id</th>
    <th>kasutaja id</th>
    <th>Prillivärv</th>
    <th>Materjal</th>
    <th>Kustuta</th>
예제 #18
0
<?php

require_once "../functions.php";
$tex_array = getAllData();
if (isset($_GET["delete"])) {
    deleteQweetData($_GET["delete"], $_GET["user"]);
}
if (isset($_GET["update"])) {
    updateQweetData($_GET["qwert"], $_GET["qwert_id"], $_GET["user_id"]);
}
$keyword = "";
if (isset($_GET["keyword"])) {
    $keyword = $_GET["keyword"];
    $tex_array = getAllData($keyword);
} else {
    $tex_array = getAllData();
}
if (isset($_GET["logout"])) {
    //kustutame sessiooni muutujad
    session_destroy();
    header("Location: sisu.php");
}
if (isset($_SESSION['logged_in_user_id'])) {
    echo "Tere, ", $_SESSION['logged_in_user_email'], "<a href='?logout=1'> Logi välja</a>";
}
$page_title = "Qweedid";
$page_file_name = "tabel.php";
require_once "../header.php";
?>

예제 #19
0
파일: data.php 프로젝트: aantsman/5_tund
        $color_error = "Värv on kohustuslik";
    } else {
        $color = cleanInput($_POST["color"]);
    }
    if ($car_plate_error == "" && $color_error == "") {
        createCarPlate($car_plate, color);
    }
}
function cleanInput($data)
{
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
}
getAllData();
?>

Tere, <?php 
echo $_SESSION['logged_in_user_email'];
?>
 <a href="?logout=1">Logi välja</a>

<h2> Lisa uus </h2>
<form>
  <form action="<?php 
echo htmlspecialchars($_SERVER["PHP_SELF"]);
?>
" method="post" >
  <label for="car_plate"> Auto numbrimärk </label>
  	<input id="car_plate" type="text" value="<?php 
예제 #20
0
파일: table.php 프로젝트: raikolepik/tund_7
    deleteCarData($_GET["delete"]);
}
//Kasutaja muudab andmeid
if (isset($_GET["update"])) {
    //auto id, auto number, auto värv
    updateCarData($_GET["car_id"], $_GET["number_plate"], $_GET["color"]);
}
$keyword = "";
if (isset($_GET["keyword"])) {
    $keyword = $_GET["keyword"];
    // otsime
    $car_array = getAllData($keyword);
} else {
    // näitame kõiki tulemusi
    // kõik autod objektide kujul massiivis
    $car_array = getAllData();
}
?>

<h1>Tabel</h1>

<form action="table.php" method="get">
    <input name="keyword" type="search" value="<?php 
echo $keyword;
?>
" >
    <input type="submit" value="otsi">
<form>
<br><br>
<table border=1>
<tr>
예제 #21
0
        }
        if (isset($_GET["update"])) {
            updateJobData($_GET["job_id"], $_GET["job_name"], $_GET["job_desc"], $_GET["job_company"], $_GET["job_county"], $_GET["job_parish"], $_GET["job_location"], $_GET["job_address"]);
        }
    }
}
//kõik tööd objektide kujul massiivis
$job_array = getAllData();
$keyword = "";
if (isset($_GET["keyword"])) {
    $keyword = $_GET["keyword"];
    //otsime
    $job_array = getAllData($keyword);
} else {
    //Naitame koiki tulemus
    $job_array = getAllData();
}
?>
<h1>Tööpakkumised</h1>
<form action="jobs.php" method="get">
	<input name="keyword" type="search" value="<?php 
echo $keyword;
?>
">
	<input type="submit" value="otsi">
</form>
<table border=1>
	<tr>
	<th>Amet</th>
	<th>Kirjeldus</th>
	<th>Asutus</th>
예제 #22
0
require_once "edit_functions.php";
if (!isset($_SESSION["logged_in_user_id"])) {
    header("Location: login.php");
}
// kas kustutame
// ?delete=vastav id mida kustutada on aadressireal
if (isset($_GET["delete"])) {
    echo "Kustutame id " . $_GET["delete"];
    //käivitan funktsiooni, saadan kaasa id!
    deleteAnimal($_GET["delete"]);
}
//salvestan andmebaasi uuendused
if (isset($_POST["save"])) {
    updateAnimal($_POST["id"], $_POST["animal"], $_POST["animal_name"]);
}
$array_of_animals = getAllData();
//käivitan funktsiooni
//$array_of_animals = getEditData($edit_id);
//trükin välja esimese looma
//echo $array_of_animals[0]->id." ".$array_of_animals[0]->animal;
?>

<h2>Tabel</h2>
<table border=1 >
	<tr>
		<th>id</th>
		<th>kasutaja id</th>
		<th>Looma liik</th>
		<th>Looma nimi</th>
		<th>X</th>
		<th>edit</th>
예제 #23
0
<?php

include_once '../../config/config.php';
include_once $serverPath . 'utils/db/db_get.php';
$table = "dungeon";
$traps_table = "traps";
if (!empty($_GET['id'])) {
    echo json_encode(findById($table, $_GET['id']));
} else {
    if (!empty($_GET['column'])) {
        $column = $_GET['column'];
        if ($column == "index") {
            $columns = ['name', 'purpose', 'location', 'creator'];
            print json_encode(getSpecificData($table, $columns));
        } else {
            if ($column == "traps") {
                print json_encode(getAllData($traps_table));
            }
        }
    }
}
예제 #24
0
    deleteboot($_GET["delete"]);
}
//salvestan andmebaasi uuendused
if (isset($_POST["save"])) {
    updateboot($_POST["id"], $_POST["boot_brand"], $_POST["model"]);
}
$keyword = "";
//aadressireal on keyword
if (isset($_GET["keyword"])) {
    //otsin
    $keyword = $_GET["keyword"];
    $array_of_boots = getAllData($keyword);
} else {
    // küsin kõik andmed
    //käivitan funktsiooni
    $array_of_boots = getAllData();
}
//trükin välja esimese auto
//echo $array_of_cars[0]->id." ".$array_of_cars[0]->plate;
?>

<h2>Tabel</h2>
<table border=1 >
	<tr>
		<th>Id</th>
		<th>User id</th>
		<th>Boot brand</th>
		<th>Model</th>
		<th>X</th>
		<th>Edit</th>
	</tr>