Subversion Repositories cheapmusic

Rev

Rev 138 | Rev 143 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 138 Rev 141
Line 8... Line 8...
8
include_once ($_SERVER['DOCUMENT_ROOT'] . "/php/NonceUtil.php");
8
include_once ($_SERVER['DOCUMENT_ROOT'] . "/php/NonceUtil.php");
9
 
9
 
10
error_reporting(E_ALL);
10
error_reporting(E_ALL);
11
 
11
 
12
$userData = [];
12
$userData = [];
13
$userTheme = 'default';
-
 
14
$configFile = parse_ini_file($_SERVER['DOCUMENT_ROOT'] . FCM_CONFIGFILE, true);
13
$configFile = parse_ini_file($_SERVER['DOCUMENT_ROOT'] . FCM_CONFIGFILE, true);
15
$crypt = Cryptor::getInstance($configFile['cryptor']);
14
$crypt = Cryptor::getInstance($configFile['cryptor']);
16
$tmpSessionTab = (!empty(getPGV("sessionTab")) && getPGV("sessionTab") > 0 ? getPGV("sessionTab"): null);
15
$tmpSessionTab = (!empty(getPGV("sessionTab")) && getPGV("sessionTab") > 0 ? getPGV("sessionTab"): null);
17
$handler = MySessionHandler::getInstance($tmpSessionTab, $configFile['mysqli']);
16
$handler = MySessionHandler::getInstance($tmpSessionTab, $configFile['mysqli']);
18
$vendors = Vendors::getInstance();
17
$vendors = Vendors::getInstance();
Line 43... Line 42...
43
    $conditions['return_type'] = 'single';
42
    $conditions['return_type'] = 'single';
44
    $userData = $user->getRows($conditions);
43
    $userData = $user->getRows($conditions);
45
    if (!empty($userData) && password_verify($userData['password'] . $userData['id'], $_COOKIE['hash'])) {
44
    if (!empty($userData) && password_verify($userData['password'] . $userData['id'], $_COOKIE['hash'])) {
46
        $_SESSION['sessData']['userLoggedIn'] = true;
45
        $_SESSION['sessData']['userLoggedIn'] = true;
47
        $_SESSION['sessData']['userID'] = $_COOKIE['rememberUserId'];
46
        $_SESSION['sessData']['userID'] = $_COOKIE['rememberUserId'];
48
        $userPicture = getUserImage($userData);
47
        $_SESSION["userPicture"] = getUserImage($userData);
49
        $userTheme = $userData['theme'];
48
        $_SESSION["colorTheme"] = $userData['theme'];
50
        $_SESSION["currentLayout"] = ($userData['cardView'] == '1' ? 'CardView' : 'TableView');
49
        $_SESSION["currentLayout"] = ($userData['cardView'] == '1' ? 'CardView' : 'TableView');
51
        $_SESSION['buyer']['Zip'] = $userData['zip'];
50
        $_SESSION['buyer']['Zip'] = $userData['zip'];
52
        $_SESSION['buyer']['Country'] = 'United States';
51
        $_SESSION['buyer']['Country'] = 'United States';
53
        $_SESSION['buyer']['Currency'] = 'USD';
52
        $_SESSION['buyer']['Currency'] = 'USD';
54
        $_SESSION["filterCondition"]["New"] = $userData['conditionNew'];
53
        $_SESSION["filterCondition"]["New"] = $userData['conditionNew'];
Line 72... Line 71...
72
    );
71
    );
73
    $conditions['return_type'] = 'single';
72
    $conditions['return_type'] = 'single';
74
    $userData = $user->getRows($conditions);
73
    $userData = $user->getRows($conditions);
75
 
74
 
76
    if (!empty($userData)) {
75
    if (!empty($userData)) {
77
        $userPicture = getUserImage($userData);
76
        $_SESSION["userPicture"] = getUserImage($userData);
78
        $userTheme = $userData['theme'];
77
        $_SESSION["colorTheme"] = $userData['theme'];
79
        $_SESSION["currentLayout"] = ($userData['cardView'] == '1' ? 'CardView' : 'TableView');
78
        $_SESSION["currentLayout"] = ($userData['cardView'] == '1' ? 'CardView' : 'TableView');
80
        $_SESSION['buyer']['Zip'] = $userData['zip'];
79
        $_SESSION['buyer']['Zip'] = $userData['zip'];
81
        $_SESSION['buyer']['Country'] = 'United States';
80
        $_SESSION['buyer']['Country'] = 'United States';
82
        $_SESSION['buyer']['Currency'] = 'USD';
81
        $_SESSION['buyer']['Currency'] = 'USD';
83
        $_SESSION["filterCondition"]["New"] = $userData['conditionNew'];
82
        $_SESSION["filterCondition"]["New"] = $userData['conditionNew'];
Line 91... Line 90...
91
        unsetSessData();
90
        unsetSessData();
92
    }
91
    }
93
// or user is not logged in
92
// or user is not logged in
94
} else {
93
} else {
95
    unsetSessData();
94
    unsetSessData();
-
 
95
    $_SESSION["colorTheme"] = 'default';
96
}
96
}
97
 
97
 
98
checkPriceMonitor();
98
checkPriceMonitor();
99
 
99
 
100
echo "<!DOCTYPE html>"; // html5
100
echo "<!DOCTYPE html>"; // html5
Line 135... Line 135...
135
        buildDiscogsSearchTerm();
135
        buildDiscogsSearchTerm();
136
 
136
 
137
        if (!empty($_SESSION["searchTerm"])) {
137
        if (!empty($_SESSION["searchTerm"])) {
138
            $_SESSION["mode"] = SIMPLE_SEARCH;
138
            $_SESSION["mode"] = SIMPLE_SEARCH;
139
            performSearch();
139
            performSearch();
-
 
140
            $xh->insert_code(jumpToSection("discogsTable"));
140
        }
141
        }
141
    } else if ($_POST["submitBtn"] == "advSearch") {
142
    } else if ($_POST["submitBtn"] == "advSearch") {
142
        buildDiscogsSearchTerm();
143
        buildDiscogsSearchTerm();
143
        if (!empty($_SESSION["advSearch"])) {
144
        if (!empty($_SESSION["advSearch"])) {
144
            $_SESSION["mode"] = ADVANCED_SEARCH;
145
            $_SESSION["mode"] = ADVANCED_SEARCH;
145
            performSearch();
146
            performSearch();
-
 
147
            $xh->insert_code(jumpToSection("discogsTable"));
146
        }
148
        }
147
    } else if ($_POST["submitBtn"] == "discogsSearch") {
149
    } else if ($_POST["submitBtn"] == "discogsSearch") {
148
        buildDiscogsSearchTerm();
150
        buildDiscogsSearchTerm();
149
        if (!empty($_SESSION["searchTerm"])) {
151
        if (!empty($_SESSION["searchTerm"])) {
-
 
152
            $_SESSION["mode"] = ADVANCED_SEARCH;
150
            performSearch();
153
            performSearch(true);
-
 
154
            $xh->insert_code(jumpToSection("productTable"));
151
        }
155
        }
152
    } else if ($_POST["submitBtn"] == "unsubscribe") {
156
    } else if ($_POST["submitBtn"] == "unsubscribe") {
153
// bugbug
157
// bugbug
154
    }
158
    }
155
}
159
}
Line 167... Line 171...
167
*/
171
*/
168
        performSearch();
172
        performSearch();
169
    }
173
    }
170
}
174
}
171
 
175
 
172
$xh->insert_code(navigationPane($userPicture ?? null));
176
$xh->insert_code(navigationPane());
173
 
177
 
174
    $xh->add_attribute("class", "page-header bg-primary");
178
    $xh->add_attribute("class", "page-header bg-primary");
175
    $xh->tag('div');
179
    $xh->tag('div');
176
        $xh->add_attribute("class", "container text-center py-3");
180
        $xh->add_attribute("class", "container text-center py-3");
177
        $xh->tag('div');
181
        $xh->tag('div');