<? 

function mbr_form()
{
global $table_mb, $subscr_url, $memb_acc_act, $feembshp, $mbrshp_per, $crcrdprocss,
$html_signup, $html_highlight, $ch_numtp, $mb_max_nads, $mb_checktime,  
$welc_mb_email, $act_mb_subj;


echo "
<p>
<a href='admconf.php'><b>Top:</b></a><br>
<form action='admconf.php?mdopt=savembr' method='post'>

<table width='100%'    border='0' cellspacing='1' cellpadding='0'> 
<tr><td  class='frmft1'>
 &nbsp; Setting Membership Options
</td></tr></table><p>

<table width='100%'><tr><td>
Name of database table for members' entries:<br> 
<input type='text' name='table_mb' value='".opt_qt($table_mb)."' class='formst'>

<p>
URL for sumbitting membership information by users:<br> 
<input type='text' name='subscr_url' value='".opt_qt($subscr_url)."' class='formst' size='80'>
 
<p>
";

if ($memb_acc_act=="0"){$slval="after subscribing by users";}
if ($memb_acc_act=="e"){$slval="after clicking on special link sent to users' e-mails";}
if ($memb_acc_act=="a"){$slval="after approving by admin";}
if ($memb_acc_act=="c"){$slval="after on-line credit card processing";}

echo "
 Membership account will be active:<br>
<select name='memb_acc_act' class='formst'>
<option value=".opt_qt($memb_acc_act).">$slval<checked>
<option value='0'>after subscribing by users
<option value='e'>after clicking on special link sent to users' e-mails
<option value='a'>after approving by admin
<option value='c'>after on-line credit card processing
</select>

<p> 
Fee based membership subscribing <br> with membership period:<br>
<select name='feembshp' class='formst'>
<option>".opt_qt($feembshp)."<checked><option>yes<option>no</select>

<p> 
Set up membership period (days):<br> 
<input type='text' name='mbrshp_per' value='".opt_qt($mbrshp_per)."' class='formst'>

<p>
Set up URL for  payment page:<br>
<input type='text' name='crcrdprocss' value='".opt_qt($crcrdprocss)."' class='formst' size='80'>
 
<p> 
HTML code for on-line payment:<br>
<textarea rows='10' cols='80' name='html_signup' wrap=off class=formst>".opt_qt($html_signup)."</textarea>
 
<p>
HTML code for highlighting ads:<br>
<textarea rows='10' cols='80' name='html_highlight' wrap=off class=formst>".opt_qt($html_highlight)."</textarea>
 
<p>
 Check number of placed ads per time period by each member:<br>
<select name='ch_numtp' class='formst'>
<option>".opt_qt($ch_numtp)."<checked><option>yes<option>no</select>
 
<br>
If you set up 'yes', set up max number of ads allowed to place:<br>
<input type='text' name='mb_max_nads' value='".opt_qt($mb_max_nads)."' class='formst'> 
<br>
and time period (days) for check:<br>
<input type='text' name='mb_checktime' value='".opt_qt($mb_checktime)."' class='formst'>

<p>
Set up message for welcome e-mail with membership activating link:<br>
(!--templates--! will be replaced by real values)<br>
<textarea rows='10' cols='80' name='welc_mb_email' wrap=off class=formst>".opt_qt($welc_mb_email)."</textarea>
 
<p>
Set up subject line for activating e-mail:<br> 
<input type='text' name='act_mb_subj' value='".opt_qt($act_mb_subj)."' class='formst' size='80'>

<p>
<input type='submit' value='Save Options' class='formst1'>
 
</form>
</td></tr></table>

";
}

 
function savembr()
{
global $opt_post, $conf_dir, $opt_header, $opt_footer;

$cfgstr=save_opt("table_mb");
$cfgstr=$cfgstr.save_opt("subscr_url");
$cfgstr=$cfgstr.save_opt("memb_acc_act");
$cfgstr=$cfgstr.save_opt("feembshp");
$cfgstr=$cfgstr.save_opt("mbrshp_per");
$cfgstr=$cfgstr.save_opt("crcrdprocss");
$cfgstr=$cfgstr.save_opt("html_signup");
$cfgstr=$cfgstr.save_opt("html_highlight");
$cfgstr=$cfgstr.save_opt("ch_numtp");
$cfgstr=$cfgstr.save_opt("mb_max_nads");
$cfgstr=$cfgstr.save_opt("mb_checktime");
$cfgstr=$cfgstr.save_opt("welc_mb_email");
$cfgstr=$cfgstr.save_opt("act_mb_subj");

$cfgstr="<?
$cfgstr
?>";

savecfl($cfgstr, "conf_mbr.php");
echo "
<p>&nbsp;<p><font class='fntmsg1'>Membership options  have been saved successfully!</font> 
<p>
 
";
}

?>