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


PHP Members::getByID方法代码示例

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


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

示例1:

 *
 * You should have received a copy of the GNU General Public License
 * along with Pusthaka.  If not, see <http://www.gnu.org/licenses/>.
 */

	$allow = "ADMIN;LIBSTAFF";
//$allow = "ADMIN";
	$PageTitle = "Edit Member";
	require('../inc/init.php');

	$mem = new Members;
	
	// DELETE Member
	if(isset($_REQUEST['BtnDeleteMember'])){
		$mid = $_REQUEST['mid'];
		$member = $mem->getByID($mid);		
		$mem->delete($member);
	}


	// Update member /////////////////////////////////////////////////////
	if(isset($_REQUEST['BtnUpdateMember'])){
		//[Fill a member data object] ------------------------------
		$member['mid'] = $_REQUEST['mid'];
		$member['mem_no'] = $_REQUEST['mem_no'];
		$member['type'] = $_REQUEST['type'];
		$member['surname'] = $_REQUEST['surname'];
		$member['firstnames'] = $_REQUEST['firstnames'];
		$member['title'] = $_REQUEST['title'];
		$member['address'] = $_REQUEST['address'];
		$member['nic'] = $_REQUEST['nic'];
开发者ID:nalaka,项目名称:pusthaka1,代码行数:31,代码来源:member_edit.php

示例2: sprintf

			
		  $sql = sprintf("update member set password='%s' WHERE mid=%d", md5($password), $mid);
		  $a = executeSqlNonQuery($sql);
		  $rowcount = $a['rows'];
		  if ($rowcount <> 1) {
			  $_SESSION['BackLink'] = $_SERVER['PHP_SELF'];
			  trigger_error("An error occured while changing password: ID=" . $mid, E_USER_ERROR);
			  exit();
		  } else {
				$_SESSION['msg'] = "Your password was changed.";
				header("Location: my_info.php");
				exit();
		  }
	} //END: Change Password

	$row = $mem->getByID($_SESSION['CurrentUser']['mid']);
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Pusthaka: <?php echo $PageTitle; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/styles.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
<!--
	function checkPwd(){
		obj = document.resetpwd;
		if(obj.pwd.value != obj.pwd2.value){
			alert('The passwords do not match');
			obj.pwd.value='';
开发者ID:nalaka,项目名称:pusthaka1,代码行数:30,代码来源:my_info.php

示例3: require

 */

	$allow = "ADMIN;LIBSTAFF";
	$PageTitle = "Member Info";
    require('../inc/init.php');

	//[Is this a proper request?] ------------------------------
	if(!isset($_REQUEST['ID'])){
		header("Location: member_browse.php");
		exit();
	}

    //[Get member] ------------------------------
    $id = $_REQUEST['ID'];
    $mem = new Members;
    $row = $mem->getByID($id);


	//[Get loan info] ------------------------------
    require('../classes/Loans.php');
    $loans = new Loans;
    $rsL = $loans->getCurrentLoansByMember($row);
	$rowcountL = mysql_num_rows($rsL);

	$rsLH = $loans->getPastLoansByMember($row);
	$rowcountLH = mysql_num_rows($rsLH);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>ULMS Members : Search Results </title>
开发者ID:nalaka,项目名称:pusthaka1,代码行数:31,代码来源:member_view.php

示例4: CancelReservation

	function CancelReservation($rid){ // returns a status message
		$sql = sprintf("UPDATE reservation SET status='Cancelled' WHERE rid=%d",$rid);
		$a = executeSqlNonQuery($sql);
		$rows_updated = $a['rows'];
		if($rows_updated != 1){
			return "ERROR: couldn't cancel reservation";
		} else{ // Cancelled, update other reservations        			
            $reservation = $this->GetByID($rid);
			require_once('Members.php'); $clsM = new Members;
            $rowMember = $clsM->getByID($reservation['mid']);
            require_once('Books.php'); $clsB = new Books;
            $rowBook = $clsB->getBookByID($reservation['bid']);
            
            $des = '[' . $rowBook['title'] . ' by ' . $rowBook['authors'] . ']' .  
				' <== [' . $rowMember['mid'] . '] ' . $rowMember['title'] . ' ' . $rowMember['firstnames'] . ' ' . $rowMember['surname'];
			logEvent('RESERVATION_CANCELLED', $_SESSION['CurrentUser']['mid'], $rowMember['mid'], addslashes($des));
        
			$sql = "SELECT * FROM reservation WHERE rid=" . $rid;
			$rs = executeSqlQuery($sql);
			$r = mysql_fetch_assoc($rs);
			$cid = $r['cid'];
			
			if($cid>0){			
				$sql = sprintf("select c.*, b.* FROM (copy c LEFT JOIN book b ON  c.bid = b.bid) WHERE c.cid=%d", $cid);
				$rs = executeSqlQuery($sql);
				$rowCopy = mysql_fetch_assoc($rs);
				return $this->updateReservations($rowCopy);
			}
						
			return "Reservation cancelled";
		}
	}
开发者ID:nalaka,项目名称:pusthaka1,代码行数:32,代码来源:Reservations.php


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