コード例 #1
0
ファイル: delete.php プロジェクト: par-orillonsoft/my-website
<?php

/**************************************************************************/
// AJAX Delete
// PARAMS $_GET : LINK in LIST
/**************************************************************************/
require_once $_SERVER['DOCUMENT_ROOT'] . '/include/config.php';
$return = 'false';
$message = '';
if (!empty($_GET['id'])) {
    $obj = new bTraduction();
    $contentID = $_GET['id'];
    $arrContent = $obj->getOne(array("traduction_id" => $_GET['id']));
    if (!empty($arrContent)) {
        $obj->delete(array("traduction_id" => $_GET['id']));
        $message = "Traduction deleted";
        $return = 'true';
    } else {
        $message = 'Content already deleted.';
    }
} else {
    $message = 'Error deleting, please try again.';
}
echo $return . "|" . $message;
コード例 #2
0
ファイル: form.php プロジェクト: par-orillonsoft/my-website
                $return = false;
            } else {
                //update
                $objTrad->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'])) {
    $arrTraduction = $objTrad->getOne(array("traduction_id" => $_GET['id']));
    $arrTraductionContenu = $objTrad->getText(array("traduction_id" => $_GET['id']));
    $arrData['traduction'] = $arrTraduction;
    $arrData['traduction_text'] = $arrTraductionContenu;
}
// ERRORS
if (!empty($arrErrors)) {
    $arrData = $_POST;
    $arrData['traduction_id'] = $_POST['content_id'];
}
/*********************************************************************************/
//Page List
$objPage = new Page();
$arrPage = $objPage->get();
//Language List
$objLang = new Language();