Revcems Staff App

Status
Not open for further replies.

antiny2010

Member
Nov 27, 2014
171
6
Hi Guys
Trying to fix up a staffapp page I have its in uber but cant seem to do it for revcms anyone able to help me?

PHP:
<div class="habblet-container" style="position: relative; left: 0px; top: 0px; width: 83%;"

<div class="habblet-container ">
<div class="cbb clearfix pixellightblue ">

<h2 class="title">%shortname% Trial Apps</h2>
<div class="box-content">


<center><b><h2>%shortname% Hotel Moderator</b></h2>
</center>
<div style="text-align: right;">
</div>
<br />
%shortname% Hotel is run by highly trained staff, and we're always hiring staff so that the hotel is always safe and having fun! You may apply for staff below, but you need to fill in the information truthfuly, else your application will be denied! Also, please make sure you're at least <b>13</b> years of age before you apply for staff!<br /><br /><center>You must also meet the following requirements:</center>
<br />
<br />
<i>&bull; Able to moderate the hotel for at least 3 hours a day or 10 hours a week!</i><br>
<i>&bull; Advertise and host events frequently!</i><br>
<i>&bull; Have read the rules and understand them entirely!</i><br>
<i>&bull; Will advertise to help gain users!</i><br>
<i>&bull; Make sure your password is well protected!</i><br>
<i>&bull; Invite your friends and help people understand what %shortname% is!</i><br>

<p><center>Please only send in ONE application otherwise ALL Of your applications will automatically be deleted through the system</center></p>
<hr></hr>
<br />
<?php
$name = USER_NAME;
if(isset($_POST['apply'])) {$job_username = mysql_real_escape_string($_POST['username']);$job_email = mysql_real_escape_string($_POST['useremail']);$job_date = mysql_real_escape_string($_POST['date']);$job_month = mysql_real_escape_string($_POST['month']);$job_year = mysql_real_escape_string($_POST['year']);$job_why = mysql_real_escape_string($_POST['why']);$job_exp = mysql_real_escape_string($_POST['exp']);
$job_do = mysql_query("INSERT INTO jobapps (username, email, dob, why, exp) VALUES ('".$job_username."', '".$job_email."', '".$job_date/$job_month/$job_year."', '".$job_why."', '".$job_exp."')");
if($job_do) {
echo "<strong>Thank you very much for submitting your staff application, you'll be notified through email if you are considered!</strong>";
} else {
die(mysql_error());
}
}?>
<center><form method="post" action="">
<b>Your hotel username</b><br />
<input type="text" readonly value="<?php echo $name; ?>" name="username"><br />
<b>An active email address</b><br />
<input type="text" name="useremail"><br />
<b>Position your applying for</b><br />
<input type="text" disabled value="Trial Mod"><br />
<b>Real deate of birth <i>(Ex: 1/1/2000)</i></b><br />
<input type="text" style="width: 40px;" name="date" placeholder="Date" maxlength="2" />
<input type="text" style="width: 40px;" name="month" placeholder="Month" maxlength="2" />
<input type="text" style="width: 80px;" name="year" placeholder="Year" maxlength="4" /><br />
<b>Why would we choose you?</b><br />
<textarea style="width: 250px; margin-left: 15px;" name="why"></textarea><br />
<b>What experience have you had?</b><br />
<textarea style="width: 250px; margin-left: 15px;" name="exp"></textarea><br />
<input type="submit" name="apply" value="Submit">
</form>
</center>
</div>
</div>
</div>
</div>
 

Joe

Well-Known Member
Jun 10, 2012
4,090
1,918
Try this
Code:
        <div id="container">
            <div id="content" style="position: relative" class="clearfix">
                <div class="alert alert-success" style="margin-bottom: 6px;width:730px;">
<strong>Are you the one?</strong> {hotelname} is looking for new t-mod's be sure to apply!
</div>
<div id="column1" class="column">
<div class="habblet-container " style="float:left; width: 460px;">
<div class="cbb clearfix red ">
<h2 class="title"><span style="float: left;">Staff Applications</span></h2>
<div style="padding: 5px" align="left">

<?php
            $sql = mysql_query("SELECT user FROM apps WHERE user = '".$_SESSION['user']['username']."'");
                if(isset($_POST['submit']))
                {
                    if (empty($_POST['real']) || empty($_POST['location']) || empty($_POST['age']) || empty($_POST['why']) || empty($_POST['dif']) || empty($_POST['agree']))
                    {
                        echo '<div class="error_red">Please fill in all fields!</div><br/>';
                    }
                    else
                    {
                    if(mysql_num_rows($sql) < 1){
                        mysql_query("INSERT INTO `apps` (user,`real`,location,age,why,dif,additional,agree) VALUES ('".$_SESSION['user']['username']."', '".filter($_POST["real"])."', '".filter($_POST["location"])."', '".filter($_POST["age"])."', '".filter($_POST["why"])."', '".filter($_POST["dif"])."', '".filter($_POST["additional"])."', '".filter($_POST["agree"])."')") or die(mysql_error());
                        echo '<div class="error_green"><b>Thank you!</b> Your application has been submitted and is awaiting to be reviewed by staff!</div><br/>';
                    }else{
                        echo '<div class="error_red">You have already applied, please wait for a reply.</div><br />';
                        }
                    } 
                }
                ?>

<form method="post">                         
                          
                        <b>Username:</b><br />
                        <input disabled="disabled" value="{username}">
                                      
                        <br /><br />
                                          
                        <b>Real Name:</b><br />
                        <input type="text" name="real">
                        <br><br>
                                          
                        <b>Location: (country, city)</b><br />
                        <input type="text" name="location">
                        <br><br>
                                          
                        <b>Age:</b><br>
                        <select name="age">
                            <?php for ($i = 13; $i <= 100; $i++) : ?>
                                <option value="<?php echo $i; ?>"><?php echo $i; ?></option>
                            <?php endfor; ?>
                        </select>
                        <br><br>
                                          
                        <b>Why should we hire you?</b><br>
                        <textarea name="why" rows="4" cols="40"></textarea>
                        <br><br>
                                          
                        <b>Why are you different from the rest?</b><br>
                        <textarea name="dif" rows="4" cols="40"></textarea>
                        <br><br>
                                          
                        <b>Additional Information: (not required)</b><br>
                        <textarea name="additional" rows="4" cols="40"></textarea>
                        <br><br>
                                          
                        <input type="checkbox" value="1" name="agree"> I agree to be active on the hotel even before we select (if we) you as an Trial Moderator
                                          
                        <br><br>
                                          
                        <div style="float:right;padding: 5px;">
                        <input type="submit" value="Apply" name="submit"/>
                        </div>
                        <div style="float:left;"><a href="/me">Cancel</a></div>
                                  
                    </form>
                  
</div>
</div>
</div>
</div>
<div id="column2" class="column">
<div class="habblet-container " style="float:right; width: 310px;">
<div class="cbb clearfix settings  ">
<h2 class="title"><span style="float: left;">What is this?</span></h2>
<div style="padding: 5px" align="l">
<img src="/swfs/c_images/album1584/ADM90.gif" align="right">
Interested in applying for a staff position at {hotelName} Hotel? You will be required to be online for at least 3 hours per day and 6-7 days a week, unless you can provide a valid excuse. All staff applicants must be able to keep the community happy and also be mature, and also remember not to abuse their powers. Applicants must also be 13+ years.
</div>
</div>
</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
        </div>
    </div>
</div>
                          
    <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>     
          
        </div>
      
        <!--[if lt IE 7]>
            <script type="text/javascript">
                Pngfix.doPngImageFix();
            </script>
        <![endif]-->

    </div>
    </body>
</html>
Make this table
INSERT INTO `apps` (user,`real`,location,age,why,dif,additional,agree
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
Uber and RevCMs are completely different coding structure.
Not Fully True. The only difference is the backend, so fetching the user data and session data, the rest is the same. Uber supports db_query as a function in its backend while RevCMS only supports mysql_query (Which can be used in both).

Here is some code I use:
Code:
<div id="column1" class="column">
<div class="habblet-container " style="float:left; width: 460px;">
<div class="cbb clearfix red ">
<h2 class="title"><span style="float: left;">Staff Applications</span></h2>
<div style="padding: 5px" align="left">
 
 
<?php
    if(isset($_POST['sendApp'])){
        $sql = mysql_query("SELECT user FROM apps WHERE user = '".$_SESSION['user']['username']."' LIMIT 1");
        if(mysql_num_rows($sql) == 0){
            $user = $_SESSION['user']['username'];
          
            $userIP = $_SERVER['REMOTE_ADDR'];
            $locationDetails = json_decode(file_get_contents("http://ipinfo.io/{$userIP}/json"));
            $userLocation = $locationDetails->city . ', ' . $locationDetails->region;
          
            $real = mysql_real_escape_string($_POST['real']);
            $age = mysql_real_escape_string($_POST['age']);
            $dif = mysql_real_escape_string($_POST['dif']);
            $why = mysql_real_escape_string($_POST['why']);
            $additional = mysql_real_escape_string($_POST['additional']);
            $agree = mysql_real_escape_string($_POST['agree']);
          
            if (!empty($real) && !empty($age) && !empty($dif) && !empty($why)){
                if(is_numeric($age) && $age >= 13 && $age < 101){
                    if($agree == "1"){
                    mysql_query("INSERT INTO `apps` (`user`,`real`,`location`,`age`,`why`,`dif`,`additional`) VALUES ('".$_SESSION['user']['username']."', '".filter($real)."', '".filter($userLocation)."', '".filter($age)."', '".filter($why)."', '".filter($dif)."', '".filter($additional)."')") or die(mysql_error());
                    echo '<div class="error_green"><b>Thank you!</b> Your application has been submitted and is awaiting to be reviewed by staff!</div><br/>';
                    }else{
                        echo '<div class="error_red">You must agree to our Application Terms to Apply!</div><br/>';
                    }
                }else{
                    echo '<div class="error_red">Please enter a valid age!</div><br/>';
                }
            }else{
                echo '<div class="error_red">Please fill in all fields!</div><br/>';
            }
        }else{
            echo '<div class="error_red">You have already applied, please wait for a reply.</div><br />';
        }
    }
?>
 
<form method="post">                           
        <b>Username:</b><br />
        <input disabled="disabled" value="{username}">
        <br /><br />
                                          
        <b>Real Name:</b><br />
        <input type="text" name="real">
        <br><br>
                                          
                        <b>Age:</b><br>
                        <select name="age">
                            <?php for ($i = 13; $i <= 100; $i++) : ?>
                                <option value="<?php echo $i; ?>"><?php echo $i; ?></option>
                            <?php endfor; ?>
                        </select>
                        <br><br>
                                          
                        <b>Why should we hire you?</b><br>
                        <textarea name="why" rows="4" cols="40"></textarea>
                        <br><br>
                                          
                        <b>Why are you different from the rest?</b><br>
                        <textarea name="dif" rows="4" cols="40"></textarea>
                        <br><br>
                                          
                        <b>Additional Info: Skype Name, Position Applied For</b><br>
                        <textarea name="additional" rows="4" cols="40"></textarea>
                        <br><br>
                                          
                        <input type="checkbox" value="1" name="agree"> I agree to be active on the hotel even before we select (if we) you as an Trial Moderator
                                          
                        <br><br>
                                          
                        <div style="float:right;padding: 5px;">
                        <input type="submit" value="Apply" name="sendApp"/>
                        </div>
                        <div style="float:left;"><a href="/me">Cancel</a></div>
                                  
                    </form>
                  
</div>
</div>
</div>
</div>

Table Query (Delete it if you already have apps table)
Code:
CREATE TABLE `apps` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user` varchar(255) DEFAULT NULL,
  `real` varchar(255) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `age` int(11) DEFAULT NULL,
  `why` varchar(255) DEFAULT NULL,
  `dif` varchar(255) DEFAULT NULL,
  `additional` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8;
 

Pinkman

Posting Freak
Jul 27, 2016
814
193
Not Fully True. The only difference is the backend, so fetching the user data and session data, the rest is the same. Uber supports db_query as a function in its backend while RevCMS only supports mysql_query (Which can be used in both).

Here is some code I use:
Code:
<div id="column1" class="column">
<div class="habblet-container " style="float:left; width: 460px;">
<div class="cbb clearfix red ">
<h2 class="title"><span style="float: left;">Staff Applications</span></h2>
<div style="padding: 5px" align="left">
 
 
<?php
    if(isset($_POST['sendApp'])){
        $sql = mysql_query("SELECT user FROM apps WHERE user = '".$_SESSION['user']['username']."' LIMIT 1");
        if(mysql_num_rows($sql) == 0){
            $user = $_SESSION['user']['username'];
         
            $userIP = $_SERVER['REMOTE_ADDR'];
            $locationDetails = json_decode(file_get_contents("http://ipinfo.io/{$userIP}/json"));
            $userLocation = $locationDetails->city . ', ' . $locationDetails->region;
         
            $real = mysql_real_escape_string($_POST['real']);
            $age = mysql_real_escape_string($_POST['age']);
            $dif = mysql_real_escape_string($_POST['dif']);
            $why = mysql_real_escape_string($_POST['why']);
            $additional = mysql_real_escape_string($_POST['additional']);
            $agree = mysql_real_escape_string($_POST['agree']);
         
            if (!empty($real) && !empty($age) && !empty($dif) && !empty($why)){
                if(is_numeric($age) && $age >= 13 && $age < 101){
                    if($agree == "1"){
                    mysql_query("INSERT INTO `apps` (`user`,`real`,`location`,`age`,`why`,`dif`,`additional`) VALUES ('".$_SESSION['user']['username']."', '".filter($real)."', '".filter($userLocation)."', '".filter($age)."', '".filter($why)."', '".filter($dif)."', '".filter($additional)."')") or die(mysql_error());
                    echo '<div class="error_green"><b>Thank you!</b> Your application has been submitted and is awaiting to be reviewed by staff!</div><br/>';
                    }else{
                        echo '<div class="error_red">You must agree to our Application Terms to Apply!</div><br/>';
                    }
                }else{
                    echo '<div class="error_red">Please enter a valid age!</div><br/>';
                }
            }else{
                echo '<div class="error_red">Please fill in all fields!</div><br/>';
            }
        }else{
            echo '<div class="error_red">You have already applied, please wait for a reply.</div><br />';
        }
    }
?>
 
<form method="post">                          
        <b>Username:</b><br />
        <input disabled="disabled" value="{username}">
        <br /><br />
                                         
        <b>Real Name:</b><br />
        <input type="text" name="real">
        <br><br>
                                         
                        <b>Age:</b><br>
                        <select name="age">
                            <?php for ($i = 13; $i <= 100; $i++) : ?>
                                <option value="<?php echo $i; ?>"><?php echo $i; ?></option>
                            <?php endfor; ?>
                        </select>
                        <br><br>
                                         
                        <b>Why should we hire you?</b><br>
                        <textarea name="why" rows="4" cols="40"></textarea>
                        <br><br>
                                         
                        <b>Why are you different from the rest?</b><br>
                        <textarea name="dif" rows="4" cols="40"></textarea>
                        <br><br>
                                         
                        <b>Additional Info: Skype Name, Position Applied For</b><br>
                        <textarea name="additional" rows="4" cols="40"></textarea>
                        <br><br>
                                         
                        <input type="checkbox" value="1" name="agree"> I agree to be active on the hotel even before we select (if we) you as an Trial Moderator
                                         
                        <br><br>
                                         
                        <div style="float:right;padding: 5px;">
                        <input type="submit" value="Apply" name="sendApp"/>
                        </div>
                        <div style="float:left;"><a href="/me">Cancel</a></div>
                                 
                    </form>
                 
</div>
</div>
</div>
</div>

Table Query (Delete it if you already have apps table)
Code:
CREATE TABLE `apps` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user` varchar(255) DEFAULT NULL,
  `real` varchar(255) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `age` int(11) DEFAULT NULL,
  `why` varchar(255) DEFAULT NULL,
  `dif` varchar(255) DEFAULT NULL,
  `additional` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8;
Read my post properly. Coding structure is backend
 
Status
Not open for further replies.

Users who are viewing this thread

Top