<?php
if(!defined('IN_MYMPS')) exit('Forbidden');
require MEMBERDIR.'/include/common.func.php';

if($ac == 'delthis'){
	
	if(!$id) write_msg('','?m=resumePost&error=1&page='.$page);
	$db->query("DELETE FROM `{$db_mymps}resume_post` WHERE id = '$id' AND userid = '$s_uid'");
	write_msg('','?m=resumePost&success=3&page='.$page);
	
} else {
	
	$sql = "SELECT a.*,b.tname,b.id AS uid,b.if_corp FROM {$db_mymps}resume_post AS a LEFT JOIN `{$db_mymps}member` AS b ON a.touser=b.userid WHERE a.userid = '$s_uid' ORDER BY a.id DESC";
	
	$rows_num = mymps_count("resume_post","WHERE userid = '$s_uid'");
	$param	  = setParam(array("m"));
	$list     = array();
	
	foreach(page1($sql) as $k => $row){
		$arr['id']       = $row['id'];
		$arr['infoid'] = $row['infoid'];
		$arr['title']   = $row['title'];
		$arr['tname']   = $row['tname'];
		$arr['if_corp']   = $row['if_corp'];
		$arr['uid']   = $row['uid'];
		$arr['userid']   = $row['userid'];
		$arr['touser']   = $row['touser'];
		$arr['infouri']   = $row['infouri'];
		$arr['resumeid']   = $row['resumeid'];
		$arr['begintime']   = $row['begintime'];
		$list[]= $arr;
	}
	$location = location();
	include mayi_tpl('resume_post');
}
?>