$costs ) { if($costs!="") { if(mysql_num_rows(safe_query("SELECT payedID FROM ".PREFIX."cash_box_payed WHERE userID='$usID' AND cashID='$id'"))) { safe_query("UPDATE ".PREFIX."cash_box_payed SET costs='$costs' WHERE userID='$usID' AND cashID='$id'"); } else { safe_query("INSERT INTO ".PREFIX."cash_box_payed (cashID, userID, costs, date, payed) VALUES ('$id', '$usID', '$costs', '$date', '1')"); } } } header("Location: index.php?site=cash_box&id=$id"); } elseif($_GET['action']=="new") { echo'
'.$usersquad.$costs_squad.' | |||
';
if(mysql_num_rows($ergebnis)) {
$ds=mysql_fetch_array($ergebnis);
if(!$id) $id = $ds[cashID];
$ergebnis=safe_query("SELECT * FROM ".PREFIX."cash_box WHERE cashID='$id'");
$ds=mysql_fetch_array($ergebnis);
$date=date("d.m.Y", $ds[date]);
$paydate=date("d.m.Y", $ds[paydate]);
$bezahlen = safe_query("SELECT * FROM ".PREFIX."cash_box_payed WHERE cashID='$id' AND payed='1' ");
$payed = mysql_num_rows($bezahlen);
$konto = cleartext($ds[konto]);
$usage=$ds[usedfor];
if(iscashadmin($userID)) $adminaction='
';
eval ("\$cash_box_usage = \"".gettemplate("cash_box_usage")."\";");
echo $cash_box_usage;
$all=safe_query("SELECT * FROM ".PREFIX."cash_box WHERE squad='".$squadID."' ORDER BY paydate DESC");
echo' '; while($ds=mysql_fetch_array($all)) { echo'• '.$ds[usedfor].' '; } echo' | '; $ergebnis = safe_query("SELECT * FROM ".PREFIX."user ORDER BY nickname"); while($du=mysql_fetch_array($ergebnis)) { if($squadID == 0) { if(isclanmember($du[userID],$squadID)) $members[]=$du[userID]; } else if(issquadmember($du[userID],$squadID)) $members[]=$du[userID]; } eval ("\$cash_box_head = \"".gettemplate("cash_box_head")."\";"); echo $cash_box_head; foreach($members as $usID) { $ergebnis = safe_query("SELECT * FROM ".PREFIX."cash_box_payed WHERE userID='$usID' AND cashID='$id'"); $du=mysql_fetch_array($ergebnis); $user=''.getnickname($usID).''; if($du[payed]) { $paydate=date("d.m.Y", $du[date]); $payed='payed: '.$paydate.''; } else { $payed='not payed yet!'; } if(iscashadmin($userID)) { if($du[costs]) { $bg=BG_1; $costs=$du[costs]; } else { $costs=""; $bg=BG_2; } $payment=' €'; } else { if($du[costs]) { $costs=''.$du[costs].' €'; $bg=BG_1; } else { $costs='0.00 €'; $bg=BG_2; } $payment=$costs; } eval ("\$cash_box_content = \"".gettemplate("cash_box_content")."\";"); echo $cash_box_content; } if(iscashadmin($userID)) $admin=''; eval ("\$cash_box_foot = \"".gettemplate("cash_box_foot")."\";"); echo $cash_box_foot; }else echo'no entries'; echo' |