{if $add}
{assign var=title value="Add Product/Subscription"}
{else}
{assign var=title value="Edit Product/Subscription"}
{/if}
{include file="admin/header.inc.html"}
{include file="admin/js.inc.html"}
<center>
<br /><h3>{$title}</h3>

<a name="e">&nbsp;</a>
{if $error}
<table><tr><td>
{foreach from=$error item=e}
<li><font color=red><b>{$e}</b></font>
{/foreach}
</td></tr></table>
{/if}


<form method="post" action="products.php#e">
<table class="vedit" width="80%">
<tr>
    <th width=50%><b>Product #</b></th>
    <td> <b>{$p.product_id}</b></td>
</tr>
<tr>
    <th><b>Membership Name<font color=red>*</font></b><br /><small>Will be displayed to user</small></th>
    <td><input type=text name=title {if $p.title}value="{$p.title|escape}"{/if}> </td>
</tr>
<tr>
    <th><b>Description <font color=red>*</font></b><br /><small>Will be displayed to user<br />
    on signup page below the title</small></th>
    <td><textarea rows=5 cols=40 name=description>{$p.description|escape:"html"}</textarea> </td>
</tr>
<tr class="odd">
<td colspan=2 style='text-align: center; font-weight: bold'>Subscription Terms</td>
</tr>
<tr>
    <th><b>Monthly Subscription Fee<font color=red>*</font></b></th>
    <TD valign="middle">&nbsp; <input name="txtmsmfe"value="{$p.price}" type="text" class="inputbox" id="txtMSMFee" maxlength="10" >
     $</TD>
    </tr>
    <tr>
   <th><b>SMS alerts<font color=red>*</font></b></th></TD>
   <TD valign="middle">&nbsp; <input name="txtmsyfee"value="{$p.txtmsyfee}" type="text" class="inputbox" id="txtMSYFee" maxlength="8">
   </TD>
   </tr>
   <tr>
   <th><b>Max No. of Monitors Allowed</b></th>
  <TD valign="middle">&nbsp; <input name="txtnoofmonallowed"value="{$p.txtnoofmonallowed}" type="text" class="inputbox" id="txtNoOfMonAllowed" maxlength="10"></TD>
  </tr>
  <tr>
  <th><b>Allowed Monitor Intervels Upto</b></th>
 <TD valign="middle"> &nbsp;
 <select name="cbmilevel"value="" class="combobox" id="cbMILevel">
 <option value="{$p.cbmIlevel}">..</option>
 <option label="1 minute" value="1">1 minute</option>
<option label="5 minutes" value="5">5 minutes</option>
<option label="15 minutes" value="15">15 minutes</option>
<option label="30 minutes" value="30">30 minutes</option>
<option label="60 minutes" value="60">60 minutes</option>
 </select></TD></tr>
   <tr>
       <th><b>Allowed Monitering Locations </b></th>
       <TD valign="middle">
       {if $p.rbmultimonitor eq Y}
        <input name="rbmultimonitor" type="radio" value="Y" checked>
        All&nbsp;&nbsp; <input type="radio" name="rbmultimonitor" value="N" >
        Only Main Site
       {elseif $p.rbmultimonitor eq N }
       <input name="rbmultimonitor" type="radio" value="Y" >
          All&nbsp;&nbsp; <input type="radio" name="rbmultimonitor" value="N"checked >
            Only Main Site
      {else}
      <input name="rbmultimonitor" type="radio" value="Y" checked>
        All&nbsp;&nbsp; <input type="radio" name="rbmultimonitor" value="N">
        Only Main Site
      {/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Send Monthly Reports</b></th>
                        <TD valign="middle">
                             {if $p.rbmonthlyreports eq Y}
       <input name="rbmonthlyreports" type="radio" value="Y" checked>
                          Yes
                          <input type="radio" name="rbmonthlyreports" value="N">
                          No
       {elseif $p.rbmonthlyreports eq N }
     <input name="rbmonthlyreports" type="radio" value="Y">
     Yes
      <input type="radio" name="rbmonthlyreports" value="N" checked>
      No
      {else}
       <input name="rbmonthlyreports" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbmonthlyreports" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Can Send E-Mail Alerts</b></th>
                        <TD valign="middle"> {if $p.rbemailalerts eq Y}
       <input name="rbemailalerts" type="radio" value="Y" checked>
                          Yes
                          <input type="radio" name="rbemailalerts" value="N">
                          No
       {elseif $p.rbemailalerts eq N }
     <input name="rbemailalerts" type="radio" value="Y">
     Yes
      <input type="radio" name="rbemailalerts" value="N" checked>
      No
      {else}
       <input name="rbemailalerts" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbemailalerts" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b> Show Online Statistics</b></th>
                        <TD valign="middle">  {if $p.rbonlineStats eq Y}
       <input name="rbonlineStats" type="radio" value="Y" checked>
                          Yes
                          <input type="radio" name="rbonlineStats" value="N">
                          No
       {elseif $p.rbonlineStats eq N }
     <input name="rbonlineStats" type="radio" value="Y">
     Yes
      <input type="radio" name="rbonlineStats" value="N" checked>
      No
      {else}
       <input name="rbonlineStats" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbonlineStats" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Access To Control Panel</b></th>
                        <TD valign="middle">{if $p.rbcontrolpanel eq Y}
       <input name="rbcontrolpanel" type="radio" value="Y" checked>
                          Yes
                          <input type="radio" name="rbcontrolpanel" value="N">
                          No
       {elseif $p.rbcontrolpanel eq N }
     <input name="rbcontrolpanel" type="radio" value="Y">
     Yes
      <input type="radio" name="rbcontrolpanel" value="N" checked>
      No
      {else}
       <input name="rbcontrolpanel" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbcontrolpanel" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Can Check HTTP(80) Port</b></th>
                        <TD valign="middle"> {if $p.rbhttpcheck eq Y}
       <input name="rbhttpcheck" type="radio" value="Y" checked>
         Yes
         <input type="radio" name="rbhttpcheck" value="N">
         No
       {elseif $p.rbhttpcheck eq N }
     <input name="rbhttpcheck" type="radio" value="Y">
     Yes
      <input type="radio" name="rrbhttpcheck" value="N" checked>
      No
      {else}
       <input name="rbhttpcheck" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbhttpcheck" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Can Check SMTP(25) Port</b></th>
                        <TD valign="middle"> {if $p.rbsmtpcheck eq Y}
       <input name="rbsmtpcheck" type="radio" value="Y" checked>
         Yes
         <input type="radio" name="rbsmtpcheck" value="N">
         No
       {elseif $p.rbsmtpcheck eq N }
     <input name="rbsmtpcheck" type="radio" value="Y">
     Yes
      <input type="radio" name="rbsmtpcheck" value="N" checked>
      No
      {else}
       <input name="rbsmtpcheck" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbsmtpcheck" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Can Check POP3(110) Port</b></th>
                        <TD valign="middle">  {if $p.rbpop3check eq Y}
       <input name="rbpop3check" type="radio" value="Y" checked>
         Yes
         <input type="radio" name="rbpop3check" value="N">
         No
       {elseif $p.rbpop3check eq N }
     <input name="rbpop3check" type="radio" value="Y">
     Yes
      <input type="radio" name="rbpop3check" value="N" checked>
      No
      {else}
       <input name="rbpop3check" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbpop3check" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Can Check FTP(21) Port</b></th>
                        <TD valign="middle"> {if $p.rbftpcheck eq Y}
       <input name="rbftpcheck" type="radio" value="Y" checked>
         Yes
         <input type="radio" name="rbftpcheck" value="N">
         No
       {elseif $p.rbftpcheck eq N }
     <input name="rbftpcheck" type="radio" value="Y">
     Yes
      <input type="radio" name="rbftpcheck" value="N" checked>
      No
      {else}
       <input name="rbftpcheck" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbftpcheck" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Can Check Custom Port</b></th>
                        <TD valign="middle">
                            {if $p.rbcustomports eq Y}
       <input name="rbcustomports" type="radio" value="Y" checked>
         Yes
         <input type="radio" name="rbcustomports" value="N">
         No
       {elseif $p.rbcustomports eq N}
     <input name="rbcustomports" type="radio" value="Y">
     Yes
      <input type="radio" name="rbcustomports" value="N" checked>
      No
      {else}
       <input name="rbcustomports" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbcustomports" value="N">
         No{/if}  </TD>
                      </tr>
                      <tr>
                          <th><b>Can Check SSL Servers</b></th>
                        <TD valign="middle">  {if $p.rbssL eq Y}
       <input name="rbssL" type="radio" value="Y" checked>
         Yes
         <input type="radio" name="rbssL" value="N">
         No
       {elseif $p.rbcustomports eq N }
     <input name="rbssL" type="radio" value="Y">
     Yes
      <input type="radio" name="rbssL" value="N" checked>
      No
      {else}
       <input name="rbssL" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbssL" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Can Provide Additional Statistics</b></th>
                        <TD valign="middle"> {if $p.rbpublicstats eq Y}
       <input name="rbpublicstats" type="radio" value="Y" checked>
         Yes
         <input type="radio" name="rbpublicstats" value="N">
         No
       {elseif $p.rbpublicstatss eq N }
     <input name="rbpublicstats" type="radio" value="Y">
     Yes
      <input type="radio" name="rbpublicstats" value="N" checked>
      No
      {else}
       <input name="rbpublicstats" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbpublicstats" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Can Store Error Details</b></th>
                        <TD valign="middle">{if $p.rberrordetails eq Y}
       <input name="rberrordetails" type="radio" value="Y" checked>
         Yes
         <input type="radio" name="rberrordetails" value="N">
         No
       {elseif $p.rberrordetails eq N }
     <input name="rberrordetails" type="radio" value="Y">
     Yes
      <input type="radio" name="rberrordetails" value="N" checked>
      No
      {else}
       <input name="rberrordetails" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rberrordetails" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Can Monitor Via Ping Utility</b></th>
                        <TD valign="middle">{if $p.rbpingmonitoring eq Y}
       <input name="rbpingmonitoring" type="radio" value="Y" checked>
         Yes
         <input type="radio" name="rbpingmonitoring" value="N">
         No
       {elseif $p.rbpingmonitoring eq N }
     <input name="rbpingmonitoring" type="radio" value="Y">
     Yes
      <input type="radio" name="rbpingmonitoring" value="N" checked>
      No
      {else}
       <input name="rbpingmonitoring" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbpingmonitoring" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Can Show Customer Time </b></th
                        <TD valign="middle">  {if $p.rbcustomTimezone eq Y}
       <input name="rbcustomTimezone" type="radio" value="Y" checked>
         Yes
         <input type="radio" name="rbcustomTimezone" value="N">
         No
       {elseif $p.rbcustomTimezone eq N }
     <input name="rbcustomTimezone" type="radio" value="Y">
     Yes
      <input type="radio" name="rbcustomTimezone" value="N" checked>
      No
      {else}
       <input name="rbcustomTimezone" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbcustomTimezone" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Can Send Alerts To Multiple EMails</b></th>
                        <TD valign="middle"> {if $p.rbmultialerts eq Y}
       <input name="rbmultialerts" type="radio" value="Y" checked>
         Yes
         <input type="radio" name="rbmultialerts" value="N">
         No
       {elseif $p.rbmultialerts eq N }
     <input name="rbmultialerts" type="radio" value="Y">
     Yes
      <input type="radio" name="rbmultialerts" value="N" checked>
      No
      {else}
       <input name="rbmultialerts" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbmultialerts" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Can Send SMS Alerts</b></th>
                        <TD valign="middle">  {if $p.rbsmsalert eq Y}
       <input name="rbsmsalert" type="radio" value="Y" checked>
         Yes
         <input type="radio" name="rbsmsalert" value="N">
         No
       {elseif $p.rbsmsalert eq N }
     <input name="rbsmsalert" type="radio" value="Y">
     Yes
      <input type="radio" name="rbsmsalerts" value="N" checked>
      No
      {else}
       <input name="rbsmsalert" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbsmsalert" value="N">
         No{/if}</TD>
                      </tr>
                      <tr>
                          <th><b>Allow Additional Service Monitors</b></th>
                        <TD valign="middle">  {if $p.rbaddnlservicemonitors eq Y}
       <input name="rbaddnlservicemonitors" type="radio" value="Y" checked>
         Yes
         <input type="radio" name="rbaddnlservicemonitors" value="N">
         No
       {elseif $p.rbaddnlservicemonitors eq N }
     <input name="rbaddnlservicemonitors" type="radio" value="Y">
     Yes
      <input type="radio" name="rbaddnlservicemonitors" value="N" checked>
      No
      {else}
       <input name="rbaddnlservicemonitors" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbaddnlservicemonitors" value="N">
         No{/if} </TD>
                      </tr>
                      <tr>
                          <th><b>Status</b></th>
                        <TD valign="middle">   {if $p.rbstatus eq Y}
       <input name="rbstatus" type="radio" value="Y" checked>
         Yes
         <input type="radio" name="rbstatus" value="N">
         No
       {elseif $p.rbstatus eq N }
     <input name="rbstatus" type="radio" value="Y">
     Yes
      <input type="radio" name="rbstatus" value="N" checked>
      No
      {else}
       <input name="rbstatus" type="radio" value="Y" checked>
         Yes
       <input type="radio" name="rbstatus" value="N">
         No{/if} </TD>
                      </tr>
                      
                      <tr> 
<!-- -->
<!--<tr>
    <th><b>Price <font color=red>*</font></b><br />
    <small>Enter only digits (and period, if necessary).<br />
    Do not enter commas ',' or dollar sign '$'</small></th>
    <td><input type=text name=price {if $p.price ne ""}value="{$p.price|escape}"{/if}> </td>
</tr> -->

{*foreach from=$product_additional_fields item=f*}
{*if $f.type eq 'select'*}
<!-- <tr>
    <th><b>{*$f.title*}</b><br /><small>{*$f.description*}</small></th>
    {*assign var=field_name value=$f.name*}
    <td><select name="{$field_name|escape}" size='{$f.size}'>
    {*html_options options=$f.options selected=$p.$field_name*}
    </select>
    </td>
</tr>
{*elseif $f.type eq 'multi_select'*}
<tr>
    <th><b>{*$f.title*}</b><br /><small>{*$f.description*}</small></th>
    {*assign var=field_name value=$f.name*}
    <td><select name="{$field_name|escape}[]" size='{$f.size}' multiple>
    {*html_options options=$f.options selected=$p.$field_name*}
    </select>
    </td>
</tr>
{*elseif $f.type eq 'textarea'*}
<tr>
    <th><b>{$f.title}</b><br /><small>{*$f.description*}</small></th>
    {*assign var=field_name value=$f.name*}
    <td><textarea name="{$field_name|escape}" rows=5 cols=30>{*$p.$field_name*}</textarea>
    </td>
</tr>
{*elseif $f.type eq 'checkbox'*}
<tr>
    <th><b>{$f.title}</b><br /><small>{$f.description}</small></th>
    {assign var=field_name value=$f.name}
    <td><input type="hidden" name="{$field_name}" value="" />
    <input type="checkbox" style='border-width: 0px' name="{$field_name}" value=1 {if $p.$field_name}checked{/if} />
    </td>
</tr>
{*elseif $f.type eq 'period'*}
<tr>
    <th><b>{$f.title}</b><br /><small>{$f.description}</small></th>
    {assign var=field_name value=$f.name}
    <td>
    {if $field_name eq "expire_days"}
    <input type="text" name="{$field_name}[count]" id="{$field_name}[count]" 
        value="{$p.$field_name.count}" size="12" maxlength="10" />
    <select name="{$field_name}[unit]" name="{$field_name}[unit]" size="1" >
    {html_options options=$period_options selected=$p.$field_name.unit}
    </select>
    {else}
    <input type="text" name="{$field_name}[count]" id="{$field_name}[count]" 
        value="{$p.$field_name.count}" size="4"  />
    <select name="{$field_name}[unit]" name="{$field_name}[unit]" size="1" >
    {html_options options=$trial_period_options selected=$p.$field_name.unit}
    </select>

    {/if}
    </td>
</tr>
{*elseif $f.type eq "header"*}
<tr class="odd">
<td colspan=2 style='text-align: center; font-weight: bold'>{$f.title}</td>
</tr>
{*elseif $f.type eq 'hidden'*}
{*else*}
<tr>
    <th><b>{$f.title}</b><br /><small>{$f.description}</small></th>
    {assign var=field_name value=$f.name}
    <td><input type=text name={$field_name} {if $p.$field_name ne ""}value="{$p.$field_name|escape}"{/if}
    {if $f.size}size="{$f.size|escape}"{/if}
    id="t_{$f.name|escape}">
    {if $f.name eq 'terms'}
    <div class="small"><b>Default:</b> {$p.terms_default|escape}<br />
    <i>(will be automatically updated according to change of product settings)</i>
    </div>
    {/if}
    </td>
</tr>-->
{*/if*}
{*/foreach*}
<!-- -->
</table>
<script language="javascript">
  frm = document.forms[0];
  el = frm.signup_email_checkbox;
  if (el)
    x = (el.checked) ? showLayer('signup_email_div') : hideLayer('signup_email_div');
</script>

<br />
<input type=submit value="&nbsp;&nbsp;&nbsp;&nbsp;Save&nbsp;&nbsp;&nbsp;&nbsp;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=button value="&nbsp;&nbsp;&nbsp;&nbsp;Back&nbsp;&nbsp;&nbsp;&nbsp;" onclick="history.back(-1)">
<input type=hidden name=action value={if $add}add_save{else}edit_save{/if}>
     
<input type=hidden name=product_id value="{$p.product_id|escape}">

<br /><br />
<!--
<table class="vedit" width="80%">
<tr class="odd"><td colspan=2 align="center"><b>E-Mail Settings</b></td></tr>
<tr>
    <th width=50%><b>Use Customized Signup E-Mail</b><br />
    <small>use special e-mail message for this product</small></th>
    <td>
    <a name="send_signup_mail"></a>
    {if !$p.product_id}
    <i>Please save new product first, then click Edit to change this option</i>
    {else}
    <input type=checkbox name="signup_email_checkbox" onclick="this.checked ? showLayer('signup_email_div') : hideLayer('signup_email_div')"
    {if $send_signup_mail_tpl}checked{/if}>
    <span id="signup_email_div" style="{if !$send_signup_mail_tpl}visibility: hidden{/if}">
    <a href="email_templates.php?a=edit&tpl=send_signup_mail&product_id={$p.product_id}">Edit E-Mail Template</a>
    / <a href="email_templates.php?a=del&tpl=send_signup_mail&product_id={$p.product_id}" onclick="return confirm('Are you sure?')">Delete</a>

    </span>
    {/if}
    </td>
</tr>
<tr>
    <th><b>Expire Notifications</b><br />
    <small>user can receive automatic emails<br />
    after signup. You can setup series of emails<br />
    to be sent.<br />
    Is there are any templates entered, templates from<br />
    aMember CP->Setup->E-Mail:Expire Notifications<br />
    will be ignored for this product<br />
     0 - send message in the day of expiration<br />
     1 - send message one day after expiration<br />
    -2 - send message 2 days before expiration<br />
    </small>
    </th><td valign="top">
    <a name="mail_expire"></a>

    <label for="dme0">
    <input id="dme0" type=radio name="dont_mail_expire" value='' style="border: none;" {if $p.dont_mail_expire eq ""}checked{/if} />
    Use default setting (aMember CP->Setup->E-Mail)</label><br />

    <label for="dme1" >
    <input id="dme1" type=radio name="dont_mail_expire" value='1' style="border: none;" {if $p.dont_mail_expire eq "1"}checked{/if} />
    Do not email expiration notices for this product (regardless of global setting)</label><br />

    <label for="dme2" >
    <input id="dme2" type=radio name="dont_mail_expire" value='2' style="border: none;" {if $p.dont_mail_expire eq "2"}checked{/if} />
    EMail expiration notices for this product (regardless of global setting)</label><br />

    <br />


    {if !$p.product_id}
    <i>Please save new product first, then click Edit to change this option</i>
    {elseif !$config.demo}
    {$mail_expire_field}
    {/if}
    </td>
</tr>
{if !$config.demo}
<tr>
    <th><b>Send Automatic Emails</b><br />
    <small>user can receive automatic emails<br />
    after signup. You can setup series of emails<br />
    to be sent.<br />
    0 - message will be sent immediately after purchase<br />
    2 - message will be sent 2 days after purchase<br />
    </small>
    </th><td valign="top">

    <a name="mail_autoresponder"></a>
    {if !$p.product_id}
    <i>Please save new product first, then click Edit to change this option</i>
    {else}
    {$mail_autoresponder_field}
    {/if}
    </td>
</tr>
{/if}
</table>


<br />
<input type=submit value="&nbsp;&nbsp;&nbsp;&nbsp;Save&nbsp;&nbsp;&nbsp;&nbsp;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=button value="&nbsp;&nbsp;&nbsp;&nbsp;Back&nbsp;&nbsp;&nbsp;&nbsp;" onclick="history.back(-1)">

-->
</form>
{*if defined('INCREMENTAL_CONTENT_PLUGIN')}{include file="../plugins/protect/incremental_content/product.html"}{*/if*}
</center>
{include file="admin/footer.inc.html"}
