Controllers API Reference
This document provides comprehensive documentation for all controllers in the Yoneily system.VideosController
Manages video content including file uploads, thumbnails, and video metadata. Location:app/controllers/videos_controller.php
Properties
$name: ‘Videos’$helpers: [‘Html’, ‘Form’, ‘Javascript’]$uses: [‘Video’, ‘News’, ‘Archivo’, ‘Category’]$paginate: Limit 15, ordered byfechacre_videosDESC
Methods
index()
Lists all videos with pagination. Returns: Paginated list of videosview($id)
Display details for a specific video.Video ID to view
add()
Create a new video with file uploads. Processes:- Video file upload
- Thumbnail generation and resizing
- Image conversion using SimpleImage
User ID creating the video
Device type for the file
Video thumbnail file
Video thumbnail image
edit($id)
Edit an existing video.Video ID to edit
delete($id)
Delete a video by ID.Video ID to delete
destacado($id)
Mark a video as featured (destacado = 1).Video ID to feature
nodestacado($id)
Unmark a video as featured (destacado = 0).Video ID to unfeature
VentasController
Handles sales transactions, shopping cart, and purchase management. Location:app/controllers/ventas_controller.php
Properties
$name: ‘Ventas’$helpers: [‘Html’, ‘Form’, ‘Javascript’]$uses: [‘Venta’, ‘Locale’, ‘Gallery’, ‘Denuncia’, ‘Promo’, ‘Page’, ‘Codigo’]$paginate: Limit 10, ordered byfechaDESC
Public Methods (No Auth Required)
These methods are publicly accessible viabeforeFilter():
add,consulta,denunciar,finalizar_denunciar,add_promo,consulta_promocion,denunciar_promo,miscompras,mismensajes,misreclamos,finalizar_compra,pdf_compra,carrito,cuantos,pdf_completo_venta,add_carrito
Methods
index()
List all sales transactions with pagination.add(usuario, cantidad, $cuantos)
Add a product sale transaction.Product (gallery) ID
User (register) ID
Store (locale) ID
Quantity to purchase
Total item count
1- Success0- Failed to save2- Product out of stock
add_carrito(usuario, cantidad, $cuantos)
Add item to shopping cart (same parameters asadd()).
add_promo(usuario, cantidad, $cuantos)
Add a promotion sale.Promotion ID
consulta(usuario, $local)
Check product availability and purchase history.Product ID
User ID
Store ID
3- Product available2- Out of stock4- Already purchased
consulta_promocion(usuario, $local)
Check promotion availability (same parameters asconsulta()).
finalizar_compra(numero_pago, $id_venta)
Finalize a purchase with payment information.Payment method
Payment reference number
Sale ID
miscompras()
View customer’s purchase history with pagination.mismensajes()
View customer’s messages with pagination.misreclamos()
View customer’s complaints/claims with pagination.pdf_compra($id)
Generate PDF receipt for a specific purchase.Sale ID
cuantos()
Get total count of sales. Returns: Integer countUsersController
Manages user accounts, authentication, and permissions. Location:app/controllers/users_controller.php
Properties
$name: ‘Users’$helpers: [‘Html’, ‘Form’, ‘Javascript’]$uses: [‘User’, ‘Group’, ‘Aco’, ‘Aro’, ‘ArosAco’, ‘Locale’]
Methods
index1()
List all users.add()
Create a new user account.Username
User password
Group ID for user role
add_vendedor()
Register a new vendor/seller with store association.Store ID to associate with vendor
Vendor code
Password (will be hashed with Security::hash)
edit($id)
Edit user information.User ID
edit_pass($id)
Change user password.User ID
Current password
New password
Confirm new password
delete($id)
Delete a user account.User ID to delete
permission($id)
Manage user permissions via ACL.User ID
ajax_load()
AJAX handler for updating user permissions. POST Parameters:key: User IDkey2: Permission aliaskey3: Current permission status (0 or 1)
login()
Display login page.logout()
Log out current user and destroy session.consulta_codigo($cod)
Check if a vendor code exists.Vendor code to check
RegistersController
Manages customer registration and profiles. Location:app/controllers/registers_controller.php
Properties
$name: ‘Registers’$helpers: [‘Html’, ‘Form’, ‘Javascript’]$uses: [‘Estado’, ‘Ciudade’, ‘Paise’, ‘Register’, ‘Phone’, ‘Archivo’, ‘Venta’]
Public Methods
These methods are publicly accessible:loginequi,add,acceso,recordar,finregistro,verpais,loginfacebook,miperfil,actualizardatos,salir,add_cliente
Methods
index()
List all registered customers with pagination.index_compras()
List all purchases with store filtering.add($pais)
Register a new customer.Customer email (must be unique)
Customer full name
Phone number
Phone country code
acceso()
Customer login via AJAX. POST Parameters:ema: Email addresspass: Password
loginfacebook($id)
Login via Facebook ID.Facebook ID
miperfil($id)
View and edit customer profile.Customer ID
recordar()
Password recovery via email.Email address for password recovery
activa($id)
Activate a customer account.Customer ID
desactiva($id)
Deactivate a customer account.Customer ID
Finalizar_compra($id)
Finalize a purchase and update customer reputation.Sale ID
puntuacion_positiva by 1
compra_falla($id)
Mark purchase as failed and update negative reputation.Sale ID
puntuacion_negativa by 1
PromosController
Manages promotional offers and special deals. Location:app/controllers/promos_controller.php
Properties
$name: ‘Promos’$helpers: [‘Html’, ‘Form’, ‘Javascript’]$uses: [‘Promo’, ‘Archivo’, ‘Category’, ‘Locale’]$paginate: Limit 10, ordered byfechacre_promoDESC
Methods
index()
List all promotions with store filtering.add()
Create a new promotion.Store name (will be converted to ID)
Promotion title
Promotion image
Available quantity
Price
- Resizes thumbnail to 450x280
- Creates slider image 779x280
- Sets
cantidad_existenteequal tocantidad - Initializes
prod_vendidosto 0
edit($id)
Edit an existing promotion.Promotion ID
delete($id)
Delete a promotion.Promotion ID
activa($id)
Activate/publish a promotion (publicar = 1).Promotion ID
desactiva($id)
Deactivate/unpublish a promotion (publicar = 0).Promotion ID
verlocal()
AJAX autocomplete for store search. GET Parameter:term: Search term
PagesController
Handles public pages, contact forms, and customer inquiries. Location:app/controllers/pages_controller.php
Properties
$name: ‘Pages’$helpers: [‘Html’, ‘Form’, ‘Javascript’]$uses: [‘Page’, ‘Aco’, ‘Aro’, ‘ArosAco’, ‘Video’, ‘Gallery’, ‘Phone’, ‘Promo’, ‘Estado’, ‘Ciudade’, ‘Register’, ‘User’, ‘Denuncia’, ‘Locale’]
Public Methods
These methods are publicly accessible:home,quienes,contactanos,mision,campanas,ofrendas,info,verestados,verciudad,detallepublicidad,detallegaleria,buscar,info_promo,registro_pregunta,registro_pregunta_galeria,info_galeria,detallelocales,delete_mensaje,promociones,productos
Methods
home()
Display homepage with random featured content. Returns:- Random featured video
- 18 random stores
- 5 random promotions
- 2 random videos
buscar($f)
Search for stores, products, and promotions.Search phrase
contactanos()
Contact form submission.Contact name
Email address
Phone number
Message content
detallepublicidad(url)
View promotion details.Promotion date
Promotion URL slug
detallegaleria(url)
View product/gallery details.Product date
Product URL slug
detallelocales(frase)
View store details with products and promotions.Store RIF (tax ID)
Search phrase
registro_pregunta()
Submit a question about a promotion.Customer ID
Promotion ID
Store ID
Question text
registro_pregunta_galeria()
Submit a question about a product.Customer ID
Product ID
Store ID
index_preguntas()
List unanswered questions with store filtering.responder_pregunta($id)
View question details for responding.Question ID
registro_respuesta()
Submit a response to a customer question.Original question ID
Response text
info_promo(usuario)
Display comments for a promotion.Promotion ID
User ID
info_galeria(usuario)
Display comments for a product.Product ID
User ID
existencia()
List products with available stock.agotados()
List out-of-stock products.promociones()
Browse all active promotions with pagination.productos()
Browse all active products with pagination.LocalesController
Manages stores/businesses in the system. Location:app/controllers/locales_controller.php
Properties
$name: ‘Locales’$helpers: [‘Html’, ‘Form’, ‘Javascript’]$uses: [‘Locale’, ‘Archivo’, ‘Category’, ‘User’, ‘Group’, ‘Aco’, ‘Aro’, ‘ArosAco’]$paginate: Limit 10, ordered bystatusDESC
Public Methods
acceso
Methods
index()
List all stores with pagination.add()
Register a new store.Business name
Tax ID (must be unique)
Manager first name
Manager last name
Manager ID number
Mobile phone
Store address
Store logo/image
Store location image
- Generates random 6-character code
- Resizes logo to 96x72 (thumbnail)
- Resizes logo to 600x480 (slider)
- Resizes location image to 600x480
edit($id)
Edit store information.Store ID
delete($id)
Delete a store.Store ID
activa($id)
Activate a store (status = 1).Store ID
desactiva($id)
Deactivate a store (status = 0).Store ID
pdf($id)
Generate PDF report for a store.Store ID
GroupsController
Manages user groups and group permissions. Location:app/controllers/groups_controller.php
Properties
$name: ‘Groups’$helpers: [‘Html’, ‘Form’, ‘Javascript’]
Methods
index()
List all user groups.add()
Create a new user group.Group name
edit($id)
Edit a user group.Group ID
delete($id)
Delete a user group.Group ID
permission($id)
Manage group permissions via ACL.Group ID
ajax_load()
AJAX handler for updating group permissions. POST Parameters:key: Group IDkey2: Permission aliaskey3: Permission status (0 or 1)
GalleriesController
Manages product galleries and images. Location:app/controllers/galleries_controller.php
Properties
$name: ‘Galleries’$helpers: [‘Html’, ‘Form’, ‘Javascript’]$uses: [‘Gallery’, ‘Archivo’, ‘Category’, ‘Locale’]$paginate: Limit 10, ordered byfechacre_galeriaDESC
Methods
index()
List all gallery items with store filtering.add()
Create a new gallery item.Store name (converted to ID)
Product title
Keywords/tags
Product description
Product image
Available quantity
Price
- Resizes thumbnail to 124x124
- Creates normal size 600x480
- Sets
cantidad_existenteequal tocantidad - Initializes
prod_vendidosto 0
edit($id)
Edit a gallery item.Gallery ID
delete($id)
Delete a gallery item.Gallery ID
activa($id)
Publish a gallery item (publicar = 1).Gallery ID
desactiva($id)
Unpublish a gallery item (publicar = 0).Gallery ID
verlocal()
AJAX autocomplete for store search. GET Parameter:term: Search term
DenunciasController
Handles customer complaints and claims. Location:app/controllers/denuncias_controller.php
Properties
$name: ‘Denuncias’$helpers: [‘Html’, ‘Form’, ‘Javascript’]$uses: [‘Denuncia’, ‘Locale’, ‘Gallery’, ‘User’]$paginate: Limit 10, ordered byfechaDESC
Public Methods
These methods are publicly accessible:add,consulta,denunciar,fin_denunciar,denunciar_promo,registro_reclamo,registro_denuncia,detallemensajepromo
Methods
index()
List all complaints with store filtering.denunciar()
Submit a complaint about a product.Product ID
Customer ID
Store ID
Complaint text
denunciar_promo()
Submit a complaint about a promotion.Promotion ID
Customer ID
Store ID
responder_denuncia($id)
View complaint details for responding.Complaint ID
registro_denuncia()
Submit a response to a complaint.Original complaint ID
Response text
delete($id)
Delete a complaint.Complaint ID