Skip to content

Commit

Permalink
Adición paginación mods: Facturas, Ventas, Inventarios, Categorías y …
Browse files Browse the repository at this point in the history
…Clientes

Adición paginación mods: Facturas, Ventas, Inventarios, Categorías y Clientes
  • Loading branch information
FazeElian authored Mar 4, 2024
2 parents 18ddc75 + 16cc3cc commit 1becd3c
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function index(Request $request)
// Obtenemos valor de input de búsqueda
$inputSearchValue = trim($request->get("searchCategory"));

$categories = Category::paginate();
$categories = Category::paginate(8);

return view('Admin.category.index', compact('categories', "inputSearchValue"))
->with('i', (request()->input('page', 1) - 1) * $categories->perPage());
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/CustomerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CustomerController extends Controller
*/
public function index()
{
$customers = Customer::paginate();
$customers = Customer::paginate(8);

return view('Admin.customer.index', compact('customers'))
->with('i', (request()->input('page', 1) - 1) * $customers->perPage());
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/FactureController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FactureController extends Controller
{
public function index()
{
$factures = Facture::paginate();
$factures = Facture::paginate(8);

return view('Admin.facture.index', compact('factures'))
->with('i', (request()->input('page', 1) - 1) * $factures->perPage());
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/InventoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class InventoryController extends Controller
public function index(Request $request)
{
// Obtenemos el valor de búsqueda del formulario
$inputSearchValue = trim($request->get("inventorieSearch"));
$inputSearchValue = trim($request->get("search"));

// Contador autoincrementable para la columna "No" en la vista
$a = 0;
Expand All @@ -40,7 +40,7 @@ public function index(Request $request)
})
->orWhere("inventories.id", "LIKE", "%" . $inputSearchValue . "%")
->orderBy("inventories.product_id", "asc")
->paginate(10);
->paginate(8);

return view('Admin.inventory.index', compact("inventories", "i", "inputSearchValue"));
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ProductController extends Controller
public function index(Request $request)
{
// Obtenemos valor de input de búsqueda
$inputSearchValue = trim($request->get("productSearch"));
$inputSearchValue = trim($request->get("search"));

// Autoincrementable para Columna No de vista
$a = 0;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/SaleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SaleController extends Controller
{
public function index()
{
$sales = Sale::paginate();
$sales = Sale::paginate(8);

return view('Admin.sale.index', compact('sales'))
->with('i', (request()->input('page', 1) - 1) * $sales->perPage());
Expand Down
2 changes: 1 addition & 1 deletion public/assets/css/Admin/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ a{
.contenido-pag{
display: flex;
width: 80%;
height: 2000px;
height: auto;
margin: 0 10%;
margin-top: 40px;
flex-direction: column; /* Poner contenedores uno encima del otro como columna */
Expand Down
3 changes: 3 additions & 0 deletions resources/views/Admin/category/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
@endforelse
</table>

{{-- Paginación de registros --}}
{{ $categories->onEachSide(3)->links('Admin.pagination') }}

<!-- Opciones clientes -->
<div class="opciones-clientes">
<!-- Botón: Cancelar -->
Expand Down
3 changes: 3 additions & 0 deletions resources/views/Admin/customer/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
@endforelse
</table>

{{-- Paginación de registros --}}
{{ $customers->onEachSide(3)->links('Admin.pagination') }}

<!-- Opciones clientes -->
<div class="opciones-clientes">
<!-- Botón: Cancelar -->
Expand Down
3 changes: 3 additions & 0 deletions resources/views/Admin/facture/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
</div>
</div>
</div>

{{-- Paginación de registros --}}
{{ $factures->onEachSide(3)->links('Admin.pagination')}}
</section>

{{-- Alertas de acciones de factura --}}
Expand Down
5 changes: 4 additions & 1 deletion resources/views/Admin/inventory/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</div>

<form action="{{ route("inventories.index") }}" method="get" class="barra_busqueda">
<input type="search" name="inventorieSearch" id="barra_busqueda" placeholder="Buscar Producto">
<input type="search" name="search" id="barra_busqueda" placeholder="Buscar Producto">
</form>
</div>

Expand Down Expand Up @@ -75,6 +75,9 @@
@endforelse
</table>

{{-- Paginación de registros --}}
{{ $inventories->onEachSide(3)->links('Admin.pagination')}}

<!-- Opciones Inventario -->
<div class="opciones-inventario">
<!-- Botón: Cancelar -->
Expand Down
5 changes: 1 addition & 4 deletions resources/views/Admin/product/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

{{-- Hoja de estilos de este archivo --}}
<link rel="stylesheet" href="{{ asset("assets/css/Admin/modules/Products/products-styles.css") }}">

{{-- Hoja de estilos para la paginación de registros --}}
<link rel="stylesheet" href="{{ asset("assets/css/Admin/paginacion-registros.css")}}">
</head>
<body>
<!-- Contenido de página -->
Expand All @@ -34,7 +31,7 @@
</div>

<form action="{{ route("products.index") }}" method="get" class="barra_busqueda">
<input type="search" name="productSearch" id="barra_busqueda" placeholder="Buscar Producto" value="{{ $inputSearchValue }}" class="barra_busqueda">
<input type="search" name="search" id="barra_busqueda" placeholder="Buscar Producto" value="{{ $inputSearchValue }}" class="barra_busqueda">
</form>
</div>

Expand Down
3 changes: 3 additions & 0 deletions resources/views/Admin/sale/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
</div>
</div>
</div>

{{-- Paginación de registros --}}
{{ $sales->onEachSide(3)->links('Admin.pagination')}}
</section>

{{-- Alertas de acciones de venta --}}
Expand Down

0 comments on commit 1becd3c

Please sign in to comment.