Пример #1
0
     /** 
      * Updates person attributes
      * **/
 /** 
  * Updates person attributes
  * **/
 case "update-person-attribute":
     $success = true;
     if (!isset($_REQUEST['id'])) {
         error_500("missing id");
         jecho(0);
     }
     $log = '';
     if (isset($_REQUEST['color'])) {
         if (checkPerson($_REQUEST['id']) == 1) {
             $sql = $QUERIES->updatePersonColor($_REQUEST['color'], $_SESSION['user'], $_REQUEST['id'], $_SESSION['frame_id'], $_SESSION['camera_id']);
             $result = mysql_query($sql) or $success = false;
         } else {
             $bb = $config->bb;
             $bbV = $config->bbV;
             //If person is a proposal and it has been approved, insert it into frame people list
             $sql = $QUERIES->insertPerson(intval($_REQUEST["id"]), $_SESSION['frame_id'], $_SESSION['camera_id'], $bb->x, $bb->y, $bb->width, $bb->height, $bbV->x, $bbV->y, $bbV->width, $bbV->height, 'null', 'null', 'null', 'null', $_REQUEST['color'], 0, $_SESSION['user'], 0);
             $result = mysql_query($sql) or $success = false;
         }
     }
     if (isset($_REQUEST['group_id'])) {
         if (checkPerson($_REQUEST['id']) == 1) {
             $sql = $QUERIES->updatePersonGroup($_REQUEST['group_id'], $_SESSION['user'], $_REQUEST['id'], $_SESSION['frame_id'], $_SESSION['camera_id']);
             $result = mysql_query($sql) or $success = false;
         } else {
             $bb = $config->bb;