$userCount = mysql_num_rows($uniqueResult); if ($userCount == 0) { $flag = 1; } else { $flag = 0; $msg = 'Username, Email and Contact must be unique.'; $class = 'danger'; } if ($flag) { $uploadFlag = 1; $data['firstname'] = $_POST['txtFirstname']; $data['lastname'] = $_POST['txtLastname']; $data['username'] = $_POST['txtUsername']; $data['email'] = $_POST['txtEmail']; if (!empty($_FILES['fileImage']['name'])) { $uploadImage = $commonController->uploadImageFile($_FILES['fileImage'], '../images/users/'); if ($uploadImage['status'] == 1) { $data['image'] = $uploadImage['message']; } else { $uploadFlag = 0; $msg = $uploadImage['message']; } } $data['address'] = $_POST['txtAddress']; $data['contact'] = $_POST['txtContact']; $data['type'] = $userType; $data['status'] = $_POST['rdoStatus']; $data['city_id'] = $_POST['ddlCity']; $data['country_id'] = $_POST['ddlCountry']; $data['state_id'] = $_POST['ddlState']; $data['district_id'] = $_POST['ddlDistrict'];
$data['facebook_url'] = !empty($_POST['txtFacebookUrl']) ? FACEBOOK_URL . $_POST['txtFacebookUrl'] : ''; $data['twitter_url'] = !empty($_POST['txtTwitterUrl']) ? TWITTER_URL . $_POST['txtTwitterUrl'] : ''; $data['check_in'] = sprintf('%s', $_POST['txtCheckIn']); $data['check_out'] = sprintf('%s', $_POST['txtCheckOut']); $data['deals'] = $_POST['ddlRoomDeal']; if (!empty($_POST['txtStartTime']) && !empty($_POST['txtEndTime'])) { $data['sms_time'] = sprintf('%s-%s', $_POST['txtStartTime'], $_POST['txtEndTime']); } if (!empty($_POST['hdnId'])) { $data['id'] = $_POST['hdnId']; $data['updated_date'] = date('Y-m-d h:i:s'); } else { $data['created_date'] = date('Y-m-d h:i:s'); } if (!empty($_FILES['fileImage']['name'])) { $uploadImage = $commonController->uploadImageFile($_FILES['fileImage'], 'images/listings/'); if ($uploadImage['status'] == 1) { $data['logo'] = $uploadImage['message']; } else { $uploadFlag = 0; $msg = $uploadImage['message']; } } if ($data['name'] != $_POST['hdnName'] && $adminController->checkRecordUniqueNess(array('table' => $data['table'], 'column' => 'name', 'value' => $data['name'])) == 0) { $flag = 1; } else { if ($data['name'] == $_POST['hdnName']) { $flag = 1; } else { $flag = 0; $msg = 'Name must be unique.';