Jump to content
MakeWebGames

Script47

Members
  • Posts

    1,150
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Script47

  1. Is the "_" needed just wondering? Maybe if you did something like database-1 or db1? Just some suggestions.
  2.   I think it is that, because it's fine on my actual source code.
  3. No offence, but did you read what I read? Your answer has nothing to do with the question from what I can see. @Sjobbe, I'm not sure as don't use NWE but try change the DB name to something else and if it works then will know there is conflicts with that name mate. :)
  4. Finally, some constructive criticism. Thanks, I will update the code as soon as with some of them changes, thanks for your feedback mate. However I don't get number 3 on your list :)
  5. Hello fellas, once again I created a mod, this one a lot more simple. Basically what it is a way for members to win money/crystals with a 50/50 chance. This mod was asked to be created by Brodiep. All blank echo's on my original code are "<br/>" on here it messes up, so you may want to update it on your version of the code. Although a Pastebin link has been added too now. 50/50 Pastebin * Maximum cash 5K * Maximum crystals 100 I can adjust these if you wish. *Remember* You need to add this page link where ever you want it. Page Link: <a href="5050.php">50/50</a> 5050.php <html> <head> <title>50/50</title> <style> .win { color:green; font-weight:bold; } .lose { color:red; font-weight:bold; } </style> </head> <?php include 'globals.php'; /* * Designed and developed by Script47 * Module idea given by Brodiep * The code here (named "5050" or "50/50") is provided "as is" with no warranty or gurantee of safety to existing code. * 50/50 has been fully tested and is found to work as intended. * 50/50 is released freely under the GNU License. Feel free to modify as you wish, as long as this comment block remains atuynd remains untouched. * This module is free, if you have purchased it from anyone, demand a full refund. */ $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? trim($_GET['action']) : null; switch ($_GET['action']) { case "placeBetMoney": placeBetMoney(); break; case "placeBetCrystals": placeBetCrystals(); break; default: index(); break; } function index() { echo '<h3>50/50</h3>'; echo '<a href="index.php">Home</a>'; echo '<br/>'; echo '<br/>'; echo 'Here you can bet sums of money up to 5K or 100 crystals, this game is full of chance do it at <strong>your own risk.</strong></b><br/>'; ?> <br/> <br/> <form action='5050.php?action=placeBetMoney' method='post'> <strong>Money:</strong> <input type='number' name='money'><br/> <input type='submit' value='Go!'><br/> </form> <br/> <form action='5050.php?action=placeBetCrystals' method='post'> <strong>Crystals:</strong> <input type='number' name='crystals'><br/> <input type='submit' value='Go!'><br/> </form> <?php } function placeBetMoney() { global $db, $ir, $h; if ($_POST['money'] > $ir['money']) { echo '<br/>'; echo "<font color='red'>You don't have that much money!</br></font"; echo '<a href="5050.php">Back</a>'; $h->endpage(); exit(); } $maxMoney = 5000; if ($_POST['money'] > $maxMoney) { echo '<br/>'; echo "<font color='red'>Maximum amount of money is $5000!</br></p>"; echo '<a href="5050.php">Back</a>'; $h->endpage(); exit(); } if (!ctype_digit($_POST['money'])) { echo '<br/>'; echo 'The Money field refers to a numerical value, please go back and try again.<br/>'; echo '<a href="5050.php">Back</a>'; $h->endpage(); exit(); } else { $money = abs(intval($_POST['money'])); } $chance = rand(1, 2); $winnings = $_POST['money'] + $_POST['money']; if ($chance == 2) { echo '<br/>'; echo '<p class="lose">Unlucky, you lost $' .$_POST['money']. '<br/></p>'; echo "<a href='5050.php'>Back</a>"; $db->query("UPDATE `users` SET money=money-$money WHERE userid={$_SESSION['userid']}"); } else { echo '<br/>'; echo '<p class="win">Congratulations! You win $' .$winnings. '<br/></p>'; echo "<a href='5050.php'>Back</a>"; $db->query("UPDATE `users` SET money=money+$money WHERE userid={$_SESSION['userid']}"); } } function placeBetCrystals() { global $db, $ir, $h; if ($_POST['crystals'] > $ir['crystals']) { echo '<br/>'; echo "<p class='lose'>You don't have that many crystals!</br></p>"; echo '<a href="5050.php">Back</a>'; $h->endpage(); exit(); } $maxCrystals = 100; if ($_POST['crystals'] > $maxCrystals) { echo '<br/>'; echo "<p class='lose'>Maximum amount of crystals is 100!</br></p>"; echo '<a href="5050.php">Back</a>'; $h->endpage(); exit(); } if (!ctype_digit($_POST['crystals'])) { echo '<br/>'; echo '<p class="lose">The Crystals field refers to a numerical value, please go back and try again.<br/></p>'; echo '<a href="5050.php">Back</a>'; $h->endpage(); exit(); } else { $crystals = abs(intval($_POST['crystals'])); } $chance = rand(1, 2); $winnings = $_POST['crystals'] + $_POST['crystals']; if ($chance == 2) { echo '<br/>'; echo '<p class="lose">Unlucky, you lost ' .$_POST['crystals']. ' crystals</p>'; echo "<a href='5050.php'>Back</a>"; $db->query("UPDATE `users` SET crystals=crystals-$crystals WHERE userid={$_SESSION['userid']}"); } else { echo '<br/>'; echo '<p class="win">Congratulations! You win ' .$winnings. ' crystals<br/></p>'; echo '<br/>'; echo "<a href='5050.php'>Back</a>"; $db->query("UPDATE `users` SET crystals=crystals+$crystals WHERE userid={$_SESSION['userid']}"); } } $h->endpage(); ?> Tell me what you all think about it. :) Thanks.
  6. Just saying I thought it looked a bit like EZRPG. How long did it take to make?
  7. *Deadline Information* 06/07/2013 or 07/07/2013
  8. Small but quality, would be useful for beginners in games.
  9. Looks sweet mate, good job! :)
  10. Probably that you gain more stats upgrade unlike the standard gym.
  11. Script47

    Cloning?

    Personally, I think this should be fine - if as you say you're only using the core mechanics and obviously not everything. Are you thinking about actually doing this? Plus just saying berty is doing the same thing with Minecraft I think and creating the same type of game, on browser.
  12. Just a bit off topic, but make it a donater's feature maybe. Just a thought.
  13. Dog fights for entertainment purposes only. xD
  14. Have to agree with the others, it does seem very overpriced.
  15. Check the other images lol it's done mate :P
  16. And the ability to bet on them to make some money too maybe?
  17. Just saying, in the future just specify, only constructive criticism please. Or something like that. :)
  18. Thanks mate. :)   Thanks dude, feel free to post any improvements or ideas. :)
  19. So I decided to start coding up a player report, one which is more advance, some features it will include can be found below, currently I don't know when it will be finished however I will keep you updated on what I have completed, you will find that below too. :) Currently I have coded the main page & the ability to file new reports you will find images about that underneath as well. So the image links you see are action for staff. Also I personally like to be able to keep things on one page, so the staff features are on the one file, not in staff panel. Staff features: Modify/Respond to report Delete Report Report's Archive Report Filter Currently coded things (Main)/Fixed things (Secondary)/Misc additions (Side/Requested Features) Main page (Main) File a Report (Main) Time Stamp (Side/Requested Features) Case Urgencies (Side/Requested Features) Best Features: Controllable in one single page Filter through tasks - Find cases easily if you have a pile of them Task Archive- closed or dismissed cases get archived so you always have previous records that are easily obtainable Ease of use - very easy to use! :p Feel free to give me advice, or things you would like to see, I will gladly try and implement any ideas in - if I can. :) Some images of current progress, will try and update as I go along. So I decided to start coding up a player report, one which is more advance, some features it will include can be found below, currently I don't know when it will be finished however I will keep you updated on what I have completed, you will find that below too. :) Currently I have coded the main page & the ability to file new reports you will find images about that underneath as well. So the image links you see are action for staff. Also I personally like to be able to keep things on one page, so the staff features are on the one file, not in staff panel. Staff features: Modify/Respond to report Delete Report Report's Archive Report Filter Currently coded things (Main)/Fixed things (Secondary)/Misc additions (Side/Requested Features) Main page (Main) File a Report (Main) Time Stamp (Side/Requested Features) Case Urgencies (Side/Requested Features) Delete Page (Main) Corresponding Link to ID (Side/Requested Features) Modify case (Main) Respond to case (Main) Cases archive (Main) Best Features: Controllable in one single page Filter through tasks - Find cases easily if you have a pile of them Task Archive- closed or dismissed cases get archived so you always have previous records that are easily obtainable Ease of use - very easy to use! :p Feel free to give me advice, or things you would like to see, I will gladly try and implement any ideas in - if I can. :) Some images of current progress, will try and update as I go along. Main Page [ATTACH=CONFIG]1035[/ATTACH] Create Report [ATTACH=CONFIG]1027[/ATTACH] Delete Report - Picks out all the details of that single case and show's it, so you can review it one last time if you wish to delete. [ATTACH=CONFIG]1036[/ATTACH] *Updates* 03/07/2013 CSS Changes (Side/Requested Features) PHP ID's automated and links moved (Side/Requested Features) - will explain tomorrow with images, tired lol long day. :) PHP ID's automated explantion - So before you would have had to write the ID of the case you want to delete through a form, but now you don't as it's automated to make life easier. :) 04/07/2013 Added Updated Image (Side/Requested Features) Created Delete Feature (Main) 06/07/2013 Created ability to modify case (Main) Created ability to respond to case (Main) Created ability to go through cases archive (Main) *Deadline Information* 06/07/2013 or 07/07/2013 *Mod Creation Complete - Code will be added (later on today) after some checks.* Special thanks to: Kyle Mass - Helping me on countless occasions, no matter how much explaining he had to do. Showed me loads of examples of code, to help me. Nick - Was able to create this feature (PHP ID's automated) with the help of Nick here, a great teacher. Ian - No matter how busy, always would help me with code. Dom - Helped with tutorial links, where I could find out useful things. DJK - Stayed awake till three last night with me, reviewing my code. Taught me how to secure bits of my code. Or has he put it " just taught you a few functions and their uses/downsides." :p I appreciate all the help you all have given me, and if not for your help, my code would most likely suck loads! :p Thanks loads fellas. If I've missed you, give me a shout! pReport.php <html> <head> <title>Player Report</title> </head> <style> table { border-collapse:collapse; background-color: #EDEDED; width:95%; } th { background-color: #E8E8E8; height:50px; } </style> </html> <?php include 'globals.php'; /* * Designed and developed by Script47 & Ramzy <----- lol xD * The code here (named "pReport") is provided "as is" with no warranty or gurantee of safety to existing code. * pReport has been fully tested and is found to work as intended. * pReport is released freely under the GNU License. Feel free to modify as you wish, as long as this comment block remains atuynd remains untouched. */ $_GET['action'] = isset($_GET['action']) && ctype_alnum($_GET['action']) ? trim($_GET['action']) : null; switch ($_GET['action']) { case "newReport": newReport(); break; case "newReportGo": newReportGo(); break; case "modifyReport": modifyReport(); break; case "modifyReportDo": modifyReportDo(); break; case "respondReportDo": respondReportDo(); break; case "deleteReport": deleteReport(); break; case "deleteReportDo": deleteReportDo(); break; case "casesArchive": casesArchive(); break; case "searchFilter": searchFilter(); break; case "searchFilterGo": searchFilterGo(); break; default: index(); break; } function index() { global $db, $ir; echo '<h3>Player Reports</h3>'; echo '<a href="index.php">Home</a><br/>'; echo '<br/>'; if ($ir['user_level'] >1) { echo ' &middot <a href="pReport.php?action=casesArchive"> <img src="images/archive.png " title="Cases Archive" /></a> &middot <a href="pReport.php?action=searchFilter"> <img src="images/filter.png " title="Case Filter"/></a> &middot'; // Colour codes in array. $caseStatusColours = array( 0 => "<span style='color:#AF4035;' value='0'>Queued</span>", 1 => "<span style='color:#FFCC66;' value='1'>Pending</span>", 2 => "<span style='color:#79A888;' value='3'>Closed</span>", 3 => "<span style='color:#A9A9A9;' value='4'>Case Dismissed</span>", ); $caseUrgencyColours = array( 0 => "<span style='color:#AF4035;' value='0'>Low</span>", 1 => "<span style='color:#FFCC66;' value='1'>Medium</span>", 2 => "<span style='color:#FF9933;' value='2'>High</span>", 3 => "<span style='color:#FF704D;' value='3'>Urgent</span>" ); // Table headings. $showCurrentCases = $db->query("SELECT * FROM `preports`"); echo '<center><table border="1">'; echo '<tr>'; echo '<th><br/>Basic Task Info</th>'; echo '<th><br/>Other Details</th>'; echo '<th><br/>Misc</th>'; echo '<th><br/>Actions</th>'; while ($row = $db->fetch_row($showCurrentCases)) { // Print out the contents of each row into a table. echo "<tr><td>"; echo '<b>Case ID:</b> ', htmlentities($row['prID']), '<br/>', ' <b>Case Name:</b> ', htmlentities($row['prName']), '<br/>', ' <b>Date/Time Reported:</b> ', htmlentities(date('d/m/y g:i A',strtotime($row['prDateTime']))), '<br/>', '<b>Case Desc:</b> ', htmlentities($row['prDesc']); echo "</td><td>"; echo '<b>Staff Over Seeing Case:</b> ', htmlentities($row['prStaffOverSeeingCase']), '<br/>', '<b>Reporter:</b> ', htmlentities($row['prReporter']), '<br/>', '<b>Offender:</b> ', htmlentities($row['prOffender']); echo "</td>"; echo '<td> <b>Case Status:</b> ', $caseStatusColours[$row['prStatus']], '<br/>', '<b>Case Urgency:</b> ', $caseUrgencyColours[$row['prUrgency']], '<br/>'; echo "<td>&middot <a href='pReport.php?action=modifyReport&prID={$row['prID']}'> <img src='images/modify.png' title='Modify/Respond to a Case' /></a>&middot <br/>&middot<a href='pReport.php?action=deleteReport&prID={$row['prID']}'> <img src='images/delete.png' title='Delete a Case' /></a> &middot</td></tr>"; } echo "</table></center>"; } else { echo '<br/>'; echo 'Know of a player breaking the rules? Report them here, all reports are kept anonymous if requested.<br/>'; echo '<br/> &middot <a href="pReport.php?action=newReport"> <img src="images/add.png" title="Report a Player"/></a> &middot'; } } function newReport() { echo '<title>Create Report</title>'; echo '<h3>Report a Player</h3>'; echo '<a href="preport.php">Back</a><br/>'; echo 'Report any players who have been offensive, racist, or have scammed you.<br/>'; echo 'Remember, reporting a player is not a joke. If you are found filing a false report, you <b>will</b> be banned!<br/>'; echo '<br/>'; echo "<form action='pReport.php?action=newReportGo' method='post'> <input type='text' name='prName' value='Case Name'><br/> <input type='text' name='prReporter' value='Reporter'><br/> <input type='text' name='prOffender' value='Offender'><br/> <textarea rows='8' cols='35' name='prDesc'> Case Description, so what exactly happened, when, specific date if possible to help the us speed up the process. Any other information if possible.</textarea> <br/>Case Urgency: <select name='prUrgency'> <option value='0' selected>Low</option> <option value='1'>Medium</option> <option value='2'>High</option> <option value='3'>Urgent</option> </select> <br/><input type='submit' value='Submit Report'> </form>"; } function newReportGo() { echo '<title>Create Report</title>'; global $db, $caseStatusColours, $caseUrgencyColours; if (empty($_POST['prName']) || empty($_POST['prReporter']) || empty($_POST['prOffender']) || empty($_POST['prDesc']) || empty($_POST['prUrgency']) ) { echo '<br/>One or more of the required fields are empty please go back and try again.'; $h->endpage(); exit(); } if (!array_key_exists($_POST['prStatus'], $caseStatusColours) || (!array_key_exists($_POST['prUrgency'], $caseUrgencyColours))) { echo "That value doesn't exist!"; $h->endpage(); exit(); } $prName = $db->escape(htmlentities($_POST['prName'])); $prReporter = $db->escape(htmlentities($_POST['prReporter'])); $prOffender = $db->escape(htmlentities($_POST['prOffender'])); $prDesc = $db->escape(htmlentities($_POST['prDesc'])); $prUrgency = $_POST['prUrgency']; $db->query("INSERT INTO `preports` (prName, prReporter, prOffender, prDesc, prUrgency) VALUES ('$prName', '$prReporter', '$prOffender', '$prDesc', '$prUrgency')"); if (!$db) { echo "Query Error: Line 196."; $h->endpage(); exit(); } else { echo 'Report processed, please be patient while we look in to it.<br/>'; echo '<a href="index.php">Home</a>'; } } function modifyReport() { global $ir; if ($ir['user_level'] !=2) { echo '<br/>Restricted area, please go back.<br/>'; echo '<a href="index.php">Back</a>'; $h->endpage(); exit(); } echo '<h3>Modify/Respond to a case</h3>'; echo '<a href="pReport.php">Back</a><br/>'; echo '<h4>Respond to a case</h4>'; echo '<form action="pReport.php?action=respondReportDo" method="post"> <input type="num" name="prID" value="ID of case you want to modify"><br/> <input type="text" name="prStaffOverSeeingCase" value="Staff Over Seeing Case"><br/> Case Urgency: <select name="prUrgency"> <option value="0" selected>Low</option> <option value="1">Medium</option> <option value="2">High</option> <option value="3">Urgent</option> </select> <br/><input name="Respond" type="submit" value="Respond to case"> </form>'; echo '<h4>Modify a case</h4>'; echo "<form action='pReport.php?action=modifyReportDo' method='post'> <input type='num' name='prID' value='ID of case you want to modify'><br/> <input type='text' name='prStaffOverSeeingCase' value='Staff Over Seeing Case'><br/> Case Status: <select name='prStatus'> <option value='0' selected>Queued</option> <option value='1'>Pending</option> <option value='2'>Closed</option> <option value='3'>Case Dismissed</option> </select> <br/> Case Urgency: <select name='prUrgency'> <option value='0' selected>Low</option> <option value='1'>Medium</option> <option value='2'>High</option> <option value='3'>Urgent</option> </select> <br/><input type='submit' value='Edit a case'> </form>"; } function respondReportDo() { echo '<title>Respond to Report</title>'; global $db, $ir, $caseUrgencyColours; if ($ir['user_level'] !=2) { echo '<br/>Restricted area, please go back.<br/>'; echo '<a href="index.php">Back</a>'; $h->endpage(); exit(); } if (!isset($_POST['prID']) || !isset($_POST['prStaffOverSeeingCase']) || (empty($_POST['prID']) || empty($_POST['prStaffOverSeeingCase']))) { echo '<br/>One or more of the required fields are empty please go back and try again.'; $h->endpage(); exit(); } if (!ctype_digit($_POST['prID'])) { echo '<br/>prID refers to a numerical value correspoding to the case ID, please go back and try again.'; $h->endpage(); exit(); } if (!array_key_exists($_POST['prUrgency'], $caseUrgencyColours)) { echo "That value doesn't exist!"; $h->endpage(); exit(); } $prID = abs(intval($_POST['prID'])); $prStaffOverSeeingCase = $db->escape(htmlentities($_POST['prStaffOverSeeingCase'])); $prUrgency = abs(intval($_POST['prUrgency'])); echo '<h3>Respond to a Report</h3>'; echo '<a href="pReport.php">Back</a><br/>'; echo '<br/>'; $db->query("UPDATE `preports` SET prStaffOverSeeingCase='{$prStaffOverSeeingCase}', prUrgency='{$prUrgency}' WHERE prID='{$prID}'"); if (!$db) { echo "Query Error: Line 301."; $h->endpage(); exit(); } else { echo 'Successfully responded to case..<br/>'; echo '<a href="pReport.php">Back</a>'; } } function modifyReportDo() { echo '<title>Modify Report</title>'; global $db, $ir, $caseStatusColours, $caseUrgencyColours; if ($ir['user_level'] !=2) { echo '<br/>Restricted area, please go back.<br/>'; echo '<a href="index.php">Back</a>'; $h->endpage(); exit(); } if (!isset($_POST['prID']) || !isset($_POST['prStaffOverSeeingCase']) || (empty($_POST['prID']) || empty($_POST['prStaffOverSeeingCase']))) { echo '<br/>One or more of the required fields are empty please go back and try again.'; $h->endpage(); exit(); } if (!ctype_digit($_POST['prID'])) { echo '<br/>prID refers to a numerical value correspoding to the case ID, please go back and try again.'; $h->endpage(); exit(); } if (!array_key_exists($_POST['prStatus'], $caseStatusColours) || (!array_key_exists($_POST['prUrgency'], $caseUrgencyColours))) { echo "That value doesn't exist!"; $h->endpage(); exit(); } $prID = abs(intval($_POST['prID'])); $prStaffOverSeeingCase = $db->escape(htmlentities($_POST['prStaffOverSeeingCase'])); $prStatus = abs(intval($_POST['prStatus'])); $prUrgency = abs(intval($_POST['prUrgency'])); echo '<h3>Modify a Report</h3>'; echo '<a href="pReport.php">Back</a><br/>'; echo '<br/>'; $db->query("UPDATE `preports` SET prStaffOverSeeingCase='{$prStaffOverSeeingCase}', prStatus='{$prStatus}', prUrgency='{$prUrgency}' WHERE prID='{$prID}'"); if (!$db) { echo "Query Error: Line 359."; $h->endpage(); exit(); } else { echo 'Case modified.<br/>'; echo '<a href="pReport.php">Back</a>'; } } function deleteReport() { echo '<title>Delete Report</title>'; global $db, $ir, $caseStatusColours, $caseUrgencyColours; if ($ir['user_level'] !=2) { echo '<br/>Restricted area, please go back.<br/>'; echo '<a href="index.php">Back</a>'; $h->endpage(); exit(); } echo '<h3>Delete a report</h3>'; echo '<a href="pReport.php">Back</a><br/>'; echo '<br/>'; $_GET['prID'] = abs((int) $_GET['prID']); $prID = ($db->query("SELECT * FROM `preports` WHERE prID={$_GET['prID']}")); echo "Are you sure you want to <b>delete</b> this case? Remember once it's gone you can't get it back."; echo '<center><table border="1">'; echo '<tr>'; echo '<th><br/>Basic Task Info</th>'; echo '<th><br/>Other Details</th>'; echo '<th><br/>Misc</th>'; echo '<th><br/>Actions</th>'; while ($row = $db->fetch_row($prID)) { // Print out the contents of each row into a table. echo "<tr><td>"; echo '<b>Case ID:</b> ', htmlentities($row['prID']), '<br/>', ' <b>Case Name:</b> ', htmlentities($row['prName']), '<br/>', ' <b>Date/Time Reported:</b> ', htmlentities(date('d/m/y g:i A',strtotime($row['prDateTime']))), '<br/>', '<b>Case Desc:</b> ', htmlentities($row['prDesc']); echo "</td><td>"; echo '<b>Staff Over Seeing Case:</b> ', htmlentities($row['prStaffOverSeeingCase']), '<br/>', '<b>Reporter:</b> ', htmlentities($row['prReporter']), '<br/>', '<b>Offender:</b> ', htmlentities($row['prOffender']); echo "</td>"; echo '<td> <b>Case Status:</b> ', $caseStatusColours[$row['prStatus']], '<br/>', '<b>Case Urgency:</b> ', $caseUrgencyColours[$row['prUrgency']], '<br/></td>'; echo "<td><br/>&middot <a href='pReport.php?action=deleteReportDo&prID={$row['prID']}'>Yes</a> &middot <br/> &middot <a href='pReport.php'>No</a> &middot</td></tr>"; } echo "</table></center>"; } function deleteReportDo() { echo '<title>Delete Report</title>'; global $db, $ir; if ($ir['user_level'] !=2) { echo '<br/>Restricted area, please go back.<br/>'; echo '<a href="index.php">Back</a>'; $h->endpage(); exit(); } $_GET['prID'] = abs((int) $_GET['prID']); $prID = $db->fetch_row($db->query("SELECT * FROM `preports` WHERE prID={$_GET['prID']}")); $db->query("DELETE FROM `preports` WHERE prID={$_GET['prID']} "); if (!$db) { exit('Query Error: Line 434.'); $h->endpage(); } else { echo 'Case deleted.'; echo '<br/><a href="pReport.php">Home</a>'; } } function casesArchive() { global $db, $ir, $caseStatusColours, $caseUrgencyColours; if ($ir['user_level'] !=2) { echo '<br/>Restricted area, please go back.<br/>'; echo '<a href="index.php">Back</a>'; $h->endpage(); exit(); } echo '<h3>Case Archive</h3>'; echo '<a href="pReport.php">Back</a><br/>'; $showArchivedCases = $db->query("SELECT * FROM `preports` WHERE prStatus='3' OR prStatus='2' ORDER BY prStatus ASC"); echo '<br/>'; echo '<br/>'; echo '<center><table border="1">'; echo '<tr>'; echo '<th><br/>Basic Task Info</th>'; echo '<th><br/>Other Details</th>'; echo '<th><br/>Misc</th>'; while ($row = $db->fetch_row($showArchivedCases)) { // Print out the contents of each row into a table. echo "<tr><td>"; echo '<b>Case ID:</b> ', htmlentities($row['prID']), '<br/>', ' <b>Case Name:</b> ', htmlentities($row['prName']), '<br/>', ' <b>Date/Time Reported:</b> ', htmlentities(date('d/m/y g:i A',strtotime($row['prDateTime']))), '<br/>', '<b>Case Desc:</b> ', htmlentities($row['prDesc']); echo "</td><td>"; echo '<b>Staff Over Seeing Case:</b> ', htmlentities($row['prStaffOverSeeingCase']), '<br/>', '<b>Reporter:</b> ', htmlentities($row['prReporter']), '<br/>', '<b>Offender:</b> ', htmlentities($row['prOffender']); echo "</td>"; echo '<td> <b>Case Status:</b> ', $caseStatusColours[$row['prStatus']], '<br/>', '<b>Case Urgency:</b> ', $caseUrgencyColours[$row['prUrgency']], '<br/></td></td>'; } echo "</table></center>"; } function searchFilter() { echo '<title>Search Filter</title>'; global $ir; if ($ir['user_level'] !=2) { echo '<br/>Restricted area, please go back.<br/>'; echo '<a href="index.php">Back</a>'; $h->endpage(); exit(); } echo '<h3>Search Filter</h3>'; echo '<a href="pReport.php">Back</a><br/>'; echo "<br/><form action='pReport.php?action=searchFilterGo' method='post'> <input name='prID' maxlength='3' value='ID of the case'> <br/>Case Status: <select name='prStatus'> <option value='0' selected>Queued</option> <option value='1'>Pending</option> <option value='2'>Closed</option> <option value='3'>Case Dismissed</option> </select> <br/> Case Urgency: <select name='prUrgency'> <option value='0' selected>Low</option> <option value='1'>Medium</option> <option value='2'>High</option> <option value='3'>Urgent</option> </select> <br/><input type='submit' value='Filter'> </form>"; } function searchFilterGo() { global $db, $ir, $caseStatusColours, $caseUrgencyColours; echo '<title>Search Filter</title>'; if ($ir['user_level'] !=2) { echo '<br/>Restricted area, please go back.<br/>'; echo '<a href="index.php">Back</a>'; $h->endpage(); exit(); } echo '<h3>Search Filter</h3>'; echo '<a href="pReport.php?action=searchFilter">Back</a><br/>'; if (!ctype_digit($_POST['prID'])) { echo 'prID refers to a numerical value correspoding to the case ID, please go back and try again.'; $h->endpage(); exit(); } if (!array_key_exists($_POST['prStatus'], $caseStatusColours) || (!array_key_exists($_POST['prUrgency'], $caseUrgencyColours))) { echo "That value doesn't exist!"; $h->endpage(); exit(); } $prID = abs(intval(intval($_POST['prID']))); $prStatus = abs(intval(intval($_POST['prStatus']))); $prUrgency = abs(intval(intval($_POST['prUrgency']))); $showFilteredCases = $db->query("SELECT * FROM `preports` WHERE prID='{$prID}' OR prStatus='{$prStatus}' OR prUrgency='{$prUrgency}'"); echo '<br/>'; echo '<br/>'; echo '<center><table border="1">'; echo '<tr>'; echo '<th><br/>Basic Task Info</th>'; echo '<th><br/>Other Details</th>'; echo '<th><br/>Misc</th>'; while ($row = $db->fetch_row($showFilteredCases)) { // Print out the contents of each row into a table. echo "<tr><td>"; echo '<b>Case ID:</b> ', htmlentities($row['prID']), '<br/>', ' <b>Case Name:</b> ', htmlentities($row['prName']), '<br/>', ' <b>Date/Time Reported:</b> ', htmlentities(date('d/m/y g:i A',strtotime($row['prDateTime']))), '<br/>', '<b>Case Desc:</b> ', htmlentities($row['prDesc']); echo "</td><td>"; echo '<b>Staff Over Seeing Case:</b> ', htmlentities($row['prStaffOverSeeingCase']), '<br/>', '<b>Reporter:</b> ', htmlentities($row['prReporter']), '<br/>', '<b>Offender:</b> ', htmlentities($row['prOffender']); echo "</td>"; echo '<td> <b>Case Status:</b> ', $caseStatusColours[$row['prStatus']], '<br/>', '<b>Case Urgency:</b> ', $caseUrgencyColours[$row['prUrgency']], '<br/></td></td>'; } echo "</table></center>"; } $h->endpage(); ?> SQL's CREATE TABLE `pReports` ( prID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, prName VarChar(225), prDesc VarChar(225), prReporter VarChar(50), prOffender VarChar(50), prStaffOverSeeingCase VarChar(50) DEFAULT 'Not chosen yet', prDateTime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, prUrgency INT DEFAULT '0', prStatus INT DEFAULT '0' ); I have a ZIP version of all this with installation help included, just can't seem to find a way to upload it. Also give me your opinions on it, and if you would like to see more mods for the future and if so, what sort of mods?
  20. Ian, looking top mate, keep it up :)
  21. Thanks mate. :)
  22. This mod was created a while back, but I wasn't able to upload it as I lost all my coding things when my laptop got messed up. However I did find a backup, so here it is. It is a back for Crystals or whatever you're game has named them, hence the name secondary bank. All feedback welcome. :) seBank.php <?php include 'globals.php'; /* Designed and developed by Script47. Edited by Peterisgb & Re-recoded by Magictallguy. The code here (named "seBank") is provided "as is" with no warranty or gurantee of safety to existing code. seBank has been fully tested and is found to work as intended. seBank is released freely under the GNU License. Feel free to modify as you wish, as long as this comment block remains untouched. */ $bankprice = 10000; $currencyname = $set['crystalname']; // Change to set your crystal's name. echo "<h3>",$currencyname," Bank</h3>"; if($ir['bankcrystals'] > -1) { switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['money'] > 9999) { $db->query("UPDATE `users` SET `money` = `money` - ".$bankprice.", `bankcrystals` = 0 WHERE `userid` = ".$userid); ?>Congratulations, you bought a <? echo $currencyname; ?> bank for <? echo money_formatter($bankprice); ?>!<br /><a href="sebank.php">Start using your account</a><br /><? } else { ?>Sorry, you don't have enough <? echo $set['moneyname']; ?> to open a account.<br /><a href='explore.php'>Back to town?</a><br /><? } } else { ?>Open a bank account today, just <? echo money_formatter($bankprice); ?>!<br /><a href='sebank.php?buy'>> Yes, sign me up!</a><? } } function index() { global $ir, $currencyname; ?><strong>You currently have <? echo number_format($ir['bankcrystals']).' '.$currencyname; ?> in the bank.</strong><br /> <table width='75%' cellspacing='1' class='table'> <tr> <td width='50%'><strong>Deposit <? echo $currencyname; ?></strong><br /> <form action='sebank.php?action=deposit' method='post'> Amount: <input type='text' name='deposit' value='<? echo number_format($ir['crystals']); ?>' /><br /> <input type='submit' value='Deposit' /> </form></td> <td><strong>Withdraw <? echo $currencyname; ?></strong><br /> <form action='sebank.php?action=withdraw' method='post'> Amount: <input type='text' name='withdraw' value='<? echo number_format($ir['bankcrystals']); ?>' /><br /> <input type='submit' value='Withdraw' /> </form></td> </tr> </table><? } function deposit() { global $db, $ir, $h, $currencyname; $_POST['deposit'] = isset($_POST['deposit']) && is_string($_POST['deposit']) ? abs(@intval(str_replace(',', '', $_POST['deposit']))) : null; if(empty($_POST['deposit'])) { echo "You didn't enter a valid amount to deposit"; $h->endpage(); exit; } if($_POST['deposit'] > $ir['crystals']) { echo "You do not have enough ",$currencyname," to deposit this amount."; $h->endpage(); exit; } $db->query("UPDATE `users` SET `bankcrystals` = `bankcrystals` + ".$_POST['deposit'].", `crystals` = `crystals` - ".$_POST['deposit']." WHERE `userid` = ".$ir['userid']); echo "You hand over ",number_format($_POST['deposit'])," ",$currencyname," to be deposited. <br /><a href='sebank.php'>> Back</a>"; } function withdraw() { global $db, $ir, $h, $currencyname; $_POST['withdraw'] = isset($_POST['withdraw']) && is_string($_POST['withdraw']) ? abs(@intval(str_replace(',', '', $_POST['withdraw']))) : null; if(empty($_POST['withdraw'])) { echo "You didn't enter a valid amount to withdraw"; $h->endpage(); exit; } if($_POST['withdraw'] > $ir['bankcrystals']) { echo "You do not have enough ",$currencyname," in the bank to withdraw this amount."; $h->endpage(); exit; } $db->query("UPDATE `users` SET `bankcrystals` = `bankcrystals` - ".$_POST['withdraw'].", `crystals` = `crystals` + ".$_POST['withdraw']." WHERE `userid` = ".$ir['userid']); echo "You ask to withdraw ",number_format($_POST['withdraw']),", <br />the banker hands it over. <br /><strong>You now have ",number_format($ir['bankcrystals'] - $_POST['withdraw'])," ",$currencyname," in the bank.</strong><br /><a href='sebank.php'>> Back</a>"; } $h->endpage(); ?> SQL: ALTER TABLE users ADD COLUMN bankcrystals INT NOT NULL DEFAULT '-1';
  23. Might give it a shot. :)
  24. Spelling mistake, just saying: "Guess wromg amd you loose!" - Line 25
  25. Exactly, I thought that too, more of an engine than anything else, however it looks very neat and cool.
×
×
  • Create New...