<?php include "../inc/odbc.php"; ?>
|
<?php include "../inc/function.php"; ?>
|
<?php
|
if (empty($_COOKIE["AdminUserID"])){header("Location: UserAdminlogin.php"); exit;}
|
$AdminUserID = $_COOKIE["AdminUserID"];
|
$AdminOpenid = $_COOKIE["AdminOpenid"];
|
|
$TypeName=empty($_REQUEST['name'])!=false ? "" : addslashes($_REQUEST['name']);
|
$ToUserID=empty($_REQUEST['pk'])!=false ? "" : addslashes($_REQUEST['pk']);
|
$NoteName=empty($_REQUEST['value'])!=false ? "" : addslashes($_REQUEST['value']);
|
|
if ($TypeName=="NoteName") {
|
if (!empty($ToUserID) and !empty($NoteName)) {
|
$sql="select id from UserRecommendNote where ToRUserID=$AdminUserID and ToUserID=$ToUserID";
|
$data = sqlsrv_query($conn,$sql);
|
if($data == true){
|
if (sqlsrv_rows_affected($data)!=0) {
|
while($rs = sqlsrv_fetch_array($data) ) {
|
$sql="update UserRecommendNote set NoteName='".$NoteName."',UpdateTime=getdate() where id=".$rs["id"];
|
$UPsql = sqlsrv_query($conn,$sql);
|
}
|
}else{
|
$sql="insert into UserRecommendNote (ToUserID,ToRUserID,NoteName) values ($ToUserID,$AdminUserID,'".$NoteName."')";
|
$UPsql = sqlsrv_query($conn,$sql);
|
}
|
}
|
}
|
}
|
?>
|