function kiemtra_hoten_thanhvien() { $ketnoi_maychu = ketnoi_MC(); chon_CSDL($ketnoi_maychu); $hoten = $_POST['txt_hoten']; $matkhau = base64_encode(trim($_POST['txt_matkhau'])); $truyvan = "SELECT user,pass,quyen FROM quantri WHERE user like '{$hoten}' AND pass = '******'"; $ketqua_truyvan = truyvan($truyvan, $ketnoi_maychu); $somautin = @mysql_num_rows($ketqua_truyvan); if ($somautin > 0) { $rows = mysql_fetch_array($ketqua_truyvan, MYSQL_BOTH); if ($rows['quyen'] == "admin") { $_SESSION['ky_danh__bcd'] = $hoten; $_SESSION['mat_khau__bcd'] = $rows['quyen']; echo "<form name='frm_dangnhap'>\n\t\t\t <input type='hidden' name='chuyentrang' value='quan_tri.php?p=1'>\n\t\t\t\t\t</form>"; } else { $_SESSION['ky_danh__bcd'] = $hoten; echo $hoten; } } else { loi(); } mysql_close($ketnoi_maychu); }
echo "Không gửi được "; echo "Lỗi: " . $mailer->ErrorInfo; } else { // Gửi thành công echo '<script> alert("Cảm ơn đã liên hệ với chúng tôi!"); </script>'; } $ketnoi_maychu = ketnoi_MC(); chon_CSDL($ketnoi_maychu); $truyvan = "INSERT INTO lienhe(hoten,diachi,dt,email,fax,tieude,noidung) VALUES ('{$hoten}','{$diachi}','{$dt}','{$email}','{$fax}','{$tieude}','{$noidung}')"; $kequa_truyvan = truyvan($truyvan, $ketnoi_maychu); if ($kequa_truyvan) { thanhcong($hoten, $diachi, $dt, $email, $fax, $tieude, $noidung); } else { loi($hoten); } mysql_close($ketnoi_maychu); } function thanhcong($hoten, $diachi, $dt, $email, $fax, $tieude, $noidung) { echo "<font color='#2a2a2a'>Lưu Thành Công. Mọi thông tin về khách hàng <b>{$hoten}</b><br> sẽ được chúng tôi cập nhật và liên lạc trong thời gian sớm nhất</font><br>"; /*echo "Thông tin về khách hàng đã lưu như sau<br>"; echo "<font color='#BB3D00'>Họ tên: </font><b><font color='blue'>$hoten</font></b><br>"; echo "<font color='#BB3D00'>Địa chỉ: </font> <b><font color='blue'>$diachi</font></b><br>"; echo "<font color='#BB3D00'>Điện thoại:</font> <b><font color='blue'>$dt</font></b><br>"; echo "<font color='#BB3D00'>Email: </font><b><font color='blue'>$email</font></b><br>"; echo "<font color='#BB3D00'>Số Fax: </font><b><font color='blue'>$fax</font></b><br>"; echo "<font color='#BB3D00'>Tiêu đề:</font ><b><font color='blue'>$tieude</font></b><br>"; echo "<font color='#BB3D00'>Nội dung chính:</font><font color='blue'> <b>$noidung</b></font><br>";*/ }