0) { $rsa = $conn->Execute("SELECT * FROM {$about_table} WHERE id = ? AND enabled = 1 AND (show_start IS NULL OR show_start <= curdate()) AND (show_end IS NULL OR show_end >= curdate())", array($param['id'])); if (!$rsa) die($conn->ErrorMsg()); $found = !$rsa->EOF; } if (!$found) { $rsa = $conn->Execute("SELECT * FROM {$about_table} WHERE enabled = 1 AND (show_start IS NULL OR show_start <= curdate()) AND (show_end IS NULL OR show_end >= curdate()) ORDER BY sort_order DESC, id ASC LIMIT 1"); if (!$rsa) die($conn->ErrorMsg()); if (!$rsa->EOF) { $found = TRUE; } else { header('Location:./'); } } $param['id'] = $rsa->fields['id']; $about['content'] = mq_runtime_decode($rsa->fields['content']); $settings['page_name'] = mq_runtime_decode($rsa->fields['title']); $settings['page_title'] .= " - {$settings['page_name']}"; $settings['page_name'] = htmlencode($settings['page_name']); $rsa->Close(); unset($rsa); require_once('header.php'); require_once('cart.php'); ?>