PHP语言 -- 发起流程

Main.php

<body>
<a href = "xinjian.php">新建流程</a>
<a href = "faqi.php">发起流程</a>
<a href = "chuli.php">处理流程</a>
</body>

faqi.php

<body>

<h1>发起流程</h1>

<div>
请选择要发起的流程:
<select id="lc">

<?php
include "DBDA.php";

$db =new DBDA();

$sql ="select * from LiuCheng";

$attr = $db->Query($sql);

foreach($attr as $v)
{
echo "<option value='{$v[0]}'>{$v[1]}</option>";
}
?>

</select>
</div>
<div>
请输入要发起的内容:
<textarea id ="nr"></textarea>
</div>
<div><input type="button" value="发起" id="fq" /></div>
</body>
<script type="text/javascript">
$(document).ready(function(e){

$("#fq").click(function(){

var lc = $("#lc").val();
var nr = $("#nr").val();

$.ajax({

url:"fqchuli.php",
data:{lc:lc,nr:nr},
type:"POST",
dataType:"TEXT",
success:function(data){

alert $data; } }); }) });
</script>

fqchuli.php

<?php
session_start();

$code = $_POST["lc"];

$nr= $_POST["nr"];

include "DBDA.php";

$uid = $_SESSION["uid"];

$rq = date("Y-m-d H:i:s",time());

$sql ="insert into UserFlow 
values('','{$code}','{$uid}','{$nr}','false','{$rq}',0)";

if($db->Query($sql,0))
{
echo "发起成功";
}
else
{
echo "发起失败";
}

 

posted on 2016-05-13 14:02  一方通行o  阅读(147)  评论(0编辑  收藏  举报

导航