= '".$_GET['Datestart']."'":""; $Dateend = (!empty($_GET['Dateend']))?" AND f.CRDATE <= ('".$_GET['Dateend']."')+INTERVAL 1 DAY":""; } $Param = (!empty($_GET['public']))?" AND i.Hash = '{$_GET['public']}'":""; $Hash = (!empty($_GET['Hash']))?" AND f.Original = '{$_GET['Hash']}'":""; $query="SELECT i.Name, i.Hash, f.Original, f.Owner FROM Izdan AS i LEFT JOIN FilesList AS f ON i.Num = f.Owner WHERE 1 ".$Datestart.$Dateend.$Hash.$Param." ORDER BY i.Name"; $result = mysql_query($query,$conn)or die("Error"); $q_stat="SELECT * FROM Stat"; $res_stat = mysql_query($q_stat,$conn)or die("Error"); while ($row = mysql_fetch_assoc($res_stat) ) { $d_stat[][$row['Hash']] = $row['Price']; } $mem = ""; $ii = 0; $p = 0; $I = $ii; $P = $p; if (mysql_num_rows($result)>0){ while ($row = mysql_fetch_assoc($result)){ if($row['Original']!=null){ if(($mem != $row["Name"])&&($mem != "")){ echo "
"; $I = $I+$ii; $P = $P+$p; $mem = ""; $ii = 0; $p = 0; }; echo '
'; echo "". ""; echo ""; $i = 0; $j = 0; foreach($d_stat as $val){ if(key($val) == $row['Original']){ $i++; if($val[$row['Original']]>0) $j++; } } echo ""; echo ""; echo ''; $mem = $row["Name"]; $ii = $ii+$i; $p = $p+$j; } }; $I = $I+$ii; $P = $P+$p; echo "
"; } ?>
Код файла Код публикации название журнала цена количество скачиваний количество платных скачиваний
Итого:".$ii."".$p."
".$row['Original']."".$row['Hash']."".$row['Name'].""; foreach($d_stat as $val){ if(key($val) == $row['Original']){ echo $val[$row['Original']]; break; } } echo "".$i."".$j."
Итого:".$ii."".$p."
Всего:".$I."".$P."