Location: PHPKode > projects > TLD Manager > tldmgr/domain_pick.php
<? 
	include("include/verify.php");
	setcookie("subdomain", "");
	setcookie("domain", "");
	setcookie("TLD", "");

	if ($domainpick) {
		setcookie("domainpick", "$domainpick");
	} else {
		$domainpick = $_COOKIE["domainpick"];
	}
	if (! $domainpick) { $domainpick = "my"; }
	$type = "My";
	if ($domainpick=="all") { $type="All"; }
?><html>
<head>
	<title><? echo $type; ?> Domains</title>
	<link type="text/css" rel="stylesheet" href="domain.css">
	<meta http-equiv="refresh" content="<? echo $login_expires+1; ?>">
	<script>function focus(){document.frm.newdomain.focus();}</script>
</head>

<body onload=focus()>
<form name=frm method="post" action="domain_chknew.php">
<input type="hidden" name="user_nick" value="<? echo $user_nick; ?>">
<input type="hidden" name="user_email" value="<? echo $user_email; ?>">
<?
	switch($fail) {
	case "invalid":
		$ERR = "Domain name is invalid";
		break;
	case "used":
		$ERR = "Domain is already registered";
		break;
	}

	$HEAD = "$type&nbsp;Domains";

	if (($user_level & 2) == 0) {
		$FOOT[0] = "type='button' value='LOGOFF' onclick='location.href=\"logout.php\"'";
		$FOOT[1] = "type='button' value='EDIT MY&#10;ACCOUNT' onclick='location.href=\"user_edit.php?nick=$user_nick\"'";
	} else {
		$FOOT[0] = "type='button' value='DONE' onclick='location.href=\"admin_menu.php\"' $seperator";
		$FOOT[1] = "type='button' value='LOGOFF' onclick='location.href=\"logout.php\"'";
		$FOOT[2] = "type='button' value='EDIT MY&#10;ACCOUNT' onclick='location.href=\"user_edit.php?nick=$user_nick\"'";
	}
	$FORM = TRUE;

	mysql_connect($db_host,$db_user,$db_pass);
	@mysql_select_db($db_name) or die( "Unable to select database \"$db_name @ $db_host\"");
	if ($domainpick == "all") {
		$query = "SELECT * FROM domain ORDER BY name";
	} else {
		$query = "SELECT * FROM domain WHERE owner='$user_nick' ORDER BY name";
	}
	$result = mysql_query($query);
	$count = 0;
	$num = mysql_numrows($result);

	include("header.php");
?>

					<table width=100% cellspacing=0 cellpadding=3 class="form1">
<? if ($num > 0) { ?>
						<tr>
							<td class="form3">NAME</td>
							<td class="form3">&nbsp;&nbsp;</td>
							<td class="form3">EXPIRES</td>
							<td class="form3">&nbsp;&nbsp;</td>
<? 	if ($domainpick == "all") { ?>
							<td class="form3">OWNER</td>
							<td class="form3">&nbsp;&nbsp;</td>
<? 	} ?>
							<td class="form3">&nbsp;</td>
							<td class="form3">&nbsp;</td>
							<td class="form3">&nbsp;</td>
						</tr>
<?
	}
	while ($count < $num) { 
		$domain = mysql_result($result,$count,"name");
		$TLD = mysql_result($result,$count,"TLD");
		$expire = mysql_result($result,$count,"expire");
?>
						<tr>
							<td><? echo "$domain.$TLD"; ?></td>
							<td></td>
							<td><? echo date("Y.m.d", $expire); ?></td>
							<td></td>
<? if ($domainpick == "all") { ?>
							<td><? echo mysql_result($result,$count,"owner"); ?></td>
							<td></td>
<? } ?>
							<td><a href="domain_menu.php?<? echo "domain=$domain&TLD=$TLD"; ?>"><img src="images/edit.png"></a></td>
							<td></td>
							<td><a href="domain_delete_confirm.php?<? echo "domain=$domain&TLD=$TLD"; ?>"><img src="images/delete.gif"></a></td>
						</tr>
<?
		$count++;
	}
	if ($domainpick != "all") {
?>
						<tr>
							<td colspan=2 style="border-top:1px solid #808080;" nowrap>
								<input name=newdomain type="text" size="30" value="<? echo $newdomain; ?>" title="newdomain(.com)"> .
								<select name="newtld" size="1">
<?
		$result = mysql_query("SELECT * FROM root");
		$count = 0;
		$num = mysql_numrows($result);
		while ($count < $num) { 
			$TLD = mysql_result($result,$count,"TLD");
			echo "								<option value=\"$TLD\"";
			if ($TLD == $newtld) { echo " SELECTED"; }
			echo ">$TLD</option>\n";
			$count++;
		}
?>
								</select>
							</td>
							<td colspan=5 class="form2" style="border-top:1px solid #808080;">
								<input type="image" src="images/regdomain.png">							
							</td>
						</tr>
<?
	} else {
		if ($num == 0) { echo "<tr><td nowrap class=\"form_err\">NO REGISTERED DOMAINS</td></tr>\n"; }
	}	
?>
					</table>

<? include("footer.php"); ?>
Return current item: TLD Manager