}
?>
<p>
<a href="?logout=1"> Logi välja <a> 
</p>
 <?php 
require_once "functions.php";
// kas kustutame
if (isset($_GET["delete"])) {
    //echo "Kustutame id ".$_GET["delete"];
    //käivitan funktsiooni, saadan kaasa id!
    delete_entry($_GET["delete"]);
}
//salvestan andmebaasi uuendused
if (isset($_POST["save"])) {
    update_entry($_POST["id"], $input['name'], $input['voit'], $input['kaotus'], $input['vslamm'], $input['ssamm'], $input['ristit']);
}
$keyword = "";
$id = "";
$time = "";
$times = date("Y-m-d");
//aadressireal on keyword
if (isset($_GET["keyword"]) && isset($_GET["time"])) {
    //otsin
    $keyword = $_GET["keyword"];
    $time = $_GET["time"];
    $data_array = get_Data($keyword, $time);
    //}elseif(isset($_GET["time"])){
    //otsin
    //$time = $_GET["time"];
    //$data_array = search_time($time);
Example #2
0
function book_entry($data)
{
    global $post_meta, $mySQLi;
    if (can_edit($data) === false) {
        $out['error'] = 'You have insufficient access to edit this entry';
    } else {
        $post_id = $data['id'];
        $user_id = $data['user_id'];
        if (array_key_exists('status', $data)) {
            $out = update_entry($data, false, true);
        } else {
            $data['status'] = 'booked';
            $out = update_entry($data, true, false);
        }
        if (!isset($out['error']) || $out['error'] == '') {
            $sql = "INSERT INTO `{$post_meta}` (post_id,meta_key,meta_value,updated) VALUES ('{$post_id}','booked','{$user_id}',CURRENT_TIMESTAMP);";
            $ins = $mySQLi->add_row($sql);
            if ($ins === FALSE || $mySQLi->insert_id == 0) {
                $out['meta_data_error'] = "Failed to insert booking metadata.";
            }
        }
        // end if update process failed
    }
    // end if can edit
    return $out;
}
Example #3
0
if (isset($_GET["logout"])) {
    session_destroy();
    header("Location: login.php");
}
?>
<p>
<a href="?logout=1"> Logi välja <a> 
</p>
 <?php 
require_once "function.php";
if (isset($_GET["delete"])) {
    echo "Kustutame id " . $_GET["delete"];
    delete_entry($_GET["delete"]);
}
if (isset($_POST["save"])) {
    update_entry($_POST["id"], $input['name'], $input['tunnus'], $input['pesitsus']);
}
$keyword = "";
if (isset($_GET["keyword"])) {
    $keyword = $_GET["keyword"];
    $data_array = get_Data($keyword);
} else {
    $data_array = get_Data();
}
?>
<h2>Tabel</h2>

<form action="redigeeri.php" method="get" >
	<input type="search" name="keyword" value="<?php 
echo $keyword;
?>
Example #4
0
require_once 'functions.php';
#
# Route URLS
#
if (isset($_REQUEST['migrate'])) {
    require_once 'migrate.php';
} elseif ($_POST['action'] == 'create') {
    $person_id = $_REQUEST['person_id'];
    $project_id = $_REQUEST['project_id'];
    $startdate = $_REQUEST['startdate'];
    create_entry($person_id, $project_id, $startdate);
} elseif ($_POST['action'] == 'update') {
    $entry_id = $_REQUEST['entry_id'];
    $project_id = $_REQUEST['project_id'];
    $startdate = $_REQUEST['startdate'];
    update_entry($entry_id, $project_id, $startdate);
} elseif ($_POST['action'] == 'delete') {
    $entry_id = $_REQUEST['entry_id'];
    delete_entry($entry_id);
} elseif ($_POST['action'] == 'reorder') {
    $new_order = $_REQUEST['new_order'];
    reorder_entries($new_order);
} elseif ($_POST['action'] == 'add_project') {
    $project_name = $_REQUEST['project_name'];
    $project_url = $_REQUEST['project_url'];
    add_project($project_name, $project_url);
} elseif ($_POST['action'] == 'park_project') {
    $project_id = $_REQUEST['project_id'];
    park_project($project_id);
} elseif ($_POST['action'] == 'unpark_project') {
    $project_id = $_REQUEST['project_id'];
#@ _UPDATE_ENTRY_
#@ _OUTLINE_PART_2_
$title = "U.S. Historical League -- Member Editing Form";
html_begin($title, $title);
$dbh = sampdb_connect();
# determine what action to perform (the default if
# none is specified is to present the initial page)
$action = script_param("action");
if (is_null($action)) {
    $action = SHOW_INITIAL_PAGE;
}
switch ($action) {
    case SHOW_INITIAL_PAGE:
        # present initial page
        display_login_page();
        break;
    case DISPLAY_ENTRY:
        # display entry for editing
        display_entry($dbh);
        break;
    case UPDATE_ENTRY:
        # store updated entry in database
        update_entry($dbh);
        break;
    default:
        die("Unknown action code ({$action})\n");
}
$dbh = NULL;
# close connection
html_end();
#@ _OUTLINE_PART_2_
Example #6
0
        } else {
            #let's see... is the permission for this project already set up? string string :-)
            $alreadyAccepted = ereg('(^|_)' . $_REQUEST['ext_project_id'] . '_', $rule_info['permission']);
            if ($alreadyAccepted) {
                echo "Rule already accepted";
            } else {
                $rule_info['oldpermission'] = $rule_info['permission'];
                #keep the old for the log
                $rule_info['permission'] = $rule_info['permission'] . $_REQUEST['ext_project_id'] . '_';
                $rule_info['project_id'] = $_REQUEST['ext_project_id'];
                $rule_info['action_by'] = $action = 'connect';
                $editrule = compact('db', 'user_id', 'rule_info', 'inputs', 'action');
                if (update_rule($editrule)) {
                    #add entry on rules_accesss
                    $match = array('ext_project_id' => $_REQUEST['ext_project_id'], 'rule_id' => $_REQUEST['accept_rule_id'], 'project_id' => $_REQUEST['project_id']);
                    update_entry('access_rules', $match, 'status', 'connected', $db);
                    echo "Rule accepted";
                }
            }
        }
        echo "</font>";
    }
}
##Action for the button of submitting a UID
#	{
if ($_POST['connect']) {
    if ($_POST['rule_id'] == '') {
        echo "Please specify rule_id to connect";
    } else {
        #ok, so you want to share? are you asking to see a rule or a resource? you know, you won't be able to see anything before asking the share the resource!
        #Check if the rule exists internally