コード例 #1
0
ファイル: LegalCase.php プロジェクト: sapray/ampersand-models
    for ($i0 = 0; isset($r['8.' . $i0]); $i0++) {
        $casefile[$i0] = array('id' => @$r['8.' . $i0 . '.0'], 'Document' => @$r['8.' . $i0 . '.0'], 'type' => @$r['8.' . $i0 . '.1']);
    }
    $authorizationdocuments = array();
    for ($i0 = 0; isset($r['9.' . $i0]); $i0++) {
        $authorizationdocuments[$i0] = array('id' => @$r['9.' . $i0 . '.0'], 'authorization' => @$r['9.' . $i0 . '.0']);
        $authorizationdocuments[$i0]['party'] = array();
        for ($i1 = 0; isset($r['9.' . $i0 . '.1.' . $i1]); $i1++) {
            $authorizationdocuments[$i0]['party'][$i1] = @$r['9.' . $i0 . '.1.' . $i1 . ''];
        }
        $authorizationdocuments[$i0]['representative'] = array();
        for ($i1 = 0; isset($r['9.' . $i0 . '.2.' . $i1]); $i1++) {
            $authorizationdocuments[$i0]['representative'][$i1] = @$r['9.' . $i0 . '.2.' . $i1 . ''];
        }
    }
    $LegalCase = new LegalCase($ID, $plaintiff, $representativeofplaintiff, $defendant, $representativeofdefendant, $areaoflaw, $typeofcase, $process, $court, $casefile, $authorizationdocuments);
    if ($LegalCase->save() !== false) {
        die('ok:' . $_SERVER['PHP_SELF'] . '?LegalCase=' . urlencode($LegalCase->getId()));
    } else {
        die('');
    }
    exit;
    // do not show the interface
}
$buttons = "";
if (isset($_REQUEST['new'])) {
    $new = true;
} else {
    $new = false;
}
if (isset($_REQUEST['edit']) || $new) {
コード例 #2
0
function delLegalCase($id)
{
    $tobeDeleted = new LegalCase($id);
    if ($tobeDeleted->isNew()) {
        return true;
    }
    // item never existed in the first place
    if ($tobeDeleted->del()) {
        return true;
    } else {
        return $tobeDeleted;
    }
}