예제 #1
0
 public function testCreateSortableLinkDesc()
 {
     $this->sort->setInput(['sort_dir' => 'desc', 'sort' => 'test']);
     $link = $this->sort->createSortableLink('sort me');
     $expected = '<a href="?sort_dir=asc&sort=test" class="grid-view-sort-desc"><i class="fa fa-chevron-down"></i> sort me</a>';
     $this->assertEquals($expected, $link);
 }
예제 #2
0
		<div class="form-group">
      <form action="news.listview.php" method="get">
  			<div class="input-group">
  					<input name="search_keywords" id="search_keywords" type="text" class="form-control">
  					<span class="input-group-btn">
  							<input name="search_btn" id="search_btn" type="submit" class="btn btn-default" value="搜索">
  					</span>
  			</div>
      </form>
		</div>

		<div class="form-group">
			<select name="sort_jump_box" id="sort_jump_box" class="form-control">
      	<option value="0">按分类查看</option>
      <?php 
$sort = new MySort();
$arrayList = $sort->getList();
$arrayList = $sort->getTree($arrayList);
foreach ($arrayList as $key => $row) {
    echo '<option value="' . $row["id"] . '">' . $row["deepTag"] . $row["title"] . '</option>';
}
?>
      </select>
		</div>

		<div class="form-group">
				<select name="att_jump_box" id="att_jump_box" class="form-control">
        	<option value="">按特性查看</option>
        		<option value="<%=attArray(k)%>"><%=attArray(k)%></option>
        </select>
		</div>
예제 #3
0
<?php

require "./cms.header.php";
require "./cms.meta.php";
require "../include/sort.class.php";
$sort = new MySort();
if (isset($_GET["id"])) {
    $sort->read($_GET["id"]);
} elseif (isset($_GET["pid"])) {
    $parent = new MySort();
    $parent->read($_GET["pid"]);
    $sort->model["pid"] = $_GET["pid"];
    $sort->model["sort_template"] = $parent->model["sort_template"];
    $sort->model["content_template"] = $parent->model["content_template"];
    $sort->model["is_parent"] = $parent->model["is_parent"];
    $sort->model["is_nav"] = $parent->model["is_nav"];
}
?>
<!-- 编辑器 -->
<script src="../include/ueditor/ueditor.config.js"></script>
<script src="../include/ueditor/ueditor.all.min.js"></script>

<!-- 图片上传 -->
<script src="../include/webuploader/webuploader.min.js"></script>
<link rel="stylesheet" href="../include/webuploader/webuploader.css">
<h3 class="admin-title">分类管理</h3>

<form action="sort.action.php?action=<?php 
echo $sort->model["id"] > 0 ? "update" : "insert";
?>
" method="post" id="form">
        if ($a <= 1) {
            return $arr;
        }
        for ($i = 1; $i < $a; $i++) {
            $j = floor(($i - 1) / 2);
            if ($arr[$i] < $arr[$j]) {
                $iTemp = $arr[$i];
                $arr[$i] = $arr[$j];
                $arr[$j] = $iTemp;
            }
        }
        var_dump($arr);
        //$arr = $this->tuckSort($arr);
    }
}
$sortClass = new MySort();
//$arr = range(1, 100);
//$arr = array_flip($arr);
$arr = $sortClass->getRand(100);
//var_dump($arr);
//echo 'hello world!';
//exit;
$startTime = microtime();
//$arr = array(5,1,3,2,4);
//快速
//$result = $sortClass->quickSort($arr);
//插入
//$result = $sortClass->insertSort($arr);
//选择
//$result = $sortClass->selectSort($arr);
//冒泡
예제 #5
0
<?php

require "cms.header.php";
include "cms.meta.php";
require "../include/sort.class.php";
var_dump($_POST);
$sort = new MySort();
$action = $_GET["action"];
$msg = "";
switch ($action) {
    case 'insert':
        $msg = "添加";
        $sort->insert();
        break;
    case 'update':
        $msg = "修改";
        $sort->update();
        break;
    case 'delete':
        $sort->delete($_GET["id"]);
        break;
    default:
        # code...
        break;
}
$html = <<<HTML
\t<div class="alert alert-success" role="alert">
\t\t<strong>{$msg}成功!</strong>
\t\t<a href="sort.formview.php?id=\$">继续{$msg}</a>
\t\t<a href="sort.listview.php">返回列表</a>
\t</div>