当前位置: 首页>>代码示例>>PHP>>正文


PHP Lookup::Gender方法代码示例

本文整理汇总了PHP中Lookup::Gender方法的典型用法代码示例。如果您正苦于以下问题:PHP Lookup::Gender方法的具体用法?PHP Lookup::Gender怎么用?PHP Lookup::Gender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lookup的用法示例。


在下文中一共展示了Lookup::Gender方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 //We're using 'r' for compatibility purposes
 //Get the first user's info
 $r = $personInfo[0];
 $fname = $r["fname"];
 //First Name
 $lname = $r["lname"];
 //Last Name
 $profile_pic = $r["profile_pic"];
 //Profile picture
 $join_date = $r["join_date"];
 //Join Date
 $dob = $r["dob"];
 //Date of Birth
 $gender_index = $r["gender"];
 //Gender
 $gender = Lookup::Gender($gender_index);
 //Gender string
 $pronoun = Lookup::Pronoun($gender_index);
 //Pronoun to describe user's gender
 $lastlogin = $r["last_login"];
 //Last time they were logged in
 $lastseen = json_decode($r["last_location"], true);
 //Last location they logged in
 $privacy = json_decode($r["privacy"], true);
 //The privacy array
 $privacy = !$privacy ? array() : $privacy;
 //If a load parameter is specified and this is 'image'
 if (isset($_GET["load"]) && $_GET["load"] == "image") {
     //We're just going to print the user's image
     header("Content-type: image/jpg");
     //Set JPG image header
开发者ID:Nickersoft,项目名称:eDart,代码行数:31,代码来源:profile.php

示例2: date

"/>
			<input type="text" id="user_dob"   name="dob"   class="datebox small_text uk-width-2-3" 	placeholder="Date of Birth"	value="<?php 
echo date("m/d/Y", $dob);
?>
 "/>

			<textarea id="user_bio" class="small_text uk-width-2-3" name="bio" placeholder="Enter a short bio here."><?php 
echo $bio;
?>
</textarea>

			<div class="uk-width-2-3 uk-align-center">
				<select id="user_gender" name="gender" class="chosen-select select small_text" data-placeholder="Gender"/>
					<option></option>
					<?php 
$gender_options = Lookup::Gender();
foreach ($gender_options as $gender_option) {
    ?>
							<option <?php 
    echo $gender_option["code"] == $gender_index ? "selected" : "";
    ?>
 ><?php 
    echo $gender_option["text"];
    ?>
</option>
					<?php 
}
?>
				</select>		
			</div>
			
开发者ID:Nickersoft,项目名称:eDart,代码行数:30,代码来源:edit.php

示例3: json_decode

$offers = $gotItem[0]['offers'];
$offers = json_decode($offers, true);
//Convert the status of the item to a number
$status = intval($gotItem[0]["status"]);
//Get info about the owner of the item
$authorUser = new User(array("action" => "get", "id" => $gotItem[0]["usr"]));
$userGet = $authorUser->run(true);
$profpic = $userGet[0]['profile_pic'];
//The owner's profile picture
$afname = $userGet[0]['fname'];
//The owner's first name
$alname = $userGet[0]['lname'];
//The owner's last name
$adob = $userGet[0]["dob"];
//The owner's date of birth
$agender = Lookup::Gender($userGet[0]["gender"]);
//The owner's gender
//Get other items in by this user
$other_itemReq = new Item(array("action" => "get", "filter" => array("usr" => $aid)));
$other_items = $other_itemReq->run();
//Get other items in this category
$sim_itemReq = new Item(array("action" => "get", "filter" => array("category" => $category)));
$sim_items = $sim_itemReq->run();
$user_items = array();
if (isset($_SESSION["userid"])) {
    //Get items available for offer
    $user_itemReq = new Item(array("action" => "get", "filter" => array("usr" => $_SESSION["userid"], "status" => "1")));
    $user_items = $user_itemReq->run();
}
//Store the owner's privacy settings in an array
$privacy = is_array(json_decode($userGet[0]["privacy"], true)) ? json_decode($userGet[0]["privacy"], true) : array();
开发者ID:Nickersoft,项目名称:eDart,代码行数:31,代码来源:view.php


注:本文中的Lookup::Gender方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。