1
$header = array(
array('data' => t('S No'), 'field' => 't.id'),
array('data' => t('Country Name'), 'field' => 't.country_name'),
array('data' => t('Status'), 'field' => 't.status'),
array('data' => t('Added Date'), 'field' => 't.added_date'),
array('data' => t('Action'), 'field' => 't.id',),
array('data' => t('Action'), '',),
);
$limit = 10;
$query = db_select('countries', 't')->extend('TableSort')->extend('PagerDefault')->limit($limit)->orderby('country_name', ASC);
//condition();
$query->fields('t');
//$edit=echo '<i class="fa fa-pencil-square-o"></i>';
//$edit=echo '<i class="fa fa-pencil-square-o"></i>';
// Don't forget to tell the query object how to find the header information.
$result = $query
->orderByHeader($header)
->execute();
$rows = array();
$i=1;
foreach ($result as $row) {
$rows[] = array(
$i,
//($x === 2) ? 0 : $x+1,
//$row->id,
$row->country_name,
//$row->status,
//$row->status,
$status = ($row->status == 0) ? 'Inactive' : 'Active',
date('d-m-Y H:i:s', strtotime($row->added_date)),
l('Edit', 'mypages/countries/'. $row->id),
l('Delete', 'mypages/delete/'. $row->country_name)
);
//print_r($status);
$i++;
}
在这个数据我在哪里,从数据库中获取数据并显示它..Now我想显示为动态管理一样的状态可以修改状态,如果他需要..如何使Drupal 7的可编辑字段在表中仅管理
$status = ($row->status == 0) ? 'Inactive' : 'Active',
在那里他可以让active or inactive
如果我们可以给降活性或非活性降低其更好..where管理员可以选择自动更新选择状态status..after .. 。 我正在显示S号作为编号,它是在第一页中工作的号码,如编号自动递增,其中编号为第二页..编号系统从最初重新开始...
什么是解决方案对于以上