コード例 #1
0
ファイル: upd_client.php プロジェクト: nyimbi/legalcase
}
//
// Update data
//
$obj_client = new LcmClient(_session('id_client'));
$errs = $obj_client->save();
if (count($errs)) {
    $_SESSION['errors'] = array_merge($_SESSION['errors'], $errs);
    lcm_header("Location: " . $ref_upd_client);
    exit;
}
//
// Attach to case
//
if (_session('attach_case')) {
    lcm_query("INSERT INTO lcm_case_client_org\n\t\t\t\tSET id_case = " . _session('attach_case') . ",\n\t\t\t\t\tid_client = " . $obj_client->getDataInt('id_client'));
}
//
// Add organisation
// [ML] 2007-01-11: not clear what this does. probably w.r.t "client represents orgs".
//
if (_session('new_org')) {
    $q = "REPLACE INTO lcm_client_org\n\t\tVALUES (" . _session('id_client') . ',' . _session('new_org') . ")";
    $result = lcm_query($q);
}
//
// Go to the 'view details' page of the author
//
// small reminder, if the client was created from the "add client to case" (Case details)
$attach = "";
if (_session('attach_case')) {
コード例 #2
0
ファイル: upd_case.php プロジェクト: nyimbi/legalcase
}
//
// Clean (most of the) input
//
$id_case = _request('id_case', 0);
//
// Create client, if requested
//
if (_request('add_client')) {
    include_lcm('inc_obj_client');
    $client = new LcmClient();
    $errs = $client->save();
    if (count($errs)) {
        $_SESSION['errors'] = array_merge($_SESSION['errors'], $errs);
    } else {
        $_SESSION['form_data']['attach_client'] = $client->getDataInt('id_client', '__ASSERT__');
    }
}
//
// Create organisation, if requested
//
if (_request('add_org')) {
    include_lcm('inc_obj_org');
    $org = new LcmOrg();
    $errs = $org->save();
    if (count($errs)) {
        $_SESSION['errors'] = array_merge($_SESSION['errors'], $errs);
    } else {
        $_SESSION['form_data']['attach_org'] = $org->getDataInt('id_org', '__ASSERT__');
    }
}