Blame | Letzte Änderung | Log anzeigen | RSS feed
<?$self=basename($PHP_SELF);$tab="banner";define ("modul_name", "branchenbuch");define ("tool_name", "branchen");require_once "../Online-Shop/connect2.php";if ($_POST){$_SESSION[bannerLog][settings]=$_POST;}?><html><head><title>Bannerverwaltung <? echo $site ?>: Redaktionssystem</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link rel=stylesheet type="text/css" href="../Online-Shop/redaktion.css"><link rel=stylesheet type="text/css" href="buttons.css"><link rel=stylesheet type="text/css" href="../styles/styles.php"></head><body><form action="<?=$self;?>" method=POST><table><tr><?$selectoren=array("Kunde" => "SELECT ID as value, Name1 as name FROM Logins where user != ''","Banner" => "select ID as value, name as name from banner order by name","Zeit" => array(array(name => "heute", value => "date = curdate()"),array(name => "gestern", value => "date = date_sub(curdate(), INTERVAL 1 DAY)"),array(name => "lfd. Woche", value => "date_format(date,'%U') = date_format(curdate(),'%U')"),array(name => "letzte Woche", value => "date_format(date,'%U') = date_format(date_sub(NOW(), INTERVAL 7 DAY),'%U')"),array(name => "lfd. Monat", value => "date_format(date,'%m') = date_format(NOW(),'%m')"),array(name => "letzter Monat", value => "date_format(date,'%m') = date_format(date_sub(NOW(), INTERVAL 1 MONTH),'%m')")));foreach(array_keys($selectoren) as $selector){if (is_string($selectoren[$selector])){$buffer=array();$result=mysql_query($selectoren[$selector]);while($row=mysql_fetch_assoc($result)){$buffer[] = $row;}$selectoren[$selector] = $buffer;}?><td> <?=$selector;?>: <select name="<?=$selector;?>"><option></option><?foreach($selectoren[$selector] as $row){?><option<? if (stripslashes($_SESSION[bannerLog][settings][$selector]) == $row[value]) { echo " selected";} ?> value="<?=$row[value];?>"><?=$row[name];?></option><?}?></select></td><?}?><td><input type="submit" value="OK"></td></tr></table></form><style>td{text-align:center;}</style><table border="0" cellpadding="5" cellspacing="0" bordercolor="#000000"><?$conditions = array();if ($_SESSION[bannerLog][settings][Kunde]){$conditions[] = "Logins_ID = ".$_SESSION[bannerLog][settings][Kunde];}if ($_SESSION[bannerLog][settings][Banner]){$conditions[] = "banner_ID = ".$_SESSION[bannerLog][settings][Banner];}if ($_SESSION[bannerLog][settings][Zeit]){$conditions[] = stripslashes($_SESSION[bannerLog][settings][Zeit]);}if (count($conditions) > 0){$cond=" and ".implode(" and ",$conditions);}$query="selectbanner.name as Banner,date_format(bannerLog.date, '%d.%m.%Y') as Datum,bannerLog.impressionCounter as impressions,bannerLog.clickCounter as clicks,bannerLog.conversionCounter as conversions,if (banner.billBy = 'impression', banner.costPerImpression * bannerLog.impressionCounter, 0) as costImpression,if (banner.billBy = 'click', banner.costPerClick * bannerLog.clickCounter, 0) as costClickfrombannerLog,bannerwherebanner.ID = bannerLog.banner_ID$condorder bybanner_ID,date desc";$result=mysql_query($query) or die (mysql_errno().": ".mysql_error()."<hr>".$query."<hr>");$firstRow=true;$rowData=array();while($row=mysql_fetch_assoc($result)){foreach(array_keys($row) as $elem){if (is_numeric($row[$elem])){$rowData[$elem]+=$row[$elem];}else{$rowData[$elem]=" ";}}if ($firstRow==true){$firstRow=false;?><tr class="rechts"><td><?=implode("</td><td>",array_keys($row));?></td></tr><?}?><tr><td><?=implode("</td><td>",$row);?></td></tr><?}?><tr><td colspan=<?=count($rowData);?>><hr noshade></td></tr><tr><td><?=implode("</td><td>",$rowData);?></td></tr></table></body></html>