function charges1_charge_OnValidate() { //charges1_charge_OnValidate @10-D55FB1E0 //Custom Code @22-2A29BDB7 global $charges1; global $accounting; global $regcharges; global $finalamount; $dba = new clsDBNetConnect(); $dba->connect(); $dba->query("SELECT * FROM users WHERE user_id='" . CCGetUserID() . "'"); $dbL = new clsDBNetConnect(); $dbL->connect(); while ($dba->next_record()) { $clook = $dba->f("country_id"); $city = $dba->f("city"); $state = $dba->f("state_id"); $addr = $dba->f("address1"); $zip = $dba->f("zip"); $usid = $dba->f("user_id"); $email = $dba->f("email"); $country = CCDLookUp("country_desc", "lookup_countries", "country_id='" . $clook . "'", $dbL); } $payment_config = array("method" => "cc", "login" => $accounting["authorize"], "tran_key" => $accounting["authorize_tran_key"], "currency_code" => $regcharges["currencycode"]); $customer_info = array("first_name" => $charges1->FirstName->GetValue(), "last_name" => $charges1->LastName->GetValue(), "address" => $addr, "city" => $city, "state" => $state, "zip" => $zip, "country" => $country, "cust_id" => $usid, "email" => $email); $credit_card_info = array("card_num" => $charges1->CCNumber->GetValue(), "exp_date" => $charges1->ExpDate->GetValue(), "card_code" => $charges1->CardCode->GetValue(), "charge_type" => "AUTH_CAPTURE"); $payment =& new payment_authorizenet($payment_config); $payment->setCustomerIP($_SERVER["REMOTE_ADDR"]); $payment->enableCustomerEmails(TRUE); $payment->addCustomerInfo($customer_info, "billing"); $result = $payment->doPayment(rand(), "Classified Ad Listing Fee", $charges1->charge->GetValue(), "no", $credit_card_info); if (!$result) { $result_code = $payment->response_code; // 2 = declined, 3 = error if ($result_code == 2) { $charges1->charge->Errors->addError("The Card has been declined. Please make sure the Name, CC Number, and Expiration date are correct."); } if ($result_code == 3) { $charges1->charge->Errors->addError("There was an error trying to process your card. Please make sure the Name, CC Number, and Expiration date are correct."); } } $finalamount = $payment->x_amount; //End Custom Code }
function Show() { global $Tpl; global $FileName; $Error = ""; if (!$this->Visible) { return; } $this->ds->open(); $RecordBlock = "Record " . $this->ComponentName; $Tpl->block_path = $RecordBlock; if ($this->EditMode) { if ($this->Errors->Count() == 0) { if ($this->ds->Errors->Count() > 0) { echo "Error in Record watchlist"; } else { if ($this->ds->next_record()) { $this->ds->SetValues(); if (!$this->FormSubmitted) { $lookupdb = new clsDBNetConnect(); $lookupdb->connect(); if (CCGetFromGet("ItemNum", "")) { $newtitle = CCDLookUp("title", "items", "ItemNum='" . CCGetFromGet("ItemNum", "") . "'", $lookupdb); } $this->ItemTitle->SetValue($newtitle); $this->itemID->SetValue(CCGetFromGet("ItemNum", "")); $this->user_id->SetValue(CCGetUserID()); unset($lookupdb); } } else { $this->EditMode = false; } } } } $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); if ($this->FormSubmitted) { $Error .= $this->ItemTitle->Errors->ToString(); $Error .= $this->itemID->Errors->ToString(); $Error .= $this->user_id->Errors->ToString(); $Error .= $this->Errors->ToString(); $Error .= $this->ds->Errors->ToString(); $Tpl->SetVar("Error", $Error); $Tpl->Parse("Error", false); } $Tpl->SetVar("Action", $this->HTMLFormAction); $this->Insert->Visible = !$this->EditMode; $lookupdb = new clsDBNetConnect(); $lookupdb->connect(); if (CCGetFromGet("ItemNum", "")) { $newtitle = CCDLookUp("title", "items", "ItemNum='" . CCGetFromGet("ItemNum", "") . "'", $lookupdb); } $this->ItemTitle->SetValue($newtitle); $this->itemID->SetValue(CCGetFromGet("ItemNum", "")); $this->user_id->SetValue(CCGetUserID()); unset($lookupdb); $this->ItemTitle->Show(); $this->Insert->Show(); $this->Cancel->Show(); $this->itemID->Show(); $this->user_id->Show(); $Tpl->parse("", false); $Tpl->block_path = ""; }
function Delete() { $imr = new clsDBNetConnect(); $imr->connect(); $imr->query("SELECT image_one, image_two, image_three, image_four, image_five, `status`, `category`, `ItemNum` FROM items WHERE " . $this->Where); while ($imr->next_record()) { $removeImage = @unlink("./" . $imr->f(0)); $removeImage1 = @unlink("./" . $imr->f(1)); $removeImage2 = @unlink("./" . $imr->f(2)); $removeImage3 = @unlink("./" . $imr->f(3)); $removeImage4 = @unlink("./" . $imr->f(4)); if ($imr->f("status") == 1) { subtract_catcounts($imr->f("category")); } $imr->query("delete from listing_index where `ItemNum` = '" . $imr->f("ItemNum") . "'"); } unset($imr); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete"); $SQL = "DELETE FROM items WHERE " . $this->Where; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteDelete"); $this->query($SQL); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteDelete"); if ($this->Errors->Count() > 0) { $this->Errors->AddError($this->Errors->ToString()); } $del = new clsDBNetConnect(); $del->query("DELETE FROM custom_textarea_values WHERE ItemNum='" . $_GET["ItemNum"] . "'"); $del->query("DELETE FROM custom_textbox_values WHERE ItemNum='" . $_GET["ItemNum"] . "'"); $del->query("DELETE FROM custom_dropdown_values WHERE ItemNum='" . $_GET["ItemNum"] . "'"); $del->query("DELETE FROM listing_index WHERE ItemNum='" . $_GET["ItemNum"] . "'"); }
function Show() { global $Tpl; if (!$this->Visible) { return; } $ShownRecords = 0; $CounterItems = 1; $this->ds->Prepare(); $this->ds->Open(); $GridBlock = "Grid " . $this->ComponentName; $Tpl->block_path = $GridBlock; $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"; $Tpl->SetVar("breaker", ""); if ($CounterItems % 4 == 0) { $Tpl->SetVar("breaker", "</tr><tr>"); } $CounterItems++; $catdb1 = new clsDBNetConnect(); $catdb1->connect(); $newSQL1 = "SELECT cat_id, name FROM categories WHERE sub_cat_id='" . $this->ds->cat_id->GetValue() . "'"; $incat = ""; $catdb1->query($newSQL1); while ($catdb1->next_record()) { $incat .= "<br> <img src=images/browse_bullet.gif> <a href='ViewCat.php?CatID=" . $catdb1->f(0) . "'>" . $catdb1->f(1) . "</a> "; $catdb2 = new clsDBNetConnect(); $catdb2->connect(); $newSQL2 = "SELECT cat_id, name FROM categories WHERE sub_cat_id='" . $catdb1->f(0) . "'"; $catdb2->query($newSQL2); while ($catdb2->next_record()) { $incat .= "<br> <img src=images/browse_bullet.gif><img src=images/browse_bullet.gif> <a href='ViewCat.php?CatID=" . $catdb2->f(0) . "'>" . $catdb2->f(1) . "</a> "; $catdb3 = new clsDBNetConnect(); $catdb3->connect(); $newSQL3 = "SELECT cat_id, name FROM categories WHERE sub_cat_id='" . $catdb2->f(0) . "'"; $catdb3->query($newSQL3); while ($catdb3->next_record()) { $incat .= "<br> <img src=images/browse_bullet.gif><img src=images/browse_bullet.gif><img src=images/browse_bullet.gif> <a href='ViewCat.php?CatID=" . $catdb3->f(0) . "'>" . $catdb3->f(1) . "</a> "; $catdb4 = new clsDBNetConnect(); $catdb4->connect(); $newSQL4 = "SELECT cat_id, name FROM categories WHERE sub_cat_id='" . $catdb3->f(0) . "'"; $catdb4->query($newSQL4); while ($catdb4->next_record()) { $incat .= "<br> <img src=images/browse_bullet.gif><img src=images/browse_bullet.gif><img src=images/browse_bullet.gif><img src=images/browse_bullet.gif> <a href='ViewCat.php?CatID=" . $catdb4->f(0) . "'>" . $catdb4->f(1) . "</a> "; $catdb5 = new clsDBNetConnect(); $catdb5->connect(); $newSQL5 = "SELECT cat_id, name FROM categories WHERE sub_cat_id='" . $catdb4->f(0) . "'"; $catdb5->query($newSQL5); while ($catdb5->next_record()) { $incat .= "<br> <img src=images/browse_bullet.gif><img src=images/browse_bullet.gif><img src=images/browse_bullet.gif><img src=images/browse_bullet.gif><img src=images/browse_bullet.gif> <a href='ViewCat.php?CatID=" . $catdb5->f(0) . "'>" . $catdb5->f(1) . "</a> "; } } } } } $this->cat_id->SetValue($this->ds->cat_id->GetValue()); $this->name->SetValue($this->ds->name->GetValue() . " (" . CatCount($this->ds->cat_id->GetValue()) . ")"); $this->subs->SetValue($incat); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow"); $Tpl->SetVar("Count", ""); $this->cat_id->Show(); $this->name->Show(); $this->subs->Show(); $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->parse("NoRecords", false); } $Tpl->parse("", false); $Tpl->block_path = ""; }
} } $EP["EMAIL:PAYMENT_SUBJECT"] = "PayPal Subscription"; $EP["EMAIL:PAYMENT_AMOUNT"] = $charges["currency"] . $payment_gross; $EP["EMAIL:PAYER_EMAIL"] = $payer_email; $EP["EMAIL:CURRENT_USERNAME"] = $ld["user_login"]; $EP["EMAIL:CURRENT_USERID"] = $ld["ID"]; $EP["EMAIL:CURRENT_USER_FIRST_NAME"] = $ld["first"]; $EP["EMAIL:CURRENT_USER_LAST_NAME"] = $ld["last"]; $EP["EMAIL:CURRENT_USER_EMAIL"] = $ld["email"]; $EP["EMAIL:CURRENT_USER_ADDRESS"] = $ld["address"]; $EP["EMAIL:CURRENT_USER_ADDRESS2"] = $ld["address2"]; $EP["EMAIL:CURRENT_USER_STATE"] = $ld["state"]; $EP["EMAIL:CURRENT_USER_CITY"] = $ld["city"]; $EP["EMAIL:CURRENT_USER_ZIP"] = $ld["zip"]; $EP["EMAIL:CURRENT_USER_DAY_PHONE"] = $ld["phonedy"]; $EP["EMAIL:CURRENT_USER_EVN_PHONE"] = $ld["phoneevn"]; $EP["EMAIL:CURRENT_USER_FAX"] = $ld["fax"]; $EP["EMAIL:CURRENT_USER_IP"] = getenv("REMOTE_ADDR"); $EP["EMAIL:CURRENT_USER__REGISTERED_IP"] = $ld["ip"]; $EP["EMAIL:CURRENT_USER_DATE_SIGNEDUP"] = date("F j, Y, g:i a", $ld["date_created"]); mailout("NewSubscribe", $now["notifyads"], $payer_id, 1000000000, time(), $EP); } else { if ($receiver_email == $accounting["paypal"]) { mailout("MakePaymentPaypal", 1, $payer_id, 1000000000, time(), $EP); $db4 = new clsDBNetConnect(); $db4->connect(); $db4->query("INSERT INTO charges (user_id, date, charge, cause) VALUES ('" . $payer_id . "', '" . time() . "', '" . $payment_gross . "', 'PayPal Deposit')"); } } }
function Show() { global $startpage; global $Tpl; global $now; global $terms; if (!$this->Visible) { return; } $ShownRecords = 0; $featcount = 0; $this->ds->Parameters["urls_title"] = CCGetFromGet("s_title", ""); $this->ds->Parameters["urls_description"] = CCGetFromGet("s_description", ""); $this->ds->Parameters["urlShowFeatured"] = CCGetFromGet("ShowFeatured", ""); if (CCGetFromGet("CatID", "") || $terms["CatID"]) { $catdb1 = new clsDBNetConnect(); $catdb1->connect(); $newSQL1 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . CCGetFromGet("CatID", "") . "'"; $incat = "'" . CCGetFromGet("CatID", "") . "'"; if ($terms["CatID"]) { $newSQL1 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $terms["CatID"] . "'"; $incat = "'" . $terms["CatID"] . "'"; } $catdb1->query($newSQL1); while ($catdb1->next_record()) { $incat .= " OR category='" . $catdb1->f(0) . "'"; $catdb2 = new clsDBNetConnect(); $catdb2->connect(); $newSQL2 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb1->f(0) . "'"; $catdb2->query($newSQL2); while ($catdb2->next_record()) { $incat .= " OR category='" . $catdb2->f(0) . "'"; $catdb3 = new clsDBNetConnect(); $catdb3->connect(); $newSQL3 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb2->f(0) . "'"; $catdb3->query($newSQL3); while ($catdb3->next_record()) { $incat .= " OR category='" . $catdb3->f(0) . "'"; $catdb4 = new clsDBNetConnect(); $catdb4->connect(); $newSQL4 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb3->f(0) . "'"; $catdb4->query($newSQL4); while ($catdb4->next_record()) { $incat .= " OR category='" . $catdb4->f(0) . "'"; $catdb5 = new clsDBNetConnect(); $catdb5->connect(); $newSQL5 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb4->f(0) . "'"; $catdb5->query($newSQL5); while ($catdb5->next_record()) { $incat .= " OR category='" . $catdb5->f(0) . "'"; } } } } } } //print $incat; $this->ds->Parameters["urlCatID"] = $incat; //CCGetFromGet("CatID", ""); $this->ds->Parameters["urls_ItemNum"] = CCGetFromGet("s_ItemNum", ""); if ($_GET["s_user_id"]) { $userfind = $_GET["s_user_id"]; $findDB = new clsDBNetConnect(); $GetUser = CCDlookUP("user_id", "users", "user_login='******'", $findDB); if ($GetUser == NULL) { $GetUser = 1000000000000.0; } } if (CCGetFromGet("User_ID", "")) { $GetUser = CCGetFromGet("User_ID", ""); } $this->ds->Parameters["urls_user_id"] = $GetUser; $this->ds->Parameters["urls_asking_min"] = CCGetFromGet("s_asking_min", ""); $this->ds->Parameters["urls_asking_max"] = CCGetFromGet("s_asking_max", ""); $this->ds->Parameters["urls_make_offer"] = CCGetFromGet("s_make_offer", ""); $this->ds->Parameters["urls_quantity"] = CCGetFromGet("s_quantity", ""); $this->ds->Parameters["urls_city_town"] = CCGetFromGet("s_city_town", ""); $this->ds->Parameters["urls_state_province"] = CCGetFromGet("s_state_province", ""); $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->image_one->SetValue(""); if ($this->ds->cat_featured->GetValue() == 1 && $featcount == 0) { $Tpl->SetVar("beginFeat", "<tr><td class=\"feat\" height=\"27\" colspan=\"6\"> Featured Items</td></tr>"); $featcount++; } if ($this->ds->cat_featured->GetValue() < 1 && $featcount == 1) { $this->image_one->SetValue("<tr class=\"wtbk\"><td colspan=\"6\"> </td><tr><td class=\"feat\" height=\"27\" colspan=\"6\"> End of Featured Items</td></tr>"); $featuredcounter++; $featcount++; } if ($this->ds->cat_featured->GetValue() == 1) { $uncount++; } if ($this->ds->bold->GetValue() == 1) { $this->bold2->SetValue("</b>"); $this->bold->SetValue("<b>"); } else { $this->bold2->SetValue(""); $this->bold->SetValue(""); } if ($this->ds->background->GetValue() == 1) { $this->background->SetValue("bgcolor=\"#FFFFC0\""); } else { $this->background->SetValue("class=\"wtbk\""); } if ($this->ds->image_preview->GetValue() == 1 && $this->ds->image_one->GetValue() != "") { if ($now["has_gd"]) { $this->image_preview->SetValue("<table bgcolor=\"#000000\" border=\"0\" width=\"78\" height=\"75\" cellspacing=\"1\" cellpadding=\"0\"><tr><td width=\"75\" height=\"75\" valign=\"middle\" align=\"center\" bgcolor=\"#FFFFFF\"><a href=\"ViewItem.php?ItemNum=" . $this->ds->ItemNum->GetValue() . "\" border=0><img src=\"imageresizer.php?heightsize=75&widthsize=75&filename=" . $this->ds->image_one->GetValue() . "\" border=0 /></a></td></tr></table>"); } else { $this->image_preview->SetValue("<table bgcolor=\"#000000\" border=\"0\" width=\"78\" height=\"75\" cellspacing=\"1\" cellpadding=\"0\"><tr><td width=\"75\" height=\"75\" valign=\"middle\" align=\"center\" bgcolor=\"#FFFFFF\"><a href=\"ViewItem.php?ItemNum=" . $this->ds->ItemNum->GetValue() . "\" border=0>" . thumbnail($this->ds->image_one->GetValue(), 75, 75, 0, 0) . "</a></td></tr></table>"); } } elseif ($this->ds->image_one->GetValue() != "") { $this->image_preview->SetValue("<img src=\"images/apic.gif\">"); } else { $this->image_preview->SetValue(""); } $this->ItemNum->SetValue($this->ds->ItemNum->GetValue()); $this->title->SetValue($this->ds->title->GetValue()); if ($this->ds->make_offer->GetValue() == 1) { $this->make_offer->SetValue(" <font color=#ff0000>(Make Offer)</font>"); } else { $this->make_offer->SetValue(""); } if ($this->ds->city_town->GetValue() != "") { $this->city_town->SetValue($this->ds->city_town->GetValue() . ", "); } else { $this->city_town->SetValue($this->ds->city_town->GetValue()); } $this->state_province->SetValue($this->ds->state_province->GetValue()); $this->asking_price->SetValue($this->ds->asking_price->GetValue()); $theday = getdate($this->ds->started->GetValue()); $lastofyear = substr($theday["year"], -2); $enddate = $theday["mon"] . "/" . $theday["mday"] . "/" . $lastofyear; $this->started->SetValue($enddate); unset($newdate); unset($theday); unset($lastofyear); unset($enddate); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow"); $this->bold->Show(); $this->bold2->Show(); $this->background->Show(); $this->image_preview->Show(); $this->image_one->Show(); $this->ItemNum->Show(); $this->title->Show(); $this->make_offer->Show(); $this->city_town->Show(); $this->state_province->Show(); $this->asking_price->Show(); $this->started->Show(); $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("CloseFeat", "<tr class=\"wtbk\"><td class=\"feat\" colspan=\"6\">End of Featured Items</td></tr>"); $Tpl->parse("NoRecords", false); } $this->Navigator->TotalPages = $this->ds->PageCount(); $this->gallerylink->Show(); $this->Sorter_title->Show(); $this->Sorter_started->Show(); $this->Sorter_asking_price->Show(); $this->Sorter_location->Show(); $this->Navigator->Show(); if ($uncount == 1) { $Tpl->SetVar("CloseFeat2", "<tr class=\"wtbk\"><td colspan=\"6\"> </td></tr><tr><td class=\"feat\" colspan=\"6\">End of Featured Items</td></tr>"); } $Tpl->parse("", false); $Tpl->block_path = ""; //Print stopwatch($startpage); }
function Show() { global $Tpl; global $now; if (!$this->Visible) { return; } $ShownRecords = 0; $this->ds->Parameters["sesUserID"] = CCGetSession("UserID"); $this->ds->Prepare(); $this->ds->Open(); $GridBlock = "Grid " . $this->ComponentName; $Tpl->block_path = $GridBlock; $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"; if ($this->ds->been_read->GetValue() == 1) { $this->been_read->SetValue("class=\"ltdt\""); } else { $this->been_read->SetValue(""); } $this->subject->SetValue($this->ds->subject->GetValue()); $twodays = $this->ds->emaildate->GetValue(); $theday = getdate($twodays); $lastofyear = substr($theday["year"], -2); $enddate = $theday["mon"] . "/" . $theday["mday"] . "/" . $lastofyear; $this->emaildate->SetValue(date("F j, Y, g:i a", $this->ds->emaildate->GetValue())); if ($this->ds->from_user_id->GetValue() != "" && is_numeric($this->ds->from_user_id->GetValue()) && $this->ds->from_user_id->GetValue() != 1000000000) { $lookupdb = new clsDBNetConnect(); $lookupdb->connect(); $thename = CCDLookUp("user_login", "users", "user_id='" . $this->ds->from_user_id->GetValue() . "'", $lookupdb); $this->from_user_id->SetValue($thename); unset($lookupdb); } else { $this->from_user_id->SetValue($now["sitename"]); } $this->email_id->SetValue($this->ds->email_id->GetValue()); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow"); $this->been_read->Show(); $this->subject->Show(); $this->emaildate->Show(); $this->from_user_id->Show(); $this->email_id->Show(); $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->parse("NoRecords", false); } $this->Navigator->TotalPages = $this->ds->PageCount(); $this->Sorter_subject->Show(); $this->Sorter_emaildate->Show(); $this->Navigator->Show(); $Tpl->parse("", false); $Tpl->block_path = ""; }
function InsertRow() { global $finalamount; global $charges; global $EP; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert"); $this->ds->charge->SetValue($finalamount); $this->ds->FirstName->SetValue($this->FirstName->GetValue()); $this->ds->LastName->SetValue($this->LastName->GetValue()); $this->ds->CCNumber->SetValue($this->CCNumber->GetValue()); $this->ds->ExpDate->SetValue($this->ExpDate->GetValue()); $this->ds->CardCode->SetValue($this->CardCode->GetValue()); $this->ds->user_id->SetValue(CCGetUserID()); $this->ds->date->SetValue(time()); $this->ds->cause->SetValue("Credit Card Payment--Subscription"); $this->ds->Insert(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert"); $lookdb = new clsDBNetConnect; $lookdb->connect(); $lookdb->query("SELECT * FROM users WHERE user_login='******'"); if($lookdb->next_record()) { $ld = array( "first" => $lookdb->f("first_name"), "ID" => $lookdb->f("user_id"), "last" => $lookdb->f("last_name"), "email" => $lookdb->f("email"), "address" => $lookdb->f("address1"), "address2" => $lookdb->f("address2"), "state" => $lookdb->f("state_id"), "zip" => $lookdb->f("zip"), "city" => $lookdb->f("city"), "phonedy" => $lookdb->f("phone_day"), "phoneevn" => $lookdb->f("phone_evn"), "fax" => $lookdb->f("fax"), "ip" => $lookdb->f("ip_insert"), "date_created" => $lookdb->f("date_created"), ); } $EP["EMAIL:PAYMENT_SUBJECT"] = "Credit Card Deposit"; $EP["EMAIL:PAYMENT_AMOUNT"] = $charges["currency"] . $finalamount; $EP["EMAIL:CURRENT_USERNAME"] = CCGetUserLogin(); $EP["EMAIL:CURRENT_USERID"] = $ld["ID"]; $EP["EMAIL:CURRENT_USER_FIRST_NAME"] = $ld["first"]; $EP["EMAIL:CURRENT_USER_LAST_NAME"] = $ld["last"]; $EP["EMAIL:CURRENT_USER_EMAIL"] = $ld["email"]; $EP["EMAIL:CURRENT_USER_ADDRESS"] = $ld["address"]; $EP["EMAIL:CURRENT_USER_ADDRESS2"] = $ld["address2"]; $EP["EMAIL:CURRENT_USER_STATE"] = $ld["state"]; $EP["EMAIL:CURRENT_USER_CITY"] = $ld["city"]; $EP["EMAIL:CURRENT_USER_ZIP"] = $ld["zip"]; $EP["EMAIL:CURRENT_USER_DAY_PHONE"] = $ld["phonedy"]; $EP["EMAIL:CURRENT_USER_EVN_PHONE"] = $ld["phoneevn"]; $EP["EMAIL:CURRENT_USER_FAX"] = $ld["fax"]; $EP["EMAIL:CURRENT_USER_IP"] = getenv("REMOTE_ADDR"); $EP["EMAIL:CURRENT_USER__REGISTERED_IP"] = $ld["ip"]; $EP["EMAIL:CURRENT_USER_DATE_SIGNEDUP"] = date("F j, Y, g:i a", $ld["date_created"]); mailout("NewSubscribe", $now["notifyads"], $payer_id, 1000000000, time(), $EP); if($this->ds->Errors->Count() > 0) { echo "Error in Record " . $this->ComponentName . " / Insert Operation"; $this->ds->Errors->Clear(); $this->Errors->AddError("Database command error."); } return ($this->Errors->Count() == 0); }
function Show() { global $Tpl; global $FileName; global $carrys; global $now; global $NoShow; global $emails2; $Error = ""; if (!$this->Visible) { return; } if (!CCGetFromGet("email_id", "")) { $emails2->Visible = false; } $this->ds->open(); $RecordBlock = "Record " . $this->ComponentName; $Tpl->block_path = $RecordBlock; if ($this->EditMode) { if ($this->Errors->Count() == 0) { if ($this->ds->Errors->Count() > 0) { echo "Error in Record emails"; } else { if ($this->ds->next_record()) { $this->ds->SetValues(); if ($this->ds->from_user_id->GetValue() != "" && is_numeric($this->ds->from_user_id->GetValue()) && $this->ds->from_user_id->GetValue() != 1000000000) { $lookupdb = new clsDBNetConnect(); $lookupdb->connect(); $thename = CCDLookUp("user_login", "users", "user_id='" . $this->ds->from_user_id->GetValue() . "'", $lookupdb); $this->from_user_id->SetValue($thename); unset($lookupdb); $NoShow = true; $emails2->Visible = true; } else { $this->from_user_id->SetValue($now["sitename"]); $NoShow = false; $emails2->Visible = false; } $updb = new clsDBNetConnect(); $updb->connect(); if (CCGetFromGet("email_id", "")) { $rawsql = "UPDATE emails SET been_read='1' WHERE email_id='" . CCGetFromGet("email_id", "") . "' AND to_user_id='" . CCGetUserID() . "'"; $updb->query($rawsql); } $twodays = $this->ds->emaildate->GetValue(); $theday = getdate($twodays); $lastofyear = substr($theday["year"], -2); $enddate = $theday["mon"] . "/" . $theday["mday"] . "/" . $lastofyear; $this->emaildate->SetValue(date("F j, Y, g:i a", $this->ds->emaildate->GetValue())); $this->subject->SetValue($this->ds->subject->GetValue()); $this->message->SetValue(nl2br($this->ds->message->GetValue())); $Tpl->SetVar("ReplyToID", $this->ds->from_user_id->GetValue()); $Tpl->SetVar("SUB", $this->ds->subject->GetValue()); $Tpl->SetVar("TheUser", CCGetUserLogin()); $carrys = array("TheDate" => date("m/d/y"), "TheUser" => CCGetUserLogin(), "TheSender" => $thename, "TheSenderID" => $this->ds->from_user_id->GetValue(), "TheOriDate" => $enddate, "originalsubject" => $this->ds->subject->GetValue(), "TheMessage" => $this->ds->message->GetValue(), "NoShow" => $NoShow, "sitename" => $now["sitename"]); if (!$this->FormSubmitted) { } } else { $this->EditMode = false; $emails2->Visible = false; } } } } $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); if ($this->FormSubmitted) { $Error .= $this->from_user_id->Errors->ToString(); $Error .= $this->emaildate->Errors->ToString(); $Error .= $this->subject->Errors->ToString(); $Error .= $this->message->Errors->ToString(); $Error .= $this->Errors->ToString(); $Error .= $this->ds->Errors->ToString(); $Tpl->SetVar("Error", $Error); $Tpl->Parse("Error", false); } $Tpl->SetVar("Action", $this->HTMLFormAction); $this->from_user_id->Show(); $this->emaildate->Show(); $this->subject->Show(); $this->message->Show(); $this->cancel->Show(); $this->Delete->Show(); $Tpl->parse("", false); $Tpl->block_path = ""; }
function buildcats($box2,$box3,$box4,$box5,$selected2,$selected3,$selected4,$selected5) { global $Tpl; global $Item_Number; $valid = ""; if ($_REQUEST["adminkey"]) { $admin = new clsDBNetConnect; $query = "select * from administrators"; $admin->query($query); while ($admin->next_record()){ $key = md5($admin->f("username") . "AdMin kkkkkey" . $admin->f("password")); if ($key == $_REQUEST["adminkey"]) $valid = $key; } } if($_REQUEST["Item_Number"]){ $item = new clsDBNetConnect; $item->query("select cat_id, name from categories cat, items i where ItemNum='" . $_REQUEST["Item_Number"] . "' and i.category=cat.cat_id"); if ($item->next_record()) { $keepcat = "<input type=\"submit\" value=\"Continue Without Changing the Category\" name=\"Submit\">"; $selected1 = $item->f("cat_id"); $current_cat = $item->f("name"); } if (!$box2){ $groups = new clsDBNetConnect; $sql = "select * from categories where cat_id = '" . $selected1 . "'"; $groups->query($sql); $groups->next_record(); if ($groups->f("sub_cat_id") > 1) { $cat1 = $groups->f("sub_cat_id"); $sql = "select * from categories where cat_id = '" . $groups->f("sub_cat_id") . "'"; $groups->query($sql); $groups->next_record(); if ($groups->f("sub_cat_id") > 1) { $cat2 = $groups->f("sub_cat_id"); $sql = "select * from categories where cat_id = '" . $groups->f("sub_cat_id") . "'"; $groups->query($sql); $groups->next_record(); if ($groups->f("sub_cat_id") > 1) { $cat3 = $groups->f("sub_cat_id"); $sql = "select * from categories where cat_id = '" . $groups->f("sub_cat_id") . "'"; $groups->query($sql); $groups->next_record(); if ($groups->f("sub_cat_id") > 1) { $cat4 = $groups->f("sub_cat_id"); $sql = "select * from categories where cat_id = '" . $groups->f("sub_cat_id") . "'"; $groups->query($sql); $groups->next_record(); if ($groups->f("sub_cat_id") > 1) { $cat5 = $groups->f("sub_cat_id"); $sql = "select * from categories where cat_id = '" . $groups->f("sub_cat_id") . "'"; $groups->query($sql); $groups->next_record(); } } } } } if ($selected1 && !$cat1 && !$cat2 && !$cat3 && !$cat4 && !$cat5) $urlstring = "Item_Number=" . $_REQUEST["Item_Number"] . "&box2=1&selected2=$selected1&adminkey=$valid"; if ($selected1 && $cat1 && !$cat2 && !$cat3 && !$cat4 && !$cat5) $urlstring = "Item_Number=" . $_REQUEST["Item_Number"] . "&box2=1&selected2=$cat1&box3=1&selected3=$selected1&adminkey=$valid"; if ($selected1 && $cat1 && $cat2 && !$cat3 && !$cat4 && !$cat5) $urlstring = "Item_Number=" . $_REQUEST["Item_Number"] . "&box2=1&selected2=$cat2&box3=1&selected3=$cat1&box4=1&selected4=$selected1&adminkey=$valid"; if ($selected1 && $cat1 && $cat2 && $cat3 && !$cat4 && !$cat5) $urlstring = "Item_Number=" . $_REQUEST["Item_Number"] . "&box2=1&selected2=$cat3&box3=1&selected3=$cat2&box4=1&selected4=$cat1&box5=1&selected5=$selected1&adminkey=$valid"; if ($selected1 && $cat1 && $cat2 && $cat3 && $cat4 && !$cat5) $urlstring = "Item_Number=" . $_REQUEST["Item_Number"] . "&box2=1&selected2=$cat4&box3=1&selected3=$cat3&box4=1&selected4=$cat2&box5=1&selected5=$cat1&box6=1&selected6=$selected1&adminkey=$valid"; if ($selected1 && $cat1 && $cat2 && $cat3 && $cat4 && $cat5) $urlstring = "Item_Number=" . $_REQUEST["Item_Number"] . "&box2=1&selected2=$cat5&box3=1&selected3=$cat4&box4=1&selected4=$cat3&box5=1&selected5=$cat2&box6=1&selected6=$cat1&box7=1&selected7=$selected1&adminkey=$valid"; header("Location: catlist.php?" . $urlstring); } } include ("./Config/vars.php"); $conn=mysql_connect($dbs["DB_HOST"],$dbs["DB_USER"],$dbs["DB_PASS"]); if (!$Item_Number && !$valid) { $jscript = <<<EOD function loadPage1(list,selected1) { location="./catlist.php?box2=1&selected2="+list.options[list.selectedIndex].value; } function loadPage2(list,selected1,selected2) { location="./catlist.php?box2=1&box3=1&selected2=$selected2&selected3="+list.options[list.selectedIndex].value; } function loadPage3(list,selected1,selected2,selected3) { location="./catlist.php?box2=1&box3=1&box4=1&selected2=$selected2&selected3=$selected3&selected4="+list.options[list.selectedIndex].value; } function loadPage4(list,selected1,selected2,selected3,selected4) { location="./catlist.php?box2=1&box3=1&box4=1&box5=1&selected2=$selected2&selected3=$selected3&selected4=$selected4&selected5="+list.options[list.selectedIndex].value; } function loadPage5(list,selected1,selected2,selected3,selected4,selected5) { location="./newitem.php?finalcat="+list.options[list.selectedIndex].value; } EOD; } elseif ($valid && !$Item_Number) { $jscript = <<<EOD function loadPage1(list,selected1) { location="./catlist.php?adminkey=$valid&box2=1&selected2="+list.options[list.selectedIndex].value; } function loadPage2(list,selected1,selected2) { location="./catlist.php?adminkey=$valid&box2=1&box3=1&selected2=$selected2&selected3="+list.options[list.selectedIndex].value; } function loadPage3(list,selected1,selected2,selected3) { location="./catlist.php?adminkey=$valid&box2=1&box3=1&box4=1&selected2=$selected2&selected3=$selected3&selected4="+list.options[list.selectedIndex].value; } function loadPage4(list,selected1,selected2,selected3,selected4) { location="./catlist.php?adminkey=$valid&box2=1&box3=1&box4=1&box5=1&selected2=$selected2&selected3=$selected3&selected4=$selected4&selected5="+list.options[list.selectedIndex].value; } function loadPage5(list,selected1,selected2,selected3,selected4,selected5) { location="./newitem.php?adminkey=$valid&finalcat="+list.options[list.selectedIndex].value; } EOD; } elseif (!$valid && $Item_Number) { $jscript = <<<EOD function loadPage1(list,selected1) { location="./catlist.php?Item_Number=$Item_Number&box2=1&selected2="+list.options[list.selectedIndex].value; } function loadPage2(list,selected1,selected2) { location="./catlist.php?Item_Number=$Item_Number&box2=1&box3=1&selected2=$selected2&selected3="+list.options[list.selectedIndex].value; } function loadPage3(list,selected1,selected2,selected3) { location="./catlist.php?Item_Number=$Item_Number&box2=1&box3=1&box4=1&selected2=$selected2&selected3=$selected3&selected4="+list.options[list.selectedIndex].value; } function loadPage4(list,selected1,selected2,selected3,selected4) { location="./catlist.php?Item_Number=$Item_Number&box2=1&box3=1&box4=1&box5=1&selected2=$selected2&selected3=$selected3&selected4=$selected4&selected5="+list.options[list.selectedIndex].value; } function loadPage5(list,selected1,selected2,selected3,selected4,selected5) { location="./newitem.php?Item_Number=$Item_Number&finalcat="+list.options[list.selectedIndex].value; } EOD; } elseif ($valid && $Item_Number) { $jscript = <<<EOD function loadPage1(list,selected1) { location="./catlist.php?adminkey=$valid&Item_Number=$Item_Number&box2=1&selected2="+list.options[list.selectedIndex].value; } function loadPage2(list,selected1,selected2) { location="./catlist.php?adminkey=$valid&Item_Number=$Item_Number&box2=1&box3=1&selected2=$selected2&selected3="+list.options[list.selectedIndex].value; } function loadPage3(list,selected1,selected2,selected3) { location="./catlist.php?adminkey=$valid&Item_Number=$Item_Number&box2=1&box3=1&box4=1&selected2=$selected2&selected3=$selected3&selected4="+list.options[list.selectedIndex].value; } function loadPage4(list,selected1,selected2,selected3,selected4) { location="./catlist.php?adminkey=$valid&Item_Number=$Item_Number&box2=1&box3=1&box4=1&box5=1&selected2=$selected2&selected3=$selected3&selected4=$selected4&selected5="+list.options[list.selectedIndex].value; } function loadPage5(list,selected1,selected2,selected3,selected4,selected5) { location="./newitem.php?adminkey=$valid&Item_Number=$Item_Number&finalcat="+list.options[list.selectedIndex].value; } EOD; } $Tpl->SetVar("jscript",$jscript); if (!$selected1) $selected1=1; $onchange = "onchange=\"loadPage1(this.form.elements[0],1)\""; if ($valid || in_array("SuperUser", groupmemberships())) $sql = "SELECT * from categories where sub_cat_id = 1 ORDER BY `weight`, `name` ASC"; else $sql = "SELECT distinct cat.cat_id, cat.name, cat.sub_cat_id FROM categories cat, groups_users gu, groups_categories gc WHERE gu.user_id = '" . CCGetSession("UserID") . "' and gu.group_id = gc.group_id and gc.cat_id=cat.cat_id and cat.sub_cat_id=1 order by weight, name ASC"; $groups = new clsDBNetConnect(); $groups->connect(); $groups->query($sql); $options= ""; while ($groups->next_record()){ if ($groups->f("cat_id")==1) $current_cat = $groups->f("name"); $id = $groups->f("cat_id"); $name = $groups->f("name"); if ($id == $selected2) { $options = $options . "<option selected value=\"$id\">$name</option>"; } else { $options = $options . "<option value=\"$id\">$name</option>"; } } $Tpl->SetVar("onchange1",$onchange); $Tpl->SetVar("options1",$options); $Tpl->SetVar("current_cat",$current_cat); $Tpl->SetVar("button","$keepcat"); $Tpl->SetVar("adminkey", $valid); $Tpl->SetVar("action","newitem.php?Item_Number=$Item_Number&finalcat=$selected1"); if ($box2 == 1 && check_cat_permission($selected2)) { $onchange = "onchange=\"loadPage2(this.form.elements[1],1,$selected2)\""; $query = "select * from categories where sub_cat_id = $selected2 ORDER BY `weight`, `name` ASC"; $result = mysql_db_query($dbs["DB_NAME"],$query,$conn) or die ("Error in query: $query.2" . mysql_error()); $query = "select name from categories where cat_id = $selected2"; $name = mysql_db_query($dbs["DB_NAME"],$query,$conn) or die ("Error in query: $query.2" . mysql_error()); $name = mysql_fetch_array($name); $current_cat = $name["name"]; $options= ""; while ($cat = mysql_fetch_array($result)) { $id = $cat["cat_id"]; $name = $cat["name"]; if ($id == $selected3) { $options = $options . "<option selected value=\"$id\">$name</option>"; } else { $options = $options . "<option value=\"$id\">$name</option>"; } } $Tpl->SetVar("onchange2",$onchange); $Tpl->SetVar("options2",$options); $Tpl->SetVar("current_cat",$current_cat); $Tpl->SetVar("adminkey", $valid); $Tpl->SetVar("button","<input type=\"submit\" value=\"Create Item in this Category\" name=\"Submit\">"); $Tpl->SetVar("action","newitem.php?Item_Number=$Item_Number&finalcat=$selected2"); } if ($box3 == 1 && check_cat_permission($selected3)) { $onchange = "onchange=\"loadPage3(this.form.elements[2],1,$selected2,$selected3)\""; $query = "select * from categories where sub_cat_id = $selected3 ORDER BY `weight`, `name` ASC"; $result = mysql_db_query($dbs["DB_NAME"],$query,$conn) or die ("Error in query: $query.3" . mysql_error()); $query = "select name from categories where cat_id = $selected3"; $name = mysql_db_query($dbs["DB_NAME"],$query,$conn) or die ("Error in query: $query.3" . mysql_error()); $name = mysql_fetch_array($name); $current_cat = $name["name"]; $options= ""; while ($cat = mysql_fetch_array($result)) { $id = $cat["cat_id"]; $name = $cat["name"]; if ($id == $selected4) { $options = $options . "<option selected value=\"$id\">$name</option>"; } else { $options = $options . "<option value=\"$id\">$name</option>"; } } $Tpl->SetVar("onchange3",$onchange); $Tpl->SetVar("options3",$options); $Tpl->SetVar("current_cat",$current_cat); $Tpl->SetVar("button","<input type=\"submit\" value=\"Create Item in this Category\" name=\"Submit\">"); $Tpl->SetVar("action","newitem.php?Item_Number=$Item_Number&finalcat=$selected3"); } if ($box4 == 1 && check_cat_permission($selected4)) { $onchange = "onchange=\"loadPage4(this.form.elements[3],1,$selected2,$selected3,$selected4)\""; $query = "select * from categories where sub_cat_id = $selected4 ORDER BY `weight`, `name` ASC"; $result = mysql_db_query($dbs["DB_NAME"],$query,$conn) or die ("Error in query: $query.4" . mysql_error()); $query = "select name from categories where cat_id = $selected4"; $name = mysql_db_query($dbs["DB_NAME"],$query,$conn) or die ("Error in query: $query.4" . mysql_error()); $name = mysql_fetch_array($name); $current_cat = $name["name"]; $options= ""; while ($cat = mysql_fetch_array($result)) { $id = $cat["cat_id"]; $name = $cat["name"]; if ($id == $selected5) { $options = $options . "<option selected value=\"$id\">$name</option>"; } else { $options = $options . "<option value=\"$id\">$name</option>"; } } $Tpl->SetVar("onchange4",$onchange); $Tpl->SetVar("options4",$options); $Tpl->SetVar("current_cat",$current_cat); $Tpl->SetVar("button","<input type=\"submit\" value=\"Create Item in this Category\" name=\"Submit\">"); $Tpl->SetVar("action","newitem.php?Item_Number=$Item_Number&finalcat=$selected4"); } if ($box5 == 1 && check_cat_permission($selected5)) { $onchange = "onchange=\"loadPage5(this.form.elements[4],1,$selected2,$selected3,$selected4,$selected5)\""; $query = "select * from categories where sub_cat_id = $selected5 ORDER BY `weight`, `name` ASC"; $result = mysql_db_query($dbs["DB_NAME"],$query,$conn) or die ("Error in query: $query.5" . mysql_error()); $query = "select name from categories where cat_id = $selected5"; $name = mysql_db_query($dbs["DB_NAME"],$query,$conn) or die ("Error in query: $query.5" . mysql_error()); $name = mysql_fetch_array($name); $current_cat = $name["name"]; $options= ""; while ($cat = mysql_fetch_array($result)) { $id = $cat["cat_id"]; $name = $cat["name"]; $options = $options . "<option value=\"$id\">$name"; } $Tpl->SetVar("onchange5",$onchange); $Tpl->SetVar("options5",$options); $Tpl->SetVar("current_cat",$current_cat); $Tpl->SetVar("button","<input type=\"submit\" value=\"Create Item in this Category\" name=\"Submit\">"); $Tpl->SetVar("action","newitem.php?Item_Number=$Item_Number&finalcat=$selected5"); } }
function startlistingnow($ItemNum, $UserID) { global $now; global $EP; global $regcharges; CCSetSession("ItemNum", $ItemNum); $db = new clsDBNetConnect(); $db->connect(); $whereif = "ItemNum='" . $ItemNum . "'"; $days = CCDLookUp("close", "items", $whereif, $db); $dayslk = CCDLookUp("days", "lookup_listing_dates", "date_id='" . $days . "'", $db); $dayscal = 86400 * $dayslk + time(); $approval = groupApprovalSpec(); if ($approval["required"] && $now["approv_priority"] || $approval["required"] && !$now["approv_priority"] && !$approval["notrequired"]) { $stat = 99; } else { $stat = 1; } $sql = "select `acct_credit_used` from items where ItemNum = '" . $ItemNum . "'"; $db->query($sql); if ($db->next_record()) { if ($db->f("acct_credit_used") > 0) { $sql = "insert into `charges` (`user_id`, `date`, `charge`, `cause`) Values ('" . $UserID . "', '" . time() . "', '-" . $db->f("acct_credit_used") . "', 'Account Credit Used to Start Item Number: " . $ItemNum . "')"; $db->query($sql); } } $sql = "UPDATE items SET status='" . $stat . "', started=" . time() . ", closes=" . $dayscal . " WHERE ItemNum='" . $ItemNum . "'"; $db->query($sql); $sql = "select * from used_coupons where ItemNum = '" . $ItemNum . "'"; $db->query($sql); if ($db->next_record()) { $sql = "UPDATE used_coupons SET `used`='1' WHERE ItemNum='" . $ItemNum . "'"; $db->query($sql); } $sql = "select * from used_tokens where ItemNum = '" . $ItemNum . "'"; $db->query($sql); if ($db->next_record()) { $sql = "UPDATE used_tokens SET `date`='" . time() . "' WHERE ItemNum='" . $ItemNum . "'"; $db->query($sql); } unset($db); unset($sql); CCSetSession("RecentItemNum", ""); $lookdb = new clsDBNetConnect(); $lookdb->connect(); $lookdb->query("SELECT * FROM users WHERE user_id='" . $UserID . "'"); if ($lookdb->next_record()) { $ld = array("first" => $lookdb->f("first_name"), "ID" => $lookdb->f("user_id"), "user_password" => $lookdb->f("user_password"), "last" => $lookdb->f("last_name"), "email" => $lookdb->f("email"), "address" => $lookdb->f("address1"), "address2" => $lookdb->f("address2"), "state" => $lookdb->f("state_id"), "zip" => $lookdb->f("zip"), "city" => $lookdb->f("city"), "phonedy" => $lookdb->f("phone_day"), "phoneevn" => $lookdb->f("phone_evn"), "fax" => $lookdb->f("fax"), "ip" => $lookdb->f("ip_insert"), "date_created" => $lookdb->f("date_created")); } $nb = new clsDBNetConnect(); $nb->connect(); $nb->query("SELECT * FROM items WHERE " . $whereif); if ($nb->next_record()) { $ls = array("itemID" => $nb->f("itemID"), "ItemNum" => $nb->f("ItemNum"), "category" => $nb->f("category"), "title" => $nb->f("title"), "started" => $nb->f("started"), "close" => $nb->f("close"), "closes" => $nb->f("closes"), "bold" => $nb->f("bold"), "background" => $nb->f("background"), "cat_featured" => $nb->f("cat_featured"), "home_featured" => $nb->f("home_featured"), "gallery_featured" => $nb->f("gallery_featured"), "image_preview" => $nb->f("image_preview"), "slide_show" => $nb->f("slide_show"), "counter" => $nb->f("counter"), "make_offer" => $nb->f("make_offer"), "image_one" => $nb->f("image_one"), "image_two" => $nb->f("image_two"), "image_three" => $nb->f("image_three"), "image_four" => $nb->f("image_four"), "image_five" => $nb->f("image_five"), "asking_price" => $nb->f("asking_price"), "quantity" => $nb->f("quantity"), "city" => $nb->f("city_town"), "state" => $nb->f("state_province")); } $lbold = pode($ls["bold"], $regcharges["bold_fee"]); $lhome = pode($ls["home_featured"], $regcharges["home_fee"]); $lback = pode($ls["background"], $regcharges["high_fee"]); $lcat = pode($ls["cat_featured"], $regcharges["cat_fee"]); $lgal = pode($ls["gallery_featured"], $regcharges["gallery_fee"]); $lipre = pode($ls["image_preview"], $regcharges["image_pre_fee"]); $lslide = pode($ls["slide_show"], $regcharges["slide_fee"]); $lcount = pode($ls["counter"], $regcharges["counter_fee"]); $li1 = podeimg($ls["image_one"], $regcharges["upload_fee"]); $li2 = podeimg($ls["image_two"], $regcharges["upload_fee"]); $li3 = podeimg($ls["image_three"], $regcharges["upload_fee"]); $li4 = podeimg($ls["image_four"], $regcharges["upload_fee"]); $li5 = podeimg($ls["image_five"], $regcharges["upload_fee"]); if ($ls["make_offer"] == 1) { $make = "Make Offer"; } if ($ls["make_offer"] == 0) { $make = ""; } $gf1 = new clsDBNetConnect(); $gf1->connect(); $gf2 = new clsDBNetConnect(); $gf2->connect(); $gf3 = new clsDBNetConnect(); $gf3->connect(); $EP["EMAIL:AD_ITEM_NUMBER"] = $ls["ItemNum"]; $EP["EMAIL:AD_CATEGORY_ID"] = $ls["category"]; $EP["EMAIL:AD_CATEGORY"] = CCDLookUp("name", "categories", "cat_id='" . $ls["category"] . "'", $gf1); $EP["EMAIL:AD_TITLE"] = $ls["title"]; $EP["EMAIL:AD_STARTED"] = date("F j, Y, g:i a", $ls["started"]); $EP["EMAIL:AD_CLOSES"] = date("F j, Y, g:i a", $ls["closes"]); $EP["EMAIL:AD_DAYS_RUNNING"] = CCDLookUp("days", "lookup_listing_dates", "date_id='" . $ls["close"] . "'", $gf2); $EP["EMAIL:AD_BOLD_CHARGE"] = $lbold; $EP["EMAIL:AD_HIGHLIGHTED_CHARGE"] = $lback; $EP["EMAIL:AD_CATEGORY_FEATURED_CHARGE"] = $lcat; $EP["EMAIL:AD_GALLERY_CHARGE"] = $lgal; $EP["EMAIL:AD_IMAGE_PREVIEW_CHARGE"] = $lipre; $EP["EMAIL:AD_HOME_PAGE_CHARGE"] = $lhome; $EP["EMAIL:AD_SLIDE_SHOW_CHARGE"] = $lslide; $EP["EMAIL:AD_COUNTER_CHARGE"] = $lcount; $EP["EMAIL:AD_DAYS_FEE"] = CCDLookUp("fee", "lookup_listing_dates", "date_id='" . $ls["close"] . "'", $gf3); $EP["EMAIL:AD_IMAGE_ONE_CHARGE"] = $li1; $EP["EMAIL:AD_IMAGE_TWO_CHARGE"] = $li2; $EP["EMAIL:AD_IMAGE_THREE_CHARGE"] = $li3; $EP["EMAIL:AD_IMAGE_FOUR_CHARGE"] = $li4; $EP["EMAIL:AD_IMAGE_FIVE_CHARGE"] = $li5; $EP["EMAIL:AD_MAKE_OFFER"] = $make; $EP["EMAIL:AD_ASKING_PRICE"] = $ls["asking_price"]; $EP["EMAIL:AD_QUANTITY"] = $ls["quantity"]; $EP["EMAIL:AD_CITY"] = $ls["city"]; $EP["EMAIL:AD_STATE_PROVINCE"] = $ls["state"]; $EP["EMAIL:CURRENT_USERNAME"] = CCGetUserLogin(); $EP["EMAIL:CURRENT_USERID"] = $ld["ID"]; $EP["EMAIL:CURRENT_USER_PASSWORD"] = $ld["user_password"]; $EP["EMAIL:CURRENT_USER_FIRST_NAME"] = $ld["first"]; $EP["EMAIL:CURRENT_USER_LAST_NAME"] = $ld["last"]; $EP["EMAIL:CURRENT_USER_EMAIL"] = $ld["email"]; $EP["EMAIL:CURRENT_USER_ADDRESS"] = $ld["address"]; $EP["EMAIL:CURRENT_USER_ADDRESS2"] = $ld["address2"]; $EP["EMAIL:CURRENT_USER_STATE"] = $ld["state"]; $EP["EMAIL:CURRENT_USER_CITY"] = $ld["city"]; $EP["EMAIL:CURRENT_USER_ZIP"] = $ld["zip"]; $EP["EMAIL:CURRENT_USER_DAY_PHONE"] = $ld["phonedy"]; $EP["EMAIL:CURRENT_USER_EVN_PHONE"] = $ld["phoneevn"]; $EP["EMAIL:CURRENT_USER_FAX"] = $ld["fax"]; $EP["EMAIL:CURRENT_USER_IP"] = getenv("REMOTE_ADDR"); $EP["EMAIL:CURRENT_USER__REGISTERED_IP"] = $ld["ip"]; $EP["EMAIL:CURRENT_USER_DATE_SIGNEDUP"] = date("F j, Y, g:i a", $ld["date_created"]); if ($stat == 99) { mailout("NewListingApproval", $now["notifyads"], $ld["ID"], 1000000000, time(), $EP); } else { mailout("NewListing", $now["notifyads"], $ld["ID"], 1000000000, time(), $EP); index_listing($ItemNum); $db = new clsDBNetConnect(); $query = "Select * from custom_textarea_values where `ItemNum` = {$ItemNum}"; $db->query($query); while ($db->next_record()) { index_listing($ItemNum, $db->f("value"), "ta", $db->f("field_id")); } $query = "Select * from custom_textbox_values where `ItemNum` = {$ItemNum}"; $db->query($query); while ($db->next_record()) { index_listing($ItemNum, $db->f("value"), "tb", $db->f("field_id")); } $query = "Select * from custom_dropdown_values where `ItemNum` = {$ItemNum}"; $db->query($query); while ($db->next_record()) { index_listing($ItemNum, $db->f("option_id"), "dd", $db->f("field_id"), $db->f("option_id")); } add_catcounts($ls["category"]); } //End Custom Code return $stat; }
function UpdateRow() { global $closes; global $valid; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate"); $this->ds->category->SetValue($this->category->GetValue()); $this->ds->title->SetValue($this->title->GetValue()); $this->ds->item_paypal->SetValue($this->item_paypal->GetValue()); $this->ds->quantity->SetValue($this->quantity->GetValue()); $this->ds->ship1->SetValue($this->ship1->GetValue()); $this->ds->shipfee1->SetValue($this->shipfee1->GetValue()); $this->ds->ship2->SetValue($this->ship2->GetValue()); $this->ds->shipfee2->SetValue($this->shipfee2->GetValue()); $this->ds->ship3->SetValue($this->ship3->GetValue()); $this->ds->shipfee3->SetValue($this->shipfee3->GetValue()); $this->ds->ship4->SetValue($this->ship4->GetValue()); $this->ds->shipfee4->SetValue($this->shipfee4->GetValue()); $this->ds->ship5->SetValue($this->ship5->GetValue()); $this->ds->shipfee5->SetValue($this->shipfee5->GetValue()); if ($this->asking_price->GetValue() == NULL) { $Asking = 0.0; } elseif ($this->asking_price->GetValue() == 0) { $Asking = 0.0; } else { $Asking = $this->asking_price->GetValue(); } $this->ds->asking_price->SetValue($Asking); $this->ds->make_offer->SetValue($this->make_offer->GetValue()); $this->ds->description->SetValue($this->description->GetValue()); $this->ds->image_preview->SetValue($this->image_preview->GetValue()); $this->ds->slide_show->SetValue($this->slide_show->GetValue()); $this->ds->city_town->SetValue($this->city_town->GetValue()); $this->ds->state_province->SetValue($this->state_province->GetValue()); $this->ds->country->SetValue($this->country->GetValue()); if ($valid) { $this->ds->fakeuser->SetValue($this->fakeuser->GetValue()); $this->ds->startnow->SetValue($this->startnow->GetValue()); $this->ds->addtime->SetValue($this->addtime->GetValue()); } $tempdb = new clsDBNetConnect(); $tempdb->connect(); $this->ds->close->SetValue($this->close->GetValue()); $this->ds->closes->SetValue(86400 * CCDLookUp("days", "lookup_listing_dates", "date_id='" . $this->close->GetValue() . "'", $tempdb) + time()); $this->ds->started->SetValue(time()); $this->ds->home_featured->SetValue($this->home_featured->GetValue()); $this->ds->gallery_featured->SetValue($this->gallery_featured->GetValue()); $this->ds->cat_featured->SetValue($this->cat_featured->GetValue()); $this->ds->bold->SetValue($this->bold->GetValue()); $this->ds->background->SetValue($this->background->GetValue()); $this->ds->counter->SetValue($this->counter->GetValue()); $this->ds->ItemNum->SetValue($this->ItemNum->GetValue()); CCSetSession("RecentItemNum", $this->ItemNum->GetValue()); if (!$valid) { $this->ds->user_id->SetValue(CCGetUserID()); } else { $this->ds->user_id->SetValue($this->fakeuser->GetValue()); } $this->ds->status->SetValue(0); $this->ds->image_five->SetValue($this->image_five->GetValue()); $this->ds->image_four->SetValue($this->image_four->GetValue()); $this->ds->image_three->SetValue($this->image_three->GetValue()); $this->ds->image_two->SetValue($this->image_two->GetValue()); $this->ds->image_one->SetValue($this->image_one->GetValue()); $this->ds->Update(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate"); if ($this->ds->Errors->Count() > 0) { echo "Error in Record " . $this->ComponentName . " / Update Operation"; $this->ds->Errors->Clear(); $this->Errors->AddError("Database command error."); } return $this->Errors->Count() == 0; }
function InsertRow() { global $EP; global $now; $db2 = new clsDBNetConnect(); $db2->connect(); $EP["EMAIL:MAO_TO_SELLER_ID"] = $this->to_user_id->GetValue(); $EP["EMAIL:MAO_TO_SELLER_USERNAME"] = CCDLookUp("user_login", "users", "user_id='" . $this->to_user_id->GetValue() . "'", $db2); $EP["EMAIL:MAO_MESSAGE"] = $this->message->GetValue(); $EP["EMAIL:MAO_FROM_BUYER_ID"] = CCGetUserID(); $EP["EMAIL:MAO_FROM_BUYER_USERNAME"] = CCGetUserLogin(); $EP["EMAIL:MAO_ITEM_NUMBER"] = $this->item_id->GetValue(); $EP["EMAIL:MAO_TITLE"] = CCDLookUp("title", "items", "ItemNum='" . $this->item_id->GetValue() . "'", $db2); $EP["EMAIL:MAO_AMOUNT"] = $this->subject->GetValue(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert"); /* $this->ds->subject->SetValue($newsubject); $this->ds->message->SetValue($newmessage); $this->ds->item_id->SetValue($this->item_id->GetValue()); $this->ds->to_user_id->SetValue($this->to_user_id->GetValue()); $this->ds->from_user_id->SetValue(CCGetUserID()); $this->ds->emaildate->SetValue(time()); $this->ds->Insert(); */ mailout("MakeAnOffer", 0, $this->to_user_id->GetValue(), CCGetUserID(), time(), $EP); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert"); if ($this->ds->Errors->Count() > 0) { echo "Error in Record " . $this->ComponentName . " / Insert Operation"; $this->ds->Errors->Clear(); $this->Errors->AddError("Database command error."); } return $this->Errors->Count() == 0; }
function Validate() { global $now; $Validation = true; $Where = ""; $ckdb = new clsDBNetConnect(); $ckdb->connect(); if ($this->EditMode) { $Where = " AND NOT (" . $this->ds->Where . ")"; } if (CCDLookUp("COUNT(*)", "users", "user_login="******"The Username <b>\"" . $this->user_login->GetValue() . "\"</b> is already taken."); } if (CCDLookUp("COUNT(*)", "users", "email=" . $this->ds->ToSQL($this->email->GetValue(), $this->email->DataType) . $Where, $this->ds) > 0) { $this->email->Errors->addError("The Email Address <b>\"" . $this->email->GetValue() . "\"</b> is in use by another member."); } if ($now["bounceout"] == 1) { if ($this->age->GetValue() == $now["bouceout_id"]) { header("location: ./index.php"); exit; } } $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate"); $Validation = $this->user_login->Validate() && $Validation; $Validation = $this->email->Validate() && $Validation; $Validation = $this->first_name->Validate() && $Validation; $Validation = $this->last_name->Validate() && $Validation; $Validation = $this->address1->Validate() && $Validation; $Validation = $this->address2->Validate() && $Validation; $Validation = $this->city->Validate() && $Validation; $Validation = $this->state_id->Validate() && $Validation; $Validation = $this->zip->Validate() && $Validation; $Validation = $this->country_id->Validate() && $Validation; $Validation = $this->phone_day->Validate() && $Validation; $Validation = $this->phone_evn->Validate() && $Validation; $Validation = $this->fax->Validate() && $Validation; $Validation = $this->age->Validate() && $Validation; //$Validation = ($this->gender->Validate() && $Validation); //$Validation = ($this->education->Validate() && $Validation); //$Validation = ($this->income->Validate() && $Validation); //$Validation = ($this->newsletter->Validate() && $Validation); //$Validation = ($this->newstype->Validate() && $Validation); $Validation = $this->agreement_id->Validate() && $Validation; //$Validation = ($this->user_password->Validate() && $Validation); //$Validation = ($this->date_created->Validate() && $Validation); //$Validation = ($this->ip_insert->Validate() && $Validation); //$Validation = ($this->ip_update->Validate() && $Validation); //$Validation = ($this->status->Validate() && $Validation); return $this->Errors->Count() == 0 && $Validation; }
function Show() { global $Tpl; global $now; if (!$this->Visible) { return; } $ShownRecords = 0; $this->ds->Parameters["urls_title"] = CCGetFromGet("s_title", ""); $this->ds->Parameters["urls_description"] = CCGetFromGet("s_description", ""); $this->ds->Parameters["urlShowFeatured"] = CCGetFromGet("ShowFeatured", ""); if (CCGetFromGet("CatID", "")) { $catdb1 = new clsDBNetConnect(); $catdb1->connect(); $newSQL1 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . CCGetFromGet("CatID", "") . "'"; $incat = "'" . CCGetFromGet("CatID", "") . "'"; if ($terms["CatID"]) { $newSQL1 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $terms["CatID"] . "'"; $incat = "'" . $terms["CatID"] . "'"; } $catdb1->query($newSQL1); while ($catdb1->next_record()) { $incat .= " OR category='" . $catdb1->f(0) . "'"; $catdb2 = new clsDBNetConnect(); $catdb2->connect(); $newSQL2 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb1->f(0) . "'"; $catdb2->query($newSQL2); while ($catdb2->next_record()) { $incat .= " OR category='" . $catdb2->f(0) . "'"; $catdb3 = new clsDBNetConnect(); $catdb3->connect(); $newSQL3 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb2->f(0) . "'"; $catdb3->query($newSQL3); while ($catdb3->next_record()) { $incat .= " OR category='" . $catdb3->f(0) . "'"; $catdb4 = new clsDBNetConnect(); $catdb4->connect(); $newSQL4 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb3->f(0) . "'"; $catdb4->query($newSQL4); while ($catdb4->next_record()) { $incat .= " OR category='" . $catdb4->f(0) . "'"; $catdb5 = new clsDBNetConnect(); $catdb5->connect(); $newSQL5 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . $catdb4->f(0) . "'"; $catdb5->query($newSQL5); while ($catdb5->next_record()) { $incat .= " OR category='" . $catdb5->f(0) . "'"; } } } } } } //print $incat; $this->ds->Parameters["urlCatID"] = $incat; //CCGetFromGet("CatID", ""); $this->ds->Parameters["urls_ItemNum"] = CCGetFromGet("s_ItemNum", ""); if (CCGetFromGet("s_user_id", "")) { $userfind = CCGetFromGet("s_user_id", ""); $findDB = new clsDBNetConnect(); $GetUser = CCDlookUP("user_id", "users", "user_login='******'", $findDB); if ($GetUser == NULL) { $GetUser = 1000000000000.0; } } if (CCGetFromGet("User_ID", "")) { $GetUser = CCGetFromGet("User_ID", ""); } $this->ds->Parameters["urls_user_id"] = $GetUser; $this->ds->Parameters["urls_asking_min"] = CCGetFromGet("s_asking_min", ""); $this->ds->Parameters["urls_asking_max"] = CCGetFromGet("s_asking_max", ""); $this->ds->Parameters["urls_make_offer"] = CCGetFromGet("s_make_offer", ""); $this->ds->Parameters["urls_quantity"] = CCGetFromGet("s_quantity", ""); $this->ds->Parameters["urls_city_town"] = CCGetFromGet("s_city_town", ""); $this->ds->Parameters["urls_state_province"] = CCGetFromGet("s_state_province", ""); $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; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); $is_next_record = $this->ds->next_record(); $CounterItems = 1; if ($is_next_record && $ShownRecords < $this->PageSize) { do { $this->ds->SetValues(); $Tpl->block_path = $GridBlock . "/Row"; $Tpl->SetVar("breaker", ""); if ($CounterItems % 4 == 0) { $Tpl->SetVar("breaker", "</tr><tr>"); } $CounterItems++; if ($this->ds->image_one->GetValue() != "") { if ($now["has_gd"]) { $this->image_one->SetValue("<table bgcolor=\"#000000\" border=\"0\"><tr><td width=\"75\" height=\"75\" valign=\"middle\" align=\"center\" bgcolor=\"#FFFFFF\"><a href=\"ViewItem.php?ItemNum=" . $this->ds->ItemNum->GetValue() . "\"><img src=\"imageresizer.php?heightsize=75&widthsize=75&filename=" . $this->ds->image_one->GetValue() . "\" border=0 /></a></td></tr></table>"); } else { $this->image_one->SetValue("<table bgcolor=\"#000000\" border=\"0\"><tr><td width=\"75\" height=\"75\" valign=\"middle\" align=\"center\" bgcolor=\"#FFFFFF\"><a href=\"ViewItem.php?ItemNum=" . $this->ds->ItemNum->GetValue() . "\">" . thumbnail($this->ds->image_one->GetValue(), 75, 75, 0, 0) . "</a></td></tr></table>"); } } $this->ItemNum->SetValue($this->ds->ItemNum->GetValue()); $this->title->SetValue($this->ds->title->GetValue()); if ($this->ds->make_offer->GetValue() == 1) { $this->make_offer->SetValue("<BR><font color=#ff0000>(Make Offer)</font>"); } else { $this->make_offer->SetValue(""); } $this->asking_price->SetValue($this->ds->asking_price->GetValue()); $theday = getdate($this->ds->started->GetValue()); $lastofyear = substr($theday["year"], -2); $enddate = $theday["mon"] . "/" . $theday["mday"] . "/" . $lastofyear; $this->started->SetValue($enddate); if ($this->ds->city_town->GetValue() != "") { $this->city_town->SetValue($this->ds->city_town->GetValue() . ", "); } else { $this->city_town->SetValue($this->ds->city_town->GetValue()); } $this->state_province->SetValue($this->ds->state_province->GetValue()); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow"); $this->image_one->Show(); $this->ItemNum->Show(); $this->title->Show(); $this->make_offer->Show(); $this->asking_price->Show(); $this->started->Show(); $this->city_town->Show(); $this->state_province->Show(); $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->parse("NoRecords", false); } $this->Navigator->TotalPages = $this->ds->PageCount(); $this->itemslink->Show(); $this->Navigator->Show(); $Tpl->parse("", false); $Tpl->block_path = ""; }
function InsertRow() { global $EP; global $now; global $charges; global $accounting; $EP = array("EMAIL:SITE_NAME" => $now["sitename"], "EMAIL:SITE_EMAIL" => $now["siteemail"], "EMAIL:SITE_EMAIL_LINK" => "<a href=\"mailto:" . $now["siteemail"] . "\">" . $now["siteemail"] . "</a>", "EMAIL:HOME_URL" => $now["homeurl"], "EMAIL:HOME_PAGE_LINK" => "<a href=\"" . $now["homeurl"] . "index.php\">Home</a>", "EMAIL:BROWSE_LINK" => "<a href=\"" . $now["homeurl"] . "browse.php\">Browse</a>", "EMAIL:SEARCH_LINK" => "<a href=\"" . $now["homeurl"] . "search.php\">Search</a>", "EMAIL:MY_ACCOUNT_LINK" => "<a href=\"" . $now["homeurl"] . "myaccount.php\">My Account</a>", "EMAIL:PAYMENT_LINK_SSL" => "<a href=\"" . $now["secureurl"] . "MakePayment.php\">Make a Payment</a>", "EMAIL:PAYMENT_LINK" => "<a href=\"" . $now["homeurl"] . "MakePayment.php\">Make a Payment</a>", "EMAIL:CURRENCY" => $charges["currency"], "EMAIL:LISTING_FEE" => $charges["listing_fee"], "EMAIL:HOMEPAGE_FEATURED_FEE" => $charges["homepage_fee"], "EMAIL:CATEGORY_FEATURED_FEE" => $charges["category_fee"], "EMAIL:GALLERY_FEE" => $charges["gallery_fee"], "EMAIL:IMAGE_PREVIEW_FEE" => $charges["image_preview_fee"], "EMAIL:SLIDE_SHOW_FEE" => $charges["slide_fee"], "EMAIL:COUNTER_FEE" => $charges["counter_fee"], "EMAIL:BOLD_FEE" => $charges["bold_fee"], "EMAIL:BACKGROUND_FEE" => $charges["highlight_fee"], "EMAIL:IMAGE_UPLOAD_FEE" => $charges["upload_fee"], "EMAIL:CURRENT_TIME" => date("F j, Y, g:i a")); $lookdb = new clsDBNetConnect(); $lookdb->connect(); $lookdb->query("SELECT * FROM users WHERE newsletter='1'"); while ($lookdb->next_record()) { $ld = array("first" => $lookdb->f("first_name"), "username" => $lookdb->f("user_login"), "ID" => $lookdb->f("user_id"), "last" => $lookdb->f("last_name"), "email" => $lookdb->f("email"), "address" => $lookdb->f("address1"), "address2" => $lookdb->f("address2"), "state" => $lookdb->f("state_id"), "zip" => $lookdb->f("zip"), "city" => $lookdb->f("city"), "phonedy" => $lookdb->f("phone_day"), "phoneevn" => $lookdb->f("phone_evn"), "fax" => $lookdb->f("fax"), "ip" => $lookdb->f("ip_insert"), "date_created" => $lookdb->f("date_created")); $EP["EMAIL:CURRENT_USERNAME"] = $ld["username"]; $EP["EMAIL:CURRENT_USERID"] = $ld["ID"]; $EP["EMAIL:CURRENT_USER_FIRST_NAME"] = $ld["first"]; $EP["EMAIL:CURRENT_USER_LAST_NAME"] = $ld["last"]; $EP["EMAIL:CURRENT_USER_EMAIL"] = $ld["email"]; $EP["EMAIL:CURRENT_USER_ADDRESS"] = $ld["address"]; $EP["EMAIL:CURRENT_USER_ADDRESS2"] = $ld["address2"]; $EP["EMAIL:CURRENT_USER_STATE"] = $ld["state"]; $EP["EMAIL:CURRENT_USER_CITY"] = $ld["city"]; $EP["EMAIL:CURRENT_USER_ZIP"] = $ld["zip"]; $EP["EMAIL:CURRENT_USER_DAY_PHONE"] = $ld["phonedy"]; $EP["EMAIL:CURRENT_USER_EVN_PHONE"] = $ld["phoneevn"]; $EP["EMAIL:CURRENT_USER_FAX"] = $ld["fax"]; $EP["EMAIL:CURRENT_USER_IP"] = getenv("REMOTE_ADDR"); $EP["EMAIL:CURRENT_USER__REGISTERED_IP"] = $ld["ip"]; $EP["EMAIL:CURRENT_USER_DATE_SIGNEDUP"] = date("F j, Y, g:i a", $ld["date_created"]); mailnews($ld["email"], $this->message->GetValue(), $this->subject->GetValue(), $EP); } $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert"); /* $this->ds->subject->SetValue($this->subject->GetValue()); $this->ds->message->SetValue($this->message->GetValue()); $this->ds->to_user_id->SetValue($this->to_user_id->GetValue()); $this->ds->from_user_id->SetValue($this->from_user_id->GetValue()); $this->ds->emaildate->SetValue($this->emaildate->GetValue()); $this->ds->Insert(); */ $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert"); if ($this->ds->Errors->Count() > 0) { echo "Error in Record " . $this->ComponentName . " / Insert Operation"; $this->ds->Errors->Clear(); $this->Errors->AddError("Database command error."); } return $this->Errors->Count() == 0; }
function itemsSearch_BeforeShow() { //itemsSearch_BeforeShow @40-1F0E9553 //Set Tag @50-4DFC98E7 global $Tpl; global $admingroup; $Tpl->SetVar("cat_id_in", $_GET["CatID"]); if ($_GET["CatID"]) { $ldb = new clsDBNetConnect(); $ldb->connect(); $ldb2 = new clsDBNetConnect(); $ldb2->connect(); $ldb3 = new clsDBNetConnect(); $ldb3->connect(); $ldb4 = new clsDBNetConnect(); $ldb4->connect(); $ldb5 = new clsDBNetConnect(); $ldb5->connect(); $ldb->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $_GET["CatID"]); if ($ldb->next_record()) { $newvars["catlist"] = "<a class=\"cats\" href=\"ViewCat.php?CatID=" . $ldb->f("cat_id") . "\">" . $ldb->f("name") . "</a>"; $ldb2->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $ldb->f("sub_cat_id")); if ($ldb2->next_record()) { $newvars["catlist"] = "<a class=\"cats\" href=\"ViewCat.php?CatID=" . $ldb2->f("cat_id") . "\">" . $ldb2->f("name") . "</a> > " . $newvars["catlist"]; $ldb3->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $ldb2->f("sub_cat_id")); if ($ldb3->next_record()) { $newvars["catlist"] = "<a class=\"cats\" href=\"ViewCat.php?CatID=" . $ldb3->f("cat_id") . "\">" . $ldb3->f("name") . "</a> > " . $newvars["catlist"]; $ldb4->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $ldb3->f("sub_cat_id")); if ($ldb4->next_record()) { $newvars["catlist"] = "<a class=\"cats\" href=\"ViewCat.php?CatID=" . $ldb4->f("cat_id") . "\">" . $ldb4->f("name") . "</a> > " . $newvars["catlist"]; $ldb5->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $ldb4->f("sub_cat_id")); if ($ldb5->next_record()) { $newvars["catlist"] = "<a class=\"cats\" href=\"ViewCat.php?CatID=" . $ldb5->f("cat_id") . "\">" . $ldb5->f("name") . "</a> > " . $newvars["catlist"]; $maxdepth = TRUE; } } } } } } $Tpl->SetVar("catlist", $newvars["catlist"]); if ($admingroup && !$maxdepth) { $QueryString = CCGetQueryString("QueryString", array()); $AdminMenu = <<<EOD <script> \t\tfunction toggleDisplayadminrow() { \t\t\tif (document.getElementById) { \t\t\t\tif(document.getElementById("adminrow").style.display=="block") { \t\t\t\t\tdocument.getElementById("adminrow").style.display="none"; \t\t\t\t\tdocument.getElementById("adminrow_icon").src="images/expand.gif"; \t\t\t\t} \t\t\t\telse { \t\t\t\t\tdocument.getElementById("adminrow").style.display="block"; \t\t\t\t\tdocument.getElementById("adminrow_icon").src="images/minimize.gif"; \t\t\t\t} \t\t\t} \t\t} \t</script> \t<table width="100%" border="0"> \t<tr><td> \t<img id="adminrow_icon" src="images/expand.gif" width="16" height="16" onclick="javascript:toggleDisplayadminrow();" onmouseover="javascript:this.style.cursor='hand';"><b> -- Expand FrontEnd Admin Menu</b> \t</td></tr> \t<table id="adminrow" style="display:none;" width="100%"> \t<tr><td> \t<form name="AdminMenu" method="POST" action="ViewCat.php?{$QueryString}"> \tAdd Sub-Categories: <input type="text" size="80" name="addcategory"><br>(Add as many categories as you like, seperated by a semi-colon, cat1;cat2;cat3) \t<br><input class="inspector" type="submit" value="Save New Categories" name="saveAddCats"/> \t</form> \tOther 'In Place' edits on this page: The items in the Category List can be renamed and reordered. \t<ul><li><b>Rename Categories - </b>You can rename the subcategories within this category by double clicking their name in the category list on the left side, then clicking "Save Changes" after all your edits are finished</li> \t<li><b>Reorder Categories - </b>You can change the order in which the subcategories are displayed in this category by grabbing the "handle" beside each one and dragging it to where you want it in the list on the left side of the page. Then click "Save Changes" after all your edits are finished</li></ul> \t</td></tr></table> \t</table> EOD; $Tpl->SetVar("AdminMenu", $AdminMenu); } //End Set Tag }
function Page_BeforeShow() { //Page_BeforeShow @1-66DC429C //Custom Code @32-2A29BDB7 global $Tpl; $finalcat = CCGetFromGet("finalcat", ""); $ItemNum = CCGetFromGet("Item_Number", ""); if (CCGetSession("RecentPreviewItem")) { $ItemNum = CCGetSession("RecentPreviewItem"); } $cats = "("; $db = new clsDBNetConnect(); $query = "select * from categories where cat_id='" . $finalcat . "'"; $db->query($query); $db->next_record(); $Tpl->SetVar("category", $finalcat); $Tpl->SetVar("cat_name", $db->f("name")); $cats .= "cat_id=" . $db->f("cat_id"); if ($db->f("sub_cat_id") > 0) { $cats .= " or "; $sub = $db->f("sub_cat_id"); $query = "select * from categories where cat_id={$sub}"; $db->query($query); $db->next_record(); $cats .= "cat_id=" . $db->f("cat_id"); if ($db->f("sub_cat_id") > 0) { $cats .= " or "; $sub = $db->f("sub_cat_id"); $query = "select * from categories where cat_id={$sub}"; $db->query($query); $db->next_record(); $cats .= "cat_id=" . $db->f("cat_id"); if ($db->f("sub_cat_id") > 0) { $cats .= " or "; $sub = $db->f("sub_cat_id"); $query = "select * from categories where cat_id={$sub}"; $db->query($query); $db->next_record(); $cats .= "cat_id=" . $db->f("cat_id"); if ($db->f("sub_cat_id") > 0) { $cats .= " or "; $sub = $db->f("sub_cat_id"); $query = "select * from categories where cat_id={$sub}"; $db->query($query); $db->next_record(); $cats .= "cat_id=" . $db->f("cat_id"); if ($db->f("sub_cat_id") > 0) { $cats .= " or "; $sub = $db->f("sub_cat_id"); $query = "select * from categories where cat_id={$sub}"; $db->query($query); $db->next_record(); $cats .= "cat_id=" . $db->f("cat_id"); if ($db->f("sub_cat_id") > 0) { $cats .= " or "; $sub = $db->f("sub_cat_id"); $query = "select * from categories where cat_id={$sub}"; $db->query($query); $db->next_record(); $cats .= "cat_id=" . $db->f("cat_id"); } else { $cats .= ")"; } } else { $cats .= ")"; } } else { $cats .= ")"; } } else { $cats .= ")"; } } else { $cats .= ")"; } } else { $cats .= ")"; } $Tpl->SetBlockVar("Custom_TextArea", ""); $custtxt = new clsDBNetConnect(); $query = "select * from custom_textarea where {$cats}"; $custtxt->query($query); if ($custtxt->next_record()) { $custtxt->seek(); $queryfields = "("; $count = 0; while ($custtxt->next_record()) { if ($count > 0) { $queryfields .= " or "; } $queryfields .= "field_id='" . $custtxt->f("id") . "'"; $textvar[$custtxt->f("id")] = $custtxt->f("template_var"); $textdesc[$custtxt->f("id")] = $custtxt->f("description"); $textname[$custtxt->f("id")] = $custtxt->f("name"); $count++; } $custtxt->seek(); $queryfields .= ") and"; if (!$_POST["closes"] && $_GET["Item_Number"]) { $custtxtvalues = new clsDBNetConnect(); $query = "select * from custom_textarea_values where {$queryfields} ItemNum=" . $ItemNum; $custtxtvalues->query($query); while ($custtxtvalues->next_record()) { $fieldvalues[$custtxtvalues->f("field_id")] = $custtxtvalues->f("value"); } } if ($_POST && !$_GET["Item_Number"]) { $custtxt->seek(); while ($custtxt->next_record()) { $fieldvalues[$custtxt->f("id")] = $_POST["custtxt_area::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id")]; } } $custtxt->seek(); while ($custtxt->next_record()) { $Tpl->SetVar("ta_name", multiline($textname[$custtxt->f("id")])); $Tpl->SetVar("ta_description", multiline($textdesc[$custtxt->f("id")])); $Tpl->SetVar("ta_var", "custtxt_area::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id")); $Tpl->SetVar("ta_value", stripslashes($fieldvalues[$custtxt->f("id")])); $Tpl->SetVar("ta_name_" . $custtxt->f("id"), multiline($textname[$custtxt->f("id")])); $Tpl->SetVar("ta_description_" . $custtxt->f("id"), multiline($textdesc[$custtxt->f("id")])); $Tpl->SetVar("ta_var_" . $custtxt->f("id"), "custtxt_area::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id")); $Tpl->SetVar("ta_value_" . $custtxt->f("id"), stripslashes($fieldvalues[$custtxt->f("id")])); $Tpl->Parse("Row", True); } $Tpl->Parse("Custom_TextArea", True); } ////////////////////////////// //Custom TextBox ////////////////////////////// $txtvar = ""; $txtdesc = ""; $txtname = ""; $custtxtvalues = ""; $custtxt = ""; $fieldvalues = ""; $Tpl->SetBlockVar("Custom_TextBox", ""); $custtxt = new clsDBNetConnect(); $query = "select * from custom_textbox where {$cats}"; $custtxt->query($query); if ($custtxt->next_record()) { $custtxt->seek(); $queryfields = "("; $count = 0; while ($custtxt->next_record()) { if ($count > 0) { $queryfields .= " or "; } $queryfields .= "field_id='" . $custtxt->f("id") . "'"; $textvar[$custtxt->f("id")] = $custtxt->f("template_var"); $textdesc[$custtxt->f("id")] = $custtxt->f("description"); $textname[$custtxt->f("id")] = $custtxt->f("name"); $count++; } $custtxt->seek(); $queryfields .= ") and"; if ($_GET["Item_Number"] && !$_POST["closes"]) { $custtxtvalues = new clsDBNetConnect(); $query = "select * from custom_textbox_values where {$queryfields} ItemNum=" . $ItemNum; $custtxtvalues->query($query); while ($custtxtvalues->next_record()) { $fieldvalues[$custtxtvalues->f("field_id")] = $custtxtvalues->f("value"); } } if ($_POST && !$_GET["Item_Number"]) { $custtxt->seek(); while ($custtxt->next_record()) { $fieldvalues[$custtxt->f("id")] = $_POST["custtxt_box::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id")]; } } $custtxt->seek(); while ($custtxt->next_record()) { $Tpl->SetVar("tb_name", multiline($textname[$custtxt->f("id")])); $Tpl->SetVar("tb_description", multiline($textdesc[$custtxt->f("id")])); $Tpl->SetVar("tb_value", stripslashes($fieldvalues[$custtxt->f("id")])); $Tpl->SetVar("tb_var", "custtxt_box::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id")); $Tpl->SetVar("tb_name_" . $custtxt->f("id"), multiline($textname[$custtxt->f("id")])); $Tpl->SetVar("tb_description_" . $custtxt->f("id"), multiline($textdesc[$custtxt->f("id")])); $Tpl->SetVar("tb_value_" . $custtxt->f("id"), stripslashes($fieldvalues[$custtxt->f("id")])); $Tpl->SetVar("tb_var_" . $custtxt->f("id"), "custtxt_box::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id")); $Tpl->Parse("tb_Row", True); } $Tpl->Parse("Custom_TextBox", True); } ///////////////////////////////////////////////////////////////// //Custom DropDown Fields ///////////////////////////////////////////////////////////////// $txtvar = ""; $txtdesc = ""; $txtname = ""; $custtxtvalues = ""; $custtxt = ""; $fieldvalues = ""; $optionlist = ""; $checked = ""; $selected = ""; $Tpl->SetBlockVar("Custom_DropDown", ""); $custtxt = new clsDBNetConnect(); $custoptions = new clsDBNetConnect(); $query = "select * from custom_dropdown where {$cats}"; $custtxt->query($query); if ($custtxt->next_record()) { $custtxt->seek(); $queryfields = "("; $count = 0; while ($custtxt->next_record()) { if ($count > 0) { $queryfields .= " or "; } $query = "select * from custom_dropdown_options where field_id = '" . $custtxt->f("id") . "'"; $custoptions->query($query); if ($_GET["Item_Number"] && !$_POST["custddbox::" . $custtxt->f("template_var") . "::" . $custtxt->f("id")]) { $dvalue = new clsDBNetConnect(); $query = "select * from custom_dropdown_values where ItemNum = {$ItemNum} and field_id = " . $custtxt->f("id"); $dvalue->query($query); if ($dvalue->next_record()) { $selected[$custtxt->f("id")] = $dvalue->f("option_id"); } else { $selected[$custtxt->f("id")] = "default"; } } elseif ($_POST["custddbox::" . $custtxt->f("template_var") . "::" . $custtxt->f("id")]) { $selected[$custtxt->f("id")] = $_POST["custddbox::" . $custtxt->f("template_var") . "::" . $custtxt->f("id")]; } while ($custoptions->next_record()) { $checked = ""; if (!$_GET["Item_Number"] && !$_POST["custddbox::" . $custtxt->f("template_var") . "::" . $custtxt->f("id")] && $custoptions->f("default") == 1 || $custoptions->f("default") == 1 && $selected[$custtxt->f("id")] == "default") { $checked = " selected "; } elseif ($custoptions->f("id") == $selected[$custtxt->f("id")]) { $checked = " selected "; } else { $checked = ""; } $optionlist[$custtxt->f("id")][] = "<option value=\"" . $custoptions->f("id") . "\"{$checked}>" . $custoptions->f("option") . "</option>\n"; } $queryfields .= "field_id='" . $custtxt->f("id") . "'"; $textvar[$custtxt->f("id")] = $custtxt->f("template_var"); $textdesc[$custtxt->f("id")] = $custtxt->f("description"); $textname[$custtxt->f("id")] = $custtxt->f("name"); $count++; } $custtxt->seek(); $count = 0; while ($custtxt->next_record()) { $i = 0; $builtoptions = ""; while ($optionlist[$custtxt->f("id")][$i]) { $builtoptions .= $optionlist[$custtxt->f("id")][$i]; $i++; } $Tpl->SetVar("dd_name", multiline($textname[$custtxt->f("id")])); $Tpl->SetVar("dd_description", multiline($textdesc[$custtxt->f("id")])); $Tpl->SetVar("dd_var", "custddbox::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id")); $Tpl->SetVar("dropdown_Options", $builtoptions); $Tpl->SetVar("dd_name_" . $custtxt->f("id"), multiline($textname[$custtxt->f("id")])); $Tpl->SetVar("dd_description_" . $custtxt->f("id"), multiline($textdesc[$custtxt->f("id")])); $Tpl->SetVar("dd_var_" . $custtxt->f("id"), "custddbox::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id")); $Tpl->SetVar("dropdown_Options_" . $custtxt->f("id"), $builtoptions); $Tpl->Parse("dd_Row", True); } $Tpl->Parse("Custom_DropDown", True); } ////////////////////////////////// //End Custom Vars///////////////// ////////////////////////////////// global $regcharges; $sql = "SELECT * FROM categories WHERE sub_cat_id > '0' ORDER BY weight, name"; $db = new clsDBNetConnect(); $db->connect(); $db->query($sql); while ($db->next_record()) { $catid = $db->f(0); $subid = $db->f(1); $name = $db->f(2); if ($subid == 1) { $inis .= "<OPTION value=\"" . $catid . "\">" . $name . "</OPTION>"; } $dsper .= "catlist[" . $catid . "] = new Array(" . $subid . " , \"" . $name . "\");\r\n"; } $closestCat = getparents($_GET["finalcat"]); if (!$closestCat) { $closestCat = 1; } $db2 = new clsDBNetConnect(); $db2->connect(); $db2->query("SELECT * FROM lookup_listing_dates WHERE charge_for='1' and cat_id={$closestCat}"); $dayfees = ""; while ($db2->next_record()) { $dayfees = $dayfees . $db2->f("days") . " Days - <font color='red'>" . $regcharges["currency"] . $db2->f("fee") . "</font><br>"; } $Tpl->SetVar("cats", $dsper); $Tpl->SetVar("catbuild", $inis); $Tpl->SetVar("dayfees", $dayfees); unset($db); //End Custom Code }
function Show() { global $Tpl; if (!$this->Visible) { return; } $ShownRecords = 0; $this->ds->Parameters["urlSUBID"] = CCGetFromGet("SUBID", ""); $this->ds->Prepare(); $this->ds->Open(); $GridBlock = "Grid " . $this->ComponentName; $Tpl->block_path = $GridBlock; $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->Go->SetValue($this->ds->Go->GetValue()); $this->Go->Parameters = CCGetQueryString("QueryString", array("ccsForm", "cat_id", "SUBID", "categoriesPage")); $this->Go->Parameters = CCAddParam($this->Go->Parameters, "SUBID", $this->ds->f("cat_id")); $this->Go->Page = "CategoriesList.php"; $this->name->SetValue($this->ds->name->GetValue()); $this->weight->SetValue($this->ds->weight->GetValue()); $this->Edit->Parameters = CCGetQueryString("QueryString", array("ccsForm")); $this->Edit->Parameters = CCAddParam($this->Edit->Parameters, "cat_id", $this->ds->f("cat_id")); $this->Edit->Page = "CategoriesMaintanence.php"; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow"); $this->Go->Show(); $this->name->Show(); $this->weight->Show(); $this->Edit->Show(); $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->parse("NoRecords", false); } $findout = ""; if (CCGetFromGet("SUBID", "") != 1 && CCGetFromGet("SUBID", "") != "") { $dr = new clsDBNetConnect(); $dr->connect(); $loc = CCGetFromGet("SUBID", ""); $find = CCDLookUp("sub_cat_id", "categories", "cat_id='" . $loc . "'", $dr); $findout = "<a href=\"CategoriesList.php?SUBID=" . $find . "\">Back Up One</a>"; unset($dr); } $Tpl->SetVar("GoBack", $findout); $this->AddNew->SetValue(1); $this->Navigator->TotalPages = $this->ds->PageCount(); $this->Sorter_name->Show(); $this->AddNew->Show(); $this->Navigator->Show(); $Tpl->parse("", false); $Tpl->block_path = ""; }
$db = new clsDBNetConnect(); $query = "delete from `items` where `ItemNum`='" . $_GET["PreviewNum"] . "'"; $db->query($query); $query = "delete from `listing_index` where `ItemNum`='" . $_GET["PreviewNum"] . "'"; $db->query($query); $query = "INSERT INTO items (\r\n `ItemNum`,\r\n `category`,\r\n `user_id`,\r\n `title`,\r\n `status`,\r\n `end_reason`,\r\n `started`,\r\n `close`,\r\n `closes`,\r\n `bold`,\r\n `background`,\r\n `cat_featured`,\r\n `home_featured`,\r\n `gallery_featured`,\r\n `image_preview`,\r\n `slide_show`,\r\n `counter`,\r\n `make_offer`,\r\n `image_one`,\r\n `image_two`,\r\n `image_three`,\r\n `image_four`,\r\n `image_five`,\r\n `asking_price`,\r\n `quantity`,\r\n `city_town`,\r\n `state_province`,\r\n `country`,\r\n `description`,\r\n `added_description`,\r\n `dateadded`,\r\n `item_paypal`,\r\n `ship1`,\r\n `shipfee1`,\r\n `ship2`,\r\n `shipfee2`,\r\n `ship3`,\r\n `shipfee3`,\r\n `ship4`,\r\n `shipfee4`,\r\n `ship5`,\r\n `shipfee5`) SELECT \r\n `ItemNum`,\r\n `category`,\r\n `user_id`,\r\n `title`,\r\n `status`,\r\n `end_reason`,\r\n `started`,\r\n `close`,\r\n `closes`,\r\n `bold`,\r\n `background`,\r\n `cat_featured`,\r\n `home_featured`,\r\n `gallery_featured`,\r\n `image_preview`,\r\n `slide_show`,\r\n `counter`,\r\n `make_offer`,\r\n `image_one`,\r\n `image_two`,\r\n `image_three`,\r\n `image_four`,\r\n `image_five`,\r\n `asking_price`,\r\n `quantity`,\r\n `city_town`,\r\n `state_province`,\r\n `country`,\r\n `description`,\r\n `added_description`,\r\n `dateadded`,\r\n `item_paypal`,\r\n `ship1`,\r\n `shipfee1`,\r\n `ship2`,\r\n `shipfee2`,\r\n `ship3`,\r\n `shipfee3`,\r\n `ship4`,\r\n `shipfee4`,\r\n `ship5`,\r\n `shipfee5` from `items_preview` where `ItemNum` = '" . $_GET["PreviewNum"] . "'"; $db->query($query); $query = "delete from `items_preview` where `ItemNum` = '" . $_GET["PreviewNum"] . "'"; $db->query($query); CCSetSession("RecentItemNum", $_GET["PreviewNum"]); CCSetSession("RecentPreviewItem", ""); } if (CCGetSession("RecentItemNum") != "") { $db = new clsDBNetConnect(); $SQL = "SELECT * FROM items WHERE ItemNum=" . CCGetSession("RecentItemNum"); $db->connect(); $db->query($SQL); $Result = $db->next_record(); $finalcat = $db->f("category"); $coupon = new clsDBNetConnect(); $SQL = "SELECT * FROM used_coupons WHERE ItemNum=" . CCGetSession("RecentItemNum") . " and `used` IS NULL"; $coupon->query($SQL); if ($coupon->next_record()) { $SQL = "SELECT * FROM coupons WHERE id=" . $coupon->f("coupon_id"); $coupon->query($SQL); if ($coupon->next_record()) { $coupon_percent = $coupon->f("discount"); $code = $coupon->f("code"); } } if ($_GET["usetoken"] == 1 && !$_GET["ccsForm"]) {
function InsertRow() { global $EP; global $now; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert"); $lookdb = new clsDBNetConnect(); $lookdb->connect(); $lookdb->query("SELECT * FROM users WHERE email='" . $this->user_email->GetValue() . "'"); if ($lookdb->next_record()) { $ld = array("first" => $lookdb->f("first_name"), "username" => $lookdb->f("user_login"), "user_password" => $lookdb->f("user_password"), "ID" => $lookdb->f("user_id"), "last" => $lookdb->f("last_name"), "email" => $lookdb->f("email"), "address" => $lookdb->f("address1"), "address2" => $lookdb->f("address2"), "state" => $lookdb->f("state_id"), "zip" => $lookdb->f("zip"), "city" => $lookdb->f("city"), "phonedy" => $lookdb->f("phone_day"), "phoneevn" => $lookdb->f("phone_evn"), "fax" => $lookdb->f("fax"), "ip" => $lookdb->f("ip_insert"), "date_created" => $lookdb->f("date_created")); } $EP["EMAIL:CURRENT_USERNAME"] = $ld["username"]; $EP["EMAIL:CURRENT_USERID"] = $ld["ID"]; $EP["EMAIL:CURRENT_USER_PASSWORD"] = $ld["user_password"]; $EP["EMAIL:CURRENT_USER_FIRST_NAME"] = $ld["first"]; $EP["EMAIL:CURRENT_USER_LAST_NAME"] = $ld["last"]; $EP["EMAIL:CURRENT_USER_EMAIL"] = $ld["email"]; $EP["EMAIL:CURRENT_USER_ADDRESS"] = $ld["address"]; $EP["EMAIL:CURRENT_USER_ADDRESS2"] = $ld["address2"]; $EP["EMAIL:CURRENT_USER_STATE"] = $ld["state"]; $EP["EMAIL:CURRENT_USER_CITY"] = $ld["city"]; $EP["EMAIL:CURRENT_USER_ZIP"] = $ld["zip"]; $EP["EMAIL:CURRENT_USER_DAY_PHONE"] = $ld["phonedy"]; $EP["EMAIL:CURRENT_USER_EVN_PHONE"] = $ld["phoneevn"]; $EP["EMAIL:CURRENT_USER_FAX"] = $ld["fax"]; $EP["EMAIL:CURRENT_USER_IP"] = getenv("REMOTE_ADDR"); $EP["EMAIL:CURRENT_USER__REGISTERED_IP"] = $ld["ip"]; $EP["EMAIL:CURRENT_USER_DATE_SIGNEDUP"] = date("F j, Y, g:i a", $ld["date_created"]); $this->ds->user_email->SetValue($this->user_email->GetValue()); $this->ds->user_login->SetValue($ld["username"]); $this->ds->ip_request->SetValue(getenv("REMOTE_ADDR")); $this->ds->date->SetValue(time()); $this->ds->Insert(); mailout("ForgotPassword", 0, $ld["ID"], 1000000000, time(), $EP); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert"); if ($this->ds->Errors->Count() > 0) { echo "Error in Record " . $this->ComponentName . " / Insert Operation"; $this->ds->Errors->Clear(); $this->Errors->AddError("Database command error."); } return $this->Errors->Count() == 0; }
function items_BeforeShow() { //items_BeforeShow @4-10DCF469 //Custom Code @7-2A29BDB7 global $Tpl; global $itemvars; global $items; global $newvars; global $currency; global $emails1; global $joinJS; global $admingroup; global $editorCSS; global $PHP_SELF; if (CCGetFromGet("ItemNum", "") || CCGetFromGet("PreviewNum", "")) { $db = new clsDBNetConnect(); $db->connect(); $SQL = "SELECT * FROM items WHERE ItemNum=" . CCGetFromGet("ItemNum", ""); if (CCGetFromGet("PreviewNum", "")) { $SQL = "SELECT * FROM items_preview WHERE ItemNum=" . CCGetFromGet("PreviewNum", ""); } $db->query($SQL); $Result = $db->next_record(); if ($Result) { $itemvars = array("ItemNum" => $db->f(ItemNum), "category" => $db->f(category), "user_id" => $db->f(user_id), "title" => $db->f(title), "status" => $db->f(status), "end_reason" => $db->f(end_reason), "started" => $db->f(started), "closes" => $db->f(closes), "image_preview" => $db->f(image_preview), "slide_show" => $db->f(slide_show), "counter" => $db->f(counter), "added_description" => $db->f("added_description"), "dateadded" => $db->f("dateadded"), "make_offer" => $db->f(make_offer), "image_one" => $db->f(image_one), "image_two" => $db->f(image_two), "image_three" => $db->f(image_three), "image_four" => $db->f(image_four), "image_five" => $db->f(image_five), "asking_price" => $db->f(asking_price), "quantity" => $db->f(quantity), "city_town" => $db->f(city_town), "state_province" => $db->f(state_province), "country" => $db->f("country"), "ship1" => $db->f("ship1"), "shipfee1" => $db->f("shipfee1"), "ship2" => $db->f("ship2"), "shipfee2" => $db->f("shipfee2"), "ship3" => $db->f("ship3"), "shipfee3" => $db->f("shipfee3"), "ship4" => $db->f("ship4"), "shipfee4" => $db->f("shipfee4"), "ship5" => $db->f("ship5"), "shipfee5" => $db->f("shipfee5"), "item_paypal" => $db->f("item_paypal"), "hits" => $db->f(hits)); if (!CCGetUserID()) { $mustbe = "<table class=\"ct\" width=\"80%\" cellspacing=\"1\" cellpadding=\"1\">\n\n <tr>\n\n <td bgcolor=\"#ffffff\" align=\"middle\" valign=\"bottom\">\n <form method=\"post\" action=\"login.php?ret_link=" . $_SERVER["REQUEST_URI"] . "&type=notLogged&ccsForm=Login\" name=\"Login\">\n\n <font class=\"fhf\">Login To Ask A Question</font>\n\n <table cellpadding=\"5\" cellspacing=\"1\" class=\"ft\">\n <tr>\n\n <td></td>\n\n </tr>\n\n <tr>\n\n <td align=\"right\"><b>Username:</b> </td>\n\n <td align=\"left\"><input name=\"login\" value=\"\" maxlength=\"100\" class=\"input\"> </td>\n\n </tr>\n\n <tr>\n\n <td align=\"right\"><b>Password:</b> </td>\n\n <td align=\"left\"><input type=\"password\" name=\"password\" value=\"\" maxlength=\"100\" class=\"input\"> <a href=\"login.php\">Forgot Password</a></td>\n\n </tr>\n\n <tr>\n\n <td align=\"middle\" colspan=\"2\">\n\n <input name=\"DoLogin\" type=\"submit\" value=\"Login\" class=\"button\"> </td>\n\n </tr>\n\n <tr>\n\n <td align=\"middle\" colspan=\"2\">\n\n New Users: <a href=\"register.php\">Register</a>\n\n </td>\n\n </tr>\n\n </table>\n\n </form>\n\n </td>\n\n </tr>\n\n </table>"; } if (!CCGetUserID() && $itemvars["make_offer"] == 1) { $mustbeoffer = "<b>You must be logged in to make an offer</b>"; } if (CCGetUserID() && $itemvars["status"] == 1 && $itemvars["item_paypal"] != "") { $Tpl->SetVar("item_paypal", " <a href=\"confirm.php?what=buynowPayPal&ItemNum=" . $itemvars["ItemNum"] . "\"><B>Buy Now</b></a>"); } if (!CCGetUserID() && $itemvars["make_offer"] == 1 && $itemvars["status"] == 1 && $itemvars["item_paypal"] == "") { $Tpl->SetVar("makeoffer", " <a href=\"login.php?ret_link=ViewItem.php?ItemNum=" . $itemvars["ItemNum"] . "&type=notLogged\">Login to Make an Offer<a>"); $Tpl->SetVar("item_paypal", ""); } if (!CCGetUserID() && $itemvars["make_offer"] == 1 && $itemvars["status"] == 1 && $itemvars["item_paypal"] != "") { $Tpl->SetVar("makeoffer", " <a href=\"login.php?ret_link=ViewItem.php?ItemNum=" . $itemvars["ItemNum"] . "&type=notLogged\">Login to Buy this Item Or Make an Offer<a>"); $Tpl->SetVar("item_paypal", ""); } $Tpl->SetVar("NotLogged", $mustbe); $Tpl->SetVar("NotLogged2", $mustbeoffer); $ldb = new clsDBNetConnect(); $ldb->connect(); $ldb2 = new clsDBNetConnect(); $ldb2->connect(); $ldb3 = new clsDBNetConnect(); $ldb3->connect(); $ldb4 = new clsDBNetConnect(); $ldb4->connect(); $ldb5 = new clsDBNetConnect(); $ldb5->connect(); $ldb->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $itemvars["category"]); if ($ldb->next_record()) { $newvars["catlist"] = "<a href=\"ViewCat.php?CatID=" . $ldb->f("cat_id") . "\">" . $ldb->f("name") . "</a>"; $ldb2->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $ldb->f("sub_cat_id")); if ($ldb2->next_record()) { $newvars["catlist"] = "<a href=\"ViewCat.php?CatID=" . $ldb2->f("cat_id") . "\">" . $ldb2->f("name") . "</a> > " . $newvars["catlist"]; $ldb3->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $ldb2->f("sub_cat_id")); if ($ldb3->next_record()) { $newvars["catlist"] = "<a href=\"ViewCat.php?CatID=" . $ldb3->f("cat_id") . "\">" . $ldb3->f("name") . "</a> > " . $newvars["catlist"]; $ldb4->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $ldb3->f("sub_cat_id")); if ($ldb4->next_record()) { $newvars["catlist"] = "<a href=\"ViewCat.php?CatID=" . $ldb4->f("cat_id") . "\">" . $ldb4->f("name") . "</a> > " . $newvars["catlist"]; $ldb5->query("SELECT name, sub_cat_id, cat_id FROM categories WHERE cat_id=" . $ldb4->f("sub_cat_id")); if ($ldb5->next_record()) { $newvars["catlist"] = "<a href=\"ViewCat.php?CatID=" . $ldb5->f("cat_id") . "\">" . $ldb5->f("name") . "</a> > " . $newvars["catlist"]; } } } } } $newvars["category"] = CCDLookUP("name", "categories", "cat_id=" . $itemvars["category"], $db); $newvars["categoryid"] = CCDLookUP("sub_cat_id", "categories", "cat_id=" . $itemvars["category"], $db); $newvars["categoryparent"] = CCDLookUP("name", "categories", "cat_id=" . $newvars["categoryid"], $db); if ($newvars["categoryparent"]) { $newvars["categoryparent"] = "<a href=\"ViewCat.php?CatID=" . $newvars["categoryid"] . "\">" . $newvars["categoryparent"] . "</a> >> "; } $newvars["sellerid"] = $itemvars["user_id"]; $newvars["seller"] = CCDLookUP("user_login", "users", "user_id=" . $itemvars["user_id"], $db); if ($itemvars["status"] == 1) { $newvars["status"] = "Open"; } if ($itemvars["status"] == 2) { $newvars["status"] = "Closed"; } if ($itemvars["status"] == 0) { $newvars["status"] = "This Item has not been started yet"; } $newvars["preview_image"] = "<img src=\"images/blank.jpg\">"; $newvars["cellbreaker2"] = ""; $newvars["cellbreaker1"] = "</td><td class=\"data\">"; //if(itemvars["image_preview"] == 1){ if ($itemvars["image_five"] != "") { $newvars["preview_image"] = thumbnail($itemvars["image_five"], 225, 225, 0, 0); $newvars["cellbreaker2"] = "</td><td class=\"data\">"; $newvars["cellbreaker1"] = ""; $newvars["imageFive"] = "<tr><td align=\"center\"><img src=\"" . $itemvars["image_five"] . "\"></td></tr>"; } if ($itemvars["image_four"] != "") { $newvars["preview_image"] = thumbnail($itemvars["image_four"], 225, 225, 0, 0); $newvars["cellbreaker2"] = "</td><td class=\"data\">"; $newvars["cellbreaker1"] = ""; $newvars["imageFour"] = "<tr><td align=\"center\"><img src=\"" . $itemvars["image_four"] . "\"></td></tr>"; } if ($itemvars["image_three"] != "") { $newvars["preview_image"] = thumbnail($itemvars["image_three"], 225, 225, 0, 0); $newvars["cellbreaker2"] = "</td><td class=\"data\">"; $newvars["cellbreaker1"] = ""; $newvars["imageThree"] = "<tr><td align=\"center\"><img src=\"" . $itemvars["image_three"] . "\"></td></tr>"; } if ($itemvars["image_two"] != "") { $newvars["preview_image"] = thumbnail($itemvars["image_two"], 225, 225, 0, 0); $newvars["cellbreaker2"] = "</td><td class=\"data\">"; $newvars["cellbreaker1"] = ""; $newvars["imageTwo"] = "<tr><td align=\"center\"><img src=\"" . $itemvars["image_two"] . "\"></td></tr>"; } if ($itemvars["image_one"] != "") { $newvars["preview_image"] = thumbnail($itemvars["image_one"], 225, 225, 0, 0); $newvars["cellbreaker2"] = "</td><td class=\"data\">"; $newvars["cellbreaker1"] = ""; $newvars["imageOne"] = "<tr><td align=\"center\"><img src=\"" . $itemvars["image_one"] . "\"></td></tr>"; } //} $javafirst = 0; $javalast = 0; if ($itemvars["image_five"] != "") { $imreturn = thumbnail($itemvars["image_five"], 225, 225, 0, 1); $imreturn2 = thumbnail($itemvars["image_five"], 100, 100, 0, 1); $imreturn3 = thumbnail($itemvars["image_five"], 350, 350, 0, 1); $sone = explode("^", $imreturn); $sone2 = explode("^", $imreturn2); $sone3 = explode("^", $imreturn3); if ($javalast == 0) { $endatt = "\n"; $javalast = 1; } elseif ($javalast == 1) { $endatt = ",\n"; } $newvars["slidesrc"] = "\"{$sone['0']}\"" . $endatt . $newvars["slidesrc"]; $newvars["slideht"] = "\"{$sone['1']}\"" . $endatt . $newvars["slideht"]; $newvars["slidewt"] = "\"{$sone['2']}\"" . $endatt . $newvars["slidewt"]; $newvars["slideht2"] = "\"{$sone2['1']}\"" . $endatt . $newvars["slideht2"]; $newvars["slidewt2"] = "\"{$sone2['2']}\"" . $endatt . $newvars["slidewt2"]; $newvars["slideht3"] = "\"{$sone3['1']}\"" . $endatt . $newvars["slideht3"]; $newvars["slidewt3"] = "\"{$sone3['2']}\"" . $endatt . $newvars["slidewt3"]; unset($imreturn); unset($sone); } if ($itemvars["image_four"] != "") { $imreturn = thumbnail($itemvars["image_four"], 225, 225, 0, 1); $imreturn2 = thumbnail($itemvars["image_four"], 100, 100, 0, 1); $imreturn3 = thumbnail($itemvars["image_four"], 350, 350, 0, 1); $sone = explode("^", $imreturn); $sone2 = explode("^", $imreturn2); $sone3 = explode("^", $imreturn3); if ($javalast == 0) { $endatt = "\n"; $javalast = 1; } elseif ($javalast == 1) { $endatt = ",\n"; } $newvars["slidesrc"] = "\"{$sone['0']}\"" . $endatt . $newvars["slidesrc"]; $newvars["slideht"] = "\"{$sone['1']}\"" . $endatt . $newvars["slideht"]; $newvars["slidewt"] = "\"{$sone['2']}\"" . $endatt . $newvars["slidewt"]; $newvars["slideht2"] = "\"{$sone2['1']}\"" . $endatt . $newvars["slideht2"]; $newvars["slidewt2"] = "\"{$sone2['2']}\"" . $endatt . $newvars["slidewt2"]; $newvars["slideht3"] = "\"{$sone3['1']}\"" . $endatt . $newvars["slideht3"]; $newvars["slidewt3"] = "\"{$sone3['2']}\"" . $endatt . $newvars["slidewt3"]; unset($imreturn); unset($sone); } if ($itemvars["image_three"] != "") { $imreturn = thumbnail($itemvars["image_three"], 225, 225, 0, 1); $imreturn2 = thumbnail($itemvars["image_three"], 100, 100, 0, 1); $imreturn3 = thumbnail($itemvars["image_three"], 350, 350, 0, 1); $sone = explode("^", $imreturn); $sone2 = explode("^", $imreturn2); $sone3 = explode("^", $imreturn3); if ($javalast == 0) { $endatt = "\n"; $javalast = 1; } elseif ($javalast == 1) { $endatt = ",\n"; } $newvars["slidesrc"] = "\"{$sone['0']}\"" . $endatt . $newvars["slidesrc"]; $newvars["slideht"] = "\"{$sone['1']}\"" . $endatt . $newvars["slideht"]; $newvars["slidewt"] = "\"{$sone['2']}\"" . $endatt . $newvars["slidewt"]; $newvars["slideht2"] = "\"{$sone2['1']}\"" . $endatt . $newvars["slideht2"]; $newvars["slidewt2"] = "\"{$sone2['2']}\"" . $endatt . $newvars["slidewt2"]; $newvars["slideht3"] = "\"{$sone3['1']}\"" . $endatt . $newvars["slideht3"]; $newvars["slidewt3"] = "\"{$sone3['2']}\"" . $endatt . $newvars["slidewt3"]; unset($imreturn); unset($sone); } if ($itemvars["image_two"] != "") { $imreturn = thumbnail($itemvars["image_two"], 225, 225, 0, 1); $imreturn2 = thumbnail($itemvars["image_two"], 100, 100, 0, 1); $imreturn3 = thumbnail($itemvars["image_two"], 350, 350, 0, 1); $sone = explode("^", $imreturn); $sone2 = explode("^", $imreturn2); $sone3 = explode("^", $imreturn3); if ($javalast == 0) { $endatt = "\n"; $javalast = 1; } elseif ($javalast == 1) { $endatt = ",\n"; } $newvars["slidesrc"] = "\"{$sone['0']}\"" . $endatt . $newvars["slidesrc"]; $newvars["slideht"] = "\"{$sone['1']}\"" . $endatt . $newvars["slideht"]; $newvars["slidewt"] = "\"{$sone['2']}\"" . $endatt . $newvars["slidewt"]; $newvars["slideht2"] = "\"{$sone2['1']}\"" . $endatt . $newvars["slideht2"]; $newvars["slidewt2"] = "\"{$sone2['2']}\"" . $endatt . $newvars["slidewt2"]; $newvars["slideht3"] = "\"{$sone3['1']}\"" . $endatt . $newvars["slideht3"]; $newvars["slidewt3"] = "\"{$sone3['2']}\"" . $endatt . $newvars["slidewt3"]; unset($imreturn); unset($sone); } if ($itemvars["image_one"] != "") { $imreturn = thumbnail($itemvars["image_one"], 225, 225, 0, 1); $imreturn2 = thumbnail($itemvars["image_one"], 100, 100, 0, 1); $imreturn3 = thumbnail($itemvars["image_one"], 350, 350, 0, 1); $sone = explode("^", $imreturn); $sone2 = explode("^", $imreturn2); $sone3 = explode("^", $imreturn3); if ($javalast == 0) { $endatt = "\n"; $javalast = 1; } elseif ($javalast == 1) { $endatt = ",\n"; } $newvars["slidesrc"] = "\"{$sone['0']}\"" . $endatt . $newvars["slidesrc"]; $newvars["slideht"] = "\"{$sone['1']}\"" . $endatt . $newvars["slideht"]; $newvars["slidewt"] = "\"{$sone['2']}\"" . $endatt . $newvars["slidewt"]; $newvars["slideht2"] = "\"{$sone2['1']}\"" . $endatt . $newvars["slideht2"]; $newvars["slidewt2"] = "\"{$sone2['2']}\"" . $endatt . $newvars["slidewt2"]; $newvars["slideht3"] = "\"{$sone3['1']}\"" . $endatt . $newvars["slideht3"]; $newvars["slidewt3"] = "\"{$sone3['2']}\"" . $endatt . $newvars["slidewt3"]; unset($imreturn); unset($sone); } if ($itemvars["slide_show"] == 1) { $sliderun = "1"; $newvars["cellbreaker2"] = "</td><td class=\"data\">"; $newvars["cellbreaker1"] = ""; $newvars["preview_image"] = "<table width=\"235\" align=\"center\" valign=\"middle\" class=\"ct\" height=\"235\" border=\"1\"><tr><td align=\"center\" valign=\"middle\" class=\"ltdt\">" . $newvars["preview_image"] . "\n</td></tr>\n</table>\n<table class=\"ct\" width=\"235\"><tr bgcolor=\"#FFFFFF\">\n<td align=\"center\" width=\"33%\"><a href=\"javascript:chgImg(-1)\"><img src=\"images/prev.gif\" border=\"0\"></a></td>\n<td align=\"center\" width=\"33%\"><a href=\"javascript:auto()\"><img src=\"images/play.gif\" border=\"0\"></a></td>\n<td align=\"center\" width=\"33%\"><a href=\"javascript:chgImg(1)\"><img src=\"images/next.gif\" border=\"0\"></a></td>\n</tr>\n</table>"; } elseif ($itemvars["image_preview"] == 1) { $sliderun = "0"; $newvars["preview_image"] = "<table width=\"235\" align=\"center\" valign=\"middle\" class=\"ct\" height=\"235\" border=\"1\"><tr><td align=\"center\" valign=\"middle\" class=\"ltdt\">" . $newvars["preview_image"] . "\n</td></tr>\n</table>\n<table width=\"235\"><tr>\n<td align=\"right\"></td>\n<td align=\"center\"></td>\n<td align=\"left\"></td>\n</tr>\n</table>"; } else { $sliderun = "0"; $newvars["preview_image"] = "<img src=\"images/blank.jpg\">"; } $theday = getdate($itemvars["started"]); $startdate = $theday["weekday"] . ", " . $theday["month"] . " " . $theday["mday"] . ", " . $theday["year"]; $newvars["started"] = $startdate; unset($theday); $theday = getdate($itemvars["closes"]); $enddate = $theday["weekday"] . ", " . $theday["month"] . " " . $theday["mday"] . ", " . $theday["year"]; $newvars["closes"] = $enddate; if ($itemvars["city_town"] != "") { $newvars["city_town"] = $itemvars["city_town"] . ", "; } if ($itemvars["make_offer"] == 0 || $itemvars["make_offer"] == "" || $itemvars["make_offer"] == NULL) { $emails1->Visible = false; } $newvars["thiscat"] = "<a href=\"ViewCat.php?CatID=" . $itemvars["category"] . "\">" . $newvars["category"] . "</a>"; $hits = ""; if ($itemvars["counter"] == 1) { $hits = $itemvars["hits"]; } if ($itemvars["dateadded"] != "" and $itemvars["added_description"] != "") { $newvars["dateadded"] = "<b>On " . date("F j, Y", $itemvars["dateadded"]) . ", " . $newvars["seller"] . " added:"; } if ($itemvars["country"] != "") { $cnt = new clsDBNetConnect(); $cnt->connect(); $countryi = CCDLookUP("country_desc", "lookup_countries", "country_id=" . $itemvars["country"], $cnt); } //*********************************// //Get Custom Category template Vars// //*********************************// $cats = "("; $db = new clsDBNetConnect(); $query = "select * from categories where cat_id='" . $itemvars["category"] . "'"; $db->query($query); $db->next_record(); $cats .= "cat_id=" . $db->f("cat_id"); if ($db->f("sub_cat_id") > 0) { $cats .= " or "; $sub = $db->f("sub_cat_id"); $query = "select * from categories where cat_id={$sub}"; $db->query($query); $db->next_record(); $cats .= "cat_id=" . $db->f("cat_id"); if ($db->f("sub_cat_id") > 0) { $cats .= " or "; $sub = $db->f("sub_cat_id"); $query = "select * from categories where cat_id={$sub}"; $db->query($query); $db->next_record(); $cats .= "cat_id=" . $db->f("cat_id"); if ($db->f("sub_cat_id") > 0) { $cats .= " or "; $sub = $db->f("sub_cat_id"); $query = "select * from categories where cat_id={$sub}"; $db->query($query); $db->next_record(); $cats .= "cat_id=" . $db->f("cat_id"); if ($db->f("sub_cat_id") > 0) { $cats .= " or "; $sub = $db->f("sub_cat_id"); $query = "select * from categories where cat_id={$sub}"; $db->query($query); $db->next_record(); $cats .= "cat_id=" . $db->f("cat_id"); if ($db->f("sub_cat_id") > 0) { $cats .= " or "; $sub = $db->f("sub_cat_id"); $query = "select * from categories where cat_id={$sub}"; $db->query($query); $db->next_record(); $cats .= "cat_id=" . $db->f("cat_id"); if ($db->f("sub_cat_id") > 0) { $cats .= " or "; $sub = $db->f("sub_cat_id"); $query = "select * from categories where cat_id={$sub}"; $db->query($query); $db->next_record(); $cats .= "cat_id=" . $db->f("cat_id"); } else { $cats .= ")"; } } else { $cats .= ")"; } } else { $cats .= ")"; } } else { $cats .= ")"; } } else { $cats .= ")"; } } else { $cats .= ")"; } ///////////////////////////////// //Send Custom TextArea Plugins // ///////////////////////////////// $custtxt = new clsDBNetConnect(); $query = "select * from custom_textarea where {$cats}"; $custtxt->query($query); $queryfields = "("; $count = 0; while ($custtxt->next_record()) { if ($count > 0) { $queryfields .= " or "; } $queryfields .= "field_id='" . $custtxt->f("id") . "'"; $fields[$custtxt->f("id")] = $custtxt->f("template_var"); $count++; } $queryfields .= ") and"; if ($queryfields != "() and") { $query = "select * from custom_textarea_values where {$queryfields} ItemNum=" . $itemvars["ItemNum"]; $custtxt->query($query); while ($custtxt->next_record()) { //AdminEdit abilities section if ($admingroup) { $editorCSS .= "\n#ta_" . $fields[$custtxt->f("field_id")] . "_" . $custtxt->f("field_id") . "_View {\n\nborder: 1px solid #fff;\n\npadding: top:8px;\n\nwidth: 500px;\n\nmax-width: 100%;\n\nvalign: center;\n\n}\n\n\n\n#ta_" . $fields[$custtxt->f("field_id")] . "_" . $custtxt->f("field_id") . "_View:hover {\n\n\tbackground-color: #ffcccc;\n\n\tborder-color: #ccc;\n\n}\n\n#ta_" . $fields[$custtxt->f("field_id")] . "_" . $custtxt->f("field_id") . "_Edit {\n\n\twidth: 100%;\n\n\tborder: 1px solid #fff;\n\n\tpadding: 1px;\n\n\tbackground-color: #eeeeee;\n\n\tvalign: center;\n\n}\n"; $joinJS .= "join(\"ta_" . $fields[$custtxt->f("field_id")] . "_" . $custtxt->f("field_id") . "_\", true)\n"; $Tpl->SetVar($fields[$custtxt->f("field_id")], "\n<DIV id=\"ta_" . $fields[$custtxt->f("field_id")] . "_" . $custtxt->f("field_id") . "_View\">\n" . stripslashes($custtxt->f("value")) . "\n</div>\n" . "<textarea id=\"ta_" . $fields[$custtxt->f("field_id")] . "_" . $custtxt->f("field_id") . "_Edit\" class=\"inplace\" tabindex=\"1\" name=\"ta_" . $fields[$custtxt->f("field_id")] . "_" . $custtxt->f("field_id") . "_Edit\"></textarea>\n"); } else { $Tpl->SetVar($fields[$custtxt->f("field_id")], stripslashes($custtxt->f("value"))); } } } ///////////////////////////////// //Send Custom TextBox Plugins // ///////////////////////////////// $fields = ""; $custtxt = new clsDBNetConnect(); $query = "select * from custom_textbox where {$cats}"; $custtxt->query($query); $queryfields = "("; $count = 0; while ($custtxt->next_record()) { if ($count > 0) { $queryfields .= " or "; } $queryfields .= "field_id='" . $custtxt->f("id") . "'"; $fields[$custtxt->f("id")] = $custtxt->f("template_var"); $count++; } $queryfields .= ") and"; if ($queryfields != "() and") { $query = "select * from custom_textbox_values where {$queryfields} ItemNum=" . $itemvars["ItemNum"]; $custtxt->query($query); while ($custtxt->next_record()) { //AdminEdit abilities section if ($admingroup) { $editorCSS .= "\n#tb_" . $fields[$custtxt->f("field_id")] . "_" . $custtxt->f("field_id") . "_View {\n\nborder: 1px solid #fff;\n\npadding: top:8px;\n\nwidth: 500px;\n\nmax-width: 100%;\n\nvalign: center;\n\n}\n\n\n\n#tb_" . $fields[$custtxt->f("field_id")] . "_" . $custtxt->f("field_id") . "_View:hover {\n\n\tbackground-color: #ffcccc;\n\n\tborder-color: #ccc;\n\n}\n\n#tb_" . $fields[$custtxt->f("field_id")] . "_" . $custtxt->f("field_id") . "_Edit {\n\n\twidth: 100%;\n\n\tborder: 1px solid #fff;\n\n\tpadding: 1px;\n\n\tbackground-color: #eeeeee;\n\n\tvalign: center;\n\n}\n"; $joinJS .= "join(\"tb_" . $fields[$custtxt->f("field_id")] . "_" . $custtxt->f("field_id") . "_\", true)\n"; $Tpl->SetVar($fields[$custtxt->f("field_id")], "\n<DIV id=\"tb_" . $fields[$custtxt->f("field_id")] . "_" . $custtxt->f("field_id") . "_View\">\n" . stripslashes($custtxt->f("value")) . "\n</div>\n" . "<textarea id=\"tb_" . $fields[$custtxt->f("field_id")] . "_" . $custtxt->f("field_id") . "_Edit\" class=\"inplace\" tabindex=\"1\" name=\"tb_" . $fields[$custtxt->f("field_id")] . "_" . $custtxt->f("field_id") . "_Edit\"></textarea>\n"); } else { $Tpl->SetVar($fields[$custtxt->f("field_id")], stripslashes($custtxt->f("value"))); } } } ////////////////////////////////// //Send Custom DropDown Plugins // ////////////////////////////////// $fields = ""; $custtxt = new clsDBNetConnect(); $query = "select * from custom_dropdown where {$cats}"; $custtxt->query($query); $queryfields = "("; $count = 0; while ($custtxt->next_record()) { if ($count > 0) { $queryfields .= " or "; } $queryfields .= "field_id='" . $custtxt->f("id") . "'"; $fields[$custtxt->f("id")] = $custtxt->f("template_var"); $count++; } $queryfields .= ")"; if ($queryfields != "()") { $query = "select * from custom_dropdown_options where {$queryfields}"; $custtxt->query($query); while ($custtxt->next_record()) { $value[$custtxt->f("id")] = $custtxt->f("option"); } $queryfields .= " and"; $query = "select * from custom_dropdown_values where {$queryfields} ItemNum=" . $itemvars["ItemNum"]; $custtxt->query($query); while ($custtxt->next_record()) { $Tpl->SetVar($fields[$custtxt->f("field_id")], stripslashes($value[$custtxt->f("option_id")])); } } if ($itemvars["ship1"]) { $Tpl->SetBlockVar("shipping", ""); $i = 1; $ship = ""; while ($itemvars["ship{$i}"]) { $ship .= "\t\t\t<tr>\n"; //ADMIN EDIT ABILITY SECTION if ($admingroup) { $editorCSS .= "\n#ship" . $i . "View {\n\nborder: 1px solid #fff;\n\npadding: top:8px;\n\nwidth: 500px;\n\nmax-width: 100%;\n\nvalign: center;\n\n}\n\n\n\n#ship" . $i . "View:hover {\n\n\tbackground-color: #ffcccc;\n\n\tborder-color: #ccc;\n\n}\n\n#ship" . $i . "Edit {\n\n\twidth: 100%;\n\n\tborder: 1px solid #fff;\n\n\tpadding: 1px;\n\n\tbackground-color: #eeeeee;\n\n\tvalign: center;\n\n}\n"; $editorCSS .= "\n#shipfee" . $i . "View {\n\nborder: 1px solid #fff;\n\npadding: top:8px;\n\nwidth: 500px;\n\nmax-width: 100%;\n\nvalign: center;\n\n}\n\n\n\n#shipfee" . $i . "View:hover {\n\n\tbackground-color: #ffcccc;\n\n\tborder-color: #ccc;\n\n}\n\n#shipfee" . $i . "Edit {\n\n\twidth: 100%;\n\n\tborder: 1px solid #fff;\n\n\tpadding: 1px;\n\n\tbackground-color: #eeeeee;\n\n\tvalign: center;\n\n}\n"; $joinJS .= "join(\"shipfee" . $i . "\", true)\n"; $joinJS .= "join(\"ship" . $i . "\", true)\n"; $ship .= "\t\t\t\t<td width=\"20%\">"; $ship .= "\n<DIV id=\"ship" . $i . "View\">\n" . $itemvars["ship{$i}"] . "\n</div>\n" . "<textarea id=\"ship" . $i . "Edit\" class=\"inplace\" tabindex=\"1\" name=\"ship" . $i . "Edit\"></textarea>\n"; $ship .= "</td>\n"; $ship .= "\t\t\t\t<td width=\"80%\">"; $ship .= "\n<DIV id=\"shipfee" . $i . "View\">\n" . $itemvars["shipfee{$i}"] . "\n</div>\n" . "<textarea id=\"shipfee" . $i . "Edit\" class=\"inplace\" tabindex=\"1\" name=\"shipfee" . $i . "Edit\"></textarea>\n"; $ship .= "</td>\n"; } else { ///NOT ADMIN EDITABLE $ship .= "\t\t\t\t<td width=\"20%\">" . $itemvars["ship{$i}"] . "</td>\n"; $ship .= "\t\t\t\t<td width=\"80%\">" . $itemvars["shipfee{$i}"] . "</td>\n"; } $ship .= "\t\t\t</tr>\n"; $i++; } $Tpl->setVar("shippingoptions", $ship); $Tpl->parse("shipping", ""); } $subsc_memb = subscription_membership($newvars["sellerid"], "icontext", " "); if ($_GET["PreviewNum"]) { $Tpl->setblockvar("Preview", ""); $Tpl->setvar("finalcat", $itemvars["category"]); $Tpl->setvar("ItemNum", $itemvars["ItemNum"]); $Tpl->parse("Preview", True); } if ($admingroup) { //Title AdminEdit $editorCSS .= "\n.inspector {\n\tfont-size: 11px;\n}\n\n#titleView {\n\nborder: 1px solid #fff;\n\npadding: top:8px;\n\nwidth: 500px;\n\nmax-width: 100%;\n\nvalign: center;\n\n}\n\n\n\n#titleView:hover {\n\n\tbackground-color: #ffcccc;\n\n\tborder-color: #ccc;\n\n}\n\n#titleEdit {\n\n\twidth: 100%;\n\n\tborder: 1px solid #fff;\n\n\tpadding: 1px;\n\n\tbackground-color: #eeeeee;\n\n\tvalign: center;\n\n}\n"; $joinJS .= "join(\"title\", true)\n"; $itemvars["title2"] = "\n<DIV id=\"titleView\">\n" . $itemvars["title"] . "\n</div>\n" . "<textarea id=\"titleEdit\" class=\"inplace\" tabindex=\"1\" name=\"titleEdit\"></textarea>\n"; //Added Description AdminEdit if ($itemvars["added_description"]) { $editorCSS .= "\n#added_descriptionView {\n\nborder: 1px solid #fff;\n\npadding: top:8px;\n\nwidth: 500px;\n\nmax-width: 100%;\n\nvalign: center;\n\n}\n\n\n\n#added_descriptionView:hover {\n\n\tbackground-color: #ffcccc;\n\n\tborder-color: #ccc;\n\n}\n\n#added_descriptionEdit {\n\n\twidth: 100%;\n\n\tborder: 1px solid #fff;\n\n\tpadding: 1px;\n\n\tbackground-color: #eeeeee;\n\n\tvalign: center;\n\n}\n"; $joinJS .= "join(\"added_description\", true)\n"; $itemvars["added_description"] = "\n<DIV id=\"added_descriptionView\">\n" . $itemvars["added_description"] . "\n</div>\n" . "<textarea id=\"added_descriptionEdit\" class=\"inplace\" tabindex=\"1\" name=\"added_descriptionEdit\"></textarea>\n"; } //Asking Price AdminEdit $editorCSS .= "\n#asking_priceView {\n\nborder: 1px solid #fff;\n\npadding: top:8px;\n\nwidth: 500px;\n\nmax-width: 100%;\n\nvalign: center;\n\n}\n\n\n\n#asking_priceView:hover {\n\n\tbackground-color: #ffcccc;\n\n\tborder-color: #ccc;\n\n}\n\n#asking_priceEdit {\n\n\twidth: 100%;\n\n\tborder: 1px solid #fff;\n\n\tpadding: 1px;\n\n\tbackground-color: #eeeeee;\n\n\tvalign: center;\n\n}\n"; $joinJS .= "join(\"asking_price\", true)\n"; $itemvars["asking_price"] = "\n<DIV id=\"asking_priceView\">\n" . $itemvars["asking_price"] . "\n</div>\n" . "<textarea id=\"asking_priceEdit\" class=\"inplace\" tabindex=\"1\" name=\"asking_priceEdit\"></textarea>\n"; //City_Town AdminEdit $editorCSS .= "\n#city_townView {\n\nborder: 1px solid #fff;\n\npadding: top:8px;\n\nwidth: 500px;\n\nmax-width: 100%;\n\nvalign: center;\n\n}\n\n\n\n#city_townView:hover {\n\n\tbackground-color: #ffcccc;\n\n\tborder-color: #ccc;\n\n}\n\n#city_townEdit {\n\n\twidth: 100%;\n\n\tborder: 1px solid #fff;\n\n\tpadding: 1px;\n\n\tbackground-color: #eeeeee;\n\n\tvalign: center;\n\n}\n"; $joinJS .= "join(\"city_town\", true)\n"; $newvars["city_town"] = "\n<DIV id=\"city_townView\">\n" . $itemvars["city_town"] . "\n</div>\n" . "<textarea id=\"city_townEdit\" class=\"inplace\" tabindex=\"1\" name=\"city_townEdit\"></textarea>\n"; //State_Province AdminEdit $editorCSS .= "\n#state_provinceView {\n\nborder: 1px solid #fff;\n\npadding: top:8px;\n\nwidth: 500px;\n\nmax-width: 100%;\n\nvalign: center;\n\n}\n\n\n\n#state_provinceView:hover {\n\n\tbackground-color: #ffcccc;\n\n\tborder-color: #ccc;\n\n}\n\n#state_provinceEdit {\n\n\twidth: 100%;\n\n\tborder: 1px solid #fff;\n\n\tpadding: 1px;\n\n\tbackground-color: #eeeeee;\n\n\tvalign: center;\n\n}\n"; $joinJS .= "join(\"state_province\", true)\n"; $itemvars["state_province"] = "\n<DIV id=\"state_provinceView\">\n" . $itemvars["state_province"] . "\n</div>\n" . "<textarea id=\"state_provinceEdit\" class=\"inplace\" tabindex=\"1\" name=\"state_provinceEdit\"></textarea>\n"; //quantity AdminEdit $editorCSS .= "\n#quantityView {\n\nborder: 1px solid #fff;\n\npadding: top:8px;\n\nwidth: 500px;\n\nmax-width: 100%;\n\nvalign: center;\n\n}\n\n\n\n#quantityView:hover {\n\n\tbackground-color: #ffcccc;\n\n\tborder-color: #ccc;\n\n}\n\n#quantityEdit {\n\n\twidth: 100%;\n\n\tborder: 1px solid #fff;\n\n\tpadding: 1px;\n\n\tbackground-color: #eeeeee;\n\n\tvalign: center;\n\n}\n"; $joinJS .= "join(\"quantity\", true)\n"; $itemvars["quantity"] = "\n<DIV id=\"quantityView\">\n" . $itemvars["quantity"] . "\n</div>\n" . "<textarea id=\"quantityEdit\" class=\"inplace\" tabindex=\"1\" name=\"quantityEdit\"></textarea>\n"; $catoptions = ""; $catlist = new clsDBNetConnect(); $catlist->query("select * from categories where sub_cat_id=1"); while ($catlist->next_record()) { if ($itemvars["category"] == $catlist->f("cat_id")) { $selected = " selected"; } $catoptions .= "<option value=\"" . $catlist->f("cat_id") . "\"{$selected}>" . $catlist->f("name") . "</option>"; $selected = ""; $catlist2 = new clsDBNetConnect(); $catlist2->query("select * from categories where sub_cat_id=" . $catlist->f("cat_id")); while ($catlist2->next_record()) { if ($itemvars["category"] == $catlist2->f("cat_id")) { $selected = " selected"; } $catoptions .= "<option value=\"" . $catlist2->f("cat_id") . "\"{$selected}>--" . $catlist2->f("name") . "</option>"; $selected = ""; $catlist3 = new clsDBNetConnect(); $catlist3->query("select * from categories where sub_cat_id=" . $catlist2->f("cat_id")); while ($catlist3->next_record()) { if ($itemvars["category"] == $catlist3->f("cat_id")) { $selected = " selected"; } $catoptions .= "<option value=\"" . $catlist3->f("cat_id") . "\"{$selected}>----" . $catlist3->f("name") . "</option>"; $selected = ""; $catlist4 = new clsDBNetConnect(); $catlist4->query("select * from categories where sub_cat_id=" . $catlist3->f("cat_id")); while ($catlist4->next_record()) { if ($itemvars["category"] == $catlist4->f("cat_id")) { $selected = " selected"; } $catoptions .= "<option value=\"" . $catlist4->f("cat_id") . "\"{$selected}>------" . $catlist4->f("name") . "</option>"; $selected = ""; $catlist5 = new clsDBNetConnect(); $catlist5->query("select * from categories where sub_cat_id=" . $catlist4->f("cat_id")); while ($catlist5->next_record()) { if ($itemvars["category"] == $catlist5->f("cat_id")) { $selected = " selected"; } $catoptions .= "<option value=\"" . $catlist5->f("cat_id") . "\"{$selected}>--------" . $catlist5->f("name") . "</option>"; $selected = ""; $catlist6 = new clsDBNetConnect(); $catlist6->query("select * from categories where sub_cat_id=" . $catlist5->f("cat_id")); while ($catlist6->next_record()) { if ($itemvars["category"] == $catlist6->f("cat_id")) { $selected = " selected"; } $catoptions .= "<option value=\"" . $catlist6->f("cat_id") . "\"{$selected}>----------" . $catlist6->f("name") . "</option>"; $selected = ""; } } } } } } $QueryString = CCGetQueryString("QueryString", array()); $AdminMenu = <<<EOD <script> \t\tfunction toggleDisplayadminrow() { \t\t\tif (document.getElementById) { \t\t\t\tif(document.getElementById("adminrow").style.display=="block") { \t\t\t\t\tdocument.getElementById("adminrow").style.display="none"; \t\t\t\t\tdocument.getElementById("adminrow_icon").src="images/expand.gif"; \t\t\t\t} \t\t\t\telse { \t\t\t\t\tdocument.getElementById("adminrow").style.display="block"; \t\t\t\t\tdocument.getElementById("adminrow_icon").src="images/minimize.gif"; \t\t\t\t} \t\t\t} \t\t} \t</script> \t<table width="100%" border="0"> \t<tr><td> \t<img id="adminrow_icon" src="images/expand.gif" width="16" height="16" onclick="javascript:toggleDisplayadminrow();" onmouseover="javascript:this.style.cursor='hand';"><b> -- Expand FrontEnd Admin Menu</b> \t</td></tr> \t<table id="adminrow" style="display:none;" width="100%"> \t<tr><td> \t<form name="AdminMenu" method="POST" action="ViewItem.php?{$QueryString}"> \tMove Item to Categories: <select name="movecategory">{$catoptions}</select><br> \t<br><input class="inspector" type="submit" value="Move to Selected Category" name="saveMoveCats"/> \t</form> \tOther 'In Place' edits on this page: Most Fields on this Page can be Double Clicked and Edited. \t<ul><li><b>Edit-In-Place - </b>The majority of the text fields on this page can be edited in place, just double click on them, then click 'Save Changes'<br> \tThe 'Title', 'Quantity', 'Asking Price', 'Location', 'Description', 'Added Description', 'Shipping Options', and 'Custom Text Area/Box' fields can be edited here, any other fileds must be edited from the Listings section in siteadmin.</li> \t</ul><hr> \t</td></tr></table> \t</table> EOD; $savebutton = <<<EOD \t<tr> <td align="center" colspan="2"> \t <input type="submit" name="SaveChanges" title="Save Changes" value="Save Changes"> \t </td> \t</tr> EOD; if ($itemvars["status"] == 99) { $approve = <<<EOD \t\t<tr> \t\t<td align="center" colspan="2" bgcolor="lightgrey"> \t \t\t<a href="ViewItem.php?{$QueryString}&approved=1">CLICK HERE TO MARK THIS LISTING AS 'APPROVED' AND START IT</a> \t \t\t</td> \t\t</tr> EOD; } $Tpl->SetVar("approve", $approve); $Tpl->SetVar("SaveButton", $savebutton); $Tpl->SetVar("AdminMenu", $AdminMenu); } $Tpl->SetVar("make_offer_form", $outform); $Tpl->SetVar("added_description", $itemvars["added_description"]); $Tpl->SetVar("dateadded", $newvars["dateadded"]); $Tpl->SetVar("title", $itemvars["title"]); $Tpl->SetVar("title2", $itemvars["title2"]); $Tpl->SetVar("categoryparent", $newvars["catlist"]); $Tpl->SetVar("ItemNum", $itemvars["ItemNum"]); $Tpl->SetVar("category", $newvars["category"]); $Tpl->SetVar("thiscat", ""); $Tpl->SetVar("askingprice", $itemvars["asking_price"]); $Tpl->SetVar("quantity", $itemvars["quantity"]); $Tpl->SetVar("seller", $newvars["seller"]); $Tpl->SetVar("sellerid", $newvars["sellerid"]); $Tpl->SetVar("UserRating", "<a href=\"Feedback.php?user_id=" . $newvars["sellerid"] . "\">(" . Getfeedbacktotal($newvars["sellerid"]) . ")</a>"); $Tpl->SetVar("subscriptions", $subsc_memb); $Tpl->SetVar("end_reason", $itemvars["end_reason"]); $Tpl->SetVar("started", $newvars["started"]); $Tpl->SetVar("closes", $newvars["closes"]); $Tpl->SetVar("initial_image", $newvars["preview_image"]); $Tpl->SetVar("cellbreaker1", $newvars["cellbreaker1"]); $Tpl->SetVar("cellbreaker2", $newvars["cellbreaker2"]); $Tpl->SetVar("city_town", $newvars["city_town"]); $Tpl->SetVar("state_province", $itemvars["state_province"]); $Tpl->SetVar("country", $countryi); $Tpl->SetVar("hits", $hits); $Tpl->SetVar("status", $newvars["status"]); $Tpl->SetVar("imageOne", $newvars["imageOne"]); $Tpl->SetVar("imageTwo", $newvars["imageTwo"]); $Tpl->SetVar("imageThree", $newvars["imageThree"]); $Tpl->SetVar("imageFour", $newvars["imageFour"]); $Tpl->SetVar("imageFive", $newvars["imageFive"]); $Tpl->SetVar("imgarray", $newvars["slidesrc"]); $Tpl->SetVar("imgarrayht", $newvars["slideht"]); $Tpl->SetVar("imgarraywd", $newvars["slidewt"]); $Tpl->SetVar("imgarrayht2", $newvars["slideht2"]); $Tpl->SetVar("imgarraywd2", $newvars["slidewt2"]); $Tpl->SetVar("imgarrayht3", $newvars["slideht3"]); $Tpl->SetVar("imgarraywd3", $newvars["slidewt3"]); $Tpl->SetVar("Loader", $sliderun); //{imageOne}{imageTwo}{imageThree}{imageFour}{imageFive} //HTML Usage unset($db); unset($SQL); unset($Result); $itemvars["hits"]++; $db = new clsDBNetConnect(); $db->connect(); if (CCGetFromGet("ItemNum", "")) { $SQL = "UPDATE items SET hits=" . $itemvars["hits"] . " WHERE ItemNum=" . $itemvars["ItemNum"]; $db->query($SQL); } unset($db); unset($SQL); } } //End Custom Code }
function users_AfterInsert() { //users_AfterInsert @4-34AA212C //Custom Code @34-2A29BDB7 global $users; global $now; global $NewPass; global $EP; global $Give_New_Credit; global $Give_Amount; global $Give_Tokens; global $Give_Cause; $lookdb = new clsDBNetConnect(); $lookdb->connect(); $lookdb->query("SELECT * FROM users WHERE user_login='******'"); if ($lookdb->next_record()) { $ld = array("first" => $lookdb->f("first_name"), "ID" => $lookdb->f("user_id"), "user_password" => $lookdb->f("user_password"), "last" => $lookdb->f("last_name"), "email" => $lookdb->f("email"), "address" => $lookdb->f("address1"), "address2" => $lookdb->f("address2"), "state" => $lookdb->f("state_id"), "zip" => $lookdb->f("zip"), "city" => $lookdb->f("city"), "phonedy" => $lookdb->f("phone_day"), "phoneevn" => $lookdb->f("phone_evn"), "fax" => $lookdb->f("fax"), "ip" => $lookdb->f("ip_insert"), "date_created" => $lookdb->f("date_created")); } CCSetSession("RecentUserSign", $users->user_login->Value); CCSetSession("RecentUserEmail", $users->email->Value); $EP["EMAIL:CURRENT_USERNAME"] = $users->user_login->Value; $EP["EMAIL:CURRENT_USERID"] = $ld["ID"]; $EP["EMAIL:CURRENT_USER_PASSWORD"] = $ld["user_password"]; $EP["EMAIL:CURRENT_USER_FIRST_NAME"] = $ld["first"]; $EP["EMAIL:CURRENT_USER_LAST_NAME"] = $ld["last"]; $EP["EMAIL:CURRENT_USER_EMAIL"] = $ld["email"]; $EP["EMAIL:CURRENT_USER_ADDRESS"] = $ld["address"]; $EP["EMAIL:CURRENT_USER_ADDRESS2"] = $ld["address2"]; $EP["EMAIL:CURRENT_USER_STATE"] = $ld["state"]; $EP["EMAIL:CURRENT_USER_CITY"] = $ld["city"]; $EP["EMAIL:CURRENT_USER_ZIP"] = $ld["zip"]; $EP["EMAIL:CURRENT_USER_DAY_PHONE"] = $ld["phonedy"]; $EP["EMAIL:CURRENT_USER_EVN_PHONE"] = $ld["phoneevn"]; $EP["EMAIL:CURRENT_USER_FAX"] = $ld["fax"]; $EP["EMAIL:CURRENT_USER_IP"] = getenv("REMOTE_ADDR"); $EP["EMAIL:CURRENT_USER__REGISTERED_IP"] = $ld["ip"]; $EP["EMAIL:CURRENT_USER_DATE_SIGNEDUP"] = date("F j, Y, g:i a", $ld["date_created"]); mailout("NewRegistration", $now["notify"], $ld["ID"], 1000000000, time(), $EP); if ($Give_New_Credit == 1) { $gdb = new clsDBNetConnect(); $gdb->connect(); if ($Give_Amount) { $SQL = "INSERT INTO charges(user_id, date, cause, charge) VALUES ('" . $ld["ID"] . "', '" . time() . "', '" . $Give_Cause . "', '" . $Give_Amount . "')"; $gdb->query($SQL); } if ($Give_Tokens) { $SQL = "update users set tokens = '" . $Give_Tokens . "' where user_id = '" . $ld["ID"] . "'"; $gdb->query($SQL); } } //End Send Email //End Custom Code }
function Show() { global $Tpl; global $now; if (!$this->Visible) { return; } $ShownRecords = 0; $this->ds->Parameters["sesUserID"] = CCGetSession("UserID"); $this->ds->Prepare(); $this->ds->Open(); $GridBlock = "Grid " . $this->ComponentName; $Tpl->block_path = $GridBlock; $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->comment->SetValue($this->ds->comment->GetValue()); $twodays = $this->ds->date->GetValue(); $theday = getdate($twodays); $lastofyear = substr($theday["year"], -2); $enddate = $theday["mon"] . "/" . $theday["mday"] . "/" . $lastofyear; $this->date->SetValue(date("F j, Y, g:i a", $this->ds->date->GetValue())); if ($this->ds->doing_rating->GetValue() != "" && is_numeric($this->ds->doing_rating->GetValue()) && $this->ds->doing_rating->GetValue() != 1000000000) { $lookupdb = new clsDBNetConnect(); $lookupdb->connect(); $thename = CCDLookUp("user_login", "users", "user_id='" . $this->ds->doing_rating->GetValue() . "'", $lookupdb); $this->doing_rating->SetValue($thename); unset($lookupdb); } else { $this->doing_rating->SetValue($now["sitename"]); } $this->id->SetValue($this->ds->id->GetValue()); $this->ItemNum->SetValue($this->ds->ItemNum->GetValue()); if ($this->ds->rating->GetValue() == 1) { $this->rating->SetValue("<img src=\"images/positive.gif\">"); } if ($this->ds->rating->GetValue() == 0) { $this->rating->SetValue("<img src=\"images/neutral.gif\">"); } if ($this->ds->rating->GetValue() == -1) { $this->rating->SetValue("<img src=\"images/negative.gif\">"); } if ($this->ds->buysell->GetValue() == 1) { $this->buysell->SetValue("Buyer"); } if ($this->ds->buysell->GetValue() == 0) { $this->buysell->SetValue("Seller"); } $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow"); $this->comment->Show(); $this->date->Show(); $this->doing_rating->Show(); $this->buysell->Show(); $this->id->Show(); $this->ItemNum->Show(); $this->rating->Show(); $counter = new clsDBNetConnect(); $query = "select * from feedback where `counter` = '" . $this->ds->id->GetValue() . "'"; $counter->query($query); if ($counter->next_record()) { $Tpl->SetBlockVar("counter", ""); $Tpl->setVar("countercomment", stripslashes($counter->f("comment"))); $Tpl->setVar("countericon", "<img src=\"images/CounterComment.gif\">"); $Tpl->setVar("counterlink", ""); $Tpl->parse("counter", ""); } else { $Tpl->SetBlockVar("counter", ""); $Tpl->setVar("countercomment", ""); $Tpl->setVar("countericon", ""); if (CCGetUserID() == $_GET["user_id"]) { $Tpl->setVar("counterlink", "<a href=\"RateUser.php?id=" . $this->ds->id->GetValue() . "\"> <i>Comment on this rating</i></a>"); } } $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->parse("NoRecords", false); } $this->Navigator->TotalPages = $this->ds->PageCount(); $this->Sorter_doing_rating->Show(); $this->Sorter_date->Show(); $this->Navigator->Show(); $Tpl->parse("", false); $Tpl->block_path = ""; }
function Show() { global $Tpl; global $now; if (!$this->Visible) { return; } $ShownRecords = 0; $this->ds->Parameters["sesUserID"] = CCGetSession("UserID"); $this->ds->Prepare(); $this->ds->Open(); $GridBlock = "Grid " . $this->ComponentName; $Tpl->block_path = $GridBlock; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); $is_next_record = $this->ds->next_record(); if ($is_next_record && $ShownRecords < $this->PageSize) { do { $this->ds->SetValues(); $User_id = $this->ds->user_id->GetValue(); $Tpl->block_path = $GridBlock . "/Row"; $this->title->SetValue($this->ds->title->GetValue()); $twodays = $this->ds->date->GetValue(); $theday = getdate($twodays); $lastofyear = substr($theday["year"], -2); $enddate = $theday["mon"] . "/" . $theday["mday"] . "/" . $lastofyear; $this->date->SetValue(date("F j, Y, g:i a", $this->ds->date->GetValue())); if ($this->ds->user_id->GetValue() != "" && is_numeric($this->ds->user_id->GetValue()) && $this->ds->user_id->GetValue() != 1000000000) { $lookupdb = new clsDBNetConnect(); $lookupdb->connect(); $thename = CCDLookUp("user_login", "users", "user_id='" . $this->ds->user_id->GetValue() . "'", $lookupdb); $this->user_id->SetValue($thename); unset($lookupdb); } else { $this->user_id->SetValue($now["sitename"]); } $this->id->SetValue($this->ds->id->GetValue()); $this->ItemNum->SetValue($this->ds->ItemNum->GetValue()); $this->amt_received->SetValue($this->ds->amt_received->GetValue()); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow"); $this->title->Show(); $this->date->Show(); $this->user_id->Show(); $this->id->Show(); $this->ItemNum->Show(); $this->amt_received->Show(); $db = new clsDBNetConnect(); $db->query("select * from feedback where `purchase_id` = '" . $this->ds->id->GetValue() . "' and `doing_rating` = '" . CCGetUserID() . "'"); if (!$db->next_record()) { $Tpl->setVar("feedbacklink", "<a href=\"RateUser.php?ItemNum=" . $this->ds->ItemNum->GetValue() . "&purchase_id=" . $this->ds->id->GetValue() . "\">Leave Feedback</a>"); } else { $Tpl->setVar("feedbacklink", "<a href=\"Feedback.php?user_id=" . $User_id . "\">View This User's Feedback</a>"); } $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->parse("NoRecords", false); } $this->Navigator->TotalPages = $this->ds->PageCount(); $this->Sorter_title->Show(); $this->Sorter_date->Show(); $this->Navigator->Show(); $Tpl->parse("", false); $Tpl->block_path = ""; }