Esempio n. 1
0
<?php

header("Content-Type:text/html;charset=UTF-8");
include "../../../system.php";
include "../../system.php";
include "../../../gd.php";
include "../../../function/new_function.php";
include "cp_unit.php";
//System-----------------------------------------------------------
$now_table = $pro_color_relate_table;
//System-----------------------------------------------------------
$sam = new guard();
$unit = new pcolor();
$img = new img_uploader();
$upid = $_GET['upid'];
$cid = $_GET['cid'];
$sql = "select * from `{$pro_color_table}` where id='{$cid}'";
$res = mysql_query($sql);
$row = mysql_fetch_array($res);
$name = $row['name'];
$sql = "select * from `{$now_table}` where `upid`='{$upid}' and `cid`='{$cid}'";
$res = mysql_query($sql);
$now = mysql_num_rows($res);
if ($now == 0) {
    //Images UPLOAD------------------------------------------------------------
    $error = "";
    $msg = "";
    $fileElementName = 'colorUpload';
    if (!empty($_FILES[$fileElementName]['error'])) {
        switch ($_FILES[$fileElementName]['error']) {
            case '1':
Esempio n. 2
0
<?php

if ($_POST['submit']) {
    $unit = new product_class();
    $tool = new My_Tool();
    $sam = new guard();
    //檢查傳入值--------------------------
    $name = htmlspecialchars(trim($_POST['name']));
    if (empty($name)) {
        $tool->error(get_msg("name_error"));
    } else {
        $name = $sam->var_check($name);
    }
    $unit->table = $pro_class_table;
    $unit->get_vars();
    $buff = array();
    $unit->get_history($unit->upid, $buff);
    $unit->add();
    $tool->show(get_msg("add_success"), $_SERVER['HTTP_REFERER']);
    exit;
}
?>
			 
    <form method="post" action="">
	<input type="hidden" name="upid" value="<?php 
print $_GET['id'];
?>
" />
	類別名稱:<input type="text" name="name" size="20" />
	排序:   <input type="text" name="no" value="100" />
	<input type="submit" name="submit" value="新增類別" />
header("Content-Type:text/html;charset=UTF-8");
include "../../session.php";
// 外掛 session 檢查功能
include "../../system.php";
//總體設定
include "../../function/new_function.php";
//函數庫
include "../system.php";
//程式個別設定
include "../class_unit.php";
//分類unit
include "../product_unit.php";
//分類unit
include "../../gd.php";
$tool = new My_Tool();
$sam = new guard();
$unit = new product_class();
$unit2 = new product();
$check = $_POST['check'];
//處理圖檔上傳---------------------------
if ($_FILES['upload']['size'] > 0) {
    if (!$sam->image_check($_FILES['upload']['type'], $pic_jpg, $pic_gif, $pic_png)) {
        $tool->error("圖片檔案格式有誤!");
    }
    $img = new img_uploader();
    $img->set_path($_FILES['upload']);
    //置入路徑
    $img->set_width($pic_width);
    //決定縮圖大小,大圖大小
    $img->set_savepath("../images/" . date("Y-m-d"));
    //設定儲存路徑
<?php

header("Content-Type:text/html;charset=UTF-8");
include "../../session.php";
// 外掛 session 檢查功能
include "../../system.php";
include "../../function/new_function.php";
include "../../gd.php";
//引入函數,資料庫
include "../system.php";
//系統植
include "../product_unit.php";
//產品項目類別
//宣告tool物件
$tool = new My_Tool();
$sam = new guard();
$unit = new product();
$unit->table = $product_table;
//設定資料表
//宣告完畢
//取得需檢查的資料-----------------------
$id = $_POST['id'];
$upid = $_POST['upid'];
$check = $_POST['check'];
//取得完畢---------------------------
//開始檢查---------------------------
if ($pro_class_set == 1) {
    if (empty($upid) and ($check == "add" or $check == "upd")) {
        $tool->error("未選擇類別!");
    }
}
Esempio n. 5
0
header("Content-Type:text/html;charset=UTF-8");
include "../../session.php";
// 外掛 session 檢查功能
include "../../system.php";
include "../../gd.php";
include "../../function/new_function.php";
//引入函數.資料庫檔
include "../system.php";
//System--------------------------------------------------------------------
$now_table = $pro_sys_table;
//System--------------------------------------------------------------------
//更新資料BEGIN--------------------------------------------------------------
if (isset($_POST['submit'])) {
    $tool = new My_Tool();
    $sam = new guard();
    //數值區檢查--------------------------------
    if ($_POST['pic_quality'] <= 0) {
        $tool->error("圖片品質不可為0或小於0!");
    }
    if ($_POST['pic_width'] <= 0 or $_POST['pic_width_small'] <= 0) {
        $tool->error("圖片上傳寬度不可為0或小於0!");
    }
    if ($_POST['pic_max_size'] <= 0) {
        $tool->error("圖片檔案大小限制不可為0或小於0!");
    }
    if ($_POST['pic_bg_w'] <= 0) {
        $tool->error("圖片外框寬度不可為0或小於0!");
    }
    if ($_POST['pic_bg_h'] <= 0) {
        $tool->error("圖片外框高度不可為0或小於0!");