<?require_once("include/bittorrent.php");dbconn(false);loggedinorreturn();stdhead("Zgłoszenie na Uploadera");?><STYLE>.popup{CURSOR: help;TEXT-DECORATION: none}</STYLE><?if ($_POST["form"]=="") { if($CURUSER["class"]<UC_MODERATOR) $CURUSER["uploadpos"] == 'no'?0:2;else $form=10;} else$form=$_POST["form"];if($form==0) { $res=mysql_query("SELECT * FROM uploadapp WHERE userid=".$CURUSER["id"]) or sqlerr(__FILE__, __LINE__); if(mysql_num_rows($res)) { $row=mysql_fetch_array($res); $form=4; }}$debug=0;$upreq = 5;$upreqn = $upreq * 1073741824;begin_main_frame();if($debug) {begin_frame("Debug Box");print("<table>"); print("<form action="uploadapp.php" method="post" enctype="multipart/form-data" name="debug" id="uploadapp">");tr("User Class"," ".get_user_class_name($CURUSER["class"]),1);tr("Variables", "form = " . $form. "[br /]". "user = " . $_POST["user"]. "[br /]". "groupacct = " . $_POST["groupacct"]. "[br /]". "grouname = " . unesc($_POST["groupname"]). "[br /]". "groupdes = " . unesc($_POST["groupdes"]). "[br /]". "joined = " . unesc($_POST["joined"]). "[br /]". "ratio = " . unesc($_POST["ratio"]). "[br /]". "upk =". unesc($_POST["upk"]). "[br /]". "rbseed = ".unesc($_POST["rbseed"]). "[br /]rbrelease = ".unesc($_POST["rbrelease"]). "[br /]rbstime = ".unesc($_POST["rbstime"]) . "[br /]". "plans =". unesc($_POST["plans"]). "[br /]". "comment =". unesc($_POST["comment"]). "[br /]". "",1); tr("View forms","<input type="radio" name="form" value="0" ". ($form==0?"checked":""). ">Upload App". "<input name="form" type="radio" value="3" ".($form==3?"checked":"").">Moderator+ Page". "<input type="submit" name="SubmitD" value="Change Forms">",1); print("</table> </form>");end_frame();}if($form>=10 && $CURUSER["class"]<UC_MODERATOR) {begin_frame("Invalid Request");end_frame();} else if($form==0) {begin_frame("<center>Zgłoszenia na Uploadera</center>");?> <form action="uploadapp.php" method="post" enctype="multipart/form-data" name="uploadapp" id="uploadapp"> <table border="1" cellspacing="0" cellpadding="10" ALIGN="center"><?if ($CURUSER["downloaded"] > 0)$ratio = $CURUSER['uploaded'] / $CURUSER['downloaded'];else if ($CURUSER["uploaded"] > 0)$ratio = 1;else$ratio = 0;tr("<P ALIGN=left>Użytkownik</P>"," <input name="user" type="hidden" value="". $CURUSER['id']."">".$CURUSER['username'],1);tr("<P ALIGN=left>Zarejestrowany dnia"," <input name="joined" type="hidden" value="".$CURUSER['added']."">".$CURUSER['added'],1);tr("<P ALIGN=left>Ratio jest większe lub równe 1.0"," <input name="ratio" type="hidden" value="".($ratio>=1?"ok":"not ok")."">".($ratio>=1?"<font color=green>Tak</font>":"<font color=red>Nie</font>"),1);$upreqm=$CURUSER['uploaded']>=$upreqn;tr("<P ALIGN=left>Wysłane przynajmniej ". $upreq ." gb"," <input name="upk" type="hidden" value="".($upreqm?"yes":"no")."">".($upreqm?"<font color=green>Tak</font>":"<font color=red>Nie</font>"),1);tr("<P ALIGN=left>Czy jeste¶ dostępny?","<input type="radio" name="groupacct" value="1">Tak". "<input name="groupacct" type="radio" value="0" checked>Nie",1);tr("<P ALIGN=left>Czy wiesz jak tworzyć pliki torrent?","<input type="radio" name="rbseed" value="1">Tak". "<input name="rbseed" type="radio" value="0" checked>Nie",1);tr("<P ALIGN=left>Czy zobowi±zujesz się do wstawiania minimum 3 torrentów w tygodniu?</P>","<input type="radio" name="rbrelease" value="1">Tak". "<input name="rbrelease" type="radio" value="0" checked>Nie",1);tr("<P ALIGN=left>Czy zapewnisz minimaln± prędko¶ć wysyłania na każdej pozycji? (32 kB/s)","<input type="radio" name="rbstime" value="1">Tak". "<input name="rbstime" type="radio" value="0" checked>Nie",1);tr("<P ALIGN=left>[br /]Prędko¶ć twojego ł±cza (Wysyłanie)","<textarea name="comment" cols="14" rows="1" wrap="VIRTUAL"></textarea>",1);tr("<P ALIGN=left>Dlaczego powiniene¶ otrzymać[br /] możliwo¶ć wstawiania torrentów?","<textarea name="plans" cols="14" rows="1" wrap="VIRTUAL"></textarea>",1);?></table> [br /]<center><input name="form" type="hidden" value="1" ALIGN="center"><input type="submit" name="Submit" value="Wy¶lij zgłoszenie"> </table> </form><?end_frame();} else if ($form==1) {begin_frame("Zgłoszenie na Uploadera");$qry="INSERT INTO uploadapp (userid,applied,grpacct,grpname,grpdes,content,comment,seeding,othergrps,seedtime) ". "VALUES (". $_POST["user"].", ". implode(",",array_map("sqlesc",array( get_date_time(), $_POST["groupacct"], $_POST["groupname"], $_POST["groupdes"], $_POST["plans"], $_POST["comment"], $_POST["rbseed"], $_POST["rbrelease"], $_POST["rbstime"]))).")";$ret=mysql_query($qry);if (!$ret) { if (mysql_errno() == 1062) print("Zgłoszenie już nie istnieje[br /]"); else print("mysql puked: ".mysql_error());} else print("<h2>Twoje zgłoszenie na uploadera zostało wysłane, czekaj cierpiwie aż do otrzymania odpowiedzi.</h2>"); end_frame();} else if($form==2) {begin_frame("Uploaders Application Request");print("<h2>You already have upload capabilities</h2>");end_frame();} else if($form==4) {begin_frame("Your Application Request"); $votesyes=$votesno==0; if($row["votes"]!="") { $votes=explode(" ",$row["votes"]); for($i=0;$i<count($votes);$i++) { $votei=explode(":",$votes[$i]); $votei[1]?$votesyes++:$votesno++; } } print("Upload Application: Yes = ".$votesyes." No = ".$votesno); print("[br /]Polls are ".($row["active"]=="0"?"Closed":"Open").".");end_frame();} else if($form>=10) {begin_frame("<center>Kandydaci na Uploaderów</center>");if($form==11) { $res=mysql_query("SELECT * FROM uploadapp WHERE id=".$_POST["pollid"]) or sqlerr(__FILE__, __LINE__); $row=mysql_fetch_array($res); $votesyes=$votesno=$voted=0; if($row["votes"]!="") { $votes=explode(" ",$row["votes"]); for($i=0;$i<count($votes);$i++) { $votei=explode(":",$votes[$i]); if($CURUSER["id"]==$votei[0]) $voted++; $votei[1]?$votesyes++:$votesno++; } } if($_POST["ballet"] && $voted==0) { $votes=($row["votes"]!=""?$row["votes"]." ":"").implode(":",array($CURUSER["id"],$_POST["ballet"]=="Yes"?1:0)); mysql_query("UPDATE uploadapp SET votes='".$votes."' WHERE id=".$_POST["pollid"]); print("Vote for ".$_POST["pollid"]." recieved (".$_POST["ballet"].")[br /]"); } else if($_POST["closepoll"]) { if(count($votes)<5) { } else { mysql_query("UPDATE uploadapp SET active='0' WHERE id=".$_POST["pollid"]); $tvotes=$votesyes+$votesno; $votea=$votesyes>$votesno; $modcomment = gmdate("Y-m-d") . " - Upload Application: ".($votea?"Accepted":"Denied")." (Yes = ".$votesyes." No = ".$votesno." (". number_format((($votea?$votesyes:$votesno)/$tvotes)*100,3)."%)"; print($modcomment."[br /]"); if($votea) { $mq="UPDATE users SET uploadpos='yes',class='".UC_UPLOADER."',modcomment=CONCAT(modcomment,".sqlesc($modcomment." ").") WHERE id=".$row["userid"]; mysql_query($mq); print("Updating User Records...[br /]"); $dt = sqlesc(get_date_time()); $msg = sqlesc("Congrats, You have been accepted as a new Uploader!. "); mysql_query("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, ".$row["userid"].", $dt, $msg, 0)") or sqlerr(__FILE__, __LINE__); } else { $mq="UPDATE users SET modcomment=CONCAT(modcomment,".sqlesc($modcomment." ").") WHERE id=".$row["userid"]; mysql_query($mq); $dt = sqlesc(get_date_time()); $msg = sqlesc("sorry, You have been denied as a new Uploader. "); mysql_query("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, ".$row["userid"].", $dt, $msg, 0)") or sqlerr(__FILE__, __LINE__); } } } else if($_POST["removepoll"]) { mysql_query("DELETE FROM uploadapp where id=".$_POST["pollid"]); } else if($_POST["addcomment"]) { print ("Comment: ".sqlesc($_POST["newcomments"])."[br /]"); if(($_POST["newcomments"])) { $un=sqlesc($CURUSER["username"].": ".$_POST["newcomments"]." "); $mq="UPDATE uploadapp SET modcomments=CONCAT(modcomments,".$un.") WHERE id=".$_POST["pollid"]; mysql_query($mq); print("Added coment to poll ".$_POST["pollid"]); } } }$res=mysql_query("SELECT * FROM uploadapp ORDER BY applied DESC") or sqlerr(__FILE__, __LINE__);if(!mysql_num_rows($res)) print("<center>Nic tutaj nie ma!");else {?> <table> <tr><td>Ankieta</td> <td>Użytkownik</td> <td><span title=" Application Date & Join Date " class="popup">Data zarejestrowania</span></td> <td><span title=" Group Affiliated Application " class="popup">Dostępny</span></td> <td><span title=" Purposed Content to deliver" class="popup">Dlaczego chcesz otrzymać uploadera</span></td> <td><span title=" Comments Left to us ops to sway us to vote yes" class="popup">Prędko¶ć Wysyłania</span></td> <td><span title=" Does User Pass Ratio Requirement?" class="popup">Ratio</span></td> <td><span title=" Does User Pass Upload Transmission Requirement?" class="popup"><?=$upreq?>gb+</span></td> <td><span title=" Does User know how to seed torrents?" class="popup"><center>Tworzenie torrenta</span></td> <td><span title=" Does User acknowledge other groups right to only upload their titles?" class="popup"><center>3 torrenty tygodniowo</span></td> <td><span title=" Does User acknowledge minimal seeding times?" class=popup"><center>Min. prędko¶ć torrenta</span></td> <td><center>Zagłosuj w ankiecie</td> </tr><? while($row=mysql_fetch_array($res)) { $resu=mysql_query("SELECT * FROM users where id = ".$row["userid"]) or sqlerr(__FILE__, __LINE__); $rowu=mysql_fetch_array($resu); $voted=$tvotes=$votesyes=$votesno=0; if($row["votes"]!="") { $votes=explode(" ",$row["votes"]); for($i=0;$i<count($votes);$i++) { $votei=explode(":",$votes[$i]); if($CURUSER["id"]==$votei[0]) $voted++; $votei[1]?$votesyes++:$votesno++; $tvotes++; } } if ($rowu["downloaded"] > 0) $ratio = $rowu['uploaded'] / $rowu['downloaded']; else if ($rowu["uploaded"] > 0) $ratio = 1; else $ratio = 0;?> <tr> <form action="uploadapp.php" method="post" enctype="multipart/form-data" name="poll<?=$row["id"]?>" id="uploadapp"> <input name="form" type="hidden" value="11"> <input name="pollid" type="hidden" value="<?=$row["id"]?>"> <td><?=$row["id"]?></td> <td><a href=userdetails.php?id=<?=$row["userid"]?>><?=$rowu["username"]?>[/url]</td> <td><?=$row["applied"]?></td> <td <?=($row["grpacct"]?"><center><font color=green>Tak</font>".unesc($row["grpdes"])." ".unesc($row["grpname"]):"><font color=red><center>Nie</font>")?></td> <td><?=$row["content"]?></td> <td><?=$row["comment"]?></td> <td bgcolor="<?=($ratio>=1?"#00FF00":"#FF0000")?>"></td> <td bgcolor="<?=($rowu["uploaded"]>=$upreqn?"#00FF00":"#FF0000")?>"></td> <td bgcolor="<?=($row["seeding"]?"#00FF00":"#FF0000")?>"></td> <td bgcolor="<?=($row["othergrps"]?"#00FF00":"#FF0000")?>"></td> <td bgcolor="<?=($row["seedtime"]?"#00FF00":"#FF0000")?>"></td> <td rowspan="2"><?=($voted||!$row["active"]?$votesyes." Yes[br /]".$votesno." No" :"Zagłosuj: ".$tvotes."[br /]". "<input name="ballet" type="submit" value="Tak">". "<input name="ballet" type="submit" value="Nie">"). (($CURUSER["class"]>=UC_ADMINISTRATOR&&$row["active"])?"<input name="closepoll" type="submit" value="Zamknij ankietę">": "[br /]".($row["active"]?"[br /]<font color=#00FF00>Poll Open</font>":"[br /]<font color=#FF0000>Poll Closed</font>")). ($CURUSER["class"]>=UC_SYSOP?"[br /]<input name="removepoll" type="submit" value="Usuń ankietę">":"") ?></td></tr> </form><tr> <form action="uploadapp.php" method="post" enctype="multipart/form-data" name="poll<?=$row["id"]?>" id="uploadapp"> <input name="form" type="hidden" value="11"> <input name="pollid" type="hidden" value="<?=$row["id"]?>"> <td> </td> <td>Komentarz</td> <td colspan="4"><textarea name="modcomments" rows="5" cols="80"><?=$row["modcomments"]?></textarea></td> <td colspan="5"><input name="newcomments" type="text" value="" maxlength="70">[br /]<input type="submit" name="addcomment" value="Dodaj komenatarz"></td> </form> </tr><? } print("</table>"); }end_frame();} end_main_frame();stdfoot();?>