Пример #1
0
function getTabHistory($idMember, $type)
{
    $sqlQuery = "SELECT * FROM qcs_history WHERE type = '" . $type . "' AND idMember = '" . $idMember . "' ORDER BY createdDate ASC";
    //	echo 	$sqlQuery . "<br/>";
    $sqlLink = startSQLSession();
    $result = mysql_query($sqlQuery, $sqlLink);
    closeSQLSession($sqlLink);
    $tabHistory = array();
    while ($line = mysql_fetch_array($result)) {
        $tabHistory[] = $line;
    }
    // echo $sqlQuery . "<br/>";
    return $tabHistory;
}
Пример #2
0
function checkLoginAndPassword($username, $password)
{
    //	echo "password = "******"<br/>";
    $password = getMD5($username, $password);
    //	echo "password MD5 = " . $password . "<br/>";
    $sqlQuery = "SELECT username FROM qcs_users WHERE username = '******' AND password = '******'";
    logMessage(__FUNCTION__ . " - " . $sqlQuery, LOG_LEVEL_DEBUG);
    $sqlLink = startSQLSession();
    $result = mysql_query($sqlQuery, $sqlLink);
    closeSQLSession($sqlLink);
    $login = '';
    if (mysql_num_rows($result) == 1) {
        $line = mysql_fetch_assoc($result);
        $login = $line['username'];
    }
    return $login;
}
Пример #3
0
function getMemberTypeById($idMember)
{
    $sqlQuery = "SELECT * FROM qcs_members WHERE id = '" . $idMember . "'";
    //	echo $sqlQuery . "<br/>";
    logMessage(__FUNCTION__ . " - " . $sqlQuery, LOG_LEVEL_DEBUG);
    $sqlLink = startSQLSession();
    $result = mysql_query($sqlQuery, $sqlLink);
    closeSQLSession($sqlLink);
    $type = "";
    if ($line = mysql_fetch_array($result)) {
        $type = $line['type'];
    }
    return $type;
}
Пример #4
0
function getIdMemberByEmail($email)
{
    $sqlQuery = "SELECT * FROM qcs_members WHERE email = '" . $email . "'";
    //	echo $sqlQuery . "<br/>";
    logMessage(__FUNCTION__ . " - " . $sqlQuery, LOG_LEVEL_DEBUG);
    $sqlLink = startSQLSession();
    $result = mysql_query($sqlQuery, $sqlLink);
    closeSQLSession($sqlLink);
    $id = "";
    if ($line = mysql_fetch_array($result)) {
        $id = $line['id'];
    }
    return $id;
}