/**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Party();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Party'])) {
         $model->attributes = $_POST['Party'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }
Example #2
0
    }
}
/**
 * Handler for the change presenter functionality
 */
if (isset($_POST['form']) && $_POST['form'] == "change_presenter") {
    if (isset($_POST['presenter_sequence_id']) && isset($_POST['party_id'])) {
        //get the presenter id from the sequence id
        require_once APPLICATION_PATH . MODEL_DIR . '/Presenter.php';
        $presenter = new Presenter();
        $presenter_id = $presenter->getIdBySequenceId($_POST['presenter_sequence_id']);
        if ($presenter_id) {
            $data = array("id" => $_POST['party_id'], "presenter_id" => $presenter_id);
            require_once APPLICATION_PATH . MODEL_DIR . '/Party.php';
            $party = new Party();
            $party->set($data);
            if ($party->save()) {
                $result->success = TRUE;
                $result->message = "Presenter changed successfully.";
            } else {
                $result->success = FALSE;
                $result->message = "Failed to change presenter.";
            }
        } else {
            $result->success = FALSE;
            $result->message = "Failed to change presenter. Check the presenter id.";
        }
    }
}
header('Content-Type: application/json');
echo json_encode($result);
Example #3
0
        $cases[$i0]['type of case'] = array();
        for ($i1 = 0; isset($r['0.' . $i0 . '.2.' . $i1]); $i1++) {
            $cases[$i0]['type of case'][$i1] = @$r['0.' . $i0 . '.2.' . $i1 . ''];
        }
    }
    $role = @$r['1'];
    $authorized = array();
    for ($i0 = 0; isset($r['2.' . $i0]); $i0++) {
        $authorized[$i0] = array('id' => @$r['2.' . $i0 . '']);
        $authorized[$i0]['representative'] = array();
        for ($i1 = 0; isset($r['2.' . $i0 . '.0.' . $i1]); $i1++) {
            $authorized[$i0]['representative'][$i1] = @$r['2.' . $i0 . '.0.' . $i1 . ''];
        }
    }
    $Party = new Party($ID, $cases, $role, $authorized);
    if ($Party->save() !== false) {
        die('ok:' . $_SERVER['PHP_SELF'] . '?Party=' . urlencode($Party->getId()));
    } else {
        die('');
    }
    exit;
    // do not show the interface
}
$buttons = "";
if (isset($_REQUEST['new'])) {
    $new = true;
} else {
    $new = false;
}
if (isset($_REQUEST['edit']) || $new) {
    $edit = true;