Repository navigation
Expand file tree
/
Copy pathcontent.php
More file actions
42 lines (41 loc) · 1.76 KB
/
Copy pathcontent.php
File metadata and controls
42 lines (41 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php require_once("includes/connection.php");?>
<?php require_once("includes/functions.php");?>
<?php
find_selected_page($connection);
?>
<?php include("includes/header.php");?>
<table id="structure">
<tr>
<td id="navigation">
<?php echo navigation($sel_subject,$sel_page,$connection); ?>
<br/>
<a href="new_subject.php">+Add a new Subject</a>
</td>
<td id="page">
<?php if(!is_null($sel_subject)) { ?>
<h2><?php echo $sel_subject['menu_name'];?></h2>
<?php if($sel_page) { ?>
<div class="page-content">
<h3><?php echo $sel_page['menu_name'];?></h3>
<?php echo $sel_page['content'];?>
<br/><br/>
<a href="edit_page.php?page=<?php echo $sel_page['id']; ?>&subj=<?php echo $sel_subject['id']; ?>">+ Edit Page</a>
</div>
<?php } else { ?>
<p>No pages available for this subject.</p>
<a href="new_page.php?subj=<?php echo $sel_subject['id']; ?>">+ Add a new page</a>
<?php } ?>
<?php } elseif(!is_null($sel_page)) { ?>
<h2><?php echo $sel_page['menu_name'];?></h2>
<div class="page-content">
<?php echo $sel_page['content'];?>
<br/><br/>
<a href="edit_page.php?page=<?php echo $sel_page['id']; ?>&subj=<?php echo $sel_subject['id']; ?>">Edit Page</a>
</div>
<?php } else { ?>
<h2>Select a subject or a page to edit</h2>
<?php } ?>
</td>
</tr>
</table>
<!-- <?php include("includes/footer.php");?> -->