Jump to content
MakeWebGames

Stock Market


Raven1992

Recommended Posts

Hi i used Hanted Dawg thread to get the stock market and everything works well but when i head to the staff pannel and click add stock i get this

Need an action dude.. I need a freaking action, do you want me to die here!

now where do i get rid of that i added what i need to my staff pannel i just need to get rid of this message and start adding stock

Link to comment
Share on other sites

Not being sarcastic or anything but if you use netbeans click the file in project manager ctrl+f then search for that phrase. As I have never used the mod that is how I would find it.

Link to comment
Share on other sites

Not being sarcastic or anything but if you use netbeans click the file in project manager ctrl+f then search for that phrase. As I have never used the mod that is how I would find it.

i not useing netbeans though and all i want to do is remove that message i looked at the file it self here it is but i dunno what to get rid of it

<?php
/* Start Copy Right Notice! */
/*
   # You do not re-distribute my files.
   # You do not claim this as your work.
   # You do not ask for money to other people for my work.
   # This is free not paid.
   # Leaving the copyright is a must (i know alot of you will just take it down :/)
   # All the work under this file is by written consent kyle mulder's and shall be in tact at all times!
   # A description of this file is bellow:

   This is a stock market, a working one, a non buggy one, a non exploitable one, a better one, more feature.
   Users can buy stocks and every 5 minutes the stock rate will change (like real life).
   Gives the users something to do.
   The stocks can crash every 5 minutes making everyone loose there investment and there cash.
   There will be a .15% that a stock can crash, more likely to happen quite often, but not all the time.
   If there is a possibility that a stock can crash every 5 minute's. That makes it:
       # 5 minutes => 1 Crash
       # 1 Hour    => 12 Crashes
       # 1 Day     => 288 Crashes
   The above is possibilites, does not mean it WILL always happen.

   Anyways lets get on with the file <img src="images/smilies/smile.png" border="0" alt="" title="Smile" class="inlineimg" />
*/
/* End Copy Right Notice! */
include_once('sglobals.php');

echo '<h2>Stock Panel</h2>';

$x = (isset($_GET['action']) && ctype_alnum($_GET['action'])) ? trim($_GET['action']) : FALSE;
switch($x)  {
   default: echo 'Need an action dude.. I need a freaking action, do you want me to die here!'; break;
   case 'add': add_stock(); break;
   case 'del': delete_stock(); break;
   case 'edit': edit_stocks(); break;
   case 'editn': edit_stock(); break;
}
function edit_stocks()  {
   global $ir,$db;
   echo 'Edit a stock bellow.


   <form action="?action=editn" method="post">';
       $stock = $db->query("SELECT stockNAME,stockID FROM `stock_stocks`") or die(mysql_error());
       while($soc = $db->fetch_row($stock)) {
           echo '<input type="radio" value="'.$soc['stockID'].'" name="ID" /> '.$soc['stockNAME'].'
';
       }   echo '

<input type="submit" value="Edit Stock" />
   </form>';
}
function edit_stock()   {
   global $ir,$db;
   $ID = abs((int) $_REQUEST['ID']);
   $stre = $db->query("SELECT stockID,stockNAME,stockOPRICE,stockNPRICE FROM `stock_stocks` WHERE `stockID` = ".$ID) or die(mysql_error());
   if($db->num_rows($stre) == 0)  {
       echo 'Invalid Stock!';
       return;
   }
   if(isset($_POST['name']))   {
       $name = $db->escape($_POST['name']);
       $nprice = abs((int) $_POST['nprice']);
       $oprice = abs((int) $_POST['oprice']);
       $db->query("UPDATE `stock_stocks` SET `stockNAME` = '".$name."',`stockOPRICE` = ".$oprice.", `stockNPRICE` = ".$nprice." WHERE `stockID` = ".$ID) or die(mysql_error());
       echo 'Stock edited successfuly';
   }
   else    {
       $row = $db->fetch_row($stre);
       echo 'Editing stock '.$row['stockNAME'].'

       <form action="?action=editn&ID='.$ID.'" method="post">
           Stock Name: <input type="text" name="name" value="'.$row['stockNAME'].'" />

           Stock Orig Price: <input type="text" name="oprice" value="'.$row['stockOPRICE'].'" />

           Stock Now Price: <input type="text" name="nprice" value="'.$row['stockNPRICE'].'" />

           <input type="submit" value="Edit Stock" />
       </form>';
   }
}
function add_stock()    {
   global $ir,$db;
   if(isset($_POST['name']))   {
       $name = $db->escape($_POST['name']);
       $orgp = abs((int) $_POST['origp']);
       $db->query("INSERT INTO `stock_stocks` (`stockNAME`,`stockOPRICE`,`stockNPRICE`) VALUES ('".$name."',".$orgp.",".$orgp.")") or die(mysql_error());
       echo 'Stock Created!';
   }
   else    {
       echo '
       Add a stock bellow.


       <form action="?action=add" method="post">
           Name: <input type="text" name="name" />

           Original Price: <input type="text" name="origp" value="2000" />

           <input type="submit" value="Add Stock" />
       </form>';
   }
}
function delete_stock() {
   global $ir,$db;
   if(isset($_POST['del']))    {
       $id = abs((int) $_POST['stock']);
       $db->query("DELETE FROM `stock_stocks` WHERE `stockID` = ".$id) or die(mysql_error());
       $db->query("DELETE FROM `stock_holdings` WHERE `holdingSTOCK` = ".$id) or die(mysql_error());
       echo 'Stock Deleted.';
   }
   else    {
       echo 'Delete a stock bellow.


       <form action="?action=del" method="post">';
       $stock = $db->query("SELECT stockNAME,stockID FROM `stock_stocks`") or die(mysql_error());
       while($soc = $db->fetch_row($stock)) {
           echo '<input type="radio" value="'.$soc['stockID'].'" name="stock" /> '.$soc['stockNAME'].'
';
       }   echo '

<input type="submit" value="Delete Stock" name="del" />
       </form>';
   }
}

?>
Link to comment
Share on other sites

try using this link :

staff_stocks.php?action=add but change staff_stocks to the actual file name

hate to disserpoint u that is the actual file name for it staff_stocks.php

- - - Updated - - -

 

I don't want to sound like a complete douche but how did you create a mod for sale here?

http://mccodes.com/viewmod.php?id=72

i didn't my friend used it he said it makes more money for something

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...