Location: PHPKode > scripts > PHP Hosting Directory > phphost_directoryv2/templates/profile_plan-update.html
{literal}
<script>
function selectItemInSelectBox(select_name, item_name)
{
	elements = document.form_addplan.elements;
	for (i = 0; i < elements.length; i++)
	{
		if (elements[i].name == select_name)
		{
			options = elements[i].options;
			for (j = 0; j < options.length; j++)
			{
				if (options[j].value == item_name)
				{
					options[j].selected = true;
				}
			}
		}
	}
}
</script>
{/literal}
<form name="form_addplan" action="{$BASE_URL}profile/plan-update/{$pid}" method="post">

{if $errors}
	{foreach from=$errors item=error}
	<tr>
		<td class="bodytext" colspan="2">
			<strong><li><font color="#FF4E00">{$error}</font></li></strong>
		</td>
	</tr>
	{/foreach}
{else}
	<tr>
		<td class="bodytext">
			<br>
		</td>
	</tr>
{/if}

<tr>
	<td class="bodytext">

		<table cellspacing="0" cellpadding="4" width="98%" border="0">
			<tr>
				<td class="bodytext" valign="top" width=140><b>Plan Name</b></td>
				<td class="bodytext"><input name="name" value="{$old.name}"></td>
			</tr>
			<tr>
				<td class="bodytext" valign="top"><b>List Plan in The</b></td>
				<td class="bodytext">
					<select size="1" name="category">
						{foreach from=$categories item=category}
						<option value="{$category.uin}">{$category.name}</option>
						{/foreach}
					</select> <b>Category</b>
				</td>
			</tr>
      <tr>
				<td class="bodytext" valign="top"><b>Monthly Price</b> ($)</td>
				<td class="bodytext"><input name="monthly_price" value="{$old.monthly_price}"></td>
			</tr>
			<tr>
				<td class="bodytext" valign="top"><b>Yearly Price</b> ($)</td>
				<td class="bodytext"><input name="yearly_price" value="{$old.yearly_price}" {if $old.noyearly}disabled{/if}></td>
			</tr>
			<tr>
				<td class="bodytext" valign="top"></td>
				<td class="bodytext"><input onClick="{literal}if (document.form_addplan.yearly_price.disabled==false) {document.form_addplan.yearly_price.disabled=true;} else {document.form_addplan.yearly_price.disabled=false;}{/literal}" type="checkbox" name="noyearly" {if $old.noyearly}checked{/if}> No Yearly Payment</td>
			</tr>
			<tr>
				<td class="bodytext" valign="top"><b>Webspace</b> (MB)</td>
				<td class="bodytext"><input name="webspace" value="{$old.webspace}"></td>
			</tr>
			<tr>
				<td class="bodytext" valign="top"><b>Data Transfer</b> (MB)</td>
				<td class="bodytext"><input name="datatransfer" value="{$old.datatransfer}" {if $old.nodatatransfer}disabled{/if}></td>
			</tr>
			<tr>
				<td class="bodytext" valign="top"></td>
				<td class="bodytext"><input onClick="{literal}if (document.form_addplan.datatransfer.disabled==false) {document.form_addplan.datatransfer.disabled=true;} else {document.form_addplan.datatransfer.disabled=false;}{/literal}" type="checkbox" name="nodatatransfer" {if $old.nodatatransfer}checked{/if}> Unmetered</td>
			</tr>
			<tr>
				<td class="bodytext" valign="top"><b>Operating System</b></td>
				<td class="bodytext">
					<select size="1" name="os">
						<option value="0" selected>Unix</option>
						<option value="1">NT</option>
					</select>
				</td>
			</tr>
			<tr>
				<td class="bodytext" valign="top"><b>Purchase URL</b></td>
				<td class="bodytext"><input size="35" value="{if $old}{$old.purchaseurl}{else}http://{/if}" name="purchaseurl"></td>
			</tr>
		</table>

		<table cellspacing="0" cellpadding="4" width="98%" border="0">
			<tr>
				<td class="bodytext" colspan=4><br><b>Services : Check All That Apply</b></td>
			</tr>

			{foreach from=$services_pair item=pair}
			<tr>
				{foreach from=$pair item=service}
				{if $service}
				<td align="right"><input type="checkbox" value="1" name="service_{$service.sid}" {if $service.value}checked{/if}></td>
				<td align="left">{$service.name}</td>
				{/if}
				{/foreach}
			</tr>
			{/foreach}

			<tr>
				<td colspan="4">
					<br><br>
					<input type="submit" value="Update Plan">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" onClick="{literal}return doConfirm('Do you really want delete this plan?'){/literal}" name="delete" value="Delete Plan">
					<br><br>
				</td>
			</tr>
		</table>
	</td>
</tr>
</form>
{literal}
<script>
selectItemInSelectBox('os', '{/literal}{$old.os}{literal}');
selectItemInSelectBox('category', '{/literal}{$old.category}{literal}');
</script>
{/literal}
Return current item: PHP Hosting Directory