Current File : /home/tradevaly/demo.tradevaly.com.bd/resources/views/frontend/buy-sell.blade.php
@extends('layouts.frontendOld')
    @section('content') 
	
	<style type="text/css">
		.form-group{padding: 0px}
		.invalid-feedback{display: block;}
	</style>
	
	<!--Start Company Area-->
	<div class="buy-sell-area fix">
		<div class="container">

			
			@if ($message = Session::get('success'))

	            <div class="alert alert-success alert-dismissible fade show text-center" role="alert" style="background: green;color: #fff">
	              <strong>Success !</strong> {{ $message }}
	              <button type="button" class="close" data-dismiss="alert" aria-label="Close">
	                <span aria-hidden="true">&times;</span>
	              </button>
	            </div>
	        @endif

	        

	        @if ($message = Session::get('error'))
	            <div class="alert alert-danger alert-dismissible fade show text-center" role="alert" style="background:red;color: #fff">
	              <strong>Sorry !</strong> {{ $message }}
	              <button type="button" class="close" data-dismiss="alert" aria-label="Close">
	                <span aria-hidden="true">&times;</span>
	              </button>
	            </div>
	        @endif  


			<div class="row">
				<div class="col-md-9 col-sm-12">
					<h2 class="hdng-08"><b><i class="fa fa-cart-plus"> </i> Buying/Selling</b></h2>

					


					<div class="tab">
						<button class="tablinks" onclick="openCity(event, 'Buying')">Buy offer</button>
						<button class="tablinks" onclick="openCity(event, 'Selling')" id="defaultOpen">Sell offer</button>
						<button class="tablinks" onclick="openCity(event, 'Trending')">Trending</button>
					</div>

					<div id="Buying" class="tabcontent">
						<!-- filter section -->
					<div class="row container">
					
						
						<div class="col-md-6">
							<div class="input-group mb-3">
							<label for="exampleFormControlSelect1">Select Category</label>	&nbsp;
								<select id="exampleFormControlSelect1" class="form-control">
								  <option>Packaging</option>
								  <option>Mechanical</option>
								  <option>Electronics</option>
								  <option>tools & Hardware</option>
								  
								</select>
						</div>
						</div>
						<div class="col-md-6">
						<div class="input-group mb-3">
						  <input type="text" class="form-control" placeholder="Type products name" aria-label="Search" aria-describedby="basic-addon2">
						  <div class="input-group-append">
							<button class="btn btn-outline-secondary" type="button">Search</button>
						  </div>
						</div>
													
						</div>
					
					</div>
					<!-- filter section end -->
						<h3 class="hdng-09"><b>Latest Buy offers</b></h3>
						
						@if( isset($dataBuy) && !empty($dataBuy) )

							@foreach($dataBuy as $value)
							<!--  Offers   -->
							<div class="row offers">
								<div class="col-md-3 col-sm-6">
									<ul class="offr-details" style="padding-left: 10px ">
										<li><b>{{ $value['product_name'] }}</b></li>
										
										<li><b>Date Post:</b> {{ date("d M Y", strtotime($value['created_at'])) }}</li>
										
									</ul>
								</div>
								<div class="col-md-3 col-sm-6">
									<ul class="offr-details">
										
										<li><b>Price:</b> {{ !empty($value['product_price'][0]['net_price']) ? $value['product_price'][0]['net_price']. ' Tk.' : '0.00 Tk.' }}  </li>
										
										<!-- <li><b>Posted By:</b> </li> -->
									</ul>
								</div>
								<div class="col-md-3 col-sm-12">
									<img src="{{ asset('storage/app/public/buy-sell/'.$value['feature_product_image']) }}" width="80">
								</div>
								<div class="col-md-3 col-sm-12">
									<ul class="offr-details2">
										<li><a href="">View Details</a></li>
										<li><a href="">Send Query</a></li>
									</ul>
								</div>
							</div>

							@endforeach
						@endif
						<!--  End Offers   -->

					

						
						
						
						
					</div>

					<div id="Selling" class="tabcontent">
					<!-- filter section -->
					<div class="row container">
					
						
						<div class="col-md-6">
							<div class="input-group mb-3">
							<label for="exampleFormControlSelect1">Select Category</label>	&nbsp;
								<select id="exampleFormControlSelect1" class="form-control">
								  <option>Packaging</option>
								  <option>Mechanical</option>
								  <option>Electronics</option>
								  <option>tools & Hardware</option>
								  
								</select>
						</div>
						</div>
						<div class="col-md-6">
						<div class="input-group mb-3">
						  <input type="text" class="form-control" placeholder="Type products name" aria-label="Search" aria-describedby="basic-addon2">
						  <div class="input-group-append">
							<button class="btn btn-outline-secondary" type="button">Search</button>
						  </div>
						</div>
													
						</div>
					
					</div>
					<!-- filter section end -->
						<h3 class="hdng-09"><b>Latest sell offers</b></h3>
						
						<!--  Offers   -->
						@if( isset($dataSell) && !empty($dataSell) )

							@foreach($dataSell as $value)
							<!--  Offers   -->
							<div class="row offers">
								<div class="col-md-3 col-sm-6">
									<ul class="offr-details" style="padding-left: 10px ">
										<li><b>{{ $value['product_name'] }}</b></li>
										
										<li><b>Date Post:</b> {{ date("d M Y", strtotime($value['created_at'])) }}</li>
										
									</ul>
								</div>
								<div class="col-md-3 col-sm-6">
									<ul class="offr-details">
										
										<li><b>Price:</b> {{ !empty($value['product_price'][0]['net_price']) ? $value['product_price'][0]['net_price']. ' Tk.' : '0.00 Tk.' }}  </li>
										
										<!-- <li><b>Posted By:</b> </li> -->
									</ul>
								</div>
								<div class="col-md-3 col-sm-12">
									<img src="{{ asset('storage/app/public/buy-sell/'.$value['feature_product_image']) }}" width="80">
								</div>
								<div class="col-md-3 col-sm-12">
									<ul class="offr-details2">
										<li><a href="">View Details</a></li>
										<li><a href="">Send Query</a></li>
									</ul>
								</div>
							</div>

							@endforeach
						@endif
						<!--  End Offers   -->
						
					</div>

					<div id="Trending" class="tabcontent">
					<!-- filter section -->
					<div class="row container">
					
						
						<div class="col-md-6">
							<div class="input-group mb-3">
							<label for="exampleFormControlSelect1">Select Category</label>	&nbsp;
								<select id="exampleFormControlSelect1" class="form-control">
								  <option>Packaging</option>
								  <option>Mechanical</option>
								  <option>Electronics</option>
								  <option>tools & Hardware</option>
								  
								</select>
						</div>
						</div>
						<div class="col-md-6">
						<div class="input-group mb-3">
						  <input type="text" class="form-control" placeholder="Type products name" aria-label="Search" aria-describedby="basic-addon2">
						  <div class="input-group-append">
							<button class="btn btn-outline-secondary" type="button">Search</button>
						  </div>
						</div>
													
						</div>
					
					</div>
					<!-- filter section end -->
						<h3 class="hdng-09"><b>Top tranding Buy/Sell offers</b></h3>
						<div class="row toptranding-list fix">

							@if( isset($dataTrending) && !empty($dataTrending) )

								@foreach($dataTrending as $value)
									<div class="col-md-3 col-sm-6">
										<div class="cat-list-03">
											<ul>
												<li><a href=""><i class="fa fa-angle-double-right"></i> {{ $value['product_name'] }}</a></li>
											</ul>
										</div>
									</div>
								@endforeach

							@endif



						</div>
					</div>
				</div>
				<div class="col-md-3  col-sm-12">
					<div class="post-inpt">
					<h2 class="hdng-08"><b><i class="fa fa-cart-plus"> </i> Quick Posting</b></h2>
					<div class="post-optn">
						{!! Form::open(array('url' => 'buy-sell','method'=>'POST', 'enctype'  => 'multipart/form-data')) !!}
                        
                        	<div class="form-group col-sm-12">
                                    <label for="exampleInputEmail1">Offer Type<span style="color: red"> *</span></label>
                                <div>
	                                {{ Form::radio('offer',1,null, array('class'=>'offer', 'required' => '')) }} Buy Offer

	                                {{ Form::radio('offer',2,null, array('class'=>'offer', 'required' => '', 'checked')) }} Sell Offer

	                                @error('offer')
	                                    <span class="invalid-feedback" role="alert">
	                                        <strong>{{ $errors->first('offer') }}</strong>
	                                    </span>
	                                @enderror

	                            </div>
	                        </div>


							<div class="form-group col-sm-12">
                                    <label for="exampleInputEmail1">Product Category<span style="color: red"> *</span></label>
                                <div>
										{!! Form::select('product_category_id', [''=>'Select Product Category']+$topCategory,[], array('id' => 'country_id', 'class' => 'form-control')) !!}

										@error('product_category_id')
			                                <span style="color: red;font-size: 12px">
			                                    <strong>{{ $errors->first('country_id') }}</strong>
			                                </span>
			                            @enderror
                        		</div>
                        	</div>

                            

                            <div class="form-group col-sm-12">
                                    <label for="exampleInputEmail1">Product Name<span style="color: red"> *</span></label>
                                <div>
	                                {!! Form::text('product_name', null, array('placeholder' => '','class' => 'form-control', 'required' => '')) !!}
                                                    
	                                @error('product_name')
	                                    <span class="invalid-feedback" role="alert">
	                                        <strong>{{ $errors->first('product_name') }}</strong>
	                                    </span>
	                                @enderror

	                            </div>
	                        </div>


                            <div class="form-group col-sm-12">
                                    <label for="exampleInputEmail1">Price<span style="color: red"> *</span></label>
                                <div>
	                                {!! Form::text('price', null, array('placeholder' => '','class' => 'form-control', 'required' => '')) !!}
                                                    
	                                @error('price')
	                                    <span class="invalid-feedback" role="alert">
	                                        <strong>{{ $errors->first('price') }}</strong>
	                                    </span>
	                                @enderror

	                            </div>
	                        </div>


	                        <div class="form-group col-sm-12">
                                    <label for="exampleInputEmail1">Product Description<span style="color: red"> *</span></label>
                                <div>
	                                {!! Form::textarea('description', null, array('placeholder' => '','class' => 'form-control' , 'required' => '', 'rows' => 4)) !!}
                                                    
	                                @error('description')
	                                    <span class="invalid-feedback" role="alert">
	                                        <strong>{{ $errors->first('description') }}</strong>
	                                    </span>
	                                @enderror

	                            </div>
	                        </div>

							
							<div class="form-group col-sm-12">
                                    <label for="exampleInputEmail1">Product Image<span style="color: red"> *</span></label>
                                <div>
	                                {!! Form::file('image', null, array('placeholder' => '','class' => 'form-control', 'required' => '')) !!}
                                                    
	                                @error('image')
	                                    <span class="invalid-feedback" role="alert">
	                                        <strong>{{ $errors->first('image') }}</strong>
	                                    </span>
	                                @enderror

	                            </div>
	                        </div>
                            
	                        <div class="form-group col-sm-12">
                                    <label for="exampleInputEmail1">Name<span style="color: red"> *</span></label>
                                <div>
	                                {!! Form::text('person_name', null, array('placeholder' => '','class' => 'form-control', 'required' => '')) !!}
                                                    
	                                @error('person_name')
	                                    <span class="invalid-feedback" role="alert">
	                                        <strong>{{ $errors->first('person_name') }}</strong>
	                                    </span>
	                                @enderror

	                            </div>
	                        </div>
                            

                            <div class="form-group col-sm-12">
                                    <label for="exampleInputEmail1">Mobile<span style="color: red"> *</span></label>
                                <div>
	                                {!! Form::text('mobile', null, array('placeholder' => '','class' => 'form-control', 'required' => '')) !!}
                                                    
	                                @error('mobile')
	                                    <span class="invalid-feedback" role="alert">
	                                        <strong>{{ $errors->first('mobile') }}</strong>
	                                    </span>
	                                @enderror

	                            </div>
	                        </div>
                            

	                        <div class="form-group col-sm-12">
                                    <label for="exampleInputEmail1">Email<span style="color: red"> *</span></label>
                                <div>
	                                {!! Form::text('email', null, array('placeholder' => '','class' => 'form-control', 'required' => '')) !!}
                                                    
	                                @error('email')
	                                    <span class="invalid-feedback" role="alert">
	                                        <strong>{{ $errors->first('email') }}</strong>
	                                    </span>
	                                @enderror

	                            </div>
	                        </div>
                            
							<div class="form-group col-sm-12">
                                    <label for="exampleInputEmail1">Company Name<span style="color: red"> *</span></label>
                                <div>
	                                {!! Form::text('company_name', null, array('placeholder' => '','class' => 'form-control', 'required' => '')) !!}
                                                    
	                                @error('company_name')
	                                    <span class="invalid-feedback" role="alert">
	                                        <strong>{{ $errors->first('company_name') }}</strong>
	                                    </span>
	                                @enderror

	                            </div>
	                        </div>



	                        <div class="form-group col-sm-12">
                                    <label for="exampleInputEmail1">Address<span style="color: red"> *</span></label>
                                <div>
	                                {!! Form::textarea('address', null, array('placeholder' => '','class' => 'form-control', 'required' => '', 'rows' => 4)) !!}
                                                    
	                                @error('address')
	                                    <span class="invalid-feedback" role="alert">
	                                        <strong>{{ $errors->first('address') }}</strong>
	                                    </span>
	                                @enderror

	                            </div>
	                        </div>


	                        <button type="submit" class="btn btn-success">Submit</button>
                        {!! Form::close() !!}
					</div>
					<!-- <div class="add-sctn"><img src="images/add4.png" alt="image" /></div> -->
					</div>
				</div>
			</div>
		</div>
	</div><!--End Company Area-->

	<script>
		function openCity(evt, cityName) {
		  var i, tabcontent, tablinks;
		  tabcontent = document.getElementsByClassName("tabcontent");
		  for (i = 0; i < tabcontent.length; i++) {
			tabcontent[i].style.display = "none";
		  }
		  tablinks = document.getElementsByClassName("tablinks");
		  for (i = 0; i < tablinks.length; i++) {
			tablinks[i].className = tablinks[i].className.replace(" active", "");
		  }
		  document.getElementById(cityName).style.display = "block";
		  evt.currentTarget.className += " active";
		}

		// Get the element with id="defaultOpen" and click on it
		document.getElementById("defaultOpen").click();
	</script>
	
@endsection