⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 affiche_add.php

📁 VIP信息处理系统源码
💻 PHP
字号:
<?php

  if ((($_POST['submit'] == '确认提交' AND !empty ($_POST['tit'])) AND !empty ($_POST['conn'])))
  {
    $now_date = date ('Y-m-d H:i:s');
    if ($_POST['to_type'] == '<adser>')
    {
      $optype = 'adser';
      $t_type = 4;
    }
    else
    {
      if ($_POST['to_type'] == '<web>')
      {
        $optype = 'web';
        $t_type = 2;
      }
      else
      {
        if ($_POST['to_type'] == '<all>')
        {
          $optype = '';
          $t_type = 0;
        }
        else
        {
          fun_alert ('请选择公告对象!');
          fun_back ();
          exit ();
        }
      }
    }

    if (empty ($_POST['hn_edit_id']))
    {
      $inst_que = '' . 'INSERT INTO message(tit,conn,time,userid,username,to_type,mes_type)				   VALUES (\'' . $_POST['tit'] . '\',\'' . $_POST['conn'] . '\',\'' . $now_date . '\',\'0\',\'' . $_POST['to_type'] . '\',\'' . $t_type . '\',\'' . $_POST['mes_type'] . '\')';
      $re_inst = mysql_query ($inst_que);
      $str_mes = '添加';
    }
    else
    {
      $inst_que = '' . 'update message  set tit=\'' . $_POST['tit'] . '\',conn=\'' . $_POST['conn'] . '\',time=\'' . $now_date . '\',mes_type=\'' . $_POST['mes_type'] . '\',username=\'' . $_POST['to_type'] . '\',to_type=\'' . $t_type . '\' where id=\'' . $_POST['hn_edit_id'] . '\'';
      $re_inst = mysql_query ($inst_que);
      $str_mes = '修改';
    }

    if ($re_inst)
    {
      fun_alert ('信息' . $str_mes . '成功!');
    }
    else
    {
      fun_alert ('信息' . $str_mes . '失败!');
    }

    fun_back ();
    exit ();
  }

  if (!empty ($_REQUEST['edit_id']))
  {
    $sql = '' . 'select * from message where id=\'' . $_REQUEST['edit_id'] . '\'';
    $rs = mysql_query ($sql);
    $row = mysql_fetch_array ($rs);
  }

  echo '<s';
  echo 'cript>function check_sub(){	if(check_null("公告主题",document.form1.tit)){return false;}	if(check_null("公告内容",document.form1.conn)){return false;}	return true;} </script>      <table width="100%" border="0" cellspacing="1" cellpadding="1" class="listtable_admin">		<form name="form1" method="post" action="" onSubmit="return check_sub()">			<tr class="listbody_admin">			  <td height="25" c';
  echo 'olspan="2" class="listtbhd"><div align="center">';
  echo (empty ($_REQUEST['edit_id']) ? '发布' : '编辑');
  echo '公告</div></td>			</tr>			<tr class="listbody_admin">			  <td width="20%" height="25"  align="center">公告主题:</td>			  <td width="80%"><input name="tit" type="text" class="text" id="tit" value="';
  echo $row[tit];
  echo '" size="81" maxlength="50"></td>			</tr>			<tr class="listbody_admin">			  <td width="20%" height="25"  align="center">公告对象:</td>			  <td width="80%">';
  echo '<s';
  echo 'elect name="to_type">			    ';
  if ($op != 'adser')
  {
    echo '<option value="<web>"';
    if ($row['to_type'] == '2')
    {
      echo ' selected';
    }

    echo '>网站主</option>';
  }

  if ($op != 'web')
  {
    echo '<option value="<adser>"';
    if ($row['to_type'] == '4')
    {
      echo ' selected';
    }

    echo '> 广告主 </option>';
  }

  echo '		      	<option value="<all>">所有会员</option>			  </select>		      <input name="hn_edit_id" type="hidden" id="hn_edit_id" value="';
  echo $_REQUEST['edit_id'];
  echo '"></td>			</tr>			<tr class="listbody_admin">			  <td width="20%" height="25"  align="center">公告类型:</td>			  <td width="80%">';
  echo '<s';
  echo 'elect name="mes_type" id="mes_type">			    ';
  while (true)
  {
    if (list ($k, $v) = each ($cfg_messtype))
    {
      echo ('' . '<option value="' . $k . '"');
      if ($row['mes_type'] == $k)
      {
        echo ' selected';
      }

      echo '' . '>' . $v . '</option>';
    }
  }

  echo '		      </select>		      </td>			</tr>			<tr class="listbody_admin">			  <td height="25" align="center">公告内容:</td>			  <td><textarea name="conn" cols="80" rows="10" wrap="VIRTUAL" id="conn" class="text">';
  echo $row['conn'];
  echo '</textarea></td>			</tr>			<tr class="listbody_admin">			  <td height="25" colspan="2" align="center">			  <input name="submit" type="submit" class="subbt" value="确认提交"> 			  <input name="button_r" type="button" class="subbt" value="返回上页" onClick="history.go(-1);"></td>			</tr>		  </form>  		</table>';
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -