public static function display($business) { $str = ""; for ($i = 0; $i < count($business); $i++) { $loaidv = LoaiDichVuBUS::getById($business[$i]['loaidv']); $loainha = LoaiNhaBUS::getById($business[$i]['loainha']); $user = UsersBUS::GetUserByID($business[$i]['chusohuu']); $str .= '<tr>'; $str .= '<td align="center">' . ($i + 1) . '</td>'; $str .= '<td>' . $user['hoten'] . '</td>'; $str .= '<td>' . $business[$i]['tieude'] . '<img src="images/vip.gif"></td>'; $str .= '<td>' . $loainha['ten']; if ($business[$i]["rank"] == 1) { $str .= " <img src='images/hot.gif' />"; } $str .= '</td>'; $str .= '<td>' . $business[$i]['sonha'] . '/' . $business[$i]['duong'] . ', ' . $business[$i]['phuong'] . ', ' . $business[$i]['quan'] . ', ' . $business[$i]['tinh'] . '</td>'; $str .= '<td align="center">' . $business[$i]['ngaydang'] . '</td>'; $str .= '<td align="center">' . $business[$i]['thoihantin'] . '</td>'; $str .= '<td align="center" style="color:green;">'; switch ($business[$i]['status']) { case 0: $str .= "Tin chờ duyệt"; break; case 1: $str .= "Tin đã duyệt"; break; case 2: $str .= "Tin đăng VIP"; break; case 3: $str .= "Tin hết hạn"; break; default: $str .= "Tin bị xóa"; break; } $str .= '</td>'; $str .= '<td align="center">' . $loaidv['ten'] . '</td>'; $str .= '</tr>'; } return $str; }
function displayWithSumRow($business, $loai, $monthFrom, $monthTo, $year) { $str = null; $str .= '<table width="70%" border="0" align="center" cellspacing="0" cellpadding="0" id="tblist">'; $str .= '<tr class="title">'; $str .= '<td width="30px" align="center">#</td>'; $str .= '<td width="30px" align="center">'; $str .= '<input type="checkbox" name="cbAll" id="cbAll" onclick="checkALL()"/></td>'; $str .= '<td width="70px" align="center">Ngày thu</td>'; $str .= '<td align="center">Công việc</td>'; $str .= '<td width="20%">Nhân viên thu</td>'; $str .= '<td align="right" width="100px">Số tiền</td>'; $str .= '</tr>'; for ($i = 0; $i < count($business); $i++) { $user = UsersBUS::GetUserByID($business[$i]['nhanvien']); $dvTien = DonViTienBUS::selectId($business[$i]['donvi']); $str .= '<tr>'; $str .= '<td align="center">' . ($i + 1) . '</td>'; $str .= '<td align="center"><input type="checkbox" name="cbId[]" id="cbId[]" value="' . $business[$i]['id'] . '"></td>'; $str .= '<td align="center">' . $business[$i]["ngay"] . '</td>'; $str .= '<td>' . $business[$i]["congviec"] . '</td>'; $str .= '<td>' . $user['hoten'] . '</td>'; $str .= '<td align="right">' . number_format($business[$i]["sotien"]) . ' ' . $dvTien['ten'] . '</td>'; $str .= '</tr>'; } $str .= '<tr>'; $str .= '<td align="right" colspan="5"><b>Tổng thu:</b></td>'; $sumRow = null; if ($monthTo == null && $monthFrom == null && $year == null) { $sumRow = ThuChiBUS::SumTongTien($loai); } else { $sumRow = ThuChiBUS::SumTongTienByMonth($loai, $monthFrom, $monthTo, $year); } $str .= '<td align="right"><b>' . $sumRow[0] . ' vnd</b></td>'; $str .= '</tr>'; $str .= '</table>'; $str .= "<script>\$(\"table[id='tblist'] tr:even\").css('background-color', '#EFEFEF');</script>"; return $str; }
<?php $txtEmail = $_REQUEST["txtEmail"]; if (!empty($txtEmail)) { $PATH_BASE = str_replace('//', '/', dirname(__FILE__) . '/'); //echo $PATH_BASE; include_once $PATH_BASE . '../../BUS/UsersBUS.php'; $user = UsersBUS::GetUserByEmail($txtEmail); if (empty($user)) { echo "<img src='../../images/user/valid.png' alt='Hợp lệ' title='Hợp lệ' width=20 height=20>"; } else { echo "aaaaaa"; //echo "<img src='../../images/user/incorrect.png' alt='Đã được sử dụng' title='Đã được sử dụng' width=20 height=20>"; //echo "<span style='position:relative;top:-6px;color:red;'> Email đã được sử dụng</span>"; //echo "<input type='hidden' id='hdEmailError' value='true' />"; } }
$flag = 1; } if ($_SESSION["curUser"][8] == 4) { $flag = 1; } if ($flag == 0) { // Khong duoc phep di tiep header("Location: index.php"); } $uid = (int) $_GET["uid"]; if (empty($uid)) { return; } $PATH = str_replace('//', '/', dirname(__FILE__) . '/'); include_once $PATH . "../../../BUS/UsersBUS.php"; $user = UsersBUS::GetUserByID($uid); ?> <script> function validate() { if (document.getElementById("txtHoten").value == "") { alert("Bạn chưa điền họ tên. Vui lòng kiểm tra lại."); document.getElementById("txtHoten").focus(); return false; } if (document.getElementById("txtSdt1").value == "") { alert("Số điện thoại 1 không được rỗng. Vui lòng kiểm tra lại."); document.getElementById("txtSdt1").focus(); return false;
session_start(); // $_SESSION["formLogin"]=true; $do = ""; if (isset($_GET["do"])) { $do = $_GET["do"]; } if ($do == "logout") { unset($_SESSION["curUser"]); header("Location:../index.php"); } if (isset($_POST["btLogin"])) { include "../BUS/UsersBUS.php"; $username = $_POST["txtUsername"]; $password = $_POST["txtPassword"]; $curUser = UsersBUS::Login($username, $password); if ($curUser != null && $curUser[8] != 2) { $now = date("Y-m-d H-i-s"); $_SESSION["curUser"] = $curUser; } else { $login = "******"; } } if (isset($_SESSION["curUser"]) && $_SESSION["curUser"][8] != 2) { $_SESSION["time_start"] = time(); $_SESSION["flag"] = true; $bodyFile = "include/controlpanel.php"; } else { $bodyFile = "module/login.php"; } if (isset($_GET["view"])) {
public static function load($curPage, $level, $nam, $thangfrom, $thangto) { $totalItems = null; $business = null; $constMaxItem = 5; $maxItems = $constMaxItem; $maxPages = 25; $offset = ($curPage - 1) * $maxItems; $condition = EvaluateProcessor::getkhenthuongCondition($level, $nam, $thangfrom, $thangto); $strSQL = "select * from khenthuong,user where khenthuong.iduser=user.id " . $condition . " limit {$offset},{$maxItems}"; $evaluate = KhenThuongBUS::selectByIdSQL($strSQL); $strSQL = "select count(*) from khenthuong,user where khenthuong.iduser=user.id " . $condition; $totalEvaluate = KhenThuongBUS::countBySQL($strSQL); $display = ""; $display .= EvaluateProcessor::displayHeader($totalEvaluate[0]); for ($i = 0; $i < count($evaluate); $i++) { $user = UsersBUS::GetUserByID($evaluate[$i]['iduser']); $display .= EvaluateProcessor::display($i + 1, $evaluate[$i]['iduser'], $user['hoten'], $user['email'], $user['gioitinh'], $user['level'], $evaluate[$i]['loai'], $evaluate[$i]['thuong'], $evaluate[$i]['ngay']); } $display .= EvaluateProcessor::displayFooter("", -1, "", "", -1, "", "", "", ""); $strPaging = Utils::paging('', $totalEvaluate[0], $curPage, $maxPages, $constMaxItem); return $display . $strPaging; }
if (isset($_POST["btUpdate"])) { include_once $PATH . "../../BUS/UsersBUS.php"; $uid = $_POST["uid"]; $user = UsersBUS::GetUserByID($uid); if ($_POST["txtEmail"] != $user[3]) { UsersBUS::SetEmail($uid, $_POST["txtEmail"]); } if (!empty($_POST["txtPassword"])) { UsersBUS::SetPassword($uid, $_POST["txtPassword"]); } if (!empty($_POST["txtAnswer"]) && !empty($_POST["lbSecurityQuestion"])) { $_POST["lbSecurityQuestion"]; UsersBUS::SetSecurityQuestion($uid, $_POST["lbSecurityQuestion"], $_POST["txtAnswer"]); } UsersBUS::SetStatus($uid, $_POST["lbStatus"]); UsersBUS::SetType($uid, $_POST["lbType"]); } ?> <script language="javascript"> $(document).ready (function () { $("#aDisable").click (function () { var url = "modules/forms/listUser.php"; var data = $("#frmListItem").serialize() + "&btDisable=true"; $("#listItem").load(url,data); }); $("#aEnable").click (function () { var url = "modules/forms/listUser.php"; var data = $("#frmListItem").serialize() + "&btEnable=true";
alert ("Có lỗi trong thông tin đăng ký. Xin kiểm tra lại"); var url = "index.php?sendemail="+strEmail; if (confirm("Bạn có reset mật khẩu hay không?")) window.location = url; return flag; } </script> <?php if (isset($_GET["sendemail"]) && isset($_GET["sendemail"]) != null) { $txtEmail = $_GET["sendemail"]; include_once "../BUS/UsersBUS.php"; include_once "../module/PHPMailer/email.php"; $checkstatus = UsersBUS::GetUser_StatusByEmail($txtEmail); if ($checkstatus !== null) { $random = rand(1, 1000000); $changePass = UsersBUS::SetPassword($checkstatus['id'], $random); if ($changePass == true) { $tag = ""; $content_Subject = "RealEstate_HoaPhuong.com"; $content_Body = "\r\n\t\t\t\t<div id='yiv1540714745'>\r\n\t\t\t\t\tXin chào, " . $checkstatus['hoten'] . "\r\n\t\t\t\t\t<br><br>\r\n\t\t\t\t\tWebsite RealEstate_HoaPhuong.com có nhận được yêu cầu thay đổi mật khẩu cùa quý khách vào ngày " . date('d-m-Y , h:i:s') . "\r\n\t\t\t\t\t<br>\r\n\t\t\t\t\tMật khẩu đã được thay đổi:<b style='color:#336699;'>" . $random . "</b>\r\n\t\t\t\t\t<br>\r\n\t\t\t\t\t<br>\r\n\t\t\t\t\tQuí khách vui lòng quay trở lại trang web để đăng nhập lại.\r\n\t\t\t\t\t<br>\r\n\r\n\t\t\t\t\t<br>\r\n\t\t\t\t\t<br>\r\n\t\t\t\t\t__________________________________________________\r\n\t\t\t\t\t<br>\r\n\t\t\t\t\tBộ phận kỹ thuật:\r\n\t\t\t\t\t<br>\r\n\t\t\t\t\tĐiện thoại : (08) 38777939. - Fax : (08) 62602665\r\n\t\t\t\t\t<br>\r\n\t\t\t\t\tE-mail: support@realestate_hoaphuong.com\r\n\t\t\t\t\t<br>\r\n\t\t\t\t</div>"; for ($i = strlen($txtEmail) - 9; $i < strlen($txtEmail); $i++) { $tag .= $txtEmail[$i]; } if ($tag == "yahoo.com") { $type = 1; } else { if ($tag == "gmail.com") { $type = 2; } else { $type = 3; }
<td>Ngày thu:</td> <td colspan="2"> <script> $(function() { $( "#txtDate" ).datepicker({dateFormat:'yy-mm-dd', showButtonPanel: true}); }); </script> <input id="txtDate" type="text" style="width:70px;"> </td> </tr> <tr> <td>Nhân viên thu: <span style="color:red;">(*)</span></td> <td><select style="width:300px;" id="cbbNhanvien"> <?php include_once "../BUS/UsersBUS.php"; $users = UsersBUS::getUsersByRole(3); for ($i = 0; $i < count($users); $i++) { echo '<option value="' . $users[$i]['id'] . '">' . $users[$i]['hoten'] . '</option>'; } ?> </select> </td> </tr> </table> </form> <div class="list" style="padding-top:20px;" id="dsThuchi"> <!-- <table width="70%" border="0" align="center" cellspacing="0" cellpadding="0"> <tr class="title"> <td width="30px" align="center">#</td> <td width="30px" align="center">
} $status = 1; $time = date('Y-m-d'); $ip = ""; echo "<br>role=" . $role; echo "<br>level=" . $level; echo "<br>"; $id = UsersBUS::Add($password, $email, $hoten, $gender, $diachi, $sdt1, $sdt2, $role, $level, 1, $time, $ip); break; case "lock": $uid = explode(',', $_GET["uid"]); for ($i = 0; $i < count($uid); $i++) { UsersBUS::SetStatus($uid[$i], 0); } break; case "unlock": $uid = explode(',', $_GET["uid"]); for ($i = 0; $i < count($uid); $i++) { UsersBUS::SetStatus($uid[$i], 1); } break; case "delete": $uid = explode(',', $_GET["uid"]); for ($i = 0; $i < count($uid); $i++) { UsersBUS::Delete($uid[$i]); } break; } $status = isset($_REQUEST["status"]) ? $_REQUEST["status"] : -1; $type = isset($_REQUEST["type"]) ? (int) $_REQUEST["type"] : -1; header("Location:../../index.php?view=user&type=" . $type . "&status=" . $status);
</td>--> <td width="69%"> <?php $strLink = "index.php?view=user&type=" . $type . "&status=" . $status . "&"; $curPage = 1; $totalItems = null; $business = null; if (isset($_REQUEST['page'])) { $curPage = $_REQUEST['page']; } $maxItems = 5; $maxPages = 25; $offset = ($curPage - 1) * $maxItems; $listRole = RoleBUS::GetAllRole(); $listUsers = UsersBUS::GetUsersByFilter($type, $status, $offset, $maxItems); $totalItems = UsersBUS::CountUsersByFilter($type, $status, $offset, $maxItems); echo "<b>Có " . $totalItems . " mẫu tin.</b>"; ?> </td> <td width="31%"> <div align="right"> <select id="type" onchange="return loadUsersByCondition();"> <option value="-1" <?php echo $type == -1 ? "selected" : ""; ?> > - Nhóm thành viên - </option> <?php for ($i = 0; $i < count($listRole); $i++) { if ($listRole[$i]["id"] == $type) { echo "<option value='" . $listRole[$i]["id"] . "' selected>" . $listRole[$i]["ten"] . "</option>"; } else {
width="986" height="177"> </div> <table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="986;"> <tr> <td style="border-right: 1px solid rgb(180, 215, 232); background-repeat: repeat-y;" background="1_files/menubg_all.jpg" valign="top" width="270"> <?php include "../include/box_left_thanhvien.php"; ?> </td> <!-- form start--> <?php include_once "../BUS/UsersBUS.php"; if (isset($curUserId)) { $user = UsersBUS::GetUserByID($curUserId); } if (!isset($curUserId)) { header("Location:dichvu.php"); } ?> <div style="padding:20px;" id="frmThayDoiThongTinKH" name="frmThayDoiThongTinKH"> <form action="user/xulydangky.php?id=<?php echo $curUserId; ?> " method="post" name="frmThayDoiThongTinKH" id="frmThayDoiThongTinKH" > <td style="padding: 10px;" valign="top"> <div style="width: 686px;"> <div style="margin-left: 10px; margin-top: 10px; font-family: tahoma; font-size: 18px; font-weight: bold; color:#890C29;"> CẬP NHẬT THÔNG TIN KHÁCH HÀNG</div>
$donviDV = DonviDichVuBUS::selectId($business['donvidv']); $donviTien = DonviTienBUS::selectId($business['donvitien']); if ($business['giaban'] != null) { $money = Utils::convert_Money($business['giaban']); } else { $money = "0,00"; } echo $money . " " . $donviTien['ten'] . "/" . $donviDV['ten']; ?> </div> <div class="contact"> <div class="registerBuy"> Thông tin liên hệ</div> <?php require_once "../BUS/UsersBUS.php"; $user = UsersBUS::GetUserByID($business['chusohuu']); ?> <div class="name"> Tên : <a href="" id="ctl00_MainContent_ctl00_hpUserName"><?php echo $user['hoten']; ?> </a> </div> <div class="phone"> Điện thoại : <?php echo $user['sdt1']; ?> </div> <div class="email nonedisplay"> Email : <?php echo $user['email'];
} $time = date('Y-m-d'); $radio_gender = $_POST['gender']; echo "<br>radio=" . $radio_gender; $rsUpdate = UsersBUS::UpdateInfor($id, $username, $radio_gender, $address, $dt1, $dt2, $time); if ($rsUpdate == true) { header("Location:../thongtinkhachhang.php?update=success"); } else { header("Location:../thongtinkhachhang.php?update=failed"); } } if (isset($_POST["btRegister"])) { include "../../BUS/UsersBUS.php"; $password = $_POST["txtPassword"]; $username = $_POST["txtUsername"]; $dt1 = $_POST["txtPhone"]; $dt2 = $_POST["txtMobile"]; $email = $_POST["txtEmail"]; $address = $_POST["txtAddress"]; $gender = $_POST["gender"]; $fRegister = "false"; $time = date('Y-m-d'); $ip = "192.168.1.22"; $id = UsersBUS::Add($password, $email, $username, $gender, $address, $dt1, $dt2, 2, 4, 0, $time, $ip); if (!empty($id)) { $fRegister = "true"; header("Location:../dichvu.php?do=login"); } else { header("Location:../dangky.php?do=failed"); } }
if (confirm("Bạn có chắc muốn lưu những thay đổi thông tin cá nhân?")) window.location = url; return false; } </script> <?php if (isset($_GET["update"])) { $hoten = isset($_GET["hoten"]) ? $_GET["hoten"] : -1; $gioitinh = isset($_GET["gioitinh"]) ? $_GET["gioitinh"] : -1; $diachi = isset($_GET["diachi"]) ? $_GET["diachi"] : -1; $sdt1 = isset($_GET["sdt1"]) ? $_GET["sdt1"] : ""; $sdt2 = isset($_GET["sdt2"]) ? $_GET["sdt2"] : ""; $newpass = isset($_GET["newpass"]) ? $_GET["newpass"] : -1; $ngaycapnhat = date("Y-m-d"); UsersBUS::Update2($user["id"], $hoten, $gioitinh, $diachi, $sdt1, $sdt2, $newpass, $ngaycapnhat); header("Location:index.php?view=private_info"); } ?> <div id="toolbar"> <div class="tl"></div> <div class="tr"></div> <div class="tm"></div> <div class="mid"> <div class="title icon_info">Thông tin cá nhân: <span class="subTitle">[ Chỉnh sửa ]</span></div> <div class="icon"> <a href="index.php"> <img src="images/icon_32_cancel.png" /><br />Quay lại</a></div> <div class="icon"> <a href=""> <img src="images/icon_32_apply.png" onclick="return saveInfo();" /><br />Lưu</a></div>
} if (isset($_POST["btnChangeInfoUser"])) { include_once "../../BUS/UsersBUS.php"; $id = $_GET["id"]; $username = $_POST["txtUsername"]; $address = $_POST["txtAddress"]; $dt1 = $_POST["txtTelephoneNumber"]; if (isset($_POST["txtMobileNumber"])) { $dt2 = $_POST["txtMobileNumber"]; } else { $dt2 = ""; } $time = date('Y-m-d'); $radio_gender = $_POST['gender']; echo "<br>radio=" . $radio_gender; $rsUpdate = UsersBUS::UpdateInfor($id, $username, $radio_gender, $address, $dt1, $dt2, $time); if ($rsUpdate == true) { Utils::redirect("../thongtinkhachhang.php?update=success"); } else { Utils::redirect("../thongtinkhachhang.php?update=failed"); } } if (isset($_POST["btRegister"])) { //echo "register"; include_once "UserController.php"; $password = $_POST["txtPassword"]; $username = $_POST["txtUsername"]; $phone = $_POST["txtPhone"]; //$dt2 = $_POST["txtMobile"]; $email = $_POST["txtEmail"]; $role = "1";