Exemplo n.º 1
0
include "../include/sort.class.php";
$where = " where news.show > -1 ";
$parameters = array();
if (isset($_GET['pid']) && $_GET['pid'] > 0) {
    $where .= "and news.pid=:pid ";
    $parameters[':pid'] = $_GET['pid'];
}
if (isset($_GET['search_keywords'])) {
    $where .= "and news.title like :keywords ";
    $parameters[':keywords'] = '%' . $_GET['search_keywords'] . '%';
}
$sql = "SELECT news.id, news.title,news.att,news.url,news.pic,news.weight,news.hits,sort.id as sort_id,sort.title as sort_title";
$sql .= " FROM `t_news` AS news LEFT JOIN `t_sort` as sort ON sort.id = news.pid " . $where;
//分页
$pagesize = 20;
$sql .= ' ' . getLimit($pagesize);
$total = $DB->fetchAll("select count(*) from t_news as news " . $where, $parameters);
//var_dump($sql);
//var_dump($parameters);
?>


<h3>内容管理</h3>
<!-- 操作 -->
<div class="tools">
	<div class="form-inline">

		<div class="form-group">
			<button type="button" class="btn btn-danger" id="del_all"><i class="fa fa-recycle"></i> 回收站</button>
			<a class="btn btn-success" href="news.add.asp"><i class="fa fa-plus-circle"></i> 批量添加</a>
			<a class="btn btn-primary" href="news.formview.php"><i class="fa fa-plus-circle"></i> 添加内容</a>
Exemplo n.º 2
0
 function getLimit()
 {
     return getLimit($this);
 }
Exemplo n.º 3
0
function getRecords($con, $where, $orderby, $limit, $offset, $pagesize, &$rowcount)
{
    $sql_where = getWhere($where);
    $sql_orderby = getOrderBy($orderby, $count);
    $sql_limit = getLimit($limit, 0);
    $sql_page = getLimit($pagesize, $offset);
    if ($limit) {
        if ($pagesize) {
            $sql = "SELECT * FROM phones " . $sql_where . $sql_orderby . $sql_limit;
            $sql = "select * from ( " . $sql . " ) a " . $sql_page;
            $records = fetchRows($con, $sql);
            if (!$records) {
                return false;
            }
            $rc_sql = "SELECT 1 FROM phones " . $sql_where . $sql_limit;
            $rc_sql = "select count(*) AS rowcount from ( " . $rc_sql . " ) rc";
            $rowcount = fetchRowCount($con, $rc_sql);
            if (!$rowcount) {
                return false;
            }
            return $records;
        }
        $sql = "SELECT * FROM phones " . $sql_where . $sql_orderby . $sql_limit;
        $records = fetchRows($con, $sql);
        $rowcount = count($records);
        return $records;
    }
    if ($pagesize) {
        $sql = "SELECT * FROM phones " . $sql_where . $sql_orderby . $sql_page;
        $records = fetchRows($con, $sql);
        if (!$records) {
            return false;
        }
        $rc_sql = "SELECT 1 FROM phones " . $sql_where;
        $rc_sql = "select count(*) AS rowcount from ( " . $rc_sql . " ) rc";
        $rowcount = fetchRowCount($con, $rc_sql);
        if (!$rowcount) {
            return false;
        }
        return $records;
    }
    $sql = "SELECT * FROM phones " . $sql_where . $sql_orderby;
    $records = fetchRows($con, $sql);
    if (!$records) {
        return false;
    }
    $rowcount = count($records);
    return $records;
}
Exemplo n.º 4
0
 $form['date_emi_Y']=intval($_POST['date_emi_Y']);
 $form['bank']=intval($_POST['bank']);
 $form['reprint']=substr($_POST['reprint'],0,1);
 $form['date_ini_D']=intval($_POST['date_ini_D']);
 $form['date_ini_M']=intval($_POST['date_ini_M']);
 $form['date_ini_Y']=intval($_POST['date_ini_Y']);
 $form['date_fin_D']=intval($_POST['date_fin_D']);
 $form['date_fin_M']=intval($_POST['date_fin_M']);
 $form['date_fin_Y']=intval($_POST['date_fin_Y']);
 $form['num_ini']=intval($_POST['num_ini']);
 $form['num_fin']=intval($_POST['num_fin']);
 if ($form['hidden_req']=='reprint'){
    if ($form['reprint']=='S') {
       $iniData=getLimit(1);
   } else {
       $iniData=getLimit();
   }
   $form['date_ini_D']=substr($iniData['si'],8,2);
   $form['date_ini_M']=substr($iniData['si'],5,2);
   $form['date_ini_Y']=substr($iniData['si'],0,4);
   $form['date_fin_D']=substr($iniData['sf'],8,2);
   $form['date_fin_M']=substr($iniData['sf'],5,2);
   $form['date_fin_Y']=substr($iniData['sf'],0,4);
   $form['num_ini']=$iniData['ni'];
   $form['num_fin']=$iniData['nf'];
 }
 if (isset($_POST['period'])) {
   $new_date_ini=mktime(0,0,0,date("m")+1,16,date("Y"));
   $new_date_fin=mktime(0,0,0,date("m")+2,15,date("Y"));
   $form['date_ini_D']=16;
   $form['date_ini_M']=strftime ("%m",$new_date_ini);
Exemplo n.º 5
0
 function page_jxload()
 {
     global $go, $default;
     load_module_helper('files', $go['a']);
     if (isset($_POST['jxload'])) {
         // perform the upload
         $this->sbmt_img_upload();
         $more = "<script type='text/javascript'>\n            \$(document).ready(function(){\n                parent.getExhibit();\n            });\n            </script>\n";
     }
     $more = !isset($more) ? '' : $more;
     $this->template->add_js('jquery.js');
     $this->template->add_js('jquery.multifile.js');
     $script = "<style type='text/css'>\n        #uploader input { font-size: 9px; }\n        #files_list div, #files_list input { margin: 0 0 1px 0; padding: 0; }\n        </style>\n        {$more}";
     $this->template->add_script = $script;
     $body = "<div style='text-align:left;' id='uploader'>\n";
     $body .= "<form enctype='multipart/form-data' action='?a={$go['a']}&q=jxload&id={$go['id']}' method='post'>\n";
     $body .= "<div style='float:left; width:200px;'>\n";
     $body .= "<input id='my_file_element' type='file' name='filename[]' >\n";
     $body .= "<input type='submit' name='jxload' value='" . $this->lang->word('upload') . "'>\n";
     $body .= "</form>\n";
     $body .= p('<strong>' . $this->lang->word('filetypes') . ':</strong> ' . $this->lang->word('allowed formats') . br() . '<strong>' . $this->lang->word('max file size') . ':</strong> ' . getLimit(), "class='red'");
     $body .= "</div>\n";
     $body .= "<div style='float:left; width:400px; text-align:right;'>\n";
     $body .= "<div id='files_list'></div>\n";
     $body .= "</div>\n";
     $body .= "<div class='cl'><!-- --></div>\n";
     $body .= "</div>\n";
     $body .= "<script>\n";
     // this tells us how many we can upload at a time
     $body .= "var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), " . $default['exhibit_imgs'] . " );\n";
     $body .= "multi_selector.addElement( document.getElementById( 'my_file_element' ) );\n";
     $body .= "</script>\n";
     $this->template->body = $body;
     $this->template->output('iframe');
     exit;
 }