Jump to content

JJC

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

JJC's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sorry about the mass but it is the whole process. Can you give me directions on "join" or a link that explains this in this type of coding.
  2. How could I call in formation from a differant table/column in the data base. A member registers and enters data such as phone number and this info is held in users table. Now this member creates an ad and this info is held in the items table. How can I get data from this users "users" table to show ? This is the results page after a search and it shows the users ad with some of the data from the "items" table. [code]class clsGriditems { //items class @4-DDF99D24 //Variables @4-9DA56C47     // Public variables          var $Sorter_title;     var $Sorter_started;     var $Sorter_location;     var $Sorter_asking_price;     var $ComponentName;     var $Visible; var $Errors;     var $ds; var $PageSize;     var $SorterName = "";     var $SorterDirection = "";     var $PageNumber;     var $CCSEvents = "";     var $CCSEventResult;     // Grid Controls     var $StaticControls; var $RowControls;     var $Navigator; //End Variables //Class_Initialize Event @4-9E569F9C     function clsGriditems()     {         global $FileName;                 global $now;         $this->ComponentName = "items";         $this->Visible = True;         $this->Errors = new clsErrors();         $this->ds = new clsitemsDataSource();         $this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");         if(!is_numeric($this->PageSize) || !strlen($this->PageSize))             $this->PageSize = $now["pagentrys"];         else             $this->PageSize = intval($this->PageSize);         $this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));         $this->SorterName = CCGetParam("itemsOrder", "");         $this->SorterDirection = CCGetParam("itemsDir", "");         $this->bold = new clsControl(ccsLabel, "bold", "bold", ccsInteger, "", CCGetRequestParam("bold", ccsGet));         $this->bold->HTML = true;         $this->bold2 = new clsControl(ccsLabel, "bold2", "bold2", ccsText, "", CCGetRequestParam("bold2", ccsGet));         $this->bold2->HTML = true;         $this->background = new clsControl(ccsLabel, "background", "background", ccsInteger, "", CCGetRequestParam("background", ccsGet));         $this->background->HTML = true;         $this->image_preview = new clsControl(ccsLabel, "image_preview", "image_preview", ccsInteger, "", CCGetRequestParam("image_preview", ccsGet));                 $this->image_preview->HTML = true;         $this->image_one = new clsControl(ccsLabel, "image_one", "image_one", ccsText, "", CCGetRequestParam("image_one", ccsGet));                 $this->image_one->HTML = true;         $this->ItemNum = new clsControl(ccsLabel, "ItemNum", "ItemNum", ccsInteger, "", CCGetRequestParam("ItemNum", ccsGet));         $this->title = new clsControl(ccsLabel, "title", "title", ccsText, "", CCGetRequestParam("title", ccsGet));         $this->titleb = new clsControl(ccsLabel, "titleb", "titleb", ccsText, "", CCGetRequestParam("titleb", ccsGet));         $this->keya = new clsControl(ccsLabel, "keya", "keya", ccsInteger, "", CCGetRequestParam("keya", ccsGet));         $this->keya->HTML = true;         $this->image_twentyone = new clsControl(ccsLabel, "image_twentyone", "image_twentyone", ccsText, "", CCGetRequestParam("image_twentyone", ccsGet));         $this->image_twentyone->HTML = true;         $this->key30 = new clsControl(ccsLabel, "key30", "key30", ccsText, "", CCGetRequestParam("key30", ccsGet));     $this->key34 = new clsControl(ccsLabel, "key34", "key34", ccsText, "", CCGetRequestParam("key34", ccsGet));         $this->key35 = new clsControl(ccsLabel, "key35", "key35", ccsText, "", CCGetRequestParam("key35", ccsGet));         $this->key36 = new clsControl(ccsLabel, "key36", "key36", ccsText, "", CCGetRequestParam("key36", ccsGet));         $this->key37 = new clsControl(ccsLabel, "key37", "key37", ccsText, "", CCGetRequestParam("key37", ccsGet));         $this->key38 = new clsControl(ccsLabel, "key38", "key38", ccsText, "", CCGetRequestParam("key38", ccsGet));         $this->key39 = new clsControl(ccsLabel, "key39", "key39", ccsText, "", CCGetRequestParam("key39", ccsGet));              $this->key1 = new clsControl(ccsLabel, "key1", "key1", ccsText, "", CCGetRequestParam("key1", ccsGet));         $this->key2 = new clsControl(ccsLabel, "key2", "key2", ccsText, "", CCGetRequestParam("key2", ccsGet));         $this->key3 = new clsControl(ccsLabel, "key3", "key3", ccsText, "", CCGetRequestParam("key3", ccsGet));         $this->key4 = new clsControl(ccsLabel, "key4", "key4", ccsText, "", CCGetRequestParam("key4", ccsGet));         $this->key5 = new clsControl(ccsLabel, "key5", "key5", ccsText, "", CCGetRequestParam("key5", ccsGet));         $this->key6 = new clsControl(ccsLabel, "key6", "key6", ccsText, "", CCGetRequestParam("key6", ccsGet));         $this->key7 = new clsControl(ccsLabel, "key7", "key7", ccsText, "", CCGetRequestParam("key7", ccsGet));         $this->key8 = new clsControl(ccsLabel, "key8", "key8", ccsText, "", CCGetRequestParam("key8", ccsGet));         $this->key24 = new clsControl(ccsLabel, "key24", "key24", ccsText, "", CCGetRequestParam("key24", ccsGet));         $this->category = new clsControl(ccsLabel, "category", "category", ccsText, "", CCGetRequestParam("category", ccsGet));         $this->business_name = new clsControl(ccsLabel, "business_name", "business_name", ccsText, "", CCGetRequestParam("business_name", ccsGet));         $this->make_offer = new clsControl(ccsLabel, "make_offer", "make_offer", ccsInteger, "", CCGetRequestParam("make_offer", ccsGet));         $this->make_offer->HTML = true;         $this->city_town = new clsControl(ccsLabel, "city_town", "city_town", ccsText, "", CCGetRequestParam("city_town", ccsGet));         $this->state_province = new clsControl(ccsLabel, "state_province", "state_province", ccsText, "", CCGetRequestParam("state_province", ccsGet));         $this->asking_price = new clsControl(ccsLabel, "asking_price", "asking_price", ccsFloat, Array(False, 2, ".", "", False, "", "", 1, True, ""), CCGetRequestParam("asking_price", ccsGet));         $this->started = new clsControl(ccsLabel, "started", "started", ccsInteger, "", CCGetRequestParam("started", ccsGet));         $this->gallerylink = new clsControl(ccsLink, "gallerylink", "gallerylink", ccsText, "", CCGetRequestParam("gallerylink", ccsGet));         $this->gallerylink->Parameters = CCGetQueryString("QueryString", Array("ccsForm"));         $this->gallerylink->Page = "gallery.php";         $this->Sorter_title = new clsSorter($this->ComponentName, "Sorter_title", $FileName);         $this->Sorter_started = new clsSorter($this->ComponentName, "Sorter_started", $FileName);         $this->Sorter_asking_price = new clsSorter($this->ComponentName, "Sorter_asking_price", $FileName);         $this->Sorter_business_name = new clsSorter($this->ComponentName, "Sorter_business_name", $FileName);         $this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpCentered);     } //End Class_Initialize Event //Initialize Method @4-383CA3E0     function Initialize()     {         if(!$this->Visible) return;         $this->ds->PageSize = $this->PageSize;         $this->ds->SetOrder($this->SorterName, $this->SorterDirection);         $this->ds->AbsolutePage = $this->PageNumber;     } //End Initialize Method //Show Method @4-B28B5156     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='" . $userfind . "'",$findDB);                         if($GetUser == NULL){                                 $GetUser = 1000000000000;                         }                 }                 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\"borderclor=\"#000000\" border=\"1\"  colspan=\"8\"> Featured Ads</td></tr>");                                         $featcount++;                                 }                                 if($this->ds->cat_featured->GetValue() < 1 && ($featcount == 1)) {                                         $this->image_one->SetValue("<tr><td class=\"feat\" height=\"27\" borderclor=\"#000000\" border=\"1\" colspan=\"8\"> None Featured ADs—</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=\"#FFFFF0\"");                                 }else{                                         $this->background->SetValue("bgcolor=\"#FFFFFF\"");                                 }                                 if($this->ds->image_preview->GetValue() == 1 && $this->ds->image_one->GetValue() != ""){                                     if ($now["has_gd"])                                         $this->image_preview->SetValue("<table bgcolor=\"#000000\" border=\"1\" 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=150&widthsize=150&filename=". $this->ds->image_one->GetValue()."\" border=0 /></a></td></tr></table>");                                     else                                         $this->image_preview->SetValue("<table bgcolor=\"#000000\" border=\"1\" 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(),150,150,0,0) . "</a></td></tr></table>");                                 } elseif($this->ds->image_one->GetValue() != ""){                                         $this->image_preview->SetValue("<em><font color=\"#000000\"><strong>Image(s)</strong></font></em>");                                 } else {                                         $this->image_preview->SetValue("No Image");                                 }                                 $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("<em><font color=\"#FF0000\"><strong>Best Offer</strong></font></em>");                                 } 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());                                 }                                 if($this->ds->keya->GetValue() != ""){                         $this->keya->SetValue ("<font color=\"#ff0000\">M</font><font color=\"#0000ff\">A</font><font color=\"#FF0000\">P</font><font color=\"#0000FF\">Link</font>" );                                                                  } else {                                         $this->keya->SetValue("");                                         }                                         if($this->ds->image_twentyone->GetValue() != ""){                         $this->image_twentyone->SetValue($this->ds->image_twentyone->GetValue() . " ");                                                                  } else {                                         $this->image_twentyone->SetValue("images/noimage.gif hieght=\"1\" width=\"1\"");                                         }                                                                          $this->state_province->SetValue($this->ds->state_province->GetValue());                 $this->asking_price->SetValue($this->ds->asking_price->GetValue());                 $this->titleb->SetValue($this->ds->titleb->GetValue());                 //$this->keya->SetValue($this->ds->keya->GetValue());                 //$this->image_twentyone->SetValue($this->ds->image_twentyone->GetValue());                 $this->key30->SetValue($this->ds->key30->GetValue());                 $this->key34->SetValue($this->ds->key34->GetValue());                 $this->key35->SetValue($this->ds->key35->GetValue());                 $this->key36->SetValue($this->ds->key36->GetValue());                 $this->key37->SetValue($this->ds->key37->GetValue());                 $this->key38->SetValue($this->ds->key38->GetValue());                 $this->key39->SetValue($this->ds->key39->GetValue());                 $this->key1->SetValue($this->ds->key1->GetValue());                 $this->key2->SetValue($this->ds->key2->GetValue());                 $this->key3->SetValue($this->ds->key3->GetValue());                 $this->key4->SetValue($this->ds->key4->GetValue());                 $this->key5->SetValue($this->ds->key5->GetValue());                 $this->key6->SetValue($this->ds->key6->GetValue());                 $this->key7->SetValue($this->ds->key7->GetValue());                 $this->key8->SetValue($this->ds->key8->GetValue());                 $this->key24->SetValue($this->ds->key24->GetValue());                 $this->category->SetValue($this->ds->category->GetValue());                                 $this->business_name->SetValue($this->ds->business_name->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);                                                                  $jes = mysql_query ("SELECT a.template_var,b.value FROM custom_textarea a,custom_textarea_values b WHERE a.cat_id = {$_GET[CatID]} AND b.field_id = a.id AND b.ItemNum = ".$this->ds->ItemNum->GetValue());                 if (@mysql_num_rows($jes))                 while ($data = @mysql_fetch_row($jes))                    {                 $this->jimkey_custom = new clsControl(ccsLabel, $data[0], $data[0], ccsText, "", CCGetRequestParam($data[0], ccsGet));                 $this -> jimkey_custom  -> SetValue($data[1]);                 $this -> jimkey_custom  -> Show();                    }                 $jes = @mysql_query ("SELECT a.template_var,b.value FROM custom_textbox a,custom_textbox_values b WHERE a.cat_id = {$_GET[CatID]} AND b.field_id = a.id AND b.ItemNum = ".$this->ds->ItemNum->GetValue());                 if (@mysql_num_rows($jes))                 while ($data = @mysql_fetch_row($jes))                    {                 $this->jimkey_custom = new clsControl(ccsLabel, $data[0], $data[0], ccsText, "", CCGetRequestParam($data[0], ccsGet));                 $this -> jimkey_custom  -> SetValue($data[1]);                 $this -> jimkey_custom  -> Show();                    }                 $jes = mysql_query ("SELECT a.template_var,c.option as value FROM custom_dropdown a,custom_dropdown_values b,custom_dropdown_options c                                        WHERE a.cat_id = {$_GET[CatID]} AND b.field_id = a.id AND b.option_id = c.id  AND b.ItemNum = ".$this->ds->ItemNum->GetValue());                 if (@mysql_num_rows($jes))                 while ($data = @mysql_fetch_row($jes))                    {                 $this->jimkey_custom = new clsControl(ccsLabel, $data[0], $data[0], ccsText, "", CCGetRequestParam($data[0], ccsGet));                 $this -> jimkey_custom  -> SetValue($data[1]);                 $this -> jimkey_custom  -> Show();                 }                 $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->titleb->Show();                 $this->keya->Show();                 $this->image_twentyone->Show();                 $this->key30->Show();                 $this->key34->Show();                 $this->key35->Show();                 $this->key36->Show();                 $this->key37->Show();                 $this->key38->Show();                 $this->key39->Show();                 $this->key1->Show();                 $this->key2->Show();                 $this->key3->Show();                 $this->key4->Show();                 $this->key5->Show();                 $this->key6->Show();                 $this-
  3. I am having problems previewing. I get the preview page and can come back and edit but [b]sometimes[/b] I get 1-40 of the same exact ad. in the data base there is two columns handling this previewitem and item. when you preview it should dump the previewitem table when returning right? It's as if you go back and forth it is creating the same ad. Again it doesn't fail every time. I am confused!!!! [code] <?php //BindEvents Method @1-A2F23582 function BindEvents() {     global $items;     $items->CCSEvents["OnValidate"] = "items_OnValidate";     global $items;     $items->CCSEvents["AfterInsert"] = "items_AfterInsert";     global $CCSEvents;     $CCSEvents["BeforeShow"] = "Page_BeforeShow"; } //End BindEvents Method function items_OnValidate() { //items_OnValidate @4-84873489 //Custom Code @33-2A29BDB7 //Validate Minimum Length @37-9F31AFB8     global $items;     if (strlen($items->title->GetValue()) < 3)     {         $items->title->Errors->addError("Your title must be atleast 3 characters long");     } //End Validate Minimum Length //Validate Minimum Value @38-5DC7FCB3     global $items;     if (($items->category->GetValue() == 1) || ($items->category->GetValue() < 1) || ($items->category->GetValue() == ""))     {         $items->category->Errors->addError("Invalid category selection");     } //End Validate Minimum Value //Validate Minimum Value @39-62603E15    //End Validate Minimum Value //Validate Minimum Value @40-76EFD938     global $items;     if (($items->image_one->GetValue() == "") && ($items->image_preview->GetValue() == 1))     {         $items->image_preview->Errors->addError("The image preview feature may only be used if an image is loaded into the first slot");     }     if ($items->description->GetValue() == "")     {          $items->description->Errors->addError("Your description cannot be empty");     }     if ($items->asking_price->GetValue() < 0)     {          $items->asking_price->Errors->addError("You have not specified a valid asking price. For no price, enter a 0. You inputed " . $items->asking_price->GetValue() . " in the field.");     }          if (($items->image_one->GetValue() == "") && ($items->gallery_featured->GetValue() == 1))     {         $items->gallery_featured->Errors->addError("The Gallery feature may only be used if an image is loaded into the first slot");     } //End Validate Minimum Value //Custom Code @69-2A29BDB7 global $items;     if (($items->image_one->GetValue() == "") && ($items->slide_show->GetValue() == 1))     {         $items->slide_show->Errors->addError("The slide show feature may only be used if an image is loaded into the first slot");     } //End Custom Code //End Custom Code } //Close items_OnValidate @4-FCB6E20C function items_AfterInsert() { //items_AfterInsert @4-9CB79601 //Custom Code @34-2A29BDB7 global $finalItemNum; //End Custom Code } //Close items_AfterInsert @4-FCB6E20C 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 } //Close Page_BeforeShow @1-FCB6E20C [/code]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.