$loginFlag = 0; $id = 0; } $pageSize = 8; $sql2 = "select * from tuhao_pro where username='******' and is_send=1 and status =0"; $sentNum = getResultNum($sql2); $sql3 = "select * from tuhao_comm where receiver_id={$id} and status = 0"; $mesNum = getResultNum($sql3); if ($type == 'goods') { $data = sent($id, $pageSize, ''); $goods = 1; $sql1 = "select * from tuhao_pro where username='******' and receiver is not null order by reg_time desc "; $numRows = getResultNum($sql1); $totalPage = ceil($numRows / $pageSize); } elseif ($type == 'info') { $data = receiveComm($id, $pageSize, ''); $goods = 0; $sql1 = "select * from tuhao_comm where receiver_id={$id} order by reg_time desc"; $numRows = getResultNum($sql1); $totalPage = ceil($numRows / $pageSize); } elseif ($type == 'sending') { $data = sending($id, $pageSize, ''); $goods = 3; $username1 = fetchOne("select username from tuhao_user where id={$id}"); $sql1 = "select * from tuhao_pro where username='******' and receiver is null order by reg_time desc "; $numRows = getResultNum($sql1); $totalPage = ceil($numRows / $pageSize); } $arr = array('status' => 1); update("tuhao_pro", $arr, "username='******' and is_send=1 and status =0"); $sql = "select user_id,college,head_photo,levell,score from tuhao_info where user_id={$id}";
<?php /** * Created by PhpStorm. * User: administrator * Date: 2015/8/6 * Time: 16:26 */ require_once '../include.php'; if (isset($_SESSION['id'])) { $id = $_SESSION['id']; } elseif (isset($_COOKIE['id'])) { $id = $_COOKIE['id']; } echo receiveComm($id, 8, 'json');