<?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 bProject(); $contentID = $_GET['id']; $arrContent = $obj->getOne(array("project_id" => $_GET['id'])); if (!empty($arrContent)) { $message = "Project " . $arrContent["project_name"] . " deleted."; $obj->delete(array("project_id" => $_GET['id'])); $return = 'true'; } else { $message = 'Project does not exist.'; } } else { $message = 'Error deleting, please try again.'; } echo $return . "|" . $message;
<?php /**************************************************************************/ // AJAX Build List // file called by the dataTables Jquery in list.php to load data /**************************************************************************/ require_once $_SERVER['DOCUMENT_ROOT'] . '/include/config.php'; $objProj = new bProject(); $arrProj = $objProj->get(); $objLang = new Language(); $arrLanguage = $objLang->get(); $module = $_GET['module']; $output['aaData'] = array(); foreach ($arrProj as $key => $data) { $row = array(); // O => hidden ID $row[] = $data['project_id']; // 1 => Actions (view, update..) $action_view = '<a href="view.php?module=' . $module . '&id=' . $data['project_id'] . '"><img alt="view" title="View" src="theme/img/view.gif" /></a>'; $action_update = '<a href="form.php?module=' . $module . '&id=' . $data['project_id'] . '"><img alt="update" title="Update" src="theme/img/update.gif" /></a>'; $action_delete = '<a href="module/' . $module . '/ajax/delete.php?module=' . $module . '&id=' . $data['project_id'] . '" class="ajaxDeleteRow" title="delete-row"><img alt="delete" title="Delete" src="theme/img/delete.gif" /></a>'; $row[] = '<span class="iconAction">' . $action_view . $action_update . $action_delete . '</span>'; // 2 => Name $row[] = $data['project_name']; // 3 => Url $row[] = $data['project_url']; //4 => Language $row_lang = '<span class="iconAction">'; foreach ($arrLanguage as $key => $lang) { $row_lang .= '<a style="text-decoration:none;margin:0 5px;" href="form.php?module=' . $module . '&id=' . $data['project_id'] . '#' . $lang['language_locale'] . '"><img alt="update" title="Update" src="theme/img/' . $lang['language_locale'] . '.gif" /></a>'; }
<?php //Object Back $objProj = new bProject(); // Arrays $arrData = array(); // VIEW : Get Data if (!empty($_GET['id'])) { $arrProject = $objProj->getOne(array("project_id" => $_GET['id'])); $arrProjectImage = array(); $arrProjectTraduction = array(); if (!empty($arrProject)) { $arrProjectImage = $objProj->getImage(array("project_id" => $_GET['id'])); $arrProjectTraduction = $objProj->getTraduction(array("project_id" => $_GET['id'])); $arrData['project'] = $arrProject; $arrData['project_image'] = $arrProjectImage; $arrData['project_traduction'] = $arrProjectTraduction; } } else { //return to list header('Location: list.php?module=' . $module); exit; } /*********************************************************************************/ //Language List $objLang = new Language(); $arrLanguage = $objLang->get(); //Type Images $arrProjectImageType = $objProj->getImageType(); ?>
<?php //Object Back $objProj = new bProject(); //Object Front Variable $objVar = new Variable(); $objUtil = new Util(); // Arrays $arrData = array(); $arrErrors = array(); //Type Images $arrProjectImageType = $objProj->getImageType(); //Construction Pattern Search Image $listPost = ""; $listTypeKey = ""; $patternPost = ""; $patternTypeKey = ""; foreach ($arrProjectImageType as $key => $data) { $listPost .= "FileName-UploadifyBtn-" . $data["project_image_type_value"]; $listTypeKey .= $data["project_image_type_value"]; if ($key < count($arrProjectImageType) - 1) { $listPost .= "|"; $listTypeKey .= "|"; } } $patternPost = '/(' . $listPost . ')/'; $patternTypeKey = '/(' . $listTypeKey . ')/'; //POST if (!empty($_POST)) { $action = ""; $return = false;