function updateStats($objectName, $objectId, $type)
{
    $db = new DatabaseConnection();
    $stats = new Stats();
    $query = "SELECT statsid FROM stats WHERE objectname='{$objectName}' AND objectid='{$objectId}'";
    $results = $db->Query($query);
    if ($db->Rows() > 0) {
        //exsiting
        $data = mysql_fetch_row($results);
        $stats = $stats->Get((int) $data[0]);
    } else {
        //new record
        $stats->objectname = $objectName;
        $stats->objectid = $objectId;
    }
    $stats->{$type} = $stats->{$type} + 1;
    $stats->Save();
}
예제 #2
0
     if (($result = validate($telephone, "phonenumber", 45)) !== true) {
         $errorText .= "<LI>Your telephone number is {$result}";
     }
     if ($fax != "" && ($result = validate($fax, "phonenumber", 45)) !== true) {
         $errorText .= "<LI>Your fax number is {$result}";
     }
 }
 if (($result = validate($password, "password", 45, 6)) !== true) {
     $errorText .= "<LI>Your password is {$result}";
 }
 if ($_POST["readTerms"] != "on") {
     $errorText .= "<LI>Please read the terms and then tick the box to proceed";
 }
 if ($errorText == "") {
     $query = $db->Query("SELECT * FROM onlineuser WHERE email='" . $db->Escape($email) . "' LIMIT 1");
     if ($db->Rows() > 0) {
         $errorText .= "<LI>The email address you have entered is taken";
     } else {
         $user = new OnlineUser($email, $first_name, $last_name, $password, $address1, $address2, $address3, $postcode, $telephone, $fax, '', 'temp');
         if (isSuperUser(false) && $status != "") {
             $user->user_status = $status;
         }
         $userId = $user->Save();
         $user = $user->Get($userId);
         $created = strtotime($user->dt_created);
         $mail = new Emailer();
         $mail->setTo($email);
         $mail->setFrom($configuration["fromEmail"]);
         $mail->setSubject("Fastfoodjobsuk Registration");
         $url = "http://www.fastfoodjobsuk.co.uk/register_activate.php?email={$email}&code={$created}";
         $mail->bodyAdd("Dear {$first_name} {$last_name}");
예제 #3
0
<?php

require "common_all.php";
$id = (int) $_GET["id"];
$member = new Spotlight();
$member = $member->Get($id);
if ($member->spotlightId == 0) {
    // pull latest out of db
    $db = new DatabaseConnection();
    $result = $db->Query("SELECT spotlightid FROM spotlight ORDER BY dt_created DESC LIMIT 1");
    if ($db->Rows() == 1) {
        $qr = mysql_fetch_row($result);
        $member = $member->Get($qr[0]);
    } else {
        header("Location: index.php");
        exit;
    }
}
require "top_wide.php";
?>
<link rel=stylesheet href="css/platinum.css" type="text/css">
  <img src="logos/<?php 
echo $member->logo;
?>
" width="<?php 
echo $platinumImageWidth;
?>
" height="<?php 
echo $platinumImageHeight;
?>
" class="topimageleft">
예제 #4
0
 /**
  * Saves the object to the database
  * @return integer $userId
  */
 function Save()
 {
     $Database = new DatabaseConnection();
     $this->pog_query = "select userid from `user` where `userid`='" . $this->userId . "' LIMIT 1";
     $Database->Query($this->pog_query);
     if ($Database->Rows() > 0) {
         $this->pog_query = "update `user` set \r\n\t\t\t`username`='" . $Database->Escape($this->username) . "', \r\n\t\t\t`password`='" . $Database->Escape($this->password) . "', \r\n\t\t\t`firstname`='" . $Database->Escape($this->firstname) . "', \r\n\t\t\t`lastname`='" . $Database->Escape($this->lastname) . "', \r\n\t\t\t`question`='" . $Database->Escape($this->question) . "', \r\n\t\t\t`answer`='" . $Database->Escape($this->answer) . "', \r\n\t\t\t`groupid`='" . $this->groupId . "', \r\n\t\t\t`lastlogin`='" . $Database->Escape($this->lastlogin) . "', \r\n\t\t\t`disabled`='" . $Database->Escape($this->disabled) . "' where `userid`='" . $this->userId . "'";
     } else {
         $this->pog_query = "insert into `user` (`username`, `password`, `firstname`, `lastname`, `question`, `answer`, `groupid`, `lastlogin`, `disabled` ) values (\r\n\t\t\t'" . $Database->Escape($this->username) . "', \r\n\t\t\t'" . $Database->Escape($this->password) . "', \r\n\t\t\t'" . $Database->Escape($this->firstname) . "', \r\n\t\t\t'" . $Database->Escape($this->lastname) . "', \r\n\t\t\t'" . $Database->Escape($this->question) . "', \r\n\t\t\t'" . $Database->Escape($this->answer) . "', \r\n\t\t\t'" . $this->groupId . "', \r\n\t\t\t'" . $Database->Escape($this->lastlogin) . "', \r\n\t\t\t'" . $Database->Escape($this->disabled) . "' )";
     }
     $Database->InsertOrUpdate($this->pog_query);
     if ($this->userId == "") {
         $this->userId = $Database->GetCurrentId();
     }
     return $this->userId;
 }
예제 #5
0
function generateJobLink($user)
{
    global $truncateText;
    $db = new DatabaseConnection();
    $result = $db->Query("SELECT * FROM job where onlineuser_onlineuserid={$user->onlineuserId} ORDER BY dt_created DESC");
    $rows = $db->Rows();
    $alt = false;
    $rowclass = "";
    if ($rows > 0 || isSuperUser(false)) {
        echo "<br/>";
        echo "<span class='adminrowheader'>Job Admin</span>";
        echo "  - <a href='job_post.php' class='newslarge'>create new</a>";
        echo "<div class=\"spacer\"></div>";
        echo "<table class=\"table\">";
        if ($rows == 0) {
            if (isSuperUser(false)) {
                echo "<tr><td>";
                echo "currently have no entries";
                echo "</td></tr>";
            }
        } else {
            echo "<TR><TD>Position</td><TD>Description</td><TD>Salary</td><TD>Location</td><TD>Company</td><TD>Created</td><TD>Expires</td><TD>Status</td><TD><!-- Functions --></td></tr>";
            for ($i = 0; $i < $rows; $i++) {
                $row = mysql_fetch_assoc($result);
                if ($alt) {
                    $rowclass = "row_even";
                } else {
                    $rowclass = "row_odd";
                }
                $alt = !$alt;
                echo "<tr>";
                echo "<td class=\"{$rowclass}\">" . $row["position"] . "</td>";
                echo "<td class=\"{$rowclass}\">" . substr($row["profile"], 0, $truncateText) . "...</td>";
                echo "<td class=\"{$rowclass}\">" . $row["bonus"] . "</td>";
                echo "<td class=\"{$rowclass}\">" . $row["location"] . "</td>";
                echo "<td class=\"{$rowclass}\">" . $row["company"] . "</td>";
                echo "<td class=\"{$rowclass}\">" . FormatDateTime($row["dt_created"], 7) . "</td>";
                echo "<td class=\"{$rowclass}\">" . FormatDateTime($row["dt_expire"], 7) . "</td>";
                $jobid = $row["jobid"];
                if ($row["job_status"] != "temp" && $row["dt_expire"] <= date("Y-m-d")) {
                    echo "<td class=\"{$rowclass}\">Expired</td><td class=\"{$rowclass}\"><ul>";
                    echo "<li><a href=\"renew.php?type=Job&id=" . $jobid . "\">Renew</a></li>";
                } else {
                    switch ($row["job_status"]) {
                        case "temp":
                            echo "<td class=\"{$rowclass}\">Temporary</td><td class=\"{$rowclass}\"><ul>";
                            echo "<li><a href='activate.php?type=Job&id={$jobid}'>Activate</a></li>";
                            break;
                        case "active":
                            echo "<td class=\"{$rowclass}\">Active</td><td class=\"{$rowclass}\"><ul>";
                            if (isSuperUser(false)) {
                                echo "<li><a href='deactivate.php?type=Job&id={$jobid}'>Pause</a></li>";
                            }
                            break;
                        case "disabled":
                            echo "<td class=\"{$rowclass}\">Paused</td><td class=\"{$rowclass}\"><ul>";
                            if (isSuperUser(false)) {
                                echo "<li><a href='activate.php?type=Job&id={$jobid}'>Continue</a></li>";
                            }
                    }
                }
                echo "<li><a href='jobedit.php?jobid={$jobid}'>Modify</a></li>";
                //echo "<li><a href='jobview.php?jobid=$jobid'  target='_blank'>View</a></li>";
                if (isSuperUser(false)) {
                    echo "<li><a href='#' onClick=\"sure('Job','{$jobid}')\">Delete</a></li>";
                }
                echo "</ul>";
                echo "</td>";
                echo "</tr>";
            }
        }
        echo "</table>";
        echo "<br/>";
        echo "<br/>";
    }
}
 function hasSpotlight()
 {
     $db = new DatabaseConnection();
     $result = $db->Query("SELECT spotlightid FROM spotlight WHERE membershipid='" . $this->gold_membershipId . "' AND spotlight_type='gold_membership'");
     if ($db->Rows() > 0) {
         $id = mysql_fetch_row($result);
         return $id[0];
     } else {
         return false;
     }
 }
예제 #7
0
    $emailMessage .= "None of your contact details have been revealed\n";
    $emailMessage .= "and it is totally up to you if you wish to make\n";
    $emailMessage .= "contact with the interested employer.\n\n";
    $emailMessage .= "Regards,\n\n";
    $emailMessage .= "The Fast Food Jobs Team\n\n";
    $emailMessage .= "Tel: 0845 644 8252\n";
    $emailMessage .= "*****@*****.**";
    return $emailMessage;
}
$cvid = (int) $_GET["cvid"];
if ($cvid == "") {
    $cvid = (int) $_POST["cvid"];
}
$db = new DatabaseConnection();
$results = $db->Query("SELECT first_name, last_name, email FROM cv WHERE cvid='{$cvid}'");
if ($db->Rows() <= 0) {
    // possibly post/get data has been tampered with
    // you should always get 1 row back with this query
    exit;
}
$data = mysql_fetch_row($results);
$cv_first_name = $data[0];
$cv_last_name = $data[1];
$cv_email = $data[2];
if ((bool) $_POST["submitting"]) {
    $jobId = (int) $_POST["jobIds"];
    $queryJob = $db->Query("SELECT contact_email FROM job WHERE jobid='{$jobId}'");
    if ($db->Rows() <= 0) {
        // shouldn't really ever get here
        exit;
    }
 /**
  * Saves the object to the database
  * @return integer $platinum_membershipId
  */
 function Save()
 {
     $Database = new DatabaseConnection();
     $this->pog_query = "select `spotlightid` from `spotlight` where `spotlightid`='" . $this->spotlightId . "' LIMIT 1";
     $Database->Query($this->pog_query);
     if ($Database->Rows() > 0) {
         $this->pog_query = "update `spotlight` set \n\t\t\t`membershipId`='" . $Database->Escape($this->membershipId) . "', \n\t\t\t`logo`='" . $Database->Escape($this->logo) . "', \n\t\t\t`image1`='" . $Database->Escape($this->image1) . "', \n\t\t\t`image2`='" . $Database->Escape($this->image2) . "', \n\t\t\t`heading`='" . $Database->Escape($this->heading) . "', \n\t\t\t`text`='" . $Database->Escape($this->text) . "', \n\t\t\t`name`='" . $Database->Escape($this->name) . "', \n\t\t\t`address`='" . $Database->Escape($this->address) . "', \n\t\t\t`tel`='" . $Database->Escape($this->tel) . "', \n\t\t\t`fax`='" . $Database->Escape($this->fax) . "', \n\t\t\t`email`='" . $Database->Escape($this->email) . "', \n\t\t\t`link`='" . $Database->Escape($this->link) . "', \n\t\t\t`dt_created`='" . $Database->Escape($this->dt_created) . "', \n\t\t\t`spotlight_type`='" . $this->spotlight_type . "' where `spotlightid`='" . $this->spotlightId . "'";
     } else {
         $this->pog_query = "insert into `spotlight` (`membershipid`, `logo`, `image1`, `image2`, `heading`, `text`, `name`, `address`, `tel`, `fax`, `email`, `link`, `spotlight_type` ) values (\n\t\t\t'" . $Database->Escape($this->membershipId) . "', \n\t\t\t'" . $Database->Escape($this->logo) . "', \n\t\t\t'" . $Database->Escape($this->image1) . "', \n\t\t\t'" . $Database->Escape($this->image2) . "', \n\t\t\t'" . $Database->Escape($this->heading) . "', \n\t\t\t'" . $Database->Escape($this->text) . "', \n\t\t\t'" . $Database->Escape($this->name) . "', \n\t\t\t'" . $Database->Escape($this->address) . "', \n\t\t\t'" . $Database->Escape($this->tel) . "', \n\t\t\t'" . $Database->Escape($this->fax) . "', \n\t\t\t'" . $Database->Escape($this->email) . "', \n\t\t\t'" . $Database->Escape($this->link) . "', \n\t\t\t'" . $this->spotlight_type . "' )";
     }
     $Database->InsertOrUpdate($this->pog_query);
     if ($this->spotlightId == "") {
         $this->spotlightId = $Database->GetCurrentId();
     }
     return $this->spotlightId;
 }
예제 #9
0
 /**
  * Saves the object to the database
  * @return integer $customerId
  */
 function Save()
 {
     $Database = new DatabaseConnection();
     $this->pog_query = "select customerid from `customer` where `customerid`='" . $this->customerId . "' LIMIT 1";
     $Database->Query($this->pog_query);
     if ($Database->Rows() > 0) {
         $this->pog_query = "update `customer` set \r\n\t\t\t`company`='" . $Database->Escape($this->company) . "', \r\n\t\t\t`firstname`='" . $Database->Escape($this->firstname) . "', \r\n\t\t\t`lastname`='" . $Database->Escape($this->lastname) . "', \r\n\t\t\t`address1`='" . $Database->Escape($this->address1) . "', \r\n\t\t\t`address2`='" . $Database->Escape($this->address2) . "', \r\n\t\t\t`city`='" . $Database->Escape($this->city) . "', \r\n\t\t\t`mobile`='" . $Database->Escape($this->mobile) . "', \r\n\t\t\t`landline`='" . $Database->Escape($this->landline) . "', \r\n\t\t\t`email`='" . $Database->Escape($this->email) . "', \r\n\t\t\t`limit`='" . $Database->Escape($this->limit) . "', \r\n\t\t\t`available`='" . $Database->Escape($this->available) . "', \r\n\t\t\t`deleted`='" . $Database->Escape($this->deleted) . "' where `customerid`='" . $this->customerId . "'";
     } else {
         $this->pog_query = "insert into `customer` (`company`, `firstname`, `lastname`, `address1`, `address2`, `city`, `mobile`, `landline`, `email`, `limit`, `available`, `deleted` ) values (\r\n\t\t\t'" . $Database->Escape($this->company) . "', \r\n\t\t\t'" . $Database->Escape($this->firstname) . "', \r\n\t\t\t'" . $Database->Escape($this->lastname) . "', \r\n\t\t\t'" . $Database->Escape($this->address1) . "', \r\n\t\t\t'" . $Database->Escape($this->address2) . "', \r\n\t\t\t'" . $Database->Escape($this->city) . "', \r\n\t\t\t'" . $Database->Escape($this->mobile) . "', \r\n\t\t\t'" . $Database->Escape($this->landline) . "', \r\n\t\t\t'" . $Database->Escape($this->email) . "', \r\n\t\t\t'" . $Database->Escape($this->limit) . "', \r\n\t\t\t'" . $Database->Escape($this->available) . "', \r\n\t\t\t'" . $Database->Escape($this->deleted) . "' )";
     }
     $Database->InsertOrUpdate($this->pog_query);
     if ($this->customerId == "") {
         $this->customerId = $Database->GetCurrentId();
     }
     return $this->customerId;
 }
예제 #10
0
    $where = "";
    $where = $firstname != "" ? "first_name like '%" . $db->Escape($firstname) . "%'" : "";
    if ($lastname != "") {
        if ($where != "") {
            $where .= " AND ";
        }
        $where .= "last_name like '%" . $db->Escape($lastname) . "%'";
    }
    if ($email != "") {
        if ($where != "") {
            $where .= " AND ";
        }
        $where .= "email like '%" . $db->Escape($email) . "%'";
    }
    $result = $db->Query("SELECT onlineuserId, first_name, last_name, email FROM onlineuser WHERE {$where} AND onlineuserId!='1'");
    if (($rows = $db->Rows()) > 0) {
        $matches = true;
        for ($i = 0; $i < $rows; $i++) {
            $resultArray[$i] = mysql_fetch_row($result);
        }
    }
}
require "top_wide.php";
?>
<style type="text/css" media="screen">
<!--
a { color: #0083cc; font-size: 10px; font-family: Verdana, Arial, Helvetica, SunSans-Regular; text-decoration: none }
a:hover { color: #0083cc; font-size: 10px; font-family: Verdana, Arial, Helvetica, SunSans-Regular; text-decoration: underline }
#wrapper table { width:740px;}
#wrapper td {padding:5px;}
-->
예제 #11
0
$db = new DatabaseConnection();
$user = new OnlineUser();
if ((bool) $_POST["submitting"]) {
    $id = (int) $_POST["id"];
    $user = $user->Get($id);
    $tables = array("cv", "franchise", "gold_membership", "job", "platinum_membership", "restaurant", "supplier");
    foreach ($tables as $tableName) {
        $db->Query("DELETE FROM {$tableName} WHERE onlineuser_onlineuserid='{$id}'");
    }
    $user->Delete();
    $_SESSION["onlineuser"] = $_SESSION["superuser"];
    header("Location: delete_user_success.php");
    exit;
}
$db->Query("SELECT dt_created FROM cv WHERE onlineuser_onlineuserid='{$id}'");
$cvCount = $db->Rows();
$db->Query("SELECT dt_created FROM franchise WHERE onlineuser_onlineuserid='{$id}'");
$franchiseCount = $db->Rows();
$db->Query("SELECT dt_created FROM gold_membership WHERE onlineuser_onlineuserid='{$id}'");
$goldCount = $db->Rows();
$db->Query("SELECT dt_created FROM job WHERE onlineuser_onlineuserid='{$id}'");
$jobCount = $db->Rows();
$db->Query("SELECT dt_created FROM platinum_membership WHERE onlineuser_onlineuserid='{$id}'");
$platinumCount = $db->Rows();
$db->Query("SELECT dt_created FROM restaurant WHERE onlineuser_onlineuserid='{$id}'");
$restaurantCount = $db->Rows();
$db->Query("SELECT dt_created FROM supplier WHERE onlineuser_onlineuserid='{$id}'");
$supplierCount = $db->Rows();
require "top.php";
?>
예제 #12
0
 /**
  * Saves the object to the database
  * @return integer $supplierId
  */
 function Save()
 {
     $Database = new DatabaseConnection();
     $this->pog_query = "select supplierid from `supplier` where `supplierid`='" . $this->supplierId . "' LIMIT 1";
     $Database->Query($this->pog_query);
     if ($Database->Rows() > 0) {
         $this->pog_query = "update `supplier` set \r\n\t\t\t`company`='" . $Database->Escape($this->company) . "', \r\n\t\t\t`address1`='" . $Database->Escape($this->address1) . "', \r\n\t\t\t`address2`='" . $Database->Escape($this->address2) . "', \r\n\t\t\t`city`='" . $Database->Escape($this->city) . "', \r\n\t\t\t`phone`='" . $Database->Escape($this->phone) . "', \r\n\t\t\t`contactname`='" . $Database->Escape($this->contactname) . "', \r\n\t\t\t`contactno`='" . $Database->Escape($this->contactno) . "', \r\n\t\t\t`deleted`='" . $Database->Escape($this->deleted) . "' where `supplierid`='" . $this->supplierId . "'";
     } else {
         $this->pog_query = "insert into `supplier` (`company`, `address1`, `address2`, `city`, `phone`, `contactname`, `contactno`, `deleted` ) values (\r\n\t\t\t'" . $Database->Escape($this->company) . "', \r\n\t\t\t'" . $Database->Escape($this->address1) . "', \r\n\t\t\t'" . $Database->Escape($this->address2) . "', \r\n\t\t\t'" . $Database->Escape($this->city) . "', \r\n\t\t\t'" . $Database->Escape($this->phone) . "', \r\n\t\t\t'" . $Database->Escape($this->contactname) . "', \r\n\t\t\t'" . $Database->Escape($this->contactno) . "', \r\n\t\t\t'" . $Database->Escape($this->deleted) . "' )";
     }
     $Database->InsertOrUpdate($this->pog_query);
     if ($this->supplierId == "") {
         $this->supplierId = $Database->GetCurrentId();
     }
     return $this->supplierId;
 }
예제 #13
0
 /**
  * Saves the object to the database
  * @return integer $statsId
  */
 function Save()
 {
     $Database = new DatabaseConnection();
     $this->pog_query = "select `statsid` from `stats` where `statsid`='" . $this->statsId . "' LIMIT 1";
     $Database->Query($this->pog_query);
     if ($Database->Rows() > 0) {
         $this->pog_query = "update `stats` set \n\t\t\t`objectname`='" . $Database->Escape($this->objectname) . "', \n\t\t\t`objectid`='" . $Database->Escape($this->objectid) . "', \n\t\t\t`impressions`='" . $Database->Escape($this->impressions) . "', \n\t\t\t`clicks`='" . $Database->Escape($this->clicks) . "' where `statsid`='" . $this->statsId . "'";
     } else {
         $this->pog_query = "insert into `stats` (`objectname`, `objectid`, `impressions`, `clicks`) values (\n\t\t\t'" . $Database->Escape($this->objectname) . "', \n\t\t\t'" . $Database->Escape($this->objectid) . "', \n\t\t\t'" . $Database->Escape($this->impressions) . "', \n\t\t\t'" . $Database->Escape($this->clicks) . "' )";
     }
     $Database->InsertOrUpdate($this->pog_query);
     if ($this->statsId == "") {
         $this->statsId = $Database->GetCurrentId();
     }
     return $this->statsId;
 }
예제 #14
0
        echo "<img src=\"logos/" . $platinumImages[$imagePos][1] . "\" width='153' height='104' border='0' class='platinumImages'></a>";
        $imagePos++;
    } else {
        echo "<a href=\"advertise.php\">";
        echo "<img src='logos/your_company_here.gif' width='153' height='104' border='0' class='platinumImages'></a>";
    }
}
if (isset($_GET["redir"])) {
    $_SESSION["redir"] = $_GET["redir"];
    header("Location: index.php");
    exit;
}
$platinumImages = array(6);
$db = new DatabaseConnection();
$result = $db->Query("SELECT platinum_membershipId,logo\n                      FROM platinum_membership\n                      WHERE platinum_membership_status='active'\n                            AND dt_expire>'" . date("Y-m-d") . "'\n                      ORDER BY RAND() LIMIT 6");
$rows = $db->Rows();
for ($i = 0; $i < $rows; $i++) {
    $qr = mysql_fetch_row($result);
    $platinumImages[$i] = $qr;
}
$imagePos = 0;
for ($i = 0; $i < count($platinumImages); $i++) {
    updateImpressions("platinum_membership", $platinumImages[$i][0]);
}
$loginEmail = showLoggedInAs();
//default
$button1 = "homebuttonIff_04";
$button2 = "homebuttonIff_05";
$button3 = "homebuttonIff_06";
$button4 = "homebuttonIff_07";
$button5 = "homebuttonIff_08";
예제 #15
0
 /**
  * Saves the object to the database
  * @return integer $groupId
  */
 function Save($deep = true)
 {
     $Database = new DatabaseConnection();
     $this->pog_query = "select groupid from `group` where `groupid`='" . $this->groupId . "' LIMIT 1";
     $Database->Query($this->pog_query);
     if ($Database->Rows() > 0) {
         $this->pog_query = "update `group` set \r\n\t\t\t`name`='" . $Database->Escape($this->name) . "', \r\n\t\t\t`desc`='" . $Database->Escape($this->desc) . "'where `groupid`='" . $this->groupId . "'";
     } else {
         $this->pog_query = "insert into `group` (`name`, `desc`) values (\r\n\t\t\t'" . $Database->Escape($this->name) . "', \r\n\t\t\t'" . $Database->Escape($this->desc) . "')";
     }
     $Database->InsertOrUpdate($this->pog_query);
     if ($this->groupId == "") {
         $this->groupId = $Database->GetCurrentId();
     }
     if ($deep) {
         $userList = $this->GetUserList();
         foreach ($this->_userList as $user) {
             $user->Save($deep);
         }
     }
     return $this->groupId;
 }
 function canSearchCV($logout = true)
 {
     $db = new DatabaseConnection();
     $result = $db->Query("select * from `job` where onlineuser_onlineuserid='" . $this->onlineuserId . "' and job_status<>'temp' and dt_expire>" . date("Y-m-d"));
     if ($db->Rows() > 0) {
         return true;
     } else {
         if ($logout) {
             header("Location: logout.php");
             exit;
         } else {
             return false;
         }
     }
 }
 /**
  * Saves the object to the database
  * @return integer $restaurantId
  */
 function Save()
 {
     $Database = new DatabaseConnection();
     $this->pog_query = "select `restaurantid` from `restaurant` where `restaurantid`='" . $this->restaurantId . "' LIMIT 1";
     $Database->Query($this->pog_query);
     if ($Database->Rows() > 0) {
         $this->pog_query = "update `restaurant` set \n\t\t\t`onlineuser_onlineuserid`='" . $Database->Escape($this->onlineuser_onlineuserid) . "', \n\t\t\t`logo`='" . $Database->Escape($this->logo) . "', \n\t\t\t`name`='" . $Database->Escape($this->name) . "', \n\t\t\t`description`='" . $Database->Escape($this->description) . "', \n\t\t\t`link`='" . $Database->Escape($this->link) . "', \n\t\t\t`tel`='" . $Database->Escape($this->tel) . "', \n\t\t\t`dt_created`='" . $Database->Escape($this->dt_created) . "', \n\t\t\t`dt_expire`='" . $Database->Escape($this->dt_expire) . "', \t\t\t\n\t\t\t`restaurant_status`='" . $this->restaurant_status . "' where `restaurantid`='" . $this->restaurantId . "'";
     } else {
         $this->pog_query = "insert into `restaurant` (`onlineuser_onlineuserid`, `logo`, `name`, `description`, `link`, `tel`, `dt_expire`, `restaurant_status` ) values (\n\t\t\t'" . $Database->Escape($this->onlineuser_onlineuserid) . "', \n\t\t\t'" . $Database->Escape($this->logo) . "', \n\t\t\t'" . $Database->Escape($this->name) . "', \n\t\t\t'" . $Database->Escape($this->description) . "', \n\t\t\t'" . $Database->Escape($this->link) . "', \n\t\t\t'" . $Database->Escape($this->tel) . "', \n\t\t\t'" . $Database->Escape($this->dt_expire) . "', \n\t\t\t'" . $this->restaurant_status . "' )";
     }
     $Database->InsertOrUpdate($this->pog_query);
     if ($this->restaurantId == "") {
         $this->restaurantId = $Database->GetCurrentId();
     }
     return $this->restaurantId;
 }
예제 #18
0
<?php

require "common_all.php";
if (isset($_POST["email"])) {
    $db = new DatabaseConnection();
    $results = $db->Query("SELECT * FROM onlineuser WHERE email='" . $db->Escape($_POST["email"]) . "' AND pass_word=PASSWORD('" . $db->Escape($_POST["password"]) . "')");
    if ($db->Rows() != null) {
        $user = new OnlineUser();
        $user = $user->populate($db);
        // are they active?
        $status = $user->user_status;
        switch ($status) {
            case "temp":
                header("Location: register_activate.php");
                exit;
                break;
            case "disabled":
                header("Location: logout.php");
                exit;
                break;
        }
        $_SESSION["onlineuser"] = $user;
        //proceed to loged in page
        if (isSuperUser(false)) {
            header("Location: admin_account.php");
            exit;
        } else {
            if (isset($_SESSION["redirect"]) || isset($_POST["redirect"])) {
                $url = isset($_SESSION["redirect"]) ? $_SESSION["redirect"] : $_POST["redirect"];
                unset($_SESSION["redirect"]);
                header("Location: {$url}");
예제 #19
0
 /**
  * Saves the object to the database
  * @return integer $newsId
  */
 function Save()
 {
     $Database = new DatabaseConnection();
     $this->pog_query = "select `newsid` from `news` where `newsid`='" . $this->newsId . "' LIMIT 1";
     $Database->Query($this->pog_query);
     if ($Database->Rows() > 0) {
         $this->pog_query = "update `news` set \n\t\t\t`heading`='" . $Database->Escape($this->heading) . "', \n\t\t\t`description`='" . $Database->Escape($this->description) . "', \n\t\t\t`link`='" . $Database->Escape($this->link) . "', \n\t\t\t`live`='" . $Database->Escape($this->live) . "', \n\t\t\t`dt_created`='" . $Database->Escape($this->dt_created) . "' where `newsid`='" . $this->newsId . "'";
     } else {
         $this->pog_query = "insert into `news` (`heading`, `description`, `link`, `live`) values (\n\t\t\t'" . $Database->Escape($this->heading) . "', \n\t\t\t'" . $Database->Escape($this->description) . "', \n\t\t\t'" . $Database->Escape($this->link) . "', \n\t\t\t'" . $Database->Escape($this->live) . "' )";
     }
     $Database->InsertOrUpdate($this->pog_query);
     if ($this->newsId == "") {
         $this->newsId = $Database->GetCurrentId();
     }
     return $this->newsId;
 }
 /**
  * Saves the object to the database
  * @return integer $supplier_categoryId
  */
 function Save()
 {
     $Database = new DatabaseConnection();
     $this->pog_query = "select `supplier_category_id` from `supplier_category` where `supplier_category_id`='" . $this->supplier_categoryId . "' LIMIT 1";
     $Database->Query($this->pog_query);
     if ($Database->Rows() > 0) {
         $this->pog_query = "update `supplier_category` set \n\t\t\t`name`='" . $Database->Escape($this->name) . "' where `supplier_category_id`='" . $this->supplier_categoryId . "'";
     } else {
         $this->pog_query = "insert into `supplier_category` (`name` ) values (\n\t\t\t'" . $Database->Escape($this->name) . "' )";
     }
     $Database->InsertOrUpdate($this->pog_query);
     if ($this->supplier_categoryId == "") {
         $this->supplier_categoryId = $Database->GetCurrentId();
     }
     return $this->supplier_categoryId;
 }