<?php

/*
 Project name : BITuN
 Start Date : 18 Apr, 2015 12:56:50 PM
 Author: Adarsh
 Purpose :
*/
session_start();
include 'classes/editArticleClass.php';
$eArticle = new editArticle();
$author_id = $eArticle->authenticate();
/* Check whether the user is an author */
if (!$author_id) {
    header("LOCATION: /");
}
function dispEr($msg)
{
    echo "<p class='bg-danger'>{$msg}</p>";
}
function displayEditForm($eArticle)
{
    $row = $eArticle->getArticleDetails();
    if ($row == FALSE) {
        dispEr($eArticle->erm);
    }
    ?>
<!DOCTYPE HTML>
<html>
	<head>
		<style>
Example #2
0
                                <img class="iss" title="' . $imgTitle . '" src=\'' . $ar[0] . '\' alt="' . $imgAlt . '">
                            </a>
                            <div class="li icon" onclick="lclick(\'' . $imgAdr . '\',\'' . $imgID . '\',\'' . $irow['title'] . '\',\'' . $irow['alt'] . '\')">
                                <img src="/Images/larrow.ico">
                            </div>	
                            <div class="ri icon" onclick="rclick(\'' . $imgAdr . '\',\'' . $imgID . '\',\'' . $irow['title'] . '\',\'' . $irow['alt'] . '\')">
                                <img src="/Images/rarrow.ico">
                            </div>
                        </div> <!-- End of slideshow div -->' . "\n";
    }
    $textToDisp = $row['content1'] . "</p><p>" . $row['content2'];
    $textToDisp = str_replace("\n", "</p><p class='para'>", $textToDisp);
    echo "\t\t\t\t\t\t<p>" . $textToDisp . "</p>\n                        \n";
    /*Obtain the author name and printing*/
    require_once 'author/classes/editArticleClass.php';
    $eArticle = new editArticle();
    $authorRes = $eArticle->getAuthorIdAndName($id);
    if ($authorRes) {
        echo "<h3>Author : <a href='/author/author.php?id=" . $authorRes['author_id'] . "'>" . $authorRes['author_name'] . " </a></h3>";
    }
    // Finished printing the author name
    //include 'author/classes/editArticleClass.php';
    if (isset($_SESSION['author_id'])) {
        $eArticle->verifyOwnership($id, $_SESSION['author_id']);
        if (!$eArticle->er) {
            echo "<p> <a href='/author/editArticle.php?id={$id}'>Edit Article</a></p>";
        }
    }
    // Finished printing the author name
    ?>
						<br><br>