Begin work on project pages
Also store project owners' emails as contact info
This commit is contained in:
@@ -33,6 +33,7 @@ $project = new \pvv\side\Project(
|
||||
'',
|
||||
$attrs["cn"][0],
|
||||
$attrs["uid"][0],
|
||||
$attrs["email"][0]
|
||||
1
|
||||
);
|
||||
if($new == 0){
|
||||
|
50
www/prosjekt/info.php
Normal file
50
www/prosjekt/info.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
|
||||
|
||||
$projectID = 0;
|
||||
if(isset($_GET['id'])){
|
||||
$projectID = $_GET['id'];
|
||||
}else{
|
||||
echo 'No project ID provided';
|
||||
exit();
|
||||
}
|
||||
|
||||
$projectManager = new \pvv\side\ProjectManager($pdo);
|
||||
$project = $projectManager->getByID($projectID);
|
||||
?>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" href="../../css/normalize.css">
|
||||
<link rel="stylesheet" href="../../css/style.css">
|
||||
<link rel="stylesheet" href="../../css/events.css">
|
||||
<link rel="stylesheet" href="../../css/projects.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav>
|
||||
<?php echo navbar(2, 'prosjekt'); ?>
|
||||
<?php echo loginbar(null, $pdo); ?>
|
||||
</nav>
|
||||
|
||||
<main class="contentsplit">
|
||||
<div class="gridr">
|
||||
<h2><?= $project->getName(); ?></h2>
|
||||
<p><?= implode($project->getDescription(), "<br>"); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="gridl">
|
||||
<div class="projectlead">
|
||||
<h2>Prosjektledelse</h2>
|
||||
<div class="projectowner">
|
||||
<p>Prosjekteier</p>
|
||||
<p class="ownername"><?= $project->getOwner() ?></p>
|
||||
<p class="owneruname"><?= $project->getOwnerUName(); ?></p>
|
||||
<p class="owneremail"><?= $project->getOwnerEmail(); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Medlemmer</h2>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
@@ -71,7 +71,7 @@ $projects = array_values(array_filter(
|
||||
<div class="event">
|
||||
<div class="event-info">
|
||||
<h3 class="no-chin"><?= '<a href="edit.php?id=' . $project->getID() . '">' . $project->getName() . '</a>'; ?></h3>
|
||||
<p><?= implode($project->getDescription()); ?></p>
|
||||
<p><?= implode($project->getDescription(), "<br>"); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
@@ -26,24 +26,27 @@ $title = $_POST['title'];
|
||||
$desc = $_POST['desc'];
|
||||
$owner = $attrs['cn'][0];
|
||||
$owneruname = $attrs['uid'][0];
|
||||
$owneremail = $attrs['mail'][0];
|
||||
|
||||
$statement;
|
||||
if($id == 0){
|
||||
$query = 'INSERT INTO projects (name, owner, owneruname, description, active) VALUES (:title, :owner, :owneruname, :desc, 1)';
|
||||
$query = 'INSERT INTO projects (name, owner, owneruname, owneremail, description, active) VALUES (:title, :owner, :owneruname, :desc, 1)';
|
||||
$statement = $pdo->prepare($query);
|
||||
|
||||
$statement->bindParam(':title', $title, PDO::PARAM_STR);
|
||||
$statement->bindParam(':desc', $desc, PDO::PARAM_STR);
|
||||
$statement->bindParam(':owner', $owner, PDO::PARAM_STR);
|
||||
$statement->bindParam(':owneruname', $owneruname, PDO::PARAM_STR);
|
||||
$statement->bindParam(':owneremail', $owneremail, PDO::PARAM_STR);
|
||||
}else{
|
||||
$query = 'UPDATE projects SET name=:title, owner=:owner, owneruname=:owneruname, description=:desc WHERE id=:id';
|
||||
$query = 'UPDATE projects SET name=:title, owner=:owner, owneruname=:owneruname, owneremail=:owneremail, description=:desc WHERE id=:id';
|
||||
$statement = $pdo->prepare($query);
|
||||
|
||||
$statement->bindParam(':title', $title, PDO::PARAM_STR);
|
||||
$statement->bindParam(':desc', $desc, PDO::PARAM_STR);
|
||||
$statement->bindParam(':owner', $owner, PDO::PARAM_STR);
|
||||
$statement->bindParam(':owneruname', $owneruname, PDO::PARAM_STR);
|
||||
$statement->bindParam(':owneremail', $owneremail, PDO::PARAM_STR);
|
||||
$statement->bindParam(':id', $id, PDO::PARAM_INT);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user