Setting Categories using tabs with Laravel - php

I would like to ask how to pull categories using tabs. I was able to pull all the items on one tab but I could not pull them per category. here is my code. The data comes from the database and seems to work on All items but I could not figure out how to pull them individually. I need some help with you expertise.
<div class="tab-content">
<div class="tab-pane container active" id="home">...</div>
<div class="tab-pane container fade" id="allItems">All Items
<div>
<div class="row">
<div class="col-12">
<div class="row">
#foreach($items as $per_item)
<div class="col-lg-4 col-6">
<div class="card mb-3">
<img src="{{$per_item->image_path}}" class="card-img-top">
<div class="card-body">
<small>{{$per_item->category->name}}</small>
<h4 class="card-title">
<a href="/items/{{$per_item->id}}">
{{$per_item->name}}
</a>
</h4>
<p class="card-text">{{$per_item->description}}</p>
<h3>{{$per_item->price}}</h3>
<form action="/cart/{{$per_item->id}}" method="POST">
#csrf
<div class="row">
<div class="col-12 col-md-5 col-lg-12 mb-2">
<input type="number" name="quantity" id="quantity"
class="w-100">
</div>
<div class="col-12 col-md-7 col-lg-12 mb-2">
<button type="submit" class="btn btn-primary">Add To
Cart</button>
</div>
</div>
</form>
</div>
</div>
</div>
#endforeach
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane container fade" id="consumables">Consumables
<div>
</div>
</div>
<div class="tab-pvane container fade" id="pnuematicTools">Pnuematic
Tools</div>

Related

Is there a way which i can use to pass a hidden input element value as a form action parameter when updating as part of update route in laravel?

I have managed to pass an id to a form as a hidden input element and would like to use the same id as a parameter when sending a PATCH request to update a single row in database.
<div class="container">
<!-- update route which requires id of the row u are trying to update and the link-->
<form action="{{route('transactions.update', )}}" method="post">
#csrf
<div class="row ">
<div class="col-sm">
<p>Fullnames</p>
</div>
<div class="col-sm">
<h6 id="names"></h6>
</div>
</div>
<div class="row">
<div class="col-sm">
<p>Account</p>
</div>
<div class="col-sm">
<h6 id="account"></h6>
</div>
</div>
<div class="row">
<div class="col-sm">
<p>Meter</p>
</div>
<div class="col-sm">
<h6 id="meter"></h6>
</div>
</div>
<!-- id passed from a selected value in table-->
<input type="hidden" id="trans_id">
<div class="row justify-content-around">
<button type="submit" class="btn btn-sm m-2 w-75" style="background-color: #335b7d; color: white">Approve</button>
</div>
<div class="row justify-content-around">
Reject
</div>
</form>
</div>
</div>
Thank you

folder to locate the pop up $error message in this code

I need to edit the error that shows if a user enters an amount below minimum but I can't find the file to edit the pop-up error response that shows if the amount I less than the withdrawal limit.
Here is the code.
<div class="row">
<div class="col-md-9">
<div class="card">
<div class="card-header">
<h4 class="card-title">withdrawal -
<small class="category">Cash Out Fund.</small>
</h4>
</div>
<div class="card-content">
<div class="row">
<div class="col-md-2">
<ul class="nav nav-pills nav-pills-icons nav-pills-primary nav-stacked" role="tablist">
<li class="active">
<a href="#withdraw" role="tab" data-toggle="tab">
<i class="material-icons">redeem</i>Withdraw
</a>
</li>
</ul>
</div>
<div class="col-md-10">
<div class="tab-content">
<div class="tab-pane active" id="withdraw">
<div class="alert alert-info">
<span class="text-center">Please Read before you proceed. You need to know processing fee:</span><br> #php $id=0;#endphp #foreach($gateways as $gateway) #php $id++;#endphp
<span>{{$id}}. <b>#if($gateway->name){{$gateway->name}}#endif #if($gateway->local_name){{$gateway->local_name}}#endif</b> we would charge you <b>{{config('app.currency_symbol')}} {{$gateway->fixed}}</b> fixed + <b>{{$gateway->percent}}%</b> to Withdraw.</span> #endforeach
</div>
<form action="{{route('userWithdraw.post')}}" method="post">
{{ csrf_field() }} #if(count($errors) > 0)
<div class="alert alert-danger alert-with-icon" data-notify="container">
<i class="material-icons" data-notify="icon">notifications</i>
<span data-notify="message">
#foreach($errors->all() as $error)
<li><strong> {{$error}} </strong></li>
#endforeach
</span>
</div>
<br> #endif
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="form-group label-floating">
<select class="selectpicker" name="gateway" data-style="btn btn-warning btn-round" title="Select Withdraw Gateway" data-size="7">
#if($gate->status == 1)
<option value="1000">{{$gate->name}}</option>
#endif #foreach($gateways as $gateway)
<option value="{{$gateway->id}}">{{$gateway->name}}</option>
#endforeach
</select>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="form-group label-floating">
<label class="control-label" for="account">Your PayPal</label>
<input id="account" name="account" type="text" class="form-control">
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="form-group label-floating">
<label class="control-label" for="amount">Withdraw Amount</label>
<input id="amount" name="amount" type="text" class="form-control">
</div>
</div>
</div>
I need to edit all error response that pops up in the file and any other error response on the entire website.

Can't open Bootstrap modal in codeigniter

I can't open my modal in CodeIgniter.
I did a view for the modal and then I loaded in the controller. But when I click on the button, it doesn't show anything. No response. head have the Jquery and Bootstrap imports in the correct order.
Here i show you my code:
cdashboard.php:
//header
$this->load->view('UI/vheader');
//sidebar
$this->load->view('UI/vsidebar',$data);
//modals
$data['modaltarea'] = $this->load->view('tareas/vmodalnewtarea',NULL,TRUE);
//data in dashboard
$this->load->view('vdashboard',$data);
//footer
$this->load->view('UI/vfooter');
vmodalnewtarea.php:
<div id="newTareaModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="newTarea" aria-hidden="true">
<div class="modal-dialog" >
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Tarea nueva</h5>
</div>
<div class="modal-body">
<div class="container-fluid">
<!--Importar plantilla-->
<div class="row">
<div class="col-md-12">
<h3>Importar plantilla</h3>
</div>
<div class="row">
<!--Proyecto-->
<div class="col-md-4">
</div>
<!--Fase-->
<div class="col-md-4">
</div>
<!--Tarea-->
<div class="col-md-4">
</div>
</div>
</div>
<!--Nueva Fase-->
<div class="row">
<div class="col-md-12">
<h3>Nueva Tarea</h3>
</div>
<div class="row">
<div class="col-md-4">
<div class="row">
<input type="text" placeholder="Nombre" required />
</div>
<div class="row">
<!--<table id="tableHitos" class="table table-bordered table-strip" >
<thead>
<th>
Hitos
</th>
</thead>
<tbody>
</tbody>
</table>-->
<a type="button" class="btn"><i class="fa fa-plus"></i></a>
</div>
</div>
<div class="col-md-8">
<textarea id="txtaTarea" rows="5" placeholder="Descripcion" required>
</textarea>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<p>
aaaaaa
</p>
</div>
</div>
</div>
</div>
And the view where I call the modal, on other view (vrowfase.php):
<div class="row fase">
<div class="col-lg-12">
<div class="col-lg-2 text-center">
<div class="callout callout-warning">
<h4><?= $fase->nombre?></h4>
<div class="progress progress-xxs">
<div class="progress-bar" role="progressbar" style="width: 50%">
</div>
</div>
</div>
</div>
<div class="projectBar col-lg-10">
<div class="row Bar">
<?= $tareas; ?>
<button type="button" class="btn btn-app text-center" data-toogle="modal" data-target="#newTareaModal">
<i class="fa fa-plus"></i>
Nueva Tarea
</button>
</div>
</div>
</div>
</div>
thanks for the help!
your modal id is
newTareaModal
and your data-target in button is
TareaModal
was a error writing.
on vrowfase.php I had "data-toogle" and is "data-toggle"
thank you anyway!

laravel foreach broke column

Sorry for title i couldn't think better title!
anyway, this is my blog page code:
#extends('layouts.frontend_index')
#section('title', 'Blog')
#section('content')
<div class="container">
<div class="row" style="margin-bottom:30px;">
<div class="col-md-8">
<div class="row">
#forelse($posts as $post)
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12" style="margin-bottom:15px;">
<div class="card card2">
<div class="cardimg">
<img src="{{ url('images/') }}/{{ $post->image }}" class="card-img-top" style="width:100%; height:auto; max-height:500px;" alt="{{ $post->title }}">
</div>
<div class="card-block">
<h4 class="card-title">{{$post->title}}</h4>
<p class="card-text">{!! str_limit($post->body, 10) !!}</p>
<p><a class="btn btn-block btn-link" href="{{ route('frontshow', $post->slug ) }}">Read More <i class="fa fa-arrow-right"></i></a></p>
</div>
</div>
</div>
#empty
<p>No Post Available yet!</p>
<div class="text-center">
<a class="btn btn-error" href="{{url('/')}}">Back to Main Page</a>
</div>
#endforelse
<div class="col-md-12 text-center">
{{$posts->links()}}
</div>
</div><!--end row-->
</div><!--end col-md-8-->
<div class="col-md-4">
<h3>Get Latest Updates...</h3>
<a target="_blank" href="https://t.me/studiotjd"><div id="telegram"></div></a>
<a target="_blank" href="https://www.facebook.com/studiotjd"><div id="facebook"></div></a>
<a target="_blank" href="https://www.instagram.com/studiotjd/"><div id="instagram"></div></a>
</div><!--end col-md-4-->
</div><!--end row-->
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-4 span3 wow rollIn" style="animation-delay: 1s;"><div id="Library"></div></div><!--end col-md-4-->
<div class="col-md-4 span3 wow bounceInDown center" style="animation-delay: 1s;"><div id="Library2"></div></div><!--end col-md-4-->
<div class="col-md-4 span3 wow bounceInRight" style="animation-delay: 1s;"><div id="Library3"></div></div><!--end col-md-4-->
</div><!--end row-->
</div><!--end col-md-12-->
</div><!--end row-->
</div>
#endsection
here is how it looks like in view:
I tried almost everything to fix this issue but nothing works!
As you can see in my inspect all col-md-4 goes under first col-md-4 and i don't know why
Is there anyone knows how to fix this issue?
try this
{{ strip_tags(str_limit($post->body, 10)) }}
I think you have html element stored in your database, and you are just using str_limit so the tags in your body is not closed.
problem is a height of div, check it on the inspector code. 1 px or more is

How we can create dynamic layout of columns with the help of bootstrap?

I am trying to make a dynamic column layout with the help of twitter bootstrap. All yellow blocks are generated in a for loop
Example
<div class="container">
<div class="col-lg-4">
Sidebar
</div>
<div class="col-lg-8">
<div class="col-lg-4"></div>
<div class="col-lg-4"></div>
<div class="col-lg-4"></div>
<div class="col-lg-4"></div>
<div class="col-lg-4"></div>
<div class="col-lg-4"></div>
<div class="col-lg-4"></div>
<div class="col-lg-4"></div>
<div class="col-lg-4"></div>
<div class="col-lg-4"></div>
</div>
You are missing the row elements:
<div class="container">
<div class="row">
<div class="col-sm-3">
Sidebar
</div>
<div class="col-sm-9">
<div class="row">
<div class="col-sm-4">1</div>
<div class="col-sm-4">2</div>
<div class="col-sm-4">3</div>
</div>
<div class="row">
<div class="col-sm-4">4</div>
<div class="col-sm-4">5</div>
<div class="col-sm-4">6</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-3">7</div>
<div class="col-sm-3">8</div>
<div class="col-sm-3">9</div>
<div class="col-sm-3">10</div>
</div>
</div>
Take a look at this demo bootply

Categories