<?php

/*
'**************************************************************************************************
' 程序名称: CCTVAI开源音乐管理系统
' 官方网站: http://www.cctvai.com
' 联系 Q Q: 1542367792
' QQ交流群：136687984
' 版本：(终结版)
' 备注：未经书面授权，不得向任何第三方提供本软件系统！
' 功能，模板，插件，扩展，定制请联系QQ：1542367792
'**************************************************************************************************
*/
error_reporting(0);
include "../../include/cctvai.conn.php";
include "../function_common.php";
admincheck(4);
/*if(Smallfivesolution() == $_SERVER['SERVER_NAME']) {
} else {
    echo Smallfivesq();
    exit();
}*/
$action=SafeRequest("action", "get");
if($action == "pm") {
    $cd_uname=SafeRequest("cd_uname", "post");
    $cd_type=SafeRequest("cd_type", "post");
    $cd_data=SafeRequest("cd_data", "post");
    $sql="select * from " . tname('user') . " where cd_name='" . $cd_uname . "'";
    $result=$db->query($sql);
    if($row=$db->fetch_array($result)) {
        $setarr=array(
            'cd_uid'=>0,
            'cd_uname'=>'系统提示',
            'cd_uids'=>$row['cd_id'],
            'cd_unames'=>$cd_uname,
            'cd_icon'=>$cd_type,
            'cd_data'=>$cd_data,
            'cd_dataid'=>0,
            'cd_state'=>1,
            'cd_addtime'=>date('Y-m-d H:i:s')
        );
        inserttable('notice', $setarr, 1);
        showmessage("恭喜您，消息已成功发送！", "userpm.php", 0);
    } else {
        showmessage("发送失败，会员帐号不存在！", $_SERVER['HTTP_REFERER'], 0);
    }
}
?>
<!DOCTYPE html>
<html>
 <head> 
  <meta charset="gbk" /> 
  <meta name="renderer" content="webkit" /> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 
  <title>后台管理中心</title> 
  <link href="../css/add.css" rel="stylesheet" /> 
  <style type="text/css">
.table2{width: 100%;max-width: 100%;border-collapse: collapse;border-spacing: 0;}
.table2 td{font-size: 12px;border-top: 1px solid #ddd;padding: 8px;vertical-align: top;}
.table2 tr:hover{text-decoration: none;background-color: #e6f2fb;}
.table2 th{border-bottom: 2px solid #ddd;vertical-align: bottom;padding: 2px;text-align: left;}
.table3{width: 100%;max-width: 100%;border-collapse: collapse;border-spacing: 0;}
.table3 tr:hover{text-decoration: none;background-color: #e6f2fb;}
.table3 td{font-size: 12px;line-height:25px;border-top: 1px solid #ddd;padding: 5px;vertical-align: top;border-right: solid 1px #ddd;}
.table3 th{border-bottom: 2px solid #ddd;vertical-align: bottom;padding: 2px;text-align: left;}
</style>
 </head>   
 <body>
  <div class="contents"> 
   <div class="panel"> 
    <div class="panel-head"> 
     <strong>发送会员通知</strong> 
    </div> 
    <form action="userpm.php?action=pm" method="post" name="form2"> 
     <table class="table3"> 
      <tbody> 
       <tr> 
        <td width="70" align="left" class="p10">会员帐号</td> 
        <td align="left"> <input type="text" class="input input_hd length_3" value="" name="cd_uname" id="cd_uname" />　 <font color="#d01f3c">&nbsp;&nbsp;必须是站内已存在的用户帐号！不能乱写!</font></td> 
       </tr> 
       <tr> 
        <td align="left" class="p10">通知类型</td> 
        <td align="left"> 
         <select name="cd_type" id="cd_type"> 
          <option value="">请选择</option> 
          <option value="dance">影音</option> 
          <option value="miniblog">说说</option> 
          <option value="album">图片</option> 
          <option value="wall">留言</option> 
          <option value="message">私信</option> 
          <option value="fans">关注</option> 
          <option value="praise">赞扬</option> 
          <option value="account">账户</option> 
          <option value="activity">活动</option> 
         </select>
	   </td> 
       </tr> 
       <tr> 
        <td width="70" align="left" class="p10">通知内容</td> 
        <td align="left"> <textarea name="cd_data" cols="50" rows="6" id="cd_data"></textarea>　 </td> 
       </tr>
       <tr> 
        <td height="35" colspan="2" align="left" bgcolor="#FAFBF7" class="td_border"><button type="submit" name="form2" class="btn btn_submit J_ajax_submit_btn" style="margin-left: 80px;" onClick="return CheckForm();">确定提交</button></td>
       </tr> 
      </tbody> 
     </table> 
    </form>
   </div> 
  </div>
</body>
</html>