<?php
if (!defined('IN_CONTEXT')) die('access violation error!');

$cols = 4;//每个页面，每行4列展示
$category_manimun = 4;//模板类别展示最小值
$category_cols = 4;//模板分类列表4列排列
$sceenpic = substr($_SERVER['HTTP_REFERER'],0,strpos($_SERVER['HTTP_REFERER'],"admin/index.php"));
$tmp_arr = array();
$tmp_arr1 = array();
?>
<div id="loading_overlay" style="display:none;"></div>
<div id="loading_anim" style="display:none;"><img src="images/loadingAnimation.gif" /></div>
<style type="text/css">
.d_c_list{ width:692px; background:#f2f2f2;border:1px solid #e2e2e2;bottom:12px;right:1px;overflow: hidden;}
.d_c_list ul{background:none; height:auto; border:none;}
.d_c_list ul li{ width: 150px; float:left; _display:inline; white-space: nowrap; height:22px; line-height:22px; overflow:hidden; margin-bottom:5px;}
.template_grid {
	width: 100%;
}
.template_grid td {
	text-align: center;
	background: #f8f8f8;
	border:0px;
	/*padding-top:20px;*/
}
.template_grid td img.tpl_thumb {
	border-top: 2px solid #dedede;
	border-left: 2px solid #dedede;
	border-right: 2px solid #999;
	border-bottom: 2px solid #999;
	width: 160px;
	height: 120px;
	margin-top: 4px;
	padding:5px;
}

.template_grid td img.tpl_thumb1 {
	border-top: 2px solid #dedede;
	border-left: 2px solid #dedede;
	border-right: 2px solid #999;
	border-bottom: 2px solid #999;
	border-color:#f68b17;
	width: 160px;
	height: 120px;
	margin-top: 4px;
	padding:5px;
}

.template_grid .small {
    display: block;
    /*padding: 3px 0px;*/
}
#cate_new{background-color:#F8F8F8;}
#cate_new .selected{ background:url(images/selected_bg.jpg);color:#fff ;}
#cate_new .selected a{color:#fff !Important;}
#cate_new ul{height:33px;line-height:33px;list-style:none; margin:0 0 0 30px !Important; padding:5px 0; font-size:12px;}
#cate_new li{float:left;text-align:center;cursor:pointer;margin:0 !Important; padding:0; width:135px; height:33px; line-height:33px;background:url(images/selectli_bg.jpg)}
#cate_new li a{color:#000 !Important;display:block;width:135px; padding:0px !Important;}
#cate_new li a:hover{color:#fff !Important;}
#cate_new li:hover{background:url(images/selected_bg.jpg);}

</style>
<style>
#init{background:url(images/Init_bg.jpg) repeat-x; height:34px; font-size:12px; line-height:34px;}
#init_sub{float:left;background:url(images/Init_left.jpg) no-repeat;height:34px;}
#init_sub a{text-align:center; color:#fff; width:150px; display:block; background:url(images/Init_a.jpg) no-repeat; line-height:26px; margin:4px 4px 0px 4px;text-decoration:underline;}
#init_sub a:hover{background:url(images/Init_hover.jpg);}
#init_sub p{float:left; }
#init_right { background:url(images/Init_right.jpg) no-repeat top right;}
</style>
<script type="text/javascript" language="javascript">
<!--

function on_del_success(response) {
    var o_result = _eval_json(response);
    if (!o_result) {
    	reloadPage();
        return on_failure(response);
    }
    
    var stat = document.getElementById("admintpllst_stat");
    if (o_result.result == "ERROR") {
        stat.innerHTML = o_result.errmsg;
        reloadPage();
        return false;
    } else if (o_result.result == "OK") {
        stat.innerHTML = "<?php _e('OK, refreshing...'); ?>";
        reloadPage();
    } else {
    	reloadPage();
        return on_failure(response);
        
    }
}

function on_del_failure(response) {
	//错误消息最好改成“已超时”
	document.getElementById("admintpllst_stat").innerHTML = "<?php _e('Request failed!'); ?>";
    reloadPage();
    return false;
}

function delete_tpl(tpl_id) {
    if (confirm("Delete the selected template?")) {
        var stat = document.getElementById("admintpllst_stat");
        stat.style.display = "block";
        stat.innerHTML = "<?php _e('Deleting selected template...'); ?>";
        _ajax_request("mod_template", 
            "admin_delete", 
            {
                tpl_id:tpl_id
            }, 
            on_del_success, 
            on_del_failure);
    }
}

function on_tog_success(response) {
    var o_result = _eval_json(response);
    if (!o_result) {
    	reloadPage();
        return on_failure(response);
    }
    
    var stat = document.getElementById("admintpllst_stat");
    if (o_result.result == "ERROR") {
        stat.innerHTML = o_result.errmsg;
        alert(o_result.errmsg);
        reloadPage();
        return false;
    } else if (o_result.result == "OK") {
        stat.innerHTML = "<?php _e('OK, refreshing...'); ?>";
        reloadPage();
    } else {
    	reloadPage();
        return on_failure(response);
    }
}

function on_tog_failure(response) {
    on_del_failure(response);
}

function reset_tpl_data() {
	if (!confirm("<?php _e('This action will take some time to download the reset-data from the server,please be patient.'); ?>")) return;
    show_iframe_win("index.php?_m=mod_template&_a=show_reset_data","",'483','210');
//    _ajax_request("mod_template",
//        "reset_tpl_data", false, 
//        on_reset_success, 
//        on_reset_failure);
}

//安装模板时触发
function toggle_default(tpl_id, is_remote,tpl_name) {
    var remote_tpl = "0";
    var url = "index.php?_m=mod_template&_a=admin_getInstallInfo&_r=_ajax&tpl_id="+tpl_id;
    if (is_remote) {
        remote_tpl = "1";
    }

	    $.post(url,{tpl_id:tpl_id},function(data){
				if(data == 'pass'){
					show_iframe_win("index.php?_m=mod_template&_a=template_remote&tag=pass&tpl_id="+tpl_id+"&is_remote="+remote_tpl+"&tpl_name="+tpl_name, '', 483, 210);
				}else if(data == 'refuse'){
					show_iframe_win("index.php?_m=mod_template&_a=template_remote&tag=refuse&tpl_id="+tpl_id+"&is_remote="+remote_tpl+"&tpl_name="+tpl_name, '', 483, 210);
					
				}else if(data == 'error2'){
					show_iframe_win("index.php?_m=mod_template&_a=template_remote&tag=error2&tpl_id="+tpl_id+"&is_remote="+remote_tpl+"&tpl_name="+tpl_name, '', 483, 210);
				}else{
					show_iframe_win("index.php?_m=mod_template&_a=template_remote&tag=net&tpl_id="+tpl_id+"&is_remote="+remote_tpl+"&tpl_name="+tpl_name, '', 483, 210);
					
				}
			})	

}

//设为默认模板时触发
function make_default(tpl_name) {
		show_iframe_win('index.php?_m=mod_template&_a=template_local&tpl_name='+tpl_name, '', 483, 210);
}
function directId(val){
	if (!/\d+/.test(val))
	{
		alert("请输入数字！")
		return false;
	}
	
	location.href="index.php?_m=mod_template&_a=admin_list&tpl_id=" + val;
}

//-->
</script>

<?php 
$bool1 = extension_loaded('zip');
$bool2 = extension_loaded('soap');
$bool1 = true;//现在不用soap
$bool2 = true;//现在不用zip
$is_ping=true;
if(!$is_ping)
{
	_e('Abnormal network conditions');
	die;
}

if(($bool1 && $bool2)){
?>


<div id="init">
		<!--修改网站初始化-->
        <div id="init_sub"><!--a href="#" onclick="reset_tpl_data();return false;"><?php //_e('Website Initialization');?></a--></div>
        <div id="init_right"><!--<marquee scrollAmount=2 width="80%"> <?php _e('Website Initialization Help');?></marquee>--></div>
    </div>
<div class="status_bar">
    <span id="admintpllst_stat" class="status" style="display:none;"></span>
</div>
<?php }?>
<table class="list_table" id="admin_tpl_list" width="100%" border="0" cellspacing="1" cellpadding="2" style="line-height:24px;">
	<thead>
	</thead>
    <tbody>
	    <tr>
		    <td>
			    <table class="template_grid" cellspacing="0">
			    	<?php
			    	$html_script = "<div class='d_c_list'><ul style='background:none;border:none;'><li><a href='index.php?_m=mod_template&_a=admin_list&_cates=_all&_p=1'>所有模板</a><span style='color:#c7c7c7'></span></li>";
			    	if(empty($tmplate_category)) $tmplate_category = array();
			    	foreach($tmplate_category as $k => $v)
			    	{
			    		if($v['amount'] >= $category_manimun && $v['super_id']==0)
			    		{
			    			$html_script .= "<li><a href='index.php?_m=mod_template&_a=admin_list&_cates={$v['id']}&sub_id={$v['super_id']}&_p=1'>{$v['name']}</a><span style='color:#c7c7c7'></span></li>";
			    		}
			    	}
					//修改后台模版列表不获取远程数据	
			    	$html_script .= '</ul></div>';
			    	//获取默认模板文件夹名称
			    	$n_tpls = sizeof($output_array);
			    	// 2011/02/25 过滤模板搜索结果中当前模板的记录 >>
			    	$tpl_id = trim(ParamHolder::get('tpl_id', 0));
//			    	if ($n_tpls && (intval($tpl_id) > 0)) {
//			    		if($install_template_num>0) $output_array=array_slice($output_array, $install_template_num);
//			    		$n_tpls -= $install_template_num;
//			    	} // 2011/02/25 <<
			    	$count_number = count($template_owns);
			    	if($category_number == '_all'&&intval($tpl_id)==0){
			    	for($i = 0; $i < $count_number; $i++)
			    	{
			    		if(is_array($template_owns[$i])) 
			    		{
			    			continue;
			    		}
			    		$tmp_arr1 = explode('#$',$template_owns[$i]);
						
			    		if(DEFAULT_TPL == $tmp_arr1[0])	//show choosed template
			    		{
			    			echo "<tr>";
			    			echo '<td width="'.intval(100 / $cols).'%">';
			    			echo '<a href="'.Html::uriquery('mod_modules', 'index').'" target="_blank" title="'.__('Manage Layout').'"><div><img style="position:relative;left:2px;" class="tpl_thumb" src="../template/'.$tmp_arr1[0].'/screenshot.jpg" onmouseover="this.className=\''.'tpl_thumb1'.'\'" onmouseout="this.className=\''.'tpl_thumb'.'\'"/></div></a><span class="small">';
							echo '模板编号:'.$tmp_arr1[2].'&nbsp;&nbsp;&nbsp;'.__('default template');
				            echo '&nbsp;';
			            	echo '</span>请输入模板编号:<input type="text" value="" id="idNumber" style="width:42px;"  name="idNumber" ><a href="###" onClick="javascript:directId(document.getElementById(\'idNumber\').value);">搜索</a></td><td style="text-align:left;">'.$html_script.'</td></tr>';
			            	break;
			    		}
			    	}
					
			    echo '</table>';
			    } else {
			    	echo "<tr>";
			    	echo '<td width="'.intval(100 / $cols).'%">';
			    	echo '<a href="'.Html::uriquery('mod_modules', 'index').'" target="_blank" title="'.__('Manage Layout').'"><div><img style="position:relative;left:2px;" class="tpl_thumb" src="../template/'.DEFAULT_TPL.'/screenshot.jpg" onmouseover="this.className=\''.'tpl_thumb1'.'\'" onmouseout="this.className=\''.'tpl_thumb'.'\'"/></div></a><span class="small">';
			    	//include_once(ROOT.DS.'template'.DS.DEFAULT_TPL.DS.'conf.php');

			    	echo '模板编号:'.$template_name.'&nbsp;&nbsp;&nbsp;'.__('default template');
			    	echo '&nbsp;';
			    	echo '</span>请输入模板编号:<input type="text" value="" id="idNumber" style="width:42px;"  name="idNumber" ><a href="###" onClick="javascript:directId(document.getElementById(\'idNumber\').value);">搜索</a></td><td style="text-align:left;">'.$html_script.'</td></tr>';
			    	echo '</table>';
			    }
			    if(!($bool1 && $bool2))
			    {
			    	echo '</td></tr></tbody></table>';
			    	if(!$bool1 && $bool2)
			    		echo '<div style="font-size:24px;font-weight:24px;">'._e('Please install zip extension!').'</div>';
			    	elseif($bool1 && !$bool2)
			    		echo '<div style="font-size:24px;font-weight:24px;">'._e('Please install soap extension!').'</div>';
			    	else
			    		echo '<div style="font-size:24px;font-weight:24px;">'._e('Please install soap extension!').'</div>';
			    	die;
			    }
				echo '<div style="clear:both;"></div><div id="cate_new"><ul>';
				if($category_number=="_all" || $category_number=="_free"){
					if($category_number=="_free"){
						$sub_id_class = 'class="selected"';
					}else{
						$sub_id_class = '';
					}
					echo "<li ".$sub_id_class."><a href='index.php?_m=mod_template&_a=admin_list&_cates=_free&sub_id={$val['sub_id']}&_p=1'>".'免费模版'."</a></li>";
					if($category_number=="_all"){
						$sub_id_class = 'class="selected"';
					}else{
						$sub_id_class = '';
					}
					echo "<li ".$sub_id_class."><a href='index.php?_m=mod_template&_a=admin_list&_cates=_all&sub_id={$val['sub_id']}&_p=1'>".'商业模版'."</a></li>";
				}else{
				foreach($tmplate_category as $val){
					if($val['sub_id']==$category_sub_id){
						$sub_id_class = 'class="selected"';
					}else{
						$sub_id_class = '';
					}
						if($val['super_id']==$category_number && $val['sub_id']>0){
							echo "<li ".$sub_id_class."><a href='index.php?_m=mod_template&_a=admin_list&_cates={$category_number}&sub_id={$val['sub_id']}&_p=1'>".$val['name']."</a></li>";
						}
					}
				}
				echo '</ul></div>';
			    echo '<table class="template_grid" cellspacing="0">';
			    	$i = 0;
			
			        while($i < $n_tpls)
			        {
			        	echo "<tr>";
			        	for($j = 0; $j < $cols; $j++)
			        	{
			        		if($i >= count($output_array))
			        		{
			        			break;	
			        		}
			        		
			        		if(is_array($output_array[$i]))//When getting remote templates happend..
			        		{
				        		if(DEFAULT_TPL_ID == $output_array[$i]['id'])
				        		{
				        			$i++;
				        			$j--;
				        			continue;	
				        		}	
			        		}
			    	?>
			            <td width="<?php echo intval(100 / $cols); ?>%">
			            	<?php if(!is_array($output_array[$i])){//Get local templates
			            			$tmp_arr = explode('#$',$output_array[$i]);
			            			if($tmp_arr[0] != DEFAULT_TPL)
			            			{
										if(!Toolkit::getAgent()||!Toolkit::getcorp()) {
											$tmp_arr[1] = DEFAULTPICURL.'sitedemo?id='.$tmp_arr[2];
										}
			            	?>
			            	<a href="<?php echo $tmp_arr[1];?>" target="_blank"><div id=<?php echo '"'.@$templates[$i]['id'].'"';?>><img class="tpl_thumb" src="<?php echo '../template/'.$tmp_arr[0].'/screenshot.jpg'; ?>" onmouseover="this.className='tpl_thumb1';" onmouseout="this.className='tpl_thumb';" title="<?php echo '企业网站-'.$output_array_name[$i]?>" /></div></a>
			            	<span class="small">
				            <?php
								echo '模板编号:'.$tmp_arr[2].'&nbsp;&nbsp;&nbsp;'."<a href='#' onclick=\"make_default('$tmp_arr[0]')\">".__('Install the choosed template')."</a>";
				            ?>
				            &nbsp;
			            	</span>
			            	<?php }else {?>
			            		<div id=<?php echo '"'.@$templates[$i]['id'].'"';?>><img class="tpl_thumb" src="<?php echo '../template/'.$tmp_arr[0].'/screenshot.jpg'; ?>" onmouseover="this.className='tpl_thumb1';" onmouseout="this.className='tpl_thumb';" title="<?php echo '企业网站-'.$output_array_name[$i]?>" /></div>
				            	<span class="small">
					            <?php
									echo '模板编号:'.$tmp_arr[2].'&nbsp;&nbsp;&nbsp;';_e('Installed');
					            ?>
					            &nbsp;
				            	</span>
			            	<?php }}else {?><!-- Get remote templates -->
			            	<?php 
                              $image_name =$output_array[$i]['screenshot'];
							if(!Toolkit::getAgent()||!Toolkit::getcorp()) {
								$output_array[$i]['demourl'] = DEFAULTPICURL.'sitedemo?id='.$output_array[$i]['id'];
							}
							$remote_flag ='true';
								
						        $tpl_name = substr($output_array[$i]['archive'],0,-4);
								$tpldir=$tpl_name;
			            	?>
			            	<a target='_blank' href="<?php echo DEFAULTPICURL.'sitedemo?id='.$output_array[$i]['id'];?>"><div id=<?php echo '"'.$output_array[$i]['id'].'"';?>><img class="tpl_thumb" src="<?php echo IMG_URL_BD."1/baohe/pic/".$tpldir.".gif"; //修改模版本地图片地址?>" onmouseover="this.className='tpl_thumb1';" onmouseout="this.className='tpl_thumb';" title="<?php echo $output_array[$i]['name'];?>"/></div></a>
					        <span class="small">
						    <?php

//						        $remote_flag = isset($output_array[$i]['package_url'])?'true':'false';
                                echo '模板编号:'.$output_array[$i]['id'].'&nbsp;&nbsp;';
								if(file_exists(ROOT."/upload/".$tpldir.'_2_sample.sql')&&file_exists(ROOT."/template/".$tpldir.'/template_info.php')){
									
								}else{
									//echo '<a href="'.IMG_URL_BD.'" target="_blank">'.__('Download').'</a>';
								}
								echo '<a href="#" onclick="toggle_default(\''.$output_array[$i]['id'].'\', '.$remote_flag.',\''.$tpl_name.'\');return false;" title="'.__('Install the choosed template').'">'.__('Install the choosed template').'</a>';
						    ?>
						    &nbsp;
					        </span>
			            	<?php }?>
			            </td>
			        <?php
				        	$i++;
			        	}
			        	for($a = 0; $a < $cols-$j; $a++)
			        	{
			        		 echo '<td width="'.intval(100 / $cols).'%"></td>';
			        	}
			        	echo "</tr>";
			        }
			        // 2011/02/25 no records
			        if (!$n_tpls) echo '<tr><td align="center">'.__('No Records!').'</td></tr>';
			        ?>
			    </table>
		    </td>
	    </tr>
    </tbody>
</table>
<?php if($n_tpls&&intval($tpl_id)==0){?>
<div style="text-align:center;margin-top:2px;">
<?php 
$str11 = '';
$str22='';
$per_page = 5;
$leftsidepage=intval(($per_page-1) /2);
$rightsidepage=$per_page-$leftsidepage-1;
$firstshowpage=1;
$endshowpage=$last_page;
if($last_page <= $per_page)
{
	for($ii = 1;$ii <= $last_page;$ii++)
	{
		if($page_number == $ii)
		{
			$str11 .= $ii."&nbsp;|&nbsp;";
		}
		else
		{
			$str11 .= "<a href='index.php?_m=mod_template&_a=admin_list&_p=$ii&_cates=$category_number&sub_id=$category_sub_id'>$ii</a>&nbsp;|&nbsp;";
		}
	}
}
else
{
     if($page_number-$leftsidepage<=0){
         $firstshowpage=1;
         $endshowpage=$per_page;
     }elseif($page_number+$rightsidepage>$last_page){
         $firstshowpage=$last_page+1-$per_page;
         $endshowpage=$last_page;
     }else{
         $firstshowpage=$page_number-$leftsidepage;
         $endshowpage=$page_number+$rightsidepage;
     }
     $str11='';
     if($firstshowpage>=4) {
         $str11 .= "<a href='index.php?_m=mod_template&_a=admin_list&_p=1&_cates=$category_number&sub_id=$category_sub_id'>1..</a>&nbsp;|&nbsp;";
     }
	for($ii = $firstshowpage;$ii <=$endshowpage;$ii++)
	{
		if($page_number == $ii)
		{
			$str11 .= $ii."&nbsp;|&nbsp;";
		}
		else
		{
			$str11 .= "<a href='index.php?_m=mod_template&_a=admin_list&_p=$ii&_cates=$category_number&sub_id=$category_sub_id'>$ii</a>&nbsp;|&nbsp;";
		}
	}
	
     if( $endshowpage!=$last_page){
      $str11 .= "<a href='index.php?_m=mod_template&_a=admin_list&_p=$last_page&_cates=$category_number&sub_id=$category_sub_id'>..$last_page</a>&nbsp;|&nbsp;";
      }
	$str22 .= "<form style='display:inline;margin:0px;' method='post' action='index.php?_m=mod_template&_a=admin_list' id='langswform' name='langswform'>";
	$str22 .= "<input name='_cates' type='hidden' value='$category_number'>转跳至:<input style='width:25px;' type='text' name='_p' value='$page_number'><input type='submit' value='确定'></form>";
}
if($page_number == $last_page)
{
	if($page_number > 1){
?>
	<a href='index.php?_m=mod_template&_a=admin_list&_p=1&_cates=<?php echo $category_number;?>&sub_id=<?php echo $category_sub_id ?>'><?php _e('First');?></a>&nbsp;|&nbsp;<a href="index.php?_m=mod_template&_a=admin_list&_cates=<?php echo $category_number;?>&sub_id=<?php echo $category_sub_id ?>&_p=<?php echo $page_number-1;?>"><?php _e('Previous');?></a>&nbsp;|&nbsp;<?php echo $str11;?><a href="#"><?php _e('Next');?></a>&nbsp;|&nbsp;<a href="index.php?_m=mod_template&_a=admin_list&_cates=<?php echo $category_number;?>&sub_id=<?php echo $category_sub_id ?>&_p=<?php echo $last_page;?>"><?php _e('Last');?></a><?php echo '&nbsp|&nbsp;'.$str22;?>
<?php } elseif($page_number == 1) {?>
	<a href='index.php?_m=mod_template&_a=admin_list&_p=1&_cates=<?php echo $category_number;?>&sub_id=<?php echo $category_sub_id ?>'><?php _e('First');?></a>&nbsp;|&nbsp;<a href="#"><?php _e('Previous');?></a>&nbsp;|&nbsp;<?php echo $str11;?><a href="#"><?php _e('Next');?></a>&nbsp;|&nbsp;<a href="index.php?_m=mod_template&_a=admin_list&_cates=<?php echo $category_number;?>&sub_id=<?php echo $category_sub_id ?>&_p=<?php echo $last_page;?>"><?php _e('Last');?></a><?php echo '&nbsp|&nbsp;'.$str22;?>
<?php	}?>
<?php
}
elseif($page_number == 1)
{
?>
	<a href='index.php?_m=mod_template&_a=admin_list&_p=1&_cates=<?php echo $category_number;?>&sub_id=<?php echo $category_sub_id ?>'><?php _e('First');?></a>&nbsp;|&nbsp;<a href="#"><?php _e('Previous');?></a>&nbsp;|&nbsp;<?php echo $str11;?><a href="index.php?_m=mod_template&_a=admin_list&_cates=<?php echo $category_number;?>&sub_id=<?php echo $category_sub_id ?>&_p=<?php echo $page_number+1;?>"><?php _e('Next');?></a>&nbsp;|&nbsp;<a href="index.php?_m=mod_template&_a=admin_list&_cates=<?php echo $category_number;?>&sub_id=<?php echo $category_sub_id ?>&_p=<?php echo $last_page;?>"><?php _e('Last');?></a><?php echo '&nbsp|&nbsp;'.$str22;?>
<?php
}
else
{
?>
<a href='index.php?_m=mod_template&_a=admin_list&_cates=<?php echo $category_number;?>&sub_id=<?php echo $category_sub_id ?>&_p=1'><?php _e('First');?></a>&nbsp;|&nbsp;<a href="index.php?_m=mod_template&_a=admin_list&_cates=<?php echo $category_number;?>&sub_id=<?php echo $category_sub_id ?>&_p=<?php echo $page_number-1;?>"><?php _e('Previous');?></a>&nbsp;|&nbsp;<?php echo $str11;?><a href="index.php?_m=mod_template&_a=admin_list&_cates=<?php echo $category_number;?>&sub_id=<?php echo $category_sub_id ?>&_p=<?php echo $page_number+1;?>"><?php _e('Next');?></a>&nbsp;|&nbsp;<a href="index.php?_m=mod_template&_a=admin_list&_cates=<?php echo $category_number;?>&sub_id=<?php echo $category_sub_id ?>&_p=<?php echo $last_page;?>"><?php _e('Last');?></a><?php echo '&nbsp|&nbsp;'.$str22;?>
<?php 
}

//if($last_page > $per_page)
//{
//	echo $str22;
//}
?>
</div>
<?php }?>
