diff --git a/addons/default/visiosoft/advs-module/resources/css/list.css b/addons/default/visiosoft/advs-module/resources/css/list.css index 6cb92603a..e7df1d293 100644 --- a/addons/default/visiosoft/advs-module/resources/css/list.css +++ b/addons/default/visiosoft/advs-module/resources/css/list.css @@ -124,6 +124,52 @@ font-weight: 500; } +.result-text .filter-tabs > div { + margin: 3px 16px 4px 0; +} + +.result-text .filter-tabs div > span { + color: #292d2e; +} + +.result-text .filter-tabs a { + background-color: #eee; + font-size: 12px; + padding: 4px 7px; + border-radius: 2px; + text-decoration: none; + max-width: 400px; +} + +.result-text .filter-tabs a:hover { + background-color: #e0e0e0; +} + +.result-text .filter-tabs a span { + color: #666; +} + +.result-text .filter-tabs a:hover span { + color: #444; +} + +.result-text .filter-tabs a:hover button { + background-color: #CD7D22; +} + +.result-text .filter-tabs a button { + height: 12px; + width: 12px; + background-color: #EC9C4A; + border-radius: 2px; +} + +.result-text .filter-tabs a svg { + flex-shrink: 0; + height: 6px; + width: 6px; +} + a.sort-by-open-dropdown:hover { color: #8598AA !important; } diff --git a/addons/default/visiosoft/advs-module/resources/images/close.svg b/addons/default/visiosoft/advs-module/resources/images/close.svg new file mode 100644 index 000000000..07737b3d1 --- /dev/null +++ b/addons/default/visiosoft/advs-module/resources/images/close.svg @@ -0,0 +1,2 @@ + + diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php index cd0839ab2..987cbb876 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php @@ -4,9 +4,7 @@ use Anomaly\SettingsModule\Setting\Contract\SettingRepositoryInterface; use Anomaly\Streams\Platform\Http\Controller\PublicController; use Anomaly\Streams\Platform\Message\MessageBag; use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel; -use Anomaly\Streams\Platform\Model\Advs\PurchasePurchaseEntryModel; use Anomaly\Streams\Platform\Model\Complaints\ComplaintsComplainTypesEntryModel; -use Anomaly\Streams\Platform\Model\Options\OptionsAdvertisementEntryModel; use Anomaly\UsersModule\User\Contract\UserRepositoryInterface; use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Http\Request; @@ -19,16 +17,15 @@ use Visiosoft\AdvsModule\Adv\Event\ChangedStatusAd; use Visiosoft\AdvsModule\Adv\Event\CreatedAd; use Visiosoft\AdvsModule\Adv\Event\priceChange; use Visiosoft\AdvsModule\Adv\Event\showAdPhone; -use Visiosoft\AdvsModule\Adv\Event\UpdateAd; use Visiosoft\AdvsModule\Adv\Event\viewAd; use Visiosoft\AdvsModule\Adv\Form\AdvFormBuilder; use Visiosoft\AdvsModule\Option\Contract\OptionRepositoryInterface; use Visiosoft\AlgoliaModule\Search\SearchModel; -use Visiosoft\AlgoliatestModule\Http\Controller\Admin\IndexController; use Visiosoft\CatsModule\Category\CategoryModel; use Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface; use Visiosoft\CloudinaryModule\Video\VideoModel; -use Visiosoft\CommentsModule\Comment\Events\CreateNewComment; +use Visiosoft\CustomfieldsModule\CustomField\Contract\CustomFieldRepositoryInterface; +use Visiosoft\CustomfieldsModule\CustomField\CustomFieldModel; use Visiosoft\FavsModule\Http\Controller\FavsController; use Visiosoft\LocationModule\City\CityModel; use Visiosoft\LocationModule\City\CityRepository; @@ -36,11 +33,8 @@ use Visiosoft\LocationModule\Country\Contract\CountryRepositoryInterface; use Visiosoft\LocationModule\District\DistrictModel; use Visiosoft\LocationModule\Neighborhood\NeighborhoodModel; use Visiosoft\LocationModule\Village\VillageModel; -use Visiosoft\PackagesModule\Http\Controller\PackageFEController; use Visiosoft\PackagesModule\Package\PackageModel; use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface; -use Visiosoft\QrcontactModule\Qr\QrModel; -use Visiosoft\StoreModule\Ad\AdModel; class AdvsController extends PublicController { @@ -69,6 +63,11 @@ class AdvsController extends PublicController private $optionRepository; + + + + private $customFieldRepository; + public function __construct( UserRepositoryInterface $userRepository, @@ -95,7 +94,10 @@ class AdvsController extends PublicController Dispatcher $events, - Request $request + Request $request, + + + CustomFieldRepositoryInterface $customFieldRepository ) { $this->userRepository = $userRepository; @@ -125,6 +127,7 @@ class AdvsController extends PublicController parent::__construct(); $this->optionRepository = $optionRepository; + $this->customFieldRepository = $customFieldRepository; } @@ -292,6 +295,76 @@ class AdvsController extends PublicController $selectImage = $returnvalues['selectImage']; $ranges = $returnvalues['ranges']; $radio = $returnvalues['radio']; + + $customFieldParameters = array_filter($param, function ($var) { + return strpos($var, 'cf_') === 0 + || strpos($var, 'min_cf_') === 0 + || strpos($var, 'max_cf_') === 0; + }, ARRAY_FILTER_USE_KEY); + + $cFArray = array(); + foreach ($customFieldParameters as $id => $value) { + if (strpos($id, 'min_cf_') === 0 || strpos($id, 'max_cf_') === 0) { + $cFId = substr($id, 7); + $cF = $this->customFieldRepository->newQuery()->find($cFId); + $keyExists = array_key_exists($cFId, $cFArray); + if (strpos($id, 'min_cf_') === 0) { + if ($keyExists) { + $cFArray[$cFId] = [ + 'name' => $cFArray[$cFId]['name'], + 'value' => [ + 'min' => $value, + 'max' => $cFArray[$cFId]['value']['max'], + ] + ]; + } else { + $cFArray[$cFId] = [ + 'name' => $cF->name, + 'value' => [ + 'min' => $value, + ] + ]; + } + } else { + if ($keyExists) { + $cFArray[$cFId] = [ + 'name' => $cFArray[$cFId]['name'], + 'value' => [ + 'min' => $cFArray[$cFId]['value']['min'], + 'max' => $value, + ] + ]; + } else { + $cFArray[$cFId] = [ + 'name' => $cF->name, + 'value' => [ + 'max' => $value, + ] + ]; + } + } + } elseif (strpos($id, 'cf_') === 0) { + $cFId = substr($id, 3); + $cF = $this->customFieldRepository->newQuery()->find($cFId); + if ($cF->type === 'radio' || $cF->type === 'selecttop') { + $cFArray[$cFId] = [ + 'name' => $cF->name, + 'value' => reset($value) + ]; + } elseif ($cF->type === 'selectdropdown') { + $cFArray[$cFId] = [ + 'name' => $cF->name, + 'value' => $value + ]; + } elseif ($cF->type === 'select') { + $cFArray[$cFId] = [ + 'name' => $cF->name, + 'value' => $value + ]; + } + } + } + dd($cFArray); } Cookie::queue(Cookie::make('last_search', $this->requestHttp->getRequestUri(), 84000)); @@ -331,6 +404,8 @@ class AdvsController extends PublicController 'user', 'featured_advs', 'viewType', 'topfields', 'selectDropdown', 'selectRange', 'selectImage', 'ranges', 'seenList', 'radio', 'categoryId', 'cityId', 'allCats', 'catText'); +// dd($checkboxes, $radio, $param, $returnvalues , $topfields , $selectDropdown , $selectRange , $selectImage , $ranges); + return $this->viewTypeBasedRedirect($viewType, $compact); }