php


Query in callback column


I want to know how and where to write sql querys in order to show items by id and avoid to list all of them. As you can see, i have implemented a callback column, but it list all and not the elements by id.
Controller (callback column)
$crud->set_table('intervaloshorarios');
//$crud->columns('intervaloHorario', 'numeroVehiculos');
$crud->display_as('idCarga', 'Nº Entrega');
$crud->set_subject('Intervalos');
$crud->set_relation('idIntervaloHorario', 'entregas', 'numeroEntrega');
//Para cambiar los nombres de las columnas usar el display_as
//http://www.grocerycrud.com/documentation/options_functions/display_as
$crud->display_as('intervaloHorario', 'Intervalos Horarios')->display_as('numeroVehiculos', 'Plazas Disponibles');
$crud->callback_column('intervaloHorario', array($this, '_callback_intervalo_horario'));
Callback function
public function _callback_intervalo_horario($intervaloHorario, $row) {
return "<a href='" . base_url('index.php/Entregas_Controller/entregas_lista/' . $row->idIntervaloHorario) . "'>$intervaloHorario</a>";
}
The callback calls to the same webpage ?
Try with this:
if ( $this->uri->segment(3) != '' ) {
$crud->where('idIntervaloHorario', $this->uri->segment(3));
}

Related Links

Send PHP query result via JSON
jQuery AJAX call in jTable
Can't compare logi infos with database
Laravel $posts->comments() isn't working here
Regex to validate username not working
SQL Query to get the related data in different table
using subfolders in codeigniter causes problems
Working with variables from 3 tables
PYROCMS custom module routing is not working
How can I select all Eloquent models from a MySQL database inserted today, within the last week or the last month?
ORM 'or_where' use
NumberFormatter::SPELLOUT spellout-ordinal in russian and italian
I get {“error”:“unauthorized”} when trying to run .php file on Apache server
Product stock status update on success order in magento
select insert into not working
How to put string variable at mysql_resutl field?

Categories

HOME
xcode8.1
hdfs
ant
semantic-web
fogbugz
elk-stack
material-components
hyperledger
openfoam
telegraf
yahoo
cqrs
slide
tiff
cname
mpu6050
complexity-theory
orange-api
synthesis
google-sites
wsf
pymongo
channel
quartz.net
function-points
opentext
data-collection
high-availability
nic
infopath2010
netbios
markov-chains
autoencoder
netstat
cargo
variable-variables
tidal-scheduler
selenide
zend-form
ipp-protocol
realstudio
.net-micro-framework
phppgadmin
node-apn
openerp-6
nitrousio
gapi
pjax
metabase
jpda
xcode8-beta4
declarative
right-to-left
swiffy
jsr363
ioctl
deeplink
mousehover
dbmigrate
r.java-file
datagridcomboboxcolumn
berkeley-db-xml
squeezebox
rails-api
air-native-extension
ivalueconverter
pre
colon
tnt4j
microformats
sly-scroller
rikulo
first-class
cakeyframeanimation
quartz-core
firefly-mv
nsrangeexception
mediacontroller
jquery-1.4
ixmldomdocument
yahoo-maps
subtext
word-automation
parentid

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App