Location: PHPKode > projects > web-cp - Web Hosting Control Panel > webcp/web/reseller/resellerset.phps
<?
// If data is set (i.e the submit button has been hit)
if (isset($data)) {
	if (is_array($data)) {
		// remove spaces and slashes.
		while (list($key, $val) = each($data)) {
			if ($key != 'serverside')
				$data[$key] = trim(stripslashes($val));
		}
		
		// Harcode reseller ID
		$data['id'] = $resellerdata['id'];
		
		// Update system
		$error = reseller("update",$data,$return);
		if ($error)
			echo "<br>&nbsp;&nbsp;• ".implode("<br>\n&nbsp;&nbsp;• ",$error)."<br>\n";
		else
			echo "<br><div align='center'>".$T['reseller updated']."</b></div><br>\n";
			
		// Reload $resellerdata
		$resellerdata = fetchdata("*","reseller",$resellerdata['id']);
	}
}
?>
<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['Name'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[name]" size="25" maxlength="255" value="<?=$resellerdata['name'];?>">&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Email'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<input type="text" name="data[email]" size="25" maxlength="255" value="<?=$resellerdata['email'];?>">&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['IP Addresses'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<? if ($userdata['level'] < 2) { ?><textarea name="data[ip]" cols="19" rows="3" wrap="virtual"><?=$resellerdata['ip'];?></textarea><? } else echo $resellerdata['ip'];?>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Num Domains'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<? if ($userdata['level'] < 2) { ?><input type="text" name="data[domains]" size="5" maxlength="255" value="<?=intval($resellerdata['domains']);?>"><? } else echo intval($resellerdata['domains']);?>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Num Subdomains'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<? if ($userdata['level'] < 2) { ?><input type="text" name="data[subdomains]" size="5" maxlength="255" value="<?=intval($resellerdata['subdomains']);?>"><? } else echo intval($resellerdata['subdomains']);?>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Num Pointers'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<? if ($userdata['level'] < 2) { ?><input type="text" name="data[pointers]" size="5" maxlength="255" value="<?=intval($resellerdata['pointers']);;?>"><? } else echo intval($resellerdata['pointers']);?>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['HD Quota'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<? if ($userdata['level'] < 2) { ?><input type="text" name="data[hd]" size="5" maxlength="255" value="<?=intval($resellerdata['hd']);?>"><? } else echo intval($resellerdata['hd']);?> <?=$T['mb'];?>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Num Users'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<? if ($userdata['level'] < 2) { ?><input type="text" name="data[users]" size="5" maxlength="255" value="<?=intval($resellerdata['users']);?>"><? } else echo intval($resellerdata['users']);?>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Num Databases'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<? if ($userdata['level'] < 2) { ?><input type="text" name="data[databases]" size="5" maxlength="255" value="<?=intval($resellerdata['db']);?>"><? } else echo intval($resellerdata['db']);?>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Transfer'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<? if ($userdata['level'] < 2) { ?><input type="text" name="data[transfer]" size="5" maxlength="255" value="<?=intval($resellerdata['transfer']);?>"><? } else echo intval($resellerdata['transfer']);?> <?=$T['gb'];?>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Shell Access'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<? if ($userdata['level'] < 2) { ?><input type="radio" name="data[shell]" value="on"<?if ($resellerdata['shell'] == 'on') echo ' checked';?>> <?=$T['on'];?>&nbsp;&nbsp;<input type="radio" name="data[shell]" value="off"<?if ($resellerdata['shell'] == 'off') echo ' checked';?>> <?=$T['off'];?><? } else echo $T[$resellerdata['shell']];?>&nbsp;</td>
	</tr>
	<? if ($cfg['bandwidth']) { ?>
	<tr>
		<td class="row1"><b>&nbsp;<?=$T['Bandwidth'];?>&nbsp;</b></td>
		<td class="row2">&nbsp;<? if ($userdata['level'] < 2) { ?><input type="text" name="data[bandwidth]" size="5" maxlength="255" value="<?=intval($resellerdata['bandwidth']);?>"><? } else echo intval($resellerdata['bandwidth']);?> <?=$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]) {
			if ($userdata['level'] < 2) { 
				unset($check);
				if ($resellerdata['serverside'][trim($sslang[$j])] == 'on')
					$check['on'] = ' checked';
				else
					$check['off'] = ' checked';
					
				echo "<tr><td class='small'>&nbsp;<b>".$T['ss'][trim($sslang[$j])]."</b>&nbsp;</td><td class='small'>\n";
				echo '&nbsp;<input type="radio" name="data[serverside]['.trim($sslang[$j]).']" value="on"'.$check['on'].'>'.$T['on'];
				echo '&nbsp;<input type="radio" name="data[serverside]['.trim($sslang[$j]).']" value="off"'.$check['off'].'>'.$T['off'];
				echo "\n</td></tr>\n";
			}
			else {
				echo "<tr><td class='small'>&nbsp;<b>".$T['ss'][trim($sslang[$j])]."</b>&nbsp;</td><td class='small'>\n";
				echo $T[$resellerdata['serverside'][trim($sslang[$j])]];
				echo "\n</td></tr>\n";
			}
			++$j;
		}
		?></table></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