sCurrBrowsedFile = 'manage_classifieds.php'; $oClassifieds -> bAdminMode = TRUE; print $oClassifieds -> PrintCommandForms(); if ($_REQUEST) { if (isset($_REQUEST['action'])) { if ((int)$_REQUEST['action']==3) { print $oClassifieds -> PrintFilterForm(); print $oClassifieds -> PrintFilteredAllAdvertisements(); ContentBlockFoot(); BottomCode(); return; } elseif ((int)$_REQUEST['action']==2) { $iClassifiedSubID = (int)$_REQUEST['FilterSubCat']; print $oClassifieds -> PrintSubRecords($iClassifiedSubID, TRUE); ContentBlockFoot(); BottomCode(); return; } elseif ((int)$_REQUEST['action']==1) { $iClassifiedID = (int)$_REQUEST['FilterCat']; print $oClassifieds -> PrintAllSubRecords($iClassifiedID); ContentBlockFoot(); BottomCode(); return; } } elseif (isset($_GET['bClassifiedID'])) { $iClassifiedID = (int)$_GET['bClassifiedID']; if ($iClassifiedID > 0) { print $oClassifieds -> PrintAllSubRecords($iClassifiedID); print $oClassifieds -> PrintBackLink(); ContentBlockFoot(); BottomCode(); return; } } elseif (isset($_GET['bSubClassifiedID'])) { $iSubClassifiedID = (int)$_GET['bSubClassifiedID']; if ($iSubClassifiedID > 0) { print $oClassifieds -> PrintSubRecords($iSubClassifiedID, TRUE); print $oClassifieds -> PrintBackLink(); ContentBlockFoot(); BottomCode(); return; } } elseif (isset($_REQUEST['iAction'])) { $sAddMainCatSuccC = MsgBox(_t('_AddMainCategory successfully added')); $sAddMainCatFailC = MsgBox(_t('_Failed to Insert AddMainCategory')); $sAddSubCatSuccC = MsgBox(_t('_AddSubCategory successfully added')); $sAddSubCatFailC = MsgBox(_t('_Failed to Insert AddSubCategory')); $sDelMainCatSuccC = MsgBox(_t('_DeleteMainCategory was successfully')); $sDelMainCatFailC = MsgBox(_t('_Failed to DeleteMainCategory')); $sDelSubCatSuccC = MsgBox(_t('_DeleteSubCategory was successfully')); $sDelSubCatFailC = MsgBox(_t('_Failed to DeleteSubCategory')); switch( $_REQUEST['iAction'] ) { case 'AddMainCategory': $sName = process_db_input( $_REQUEST['name1'] ); $sDescription = process_db_input( $_REQUEST['description1'] ); $sCustomName1 = process_db_input( $_REQUEST['CustomName1'] ); $sCustomName2 = process_db_input( $_REQUEST['CustomName2'] ); $sCustomAction1 = process_db_input( $_REQUEST['CustomAction1'] ); $sCustomAction2 = process_db_input( $_REQUEST['CustomAction2'] ); if ($sName=='') { print $sAddMainCatFailC; break; } $sqlRes = InsertC($sName, $sDescription, $sCustomName1, $sCustomName2, $sCustomAction1, $sCustomAction2); print (mysql_affected_rows()!=0) ? $sAddMainCatSuccC : $sAddMainCatFailC; break; case 'AddSubCategory': if (($_REQUEST['FilterCat']) AND (isset($_REQUEST['name2']))) { $sName = process_db_input( $_REQUEST['name2'] ); $sDescription = process_db_input( $_REQUEST['description2'] ); $sCategoryID = process_db_input( $_REQUEST['FilterCat'] ); if ((int)$sCategoryID < 1) { print $sAddSubCatFailC; break; } $sqlRes = InsertCS($sCategoryID, $sName, $sDescription); print (mysql_affected_rows()!=0) ? $sAddSubCatSuccC : $sAddSubCatFailC; } break; case 'DeleteMainCategory': if ($_REQUEST['FilterCat']) { $sCategoryID = process_db_input( $_REQUEST['FilterCat'] ); $query = "DELETE FROM `Classifieds` WHERE `ID` = '{$sCategoryID}'"; $sqlRes = db_res( $query ); print (mysql_affected_rows()!=0) ? $sDelMainCatSuccC : $sDelMainCatFailC; } break; case 'DeleteSubCategory': if ($_REQUEST['SubClassified']) { $sCategoryID = process_db_input( $_REQUEST['SubClassified'] ); $query = "DELETE FROM `ClassifiedsSubs` WHERE `ClassifiedsSubs`.`ID` = {$sCategoryID}"; $sqlRes = db_res( $query ); print (mysql_affected_rows()!=0) ? $sDelSubCatSuccC : $sDelSubCatFailC; } break; } } elseif (isset($_REQUEST['DeleteAdvertisementID'])) { $id = (int)$_REQUEST['DeleteAdvertisementID']; if ($id > 0) { //print ActionDeleteAdvertisement($id); print $oClassifieds->ActionDeleteAdvertisement($id); } } elseif (isset($_REQUEST['ActivateAdvertisementID'])) { $id = (int)$_REQUEST['ActivateAdvertisementID']; if ($id > 0) { print ActionActivateAdvertisement($id); } } elseif (isset($_REQUEST['ActivateAdvWholesale'])) { print UpdateAllNewAdvIntoActive(); } elseif (isset($_REQUEST['DeleteSelected'])) { print DeleteSelectedAdv(); } elseif (isset($_REQUEST['ApproveSelected'])) { print ApproveSelectedAdv(); } if (isset($_REQUEST['UpdatedAdvertisementID'])) { $id = (int)$_REQUEST['UpdatedAdvertisementID']; if ($id > 0) { if (isset($_REQUEST['DeletedPictureID']) && (int)$_REQUEST['DeletedPictureID']>0) { //delete a pic print $oClassifieds->ActionDeletePicture(); print $oClassifieds->PrintEditForm($id); } else { print $oClassifieds->ActionUpdateAdvertisementID($id); } } return; } elseif (isset($_REQUEST['EditAdvertisementID'])) { if (((int)$_REQUEST['EditAdvertisementID']) > 0) { print $oClassifieds -> PrintEditForm((int)$_REQUEST['EditAdvertisementID']); print $oClassifieds -> PrintBackLink(); ContentBlockFoot(); BottomCode(); return; } } elseif (isset($_REQUEST['ShowAdvertisementID'])) { if ($_REQUEST['ShowAdvertisementID'] > 0) { print $oClassifieds -> ActionPrintAdvertisement($_REQUEST['ShowAdvertisementID']); print $oClassifieds -> PrintBackLink(); ContentBlockFoot(); BottomCode(); return; } } elseif (isset($_REQUEST['BuyNow'])) { $advId = (int)$_REQUEST['IDAdv']; if ($advId > 0) { print $oClassifieds -> ActionBuyAdvertisement($advId); ContentBlockFoot(); BottomCode(); return; } } elseif (isset($_REQUEST['BuySendNow'])) { $advId = (int)$_REQUEST['IDAdv']; if ($advId > 0) { print $oClassifieds -> ActionBuySendMailAdvertisement($advId); ContentBlockFoot(); BottomCode(); return; } } elseif (isset($_REQUEST['UsersOtherListing'])) { $iProfileID = (int)$_REQUEST['IDProfile']; if ($iProfileID > -1) { print $oClassifieds -> PrintMyAds($iProfileID); ContentBlockFoot(); BottomCode(); return; } } } print $oClassifieds -> PrintManageClassifiedsForm(); $sCap1C = _t("_TREE_C_BRW"); $sCap2C = _t("_MODERATING"); print "