public function actionSearch() { $request = \Yii::$app->request; $start = $request->get('iDisplayStart'); $limit = $request->get('iDisplayLength'); $andWhere = []; $order = ''; $id_phone_name = $request->get('id_phone_name'); if ($request->get('id_phone_name') != '') { // 电话、ID、姓名 if (is_numeric($id_phone_name)) { if (strlen($id_phone_name . '') == 11) { $andWhere[] = ["=", "phone", $id_phone_name]; } else { $andWhere[] = ["=", "id", $id_phone_name]; } } else { $andWhere[] = ["like", "json_extract(info,'\$.real_name')", $id_phone_name]; } } else { User::getInstance()->searchWhere($andWhere, $request->get(), $order); } $list = User::getInstance()->lists($start, $limit, $andWhere, $order); $count = User::getInstance()->count($andWhere); foreach ($list as $k => $v) { $list[$k]['info'] = json_decode($v['info']); $list[$k]['info']->level = getLevel($list[$k]['info']->level); $list[$k]['info']->is_marriage = getMarriage($list[$k]['info']->is_marriage); $list[$k]['sex'] = getSex($list[$k]['sex']); } $data = ['draw' => \Yii::$app->request->get('sEcho'), 'recordsTotal' => $count, 'recordsFiltered' => $count, 'data' => $list]; $this->renderAjax($data, false); }
function _initialize() { if (!is_numeric($_GET['uid']) && is_string($_GET['uid'])) { $domainuser = D('User')->getUserByIdentifier(h($_GET['uid']), 'domain'); if ($domainuser) { $this->uid = $domainuser['uid']; $this->assign('uid', $this->uid); } else { $this->error(L('user_not_exist')); } } else { $this->assign('uid', intval($_GET['uid'])); } if ('detail' != ACTION_NAME) { $user_info = D('User')->getUserByIdentifier($this->uid); if ($user_info) { $userinfo = array('Địa chỉ mblog' => U('home/Space/index', array('uid' => $user_info['domain'] ? $user_info['domain'] : $this->uid)), 'Giới tính' => getSex($user_info['sex']), 'Nơi sống' => $user_info['location']); // 基本信息-钩子 Addons::hook('home_space_profile_base', array('uid' => $this->uid, 'user_info' => &$userinfo)); $this->assign('userinfo', $userinfo); } else { $this->error(L('user_not_exist')); } $this->__getSpaceCount($this->uid); } }
public function view() { $uid = intval($_REQUEST['uid']); if (!$uid) { $this->error('错误用户'); } $userModel = D('User'); $intentionModel = D('Intention'); $introModel = D('Intro'); $userJoinKeywordModel = D('UserJoinKeyword'); $userJoinFunctionModel = D('UserJoinFunction'); $jobModel = D('Job'); $projectModel = D('Project'); $dictMajorModel = D('DictMajor'); $dictLocationModel = D('DictLocation'); $data = array(); $data['user'] = $userModel->where(" uid = {$uid} ")->find(); $data['intention'] = $intentionModel->where(" uid = {$uid} ")->find(); $data['intro'] = $introModel->where(" uid = {$uid} ")->getfield('intro'); $data['keyword'] = $userJoinKeywordModel->field('keyword.keyword')->join('LEFT JOIN keyword ON user_join_keyword.keyword_id = keyword.id ')->where(" uid = {$uid} ")->select(); $data['function'] = $userJoinFunctionModel->field('dict_function.function_name')->join('LEFT JOIN dict_function ON user_join_function.function_id = dict_function.function_id ')->where(" uid = {$uid} ")->select(); $data['job'] = $jobModel->where(" uid = {$uid} ")->select(); $data['project'] = $projectModel->where(" uid = {$uid} ")->select(); $data['user']['sex'] = getSex($data['user']['sex']); $data['user']['age'] = getAge($data['user']['birthday']); $data['user']['birthday'] = getBirthday($data['user']['birthday']); $data['user']['workyear'] = getDictValue('WORKYEAR', $data['user']['workyear']); $data['user']['location'] = $dictLocationModel->getLocationName($data['user']['location']); $data['user']['jobstatus'] = getDictValue('JOBSTATUS', $data['user']['jobstatus']); $data['user']['degrees'] = getDictValue('DEGREES', $data['user']['degrees']); $data['user']['major'] = $dictMajorModel->getMajorName($data['user']['major']); $data['intention']['jobarea'] = $dictLocationModel->getLocationName($data['intention']['jobarea']); $data['intention']['salary'] = getDictValue('SALARY', $data['intention']['salary']); $this->assign('data', $data); $this->assign('title', '查看'); $this->display(); }
echo $MB[MB_ID]; ?> </font></td> <td><?php echo getStrCut($MB[MB_NIC], 10, '..'); ?> </td> <td>[<?php echo $MB[MB_TYPE]; ?> ]<?php echo $MB_GROUP[$MB[MB_TYPE] - 1]; ?> </td> <td><?php echo getSex($MB[MB_SEX]); ?> ,<?php echo getAge($MB[MB_BIRTH]); ?> 세</td> <td><?php echo substr($MB[MB_ADDR1], 0, 4); ?> </td> <td> <?php if ($MB[MB_HOME_TEL]) { ?> <img src='./image/ico_tel.gif' style='cursor:pointer;' onclick="alert('전화번호 : <?php echo $MB[MB_HOME_TEL];
function getUserInfo($uid, $uname, $mid, $status = false) { $data = array(); $uid = intval($uid); $user = null; if ($uid > 0) { $user = D('User', 'home')->getUserByIdentifier($uid, 'uid'); } else { if (!empty($uname)) { $user = D('User', 'home')->getUserByIdentifier($uname, 'uname'); } } if (!$user) { return false; } if ($uid != $mid) { $isBlack = D('UserPrivacy', 'home')->isInBlackList($uid, $mid); $data['isInBlackList'] = $isBlack ? 1 : 0; } $data['uid'] = $user['uid']; $data['uname'] = $user['uname']; $data['province'] = $user['province']; $data['city'] = $user['city']; $data['location'] = $user['location']; $data['face'] = getUserFace($user['uid']); $data['space'] = $user['domain'] ? U('home/Space/index', array('uid' => $user['domain'])) : U('home/Space/index', array('uid' => $user['uid'])); $data['sex'] = getSex($user['sex']); $data['weibo_count'] = model('UserCount')->getUserWeiboCount($user['uid']); $data['favorite_count'] = (int) M('weibo_favorite')->where('uid=' . $user['uid'])->count(); $data['followers_count'] = model('UserCount')->getUserFollowerCount($user['uid']); $data['followed_count'] = model('UserCount')->getUserFollowingCount($user['uid']); $data['is_followed'] = getFollowState($mid, $user['uid']); $data['is_verified'] = intval(M('user_verified')->getField('verified', "uid={$uid}")); if ($status) { $status = M('weibo')->where('uid=' . $user['uid'])->order('weibo_id DESC')->find(); $data['status'] = $status ? D('Weibo', 'weibo')->getOneApi('', $status) : ''; } return $data; }
<?php session_start(); include "setting.php"; if (!check_post()) { print "フォームは全て記入してください。"; exit; } $check = check_inputs(); if ($check != '') { print $check; exit; } $login_name = $_POST["login_name"]; $pwd = $_POST["pwd"]; $sex = getSex($_POST["sex"]); $hashpwd = password_hash($pwd, PASSWORD_DEFAULT); $db = new mydb(); if (check_exist_user($db, $login_name) == true) { $query = "INSERT INTO member (login_name,pwd,sex) VALUES(\$1, \$2, \$3)"; $result = $db->query($query, array($login_name, $hashpwd, $sex)); if ($result == false) { print "登録に失敗しました。"; } else { $query = "select id from member where login_name=\$1"; $result = $db->query($query, array($login_name), "getid"); $row = pg_fetch_assoc($result, 0); regist_success($login_name, $row['id']); } } else { print "指定されたユーザー名は利用できません。";
?> 님 ( <?php echo $M['name']; ?> ) <?php if ($M['sex']) { ?> <img src="<?php echo $g['img_core']; ?> /_public/ico_sex_<?php echo $M['sex']; ?> .gif" alt="" title="<?php echo getSex($M['sex']); ?> 성(<?php echo getAge($M['birth1']); ?> 세)" /><?php } ?> </span> </div> 이메일 : <a href="mailto:<?php echo $M['email']; ?> "><?php echo $M['email'];
echo $r; ?> &iframe=Y&m=member&front=manager&page=info&mbruid=<?php echo $R['memberuid']; ?> ');" title="회원정보"><?php echo $_R['id']; ?> </a></td> <td><?php echo $R['level']; ?> </td> <td><?php if ($R['sex']) { echo getSex($R['sex']); } ?> </td> <td><?php if ($R['birth1']) { echo getAge($R['birth1']); } ?> </td> <td><?php if ($R['birth1']) { echo substr($R['birth1'], 2, 2); ?> /<?php echo substr($R['birth2'], 0, 2);
<?php $mysql = dbConnect(); $id = filter_input(INPUT_GET, "id", FILTER_SANITIZE_STRING); $stmt = $mysql->prepare("SELECT PIES.ID, PIES.IMIE, PIES.SUKA, PIES.OZNACZENIE, PIES.OJCIEC, PIES.MATKA, PIES.M_ID, PIES.R_ID, " . "MIOT.URODZONY, RASA.NAZWA " . "FROM PIES " . "JOIN MIOT ON MIOT.ID = PIES.M_ID " . "JOIN RASA ON RASA.ID = PIES.R_ID " . "WHERE PIES.ID=(?)"); $stmt->bind_param("i", $id); $stmt->bind_result($id, $imie, $suka, $oznaczenie, $ojciec, $matka, $m_id, $r_id, $urodzony, $rasa); if (!$stmt) { die; } $stmt->execute(); if ($stmt->fetch()) { echo 'Pies:<br>'; echo 'ID: ' . $id . '<br>'; echo 'Imię: ' . $imie . '<br>'; echo 'Płeć: ' . getSex($suka) . '<br>'; echo 'Oznaczenie: ' . $oznaczenie . '<br>'; echo 'Ojciec: ' . $ojciec . '<br>'; echo 'Matka: ' . $matka . '<br>'; echo 'ID miotu / data urodzenia:' . foreignKeyLink('miot', $m_id, $urodzony) . '<br>'; echo 'Rasa: ' . foreignKeyLink('rasa', $r_id, $rasa) . '<br>'; echo "<a href=\"nowy_pies.php?id={$id}\">edytuj</a> / "; echo "<a href=\"usun_pies.php?id={$id}\">usuń</a>"; } else { echo 'Nie znaleziono psa'; } $stmt->close(); include "footer.php"; ?>
/** * page code function */ function PageCompPageMainCode() { global $en_ziploc; global $_page_cont; global $_ni; global $w_ex; global $member_sex; global $logged; global $search_start_age; global $search_end_age; $gl_search_start_age = (int) $search_start_age; $gl_search_end_age = (int) $search_end_age; if ($logged['member']) { //$arr_sex = db_arr("SELECT Sex FROM Profiles WHERE ID = ".(int)$_COOKIE['memberID']); $member_sex = getSex($_COOKIE['memberID']); //$arr_sex['Sex']; } else { $member_sex = 'male'; } $ret = ""; // Get LookingFor profile type $default_looking_for = ''; if (strlen($_GET['LookingFor'])) { $default_looking_for = $_GET['LookingFor']; } elseif ($fname == 'LookingFor') { switch ($member_sex) { case 'male': $default_looking_for = "female"; break; case 'female': $default_looking_for = "male"; break; } } $respd = db_res("SELECT * FROM `ProfilesDesc` WHERE `search_type` <> 'none' ORDER BY `search_order` ASC"); while ($arrpd = mysql_fetch_array($respd)) { $fname = get_field_name($arrpd); if ($fname == "Sex" && !$_GET['LookingFor']) { $arrpd['search_default'] = $member_sex; } if ($fname == 'LookingFor' && strlen($default_looking_for)) { $arrpd['search_default'] = $default_looking_for; } $section_hide = 0; switch ($arrpd['search_type']) { case 'radio': $ret .= print_row_search_radio($arrpd, $arrpd['search_default'], "table", $javascript, $section_hide); break; case 'list': $ret .= print_row_search_list($arrpd, $arrpd['search_default'], "text", $section_hide); break; case 'check': $ret .= print_row_search_check($arrpd, $arrpd['search_default'], "text", $section_hide); break; case 'check_set': $ret .= print_row_search_check_set($arrpd, $arrpd['search_default'], "text", "", $section_hide); break; case 'daterange': $ret .= print_row_search_daterange($arrpd, $arrpd['search_default'], "text", $section_hide); break; case 'text': $ret .= print_row_search_text($arrpd, $arrpd['search_default'], "text", $section_hide); break; } } return $ret; }
/** * 登录首页 * 描述: * */ function index_index() { global $_MooClass, $dbTablePre, $userid, $user_arr, $memcached; $sql_condition_province = $sql_condition_city = $province = ''; $currentdistrict = '0'; $arr_diamond_female = $arr_diamond_male = null; $provice_list = $city_list = $province_othercachefile = null; $s_cid = 40; //note 先初始化用户信息 //MooUserInfo(); //-------会员推荐------// $workprovince = MooGetGPC('workprovince', 'integer', 'G'); //工作省份 $workcity = MooGetGPC('workcity', 'integer', 'G'); //工作城市 if (in_array($workprovince, array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 2010-09-04 $workcity = $workprovince; $workprovince = 10101000; } $age1 = MooGetGPC('age1', 'integer', 'G'); //最小年龄 $age2 = MooGetGPC('age2', 'integer', 'G'); //最大年龄 $userList = $userList2 = array(); $index_total_user = 12; //首页总用户数 //note 当前年份 $year = date('Y'); //登录用户查找性别 $sql_gender = ''; //性别取反 if ($GLOBALS['MooUid']) { $gender = $user_arr['gender'] == 1 ? 0 : 1; /* $sql_gender = " and gender='$gender'"; $sql_condition_province .= $sql_gender; $sql_condition_city .= " and gender='$gender'"; */ } else { $gender = !MooGetGPC('gender', 'integer', 'G') ? 0 : 1; //note 性别 } $date_time = date('d'); $month_time = date('m'); $reguser_num = 30000 + $month_time * 1100 + $date_time * 191; //新加滚动文字 /*$time_list = time(); $sql = "select content from {$dbTablePre}text_show where start_time<'$time_list' and end_time>'$time_list' order by reg_time desc limit 0,15"; $text_list = $_MooClass['MooMySQL']->getAll($sql);*/ //显示男姓or显示女生搜索 /* if(isset($workprovince) && isset($workcity) && isset($age1) && $age2){ //$sql = "select * from {$dbTablePre}members where gender=$sex and images_ischeck=1 "; include_once("./module/crontab/crontab_config.php"); //note 从快速搜索表中查询 if($gender == '0'){ $sql = "select uid from {$dbTablePre}members_search where images_ischeck=1 and gender='0'"; } if($gender == '1'){ $sql = "select uid from {$dbTablePre}members_search where images_ischeck=1 and gender='1'"; } if($workprovince != 0 && $workcity == 0){//仅选择了省 $sql .= " and province=$workprovince"; }elseif($workprovince != 0 && $workcity != 0){ //选择了省市 $sql .= " and province=$workprovince and city=$workcity"; } if($age1 != '0' && $age2 != '0'){ if($age1 < $age2){ //查找数据的年龄条件 $between = ($year-$age2).' and '.($year-$age1); $sql .= " and birthyear between $between"; }else{ //查找数据的年龄条件 $between = ($year-$age1).' and '.($year-$age2); $sql .= " and birthyear between $between"; } } $sql .= " and is_lock = 1"; //$sql .= " and is_lock = 1 limit 12"; $sql .= " order by city_star desc,s_cid asc,bgtime desc ,pic_num desc limit 20"; //var_dump($sql);exit; //note 查询出来的用户id写入缓存 $md5 = md5($sql); $index_search = ("type=query/name=userid_{$md5}/sql=$sql/cachetime=86400"); $_MooClass['MooCache']->getBlock($index_search); $userid = $GLOBALS['_MooBlock']["userid_{$md5}"]; //查询为空则跳转到首页 if(empty($userid)) { MooMessage("非常抱歉!没有您所找的会员!", 'index.php','01'); exit; } //note uid数组转换成字符串 $index_img_num = 5; $index_img = index_img($currentdistrict,$index_img_num); $small_img_num = 3; $small_img = small_img($currentdistrict,$small_img_num); $user_arr1 = array(); foreach ($userid as $v1){ $user_arr1[] = $v1['uid']; } //note 获得用户id $userid_list = implode(",",$user_arr1); $sql = "select s.uid,s.gender,s.images_ischeck,s.nickname,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid left join {$dbTablePre}members_introduce i on s.uid=i.uid where s.uid in ($userid_list) order by s.city_star desc, s.s_cid asc"; //note 查询出来的用户信息写入缓存 $md5 = md5($sql); $index_search = ("type=query/name=userList_{$md5}/sql=$sql/cachetime=86400"); $_MooClass['MooCache']->getBlock($index_search); $userList = $GLOBALS['_MooBlock']["userList_{$md5}"]; } else{ */ //默认进入 //包含配置文件 include_once "./module/crontab/crontab_config.php"; $cur_ip = GetIP(); // $cur_ip = "61.190.44.98"; // $cur_ip = "202.120.2.200";//上海ip // $cur_ip = "218.202.206.102";//新疆ip //$cur_ip = "218.70.178.197"; //重庆 // $cur_ip="221.130.166.242"; MooPlugins('ipdata'); $ip_arr = convertIp($cur_ip); //得到省份对应的数值,查库 $province = $city = ""; foreach ($provice_list as $key => $val) { if (strstr($ip_arr, $val)) { $province = $key; $currentdistrict = $val; break; } } if (isset($_GET['province'])) { foreach ($provice_list as $key => $val) { if ($_GET['province'] == $key) { $currentdistrict = $val; break; } } } $test = array(); if (isset($currentdistrict)) { $index_img_num = 5; $index_img = index_img($currentdistrict, $index_img_num); $small_img_num = 3; $small_img = small_img($currentdistrict, $small_img_num); $test = test($currentdistrict); } //得到市对应的城市代号 foreach ($city_list as $city_key => $city_val) { if (strstr($ip_arr, $city_val)) { $city = $city_key; break; } } if (isset($_GET['province'])) { //默认快速查询没有进入 $province = MooGetGPC('province', 'integer', 'G'); //note 修正广东省深圳和广州的区域查询 if (in_array($province, array(10101201, 10101002))) { $city = $province; $province = 10101000; } //修正直辖市查询 if (in_array($province, array('10102000', '10103000', '10104000', '10105000'))) { $city = '0'; } /* $sql = "SELECT * FROM {$dbTablePre}index_cachefile WHERE province='{$province}' AND city='{$city}'"; $cachefile_list = $_MooClass['MooMySQL']->getAll($sql); foreach($cachefile_list as $cachefile){ if(file_exists("data/block/{$cachefile['provincestarfile']}")){ @unlink("data/block/{$cachefile['provincestarfile']}"); } if(file_exists("data/block/{$cachefile['citystarfile']}")){ @unlink("data/block/{$cachefile['citystarfile']}"); } if(file_exists("data/block/{$cachefile['provinceotherfile']}")){ @unlink("data/block/{$cachefile['provinceotherfile']}"); } } */ } $userList = array(); //查市城市之星 //note 修正广东省深圳和广州的区域查询 if (in_array($province, array(10101201, 10101002))) { $city = $province; $province = 10101000; } $sql_city = "s.city='{$city}'"; //修正直辖市查询 if (in_array($province, array('10102000', '10103000', '10104000', '10105000'))) { $city = '0'; } if ($city == 0) { $sql_city = "s.province='{$province}'"; } if (!empty($city) || !empty($province)) { //默认没有进入 选择省后进入 $sql = "SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce FROM {$dbTablePre}members_search as s left join {$dbTablePre}members_base b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid WHERE s.s_cid='20' and s.gender='{$gender}' and ({$sql_city} AND s.is_lock=1 AND s.images_ischeck=1 and s.nickname!='' AND s.showinformation=1 AND s.city_star>=1 AND s.usertype=1) AND i.introduce!='' order by s.s_cid limit 6"; //$userList = $_MooClass['MooMySQL']->getAll($sql); $param = "type=query/name=userlist_{$city}_citystar/sql={$sql}/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); // $userList = $GLOBALS['_MooBlock']["userlist_{$city}_citystar"]; //市缓存文件 //$city_cachefile = "userlist_{$city}_citystar".'_'.md5($param).'.data'; } //市无城市之星,从省取城市之星 if (empty($userList)) { //默认进入 //enky note //$sql="select * from {$dbTablePre}members_base as b left join {$dbTablePre}members_search as s on b.uid=s.uid WHERE s.province='$province' AND s.is_lock=1 AND s.images_ischeck = 1 AND s.showinformation=1 and s.city_star>=1 and s.usertype=1 AND s.uid!=20752315 LIMIT 20"; $sql = "select s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce from {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid WHERE s.province='{$province}'\n\t\t\t AND s.is_lock=1 and s.gender={$gender}\n\t\t\t AND s.images_ischeck = 1 AND s.showinformation=1 \n\t\t\t and s.city_star>=1 and s.usertype=1 AND i.introduce!='' and s.nickname!='' LIMIT 6"; // $userList = $_MooClass['MooMySQL']->getAll($sql); $param = "type=query/name=userlist_{$province}_provincestar/sql={$sql}/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); $userList = $GLOBALS['_MooBlock']["userlist_{$province}_provincestar"]; //省缓存文件 //$province_cachefile = "userlist_{$province}_provincestar".'_'.md5($param).'.data'; } //城市之星不够取钻石会员(市->省->全国) $count = count($userList); if ($count < 6) { //默认进入 $addarr = array('cityadd', 'provinceadd', 'countryadd'); $user_in = '1747188|2154375|1600591|2159633|20782701|20785837|20561126|20305660|20910184'; //城市之星uid $user_list = array(); if (!is_array($userList)) { $userList = array(); } //enky add foreach ($userList as $user) { $user_list[] = $user['uid']; } if (!empty($user_list)) { $user_in .= ',' . implode('|', $user_list); } //从(市->省->全国)取钻石会员 $cityadd = array(); $provinceadd = array(); $countryadd = array(); foreach ($addarr as $add) { if ($count < 6) { $id = ''; //从市取 if ($add == 'cityadd') { if (!$city || $city == 0) { continue; } $sql_add = "s.city='{$city}' and"; $id .= $city; } //从省取 if ($add == 'provinceadd') { if (!$province || $province == 0) { continue; } $sql_add = "s.province='{$province}' and"; $id .= $province; } //全国取 if ($add == 'countryadd') { $sql_add = ''; $id .= 'country'; } //取几个钻石会员 $add_query_sum = 6 - $count; //enky need change $cl = searchApi('members_women members_man'); $cond[] = array('is_lock', '1', false); $cond[] = array('images_ischeck', '1', false); $cond[] = array('gender', $gender, false); $cond[] = array('usertype', '1', false); $cond[] = array('@id', '20752315|' . $user_in, true); //uid $cond[] = array('s_cid', '20', false); $cond[] = array('city_star', '0', false); $cond[] = array('showinformation', '1', false); $cond[] = array('pic_num', array(1, 20), false); if ($province) { array('province', $province, false); } if ($city) { array('city', $city, false); } $limit = array($add_query_sum); $res_matches = $cl->getResult($cond, $limit); if ($res_matches) { $count_res = count($res_matches); $array_merge = array(); for ($i = 0; $i < $count_res; $i++) { if (!empty($res_matches['matches'][$i])) { $ids[] = $res_matches['matches'][$i]['id']; } } $sql_str = implode(',', $ids); $nickname_res = $_MooClass['MooMySQL']->getAll("select nickname,uid from web_members_search where uid in " . "({$sql_str})"); $mainimg_res = $_MooClass['MooMySQL']->getAll("select mainimg from web_members_base where uid in " . "({$sql_str})"); $introduce_res = $_MooClass['MooMySQL']->getAll("select introduce from web_members_introduce where uid in " . "({$sql_str})"); //合并到sphinx查询出的整理后的数组 for ($i = 0; $i < $count_res; $i++) { if (!empty($res_matches['matches'][$i]['attrs'])) { $res_matches['matches'][$i]['attrs']['nickname'] = $nickname_res[$i]['nickname']; $res_matches['matches'][$i]['attrs']['uid'] = $nickname_res[$i]['uid']; $res_matches['matches'][$i]['attrs']['mainimg'] = $mainimg_res[$i]['mainimg']; $res_matches['matches'][$i]['attrs']['introduce'] = $introduce_res[$i]['introduce']; $bigarr[] = $res_matches['matches'][$i]['attrs']; } } ${$add} = $bigarr; } else { $sql = "select s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce from {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid where s.uid not in({$user_in})\n\t\t\t\t\t\t\t\t AND {$sql_add} s.city_star=0 AND s.s_cid = 20 and s.gender={$gender}\n\t\t\t\t\t\t\t\t AND s.images_ischeck = 1 AND s.is_lock = 1 AND s.showinformation = 1\n\t\t\t\t\t\t\t\t AND s.pic_num >=1 AND s.usertype=1 AND i.introduce!='' and s.nickname!='' LIMIT {$add_query_sum}"; $param = "type=query/name=userlist_{$id}_other/sql={$sql}/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); ${$add} = $GLOBALS['_MooBlock']["userlist_{$id}_other"]; } //已获取的首页会员uid $user_list = array(); if (!is_array(${$add})) { ${$add} = array(); } //enky add foreach (${$add} as $user) { $user_list[] = $user['uid']; } if (!empty($user_list)) { $user_in .= ',' . implode(',', $user_list); } //echo $user_in;exit; //已有总数 $count += count(${$add}); } } //$countryadd have data $userList = array_merge($userList, $cityadd, $provinceadd, $countryadd); //省其它类型会员缓存文件 //$province_othercachefile = "userlist_{$id}_other".'_'.md5($param).'.data'; } //生成的block缓存文件存库 /* $city = $city ? $city : 0; $sql = "SELECT * FROM {$dbTablePre}index_cachefile WHERE province='{$province}' AND city='{$city}'"; $cache_arr = $_MooClass['MooMySQL']->getAll($sql); if(empty($cache_arr)){ $province_cachefile = isset($province_cachefile)?$province_cachefile:''; $sql = "INSERT INTO {$dbTablePre}index_cachefile SET province='{$province}',city='{$city}',provincestarfile='{$province_cachefile}',citystarfile='{$city_cachefile}',provinceotherfile='{$province_othercachefile}'"; $_MooClass['MooMySQL']->query($sql); } */ //推荐列表中如果存在,则以推荐列表中的指定的sort替换 $sql = "SELECT * FROM {$dbTablePre}members_recommend WHERE province='{$province}' AND city='{$city}' order by sort asc"; $recommend_list = $_MooClass['MooMySQL']->getAll($sql); if (!empty($recommend_list)) { foreach ($recommend_list as $list) { $sort = $list['sort'] < 1 ? 0 : $list['sort'] - 1; if (MOOPHP_ALLOW_FASTDB) { $u = MooFastdbGet('members_search', 'uid', $list['uid']); $u2 = MooFastdbGet('members_base', 'uid', $list['uid']); $u = array_merge($u, $u2); } else { $sql = "SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce FROM {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid WHERE s.uid='{$list['uid']}'"; $u = $_MooClass['MooMySQL']->getOne($sql); } if ($u) { foreach ($userList as $key => $val) { if ($list['uid'] == $val['uid']) { $user_key = $key; break; } } if (isset($user_key)) { if (isset($userList[$sort])) { $userList[$key] = $userList[$sort]; } $userList[$sort] = $u; } else { $userList[$sort] = $u; } } } } // } //删除数组中多余的部分 array_splice($userList, 6); $userArr = array(); $i = 0; $imgSrcSmall = $imgSrcMid = $imgSrcUrl = ''; foreach ($userList as $v) { $introduce = ''; if (isset($v['introduce'])) { $introduce = MooCutstr($v['introduce'], 50, '...'); } $imgSrcSmall = MooGetphoto($v['uid'], 'small'); $imgSrcMid = MooGetphoto($v['uid'], 'mid'); if ($imgSrcSmall) { $imgSrc = $imgSrcMid; } elseif ($v['gender'] == '1') { $imgSrc = "module/index/templates/default/images/se_woman.gif"; } else { $imgSrc = "module/index/templates/default/images/se_man.gif"; } if (isset($v['mainimg']) && !empty($v['mainimg']) && isset($v['images_ischeck']) && $v['images_ischeck'] == 1) { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src={$imgSrc} width=\"120\"/> </a>"; } else { if (isset($v['gender']) && $v['gender']) { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_woman.gif\" /> </a> "; } else { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_man.gif\" /></a> "; } } if ($v['birthyear']) { $age = date('Y') - $v['birthyear'] . '岁'; } else { $age = '年龄保密'; } $userArr[] = array("i" => $i, "uid" => $v['uid'], "mainimg" => $v['mainimg'], "images_ischeck" => $v['images_ischeck'], "gender" => $v['gender'], "introduce" => $introduce, "imgUrl" => $imgUrl, "nickname" => $v['nickname'], "age" => $age, "province" => $v['province'], "city" => $v['city']); $i++; } //===============最新注册会员,按照片数排序 ,男会员========================= $newMale = array(); $param = "type=query/name=new_members_male/sql=SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce FROM {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid where s.gender=0 and s.pic_num>4 and s.images_ischeck=1 and s.is_lock=1 and i.introduce!='' and s.nickname!='' order by s.uid desc limit 3/cachetime=10800"; $_MooClass['MooCache']->getBlock($param); $new_reguser_male = isset($GLOBALS['_MooBlock']['new_members_male']) ? $GLOBALS['_MooBlock']['new_members_male'] : ''; foreach ($new_reguser_male as $v) { $introduce = MooCutstr($v['introduce'], 14, '...'); $imgSrcSmall = MooGetphoto($v['uid'], 'small'); $imgSrcMid = MooGetphoto($v['uid'], 'mid'); if ($imgSrcSmall) { $imgSrc = $imgSrcMid; } elseif ($v['gender'] == '1') { $imgSrc = "module/index/templates/default/images/se_woman.gif"; } else { $imgSrc = "module/index/templates/default/images/se_man.gif"; } if (isset($v['mainimg']) && !empty($v['mainimg']) && isset($v['images_ischeck']) && $v['images_ischeck'] == 1) { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src={$imgSrc} width=\"120\"/> </a>"; } else { if (isset($v['gender']) && $v['gender']) { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_woman.gif\" /> </a> "; } else { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_man.gif\" /></a> "; } } if ($v['birthyear']) { $birthyear = date('Y') - $v['birthyear'] . '岁'; } else { $birthyear = '年龄保密'; } if ($v['nickname']) { $nickname = MooCutstr($v['nickname'], 15, ''); } else { $nickname = 'ID:' . $v['uid']; } $newMale[] = array("uid" => $v['uid'], "mainimg" => $v['mainimg'], "images_ischeck" => $v['images_ischeck'], "gender" => $v['gender'], "introduce" => $introduce, "imgUrl" => $imgUrl, "nickname" => $nickname, "birthyear" => $birthyear, "province" => $v['province'], "city" => $v['city']); } //==================最新注册会员,按照片数排序 ,女会员========================== $param = "type=query/name=new_members_female/sql=SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce FROM {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid where s.gender=1 and s.pic_num>4 and s.images_ischeck=1 and s.is_lock=1 order by s.uid desc limit 3/cachetime=10800"; $_MooClass['MooCache']->getBlock($param); $new_reguser_female = isset($GLOBALS['_MooBlock']['new_members_female']) ? $GLOBALS['_MooBlock']['new_members_female'] : ''; foreach ($new_reguser_female as $v) { $introduce = MooCutstr($v['introduce'], 14, '...'); $imgSrcSmall = MooGetphoto($v['uid'], 'small'); $imgSrcMid = MooGetphoto($v['uid'], 'mid'); if ($imgSrcSmall) { $imgSrc = $imgSrcMid; } elseif ($v['gender'] == '1') { $imgSrc = "module/index/templates/default/images/se_woman.gif"; } else { $imgSrc = "module/index/templates/default/images/se_man.gif"; } if (isset($v['mainimg']) && !empty($v['mainimg']) && isset($v['images_ischeck']) && $v['images_ischeck'] == 1) { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src={$imgSrc} width=\"120\"/> </a>"; } else { if (isset($v['gender']) && $v['gender']) { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_woman.gif\" /> </a> "; } else { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_man.gif\" /></a> "; } } if ($v['birthyear']) { $birthyear = date('Y') - $v['birthyear'] . '岁'; } else { $birthyear = '年龄保密'; } if ($v['nickname']) { $nickname = MooCutstr($v['nickname'], 15, ''); } else { $nickname = 'ID:' . $v['uid']; } $newFemale[] = array("uid" => $v['uid'], "mainimg" => $v['mainimg'], "images_ischeck" => $v['images_ischeck'], "gender" => $v['gender'], "introduce" => $introduce, "imgUrl" => $imgUrl, "nickname" => $nickname, "birthyear" => $birthyear, "province" => $v['province'], "city" => $v['city']); } //=================钻石会员 地区切换时真爱一生推荐会员涉及的================================== $sql = "select count(uid) as num from web_diamond_recommend where isindex=1 and province='{$province}'"; $result = $_MooClass['MooMySQL']->getOne($sql); $num = $result['num']; /* $sql="select count(uid) as num from web_diamond_recommend where isindex=1 and gender='0' and province='{$province}'"; $result_male=$_MooClass['MooMySQL']->getOne($sql); $num_male=$result_male['num']; */ if ($num >= 5) { //女钻石会员 $sql = "select uid,birthyear,province,city,nickname from {$dbTablePre}diamond_recommend where isindex=1 and province='{$province}' order by city<>'{$city}' ,city desc,sort desc limit 10"; //FEMAIL $param = "type=query/name=web_diamond_recommend/sql={$sql}/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); $arr_diamond = $GLOBALS['_MooBlock']['web_diamond_recommend']; //男钻石会员 /* $sql_male = "select uid,birthyear,province,city,nickname from {$dbTablePre}diamond_recommend where isindex=1 and gender='0' and province='{$province}' order by city<>'{$city}' ,city desc,sort desc limit 10"; //MAIL $param = ("type=query/name=web_diamond_recommend/sql=$sql_male/cachetime=86400"); $_MooClass['MooCache']->getBlock($param); $arr_diamond_male = $GLOBALS['_MooBlock']['web_diamond_recommend']; */ } else { $diamond_filename = "data/cache/diamond_intro.php"; if (!file_exists($diamond_filename)) { //女钻石会员 $sql = "select m.uid,m.birthyear,m.province,m.city,m.nickname,b.mainimg,m.images_ischeck,i.introduce from {$dbTablePre}members_search m left join {$dbTablePre}members_base as b on m.uid=b.uid left join {$dbTablePre}members_introduce as i on m.uid=i.uid left join {$dbTablePre}members_choice c on m.uid=c.uid where m.s_cid='20' and m.usertype='1' and i.introduce_pass='******' and m.is_lock='1' and m.images_ischeck='1'"; $sql = $sql . " order by m.pic_num desc,m.bgtime desc limit 10"; $arr_diamond = $_MooClass['MooMySQL']->getAll($sql); foreach ($arr_diamond as $k => $v) { $diamond_str .= $v['uid'] . ','; } //男钻石会员 /* $sql_male = "select m.uid,m.birthyear,m.province,m.city,m.nickname,b.mainimg,m.images_ischeck,i.introduce from {$dbTablePre}members_search m left join {$dbTablePre}members_base as b on m.uid=b.uid left join {$dbTablePre}members_introduce as i on m.uid=i.uid left join {$dbTablePre}members_choice c on m.uid=c.uid where m.s_cid='20' and m.usertype='1' and i.introduce_pass='******' and m.is_lock='1' and m.images_ischeck='1' and m.gender='0'"; $sql = $sql_male . " order by m.pic_num desc,m.bgtime desc limit 10"; $arr_diamond_male = $_MooClass['MooMySQL']->getAll($sql); foreach($arr_diamond_male as $k=>$v){ $diamond_str_male .= $v['uid'].','; } */ //$diamond_str=$diamond_str_female.$diamond_str_male; file_put_contents($diamond_filename, $diamond_str); } else { $arr_diamond = file($diamond_filename); if ($arr_diamond) { $star_user = trim($arr_diamond[0], ','); $star_user = explode(',', $star_user); if (count($star_user) == 10) { $star = $star_user[0] . ',' . $star_user[1] . ',' . $star_user[2] . ',' . $star_user[3] . ',' . $star_user[4] . ',' . $star_user[5] . ',' . $star_user[6] . ',' . $star_user[7] . ',' . $star_user[8] . ',' . $star_user[9]; //女钻石会员 enky need change $sql = "select m.uid,m.birthyear,m.province,m.city,m.nickname,b.mainimg,m.images_ischeck,i.introduce from {$dbTablePre}members_search m left join {$dbTablePre}members_base as b on m.uid=b.uid left join {$dbTablePre}members_introduce as i on m.uid=i.uid left join {$dbTablePre}members_choice c on m.uid=c.uid where m.uid in({$star}) limit 10"; //FEMAIL $param = "type=query/name=web_star_recommend/sql={$sql}/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); $arr_diamond = $GLOBALS['_MooBlock']['web_star_recommend']; /* $star_male=$star_user[10].','.$star_user[11].','.$star_user[12].','.$star_user[13].','.$star_user[14].','.$star_user[15].','.$star_user[16].','.$star_user[17].','.$star_user[18].','.$star_user[19]; //男钻石会员 enky need change $sql_male = "select m.uid,m.birthyear,m.province,m.city,m.nickname,b.mainimg,m.images_ischeck,i.introduce from {$dbTablePre}members_search m left join {$dbTablePre}members_base as b on m.uid=b.uid left join {$dbTablePre}members_introduce as i on m.uid=i.uid left join {$dbTablePre}members_choice c on m.uid=c.uid where m.uid in($star_male) limit 10"; //MAIL $param = ("type=query/name=web_star_recommend/sql=$sql_male/cachetime=86400"); $_MooClass['MooCache']->getBlock($param); $arr_diamond_male = $GLOBALS['_MooBlock']['web_star_recommend']; */ } } } } $diamond = array(); foreach ($arr_diamond as $v) { if (MooGetphoto($v['uid'], 'middle')) { $imgSrc = MooGetphoto($v['uid'], 'mid'); } else { $imgSrc = "module/index/templates/default/images/se_woman.gif"; } if ($v['nickname']) { $nickname = MooCutstr($v['nickname'], 6, ''); } else { $nickname = "ID:" . $v['uid']; } if ($v['birthyear'] == '') { $age = iconv('gbk', 'utf-8', "年龄:保密"); } else { $age = date('Y') - $v['birthyear'] . "岁"; } foreach ($provice_list as $key => $val) { if ($v['province'] == $key) { $PROVINCE = $val; break; } } foreach ($city_list as $key => $val) { if ($v['city'] == $key) { $CITY = $val; break; } } $diamond[] = array("uid" => $v['uid'], "imgSrc" => $imgSrc, "nickname" => $nickname, "age" => $age, "province" => $PROVINCE, "city" => $CITY); } //========================高级会员============================= $param = "type=query/name=members_advance/sql=SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg FROM {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid where s.s_cid='30' and s.images_ischeck=1 and s.is_lock=1 and s.showinformation=1 order by s.uid desc limit 8/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); $members_advance = isset($GLOBALS['_MooBlock']['members_advance']) ? $GLOBALS['_MooBlock']['members_advance'] : ''; $advance = array(); foreach ($members_advance as $v) { if (MooGetphoto($v['uid'], 'middle')) { $imgSrc = MooGetphoto($v['uid'], 'mid'); } else { $imgSrc = "module/index/templates/default/images/se_woman.gif"; } if ($v['nickname']) { $nickname = MooCutstr($v['nickname'], 6, ''); } else { $nickname = "ID:" . $v['uid']; } if ($v['birthyear'] == '') { $age = iconv('gbk', 'utf-8', "年龄:保密"); } else { $age = date('Y') - $v['birthyear'] . "岁"; } foreach ($provice_list as $key => $val) { if ($v['province'] == $key) { $PROVINCE = $val; break; } } foreach ($city_list as $key => $val) { if ($v['city'] == $key) { $CITY = $val; break; } } $advance[] = array("uid" => $v['uid'], "imgSrc" => $imgSrc, "nickname" => $nickname, "age" => $age, "province" => $PROVINCE, "city" => $CITY); } //========================成功案例============================= $storyList = array(); $param = "type=query/name=story/sql=select s.sid,s.uid,s.title,s.content,s.name1,s.name2,s.story_date,sp.img from `{$dbTablePre}story` as s left join `{$dbTablePre}story_pic` as sp on s.is_index=sp.mid where sp.syscheck=1 and s.syscheck=1 and s.recommand= '1' order by s.story_date desc,sp.img desc limit 0, 4/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); $story = $GLOBALS['_MooBlock']['story']; foreach ($story as $v) { $picsmall = MooGetstoryphoto($v['sid'], $v['uid'], 'medium'); if ($picsmall) { $imgSrc = "<img src=\"" . $picsmall . "\" width=\"211\" height=\"143\" /> "; } else { $imgSrc = "<img src=\"module/index/templates/default/images/story_sample.jpg\" width=\"211\" height=\"143\" />"; } $title = MooCutstr($v['title'], 18, $dot = ' '); $name1 = MooCutstr($v['name1'], 8, ''); $name1 = getSex($v['uid']) ? "她" . $name1 : "他" . $name1; $name2 = MooCutstr($v['name2'], 8, ''); $name2 = getSex($v['uid']) ? '她' . $name2 : '他' . $name2; $date = Date('Y-m-d', $v['story_date']); $content = MooCutstr($v['content'], 50, $dot = ' ...'); $storyList[] = array("sid" => $v['sid'], "imgSrc" => $imgSrc, "title" => $title, "name1" => $name1, "name2" => $name2, "date" => $date, "content" => $content); } // print_r($storyList);exit; MooPlugins('ipdata'); $ip = GetIP(); //$ip = '119.145.41.181'; $finally_ip = convertIp($ip); //$news_ip =iconv('gbk','utf-8',file_get_contents('http://fw.qq.com/ipaddress')); //$finally_ip = $news_ip; //echo $finally_ip; if (preg_match('/(广东|广州|深圳|佛山|珠海|东莞|汕头|韶关|江门|湛江|茂名|肇庆|惠州|梅州|汕尾|河源|清远|阳江|潮州|揭阳|云浮)/', $finally_ip)) { $finally_address = 1; } $time = time(); //活动时间 $activitytime1 = "2011-02-01 00:30:00"; $activitytime2 = "2011-02-08"; if ($time >= strtotime($activitytime1) && $time < strtotime($activitytime2)) { $appear = "1"; } // note 与相亲网首页错开会员 $api = MooGetGPC('api', 'string', "G"); if ($api == '0019') { $d = ''; foreach ($userList as $v) { if ($v['uid'] < 30000000) { $apistr .= $d . $v['uid']; $d = ','; } } exit($apistr); } $text_list = text_show(); //echo $province; require MooTemplate('public/index_test', 'module'); }
function showTablePies($where) { $mysql = dbConnect(); $stmt = $mysql->prepare("SELECT PIES.ID, PIES.IMIE, PIES.SUKA, PIES.OZNACZENIE, PIES.OJCIEC, PIES.MATKA, PIES.M_ID, PIES.R_ID, " . "MIOT.URODZONY, RASA.NAZWA " . "FROM PIES " . "JOIN MIOT ON MIOT.ID = PIES.M_ID " . "JOIN RASA ON RASA.ID = PIES.R_ID " . $where); $stmt->bind_result($id, $imie, $suka, $oznaczenie, $ojciec, $matka, $m_id, $r_id, $urodzony, $rasa); if (!$stmt) { die; } $stmt->execute(); echo 'Psy:<br>'; echo '<a href="nowy_pies.php">Dodaj nowego psa</a>'; echo '<table class="data">'; echo '<tr class="tableheader">'; echo '<th>ID</th>'; echo '<th>Imię</th>'; echo '<th>Płeć</th>'; echo '<th>Oznaczenie</th>'; echo '<th>Ojciec</th>'; echo '<th>Matka</th>'; echo '<th>ID miotu / data urodzenia</th>'; echo '<th>ID rasy</th>'; echo '</tr>'; while ($stmt->fetch()) { echo "<tr>"; echo "<td>" . primaryKeyLink('pies', $id) . "</td>"; echo "<td>" . $imie . "</td>"; echo "<td>" . getSex($suka) . "</td>"; echo "<td>" . $oznaczenie . "</td>"; echo "<td>" . $ojciec . "</td>"; echo "<td>" . $matka . "</td>"; echo '<td>' . foreignKeyLink('miot', $m_id, $urodzony) . '</td>'; echo '<td>' . foreignKeyLink('rasa', $r_id, $rasa) . '</td>'; echo "</tr>\n"; } echo "</table>\n"; $stmt->close(); }
public function searchuser() { $result = D('WeiboApi', 'weibo')->searchUser($this->data['key'], $this->mid, $this->since_id, $this->max_id, $this->count, $this->page); if (empty($result)) { $result = array(); } $allowed_key = array('ctime', 'domain', 'face', 'followed_count', 'followers_count', 'is_active', 'is_init', 'is_followed', 'location', 'mini', 'sex', 'uid', 'uname'); foreach ($result as $k => $v) { // 剔除敏感信息 foreach ($v as $k2 => $v2) { if (!in_array($k2, $allowed_key)) { unset($result[$k][$k2]); } } $result[$k]['timestamp'] = $v['ctime']; $result[$k]['ctime'] = date('Y-m-d H:i:s', $v['ctime']); $result[$k]['location'] = (string) $v['location']; $result[$k]['sex'] = getSex($v['sex']); } return $result; }
<?php echo "Czy na pewno chcesz usunąć następujący wpis?"; echo "<ul>"; $mysql = dbConnect(); $id = filter_input(INPUT_GET, "id", FILTER_SANITIZE_STRING); $stmt = $mysql->prepare("SELECT PIES.ID, PIES.IMIE, PIES.SUKA, PIES.OZNACZENIE " . "FROM PIES " . "WHERE PIES.ID=(?)"); $stmt->bind_param("i", $id); $stmt->bind_result($id, $imie, $suka, $oznaczenie); if (!$stmt) { die; } $stmt->execute(); if ($stmt->fetch()) { echo '<li>'; echo 'Pies: ' . $id . ', '; echo 'Imię: ' . $imie . ', '; echo 'Płeć: ' . getSex($suka) . ', '; echo 'Oznaczenie: ' . $oznaczenie . ', '; } else { echo 'Nie znaleziono psa'; } $stmt->close(); echo "</ul>"; echo "<a href=\"usun_pies_zatwierdz.php?id={$id}\">Usuń</a>"; ?> <?php include "footer.php"; ?>
function getUserSex($id) { $info = getUserInfo($id, 'sex'); $sex = getSex($list->sex); return $sex; }
function getUserSex($id) { $dao = D("User"); $list = $dao->find($id); $sex = getSex($list[sex]); return $sex; }