2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2010 */
\r
6 /* Inclusive Design Institute */
\r
8 /* This program is free software. You can redistribute it and/or */
\r
9 /* modify it under the terms of the GNU General Public License */
\r
10 /* as published by the Free Software Foundation. */
\r
11 /************************************************************************/
\r
13 define('TR_INCLUDE_PATH', '../include/');
\r
14 include(TR_INCLUDE_PATH.'vitals.inc.php');
\r
15 include_once(TR_INCLUDE_PATH.'classes/DAO/MyownPatchesDAO.class.php');
\r
17 if (isset($_POST['field']))
\r
19 $myownPatchesDAO = new MyownPatchesDAO();
\r
21 // Format of $_POST['field']: [fieldName]|[user_id]
\r
22 $pieces = explode('-', $_POST['field']);
\r
23 $status = $myownPatchesDAO->UpdateField($pieces[1], $pieces[0], $_POST['value']);
\r
25 if (is_array($status))
\r
27 $rtn['status'] = 'fail';
\r
28 foreach ($status as $err)
\r
29 $rtn['error'][] = $err;
\r
33 $rtn['status'] = 'success';
\r
34 $rtn['success'][] = _AT('TR_FEEDBACK_ACTION_COMPLETED_SUCCESSFULLY');
\r
36 echo json_encode($rtn);
\r