Ejemplo n.º 1
0
<?php

check_login();
include SITEDIR . '/includes/navLeftSideVars.php';
if (!empty($_REQUEST['cty'])) {
    $status = 0;
    $insertSQL = sprintf("INSERT INTO geo_city_owners (cty_id, owner_id, expiry_date, subs_expiry_date, status) VALUES (%s, %s, %s, %s, %s)", GetSQLValueString($_REQUEST['cty'], "int"), GetSQLValueString($_SESSION['user']['id'], "text"), GetSQLValueString(date('Y-m-d H:i:s', strtotime("+1 month")), "date"), GetSQLValueString(date('Y-m-d H:i:s', strtotime("+1 year")), "date"), GetSQLValueString($status, "int"));
    mysql_select_db($database_connMain, $connMain);
    $Result1 = mysql_query($insertSQL, $connMain) or die(mysql_error());
    $insertGoTo = $currentURL;
    header(sprintf("Location: %s", $insertGoTo));
    exit;
}
//getting owern information
$Models_Geo = new Models_Geo();
$ownerDetails = $Models_Geo->getOwnerDetails($city_id, 0);
if (!empty($ownerDetails)) {
    header("Location: " . $currentURL);
    exit;
}
?>
<h1><?php 
echo $pageTitle;
?>
</h1>
<p>Apply For City Moderator</p>
<form action="<?php 
echo PAYPAL_URL;
?>
" method="post">
    
Ejemplo n.º 2
0
function check_city_owner_bk($city_id, $user_id)
{
    $Models_Geo = new Models_Geo();
    $ownerDetails = $Models_Geo->getOwnerDetails($city_id, 0);
    if ($ownerDetails['owner_id'] != $user_id) {
        throw new Exception('Invalid Owner');
    }
    if ($ownerDetails['status'] != 1) {
        throw new Exception('Ownership not active');
    }
    if (strtotime($ownerDetails['expiry_date']) < time()) {
        throw new Exception('Ownership expired');
    }
    if (strtotime($ownerDetails['subs_expiry_date']) < time()) {
        throw new Exception('Subscription expired');
    }
}