<?php
// $Id: registration.html.php,v 1.9 2003/12/17 22:58:08 ronbakker Exp $
/**
* Content code
* @package Mambo Open Source
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.9 $
**/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

class HTML_registration {
	function lostPassForm($option) {
		?>
<table cellpadding="4" cellspacing="0" border="0" width="98%" class="contentpane">
  <form action="index.php" method="post">
    <tr>
      <td colspan="2" class="componentheading"><?php echo _PROMPT_PASSWORD; ?></td>
    </tr>
    <tr>
      <td colspan="2"><?php echo _NEW_PASS_DESC; ?></td>
    </tr>
    <tr>
      <td><?php echo _PROMPT_UNAME; ?></td>
      <td><input type="text" name="checkusername" class="inputbox" size="40" maxlength="25" /></td>
    </tr>
    <tr>
      <td><?php echo _PROMPT_EMAIL; ?></td>
      <td><input type="text" name="confirmEmail" class="inputbox" size="40" /></td>
    </tr>
    <tr>
      <td colspan="2"> <input type="hidden" name="option" value="<?php echo $option;?>" />
        <input type="hidden" name="task" value="sendNewPass" /> <input type="submit" class="button" value="<?php echo _BUTTON_SEND_PASS; ?>" /></td>
    </tr>
  </form>
</table>
<?php
	}

	function registerForm($option, $emailpass) {
?>
	<script language="javascript" type="text/javascript">
		function submitbutton() {
			var form = document.mosForm;
			var r = new RegExp("[^0-9A-Za-z]", "i");

			// do field validation
			if (form.name.value == "") {
				alert( "<?php echo _REGWARN_NAME;?>" );
			} else if (form.username.value == "") {
				alert( "<?php echo _REGWARN_UNAME;?>" );
			} else if (r.exec(form.username.value)) {
				alert( "<?php printf( _VALID_AZ09, _PROMPT_UNAME, 6 );?>" );
			} else if (form.email.value == "") {
				alert( "<?php echo _REGWARN_MAIL;?>" );
    <?php if ($emailpass=="0") { ?>
			} else if ((form.password.value != "") && (form.password.value != form.password2.value)){
				alert( "<?php echo _REGWARN_VPASS2;?>" );
			} else if (r.exec(form.password.value)) {
				alert( "<?php printf( _VALID_AZ09, _REGISTER_PASS, 6 );?>" );
    <?php } ?>
			} else {
				form.submit();
			}
		}
	</script>


<table cellpadding="5" cellspacing="0" border="0" width="98%" class="contentpane">

  <form action="index.php" method="POST" name="mosForm">

    <tr>
      <td colspan="2" width="100%" class="componentheading"><?php echo _REGISTER_TITLE; ?></td>
    </tr>

    <tr>

      <td width="30%"><?php echo _REGISTER_NAME; ?></td>
      <td width="70%"><input type="text" name="name" size="40" value="" class="inputbox" /></td>
    </tr>

    <tr>

      <td><?php echo _REGISTER_UNAME; ?></td>
      <td><input type="text" name="username" size="40" value="" class="inputbox" /></td>
    <tr>

      <td><?php echo _REGISTER_EMAIL; ?></td>
      <td><input type="text" name="email" size="40" value="" class="inputbox" /></td>
    </tr>

    <?php if ($emailpass=="0") { ?>

    <tr>

      <td><?php echo _REGISTER_PASS; ?></td>
      <td><input class="inputbox" type="password" name="password" size="40" value="" /></td>
    </tr>

    <tr>

      <td><?php echo _REGISTER_VPASS; ?></td>
      <td><input class="inputbox" type="password" name="password2" size="40" value="" /></td>
    </tr>

    <?php } else { ?>

    <tr>

      <td colspan="2"><?php echo _SENDING_PASSWORD; ?></td>
      <input type="hidden" name="password" value="" />
      <input type="hidden" name="password2" value="" />

	</tr>

    <?php } ?>


    <tr>
      <td colspan="2">&nbsp;</td>
    </tr>

    <tr>

      <td colspan=2>
  <input type="hidden" name="id" value="0" />
  <input type="hidden" name="gid" value="0" />
  <input type="hidden" name="emailpass" value="<?php echo $emailpass;?>" />
  <input type="hidden" name="option" value="<?php echo $option; ?>" />
  <input type="hidden" name="task" value="saveRegistration" />
  <input type="button" value="<?php echo _BUTTON_SEND_REG; ?>" class="button" onclick="submitbutton()" />
  </form></td>
		</tr>
</table>
<?php
	}
}
?>
