adv adv php,jQuery插件advTable

这篇博客介绍了如何使用advTable jQuery插件创建一个功能丰富的用户表格,包括内容编辑、行选择、多选、数据源选择(如数据库、文件或HTML)、过滤、密码保护的数据库更新及日期选择等功能。通过示例代码展示了如何连接数据库并展示数据,以及如何配置PHP文件以处理数据库操作。此外,还提到了如何自定义列名和设置表格参数。
摘要由CSDN通过智能技术生成

jQuery插件advTable好的用户表处理程序、可编辑内容、可选行、多选排、源选择(数据库或文件或HTML)、过滤的内容、密码保护的数据库更新超时、调整大小、HTML5日期选择。

f52d29a5e54524ce24038046d81e16b2.png

//if table have children create from this or table dont have children crate from com.php with JSON or uploaded csv file see below.

//or load with this example method with my php class

require_once('mysql_db.php');

$db = Database::getInstance();

$db->connect();

$sql = "SELECT * FROM yourTable";

$table = $db->getHTMLtable($sql, 'yourId');

echo $table;

$db->disconnect();

?>

$(document).ready(function() {

// initialize with default setting $('#yourId').advTable() or add a new settings:

// This is default

$('#yourId').advTable({

src: 'database', // database is default else your uploaded file. Example 'upload/demo.csv'

name: "advTable", // Name required for table association in com.php file (com_mssql or com_mysql)

width: 1000, // table inner width numeric

height: 300, // table inner height numeric

delimiter: ';', // delimiter for csv file (download)

datePicker: true, // enable HTML5 date picker. Check field data. If this date or datetime then enable browser HTML5 datepicker.

buttons: { // handlers true:display, false:hide

addRow: true,

dellRow: true,

update: true,

reload: true,

search: true

},

php: {

id: 0, // unique database column index not editable

file: "com.php", // required for database handling (com_mssql or com_mysql)

user: "root", // add more user option (not working, yet)

timeout: 60000 // entered password timeout

}

});

});

// com php file configuration (bottom of the com php):

function assoc_table($value = '') {

$val = array();

if($value == 'advTable') {

$val['table'] = 'yourTable'; // configured name in script (name: "advTable") 'yourTable' is a real database table.

$val['pass'] ='admin'; // password for this table

}

return $val;

}

?>

// if you want change column name then add tags for this array(name_def.php):

$nevek = array(

'date' => 'Date',

'location' => 'Location',

'country_code' => 'Country code',

'country_name' => 'Country name',

'ip' => 'Ip address',

'id' => 'Identity',

'region' => 'Region',

'city' => 'City',

'postal_code' => 'Postal code',

'latitude' => 'Latitude',

'longitude' => 'Longitude'

);

?>

相关链接

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值