コード例 #1
0
ファイル: manager.php プロジェクト: robinhunan/coolphp
 function home()
 {
     $manager = new manager();
     $url = "?mod=index&page=_page_";
     if ($key = get($_GET, 'key')) {
         $where = util::convert($_GET['field']) . ' like "%' . util::convert($key) . '%"';
         $manager->db->where($where);
         $url = sprintf('%s&fields=%s&key=%s', $url, $_GET['field'], $key);
     }
     if ($cnt = $manager->db->count()) {
         $o = array('size' => 20);
         //每页显示的记录数
         $pages = new pages($cnt, $o);
         $sql = sprintf("select * from %s %s order by id desc", $manager->db->table, $manager->db->condition());
         $rows = $manager->db->rows($sql, $pages->start, $o['size']);
         $nav = $pages->show();
     }
     include template::inc("manager/index.php");
 }
コード例 #2
0
ファイル: cb.php プロジェクト: hshoghi/cms
?>
    </div>

    <div style="float:left; border: 1px solid black; padding: 3px; background-color: #F8F8F8">
    <textarea id="code" cols="120" rows="30">

<?php 
$test = "test";
echo $test;
?>

    </textarea>
    </div>

    <script type="text/javascript">
      var editor = CodeMirror.fromTextArea('code', {
        height: "350px",
        parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js",
                     "../contrib/php/js/tokenizephp.js", "../contrib/php/js/parsephp.js",
                     "../contrib/php/js/parsephphtmlmixed.js"],
        stylesheet: ["/lib/CodeMirror-0.93/css/xmlcolors.css", "/lib/CodeMirror-0.93/css/jscolors.css", "/lib/CodeMirror-0.93/css/csscolors.css", "/lib/CodeMirror-0.93/contrib/php/css/phpcolors.css"],
        path: "/lib/CodeMirror-0.93/js/",
        continuousScanning: 500,
        lineNumbers: true
      });
    </script>


<?php 
template::inc('global', 'bottom');
コード例 #3
0
ファイル: blogs-listing.php プロジェクト: hshoghi/cms
<?php

$title = "Blog Listing";
template::inc('intranet', 'top');
?>
<div class = "has-floats">
	<div class = "float-right blog_listing">
		<div class = "content_listing">
			<input type = "button" onclick = "window.location = '/admin/blog/blogs/add-new'" value = "Add new blog"/>
<?php 
$cols = "\t\n\t\t\tname\t\t{label:\tName\t\t;}\n\t\t\tdescription\t{label:\tDescription\t;}\n                        slug            {label: Slug \t\t;}\n                        status\t\t{label: Status\t\t;}\n\t\t";
if (auth('blog_author:editor')) {
    $cols .= 'edit {}';
}
$clause = array('blog_website' => array('where' => 'blog_website.website_id=' . $website_id));
$param = array('enable_sort' => true);
$params = array("aql" => 'blog', 'clause' => $clause, "cols" => $cols, "param" => $param);
aql::grid($params);
?>
		</div>
	</div>
		<div class = "left_nav">
<?php 
include 'pages/admin/blog/left-nav/left-nav.php';
?>
	</div>
</div>
<?php 
template::inc('intranet', 'bottom');
コード例 #4
0
ファイル: codebase-editor.php プロジェクト: hshoghi/cms
<?php

$title = 'Codebase Editor';
template::inc('skybox', 'top');
$selected_codebase = $_GET['codebase'];
$table = $_GET['table'];
$codebase_list = get_codebases();
$codebase_arr = array();
$aql = "dev_codebase\t{\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t}";
$codebase_arr = array();
$rs = aql::select($aql);
foreach ($rs as $r) {
    $codebase_arr[$r['name']] = $r['name'];
}
foreach ($codebase_list as $codebase) {
    $codebase_arr[$codebase['codebase']] = $codebase['codebase'];
}
$param = array('id' => 'codebase_name', 'name' => 'name', 'selected_value' => $selected_codebase);
snippet::dropdown($codebase_arr, $param);
?>
<br><br>
<div>
	<input type="hidden" id = "table_name" value = "<?php 
echo $table;
?>
" />
	<input type="submit" value="Save" onclick = "save_codebase()" />
</div>
<?php 
template::inc('skybox', 'bottom');
コード例 #5
0
ファイル: msg.php プロジェクト: robinhunan/coolphp
 /**
  ** 掷出信息
  ** @ info : 信息内容
  ** @ url  : 重定向url
  **/
 public static function info($url = 'none', $info = '', $type = 'ok', $second = 2, $title = "提示信息")
 {
     $info = empty($info) ? '操作成功!' : (is_string($info) ? $info : json_encode($info));
     include_once template::inc('msg.html');
     exit;
 }
コード例 #6
0
ファイル: preview.php プロジェクト: hshoghi/cms
<?php

$blog_article_ide = IDE;
$r = aql::profile('blog_article', $blog_article_ide);
$title = $r['title'];
template::inc('website', 'top');
include 'components/blog_article/id/article.php';
template::inc('website', 'bottom');
コード例 #7
0
ファイル: index.php プロジェクト: robinhunan/coolphp
                //添加页
                $tr = $tr == 'tr' ? 'tr2' : 'tr';
                foreach ($_POST[$v] as $key => $val) {
                    $fields .= "<tr class='{$tr} h30'>\n<td  class='ltit'>{$_POST['field'][$key]}</td>\n<td><input name='{$key}' type='text'></td>\n</tr>\n";
                }
                $str = str_replace(array('__table__', '__ds_table__', '__fields__'), array($table, $ds_table, $fields), $str);
            } else {
                if ('edit' == $v) {
                    //编辑页
                    $tr = $tr == 'tr' ? 'tr2' : 'tr';
                    foreach ($_POST[$v] as $key => $val) {
                        $fields .= "<tr class='{$tr} h30'>\n<td  class='ltit'>{$_POST['field'][$key]}</td>\n<td><input name='{$key}' value=\"{\$row['{$key}']}\" type='text'></td>\n</tr>\n";
                    }
                    $str = str_replace(array('__table__', '__ds_table__', '__fields__'), array($table, $ds_table, $fields), $str);
                }
            }
        }
        file::save($mod, $str);
    }
}
/** 显示所有的数据表 **/
foreach ($db->query('show tables') as $row) {
    $tables[] = $row[0];
}
$table = in_array($table, $tables) ? $table : $tables[0];
/** 显示一个表中的所有字段 */
foreach ($db->query('show full COLUMNS from ' . $table) as $row) {
    $rows[] = $row;
}
include template::inc('tools/index.php');