1 Star 0 Fork 6

八爪鱼工作室/罗湖医院体检科

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mailbox.php 3.45 KB
一键复制 编辑 原始数据 按行查看 历史
邓云溪 提交于 2018-05-21 11:02 . no commit message
<?php
require_once(dirname(__FILE__)."/"."global.php");
require_once(PHP168_PATH."inc/encode.php");
require(PHP168_PATH."inc/head.php");
require(PHP168_PATH.'/JYAPI.php');
require(PHP168_PATH.'/JYSmarty.php');
(""==$act)?($act="send"):($act = $_GET["act"]);
$smarty->assign("act",$act);
$smarty->assign("unitname",$webdb['webname']);
if($act=="send"){
$user_ip = ($_SERVER["HTTP_VIA"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"];
$user_ip = ($user_ip) ? $user_ip : $_SERVER["REMOTE_ADDR"];
$attr = new JYAPI("Model_JiuyiAttr");
$mailtype = $attr->getAllAttr("fk = 'mailtypeid'",'att_id as typeid, att_name as typename');
$curtype[43] = "checked";
$smarty->assign("mailtype",$mailtype);
$smarty->assign("curtype",$curtype);
$smarty->assign("user_ip",$user_ip);
$smarty->display("mail_index.html");
$smarty->display("mail_send.html");
}elseif($act=="list"){
$mail = new JYAPI("Model_Mailbox",true);
$p = isset( $_GET["p"] ) ? $_GET["p"] : 1;
$pageSize = 10;
$where ='unit_id = '.UNITID.' and has_reply = 1 and reply_public = 1';
$maillist = $mail->getAllMail($where,'*','send_time desc',$p,$pageSize);
$smarty->assign("maillist",$maillist);
$dpager = $mail->pager;
$smarty->assign("dpager", $dpager);
$smarty->assign("url", "mailbox.php?act=list&page=|num|");
$smarty->display("mail_index.html");
$smarty->display("mail_list.html");
}elseif($act=="mymail"){
$ispost = count($_POST);
$sender_name = $_POST["sender_name"];
$sender_pwd = $_POST["sender_pwd"];
$mailcnt =0;
if($ispost){
$mail = new JYAPI("Model_Mailbox");
$where = 'unit_id ='.UNITID;
$where .= " and sender_name = '$sender_name' and sender_pwd = '$sender_pwd'";
$maillist = $mail->getAllMail($where,'*','',1,50);
$mailcnt = count($maillist);
$smarty->assign("maillist",$maillist);
$smarty->assign("sender_name",$sender_name);
$smarty->assign("sender_pwd",$sender_pwd);
}
$smarty->assign("mailcnt",$mailcnt);
$smarty->display("mail_index.html");
$smarty->display("mail_melist.html");
}elseif($act=="review"){
$id = $_GET["id"];
$mail = new JYAPI("Model_Mailbox");
$vo = $mail->getOneMail($id);
$smarty->assign("vo",$vo);
$smarty->display("mail_index.html");
$smarty->display("mail_review.html");
}elseif($act=="insert"){
//获取表单的数据
$vo = $_POST;
//验证过程
if($vo[sender_name]==""){
echo "<font color='red'>请填写您的姓名</font><br><a href='/mailbox.php'>点击填写信件表单</a>";
exit;
}elseif($vo[sender_pwd]==""){
echo "<font color='red'>请填写读信密码</font><br><a href='/mailbox.php'>点击填写信件表单</a>";
exit;
}elseif($vo[sender_tell]==""){
echo "<font color='red'>请填写您的联系电话</font><br><a href='/mailbox.php'>点击填写信件表单</a>";
exit;
}elseif($vo[mail_title]==""){
echo "<font color='red'>请填写信件标题</font><br><a href='/mailbox.php'>点击填写信件表单</a>";
exit;
}elseif($vo[mail_content]==""){
echo "<font color='red'>请填写信件内容</font><br><a href='/mailbox.php'>点击填写信件表单</a>";
exit;
}
$is_public = $_POST["is_public"];
if($is_public=="on"){
$is_public = 1;
}else{
$is_public = 0;
}
$vo["is_public"]=$is_public;
$mail = new JYAPI("Model_Mailbox");
$mail->newMail(UNITID,$vo);
echo "<script language='javascript'>alert('信件提交成功');window.location = '/mailbox.php';</script>";
}
require(PHP168_PATH."inc/foot.php");
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/elfbobo/luohu.git
[email protected]:elfbobo/luohu.git
elfbobo
luohu
罗湖医院体检科
master

搜索帮助