DATE_SUB(NOW(), INTERVAL 90 DAY) AND r.release_status = "in_content" AND er.upc IS NULL AND dh.upc IS NULL AND r.deletions <> "Y" AND eod.upc IS NULL AND r.not_for_distribution = "N" AND v.status = "signed" AND r.product_type_id = 1 GROUP BY r.upc ORDER BY ' . $order_by . ($sort_desc ? ' DESC' : ''); if (!$no_url) { $sql .= ' LIMIT ?, ?'; $dataParams->addDataParam('i', (($page - 1) * $pageRecord)); $dataParams->addDataParam('i', $pageRecord); } $result = $wrapperObj->executeQuery($sql, $dataParams); //echo $sql; exit; if ($result === false) { showierror($sql); } if (!$no_url) { $dataParams = new QueryData(); $sql = 'SELECT FOUND_ROWS() AS total'; $total_count = $wrapperObj->executeQuery($sql, $dataParams); if ($total_count === false) { showierror($sql); } $total_count_row = $total_count[0]; $total = $total_count_row['total']; $pageNum = ceil($total/$pageRecord); } $varTable = ' ' . ($no_url ? 'UPC' : sortColumnHeader('UPC', 'upc', $url)) . ' ' . ($no_url ? 'Release Name' : sortColumnHeader('Release Name', 'rn', $url)) . ' ' . ($no_url ? 'Artist Name' : sortColumnHeader('Artist Name', 'art', $url)) . ' ' . ($no_url ? 'Label' : sortColumnHeader('Label', 'lbl', $url)) . ' ' . ($no_url ? 'Owner' : sortColumnHeader('Owner', 'owner', $url)) . ' ' . ($no_url ? 'PM' : sortColumnHeader('PM', 'pm', $url)) . ' ' . ($no_url ? 'Date Added' : sortColumnHeader('Date Added', 'date_added', $url)) . ' ' . ($no_url ? 'Release Date' : sortColumnHeader('Release Date', 'rel_date', $url)) . ' ' . ($no_url ? 'Days Since Content' : sortColumnHeader('Days Since Content', 'days_since', $url)) . ' ' . ($no_url ? 'Image Scan' : sortColumnHeader('Image Scan', 'img_scan', $url)) . ' ' . ($no_url ? 'Marketing Priority' : sortColumnHeader('Marketing Priority', 'mkt_priority', $url)) . ' ' . ($no_url ? 'Label Priority' : sortColumnHeader('Label Priority', 'label_priority', $url)) . ' ' . ($no_url ? 'Suggested Encoding Order Priority' : sortColumnHeader('Suggested Encoding Order Priority', 'suggested_priority', $url)) . ' '; $rci = 0; foreach ($result as $RowData) { $row_class = (++$rci & 1) ? '' : 'alt'; $varTable .= ' ' . ($no_url ? '"'. $RowData['display_upc'] . '"' : '' . $RowData['display_upc'] . '') . ' ' . ($no_url ? $RowData['release_name'] : '' . $RowData['release_name'] . '') . ' ' . ($no_url ? $RowData['name'] : '' . $RowData['name'] . '') . ' ' . ($no_url ? $RowData['label'] : '' . $RowData['label'] . '') . ' ' . $RowData['owner'] . ' ' . $RowData['pm'] . ' ' . format_date($RowData['ingestion_completed']) . ' ' . format_date($RowData['release_date']) . ' ' . $RowData['days_since_content'] . ' ' . $RowData['image_scan'] . ' ' . $RowData['mkt_priority'] . ' ' . $RowData['label_priority'] . ' ' . $RowData['suggested_priority'] . ' '; } $varTable .= ' '; ?>