$shippingtext = $buy->f("ship" . $shipping) . ": \$" . $buy->f("shipfee" . $shipping); } else { $shipfee = 0; $shippingtext = "No Shipping Specified: \$0.00"; $totalfee = $buy->f("asking_price"); } if ($totalfee == $payment_gross) { $purchase = new clsDBNetConnect(); $query = "insert into `purchases` (`ItemNum`, `date`, `title`, `asking`, `amt_received`, `shipping`, `user_id`, `buyer`, `user_paypal`, `buyer_paypal`, `txn_id`) values ('" . $ItemNum . "', '" . time() . "', '" . mysql_escape_string($buy->f("title")) . "', '" . mysql_escape_string($buy->f("asking_price")) . "', '" . $payment_gross . "', '" . mysql_escape_string($shippingtext) . "', '" . mysql_escape_string($buy->f("user_id")) . "', '" . $buyer_id . "', '" . $receiver_email . "', '" . $payer_email . "', '" . $txn_id . "')"; $purchase->query($query); $quantity = $buy->f("quantity") - 1; $update = new clsDBNetConnect(); if ($quantity < 1) { $update->query("update items set status = '2', quantity = '0', end_reason = 'Item Purchased Via Paypal: " . $txn_id . "' where ItemNum = {$item_number}"); $update->query("delete from listing_index where `ItemNum` = '" . $item_number . "'"); subtract_catcounts($buy->f("category")); } else { $update->query("update items set quantity = '" . $quantity . "' where ItemNum = {$item_number}"); } if ($shipping) { $ship_method = $buy->f("ship" . $shipping); $ship_fee = $buy->f("shipfee" . $shipping); } else { $ship_method = "No Shipping Method Specified"; $ship_fee = "No Shipping Fee Specified"; } $item_title = $buy->f("title"); $seller = new clsDBNetConnect(); $seller->query("select * from users where user_id = '" . $buy->f("user_id") . "'"); if ($seller->next_record()) { $EP["EMAIL:ITEMTITLE"] = $item_title;
} if ($db->f("image_two")) { unlink("../" . $db->f("image_two")); } if ($db->f("image_three")) { unlink("../" . $db->f("image_three")); } if ($db->f("image_four")) { unlink("../" . $db->f("image_four")); } if ($db->f("image_five")) { unlink("../" . $db->f("image_five")); } } if ($db->f("status") == 1) { subtract_catcounts($db->f("category")); } $query = "delete from items where ItemNum = " . $_GET["delete"]; $db->query($query); $query = "delete from custom_dropdown_values where ItemNum = " . $_GET["delete"]; $db->query($query); $query = "delete from custom_textbox_values where ItemNum = " . $_GET["delete"]; $db->query($query); $query = "delete from custom_textarea_values where ItemNum = " . $_GET["delete"]; $db->query($query); } class clsGriditems { //items class @12-DDF99D24 //Variables @12-EAD8F07D // Public variables
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 Update() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate"); $SQL = "UPDATE items SET " . "end_reason=" . $this->ToSQL($this->end_reason->DBValue, $this->end_reason->DataType) . ", " . "status=" . $this->ToSQL($this->status->DBValue, $this->status->DataType) . " WHERE " . $this->Where; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteUpdate"); $this->query($SQL); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteUpdate"); if ($this->Errors->Count() > 0) { $this->Errors->AddError($this->Errors->ToString()); } $this->query("delete from listing_index where `ItemNum` = '" . $this->wp->GetDBValue("1") . "'"); $SQL = "SELECT `category` from items where `ItemNum` = '" . $this->wp->GetDBValue("1") . "'"; $this->query($SQL); if ($this->next_record()) { subtract_catcounts($this->f("category")); } }