Exemplo n.º 1
0
    // GET POST
    $arrData = $_POST;
    $id = $arrData['content_id'];
    //ADD Variables
    $arrData['language_id'] = $_POST['content_id'];
    $arrData['language_image'] = '../theme/img/' . $arrData['language_locale'] . '.gif';
    if (empty($arrErrors)) {
        try {
            if (empty($arrData['language_id'])) {
                //add
                $objLang->add($arrData);
                $action = "create";
                $return = false;
            } else {
                //update
                $objLang->update($arrData);
                $action = "update";
            }
            header('Location: view.php?module=' . $module . '&id=' . $id . '&action=' . $action);
            exit;
        } catch (Exception $e) {
            $arrErrors[] = $e->getMessage();
        }
    }
}
// UPDATE : Get Data
if (!empty($_GET['id'])) {
    $arrLanguage = $objLang->getOne(array("language_id" => $_GET['id']));
    $arrData['language'] = $arrLanguage;
}
// ERRORS