<?php
/**
 * Phoebe pedagogic planner
 *
 * PHP version 5
 *
 * LICENSE: The GNU General Public License (GPL), version 2. See LICENSE.txt
 *
 * Copyright (c) 2006-2008 JISC/HEFCE/University of Oxford
 *
 * @author      David Balch <david.balch@conted.ox.ac.uk>
 * @license     http://opensource.org/licenses/gpl-license.php GPL2
 * @link        http://phoebe-project.conted.ox.ac.uk/
 */

/* Create a new property title */
$content['settings'] = 'dbWrite';
include_once($_SERVER['DOCUMENT_ROOT'].'/inc/core.php');
include_once($_SERVER['DOCUMENT_ROOT'].'/inc/session.php');
include_once($_SERVER['DOCUMENT_ROOT'].'/db/addFuncts.php');

// Sanitise user data before sending to database
// Remove preceding "p"
$prop_id = substr($_POST['id'], 1);
// Remove following "_title"
$prop_id = str_replace('_title', '', $prop_id);

$vals = array('prop_id' => $prop_id, 'value' => $_POST['value']);

$result = updateProp('title', $vals);
echo $result;
?>