{include file="header.tpl"}
<div class="box">
<div class="box_title" id="tba">Add Your Program (2/2)</div>
<div class="box_body">
{literal}
<script>
function validate() {
  var d = document.add_form;
  if (!d.name.value) {
    alert('Please enter your Site Name.');
    d.name.focus();
    return false;
  }
  if (!d.url.value) {
    alert('Please enter your Site URL.');
    d.url.focus();
    return false;
  }

  status = checkEmail(d.email.value);

  if (status > 0) {
    if (status == 1) alert('Please enter your E-Mail address!');
    if (status == 2) alert('Please enter a valid E-Mail address!');
    d.email.focus();
    return false;
  }
  return true;
}
</script>
{/literal}

{if $group.add_description}{$group.add_description}<br><br>{/if}
{if $errors}
{section name=e loop=$errors}
{if $errors[e].name == 'name'}<li style="color: red"> Please enter your Site Name<br>{/if}
{if $errors[e].name == 'url'}<li style="color: red"> Please enter your Site URL<br>{/if}
{if $errors[e].name == 'email'}<li style="color: red"> Please enter your Contact E-mail<br>{/if}
{if $errors[e].name == 'invalid_email'}<li style="color: red"> Please enter valid Contact E-mail<br>{/if}
{if $errors[e].name == 'turing'}<li style="color: red"> Please enter valid Turing Number<br>{/if}
{/section}
<br>
{/if}

<form method=post name="add_form" onsubmit="return validate()">
<input type="hidden" name="a" value="add">
<input type="hidden" name="action" value="save">
<input type="hidden" name="type" value="{$frm.type}">
<table cellspacing=1 cellpadding=2 border=0 width="100%">
<tr>
 <td width="30%">Listing Type:</td><td><b>{$group.name}</b></td>
</tr>
<tr>
 <td width="30%">* Site Name:</td><td><input type="text" name="name" value="{$frm.name|escape:html}" class=inpts size=50></td>
</tr>
<tr>
 <td>* Site URL:</td><td><input type="text" name="url" value="{$frm.url|escape:html}" class=inpts size=50></td>
</tr>
<tr>
 <td>* Contact E-mail:</td><td><input type="text" name="email" value="{$frm.email|escape:html}" class=inpts size=50></td>
</tr>
<tr>
 <td>Interest Percents:</td><td><input type="text" name="percents" value="{$frm.percents|escape:html}" class=inpts size=50></td>
</tr>
<tr>
 <td>Minimal Spend:</td><td><input type="text" name="min_spend" value="{$frm.min_spend|escape:html}" class=inpts size=50></td>
</tr>
<tr>
 <td>Maximal Spend:</td><td><input type="text" name="max_spend" value="{$frm.max_spend|escape:html}" class=inpts size=50></td>
</tr>
<tr>
 <td>Referral Bonus:</td><td><input type="text" name="referral" value="{$frm.referral|escape:html}" class=inpts size=50></td>
</tr>
<tr>
 <td>Withdrawal Type:</td>
 <td>
   <select name="withdrawal_type" class=inpts>
     <option value=1 {if $frm.withdrawal_type == 1}selected{/if}>Manual</option>
     <option value=2 {if $frm.withdrawal_type == 2}selected{/if}>Instant</option>
     <option value=3 {if $frm.withdrawal_type == 3}selected{/if}>Automatic</option>
   </select>
 </td>
</tr>
<tr>
 <td>Support E-mail:</td><td><input type="text" name="support_email" value="{$frm.support_email|escape:html}" class=inpts size=50></td>
</tr>
<tr>
 <td>Support Form:</td><td><input type="text" name="support_form" value="{$frm.support_form|escape:html}" class=inpts size=50></td>
</tr>
{section name=f loop=$forums}
<tr>
 <td>{$forums[f].name|escape} Forum:</td>
 <td><input type="text" name="forums[{$forums[f].name|escape}]" value="{$forums[f].url|escape:html}" class=inpts size=50></td>
</tr>
{/section}
<tr>
 <td>Support Phone:</td><td><input type="text" name="support_phone" value="{$frm.support_phone|escape:html}" class=inpts size=50></td>
</tr>
<tr>
 <td>Support AIM:</td><td><input type="text" name="support_aim" value="{$frm.support_aim|escape:html}" class=inpts size=50></td>
</tr>
<tr><td>Payment Methods:</td>
<td>{section name=p loop=$payments}
   <input type="checkbox" name="payments[{$payments[p].name}]" value="1" {if $payments[p].selected}checked{/if}> {$payments[p].name} <br>{/section}</td>
</tr>
<tr>
  <td>Options:</td>
  <td>{section name=p loop=$options} <input type="checkbox" name="options[{$options[p].name}]" value=1 {if $options[p].selected}checked{/if}> <img src="{"images/`$options[p].name`.gif"|encurl}" alt="{$options[p].name}" align="absmiddle" vspace="2"> <br>{/section}</td>
</tr>

<tr><td colspan=2>Program Description</td></tr>
<tr>
  <td colspan=2><textarea name="description" cols="85" rows="8" class="inpts">{$frm.description|escape:html}</textarea></td>
</tr>
<tr><td>&nbsp</td></tr>
<tr>
  <td colspan=2>* - required fields</td>
</tr>
<tr>
  <td colspan=2><input type="submit" value="Add Program to {$group.name} list" class="sbmt"></td>
</tr>
</table>
</form></div></div>
{include file="footer.tpl"}
