Jump to content
MakeWebGames

Uridium

Members
  • Posts

    2,657
  • Joined

  • Last visited

  • Days Won

    74

Everything posted by Uridium

  1. Above shows how to add a course Above shows accepted addition Above shows Editing a Course And finally the Succes message... All Courses can be deleted but make sure users are not taking that course at the time... USERS VIEW List of Available course When user starts their course And the final outcome after the completion.
  2. Call this file staff_courses.php When adding a new course make sure no values are less than 0 for some reason it goofs so ive had to add a new line of SQL   <?php // illusions 2011 include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains course stuffs switch($_GET['action']) { case "addcourse": addcourse(); break; case "addcourseaccept": accept_course(); break; case "editcourse": editcourse(); break; case "delcourse": delcourse(); break; default: print "Error: This script requires an action."; break; } function addcourse() { global $db, $ir, $c, $h, $userid; print "<h3>Add Course</h3><hr /> <form action='staff_courses.php?action=addcourseaccept' method='post'> <table border='1' width='100%' class='table' cellspacing='3' cellpadding='4'> <tr> <th>Course Name: <input type='text' name='name' /> </th> <th>Course Description: <input type='text' name='desc' /> </th> <th>Starting Text: <input type='text' name='starting' /> </th> <th>Completed Text: <input type='text' name='completed' /> </th> <th>Course Target Percent: <input type='text' name='comppercent' /> </th></tr> <th>Percent Gain: <input type='text' name='percent' /> Example 1 to 99999 </th> <th>Clicks Per Day: <input type='text' name='clicks' /> Example 18 </th> <th>Clicks Per Session: <input type='text' name='perclicks' /> Example 3 Per Session </th> <th>Cost (Money): <input type='text' name='cost' /> </th> <th>Cash Prize: <input type='text' name='cashprize' /> </th></tr> <th>Item Prize: ".item_dropdown($c,'item')." </th> <th>Item Name: <input type='text' name='itemname' /> </th> <th>Item Qty: <input type='text' name='qty' /> </th> <th>Crystals Prize: <input type='text' name='crystals' /> </th> <th>Cost (Energy): <input type='text' name='energy' /> </th></tr> <th>Strength Gain: <input type='text' name='str' value='0.0000'/> </th> <th>Agility Gain: <input type='text' name='agil' value='0.0000'/> </th> <th>Guard Gain: <input type='text' name='gua' value='0.0000'/> </th> <th>Labour Gain: <input type='text' name='lab' value='0.0000'/> </th> <th>IQ Gain: <input type='text' name='iq' value='0.000000'/> </th></tr> <th><center><input type='submit' value='Add Course' /></center></form></tr></table> [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; } function accept_course() { global $db,$ir,$c,$userid; if($ir['user_level'] != 2) { die("403"); } $cost=abs((int) $_POST['cost']); $energy=abs((int) $_POST['energy']); $comppercent=abs((int) $_POST['comppercent']); $percent=abs((int) $_POST['percent']); $clicks=abs((int) $_POST['clicks']); $perclicks=abs((int) $_POST['perclicks']); $cashprize=abs((int) $_POST['cashprize']); $crystals=abs((int) $_POST['crystals']); $item=abs((int) $_POST['item']); $qty=abs((int) $_POST['qty']); $str=abs((float) $_POST['str']); $agil=abs((float) $_POST['agil']); $gua=abs((float) $_POST['gua']); $lab=abs((float) $_POST['lab']); $iq=abs((float) $_POST['iq']); $name=$_POST['name']; if($_POST['name'] && $_POST['desc'] && $cost && $cashprize && $item && $qty) { $db->query("INSERT INTO schools VALUES(NULL, '{$_POST['name']}', '{$_POST['desc']}', '{$_POST['starting']}', '{$_POST['completed']}', '$cost', '$energy', '$cashprize', '$crystals', '$item', '{$_POST['itemname']}', '$qty', '$comppercent', '$percent', '$clicks', '$perclicks', '$str', '$gua', '$lab', '$agil', '$iq')"); print "Course {$_POST['name']} added. [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url] [url='staff_courses.php?action=addcourse'][ ADD ANOTHER COURSE ][/url]"; stafflog_add("Added course {$_POST['name']}"); } } function editcourse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $cost=abs((int) $_POST['cost']); $energy=abs((int) $_POST['energy']); $comppercent=abs((int) $_POST['comppercent']); $percent=abs((int) $_POST['percent']); $clicks=abs((int) $_POST['clicks']); $perclicks=abs((int) $_POST['perclicks']); $cashprize=abs((int) $_POST['cashprize']); $item=abs((int) $_POST['item']); $qty=abs((int) $_POST['qty']); $str=abs((float) $_POST['str']); $agil=abs((float) $_POST['agil']); $gua=abs((float) $_POST['gua']); $lab=abs((float) $_POST['lab']); $iq=abs((float) $_POST['iq']); $name=$_POST['name']; $db->query("UPDATE schools SET crNAME='$name', crDESC='{$_POST['desc']}', crSTARTING='{$_POST['starting']}', crCOMPLETED='{$_POST['completed']}', crCOST=$cost, crCASHPRIZE=$cashprize, crITEM=$item, crITEMNAME='{$_POST['itemname']}', crQTY=$qty, crENERGY=$energy, crCOMPPERCENT=$comppercent, crPERCENT=$percent, crCLICKS=$clicks, crPERCLICKS=$perclicks, crSTR=$str, crGUARD=$gua, crLABOUR=$lab, crAGIL=$agil, crIQ=$iq WHERE crID={$_POST['id']}"); print "<h1>Course $name was edited successfully.</h1> [url='staff_courses.php?action=addcourse'][ ADD ANOTHER COURSE ][/url] [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; stafflog_add("Edited course $name"); break; case "1": $q=$db->query("SELECT * FROM schools WHERE crID={$_POST['course']}"); $old=$db->fetch_row($q); print "<h3>Editing a Course</h3><hr /> <form action='staff_courses.php?action=editcourse' method='post'> <table border='1' width='100%' class='table' cellspacing='3' cellpadding='4'> <tr> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['course']}' /> <th>Name: <input type='text' name='name' value='{$old['crNAME']}' /> </th> <th>Description: <input type='text' name='desc' value='{$old['crDESC']}' /> </th> <th>Starting Text: <input type='text' name='starting' value='{$old['crSTARTING']}' /> </th> <th>Completed Text: <input type='text' name='completed' value='{$old['crCOMPLETED']}' /> </th> <th>Course Target(percent): <input type='text' name='comppercent' value='{$old['crCOMPPERCENT']}' /> </th></tr> <th>Percent Gain (percent): <input type='text' name='percent' value='{$old['crPERCENT']}' /> </th> <th>Clicks Per Day : <input type='text' name='clicks' value='{$old['crCLICKS']}' /> </th> <th>Clicks Per Session: <input type='text' name='perclicks' value='{$old['crPERCLICKS']}' /> </th> <th>Cost (Money): <input type='text' name='cost' value='{$old['crCOST']}' /> </th> <th>Cash Prize : <input type='text' name='cashprize' value='{$old['crCASHPRIZE']}' /> </th></tr> <th>Item Prize: ".item_dropdown($c,'item')." </th> <th>Item Name : <input type='text' name='itemname' value='{$old['crITEMNAME']}' /> </th> <th>Quantity : <input type='text' name='qty' value='{$old['crQTY']}' /> </th> <th>Cost (Energy): <input type='text' name='energy' value='{$old['crENERGY']}' /> </th> <th>Strength Gain: <input type='text' name='str' value='{$old['crSTR']}' /> </th></tr> <th>Agility Gain: <input type='text' name='agil' value='{$old['crAGIL']}' /> </th> <th>Guard Gain: <input type='text' name='gua' value='{$old['crGUARD']}' /> </th> <th>Labour Gain: <input type='text' name='lab' value='{$old['crLABOUR']}' /> </th> <th>IQ Gain: <input type='text' name='iq' value='{$old['crIQ']}' /> </th> <input type='submit' value='Edit Course' /></form></tr></table> [url='staff_courses.php?action=addcourse'][ ADD A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; break; default: print "<h3>Editing a Course</h3><hr /> <form action='staff_courses.php?action=editcourse' method='post'> <input type='hidden' name='step' value='1' /> Course: ".course_dropdown($c, "course")." <input type='submit' value='Edit Course' /></form>"; break; } } function delcourse() { global $db,$ir,$c,$h,$userid; if($_POST['course']) { $q=$db->query("SELECT * FROM schools WHERE crID={$_POST['course']}"); $old=$db->fetch_row($q); $db->query("UPDATE users SET course=0, cpercent=0 WHERE course={$_POST['course']}"); $db->query("DELETE FROM schools WHERE crID={$_POST['course']}"); print "Course {$old['crNAME']} deleted. <h1>Course $name was Removed from Game successfully.</h1> [url='staff_courses.php?action=addcourse'][ ADD ANOTHER COURSE ][/url] [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; stafflog_add("Deleted course {$old['crNAME']}"); } else { print "<h3>Deleting a Course</h3><hr /> [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url] <form action='staff_courses.php?action=delcourse' method='post'> Course: ".course_dropdown($c, "course")." <input type='submit' value='Delete Course' /></form> [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=addcourse'][ ADD A COURSE ][/url]"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_users.php?action=reportsview']> Back[/url]"; } $h->endpage(); ?>
  3. Im still digging i havent forgotten :) Couldnt find it so ive had to reinstall MCC on my pc and edit the files to make them work... Will repost working copy...
  4. Let me dig up my copies i may have altered this and never updated it......
  5. Wow im surprised people are still using this mod :)
  6. How comes Paul gets an online Guard Dog I want one but with sharper teeth ;)
  7. Tested your script on my localhost and the bars were fine for me...
  8. Uridium

    teach

    Look at the scripts that you already have it will give you a better starting guide than looking at other scripts made by other people
  9. I personally think a better installation script would be an idea the current v2 doesnt offer a great deal to the first time setup
  10. with just scouring your code all i can see is that this may be the issue #container { width: 800px; margin: auto; border: 2px solid #000000; background-color: #999999; clear: both; overflow: hidden; margin-bottom: 10px; } #menu { width: 800px; height: 17px; background-color: #333333; border-bottom: 2px solid #000000; border-top: 2px solid #000000; margin-bottom: 10px; padding-top: 3px; text-align: center; } #side { width: 200px; margin-left: 15px; margin-bottom: 15px; float: left; } dont quote me though im not great with CSS but id start there
  11. Sorry wasnt aware it was a 180 day wait i was on the assumption it was 5- 7 days sorry about that.
  12. The moral to this story is dont include a download link until Paypal has completed the Transaction if a Genuine user is truly genuine they will wait for payment to go ahead and be credited a download link there after...
  13. I remember this program the guy was a jester or what ever he was dressed up as was a kids tv started at about 3:30pm just after school
  14. Gold showed the whole series a few months ago recorded the lot :)
  15. In a nutshell EXCELLENT! takes time to create something on this scale i know from past experience Excellent idea havent used the script but just looking at this lots of ideas which can be added to this script to make it one of a kind. Im all for new ideas for a script and this one is the beez knees Weldone to all :)
  16. dauninge I've spoken to my fat tall friend and we both think your echoing the entire section...
  17. There are a lot of factors to think about when using things like paypal Paypal isnt instant. Just because someone has purchased a DP from your game doesnt mean the transaction was successful a number of things can happen it usually takes paypal 3 - 4 days to ensure full payment from theirs to your account and inbetween it gives the Payee the option to opt out of the Transaction which leaves you with nothing.
  18. If you spent more time on this script you could add some nice features like a Lotto History button to show which ticket was draw and also adding 5 runner up prizes
  19. Have they disabled ALL crons or just 1 5 and 10 min ones
  20. Whats with the annoying Lagg on MWG, before i could deal with it but since youve changed hoest some pages take over 2 minutes to load...
  21. I re-coded mcc lit i was about to send it to dabs but unfortunatley just as i was about to press send my dog ate the folder and im sorry to say it was my one and only copy. Mind you i think it must have had bugs anyway cos my dog hasnt stopped Crapping since its eaten it ;) Im wondering if it might be a sessions error ;)
  22. Bah humbug to your comments. I kinda like it you dont see many kid themed layouts (infact i think this is the first) Stick with it coly i think you may be the first to have created something unique for a mcc styled game layout.. Weldone from me and i mean that without any mock response...
  23. Acter why are you creating so many threads for the same principal ? just stick to one it gets confusing..
  24. This part put me off instantly even viewing your site if your willing to make someone a MOD when you dont even know their background your game is doomed before it starts... but on a lighter note: start with the cheapest hosting as your not always guaranteed to get the members you hope for the SILVER package looks decent but make sure you ask your host if they will give you 1 min and 5 min crons with the package if not youd need to go elsewhere
×
×
  • Create New...