Esempio n. 1
0
<?php

include "../../../system.php";
include "../../system.php";
include "../../../function/new_function.php";
include "ps_unit.php";
//System-----------------------------------------------------------
$now_table = $pro_size_relate_table;
//System-----------------------------------------------------------
$tool = new My_Tool();
$sam = new guard();
$unit = new psize();
$upid = $_POST['upid'];
$sid = $_POST['sid'];
$sql = "select * from `{$pro_size_table}` where `id`='{$sid}'";
$res = mysql_query($sql);
$row = mysql_fetch_array($res);
$name = $row['name'];
$sql = "select * from `{$now_table}` where `upid`='{$upid}' and `sid`='{$sid}'";
$res = mysql_query($sql);
if (mysql_num_rows($res) == 0) {
    if (!empty($sid)) {
        $unit->table = $now_table;
        $unit->upid = $upid;
        $unit->name = $name;
        $unit->sid = $sid;
        $unit->add();
    }
}