public
Created

Part 1: retrieve listing type from database

  • Download Gist
modify_form.html
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
<!-- mod: retrieve listing type from database -->
<%php%>
global $dbConn;
 
$id = $_GET['id'];
// premium sponsored
 
$query = "select * from idx_paid_listing where link_id = '$id'";
$row2 = $dbConn->FetchOne($query);
$raw_premium = $row2["premium"];
$raw_sponsored = $row2["sponsored"];
$raw_expire = $row2["expire"];
$raw_paid = $row2["paid"];
$premium = 0;
$sponsored = 0;
if ($raw_paid == 1 &&
$raw_premium == 1 &&
@strtotime("now") < @strtotime($raw_expire)) {
$premium = 1;
$sponsored = 0;
}
if ($raw_paid == 1 &&
$raw_sponsored == 1 &&
@strtotime("now") < @strtotime($raw_expire)) {
$premium = 0;
$sponsored = 1;
}
if (!$premium && !$sponsored) {
$basic = 1;
}
$this->assign('status_basic', $basic);
$this->assign('status_premium', $premium);
$this->assign('status_sponsored', $sponsored);
<%/php%>
<!-- /mod: retrieve listing type from database -->

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.