Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pH7Software/pH7-Social-Dating-CMS
Browse files Browse the repository at this point in the history
  • Loading branch information
pH-7 committed May 9, 2016
2 parents 35b6862 + b184044 commit 1e12129
Show file tree
Hide file tree
Showing 70 changed files with 423 additions and 392 deletions.
2 changes: 1 addition & 1 deletion _install/library/Controller.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract class Controller implements IController
SOFTWARE_LICENSE = 'GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.',
SOFTWARE_COPYRIGHT = '© (c) 2012-2016, Pierre-Henry Soria. All Rights Reserved.',
SOFTWARE_VERSION_NAME = 'p[H]', // 1.0 and 1.1 branches were "pOH", 1.2 branch was "pOW" and 1.3 is now "p[H]"
SOFTWARE_VERSION = '1.3.8',
SOFTWARE_VERSION = '1.3.9',
SOFTWARE_BUILD = '1',
DEFAULT_LANG = 'en',
DEFAULT_THEME = 'base';
Expand Down
2 changes: 1 addition & 1 deletion _protected/app/configs/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

/***** DESIGN *****/

define('PH7_WIDTH_SEARCH_FORM', 160);
define('PH7_WIDTH_SEARCH_FORM', 156);

/***** SECURITY *****/

Expand Down
20 changes: 17 additions & 3 deletions _protected/app/system/core/classes/AffiliateCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
* @package PH7 / App / System / Core / Class
*/
namespace PH7;
use PH7\Framework\Config\Config, PH7\Framework\Registry\Registry;
use
PH7\Framework\Session\Session,
PH7\Framework\Navigation\Browser,
PH7\Framework\Config\Config,
PH7\Framework\Registry\Registry;

// Abstract Class
class AffiliateCore extends UserCore
Expand All @@ -21,8 +25,8 @@ class AffiliateCore extends UserCore
*/
public static function auth()
{
$oSession = new Framework\Session\Session;
$oBrowser = new Framework\Navigation\Browser;
$oSession = new Session;
$oBrowser = new Browser;

$bIsConnect = (((int)$oSession->exists('affiliate_id')) && $oSession->get('affiliate_ip') === Framework\Ip\Ip::get() && $oSession->get('affiliate_http_user_agent') === $oBrowser->getUserAgent());

Expand All @@ -32,6 +36,16 @@ public static function auth()
return $bIsConnect;
}

/**
* Check if an admin is logged as an affiliate.
*
* @return boolean
*/
public static function isAdminLoggedAs()
{
return (new Session)->exists('login_affiliate_as');
}

/**
* Update the Affiliate Commission.
*
Expand Down
11 changes: 10 additions & 1 deletion _protected/app/system/core/classes/UserCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* @copyright (c) 2012-2016, Pierre-Henry Soria. All Rights Reserved.
* @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
* @package PH7 / App / System / Core / Class
* @version 1.1
*/
namespace PH7;

Expand Down Expand Up @@ -42,6 +41,16 @@ public static function auth()
return $bIsConnect;
}

/**
* Check if an admin is logged as a user.
*
* @return boolean
*/
public static function isAdminLoggedAs()
{
return (new Session)->exists('login_user_as');
}

/**
* Delete User.
*
Expand Down
2 changes: 1 addition & 1 deletion _protected/app/system/core/models/DataCoreModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class DataCoreModel extends Framework\Mvc\Model\Engine\Model
{

const TB_PICTURE = 'Pictures', TB_VIDEO = 'Videos', MAX_ITEMS = 800;
const TB_PICTURE = 'Pictures', TB_VIDEO = 'Videos', MAX_ITEMS = 1000;

public function getPicsVids($sTable, $sOrder, $iOffset, $iLimit)
{
Expand Down
4 changes: 2 additions & 2 deletions _protected/app/system/core/models/ModeratorCoreModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class ModeratorCoreModel extends AdminCoreModel
{

public function totalAlbumsPicture()
public function totalPictureAlbums()
{
$rStmt = Db::getInstance()->prepare('SELECT COUNT(albumId) AS totalAlbums FROM' . Db::prefix('AlbumsPictures') . 'WHERE approved = \'0\'');
$rStmt->execute();
Expand All @@ -30,7 +30,7 @@ public function totalPictures()
return (int)$oRow->totalPictures;
}

public function totalAlbumsVideo()
public function totalVideoAlbums()
{
$rStmt = Db::getInstance()->prepare('SELECT COUNT(albumId) AS totalAlbums FROM' . Db::prefix('AlbumsVideos') . 'WHERE approved = \'0\'');
$rStmt->execute();
Expand Down
7 changes: 4 additions & 3 deletions _protected/app/system/core/models/PictureCoreModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ public function album($iProfileId = null, $iAlbumId = null, $iApproved = 1, $iOf
{
$this->cache->start(self::CACHE_GROUP, 'album' . $iProfileId . $iAlbumId . $iApproved . $iOffset . $iLimit . $sOrder, static::CACHE_TIME);

if(!$oData = $this->cache->get())
if (!$oData = $this->cache->get())
{

$iOffset = (int) $iOffset;
$iLimit = (int) $iLimit;

Expand Down Expand Up @@ -52,7 +51,9 @@ public function deletePhoto($iProfileId, $iAlbumId, $iPictureId = null)
$rStmt = Db::getInstance()->prepare('DELETE FROM'.Db::prefix('Pictures').'WHERE profileId=:profileId AND albumId=:albumId' . $sSqlPictureId);
$rStmt->bindValue(':profileId', $iProfileId, \PDO::PARAM_INT);
$rStmt->bindValue(':albumId', $iAlbumId, \PDO::PARAM_INT);
(!empty($iPictureId)) ? $rStmt->bindValue(':pictureId', $iPictureId, \PDO::PARAM_INT) : '';
if (!empty($iPictureId))
$rStmt->bindValue(':pictureId', $iPictureId, \PDO::PARAM_INT);

return $rStmt->execute();
}

Expand Down
110 changes: 70 additions & 40 deletions _protected/app/system/core/models/UserCoreModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* @copyright (c) 2012-2016, Pierre-Henry Soria. All Rights Reserved.
* @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
* @package PH7 / App / System / Core / Model
* @version 1.0
*/
namespace PH7;

Expand All @@ -15,6 +14,7 @@
PH7\Framework\Mvc\Model\DbConfig,
PH7\Framework\Mvc\Model\Engine\Util\Various,
PH7\Framework\Date\CDateTime,
PH7\Framework\Session\Session,
PH7\Framework\Security\Security;

// Abstract Class
Expand All @@ -23,18 +23,19 @@ class UserCoreModel extends Framework\Mvc\Model\Engine\Model

const CACHE_GROUP = 'db/sys/mod/user', CACHE_TIME = 604800;

protected $sCurrentDate;
protected $sCurrentDate, $iProfileId;

public function __construct()
{
parent::__construct();

$this->sCurrentDate = (new Framework\Date\CDateTime)->get()->dateTime('Y-m-d H:i:s');
$this->iProfileId = (new Session)->get('member_id');
}

public static function checkGroup()
{
$oSession = new Framework\Session\Session;
$oSession = new Session;
if (!$oSession->exists('member_group_id'))
{
$oSession->regenerateId();
Expand Down Expand Up @@ -268,23 +269,25 @@ public function search(array $aParams, $bCount, $iOffset, $iLimit)
$bIsZipCode = !empty($aParams['zip_code']);
$bIsMail = !empty($aParams['mail']);
$bIsSex = !empty($aParams['sex']);

$sSqlLimit = (!$bCount) ? 'LIMIT :offset, :limit' : '';
$sSqlSelect = (!$bCount) ? '*' : 'COUNT(m.profileId) AS totalUsers';
$sSqlFirstName = ($bIsFirstName) ? ' AND firstName = :firstName' : '';
$sSqlMiddleName = ($bIsMiddleName) ? ' AND middleName = :middleName' : '';
$sSqlLastName = ($bIsLastName) ? ' AND lastName = :lastName' : '';
$sSqlSingleAge = ($bIsSingleAge) ? ' AND birthDate LIKE :year ' : '';
$sSqlAge = ($bIsAge) ? ' AND birthDate BETWEEN DATE_SUB(\'' . $this->sCurrentDate . '\', INTERVAL :age2 YEAR) AND DATE_SUB(\'' . $this->sCurrentDate . '\', INTERVAL :age1 YEAR) ' : '';
$sSqlHeight = ($bIsHeight) ? ' AND height = :height ' : '';
$sSqlWeight = ($bIsWeight) ? ' AND weight = :weight ' : '';
$sSqlCountry = ($bIsCountry) ? ' AND country = :country ' : '';
$sSqlCity = ($bIsCity) ? ' AND city LIKE :city ' : '';
$sSqlState = ($bIsState) ? ' AND state LIKE :state ' : '';
$sSqlZipCode = ($bIsZipCode) ? ' AND zipCode LIKE :zipCode ' : '';
$sSqlEmail = ($bIsMail) ? ' AND email LIKE :email ' : '';
$sSqlOnline = (!empty($aParams['online'])) ? ' AND userStatus = 1 AND lastActivity > DATE_SUB(\'' . $this->sCurrentDate . '\', INTERVAL ' . DbConfig::getSetting('userTimeout') . ' MINUTE) ' : '';
$sSqlAvatar = (!empty($aParams['avatar'])) ? ' AND avatar IS NOT NULL AND approvedAvatar = 1 ' : '';
$bHideUserLogged = !empty($this->iProfileId);

$sSqlLimit = !$bCount ? 'LIMIT :offset, :limit' : '';
$sSqlSelect = !$bCount ? '*' : 'COUNT(m.profileId) AS totalUsers';
$sSqlFirstName = $bIsFirstName ? ' AND firstName = :firstName' : '';
$sSqlMiddleName = $bIsMiddleName ? ' AND middleName = :middleName' : '';
$sSqlLastName = $bIsLastName ? ' AND lastName = :lastName' : '';
$sSqlSingleAge = $bIsSingleAge ? ' AND birthDate LIKE :year ' : '';
$sSqlAge = $bIsAge ? ' AND birthDate BETWEEN DATE_SUB(\'' . $this->sCurrentDate . '\', INTERVAL :age2 YEAR) AND DATE_SUB(\'' . $this->sCurrentDate . '\', INTERVAL :age1 YEAR) ' : '';
$sSqlHeight = $bIsHeight ? ' AND height = :height ' : '';
$sSqlWeight = $bIsWeight ? ' AND weight = :weight ' : '';
$sSqlCountry = $bIsCountry ? ' AND country = :country ' : '';
$sSqlCity = $bIsCity ? ' AND city LIKE :city ' : '';
$sSqlState = $bIsState ? ' AND state LIKE :state ' : '';
$sSqlZipCode = $bIsZipCode ? ' AND zipCode LIKE :zipCode ' : '';
$sSqlEmail = $bIsMail ? ' AND email LIKE :email ' : '';
$sSqlOnline = !empty($aParams['online']) ? ' AND userStatus = 1 AND lastActivity > DATE_SUB(\'' . $this->sCurrentDate . '\', INTERVAL ' . DbConfig::getSetting('userTimeout') . ' MINUTE) ' : '';
$sSqlAvatar = !empty($aParams['avatar']) ? ' AND avatar IS NOT NULL AND approvedAvatar = 1 ' : '';
$sSqlHideLoggedProfile = $bHideUserLogged ? ' AND (m.profileId <> :profileId)' : '';

if (empty($aParams['order'])) $aParams['order'] = SearchCoreModel::LATEST; // Default is "ORDER BY joinDate"
if (empty($aParams['sort'])) $aParams['sort'] = SearchCoreModel::ASC; // Default is "ascending"
Expand Down Expand Up @@ -321,10 +324,13 @@ public function search(array $aParams, $bCount, $iOffset, $iLimit)
$sSqlSex = '';
}

$rStmt = Db::getInstance()->prepare('SELECT ' . $sSqlSelect . ' FROM' . Db::prefix('Members') . 'AS m LEFT JOIN' . Db::prefix('MembersPrivacy') . 'AS p ON m.profileId = p.profileId
$rStmt = Db::getInstance()->prepare(
'SELECT ' . $sSqlSelect . ' FROM' . Db::prefix('Members') . 'AS m LEFT JOIN' . Db::prefix('MembersPrivacy') . 'AS p ON m.profileId = p.profileId
LEFT JOIN' . Db::prefix('MembersInfo') . 'AS i ON m.profileId = i.profileId WHERE username <> \'' . PH7_GHOST_USERNAME . '\' AND searchProfile = \'yes\'
AND (groupId <> 1) AND (groupId <> 9)' . $sSqlFirstName . $sSqlMiddleName . $sSqlLastName . $sSqlMatchSex . $sSqlSex . $sSqlSingleAge . $sSqlAge . $sSqlCountry . $sSqlCity . $sSqlState .
$sSqlZipCode . $sSqlHeight . $sSqlWeight . $sSqlEmail . $sSqlOnline . $sSqlAvatar . $sSqlOrder . $sSqlLimit);
AND (groupId <> 1) AND (groupId <> 9)' . $sSqlHideLoggedProfile . $sSqlFirstName . $sSqlMiddleName . $sSqlLastName . $sSqlMatchSex . $sSqlSex . $sSqlSingleAge . $sSqlAge . $sSqlCountry . $sSqlCity . $sSqlState .
$sSqlZipCode . $sSqlHeight . $sSqlWeight . $sSqlEmail . $sSqlOnline . $sSqlAvatar . $sSqlOrder . $sSqlLimit
);

if (!empty($aParams['match_sex'])) $rStmt->bindValue(':matchSex', '%' . $aParams['match_sex'] . '%', \PDO::PARAM_STR);
if ($bIsFirstName) $rStmt->bindValue(':firstName', $aParams['first_name'], \PDO::PARAM_STR);
if ($bIsMiddleName) $rStmt->bindValue(':middleName', $aParams['middle_name'], \PDO::PARAM_STR);
Expand All @@ -339,6 +345,7 @@ public function search(array $aParams, $bCount, $iOffset, $iLimit)
if ($bIsState) $rStmt->bindValue(':state', '%' . $aParams['state'] . '%', \PDO::PARAM_STR);
if ($bIsZipCode) $rStmt->bindValue(':zipCode', '%' . $aParams['zip_code'] . '%', \PDO::PARAM_STR);
if ($bIsMail) $rStmt->bindValue(':email', '%' . $aParams['mail'] . '%', \PDO::PARAM_STR);
if ($bHideUserLogged) $rStmt->bindValue(':profileId', $this->iProfileId, \PDO::PARAM_INT);

if (!$bCount)
{
Expand Down Expand Up @@ -570,8 +577,8 @@ public function add(array $aData)
{
$sHashValidation = (!empty($aData['hash_validation']) ? $aData['hash_validation'] : null);

$rStmt = Db::getInstance()->prepare('INSERT INTO' . Db::prefix('Members') . '(email, username, password, firstName, lastName, sex, matchSex, birthDate, active, ip, hashValidation, joinDate, lastActivity, groupId)
VALUES (:email, :username, :password, :firstName, :lastName, :sex, :matchSex, :birthDate, :active, :ip, :hashValidation, :joinDate, :lastActivity, :groupId)');
$rStmt = Db::getInstance()->prepare('INSERT INTO' . Db::prefix('Members') . '(email, username, password, firstName, lastName, sex, matchSex, birthDate, active, ip, hashValidation, joinDate, lastActivity)
VALUES (:email, :username, :password, :firstName, :lastName, :sex, :matchSex, :birthDate, :active, :ip, :hashValidation, :joinDate, :lastActivity)');
$rStmt->bindValue(':email', trim($aData['email']), \PDO::PARAM_STR);
$rStmt->bindValue(':username', trim($aData['username']), \PDO::PARAM_STR);
$rStmt->bindValue(':password', Security::hashPwd($aData['password']), \PDO::PARAM_STR);
Expand All @@ -585,13 +592,16 @@ public function add(array $aData)
$rStmt->bindParam(':hashValidation', $sHashValidation, \PDO::PARAM_STR, 40);
$rStmt->bindValue(':joinDate', $this->sCurrentDate, \PDO::PARAM_STR);
$rStmt->bindValue(':lastActivity', $this->sCurrentDate, \PDO::PARAM_STR);
$rStmt->bindValue(':groupId', (int) DbConfig::getSetting('defaultMembershipGroupId'), \PDO::PARAM_INT);
$rStmt->execute();
$this->setKeyId( Db::getInstance()->lastInsertId() ); // Set the user's ID
Db::free($rStmt);
$this->setInfoFields($aData);
$this->setDefaultPrivacySetting();
$this->setDefaultNotification();

// Last one, update the membership with the correct details
$this->updateMembership((int)DbConfig::getSetting('defaultMembershipGroupId'), $this->getKeyId(), null, $this->sCurrentDate);

return $this->getKeyId();
}

Expand Down Expand Up @@ -905,17 +915,28 @@ public function getUsernameList($sUsernameSearch, $sTable = 'Members')
*/
public function getProfiles($sOrder = SearchCoreModel::LAST_ACTIVITY, $iOffset = null, $iLimit = null)
{
$bIsLimit = (null !== $iOffset && null !== $iLimit);
$bIsLimit = null !== $iOffset && null !== $iLimit;
$bHideUserLogged = !empty($this->iProfileId);

$iOffset = (int) $iOffset;
$iLimit = (int) $iLimit;

$sOrder = SearchCoreModel::order($sOrder, SearchCoreModel::DESC);

$sSqlLimit = ($bIsLimit ? 'LIMIT :offset, :limit' : '');
$rStmt = Db::getInstance()->prepare('SELECT * FROM' . Db::prefix('Members') . 'AS m LEFT JOIN' . Db::prefix('MembersPrivacy') . 'AS p ON m.profileId = p.profileId
$sSqlLimit = $bIsLimit ? 'LIMIT :offset, :limit' : '';
$sSqlHideLoggedProfile = $bHideUserLogged ? ' AND (m.profileId <> :profileId)' : '';

$rStmt = Db::getInstance()->prepare(
'SELECT * FROM' . Db::prefix('Members') . 'AS m LEFT JOIN' . Db::prefix('MembersPrivacy') . 'AS p ON m.profileId = p.profileId
LEFT JOIN' . Db::prefix('MembersInfo') . 'AS i ON m.profileId = i.profileId WHERE (username <> \'' . PH7_GHOST_USERNAME . '\') AND (searchProfile = \'yes\')
AND (username IS NOT NULL) AND (firstName IS NOT NULL) AND (sex IS NOT NULL) AND (matchSex IS NOT NULL) AND (country IS NOT NULL) AND (city IS NOT NULL) AND (groupId <> 1) AND (groupId <> 9)' . $sOrder . $sSqlLimit);
AND (username IS NOT NULL) AND (firstName IS NOT NULL) AND (sex IS NOT NULL) AND (matchSex IS NOT NULL) AND (country IS NOT NULL)
AND (city IS NOT NULL) AND (groupId <> 1) AND (groupId <> 9)' . $sSqlHideLoggedProfile . $sOrder . $sSqlLimit
);

if ($bHideUserLogged)
{
$rStmt->bindValue(':profileId', $this->iProfileId, \PDO::PARAM_INT);
}

if ($bIsLimit)
{
Expand Down Expand Up @@ -946,16 +967,25 @@ public function getGeoProfiles($sCountry, $sCity, $bCount, $sOrder, $iOffset, $i
$iOffset = (int) $iOffset;
$iLimit = (int) $iLimit;

$sOrder = (!$bCount) ? SearchCoreModel::order($sOrder, SearchCoreModel::DESC) : '';
$sOrder = !$bCount ? SearchCoreModel::order($sOrder, SearchCoreModel::DESC) : '';

$sSqlLimit = !$bCount ? 'LIMIT :offset, :limit' : '';
$sSqlSelect = !$bCount ? '*' : 'COUNT(m.profileId) AS totalUsers';

$sSqlLimit = (!$bCount) ? 'LIMIT :offset, :limit' : '';
$sSqlSelect = (!$bCount) ? '*' : 'COUNT(m.profileId) AS totalUsers';
$sSqlCity = !empty($sCity) ? 'AND (city LIKE :city)' : '';

$sSqlCity = (!empty($sCity)) ? 'AND (city LIKE :city)' : '';
$rStmt = Db::getInstance()->prepare('SELECT ' . $sSqlSelect . ' FROM' . Db::prefix('Members') . 'AS m LEFT JOIN' . Db::prefix('MembersInfo') . 'AS i ON m.profileId = i.profileId WHERE (username <> \'' . PH7_GHOST_USERNAME . '\')
AND (country = :country) ' . $sSqlCity . ' AND (username IS NOT NULL) AND (firstName IS NOT NULL) AND (sex IS NOT NULL) AND (matchSex IS NOT NULL) AND (country IS NOT NULL) AND (city IS NOT NULL) AND (groupId <> 1) AND (groupId <> 9)' . $sOrder . $sSqlLimit);
$rStmt = Db::getInstance()->prepare(
'SELECT ' . $sSqlSelect . ' FROM' . Db::prefix('Members') . 'AS m LEFT JOIN' . Db::prefix('MembersInfo') . 'AS i ON m.profileId = i.profileId
WHERE (username <> \'' . PH7_GHOST_USERNAME . '\') AND (country = :country) ' . $sSqlCity . ' AND (username IS NOT NULL)
AND (firstName IS NOT NULL) AND (sex IS NOT NULL) AND (matchSex IS NOT NULL) AND (country IS NOT NULL)
AND (city IS NOT NULL) AND (groupId <> 1) AND (groupId <> 9)' . $sOrder . $sSqlLimit
);
$rStmt->bindParam(':country', $sCountry, \PDO::PARAM_STR, 2);
(!empty($sCity)) ? $rStmt->bindValue(':city', '%' . $sCity . '%', \PDO::PARAM_STR) : '';

if (!empty($sCity))
{
$rStmt->bindValue(':city', '%' . $sCity . '%', \PDO::PARAM_STR);
}

if (!$bCount)
{
Expand Down Expand Up @@ -1310,7 +1340,7 @@ public function getMembershipDetails($iProfileId)
*/
public function checkMembershipExpiration($iProfileId, $sCurrentTime)
{
$rStmt = Db::getInstance()->prepare('SELECT m.profileId FROM' . Db::prefix('Members') . 'AS m INNER JOIN' . Db::prefix('Memberships') . 'AS pay ON m.groupId = pay.groupId WHERE (pay.expirationDays = 0 OR DATE_SUB(m.membershipDate, INTERVAL pay.expirationDays DAY) <= :currentTime) AND (m.profileId = :profileId) LIMIT 1');
$rStmt = Db::getInstance()->prepare('SELECT m.profileId FROM' . Db::prefix('Members') . 'AS m INNER JOIN' . Db::prefix('Memberships') . 'AS pay ON m.groupId = pay.groupId WHERE (pay.expirationDays = 0 OR DATE_ADD(m.membershipDate, INTERVAL pay.expirationDays DAY) >= :currentTime) AND (m.profileId = :profileId) LIMIT 1');
$rStmt->bindValue(':profileId', $iProfileId, \PDO::PARAM_INT);
$rStmt->bindValue(':currentTime', $sCurrentTime, \PDO::PARAM_INT);
$rStmt->execute();
Expand All @@ -1331,9 +1361,9 @@ public function updateMembership($iNewGroupId, $iProfileId, $fPrice = null, $sDa
$bIsPrice = !empty($fPrice);
$bIsTime = !empty($sDateTime);

$sSqlPrice = ($bIsPrice) ? ' AND pay.price = :price' : '';
$sSqlWherePrice = ($bIsPrice) ? ' AND pay.price = :price' : '';
$sSqlTime = ($bIsTime) ? ',m.membershipDate = :dateTime ' : ' ';
$sSqlQuery = 'UPDATE' . Db::prefix('Members') . 'AS m INNER JOIN' . Db::prefix('Memberships') . 'AS pay ON m.groupId = pay.groupId SET m.groupId = :groupId' . $sSqlTime . 'WHERE m.profileId = :profileId' . $sSqlPrice;
$sSqlQuery = 'UPDATE' . Db::prefix('Members') . 'AS m INNER JOIN' . Db::prefix('Memberships') . 'AS pay ON m.groupId = pay.groupId SET m.groupId = :groupId' . $sSqlTime . 'WHERE m.profileId = :profileId' . $sSqlWherePrice;

$rStmt = Db::getInstance()->prepare($sSqlQuery);
$rStmt->bindValue(':groupId', $iNewGroupId, \PDO::PARAM_INT);
Expand Down
Loading

0 comments on commit 1e12129

Please sign in to comment.