/** * @project ApPHP Business Directory * @copyright (c) 2011 ApPHP * @author ApPHP <*****@*****.**> * @license http://www.gnu.org/licenses/ */ // *** Make sure the file isn't accessed directly defined('APPHP_EXEC') or die('Restricted Access'); //-------------------------------------------------------------------------- if ($objLogin->IsLoggedInAsCustomer() && Modules::IsModuleInstalled('listings')) { $action = MicroGrid::GetParameter('action'); $rid = MicroGrid::GetParameter('rid'); $mode = 'view'; $msg = ''; $objListings = Listings::Instance(); if ($action == 'add') { $mode = 'add'; } else { if ($action == 'create') { if ($objListings->AddRecord()) { if (ModulesSettings::Get('listings', 'pre_moderation_allow') == 'yes') { $msg = draw_success_message(_SUBMITTED_FOR_MODERATION, false); } else { $msg = draw_success_message(_ADDING_OPERATION_COMPLETED, false); } $mode = 'view'; } else { $msg = draw_important_message($objListings->error, false); $mode = 'add'; }
$mode = 'details'; } else { if ($action == 'cancel_add') { $mode = 'view'; } else { if ($action == 'cancel_edit') { $mode = 'view'; } } } } } } } } $objListings = Listings::Instance($listing_id); $listing_info_name = $objListings->GetField('business_name'); // Start main content draw_title_bar(prepare_breadcrumbs(array(_MY_ACCOUNT => '', _MY_LISTINGS => '', $listing_info_name => '', _CATEGORIES => '', ucfirst($action) => '')), prepare_permanent_link('index.php?customer=my_listings', _BUTTON_BACK)); //if($objSession->IsMessage('notice')) echo $objSession->GetMessage('notice'); echo $msg; draw_content_start(); if ($mode == 'view') { $objListingsCategories->DrawViewMode(); } else { if ($mode == 'add') { $objListingsCategories->DrawAddMode(); } else { if ($mode == 'edit') { $objListingsCategories->DrawEditMode($rid); } else {
/** * After-Insertion - add listing descriptions to description table */ public function AfterInsertRecord() { global $objLogin; $category_id = isset($_POST['category_id']) ? (int) $_POST['category_id'] : '0'; $objListings = Listings::Instance($this->listingId); $is_published = $objListings->GetField('is_published'); $access_level = $objListings->GetField('access_level'); if ($is_published == '1') { Categories::UpdateListingsCount($category_id, '+', $access_level); } }
<?php /** * @project ApPHP Business Directory * @copyright (c) 2011 ApPHP * @author ApPHP <*****@*****.**> * @license http://www.gnu.org/licenses/ */ // *** Make sure the file isn't accessed directly defined('APPHP_EXEC') or die('Restricted Access'); //-------------------------------------------------------------------------- $objListing = Listings::Instance(Application::Get('listing_id')); $objCategory = Categories::Instance(); $category_info = $objCategory->GetLevelsInfo($objListing->GetField('category_id')); draw_title_bar(prepare_breadcrumbs(array(_CATEGORIES => prepare_link('categories', '', '', 'all', _SEE_ALL, '', '', true), $category_info['third']['name'] => $category_info['third']['link'], $category_info['second']['name'] => $category_info['second']['link'], $category_info['first']['name'] => $category_info['first']['link']))); $objListing->DrawListing();
} else { if ($params['visitor_phone'] == '') { $msg = draw_important_message(str_replace('_FIELD_', '<b>' . _PHONE . '</b>', _FIELD_CANNOT_BE_EMPTY), false); $params['focus_field'] = 'visitor_phone'; } else { if ($params['visitor_locations'] == '') { $msg = draw_important_message(str_replace('_FIELD_', '<b>' . _LOCATION . '</b>', _FIELD_CANNOT_BE_EMPTY), false); $params['focus_field'] = 'visitor_locations'; } else { if ($params['visitor_sub_locations'] == '') { $msg = draw_important_message(str_replace('_FIELD_', '<b>' . _SUB_LOCATION . '</b>', _FIELD_CANNOT_BE_EMPTY), false); $params['focus_field'] = 'visitor_sub_locations'; } else { // direct inquiry if ($params['inquiry_type'] == '1') { $objListing = Listings::Instance($params['listing_id']); $plan_info = AdvertisePlans::GetPlanInfo($objListing->GetField('advertise_plan_id')); if ($plan_info[0]['inquiry_button'] != '1') { $msg = draw_important_message(_DIRECT_INQUIRY_NOT_ALLOWED, false); } if ($objListing->GetField('customer_id') == $objLogin->GetLoggedID()) { $msg = draw_important_message(_INQUIRY_TO_YOURSELF_PROHIBITED, false); } } if (empty($msg)) { $sql = 'INSERT INTO ' . TABLE_INQUIRIES . ' ( inquiry_type, category_id, listing_id, name, email,