Exemple #1
0
<?php

$tbl = new table('chuyenmuc');
if (isset($_POST["done"])) {
    if (test_isset1('chuyenmuc', 'alias', $_POST['name']) == 0) {
        $field = 'id,name,image,ordering,alias';
        $str_img = upload_img('image', '../uploads/chuyenmuc/', 30, 30);
        // values
        // format($str,$isComma=1)
        // isCheck($check)
        $values = format($tbl->getLastId() + 1, 1);
        $values .= format($_POST["name"], 1);
        $values .= format(str_replace('../', '', $str_img), 1);
        $values .= format($_POST['ordering'], 1);
        $values .= format(convert($_POST["name"]), 0);
        // insertObject($field,$value)
        $res = $tbl->insertObject($field, $values);
        if ($res) {
            echo "OK";
        }
    } else {
        echo "Lỗi trùng tên. Vui lòng nhập tên khác.";
    }
}
?>
<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 #2
0
<?php

$tbl = new table('products');
if (isset($_POST["done"])) {
    if (test_isset1('products', 'mavach', $_POST['mavach']) == 0) {
        // get field
        $field = 'id,catid1,catid2,catid3,chuyenmucid,name,mavach,ghichu,nsx,status,image,color,
			details,new,promo,typical,featured,liked,chobe,chome,chogiadinh,huongdan,url,alias';
        // upload file
        // uploadFile($file,$auto=1,$dir='uploads/images/')
        $str_img = add_multi_img('../Images/Products/', $_POST['num_img'], 'image', 80, 75);
        if (!is_numeric($_POST['num_color']) || $_POST['num_color'] == 0) {
            $color = '';
        } else {
            $dem = 0;
            for ($i = 0; $i < $_POST['num_color']; $i++) {
                $colorname = $_POST['color' . $i];
                if ($colorname != '') {
                    $cuoi = '';
                    $dem++;
                    if ($dem != 1) {
                        $cuoi = '-';
                    }
                    $color .= $cuoi . $colorname;
                }
            }
        }
        /*if(!is_numeric($_POST['num_size']) || $_POST['num_size']==0)
        			$size='';
        		else{
        			$dem=0;
Exemple #3
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 #4
0
<?php

$tbl = new table('pages');
if (isset($_POST["done"])) {
    if (test_isset1('pages', 'alias', $_POST['name']) == 0) {
        $field = 'id,name,details,alias';
        // vn
        $id = $tbl->getLastId() + 1;
        $values = format($id, 1);
        $values .= format($_POST["name"], 1);
        $values .= format($_POST["details"], 1);
        $values .= format(convert($_POST["name"]), 0);
        $res = $tbl->insertObject($field, $values);
        if ($res) {
            echo "OK!";
        }
    } else {
        echo "Lỗi trùng tên. Vui lòng nhập tên khác.";
    }
}
?>
<div id="center-column">
			<div class="top-bar">
			  <h1>Pages</h1>
				<div class="breadcrumbs"><a href="#">Content</a> / <a href="#">Thêm</a></div>
			</div><br />
 
		  
		  
			<div class="table">
				<img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
Exemple #5
0
<?php

$tbl = new table('promotion');
if (isset($_POST["done"])) {
    if (test_isset1('promotion', 'name', $_POST['name']) == 0) {
        $field = 'id,name,url,image';
        $str_img = upload_img('image', '../Images/Promotion/', 22, 22);
        // values
        $values = format($tbl->getLastId() + 1, 1);
        $values .= format($_POST["name"], 1);
        $values .= format($_POST['url'], 1);
        $values .= format(str_replace('../', '', $str_img), 0);
        // insertObject($field,$value)
        $res = $tbl->insertObject($field, $values);
        if ($res) {
            echo "OK";
        }
    } else {
        echo "Lỗi trùng tên. Vui lòng nhập tên khác.";
    }
}
?>
<div id="center-column">
			<div class="top-bar">
			  <h1>Thông tin khuyến mãi</h1>
				<div class="breadcrumbs"><a href="<?php 
loadPage('promotion');
?>
">Thông tin khuyến mãi</a> / <a href="#">Thêm</a></div>
			</div><br />
 
Exemple #6
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 #7
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 #8
0
<?php

$tbl = new table('category1');
if (isset($_POST["done"])) {
    if (test_isset1('category1', 'alias', $_POST['name']) == 0) {
        $field = 'id,name,ordering,alias';
        // values
        $values = format($tbl->getLastId() + 1, 1);
        $values .= format($_POST["name"], 1);
        $values .= format($_POST['ordering'], 1);
        $values .= format(convert($_POST["name"]), 0);
        // insertObject($field,$value)
        $res = $tbl->insertObject($field, $values);
        if ($res) {
            echo "OK";
        }
    } else {
        echo "Lỗi trùng tên. Vui lòng nhập tên khác.";
    }
}
?>
<div id="center-column">
			<div class="top-bar">
			  <h1>Danh mục 1</h1>
				<div class="breadcrumbs"><a href="<?php 
loadPage('category1');
?>
">Danh mục 1</a> / <a href="#">Thêm</a></div>
			</div><br />