if ($_POST['txtpass'] == NULL) { $loi[] = ERROR_EMPTY_PASS; } else { if ($_POST['txtpass'] != $_POST['txtpass2']) { $loi[] = ERROR_NOTMATCHES; } else { $p = $_POST['txtpass']; } } $l = $_POST['level']; if ($u && $p && $l) { $a = new User(); $a->set_user($u); $a->set_pass($p); $a->set_level($l); if ($a->insert_user() == FALSE) { $loi[] = "Sorry, Your username has been register, please try again"; } else { ob_end_clean(); header("location:index.php?module=user&act=list"); exit; } } } ?> <form action="index.php?module=user&act=add" method="post"> <fieldset> <legend>Add A User</legend> <?php if ($loi != "") { echo "<ul>";
$dk->set_dienthoai($dt); $dk->set_level($lv); $ngaydk = date("d"); $thangdk = date("m"); $namdk = date("Y"); $ngaydk = "{$namdk}-{$thangdk}-{$ngaydk}"; $ngaysinh = "{$namsinh}-{$thangsinh}-{$ngaysinh}"; $dk->set_ngaydangky($ngaydk); $dk->set_ngaysinh($ngaysinh); if ($dk->check_user() == FALSE) { echo "<div align='center' style='margin:10px;'><font size='+1' color='#FF0033'>Tên này đã có người dùng</font></div>"; } if ($dk->check_email() == FALSE) { echo "<div align='center' style='margin:10px;'><font size='+1' color='#FF0033'>Email này đã có người dùng</font></div>"; } else { if ($dk->insert_user() == FALSE) { echo "<div align='center' style='margin:10px;'><font size='+1' color='#FF0033'>Đăng ký thất bại</font></div>"; } else { $dk->insert_user(); echo "<div align='center' style='margin:10px;'><font size='+1' color='#FF0033'>Đăng ký thành công !</font></div>"; } } } } } else { ?> <form action="index.php?module=user&act=register" method="post" name="f"> <fieldset> <legend align="center"><font size="+1">Đăng Ký Thành Viên</font></legend>