php递归出来的数据怎么分页显示啊 在线等 185
functionrecursionSpec($len,$sign){if($len<$sign){echo"for(vari_".$len."=0;i_".$len."<...
function recursionSpec($len,$sign) {
if($len < $sign){
echo "for (var i_".$len."=0; i_".$len."<spec_group_checked[".$len."].length; i_".$len."++){td_".(intval($len)+1)." = spec_group_checked[".$len."][i_".$len."];\n";
$len++;
recursionSpec($len,$sign);
}else{
echo "var tmp_spec_td = new Array();\n";
for($i=0; $i< $len; $i++){
echo "tmp_spec_td[".($i)."] = td_".($i+1)."[1];\n";
}
echo "tmp_spec_td.sort(function(a,b){return a-b});\n";
echo "var spec_bunch = 'i_';\n";
for($i=0; $i< $len; $i++){
echo "spec_bunch += tmp_spec_td[".($i)."];\n";
}
//echo "alert(spec_bunch);";
echo "str += '<input type=\"hidden\" name=\"spec['+spec_bunch+'][goods_id]\" nc_type=\"'+spec_bunch+'|id\" value=\"\" />';";
echo "if (td_1[2] != null) { str += '<input type=\"hidden\" name=\"spec['+spec_bunch+'][color]\" value=\"'+td_1[1]+'\" />';}";
for($i=0; $i< $len; $i++){
echo "str +='<td><input type=\"hidden\" name=\"spec['+spec_bunch+'][sp_value]['+td_".($i+1)."[1]+']\" value=\"'+td_".($i+1)."[0]+'\" />'+td_".($i+1)."[0]+'</td>';\n";
}
echo "str +='<td><input class=\"text price\" type=\"text\" name=\"spec['+spec_bunch+'][price]\" data_type=\"price\" nc_type=\"'+spec_bunch+'|price\" value=\"\" /><em class=\"add-on\"><i class=\"icon-renminbi\"></i></em></td><td><input class=\"text stock\" type=\"text\" name=\"spec['+spec_bunch+'][stock]\" data_type=\"stock\" nc_type=\"'+spec_bunch+'|stock\" value=\"\" /></td><td><input class=\"text stock\" type=\"text\" name=\"spec['+spec_bunch+'][alarm]\" data_type=\"alarm\" nc_type=\"'+spec_bunch+'|alarm\" value=\"\" /></td><td><input class=\"text price\" type=\"text\" name=\"spec['+spec_bunch+'][weight]\" data_type=\"weight\" nc_type=\"'+spec_bunch+'|weight\" value=\"\" /><em class=\"add-on\"><B>KG</B></em></td><td><input class=\"text price\" type=\"text\" name=\"spec['+spec_bunch+'][min]\" data_type=\"min\" nc_type=\"'+spec_bunch+'|min\" value=\"1\" /></td></tr>';\n";
for($i=0; $i< $len; $i++){
echo "}\n";
}
}
} 展开
if($len < $sign){
echo "for (var i_".$len."=0; i_".$len."<spec_group_checked[".$len."].length; i_".$len."++){td_".(intval($len)+1)." = spec_group_checked[".$len."][i_".$len."];\n";
$len++;
recursionSpec($len,$sign);
}else{
echo "var tmp_spec_td = new Array();\n";
for($i=0; $i< $len; $i++){
echo "tmp_spec_td[".($i)."] = td_".($i+1)."[1];\n";
}
echo "tmp_spec_td.sort(function(a,b){return a-b});\n";
echo "var spec_bunch = 'i_';\n";
for($i=0; $i< $len; $i++){
echo "spec_bunch += tmp_spec_td[".($i)."];\n";
}
//echo "alert(spec_bunch);";
echo "str += '<input type=\"hidden\" name=\"spec['+spec_bunch+'][goods_id]\" nc_type=\"'+spec_bunch+'|id\" value=\"\" />';";
echo "if (td_1[2] != null) { str += '<input type=\"hidden\" name=\"spec['+spec_bunch+'][color]\" value=\"'+td_1[1]+'\" />';}";
for($i=0; $i< $len; $i++){
echo "str +='<td><input type=\"hidden\" name=\"spec['+spec_bunch+'][sp_value]['+td_".($i+1)."[1]+']\" value=\"'+td_".($i+1)."[0]+'\" />'+td_".($i+1)."[0]+'</td>';\n";
}
echo "str +='<td><input class=\"text price\" type=\"text\" name=\"spec['+spec_bunch+'][price]\" data_type=\"price\" nc_type=\"'+spec_bunch+'|price\" value=\"\" /><em class=\"add-on\"><i class=\"icon-renminbi\"></i></em></td><td><input class=\"text stock\" type=\"text\" name=\"spec['+spec_bunch+'][stock]\" data_type=\"stock\" nc_type=\"'+spec_bunch+'|stock\" value=\"\" /></td><td><input class=\"text stock\" type=\"text\" name=\"spec['+spec_bunch+'][alarm]\" data_type=\"alarm\" nc_type=\"'+spec_bunch+'|alarm\" value=\"\" /></td><td><input class=\"text price\" type=\"text\" name=\"spec['+spec_bunch+'][weight]\" data_type=\"weight\" nc_type=\"'+spec_bunch+'|weight\" value=\"\" /><em class=\"add-on\"><B>KG</B></em></td><td><input class=\"text price\" type=\"text\" name=\"spec['+spec_bunch+'][min]\" data_type=\"min\" nc_type=\"'+spec_bunch+'|min\" value=\"1\" /></td></tr>';\n";
for($i=0; $i< $len; $i++){
echo "}\n";
}
}
} 展开
1个回答
2015-09-23
展开全部
php 如何实现翻页功能,就是一页显示不了所有数据,所以把数据分页显示,按下...我已经实现了分页,但是没有翻页功能,即点击翻页后,数据不显示,求大神帮忙,...
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询