예제 #1
0
$arrErrors = array();
//POST
if (!empty($_POST)) {
    $action = "";
    $return = false;
    // 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