コード例 #1
0
ファイル: leftIndex.php プロジェクト: laiello/site-web-php
	<div class="captions">
		<h2>
			<?php 
echo $page_title;
?>
		</h2>
	</div>
	<img src="images/banner.jpg" alt="" />
</div>
<div id="main">

	<?php 
include_once "control/ArticleControls.php";
?>
	<?php 
$object = new ArticleControls();
$navigation = new navigationControls();
?>
	<div id="sidebar">
		<div class="box">
			<h3>Derniers articles</h3>
			<div class="dateList">
				<?php 
$list = $object->getFiveLast();
if ($list != null) {
    ?>
				<ul class="linkedList dateList">
					<?php 
    foreach ($list as $article_current) {
        echo '<li class="first"><span class="date">' . ($ret = $object->dateReducted($article_current->News_date) . '</span><a href="news.php?art_id=' . $article_current->News_id . '">' . $article_current->News_title . '</a></li>');
        ?>
コード例 #2
0
ファイル: index.php プロジェクト: laiello/site-web-php
<?php 
$title = "index";
$keywords = "Computer science, Architecture, Java, Linux";
$description = "Website of computer sciences news and articles";
include "header.php";
$page_title = "C là qu'on parle aussi bien des Pythons que des Perl";
include "control/ArticleControls.php";
$object = new ArticleControls();
$navigation = new navigationControls();
?>


<div id="banner">
	<div class="captions">
		<h2>
			<?php 
echo $page_title;
?>
		</h2>
	</div>
	<img src="images/banner.jpg" alt="" />
</div>
<div id="main">


	<div class="box">
		
			<?php 
$list = $object->getFiveLast();
foreach ($list as $article) {
コード例 #3
0
<?php

include_once 'data/CategoryDAO.php';
include_once 'control/ArticleControls.php';
include_once 'business/Article.php';
$categoryDao = new CategoryDao();
$articleController = new ArticleControls();
$article = new Article();
$article->setName($_POST['title']);
$article->setId(intval($_POST['id']));
$article->setContent($_POST['editor']);
$article->setSumup($_POST['sumup_editor']);
$article->setTags($_POST['tags']);
$ret = $articleController->alterArticle($article);
if ($ret) {
    header("location:../news.php?art_id=" . $_POST['id']);
} else {
    echo "Unexpected exception";
}
コード例 #4
0
ファイル: addNews.php プロジェクト: laiello/site-web-php
<?php

include_once 'business/Article.php';
include 'control/ArticleControls.php';
include_once 'business/Comment.php';
$article = new Article();
$control = new ArticleControls();
$article->setTitle($_POST['title']);
$article->setContent($_POST['category']);
// $article->setUser_name($_POST['name']);
// $article->setNews_id($_POST['id']);
// $article->setIp($_POST['ip']);
if ($control->addMail($article)) {
    header("location:../news.php?art_id=" . $_POST['id']);
} else {
    echo "La requête n'a pu être exécutée";
}
コード例 #5
0
ファイル: uploadImages.php プロジェクト: laiello/site-web-php
?>

		
<?php 
include "leftIndex.php";
?>

<?php 
include "listener/checkConnect.php";
?>

<div class="box">
	<h2>Admin console</h2>

<?php 
$articleController = new ArticleControls();
?>
	<?php 
include "buttonAdmin.php";
?>

	<form method="post" action="listener/upload.php"
		enctype="multipart/form-data">
		 <label
			for="file">Fichier (tous formats | max. 1 Mo) :</label><br /> <input
			type="hidden" name="MAX_FILE_SIZE" value="1048576" /> <input
			type="file" name="file" id="mon_fichier" /><br /> <label
			for="titre">Name (max. 50 char) :</label><br /> <input
			type="text" name="title" value="Name"  /><br />
		<input type="submit" name="submit" value="Envoyer" />
	</form>
コード例 #6
0
ファイル: adminConsole.php プロジェクト: laiello/site-web-php
<script src="../script/ckeditor/ckeditor.js"></script>

<?php 
include "leftIndex.php";
?>

<?php 
include "listener/checkConnect.php";
?>


<div class="box">
	<h2>Admin console</h2>

	<?php 
$articleController = new ArticleControls();
?>

	<?php 
include "buttonAdmin.php";
?>

	<div class="box">
		<h3>Poster une nouvelle news:</h3>
		<form METHOD="POST" action="listener/postArticle.php">
			Categorie:
			<!--  <select id="categorie">  -->
			<input type=text list=categories name="category">
			<datalist id=categories>
				<?php 
foreach ($articleController->getCategories() as $value) {
コード例 #7
0
ファイル: pageConnect.php プロジェクト: laiello/site-web-php
<?php 
$title = "Connection";
$keywords = "Computer science, Architecture, Java, Linux";
$description = "Website of computer sciences news and articles";
include "header.php";
$page_title = "C là qu'on parle aussi bien des Pythons que des Perl";
?>


<?php 
include "leftIndex.php";
?>

<?php 
include_once "control/ArticleControls.php";
$firstArticle = new ArticleControls();
$firstArticle->print_Article();
?>
										<div class="box">
						<h2>
							<?php 
echo $firstArticle->getArticle()->News_title;
?>
						</h2>
						<img src="images/pic01.jpg" width="150" height="150" alt="" class="left" />
						<p>
						<?php 
echo $firstArticle->getArticle()->News_content;
?>
							
	
コード例 #8
0
ファイル: validComment.php プロジェクト: laiello/site-web-php
<?php

include_once 'data/CategoryDAO.php';
include_once 'control/ArticleControls.php';
include_once 'business/Article.php';
// session_start();
$articleController = new ArticleControls();
$ret;
$allUncheckedComment = $articleController->getAllUncheckedComments();
if ($allUncheckedComment != null) {
    $articleId = "";
    foreach ($allUncheckedComment as $comment) {
        $article;
        $articleId = "valid_" . $comment->comment_id . "";
        if (isset($_POST[$articleId])) {
            $ret = $articleController->validComments($comment->comment_id);
        }
    }
    $articleController->removeAllUncheckedComments();
}
if ($ret) {
    header("location:../validComments.php");
} else {
    echo "Unexpected exception";
}
コード例 #9
0
$title = "Recherche";
$keywords = "Computer science, Architecture, Java, Linux";
$description = "News and Discutions about Computer science";
include "header.php";
$page_title = "C là qu'on parle aussi bien des Pythons que des Perl";
include "leftIndex.php";
include_once "control/ArticleControls.php";
?>

<div class="box">
	<h2>Resultats</h2>
	<p>
		<?php 
$criteria = $_GET["search"];
$object = new ArticleControls();
$list = $object->getArticlesMatchingSearch($criteria);
if ($list) {
    echo "<ul>";
    foreach ($list as $article) {
        echo '<li><a href="news.php?art_id=' . $article->News_id . '">' . $article->News_title . '</a></li><br/>';
        echo '<p>' . $article->News_sumup . '</p><br/>';
    }
    echo "<li></li></ul>";
} else {
    ?>
	
	
	<h3>Pas d'article correspondant</h3>

	<?php 
コード例 #10
0
ファイル: news.php プロジェクト: laiello/site-web-php
<?php

include_once "control/ArticleControls.php";
$id = $_GET["art_id"];
$object = new ArticleControls();
$article = $object->getArticleById($id);
?>

<?php 
$title = $article->News_title;
$keywords = $article->News_tag;
$description = $article->News_sumup;
?>

<?php 
include "header.php";
$page_title = "C là qu'on parle aussi bien des Pythons que des Perl";
?>

<script src="http://yandex.st/highlightjs/8.0/highlight.min.js"></script>

<script>
$(document).ready(function(){
	$(':input[name="delete"]').click(function(){
		 $(function() {
			 $( "#dialog-confirm" ).removeClass("dialog-hide");
			 $( "#dialog-confirm" ).dialog({
			 resizable: true,
			 height:200,
			 width: 486,
			 modal: true,
コード例 #11
0
ファイル: addComment.php プロジェクト: laiello/site-web-php
<?php

include 'control/ArticleControls.php';
include_once 'business/Comment.php';
$comment = new Comment();
$control = new ArticleControls();
$comment->setTitle($_POST['title']);
$comment->setContent($_POST['content']);
$comment->setUser_name($_POST['name']);
$comment->setNews_id($_POST['id']);
$comment->setIp($_POST['ip']);
if ($control->addComment($comment)) {
    header("location:../news.php?art_id=" . $_POST['id']);
} else {
    echo "La requête n'a pu être exécutée";
}
コード例 #12
0
ファイル: category.php プロジェクト: laiello/site-web-php
		
<?php 
include "leftIndex.php";
include_once "control/ArticleControls.php";
$cat_id = $_GET["cat_id"];
?>
			
					<div class="box">
						<h2>
							Liste des articles
						</h2>
						<img src="images/News.jpg" width="150" height="150" alt="" class="left" />
						<p>
							<?php 
$object = new ArticleControls();
$list = $object->print_Article($cat_id);
if ($list) {
    echo "<ul>";
    foreach ($list as $article) {
        echo '<li><a href="news.php?art_id=' . $article->News_id . '">' . $article->News_title . '</a></li><br/>';
        echo '<p>' . $article->News_sumup . '</p><br/>';
    }
    echo "<li></li></ul>";
} else {
    ?>
								<h3>
								Pas encore d'article dans cette section
								</h3>
								
							<?php 
コード例 #13
0
ファイル: postArticle.php プロジェクト: laiello/site-web-php
<?php

include_once 'data/CategoryDAO.php';
include_once 'control/ArticleControls.php';
include_once 'business/Article.php';
if (session_status() == PHP_SESSION_NONE) {
    session_start();
}
$categoryDao = new CategoryDao();
$articleController = new ArticleControls();
var_dump($_POST['category']);
$categoryId = $categoryDao->getIdForName($_POST['category']);
$article = new Article();
$article->setName($_POST['title']);
$article->setContent($_POST['editor']);
$article->setSumup($_POST['sumup_editor']);
$article->setCategory($categoryId);
$article->setAuthor($_SESSION['USR']);
$article->setTags($_POST['tags']);
$ret = $articleController->submitNewArticle($article);
if ($ret) {
    header("location:../adminConsole.php");
} else {
    echo "Unexpected exception";
}
コード例 #14
0
<?php

include_once 'control/ArticleControls.php';
$articleController = new ArticleControls();
$ret = $articleController->deleteArticle(intval($_POST['id']));
if ($ret) {
    header("location:../adminConsole.php");
} else {
    echo "Unexpected exception";
}
コード例 #15
0
<?php 
include "leftIndex.php";
?>


<?php 
include "listener/checkConnect.php";
?>

<div class="box">
	<h2>Admin console</h2>
	<!-- <img src="images/console.png" width="150" height="150" alt=""
		class="left" /> -->

	<?php 
$articleController = new ArticleControls();
?>

	<?php 
include "buttonAdmin.php";
?>
	<div class="box">
		<h3>Commentaires à valider:</h3>

		<?php 
$allUncheckedComment = $articleController->getAllUncheckedComments();
?>
		<form METHOD="POST" action='listener/validComment.php'>
			<?php 
$articleController->printUnvalidComment($allUncheckedComment);
?>
コード例 #16
0
ファイル: deleteImage.php プロジェクト: laiello/site-web-php
<?php

include_once 'control/ArticleControls.php';
ArticleControls::deleteImg();
header("location:../uploadImages.php");