$member = new Platinum_membership(); $id = intval($_GET["id"]); if ($id == 0) { $id = intval($_POST["id"]); } if ($id > 0) { $member = $member->Get($id); $user->canAccess($member); } else { //new object $member->onlineuser_onlineuserid = $user->onlineuserId; //default link $member->link = "http://"; //free for now $member->platinum_membership_status = 'active'; $member->dt_expire = expiryYear(); //$member->logo="platinum.gif"; //$member->image1="platinum.gif"; //$member->image2="platinum.gif"; } //check if form is being submitted if ((bool) $_POST["submitting"]) { $member->logo = $_POST["currentFilename"]; $member->image1 = $_POST["currentFilenameImg1"]; $member->image2 = $_POST["currentFilenameImg2"]; $member->heading = $_POST["heading"]; $member->text = $_POST["text"]; $member->name = $_POST["name"]; $member->address = $_POST["address"]; $member->tel = $_POST["tel"]; $member->fax = $_POST["fax"];
<?php require "common_user.php"; require "top.php"; $class = stripslashes($_GET["type"]); $id = (int) $_GET["id"]; $newExpiryDate = expiryDate(); if ($class == "gold_membership" || $class == "platinum_membership") { $newExpiryDate = expiryYear(); } if ($class == "Job") { $db = new DatabaseConnection(); $db->Query("update job set job_status = 'active', dt_expire='{$newExpiryDate}' where onlineuser_onlineuserid={$user->onlineuserId} and jobid={$id}"); } else { $object = new $class(); $object = $object->Get($id); if (isSuperUser(false) || $user->canAccess($object)) { /* no point check this, where if an object is live or not are determined by status and expiry date $expires=strtotime($object->dt_expire); if (date("U") > $expires){ // at this point the advert has already expired // maybe redirect to a pay now link ? exit; } */ $status = $class . "_status"; $object->{$status} = "active"; $object->dt_expire = $newExpiryDate; $object->Save(); } else { // this user is not allowed to access this resource