コード例 #1
0
ファイル: project-edit.php プロジェクト: MapFig/mapfig-studio
    redirect("index.php");
}
$error = "";
$success = "";
if (strlen($_SESSION['response']['projects-edit']['error']) > 0) {
    $error = '<div ng-show="authMsg" class="alert alert-danger text-center ng-binding">' . $_SESSION['response']['projects-edit']['error'] . '</div>';
} else {
    if (strlen($_SESSION['response']['projects-edit']['success']) > 0) {
        $success = '<div ng-show="authMsg" class="alert alert-success text-center ng-binding">' . $_SESSION['response']['projects-edit']['success'] . '</div>';
    }
}
unset($_SESSION['response']['projects-edit']['error']);
unset($_SESSION['response']['projects-edit']['success']);
$PAGE = "PROJECT_EDIT";
$user = $_SESSION['user'];
$project = getProjectByIdAndUserId($user['id'], (int) $_GET['id']);
?>
<!DOCTYPE html>
<html lang="en">

<head>
   <meta charset="utf-8">
   <title>Edit Project</title>
   
   <?php 
require_once dirname(__FILE__) . "/../include/header.tpl.php";
?>
   
   
   <!-- =============== VENDOR STYLES ===============-->
   <!-- FONT AWESOME-->
コード例 #2
0
/**
 * 
 */
function openProjectAction()
{
    $errors = NULL;
    if (isset($_POST['opening_project']) && isset($_COOKIE['form'])) {
        setcookie('form', 1, time() - 3600);
        $proj_id = intval($_POST['opening_project']);
        if ($proj_id === 0) {
            $errors[] = 'Проект не выбран';
        }
        if (!$errors) {
            $user_id = getUserFromSession()['id'];
            $opening_project = getProjectByIdAndUserId($proj_id, $user_id);
            if ($opening_project['id']) {
                $_SESSION['project'] = $opening_project;
                $_SESSION['opening_project_data'] = getProjectDataById($opening_project['id']);
            } else {
                $errors[] = 'Произошла ошибка доступа к базе данных';
            }
        }
    }
    indexAction($errors);
}