Exemplo n.º 1
0
function formulaires_ecatalogue_currency_verifier_dist()
{
    $erreurs = array();
    $c_mdl = new CurrencyModel();
    $data = $c_mdl->form_data_from_array($_REQUEST);
    $c_mdl->validate($data, $erreurs, true);
    return $erreurs;
}
Exemplo n.º 2
0
function formulaires_ecatalogue_currency_traiter_dist($id_currency)
{
    $result = array();
    $mdl = new CurrencyModel();
    if (_request('delete_currency')) {
        if ($mdl->delete_by_id($id_currency)) {
            pdk_set_message_ok(_T('ecatalogue:form_deleted'));
            //$result['message_ok'] = _T('sport:form_deleted');
        } else {
            pdk_set_message_error(_T('ecatalogue:form_error'));
            //$result['message_erreur'] = _T('sport:form_error');
        }
        include_spip('inc/headers');
        redirige_url_ecrire('ecatalogue_currencies');
    } else {
        $data = $mdl->form_data_from_array($_REQUEST);
        if ($mdl->update_by_id($id_currency, $data, true)) {
            $result['message_ok'] = _T('ecatalogue:form_saved');
        } else {
            $result['message_erreur'] = _T('ecatalogue:form_error');
        }
    }
    return $result;
}