Example #1
0
<!DOCTYPE html>
<html>
	<head>
		<meta content="noindex, nofollow" name="robots">
 <link rel="stylesheet" type="text/css" href="menu.css">

<title>News Portal - Update Sentiment</title>
	</head>
<body>
	<?php 
include "menu.php";
require_once "SentimentPDO.php";
require_once "Sentiment.php";
$sentimentid = $_GET["id"];
$sentimentPDO = new SentimentPDO();
$sentiment = $sentimentPDO->getSentiment($sentimentid);
?>
<form action="EditSentiment.php" method="post">
<input type="hidden" name="sentimentid" value="<?php 
echo $sentimentid;
?>
">
<h1>Input Sentiment Source</h1>
<br>
<input type="text" name="sentimentsourcename" value="<?php 
echo $sentiment->getSentimentSourceName();
?>
">
<br>
<h1>Input Sentiment SourceLink</h1>
<br>
Example #2
0
<?php

require_once "SentimentPDO.php";
require_once "Sentiment.php";
$sentimentPDO = new SentimentPDO();
$sentiments = $sentimentPDO->getSentiments();
echo "<html>";
echo "<head>";
echo "<meta http-equiv='Content-Type'' content='text/html; charset=UTF-8' >";
echo "<link rel='stylesheet'' type='text/css' href='menu.css'>";
echo "<title>News Portal Sentiment List</title>";
echo "</head>";
echo "<body>";
include "menu.php";
echo "<table border=1>";
echo "<tr border=1>";
echo "<th border=1><h4>Sentiment Source Id</h4></th>";
echo "<th border=1><h4>Sentiment Source Name</h4></th>";
echo "<th border=1><h4>Sentiment Source Link</h4></th>";
echo "<th border=1><h4>Sentiment Source Link Type</h4></th>";
echo "<th border=1><h4>Update Link</h4></th>";
echo "<th border=1><h4>Delete Link</h4></th>";
echo "</tr>";
foreach ($sentiments as $sentiment) {
    echo "<tr border=1>";
    echo "<td border=1>";
    echo "<h5>" . $sentiment->getSentimentId() . "</h5>";
    echo "</td>";
    echo "<td border=1>";
    echo "<h5>" . $sentiment->getSentimentSourceName() . "</h5>";
    echo "</td>";
Example #3
0
<?php

require_once "SentimentPDO.php";
require_once "Sentiment.php";
if (isset($_POST['submit'])) {
    $sentimentid = $_POST["sentimentid"];
    $sentimentsourcename = $_POST["sentimentsourcename"];
    // echo $username . "<br>\n";
    $sentimentsourcelink = $_POST["sentimentsourcelink"];
    //echo $password ."<br>\n";
    $sentimentsourcelinktype = $_POST["sentimentsourcelinktype"];
    if ($sentimentsourcename != '' && $sentimentsourcelink != '' && $sentimentsourcelinktype != '') {
        $sentimentPDO = new SentimentPDO();
        $sentiment = new Sentiment();
        $sentiment->setSentimentId($sentimentid);
        $sentiment->setSentimentSourceName($sentimentsourcename);
        $sentiment->setSentimentSourceLink($sentimentsourcelink);
        $sentiment->setSentimentSourceLinkType($sentimentsourcelinktype);
        $sentimentPDO->updateSentiment($sentiment);
        echo "<html>";
        echo "<head>";
        echo "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' >";
        echo "<link rel='stylesheet' type='text/css' href='menu.css'>";
        echo "<title>News Portal - Update Sentiment Source</title>";
        echo "</head>";
        echo "<body>";
        include "menu.php";
        echo "Updated a Sentiment Source </br>";
        echo "<a href='Home.php'> Back to Home</a>";
        echo "</body>";
        echo "</html";
Example #4
0
<?php

require_once "SentimentPDO.php";
require_once "Sentiment.php";
$sentimentid = $_GET["id"];
$sentimentPDO = new SentimentPDO();
$sentiment = $sentimentPDO->getSentiment($sentimentid);
// echo "UserId " .$user->getUserId();
$sentimentPDO->deleteSentiment($sentiment);
echo "<html>";
echo "<head>";
echo "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' >";
echo "<link rel='stylesheet' type='text/css' href='menu.css'>";
echo "<title>News Portal - Delete Sentiment</title>";
echo "</head>";
echo "<body>";
include "menu.php";
echo "Deleted Sentiment </br>";
echo "<a href='Home.php'> Back to Home</a>";
echo "</body>";
echo "</html";
<?php

require_once "SentimentPDO.php";
require_once "Sentiment.php";
if (isset($_POST['submit'])) {
    $sentimentsourcename = $_POST["sentimentsourcename"];
    // echo $username . "<br>\n";
    $sentimentsourcelink = $_POST["sentimentsourcelink"];
    //echo $password ."<br>\n";
    $sentimentsourcelinktype = $_POST["sentimentsourcelinktype"];
    if ($sentimentsourcename != '' && $sentimentsourcelink != '' && $sentimentsourcelinktype != '') {
        $sentimentPDO = new SentimentPDO();
        $sentiment = new Sentiment();
        $sentiment->setSentimentSourceName($sentimentsourcename);
        $sentiment->setSentimentSourceLink($sentimentsourcelink);
        $sentiment->setSentimentSourceLinkType($sentimentsourcelinktype);
        $sentimentPDO->insertSentiment($sentiment);
        echo "<html>";
        echo "<head>";
        echo "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' >";
        echo "<link rel='stylesheet' type='text/css' href='menu.css'>";
        echo "<title>News Portal - Insert Sentiment Source</title>";
        echo "</head>";
        echo "<body>";
        include "menu.php";
        echo "Created a Sentiment Source </br>";
        echo "<a href='index.php'> Back to Home</a>";
        echo "</body>";
        echo "</html";
    } else {
        echo "Please fill all of the fields" . "<br>\n";