problem with add_action
- Single Page
Posted 17 August 2012 - 15:34 PM
$crud->set_relation('hospitalname','hosptbl','hospital');
[b]and add action button:[/b]
$crud->add_action('Photos', '', '','ui-icon-image',array($this,'just_a_test'));
[b]and create function for the action button:[/b]
function just_a_test($primary_key , $row)
{
return "Scale: ".$row->hospitalname.".";
}
[b]the result is id number not the description of the relation, in this situation hospital. What is procedure for generate the description not id?[/b]
[b]Thanks,[/b]
[b]Javier.[/b]
Posted 17 August 2012 - 15:57 PM
Posted 17 August 2012 - 16:23 PM
--
-- Table structure for table `tbldtl`
--
CREATE TABLE `tbldtl` (
`id` int(10) NOT NULL auto_increment,
`casestatus` varchar(3) NOT NULL,
`surgerydate` date NOT NULL,
`salesman` varchar(3) NOT NULL,
`patientname` varchar(65) NOT NULL,
`insid` varchar(20) NOT NULL,
`billto` varchar(3) NOT NULL,
`mdname` varchar(3) NOT NULL,
`hospitalname` varchar(3) NOT NULL,
`surgery` varchar(65) NOT NULL,
`franquise` varchar(3) NOT NULL,
`postingdate` date NOT NULL,
`ordertype` varchar(65) NOT NULL,
`analistdate` date NOT NULL,
`metric` varchar(3) NOT NULL,
`aproveddate` date NOT NULL,
`receivebilldate` date NOT NULL,
`billingdate` date NOT NULL,
`ordernumber` varchar(65) NOT NULL,
`invoicenumber` varchar(65) NOT NULL,
`sendto3pl` date NOT NULL,
`comments` longtext NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1092 ;
[b]And this is table for the field hospitalname of detail:[/b]
--
-- Table structure for table `hosptbl`
--
CREATE TABLE `hosptbl` (
`id_hos` int(4) NOT NULL auto_increment,
`hospital` varchar(65) NOT NULL,
PRIMARY KEY (`id_hos`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Hospital Table' AUTO_INCREMENT=59 ;