Esempio n. 1
0
<?php
require_once("plib/head.php");

$cgi = getCGI();
$p_id = $cgi[p_id];
if($p_id == "") sys_exit("参数错误");

conProjDB($p_id);


$p_cname = $proj_data[p_cname];
$nav_str .= " &gt; <a href=templist.php?p_id=$p_id >$p_cname</a> &gt; 新建模板";

if($cgi[edit] != "" && $cgi[cname] != "")
{
	if($cgi[grade] == "") $cgi[grade] = "3";
	if($cgi[showorder] == "") $cgi[showorder] = "0";

        $sqlstr = sprintf("insert into temp set cname='%s',  grade=%s, showorder=%s, ttype='%s', createdt=now()", mysql_escape_string($cgi[cname]), $cgi[grade], $cgi[showorder], $cgi[ttype]);
	$res = mysql_query($sqlstr, $proj_mysql) or sys_exit("系统忙, 请稍候再试。", $sqlstr . ":\n" . mysql_error());

        $t_id=mysql_insert_id($proj_mysql);

	if($cgi[t_name] == "")
	{
		$table_name = sprintf("sp_t%d", $t_id);
	}
	else
	{
		$table_name = $cgi[t_name];
	}
Esempio n. 2
0
<?php

require_once "plib/config_inc.php";
$html_charset = HTML_CHARSET;
header("Content-type: text/html; charset={$html_charset}");
require_once "plib/head.php";
$cgi = getCGI();
$p_id = $cgi[p_id];
$t_id = $cgi[t_id];
if ($p_id == "" || $t_id == "") {
    sys_exit("参数错误");
}
conProjDB($p_id, $t_id);
$i = 0;
foreach ($tempdef_data as $kk => $row) {
    if ($row[t_id] != $t_id) {
        continue;
    }
    if ($row[if_into_db] != "y") {
        continue;
    }
    $sel_list .= "<option value=\"{$row['cname']}\">{$row['cname']}</option>";
}
?>


<select name=cond_type>
<option value="and">并且
<option value="or">或者
</select>
Esempio n. 3
0
$sqlstr = "select * from pub_queue order by p_id asc, t_id asc, id asc";
$res = mysql_query($sqlstr, $pub_mysql) or exit(mysql_error($pub_mysql) . "\n" . $sqlstr);
$pub_data = array();
while($row = mysql_fetch_array($res))
{
	$pub_data[] = $row;
	$sqlstr = "delete from pub_queue where id=$row[id]";
	$res1 = mysql_query($sqlstr, $pub_mysql) or exit(mysql_error($pub_mysql) . "\n" . $sqlstr);
}

foreach($pub_data as $row)
{
	if($p_id != $row[p_id] || $t_id != $row[t_id])
	{
		conProjDB($row[p_id], $row[t_id]);
	}

	$id   = $row[id];
	$p_id = $row[p_id];
	$t_id = $row[t_id];
	$d_id = $row[d_id];

	print "\n\n\n\np_id:$p_id, t_id:$t_id, d_id:$d_id\n";

	if($d_id == 0)
	{
		if( AddDoc($p_id, $t_id) < 0) printf("添加文档失败: %s<br>\n", $error_message);
	}
	else
	{