Esempio n. 1
0
<?php

require_once '../../models/Products.php';
if (isset($_POST['id'])) {
    $row = $_POST;
    $response = Products::Update($row);
    if ($response === true) {
        header("Location: index.php");
    }
} else {
    $row = Products::Get($_REQUEST['id']);
}
?>


<!DOCTYPE html>
<html lang="en">
	<?php 
include '../../inc/head.php';
?>
	<body>
		<div>
			<?php 
include '../../inc/nav.php';
?>

			<div id="content">
				
				<?php 
if (isset($response)) {
    ?>
Esempio n. 2
0
     errorinfo($errorInfo, '');
 }
 //echo $where;
 $info = array();
 $info = $products->GetInfo(array('id', 'classid', 'title', 'seotitle', 'seokeyword', 'seointro', 'filename', 'price', 'standard', 'fromlinkurl', 'fromtitle', 'content', 'author', 'addtime', 'clicks', 'linkurl', 'isplay', 'thumb', 'titlecolor'), $where);
 if (empty($info)) {
     $errorInfo = '变量错误';
     errorinfo($errorInfo, '');
 }
 $classid = $info['classid'];
 $classinfo = $products_class->GetInfo(array('id', 'title', 'filename', 'linkurl'), " id = {$classid} ");
 $photoList = array();
 $photoList = $products_photo->GetList(array('id', 'productid', 'thumb'), '', '', " productid = " . $info['id'] . " ", 'orders asc,id desc');
 //点击统计 待添加
 $clicks = $info['clicks'] + 1;
 $products->Update(array('clicks' => $clicks), $where);
 //信息审核
 if ($info['isplay'] == '0') {
     $errorInfo = '该信息未审核';
     errorinfo($errorInfo, '');
 }
 //转连接
 if (!empty($info['linkurl'])) {
     header("Location: " . $info['linkurl'] . "");
     exit;
 }
 $topTitle = $info['title'];
 //seo新增 20120409
 if (!empty($info['seotitle'])) {
     $topTitle = $info['seotitle'];
 }
Esempio n. 3
0
         $addtime = $addtime;
     }
     if (!empty($authortime)) {
         $authortime = $authortime;
     } else {
         $authortime = $authortime;
     }
     if (!empty($filename) && (isset($id) && $filename != $infoold['filename'])) {
         $namea = $products->GetInfo('', " `filename` = '" . $filename . "' ");
         if (!empty($namea)) {
             errorinfo('对不起,自定义name已经使用过了,请更换自定义name', '');
         }
     }
     $info = array('classid' => $classid, 'title' => $title, 'seotitle' => $seotitle, 'seokeyword' => $seokeyword, 'seointro' => $seointro, 'filename' => $filename, 'fromtitle' => $fromtitle, 'fromlinkurl' => $fromlinkurl, 'titlecolor' => $titlecolor, 'thumb' => $thumb, 'intro' => $intro, 'author' => $author, 'content' => $content, 'addtime' => $addtime, 'authortime' => $authortime, 'template' => $template, 'linkurl' => $linkurl, 'price' => $price, 'standard' => $standard, 'clicks' => $clicks, 'isplay' => $isplay, 'ishot' => $ishot, 'istop' => $istop, 'isgood' => $isgood);
     if (isset($id)) {
         if ($products->Update($info, ' id =' . $id)) {
             errorinfo('编辑成功', '');
         } else {
             errorinfo('编辑失败', '');
         }
     } else {
         if ($products->Add($info)) {
             errorinfo('添加成功', '');
         } else {
             errorinfo('添加失败', '');
         }
     }
 } else {
     $info = array();
     $time = time();
     if (isset($id)) {