Subversion Repositories cheapmusic

Rev

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

Rev 77 Rev 78
Line 368... Line 368...
368
}
368
}
369
 
369
 
370
// print result table or card deck
370
// print result table or card deck
371
function printResult() {
371
function printResult() {
372
    if ($_SESSION["currentLayout"] == 'TableView') {
372
    if ($_SESSION["currentLayout"] == 'TableView') {
373
        return buildTable();
373
        return buildTable($_SESSION["resultArr"]);
374
    }
374
    }
375
    else /* CardView */ {
375
    else /* CardView */ {
376
        return buildCardDeck();
376
        return buildCardDeck($_SESSION["resultArr"]);
377
    }
377
    }
378
}
378
}
379
 
379
 
380
// build HTML table from array
380
// build HTML table from array
381
function buildTable() {
381
function buildTable($arr) {
382
    global $mediaTypeTextArr;
382
    global $mediaTypeTextArr;
383
    global $mediaTypeIconArr;
383
    global $mediaTypeIconArr;
384
 
384
 
385
    $str = "";
385
    $str = "";
386
 
386
 
387
    if (count($_SESSION["resultArr"]) > 0) {
387
    if (count($arr) > 0) {
388
        $str .= "<div class=\"table-responsive\">";
388
        $str .= "<div class=\"table-responsive\">";
389
        $str .= "<table class=\"table table-striped table-condensed table-hover small bg-info\">";
389
        $str .= "<table class=\"table table-striped table-condensed table-hover small bg-info\">";
390
        $str .= "<thead class=\"thead-dark sticky-top\"><tr><th>Image</th><th class=\"text-left\">Title / Merchant</th><th>Condition</th><th class=\"hide-small\">Price</th><th class=\"hide-small\">S/H</th><th>Total</th><th class=\"hide-extra-small\"></th></tr></thead>";
390
        $str .= "<thead class=\"thead-dark sticky-top\"><tr><th>Image</th><th class=\"text-left\">Title / Merchant</th><th>Condition</th><th class=\"hide-small\">Price</th><th class=\"hide-small\">S/H</th><th>Total</th><th class=\"hide-extra-small\"></th></tr></thead>";
391
        $str .= "<tbody>";
391
        $str .= "<tbody>";
392
 
392
 
393
        foreach ($_SESSION["resultArr"] as $row) {
393
        foreach ($arr as $row) {
394
            if (!$row["Show"]) {
394
            if (!$row["Show"]) {
395
                continue;
395
                continue;
396
            }
396
            }
397
 
397
 
398
            $href = "href=\"" . $row["URL"] . "\" target=\"_blank\" onclick=\"saveTransfer('" . $row["URL"] . "'); return true;\"";
398
            $href = "href=\"" . $row["URL"] . "\" target=\"_blank\" onclick=\"saveTransfer('" . $row["URL"] . "'); return true;\"";
Line 491... Line 491...
491
 
491
 
492
    return ($str);
492
    return ($str);
493
}
493
}
494
 
494
 
495
// build HTML card deck from array
495
// build HTML card deck from array
496
function buildCardDeck() {
496
function buildCardDeck($arr) {
497
    global $mediaTypeTextArr;
497
    global $mediaTypeTextArr;
498
    global $mediaTypeIconArr;
498
    global $mediaTypeIconArr;
499
 
499
 
500
    $str = "";
500
    $str = "";
501
 
501
 
502
    if (count($_SESSION["resultArr"]) > 0) {
502
    if (count($arr) > 0) {
503
        $str .= "<div class=\"card-deck small\">";
503
        $str .= "<div class=\"card-deck small\">";
504
 
504
 
505
        foreach ($_SESSION["resultArr"] as $row) {
505
        foreach ($arr as $row) {
506
            if (!$row["Show"]) {
506
            if (!$row["Show"]) {
507
                continue;
507
                continue;
508
            }
508
            }
509
 
509
 
510
            $href = "href=\"" . $row["URL"] . "\" target=\"_blank\" onclick=\"saveTransfer('" . $row["URL"] . "'); return true;\"";
510
            $href = "href=\"" . $row["URL"] . "\" target=\"_blank\" onclick=\"saveTransfer('" . $row["URL"] . "'); return true;\"";