Location: PHPKode > projects > web-cp - Web Hosting Control Panel > webcp/web/reseller/newdomain.phps
<?
// If data is set (i.e the submit button has been hit) and $action != 'newaccount' (setup exception)
if (isset($data) AND $action != 'newaccount') {
	if (is_array($data)) {
		// remove spaces and slashes.
		while (list($key, $val) = each($data)) {
			if ($key != 'serverside')
				$data[$key] = trim(stripslashes($val));
		}
		
		// HARDCODED $data['id'], $data['type'];
		$data['id'] = $resellerdata['id'];
		$data['type'] = 'domain';
		
		$error = domain("create",$data,$return);
		if ($error)
			echo "<br>&nbsp;&nbsp;• ".implode("<br>\n&nbsp;&nbsp;• ",$error)."<br>\n";
		else
			echo "<br><div align='center'>".$T['domain created']."<a href='./?cp=domain&url=newuser&number=$return' target='_top'><b>".$data['hostname'].".".$data['domain']."</b></a>.</div><br>\n";
	}
}
?>
<div align="center">
<form action="<?=$current_url;?>" method="post" name="webcp" onSubmit="submitonce(this);">
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
<table border="0" cellpadding="0" cellspacing="0" class="tblbg"><tr><td>
<table border="0" cellspacing="1">
	<tr>
		<td colspan="2" class="tbltop">&nbsp;<?=$T[$cp][$url];?>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['IP Address'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<select name="data[ip_addr]">
		<?
		$tmp = explode(" ",$resellerdata['ip']);
		
		do {
			echo '<option value="'.trim(current($tmp)).'"';
			if ($data['ip_addr'] == current($tmp)) echo " SELECTED";
			echo '> '.current($tmp).'</option>';
			echo "\n";
		} while(next($tmp));
	
		?></select>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Hostname'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[hostname]" size="25" maxlength="255" value="<? if(!$data['hostname']) echo "www"; else echo $data['hostname'];?>">&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Domain Name'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[domain]" size="25" maxlength="255" value="<?=$data['domain'];?>">&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Hostname Aliases'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[aliases]" size="25" maxlength="255" value="<?=$data['aliases'];?>">&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Default Root'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[defaultroot]" size="25" maxlength="255" value="<? if($data['defaultroot']) echo $data['defaultroot']; else echo "/www/web/%USER%";?>">&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Domain Alias'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="checkbox" name="data[nohost]" value="true" CHECKED>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Catch all Aliases'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="checkbox" name="data[catchall]" value="true">&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Redirect'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="checkbox" name="data[redirect]" value="true" CHECKED>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Num Users'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[users]" size="5" maxlength="255" value="<? if($data['users']) echo intval($data['users']); else echo 10;?>">&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['HD Quota'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[hd]" size="5" maxlength="255" value="<? if($data['hd']) echo intval($data['hd']); else echo 50;?>"> <?=$T['mb'];?>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Transfer Quota'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[transfer]" size="5" maxlength="255" value="<? if($data['transfer']) echo intval($data['transfer']); else echo 2;?>"> <?=$T['gb'];?>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Num Subdomains'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[subdomains]" size="5" maxlength="255" value="<? if(isset($data['subdomains'])) echo intval($data['subdomains']); else echo 2;?>">&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Num Pointers'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[pointers]" size="5" maxlength="255" value="<? if(isset($data['pointers'])) echo intval($data['pointers']); else echo 1;?>">&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Num Databases'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[databases]" size="5" maxlength="255" value="<? if(isset($data['databases'])) echo intval($data['databases']); else echo 5;?>">&nbsp;</td>
	</tr>
	<? if ($cfg['bandwidth']) { ?>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Bandwidth'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[bandwidth]" size="5" maxlength="255" value="<? if($data['bandwidth']) echo intval($data['bandwidth']); else echo '0';?>"> <?=$T['kbps'];?>&nbsp;</td>
	</tr>
	<? } ?>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Server Side Options'];?>&nbsp;</b></td>
		<td class="row2"><table border="0" cellpadding="0" cellspacing="0">
		<?
		if (strstr($cfg['sslang'],",")) $sslang = explode(",",$cfg['sslang']);
		else $sslang[0] = $cfg['sslang'];

		$j = 0;
		while ($sslang[$j]) {
			echo "<tr><td class='row2'>&nbsp;".$T['ss'][trim($sslang[$j])]."&nbsp;</td><td class='small'>\n";
			if ($resellerdata['serverside'][trim($sslang[$j])] != "on")
				echo '&nbsp;<input type="radio" name="data[serverside]['.trim($sslang[$j]).']" value="na" CHECKED>'.$T['na'];
			else {
				echo '&nbsp;<input type="radio" name="data[serverside]['.trim($sslang[$j]).']" value="na">'.$T['na'];
				echo '&nbsp;<input type="radio" name="data[serverside]['.trim($sslang[$j]).']" value="on">'.$T['on'];
				echo '&nbsp;<input type="radio" name="data[serverside]['.trim($sslang[$j]).']" value="off" CHECKED>'.$T['off'];
			}
			echo "\n</td></tr>\n";
			++$j;
		}
	?>
	
	</table></tr>
	<?
	if ($resellerdata['shell'] == "on") {
		?>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Shell Access'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="radio" name="data[shell]" value="on"><?=$T['on'];?>
		<input type="radio" name="data[shell]" value="off" checked><?=$T['off'];?>&nbsp;</td>
	</tr>
	<? } ?>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Domain Contact E-Mail'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[email]" size="25" maxlength="255" value="<?=$data['email'];?>">&nbsp;</td>
	</tr>
</table>
</td></tr></table><br>
<div align="right"><input type="submit" value="<?=$T['submit'];?>"></div>
</td></tr></table>
</form>
</div>
Return current item: web-cp - Web Hosting Control Panel