示例#1
0
function Page_BeforeShow()
{
    //Page_BeforeShow @1-66DC429C
    //Custom Code @12-2A29BDB7
    global $Tpl;
    global $now;
    global $accounting;
    global $charges;
    global $images;
    global $ttldis;
    global $usertotal;
    global $ttlcal;
    global $item_token;
    $db = new clsDBNetConnect();
    $query = "select tokens from users where user_id=" . CCGetUserID();
    $db->query($query);
    if ($db->next_record()) {
        if ($db->f("tokens") > 0 && !$item_token) {
            $Tpl->SetVar("tokens", "<br><br>You Currently have " . $db->f("tokens") . " 'Free Listing Tokens' in your account.  <br><a href=\"StartListing.php?usetoken=1\">Click Here to use one token and make this listing free!</a>");
        }
    }
    $Tpl->SetVar("ChargeListing", $ttldis);
    $Tpl->SetVar("UserTotal", pricepad($usertotal));
    $finaltotal = $usertotal - $ttlcal;
    $Tpl->SetVar("UserTotalFinal", pricepad($finaltotal));
    //End Custom Code
}
示例#2
0
            if ($ttlcal - $usertotal > 0) {
                $acct_credit = $usertotal;
                $ttlcal = $ttlcal - $usertotal;
                $ttldis .= "<br><br><b>Account Credit Used: </b>-" . pricepad($usertotal);
            } else {
                $acct_credit = $ttlcal;
                $ttlcal = "0.00";
                $ttldis .= "<br><br><b>Account Credit Used: </b>-" . pricepad($acct_credit);
            }
        }
        if ($item_token) {
            $ttldis .= "<br><br><b>FREE LISTING TOKEN USED: </b><br><a href=\"StartListing.php?removetoken=1\">Click here to remove this token and add it back to your account</a>";
            $ttlcal = "0.00";
        }
        $ttlcal = round($ttlcal, 2);
        $ttldis .= "<br><br><b>Total:</b> " . $currency . pricepad($ttlcal);
    }
    unset($db);
    unset($SQL);
    unset($Result);
    $db = new clsDBNetConnect();
    $SQL = "update items set amt_due = {$ttlcal}, acct_credit_used = {$acct_credit} where ItemNum=" . CCGetSession("RecentItemNum");
    $db->query($SQL);
    unset($db);
    unset($SQL);
    unset($Result);
    $dontshow = 1;
} else {
    $dontshow = 0;
}
//Include Page implementation @2-503267A8
示例#3
0
 function Show()
 {
     global $Tpl;
     global $now;
     global $regcharges;
     if (!$this->Visible) {
         return;
     }
     $ShownRecords = 0;
     $featcount = 0;
     $this->ds->Parameters["urls_asking_min"] = CCGetFromGet("s_asking_min", "");
     $this->ds->Parameters["urls_asking_max"] = CCGetFromGet("s_asking_max", "");
     $this->ds->Parameters["urls_recurring"] = CCGetFromGet("s_recurring", "");
     $this->ds->Parameters["urls_quantity"] = CCGetFromGet("s_quantity", "");
     $this->ds->Parameters["urls_description"] = CCGetFromGet("s_description", "");
     $this->ds->Parameters["urls_intro_duration"] = CCGetFromGet("s_intro_duration", "");
     $this->ds->Parameters["urls_category"] = CCGetFromGet("s_category", "");
     //$this->ds->Parameters["urlCatID"] = CCGetFromGet("CatID", "");
     $this->ds->Prepare();
     $this->ds->Open();
     $GridBlock = "Grid " . $this->ComponentName;
     $Tpl->block_path = $GridBlock;
     $uncount = 0;
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow");
     $is_next_record = $this->ds->next_record();
     if ($is_next_record && $ShownRecords < $this->PageSize) {
         do {
             $this->ds->SetValues();
             $Tpl->block_path = $GridBlock . "/Row";
             $this->id->SetValue($this->ds->id->GetValue());
             $this->title->SetValue($this->ds->title->GetValue());
             if ($this->ds->recurring->GetValue() == 1) {
                 $this->recurring->SetValue("<img src=\"images/recurring.gif\">");
             } else {
                 $this->recurring->SetValue("");
             }
             if ($this->ds->description->GetValue() != "") {
                 $this->description->SetValue($this->ds->description->GetValue());
             } else {
                 $this->description->SetValue($this->ds->description->GetValue());
             }
             if ($this->ds->price->GetValue() == "0") {
                 $url = "ViewSubscriptions.php?subsc_nc=" . $this->ds->id->GetValue();
             } else {
                 $url = "subscribe.php?id=" . $this->ds->id->GetValue();
             }
             if ($this->ds->icon->GetValue()) {
                 $this->icon->SetValue("<a href=\"" . $url . "\"><img src=\"images/" . $this->ds->icon->GetValue() . "\" border=\"0\"></a>");
             } else {
                 $this->icon->SetValue("");
             }
             $this->intro_duration->SetValue($this->ds->intro_duration->GetValue());
             $this->price->SetValue($this->ds->price->GetValue());
             $this->intro_price->SetValue($this->ds->intro_price->GetValue());
             $theday = getdate($this->ds->date_added->GetValue());
             $lastofyear = substr($theday["year"], -2);
             $enddate = $theday["mon"] . "/" . $theday["mday"] . "/" . $lastofyear;
             $this->date_added->SetValue($enddate);
             unset($newdate);
             unset($theday);
             unset($lastofyear);
             unset($enddate);
             $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
             $Tpl->SetVar("url", $url);
             $this->icon->Show();
             $this->id->Show();
             $this->title->Show();
             $this->recurring->Show();
             $this->description->Show();
             $this->intro_duration->Show();
             $this->price->Show();
             $this->intro_price->Show();
             $this->date_added->Show();
             if ($this->ds->intro_price->GetValue()) {
                 $Tpl->SetVar("intro_price", $regcharges["currency"] . pricepad($this->ds->intro_price->GetValue()));
             }
             if ($this->ds->price->GetValue()) {
                 $Tpl->SetVar("price", $regcharges["currency"] . pricepad($this->ds->price->GetValue()));
             }
             if ($this->ds->unlimited->GetValue() == 1) {
                 $Tpl->SetVar("duration", "Lifetime");
             } elseif ($this->ds->duration->GetValue() == 1) {
                 $Tpl->SetVar("duration", $this->ds->duration->GetValue() . " Day");
             } else {
                 $Tpl->SetVar("duration", $this->ds->duration->GetValue() . " Days");
             }
             if ($this->ds->intro_duration->GetValue() > 9999) {
                 $Tpl->SetVar("intro_duration", "Lifetime");
             } elseif ($this->ds->intro_duration->GetValue() == 1) {
                 $Tpl->SetVar("intro_duration", $this->ds->intro_duration->GetValue() . " Day");
             } elseif ($this->ds->intro_duration->GetValue() == 0) {
                 $Tpl->SetVar("intro_duration", $this->ds->intro_duration->GetValue() . "&nbsp;");
             } else {
                 $Tpl->SetVar("intro_duration", $this->ds->intro_duration->GetValue() . " Days");
             }
             $Tpl->block_path = $GridBlock;
             $Tpl->parse("Row", true);
             $ShownRecords++;
             $is_next_record = $this->ds->next_record();
         } while ($is_next_record && $ShownRecords < $this->PageSize);
     } else {
         $Tpl->SetVar("CloseSubsc", "<tr class=\"wtbk\"><td class=\"feat\" colspan=\"6\">No Subscription Plans Availible or Active</td></tr>");
         $Tpl->parse("NoRecords", false);
     }
     $this->Navigator->TotalPages = $this->ds->PageCount();
     $this->Sorter_title->Show();
     $this->Sorter_date_added->Show();
     $this->Sorter_price->Show();
     $this->Sorter_intro_price->Show();
     $this->Sorter_duration->Show();
     $this->Sorter_intro_duration->Show();
     $this->Navigator->Show();
     $Tpl->parse("", false);
     $Tpl->block_path = "";
 }