Example #1
0
// Not authed for this nemex? Maybe we have a sharekey for the project?
// If not, just show the login form
if (!$session->isAuthed()) {
    if (count($_GET) == 2) {
        $get = array_keys($_GET);
        $projectName = $get[0];
        $sharekey = $get[1];
        $project = Project::openWithSharekey($projectName, $sharekey);
        if ($project) {
            $nodes = $project->getNodes();
            include NX_PATH . 'media/templates/project-readonly.html.php';
            exit;
        }
    }
    include NX_PATH . 'media/templates/login.html.php';
} else {
    if (!empty($_GET)) {
        $projectName = key($_GET);
        $project = Project::open($projectName);
        if ($project) {
            $nodes = $project->getNodes();
            include NX_PATH . 'media/templates/project.html.php';
        } else {
            header("HTTP/1.1 404 Not Found");
            echo 'No Such Project: ' . htmlspecialchars($projectName);
        }
    } else {
        $projects = Project::getProjectList();
        include NX_PATH . 'media/templates/project-list.html.php';
    }
}
Example #2
0
    $start_limit = $page * ROW_PER_PAGE - ROW_PER_PAGE;
}
@($action = isset($_GET['action']) ? $_GET['action'] : $_POST['action']);
@($id = isset($_GET['id']) ? $_GET['id'] : $_POST['id']);
switch ($action) {
    case "Add":
        $sMsg1 = $objProject->addProject($_POST);
    case "Edit":
        if ($action == "Edit") {
            $sMsg1 = $objProject->updateProject($_POST);
        }
        if ($sMsg1 == 1) {
            $sMsg = $objMessages->addupdatesucessIndication($moduleLabel, $action);
            $count = $objProject->getProjectCount();
            if ($count > 0) {
                $projectList = $objProject->getProjectList();
            }
            include "layouts/project.html";
        } else {
            if ($sMsg1 == 0) {
                $sMsg = $objMessages->errorIndication($moduleLabel, $action);
            } else {
                if ($sMsg1 == 2) {
                    $sMsg = $objMessages->duplicateIndication($moduleLabel);
                }
            }
            if ($id != "") {
                $projectData = $objProject->getDataById($id);
            }
            include "layouts/forms/project.html";
        }
 public static function getProjectList()
 {
     try {
         $project = Project::getProjectList();
         if ($project !== null) {
             echo AppUtil::getReturnStatus("Successful", $project);
         } else {
             echo AppUtil::getReturnStatus("Unsuccessful", "Database Error Occurred");
         }
     } catch (Exception $e) {
         echo AppUtil::getReturnStatus("Unsuccessful", "Unknown database error occurred");
     }
 }