Example #1
0
File: index.php Project: nicox/noaa
include './functions.php';
#connect_mysql();
mysql_select_db($db_name);
html_header();
if ($_GET["change"] != "") {
    #	echo "test";
    change_view($_GET["change"]);
    links();
    exit;
}
if ($_GET["submit"] == "1") {
    $device_id = $_POST["device_id"];
    $mac = $_POST["mac"];
    $allowed = $_POST["allowed"];
    $description = $_POST["description"];
    save_changes($device_id, $mac, $allowed, $description);
    change_view($device_id);
    links();
    exit;
}
links();
$SQL = " SELECT * FROM devices LEFT JOIN mac_vendors ON mac_prefix = SUBSTRING( address, 1, 8 )";
if ($_GET["allowed"] == "0") {
    $SQL = $SQL . "where allowed = '0'";
}
//  $SQL = $SQL."order by address asc";
$retid = mysql_query($SQL);
if (!$retid) {
    echo mysql_error();
}
#$row = mysql_fetch_array($retid);
Example #2
0
<?php

header('Content-Type: application/json');
include $_SERVER['DOCUMENT_ROOT'] . '/config.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/lib/db.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/lib/session.php';
sec_session_start();
switch ($_POST['option']) {
    case 1:
        add_usr_picture($dbh, $table_prefix);
        break;
    case 2:
        save_changes($dbh, $table_prefix);
        break;
}
function add_usr_picture($dbh1, $table_prefix1)
{
    $img = $_POST['image'];
    $user_id = $_SESSION['user_id'];
    if ($stmt = $dbh1->prepare("UPDATE " . $table_prefix1 . "_users SET img=? WHERE id=?")) {
        $stmt->bindParam(1, $img);
        $stmt->bindParam(2, $user_id);
        $stmt->execute();
    }
    echo json_encode(array('user_id' => $_SESSION['user_id'], 'files' => $_POST['image']));
    // required in production
}
function save_changes($dbh1, $table_prefix1)
{
    if ($insert_stmt = $dbh1->prepare("UPDATE " . $table_prefix1 . "_users SET name=?, last_name=?, e_mail=?, about=?, url=?, phone=? WHERE id=?")) {
        $insert_stmt->bindParam(1, $_POST['first_name']);
Example #3
0
            $publisher = $book[3];
            $isbn = $book[4];
        }
    }
}
if ($_GET['submit'] == true) {
    // validate
    $x = 0;
    foreach ($fields as $item) {
        if (empty($_POST[$item])) {
            $errors[$x] = "Required";
        }
        $x++;
    }
    if (empty($errors)) {
        save_changes($book_id, $title, $author, $publisher, $isbn);
        header("location:biags_library.php?updated=true&id={$book_id}&title={$title}");
    }
}
?>
<!DOCtype html>
<html lang="EN">
<head>
	<title>Biags Library - Update</title>
	<link rel="stylesheet" type="text/css" href="style.css" media="all" />
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="myjquery.js"></script>
</head>
	<body>
		<div class="container">
		<h1><a href="biags_library.php">Biag's Library</a></h1>
Example #4
0
	paste_from_file(body_text);
} else if (isset($_POST['submit']) && ($_POST['submit'] != 'submit1')) {
	/* we're saving. redirects if successful. */
	save_changes(true, $current_tab);
}

if (isset($_POST['submit_file_alt'])) {
	paste_from_file(body_text_alt);
} else if (isset($_POST['submit']) && ($_POST['submit'] != 'submit1')) {
	/* we're saving. redirects if successful. */
	save_changes(true, $current_tab);
}

if (isset($_POST['submit'])) {
	/* we're saving. redirects if successful. */
	save_changes(true, $current_tab);
}

if (!isset($current_tab) && isset($_POST['button_1']) && ($_POST['button_1'] == -1) && !isset($_POST['submit'])) {
	$current_tab = 1;
} else if (!isset($current_tab)) {
	$current_tab = 0;
}

if ($cid) {
	$_section[0][0] = _AT('edit_content');
} else {
	$_section[0][0] = _AT('add_content');
}

if($current_tab == 0) {
Example #5
0
         mail($to, $msgtitle, $message, $headers);
     }
 }
 // Process form save
 if ($_POST["save"]) {
     save_changes();
     // Update View
     echo "<h3>" . CODENAME . " Updated</h3>";
     echo "<p>Thank you for your update, these changes are now available to all stakeholders.</p>";
     echo "<p>Additional updates can be made by selecting your review from the menu.</p>";
     echo "<p><a href=\"#\" onclick=\"update_div('#ajax','currentAppraisal.php');\" class=\"return\">Return to Review</a></p>";
 }
 //Manager of Additional Responsibilities
 if ($_POST["AdditionalResponsibilities"]) {
     //Update Form
     save_changes();
     // Email for feedback
     //Email Owner
     $to = $_POST["AdditionalResponsibilitiesEmail"];
     $headers = 'From: appraisals@cheltladiescollege.org' . "\r\n";
     $headers .= 'Reply-To: ITAVsupport@cheltladiescollege.org' . "\r\n";
     $headers .= 'MIME-Version: 1.0' . "\r\n";
     $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
     $headers .= 'X-Mailer: PHP/' . phpversion();
     $msgtitle = CODENAME . " feedback requested";
     $message = "<p>" . $_POST["name"] . " has added you as a manager of additional responsibilities, and has requested your feedback in their review.</p>";
     $message .= "<p>Please click the link provided to complete the feedback form, your feedback will then be appended to the performance review, for the line manager and reviewee to see.</p>";
     $message .= "<p><a href='" . WEBAPP_LOC . "/app/views/feedback.php?review=" . $_POST["appraisalId"] . "'>Leave Feedback</a></p>";
     $message = wordwrap($message, 70, "\r\n");
     // Send email
     mail($to, $msgtitle, $message, $headers);