Exemple #1
0
<?php

if (isset($_GET["id"])) {
    $id = $_GET["id"];
}
$tbl = new table('baiviet');
if (isset($_POST["done"])) {
    if (test_isset1('baiviet', 'alias', $_POST['name'], $id) == 0) {
        $field = array('catid', 'name', 'image', 'details', 'ordering', 'alias');
        $img = edit_img('../', 'uploads/category/', 'baiviet', 'image', $_POST['tmpimage'], $id, 52, 42);
        $values = array(format($_POST["catid"], 0), format($_POST["name"], 0), format($img, 0), format($_POST["details"], 0), format($_POST['ordering'], 0), format(convert($_POST["name"]), 0));
        // updateObject($field=array(),$value=array(),$where)
        $res = $tbl->updateObject($field, $values, 'id=' . $id);
        if ($res) {
            header('location: ' . loadPage('baiviet'));
        }
    } else {
        echo "Lỗi trùng tên. Vui lòng nhập tên khác.";
    }
}
$res = $tbl->loadOne('id=' . $id);
if ($res) {
    $row = mysql_fetch_array($res);
    $thumb_img = get_thumb('uploads/category/', $row['image']);
    ?>
<div id="center-column">
			<div class="top-bar">
			  <h1>Bài viết</h1>
				<div class="breadcrumbs"><a href="<?php 
    echo loadPage('baiviet');
    ?>
Exemple #2
0
<?php

if (isset($_GET["id"])) {
    $id = $_GET["id"];
}
$tbl = new table('chuyenmuc');
if (isset($_POST["done"])) {
    if (test_isset1('chuyenmuc', 'alias', $_POST['name'], $id) == 0) {
        $field = array('name', 'image', 'ordering', 'alias');
        $img = edit_img('../', 'uploads/chuyenmuc/', 'chuyenmuc', 'image', $_POST['tmpimage'], $id, 30, 30);
        $values = array(format($_POST["name"], 0), format($img, 0), format($_POST['ordering'], 0), format(convert($_POST["name"]), 0));
        // updateObject($field=array(),$value=array(),$where)
        $res = $tbl->updateObject($field, $values, 'id=' . $id);
        if ($res) {
            header('location: ' . loadPage('chuyenmuc'));
        }
    } else {
        echo "Lỗi trùng tên. Vui lòng nhập tên khác.";
    }
}
$res = $tbl->loadOne('id=' . $id);
if ($res) {
    $row = mysql_fetch_array($res);
    $thumb_img = get_thumb('uploads/chuyenmuc/', $row['image']);
    ?>
<div id="center-column">
			<div class="top-bar">
			  <h1>Chuyên mục riêng</h1>
				<div class="breadcrumbs"><a href="<?php 
    echo loadPage('chuyenmuc');
    ?>
Exemple #3
0
<?php

if (isset($_GET['id'])) {
    $id = $_GET["id"];
}
$tbl = new table('img');
if (isset($_POST["done"])) {
    // get field
    $field = array('proid', 'name', 'image');
    $img = edit_img('../', 'Images/Products/', 'img', 'image', $_POST['tmpimage'], $id, 50, 50);
    $values = array(format($_POST["proid"], 0), format($_POST["name"], 0), format($img, 0));
    $res = $tbl->updateObject($field, $values, 'id=' . $id);
    if ($res) {
        echo "OK";
    }
}
$res = $tbl->loadOne('id=' . $id);
if ($res) {
    $row = mysql_fetch_array($res);
    $proid = $row['proid'];
    $thumb_img = get_thumb('Images/Products/', $row['image']);
    ?>
<div id="center-column">
			<div class="top-bar">
            	<a href="<?php 
    echo loadPage('addimg') . "&proid=" . $proid;
    ?>
"  class="button"><img src="img/add-folder-icon.png" width="30" height="30" border="0" />  </a>
			  <h1>Kích thước & Giá</h1>
			  <div class="breadcrumbs"><a href="#">Sửa</a></div>
  </div><br />
Exemple #4
0
<?php

if (isset($_GET['id'])) {
    $id = $_GET["id"];
}
$tbl = new table('category2');
if (isset($_POST["done"])) {
    /*if(test_isset2('category2','alias',$_POST["catid"],$_POST['name'])==0)
    		{	*/
    // get field
    $field = array('catid', 'name', 'image', 'ordering', 'alias');
    $img = edit_img('../', 'Images/Category2/', 'category2', 'image', $_POST['tmpimage'], $id, 22, 22);
    $values = array(format($_POST["catid"], 0), format($_POST["name"], 0), format($img, 0), format($_POST['ordering'], 0), format(convert($_POST["name"]), 0));
    $res = $tbl->updateObject($field, $values, 'id=' . $id);
    if ($res) {
        header('location: ' . loadPage('category2'));
    }
    /*}
    		else
    			echo "Lỗi trùng tên. Vui lòng nhập tên khác.";*/
}
$res = $tbl->loadOne('id=' . $id);
if ($res) {
    $row = mysql_fetch_array($res);
    $thumb_img = get_thumb('Images/Category2/', $row['image']);
    ?>
<div id="center-column">
			<div class="top-bar">
			  <h1>Danh mục 2</h1>
				<div class="breadcrumbs"><a href="<?php 
    loadPage('category2');
Exemple #5
0
<?php

if (isset($_GET["id"])) {
    $id = $_GET["id"];
}
$tbl = new table('category_bv');
if (isset($_POST["done"])) {
    if (test_isset1('category_bv', 'alias', $_POST['name'], $id) == 0) {
        $field = array('name', 'image', 'details', 'display', 'ordering', 'alias');
        $img = edit_img('../', 'Images/Category_bv/', 'category_bv', 'image', $_POST['tmpimage'], $id, 231, 49);
        $values = array(format($_POST["name"], 0), format($img, 0), format($_POST["details"], 0), format($_POST["detailsDisplay"], 0), format($_POST['ordering'], 0), format(convert($_POST["name"]), 0));
        // updateObject($field=array(),$value=array(),$where)
        $res = $tbl->updateObject($field, $values, 'id=' . $id);
        if ($res) {
            header('location: ' . loadPage('category_bv'));
        }
    } else {
        echo "Lỗi trùng tên. Vui lòng nhập tên khác.";
    }
}
$res = $tbl->loadOne('id=' . $id);
if ($res) {
    $row = mysql_fetch_array($res);
    //var_dump($row);
    $thumb_img = get_thumb('Images/Category_bv/', $row['image']);
    ?>
<div id="center-column">
			<div class="top-bar">
			  <h1>Danh mục bài viết</h1>
				<div class="breadcrumbs"><a href="<?php 
    echo loadPage('category_bv');
Exemple #6
0
<?php

if (isset($_GET["id"])) {
    $id = $_GET["id"];
}
$tbl = new table('nsx');
if (isset($_POST["done"])) {
    if (test_isset1('nsx', 'alias', $_POST['name'], $id) == 0) {
        $field = array('name', 'image', 'ordering', 'alias');
        $img = edit_img('../', 'Images/Brand/', 'nsx', 'image', $_POST['tmpimage'], $id, 180, 84);
        $values = array(format($_POST["name"], 0), format($img, 0), format($_POST['ordering'], 0), format(convert($_POST["name"]), 0));
        // updateObject($field=array(),$value=array(),$where)
        $res = $tbl->updateObject($field, $values, 'id=' . $id);
        if ($res) {
            header('location: ' . loadPage('nsx'));
        }
    } else {
        echo "Lỗi trùng tên. Vui lòng nhập tên khác.";
    }
}
$res = $tbl->loadOne('id=' . $id);
if ($res) {
    $row = mysql_fetch_array($res);
    $thumb_img = get_thumb('../Images/Brand/', $row['image']);
    ?>
<div id="center-column">
			<div class="top-bar">
			  <h1>Thương hiệu nổi tiếng</h1>
				<div class="breadcrumbs"><a href="<?php 
    echo loadPage('nsx');
    ?>
Exemple #7
0
<?php

if (isset($_GET['id'])) {
    $id = $_GET["id"];
}
$tbl = new table('news');
if (isset($_POST["done"])) {
    $field = array('catid', 'name', 'details', 'image', 'hot', 'date_add', 'alias', 'url');
    $img = edit_img('../', 'Images/News/', 'news', 'image', $_POST['tmpimage'], $id, 250, 163);
    $values = array(format($_POST["catid"], 0), format($_POST["name"], 0), format($_POST["details"], 0), format($img, 0), format(isCheck(isset($_POST["hot"])), 0), format(strtotime(date('H:i:s ') . $_POST["date_add"]), 0), format(rand_name($_POST["name"], $id), 0), format($_POST["url"], 0));
    // insertObject($field,$value)
    $res = $tbl->updateObject($field, $values, 'id=' . $id);
    if ($res) {
        header('location: ' . loadPage('news'));
    }
}
$res = $tbl->loadOne('id=' . $id);
if ($res) {
    $row = mysql_fetch_array($res);
    $thumb_img = get_thumb('Images/News/', $row['image']);
    ?>
<div id="center-column">
			<div class="top-bar">
			  <h1>Tin tức</h1>
			  <div class="breadcrumbs"><a href="<?php 
    echo loadPage('news');
    ?>
">Tin tức</a> / <a href="#">Sửa</a></div>
			</div><br />