<?php
require_once("models/config.php");
if(isUserLoggedIn()) { 
   
}else{
  header("Location: index.php"); die(); 
}
  
$mysqli = new mysqli("localhost", "bdicentralserver_sc", "Myl-PGfSbzcf", "bdicentralserver_sc");
$resulta = $mysqli->query("SELECT count(*) as total FROM pricefile_mx WHERE id_marca IN (SELECT manufacturer_id_xref FROM manufacturer_xref_user_mx WHERE user_id = ".$loggedInUser->user_id.") AND id_subcategoria IN (SELECT category_id FROM category_xref_user_mx WHERE user_id = ".$loggedInUser->user_id.") AND precio > 0 AND (DATEDIFF( now(),updated)) <= 30");
$a = $resulta->fetch_assoc();
echo $a["total"];
?>