Пример #1
0
<?php

include_once 'database.php';
$id = $_GET['id'];
if (isset($_POST['add_news'])) {
    if (isset($_POST['newstype']) && isset($_POST['title']) && isset($_POST['info'])) {
        $id = $_GET['id'];
        $type = $_POST['newstype'];
        $title = $_POST['title'];
        $info = $_POST['info'];
        $link = $_POST['link'];
        editnews($id, $type, $title, $info, $link);
        header("Location:index.php?page=news");
    }
}
$n = getnews($id);
?>

<html>
<head><title>PH directory - Add news</title></head>
<body>
	<h2>Edit News</h2>
	<form method="post" class="form-horizontal">
		<div class="form-group">
			<label id="form-label">News no. <?php 
echo $id;
?>
</label><br>
			<label id="form-label">Type</label>
			<select name="newstype" class="form-control" required>
				<?php 
Пример #2
0
<?php

//addnews($titrfr,$titren,$titrar,$contfr,$conten,$contar,$img,$id,$autfr,$auten,$autar,$slider)
if (tp('verif') == 1) {
    model::load('news', 'editnews');
    if (!editnews(tp('titrfr'), tp('titren'), tp('titrar'), tp('contfr'), tp('conten'), tp('contar'), tp('photoid'), tp('id'), tp('autfr'), tp('auten'), tp('autar'), tp('slider'), tp('dat'), tp('vod'), tp('idvod'))) {
        exit("0");
    } else {
        exit("1");
    }
} else {
    view::load('news', 'editnews');
}
Пример #3
0
function internal_newsDispatch($op)
{
    if (isset($_POST['undo'])) {
        $op = 'news';
    }
    switch ($op) {
        case "news":
            news();
            break;
        case "addnews":
            editnews();
            break;
        case "editviewer":
            editviewer();
            break;
        case "modnews":
            editnews(true);
            break;
        case "savenews":
            savenews();
            break;
        case "delnews":
            delnews();
            break;
    }
}
Пример #4
0

<?php 
include "conntube.php";
$action = $_REQUEST['action'];
//global $entity;
$newsidlist = array();
switch ($action) {
    case 'addnews':
        addnews();
        break;
    case 'deletenews':
        deletenews();
        break;
    case 'editnews':
        editnews();
        break;
    default:
        echo 'Just one more step!';
        break;
}
?>
	
<?php 
function addnews()
{
    global $record_path;
    if (isset($_POST['title'])) {
        $Title = $_POST['title'];
    }
    if (isset($_POST['description'])) {