信呼OA版本v2.3.8
This commit is contained in:
246
webmain/system/admin/adminAction.php
Normal file
246
webmain/system/admin/adminAction.php
Normal file
@@ -0,0 +1,246 @@
|
||||
<?php
|
||||
class adminClassAction extends Action
|
||||
{
|
||||
public function loadadminAjax()
|
||||
{
|
||||
$id = (int)$this->get('id',0);
|
||||
$data = m('admin')->getone($id);
|
||||
if($data){
|
||||
$data['pass']='';
|
||||
}
|
||||
$arr['data'] = $data;
|
||||
$dbs = m('sjoin');
|
||||
$arr['grouparr'] = $dbs->getgrouparr();
|
||||
$arr['groupid'] = $dbs->getgroupid($id);
|
||||
|
||||
$this->returnjson($arr);
|
||||
}
|
||||
|
||||
public function beforeshow($table)
|
||||
{
|
||||
$fields = 'id,name,`user`,deptname,`type`,`num`,status,tel,workdate,ranking,superman,loginci,sex,sort,face';
|
||||
$s = '';
|
||||
$key = $this->post('key');
|
||||
if($key!=''){
|
||||
$s = m('admin')->getkeywhere($key);
|
||||
}
|
||||
//这句是bug修改
|
||||
$sql1 = 'alter table `[Q]admin` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;';
|
||||
$opts = $this->option->getval('adminbug1');
|
||||
if(isempt($opts)){
|
||||
$this->db->query($sql1);
|
||||
$this->option->setval('adminbug1',$this->now, '用户bug1');
|
||||
}
|
||||
return array(
|
||||
'fields'=> $fields,
|
||||
'where' => $s
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function fieldsafters($table, $fid, $val, $id)
|
||||
{
|
||||
$fields = 'sex,ranking,tel,mobile,workdate,email,quitdt';
|
||||
if(contain($fields, $fid))m('userinfo')->update("`$fid`='$val'", $id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function publicbeforesave($table, $cans, $id)
|
||||
{
|
||||
$user = strtolower(trimstr($cans['user']));
|
||||
$name = trimstr($cans['name']);
|
||||
$num = trimstr($cans['num']);
|
||||
$email= trimstr($cans['email']);
|
||||
$check= c('check');
|
||||
$mobile = $cans['mobile'];
|
||||
$weixinid = $cans['weixinid'];
|
||||
$pingyin = $cans['pingyin'];
|
||||
$msg = '';
|
||||
if($check->isincn($user))return '用户名不能有中文';
|
||||
if(strlen($user)<2)return '用户名必须2位字符以上';
|
||||
if(!isempt($email) && !$check->isemail($email))return '邮箱格式有误';
|
||||
if(!isempt($pingyin) && $check->isincn($pingyin))return '名字拼音不能有中文';
|
||||
if(!isempt($num) && $check->isincn($num))return '编号不能有中文';
|
||||
if(!isempt($mobile)){
|
||||
if(!$check->ismobile($mobile))return '手机格式有误';
|
||||
}
|
||||
if(isempt($mobile) && isempt($email))return '邮箱/手机号不能同时为空';
|
||||
if(!isempt($weixinid)){
|
||||
if(is_numeric($weixinid))return '微信号不能是数字';
|
||||
if($check->isincn($weixinid))return '微信号不能有中文';
|
||||
}
|
||||
$db = m($table);
|
||||
|
||||
if($msg=='' && $num!='')if($db->rows("`num`='$num' and `id`<>'$id'")>0)$msg ='编号['.$num.']已存在';
|
||||
if($msg=='')if($db->rows("`user`='$user' and `id`<>'$id'")>0)$msg ='用户名['.$user.']已存在';
|
||||
if($msg=='')if($db->rows("`name`='$name' and `id`<>'$id'")>0)$msg ='姓名['.$name.']已存在';
|
||||
$rows = array();
|
||||
if($msg == ''){
|
||||
$did = $cans['deptid'];
|
||||
$sup = $cans['superid'];
|
||||
$rows = $db->getpath($did, $sup);
|
||||
}
|
||||
if(isempt($pingyin))$pingyin = c('pingyin')->get($name,1);
|
||||
$rows['pingyin'] = $pingyin;
|
||||
$rows['user'] = $user;
|
||||
$rows['name'] = $name;
|
||||
$rows['email'] = $email;
|
||||
$arr = array('msg'=>$msg, 'rows'=>$rows);
|
||||
return $arr;
|
||||
}
|
||||
|
||||
public function publicaftersave($table, $cans, $id)
|
||||
{
|
||||
m($table)->record(array('superman'=>$cans['name']), "`superid`='$id'");
|
||||
if(getconfig('systype')=='demo'){
|
||||
m('weixin:user')->optuserwx($id);
|
||||
}
|
||||
$mygroup = $this->post('mygroup');
|
||||
m('sjoin')->addgroupuid($id, $mygroup);
|
||||
$this->updatess('and a.id='.$id.'');
|
||||
}
|
||||
|
||||
public function updatedataAjax()
|
||||
{
|
||||
$a = $this->updatess();
|
||||
m('imgroup')->updategall();
|
||||
echo '总'.$a[0].'条记录,更新了'.$a[1].'条';
|
||||
}
|
||||
|
||||
public function updatess($whe='')
|
||||
{
|
||||
return m('admin')->updateinfo($whe);
|
||||
}
|
||||
|
||||
|
||||
//批量导入
|
||||
public function saveadminplAjax()
|
||||
{
|
||||
$rows = c('html')->importdata('user,name,sex,ranking,deptname,mobile,email,tel,superman','name');
|
||||
$oi = 0;
|
||||
$db = m('admin');
|
||||
$sort = (int)$db->getmou('max(`sort`)', '`id`>0');
|
||||
$dbs = m('dept');
|
||||
$py = c('pingyin');
|
||||
|
||||
$inarr = array();
|
||||
|
||||
foreach($rows as $k=>$rs){
|
||||
$user = $rs['user'];
|
||||
$name = $rs['name'];
|
||||
$arr = array();
|
||||
|
||||
$arr['pingyin'] = $py->get($name,1);
|
||||
if($db->rows("`name`='$name'")>0)$name = $name.'1';
|
||||
if(isempt($user))$user = $arr['pingyin'];
|
||||
|
||||
if($db->rows("`user`='$user'")>0)$user = $user.'1'; //相同用户名?
|
||||
|
||||
$arr['user'] = strtolower($user);
|
||||
$arr['name'] = $name;
|
||||
|
||||
$arr['sex'] = $rs['sex'];
|
||||
$arr['ranking'] = $rs['ranking'];
|
||||
$arr['deptname'] = $rs['deptname'];
|
||||
$arr['mobile'] = $rs['mobile'];
|
||||
$arr['email'] = $rs['email'];
|
||||
$arr['tel'] = $rs['tel'];
|
||||
$arr['superman'] = $rs['superman'];
|
||||
$arr['pass'] = md5('123456');
|
||||
$arr['sort'] = $sort+$oi;
|
||||
$arr['workdate'] = $this->date;
|
||||
$arr['adddt'] = $this->now;
|
||||
$arr['companyid'] = 1; //默认公司Id为1
|
||||
|
||||
//读取上级主管Id
|
||||
$superid = (int)$db->getmou('id', "`name`='".$arr['superman']."'");
|
||||
if($superid==0)$arr['superman'] = '';
|
||||
$arr['superid'] = $superid;
|
||||
|
||||
//读取部门Id
|
||||
$deptarr = $this->getdeptid($rs['deptname'], $dbs);
|
||||
|
||||
if($deptarr['deptid']==0)return returnerror('行'.($k+1).'找不到对应顶级部门['.$rs['deptname'].']');
|
||||
foreach($deptarr as $k1=>$v1)$arr[$k1]=$v1;
|
||||
|
||||
$inarr[] = $arr;
|
||||
}
|
||||
|
||||
foreach($inarr as $k=>$rs){
|
||||
$bo = $db->insert($rs);
|
||||
if($bo)$oi++;
|
||||
}
|
||||
|
||||
if($oi>0)$this->updatess();
|
||||
return returnsuccess('成功导入'.$oi.'个用户');
|
||||
}
|
||||
|
||||
private function getdeptid($str,$dobj)
|
||||
{
|
||||
$deptid = '0';
|
||||
if(isempt($str))return $deptid;
|
||||
$stra = explode(',', $str);
|
||||
$depad = $this->getdeptids($stra[0],$dobj);
|
||||
$deptids= '';
|
||||
$deptnames= '';
|
||||
for($i=1;$i<count($stra);$i++){
|
||||
$depads = $this->getdeptids($stra[$i],$dobj);
|
||||
if($depads[0]>0){
|
||||
$deptids.=','.$depads[0].'';
|
||||
$deptnames.=','.$depads[1].'';
|
||||
}
|
||||
}
|
||||
if($deptids!='')$deptids = substr($deptids, 1);
|
||||
if($deptnames!='')$deptnames = substr($deptnames, 1);
|
||||
|
||||
return array(
|
||||
'deptid' => $depad[0],
|
||||
'deptname' => $depad[1],
|
||||
'deptallname' => $stra[0],
|
||||
'deptids' => $deptids,
|
||||
'deptnames' => $deptnames,
|
||||
);
|
||||
}
|
||||
private function getdeptids($str,$dobj)
|
||||
{
|
||||
$stra = explode('/', $str);
|
||||
$pid = 0;
|
||||
$id = 1;//默认顶级ID
|
||||
$deptname = '';
|
||||
for($i=0;$i<count($stra);$i++){
|
||||
$name = $stra[$i];
|
||||
$deptname = $name;
|
||||
$id = (int)$dobj->getmou('id',"`pid`='$pid' and `name`='$name'");
|
||||
//不存在就创建部门
|
||||
if($id==0){
|
||||
if($pid==0)return array(0, $deptname);
|
||||
$cjbm['name'] = $deptname;
|
||||
$cjbm['pid'] = $pid;
|
||||
$id = $dobj->insert($cjbm);
|
||||
$pid = $id;
|
||||
}else{
|
||||
$pid = $id;
|
||||
}
|
||||
}
|
||||
|
||||
return array($id, $deptname);
|
||||
}
|
||||
|
||||
//修改头像
|
||||
public function editfaceAjax()
|
||||
{
|
||||
$fid = (int)$this->post('fid');
|
||||
$uid = (int)$this->post('uid');
|
||||
echo m('admin')->changeface($uid, $fid);
|
||||
}
|
||||
|
||||
//获取职位
|
||||
public function getrankAjax()
|
||||
{
|
||||
$arr = array();
|
||||
$rows = $this->db->getall('select `ranking` from `[Q]admin` group by `ranking`');
|
||||
foreach($rows as $k=>$rs)$arr[] = array('name'=>$rs['ranking'],'value'=>'');
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
116
webmain/system/admin/rock_admin_txl.php
Normal file
116
webmain/system/admin/rock_admin_txl.php
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var at = $('#optionview_{rand}').bootstree({
|
||||
url:false,autoLoad:false,
|
||||
columns:[{
|
||||
text:'部门',dataIndex:'name',align:'left',xtype:'treecolumn'
|
||||
}],
|
||||
itemdblclick:function(d){
|
||||
a.setparams({'deptid':d.id}, true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var a = $('#admin_{rand}').bootstable({
|
||||
modenum:'user',sort:'sort',dir:'asc',fanye:true,params:{atype:'txlmy'},url:publicmodeurl('user'),
|
||||
storeafteraction:'storeafter',storebeforeaction:'storebefore',checked:false,
|
||||
columns:[{
|
||||
text:'头像',dataIndex:'face',notexcel:true,renderer:function(v,d){
|
||||
if(isempt(v))v='images/noface.png';
|
||||
return '<img onclick="$.imgview({url:this.src})" src="'+v+'" height="24" width="24">';
|
||||
}
|
||||
},{
|
||||
text:'姓名',dataIndex:'name',sortable:true
|
||||
},{
|
||||
text:'部门',dataIndex:'deptallname',align:'left'
|
||||
},{
|
||||
text:'职位',dataIndex:'ranking',sortable:true
|
||||
},{
|
||||
text:'办公电话',dataIndex:'tel'
|
||||
},{
|
||||
text:'手机号',dataIndex:'mobile'
|
||||
},{
|
||||
text:'邮箱',dataIndex:'email'
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort',sortable:true
|
||||
}],
|
||||
load:function(d){
|
||||
if(d.deptdata){
|
||||
at.loadData(d.deptdata);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown();
|
||||
},
|
||||
changlx:function(o1,lx){
|
||||
$("button[id^='state{rand}']").removeClass('active');
|
||||
$('#state{rand}_'+lx+'').addClass('active');
|
||||
var atype = 'txlmy';
|
||||
if(lx=='0')atype = 'txldown';
|
||||
if(lx=='1')atype = 'txldownall';
|
||||
get('key_{rand}').value='';
|
||||
a.setparams({atype:atype,deptid:'0',key:''},true);
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
|
||||
$('#optionview_{rand}').css('height',''+(viewheight-25)+'px');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
<table width="100%">
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<div style="border:1px #cccccc solid;width:220px">
|
||||
<div id="optionview_{rand}" style="height:400px;overflow:auto;"></div>
|
||||
</div>
|
||||
</td>
|
||||
<td width="10" nowrap><div style="width:10px"> </div></td>
|
||||
<td width="95%">
|
||||
|
||||
<table width="100%"><tr>
|
||||
<!--
|
||||
<td nowrap>
|
||||
<button class="btn btn-info" onclick="reim.creategroup()" type="button"><i class="icon-comments-alt"></i> 创建会话</button>
|
||||
</td>-->
|
||||
<td>
|
||||
<div class="input-group" style="width:250px">
|
||||
<input class="form-control" id="key_{rand}" placeholder="姓名/部门/职位">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="search" type="button"><i class="icon-search"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
</td>
|
||||
<td width="80%">
|
||||
<div class="btn-group" id="btngroup{rand}">
|
||||
<button class="btn btn-default active" id="state{rand}_" click="changlx," type="button">全部</button>
|
||||
<button class="btn btn-default" id="state{rand}_0" click="changlx,0" type="button">我直属下属</button>
|
||||
<button class="btn btn-default" id="state{rand}_1" click="changlx,1" type="button">全部下属</button>
|
||||
</div>
|
||||
</td>
|
||||
<td align="right" nowrap>
|
||||
<!-- <button class="btn btn-default" click="daochu,1" type="button">导出</button>-->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="admin_{rand}"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
235
webmain/system/beifen/beifenAction.php
Normal file
235
webmain/system/beifen/beifenAction.php
Normal file
@@ -0,0 +1,235 @@
|
||||
<?php
|
||||
@set_time_limit(3600);
|
||||
class beifenClassAction extends Action
|
||||
{
|
||||
|
||||
public function chushuaAjax()
|
||||
{
|
||||
$myext = $this->getsession('adminallmenuid');
|
||||
if(getconfig('systype')=='demo')return '演示请勿操作';
|
||||
if($myext!='-1')return '只有管理员才可以用';
|
||||
|
||||
$tabstr = 'daily,file,files,flow_log,flow_todos,flow_checks,im_history,im_mess,im_messzt,infor,infors,log,logintoken,meet,reads,sjoin,work,todo,flow_chao,flow_bill,flow_remind,goodm,goodn,goodss,goods,kqanay,kqdkjl,kqerr,kqout,kqinfo,location,official,officialfa,officialhong,schedule,scheduld,project,userinfo,userinfos,userract,hrpositive,word,hrredund,hrsalary,customer,custsale,custract,custfina,custappy,assetm,book,bookborrow,carm,carms,carmang,carmrese,email_cont,emailm,emails,sealapl,vcard,tovoid,editrecord,wouser,dailyfx,knowtraim,knowtrais,fininfom,fininfos,hrtrsalary,hrtransfer,hrdemint,reward,offyuebd,repair,knowtiku,kqdisv,knowledge,kqjcmd,kqjuser,kqjsn,hrcheck,receipt,hrcheckn,hrchecks,hrkaohem,hrkaohes,hrkaohen,demo,finpiao,wordxie,wordeil,subscribe,subscribeinfo,news,finzhang,finkemu,finount,finjibook,custplan,wenjuan,wenjuat,wenjuau,dangan,danganjy,wotpl,seal,godepot,im_tonghua,bianjian';
|
||||
$mrows = m('mode')->getall('`id`>=108');
|
||||
foreach($mrows as $k1=>$rs1){
|
||||
if(!isempt($rs1['table']))$tabstr.=','.$rs1['table'].'';
|
||||
if(!isempt($rs1['tables']))$tabstr.=','.$rs1['tables'].'';
|
||||
}
|
||||
$tables = explode(',', $tabstr);
|
||||
$alltabls = $this->db->getalltable();
|
||||
foreach($tables as $tabs){
|
||||
$_tabs = ''.PREFIX.''.$tabs.'';
|
||||
$yunbo = false;
|
||||
if(in_array($_tabs, $alltabls) || !$alltabls)$yunbo = true;
|
||||
if($yunbo){
|
||||
$sql1 = "delete from `$_tabs`";
|
||||
$sql2 = "alter table `$_tabs` AUTO_INCREMENT=1";
|
||||
$this->db->query($sql1, false);
|
||||
$this->db->query($sql2, false);
|
||||
}
|
||||
}
|
||||
$this->option->delpid('-2,-102'); //收信的清空
|
||||
if(!getconfig('platdwnum')){
|
||||
m('company')->delete('id>1');
|
||||
$sql2 = "alter table `[Q]company` AUTO_INCREMENT=1";
|
||||
$this->db->query($sql2, false);
|
||||
}
|
||||
echo 'ok';
|
||||
}
|
||||
|
||||
public function beifenAjax()
|
||||
{
|
||||
m('beifen')->start();
|
||||
echo 'ok';
|
||||
}
|
||||
|
||||
public function getdataAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')exit('演示请勿操作');
|
||||
$carr = c('file')->getfolderrows(''.UPDIR.'/data');
|
||||
$rows = array();
|
||||
$len = count($carr);
|
||||
$oux = 0;
|
||||
for($k=$len-1;$k>=0;$k--){
|
||||
if($oux>100)break;
|
||||
$fils = $carr[$k];
|
||||
$fils['xu'] = $k;
|
||||
$rows[] = $fils;
|
||||
$oux++;
|
||||
}
|
||||
if($rows)$rows = c('array')->order($rows, 'filename');
|
||||
$arr['rows'] = $rows;
|
||||
$this->returnjson($arr);
|
||||
}
|
||||
|
||||
public function getdatssssAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')exit('演示请勿操作');
|
||||
$rows = array();
|
||||
$folder = $this->post('folder');
|
||||
$path = ''.UPDIR.'/data/'.$folder.'';
|
||||
$carr = c('file')->getfilerows($path);
|
||||
foreach($carr as $k=>$rs){
|
||||
$id = $rs['filename'];
|
||||
$ids = substr($id,0,-5);
|
||||
$ida = explode('_', $ids);
|
||||
$len = count($ida);
|
||||
$fieldshu = $ida[$len-2];
|
||||
$total = $ida[$len-1];
|
||||
$fields = str_replace('_'.$fieldshu.'_'.$total.'.json','', $id);
|
||||
$filepath = $path.'/'.$id.'';
|
||||
if(file_exists($filepath)){
|
||||
$filesize = filesize($filepath);
|
||||
$rows[] = array(
|
||||
'fields' => $fields,
|
||||
'fieldshu' => $fieldshu,
|
||||
'total' => $total,
|
||||
'id' => $id,
|
||||
'filesizecn'=> $this->rock->formatsize($filesize)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$arr['rows'] = $rows;
|
||||
$this->returnjson($arr);
|
||||
}
|
||||
|
||||
public function huifdatanewAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')exit();
|
||||
if($this->adminid!=1)return '只有ID=1的管理员才可以用';
|
||||
$folder = $this->post('folder');
|
||||
$sida = explode(',', $this->post('sid'));
|
||||
$alltabls = $this->db->getalltable();
|
||||
$shul = 0;
|
||||
$tablss = '';
|
||||
foreach($sida as $id){
|
||||
$ids = substr($id,0,-5);
|
||||
$ida = explode('_', $ids);
|
||||
$len = count($ida);
|
||||
$fieldshu = $ida[$len-2];
|
||||
$total = $ida[$len-1];
|
||||
$tab = str_replace('_'.$fieldshu.'_'.$total.'.json','', $id); //表
|
||||
|
||||
if(!in_array($tab, $alltabls))continue; //表不存在
|
||||
|
||||
$filepath = ''.UPDIR.'/data/'.$folder.'/'.$id.'';
|
||||
if(!file_exists($filepath))continue;
|
||||
|
||||
$data = m('beifen')->getbfdata('',$filepath);
|
||||
if(!$data)continue;
|
||||
|
||||
|
||||
$dataall = $data[$tab]['data'];
|
||||
if(count($dataall)<=0)continue; //没有数据
|
||||
|
||||
$allfields = $this->db->getallfields($tab);
|
||||
$fistdata = $dataall[0];
|
||||
$xufarr = array();
|
||||
foreach($fistdata as $f=>$v){
|
||||
if(in_array($f, $allfields)){
|
||||
$xufarr[] = $f;
|
||||
}
|
||||
}
|
||||
$uparr = array();
|
||||
foreach($dataall as $k=>$rs){
|
||||
$str1 = '';
|
||||
$upa = array();
|
||||
foreach($xufarr as $f){
|
||||
$upa[$f] = $rs[$f];
|
||||
}
|
||||
$uparr[] = $upa;
|
||||
}
|
||||
|
||||
$sql1 = "delete from `$tab`";
|
||||
$sql2 = "alter table `$tab` AUTO_INCREMENT=1";
|
||||
$bo = $this->db->query($sql1, false);
|
||||
$bo = $this->db->query($sql2, false);
|
||||
foreach($uparr as $k=>$upas){
|
||||
$bo = $this->db->record($tab, $upas);
|
||||
}
|
||||
$shul++;
|
||||
$tablss.=','.$tab.'';
|
||||
}
|
||||
return ''.$tablss.'表已恢复';
|
||||
}
|
||||
|
||||
/**
|
||||
* 还原数据操作(2017-08-27弃用)
|
||||
*/
|
||||
public function huifdataAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')exit('演示请勿操作');
|
||||
$xu = (int)$this->post('xu');
|
||||
$carr = c('file')->getfilerows(''.UPDIR.'/data');
|
||||
$sida = explode(',', $this->post('sid'));
|
||||
$rows = array();
|
||||
if(isset($carr[$xu])){
|
||||
$file = $carr[$xu]['filename'];
|
||||
$data = m('beifen')->getbfdata($file);
|
||||
if($data){
|
||||
$alltabls = $this->db->getalltable();
|
||||
foreach($sida as $tab){
|
||||
if(!isset($data[$tab]))continue;
|
||||
if(!in_array($tab, $alltabls))continue; //表不存在
|
||||
$dataall = $data[$tab]['data'];
|
||||
if(count($dataall)<=0)continue;
|
||||
|
||||
$allfields = $this->db->getallfields($tab);
|
||||
$fistdata = $dataall[0];
|
||||
$xufarr = array();
|
||||
foreach($fistdata as $f=>$v){
|
||||
if(in_array($f, $allfields)){
|
||||
$xufarr[] = $f;
|
||||
}
|
||||
}
|
||||
$uparr = array();
|
||||
foreach($dataall as $k=>$rs){
|
||||
$str1 = '';
|
||||
$upa = array();
|
||||
foreach($xufarr as $f){
|
||||
$upa[$f] = $rs[$f];
|
||||
}
|
||||
$uparr[] = $upa;
|
||||
}
|
||||
|
||||
$sql1 = "delete from `$tab`";
|
||||
$sql2 = "alter table `$tab` AUTO_INCREMENT=1";
|
||||
$bo = $this->db->query($sql1, false);
|
||||
$bo = $this->db->query($sql2, false);
|
||||
foreach($uparr as $k=>$upas){
|
||||
$bo = $this->db->record($tab, $upas);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo 'ok';
|
||||
}
|
||||
|
||||
public function chushuserAjax()
|
||||
{
|
||||
|
||||
if(getconfig('systype')=='demo')return '演示请勿操作';
|
||||
if($this->adminid!=1)return '只有ID=1的管理员才可以用';
|
||||
|
||||
$users = "'diaochan','zhangfei','daqiao','xiaoqiao','zhaozl','rock','xinhu'";
|
||||
$dbs = m('admin');
|
||||
$dba = m('dept');
|
||||
|
||||
//默认可以多次初始化
|
||||
if($this->option->getval('sysuserinit', '是') != '是')
|
||||
if($dbs->rows("`user` in($users)")==0)return '可能你已初始化过用户和部门了,要开启可到【流程模块→数据选项】系统选项下开启';
|
||||
|
||||
$dbs->delete('id>1');
|
||||
$this->db->query('alter table `[Q]admin` AUTO_INCREMENT=2', false);
|
||||
|
||||
$dba->delete('id>1');
|
||||
$this->db->query('alter table `[Q]dept` AUTO_INCREMENT=2', false);
|
||||
|
||||
$this->db->query('delete from `[Q]userinfo`', false);
|
||||
$this->db->query('delete from `[Q]userinfos`', false);
|
||||
$this->db->query('alter table `[Q]userinfos` AUTO_INCREMENT=1', false);
|
||||
|
||||
return 'ok';
|
||||
}
|
||||
}
|
||||
89
webmain/system/beifen/rock_beifen.php
Normal file
89
webmain/system/beifen/rock_beifen.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var c={
|
||||
chush:function(o1){
|
||||
js.confirm('确定要初始化系统数据嘛?<font color=red>慎重!</font>',function(bt){
|
||||
if(bt=='yes'){
|
||||
o1.disabled=true;
|
||||
c.chushss(o1);
|
||||
}
|
||||
});
|
||||
},
|
||||
chushss:function(o1){
|
||||
js.msg('wait','初始中...');
|
||||
js.ajax(js.getajaxurl('chushua','{mode}','{dir}'),{}, function(s){
|
||||
if(s=='ok'){
|
||||
js.confirm('初始化成功,请重新登录',function(){
|
||||
js.location('?m=login&a=exit');
|
||||
});
|
||||
}else{
|
||||
js.msg('msg', s);
|
||||
o1.disabled=false;
|
||||
}
|
||||
});
|
||||
},
|
||||
beifen:function(o1,lx){
|
||||
js.msg('wait','备份中...');
|
||||
js.ajax(js.getajaxurl('beifen','{mode}','{dir}'),{lx:lx}, function(s){
|
||||
if(s=='ok'){
|
||||
js.msg('success', '备份成功请到目录<?=UPDIR?>/data下查看');
|
||||
}else{
|
||||
js.msg('msg', s);
|
||||
}
|
||||
});
|
||||
},
|
||||
huifu:function(){
|
||||
js.confirm('建议:恢复数据前请先备份一下数据啊!是否去备份?',function(jg){
|
||||
if(jg=='yes'){
|
||||
c.beifen();
|
||||
}else{
|
||||
addtabs({name:'数据恢复',num:'huifu',url:'system,beifen,huifu'});
|
||||
}
|
||||
});
|
||||
},
|
||||
deluser:function(o1){
|
||||
js.confirm('确定要初始化部门和用户数据嘛?<font color=red>慎重!</font>',function(bt){
|
||||
if(bt=='yes'){
|
||||
o1.disabled=true;
|
||||
c.delusers(o1);
|
||||
}
|
||||
});
|
||||
},
|
||||
delusers:function(o1){
|
||||
js.msg('wait','初始中...');
|
||||
js.ajax(js.getajaxurl('chushuser','{mode}','{dir}'),{}, function(s){
|
||||
js.msg();
|
||||
if(s=='ok'){
|
||||
js.alert('部门和用户已初始,请到用户管理导入用户。');
|
||||
}else{
|
||||
js.msg('msg', s);
|
||||
o1.disabled=false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div align="left">
|
||||
<div>
|
||||
<button click="beifen,0" class="btn btn-success" type="button">系统数据备份</button>
|
||||
</div>
|
||||
<div class="tishi">数据备份会备份到系统目录<?=UPDIR?>/data文件下,建议每天备份一次!</div>
|
||||
|
||||
<div class="blank10"></div>
|
||||
<div><button click="huifu" class="btn btn-info" type="button">系统数据恢复</button></div>
|
||||
<div class="tishi">恢复你备份过的数据!</div>
|
||||
|
||||
|
||||
<div class="blank20"></div>
|
||||
<div><button click="chush" class="btn btn-danger" type="button">系统数据初始化</button></div>
|
||||
<div class="tishi">初始化将会清空系统上所有数据(除了人员、组织结构、模块配置权限),请谨慎使用!</div>
|
||||
|
||||
<div class="blank20"></div>
|
||||
<div><button click="deluser" class="btn btn-danger" type="button">初始化部门和用户</button></div>
|
||||
<div class="tishi">初始化部门和用户,将会删除你创建的用户和部门,为了防止误删只能使用一次,请备份好数据谨慎使用!</div>
|
||||
|
||||
</div>
|
||||
93
webmain/system/beifen/rock_beifen_huifu.php
Normal file
93
webmain/system/beifen/rock_beifen_huifu.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var folder='';
|
||||
var at = $('#viewss_{rand}').bootstable({
|
||||
tablename:'option',celleditor:false,url:js.getajaxurl('getdata', '{mode}', '{dir}'),
|
||||
columns:[{
|
||||
text:'备份时间',dataIndex:'filename'
|
||||
},{
|
||||
text:'操作',dataIndex:'opt',renderer:function(v,d,i){
|
||||
return '<a href="javascript:;" onclick="huifww{rand}('+i+')">恢复</a>';
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'option',celleditor:true,checked:true,url:js.getajaxurl('getdatssss', '{mode}', '{dir}'),
|
||||
autoLoad:false,params:{xu:0},
|
||||
columns:[{
|
||||
text:'表名',dataIndex:'fields'
|
||||
},{
|
||||
text:'字段数',dataIndex:'fieldshu'
|
||||
},{
|
||||
text:'记录数',dataIndex:'total'
|
||||
},{
|
||||
text:'文件大小',dataIndex:'filesizecn'
|
||||
}],
|
||||
load:function(){
|
||||
get('btnss_{rand}').focus();
|
||||
}
|
||||
});
|
||||
|
||||
huifww{rand}=function(i){
|
||||
c.huifu(i);
|
||||
}
|
||||
|
||||
var c = {
|
||||
huifu:function(f){
|
||||
var d = at.getData(f);
|
||||
folder= d.filename;
|
||||
a.setparams({'folder':d.filename},true);//恢复的文件夹
|
||||
},
|
||||
clickwin:function(){
|
||||
var sid = a.getchecked();
|
||||
if(sid==''){
|
||||
js.msg('msg','没有选中记录');
|
||||
return;
|
||||
}
|
||||
js.confirm('确定要恢复选中的数据库表吗?恢复了现有的数据就没有了!',function(jg){
|
||||
if(jg=='yes'){
|
||||
setTimeout(function(){
|
||||
c.huifusss(sid);
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
},
|
||||
huifusss:function(sid){
|
||||
js.wait('恢复中请不要关闭...');
|
||||
js.ajax(js.getajaxurl('huifdatanew', '{mode}', '{dir}'),{sid:sid,'folder':folder},function(s){
|
||||
setTimeout(function(){
|
||||
js.tanclose('confirm');
|
||||
js.msg('success','恢复'+s+'');
|
||||
}, 1000);
|
||||
},'post');
|
||||
},
|
||||
reload:function(){
|
||||
at.reload();
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr valign="top">
|
||||
<td width="30%">
|
||||
<div>
|
||||
<button class="btn btn-default" click="reload,0" type="button">刷新</button>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="viewss_{rand}"></div>
|
||||
</td>
|
||||
<td width="10"></td>
|
||||
<td>
|
||||
<div align="right"><font color="#888888">系统只会恢复数据并不会恢复字段,建议选择单表恢复,以免超时。</font>
|
||||
<button class="btn btn-default" id="btnss_{rand}" click="clickwin,0" type="button">恢复选中表</button>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
46
webmain/system/city/cityAction.php
Normal file
46
webmain/system/city/cityAction.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
class cityClassAction extends Action
|
||||
{
|
||||
//数据源
|
||||
public function getdataAjax()
|
||||
{
|
||||
$id = $this->post('id');
|
||||
if(isempt($id))$id='1';
|
||||
$id = (int)$id;
|
||||
$dbs = m('city');
|
||||
$rows = $dbs->getrows('pid='.$id.'','*','`sort`,`id`');
|
||||
$patha = $dbs->getpath($id);
|
||||
$type = $dbs->getmou('type', $id);
|
||||
if(isempt($type))$type=-1;
|
||||
$ntype = (int)$type+1;
|
||||
if($ntype==0)$id = 0; //顶级
|
||||
return array(
|
||||
'type' => $ntype,
|
||||
'pid' => $id,
|
||||
'rows' => $rows,
|
||||
'path' => $patha,
|
||||
);
|
||||
}
|
||||
|
||||
//删除
|
||||
public function deldataAjax()
|
||||
{
|
||||
$id = (int)$this->post('id','0');
|
||||
$to = m('city')->rows("`pid`='$id'");
|
||||
if($to>0)return returnerror('有'.$to.'条下级不能删除');
|
||||
m('city')->delete($id);
|
||||
return returnsuccess();
|
||||
}
|
||||
|
||||
//从官网获取城市数据
|
||||
public function initdataAjax()
|
||||
{
|
||||
c('cache')->del('cityalldata');
|
||||
return m('city')->daorudata();
|
||||
}
|
||||
|
||||
public function clearchaheAjax()
|
||||
{
|
||||
c('cache')->del('cityalldata');
|
||||
}
|
||||
}
|
||||
139
webmain/system/city/rock_city.php
Normal file
139
webmain/system/city/rock_city.php
Normal file
@@ -0,0 +1,139 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var type = 0,pid=0;
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'city',celleditor:true,sort:'sort',dir:'asc',url:js.getajaxurl('getdata','{mode}','{dir}'),
|
||||
columns:[{
|
||||
text:'名称',dataIndex:'name',editor:true,align:'left'
|
||||
},{
|
||||
text:'拼音',dataIndex:'pinyin',editor:true,sortable:true
|
||||
},{
|
||||
text:'拼音简称',dataIndex:'pinyins',editor:true
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort',editor:true,sortable:true
|
||||
},{
|
||||
text:'级别',dataIndex:'type'
|
||||
},{
|
||||
text:'ID',dataIndex:'id',sortable:true
|
||||
},{
|
||||
text:'上级ID',dataIndex:'pid'
|
||||
},{
|
||||
text:'',dataIndex:'opt',renderer:function(v,d){
|
||||
return '<a href="javascript:;" onclick="opensho{rand}('+d.id+')">打开</a>';
|
||||
}
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
},
|
||||
load:function(ds){
|
||||
var darr = ds.path;
|
||||
var s = '<a href="javascript:;" onclick="opensho{rand}(0)">顶级</a>';
|
||||
for(var i=0;i<darr.length;i++){
|
||||
s+='/<a href="javascript:;" onclick="opensho{rand}('+darr[i].id+')">'+darr[i].name+'</a>';
|
||||
}
|
||||
$('#path_{rand}').html(s);
|
||||
type = ds.type;
|
||||
pid = ds.pid;
|
||||
btn(true);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del({url:js.getajaxurl('deldata','{mode}','{dir}')});
|
||||
},
|
||||
open:function(id){
|
||||
a.setparams({id:id}, true);
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var h = $.bootsform({
|
||||
title:'城市',height:300,width:400,
|
||||
tablename:'city',isedit:lx,
|
||||
submitfields:'name,pinyin,pinyins,type,pid',
|
||||
items:[{
|
||||
labelText:'名称',name:'name',required:true
|
||||
},{
|
||||
labelText:'拼音',name:'pinyin'
|
||||
},{
|
||||
labelText:'拼音简称',name:'pinyins'
|
||||
},{
|
||||
labelText:'',name:'type',type:'hidden'
|
||||
},{
|
||||
labelText:'',name:'pid',type:'hidden'
|
||||
},{
|
||||
labelText:'序号',name:'sort',type:'number',value:'0'
|
||||
}],
|
||||
success:function(){
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
h.setValue('type', type);
|
||||
h.setValue('pid', pid);
|
||||
if(lx==1){
|
||||
h.setValues(a.changedata);
|
||||
}
|
||||
h.getField('name').focus();
|
||||
},
|
||||
refresh:function(){
|
||||
a.reload();
|
||||
},
|
||||
initdata:function(o1){
|
||||
js.msg('wait','处理中...');
|
||||
o1.disabled=true;
|
||||
js.ajax(js.getajaxurl('initdata','{mode}','{dir}'),false,function(ret){
|
||||
if(ret.success){
|
||||
js.msg('success', ret.data);
|
||||
a.reload();
|
||||
}else{
|
||||
o1.disabled=false;
|
||||
js.msg('msg', ret.msg);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
clearchahe:function(){
|
||||
js.ajax(js.getajaxurl('clearchahe','{mode}','{dir}'),false,function(ret){
|
||||
js.msg('success', '已清除');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function btn(bo){
|
||||
get('del_{rand}').disabled = bo;
|
||||
get('edit_{rand}').disabled = bo;
|
||||
}
|
||||
js.initbtn(c);
|
||||
opensho{rand}=function(id){
|
||||
c.open(id);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
<button class="btn btn-default" click="refresh" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
<button class="btn btn-default" click="initdata" type="button">导入数据</button>
|
||||
</td>
|
||||
|
||||
<td width="80%">
|
||||
当前路径:<span id="path_{rand}"></span>
|
||||
</td>
|
||||
<td align="right" nowrap>
|
||||
|
||||
<button class="btn btn-default" click="clearchahe" type="button">清除城市数据缓存</button>
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
<div class="tishi"></div>
|
||||
417
webmain/system/cog/cogAction.php
Normal file
417
webmain/system/cog/cogAction.php
Normal file
@@ -0,0 +1,417 @@
|
||||
<?php
|
||||
class cogClassAction extends Action
|
||||
{
|
||||
public function sysinfoAjax()
|
||||
{
|
||||
$fields = array(
|
||||
'title' => '系统名称',
|
||||
'url' => '系统URL地址',
|
||||
'localurl' => '系统本地地址',
|
||||
'outurl' => '外网地址',
|
||||
'db_drive' => '操作数据库驱动',
|
||||
'db_host' => '数据库地址',
|
||||
'db_name' => '数据库名称',
|
||||
'version' => '版本',
|
||||
'phpos' => '服务器',
|
||||
'phpver' => 'PHP版本',
|
||||
'mysqlver' => 'mysql版本',
|
||||
'SERVER_SOFTWARE' => 'web服务器',
|
||||
'upload_max_filesize' => '最大上传大小',
|
||||
'post_max_size' => 'POST最大',
|
||||
'memory_limit' => '使用最大内存',
|
||||
'curl' => '是否支持CURL',
|
||||
'max_execution_time' => 'PHP执行超时时间',
|
||||
);
|
||||
|
||||
$data = array(
|
||||
'title' => getconfig('title'),
|
||||
'url' => getconfig('url'),
|
||||
'localurl' => getconfig('localurl'),
|
||||
'taskurl' => getconfig('taskurl'),
|
||||
'outurl' => getconfig('outurl'),
|
||||
'xinhukey' => getconfig('xinhukey'),
|
||||
'db_host' => DB_HOST,
|
||||
'db_name' => DB_BASE,
|
||||
'db_drive' => getconfig('db_drive'),
|
||||
'version' => '信呼V'.VERSION.'',
|
||||
'phpos' => PHP_OS,
|
||||
'phpver' => PHP_VERSION,
|
||||
'mysqlver' => $this->db->getsyscount('version'),
|
||||
'SERVER_SOFTWARE' => $_SERVER['SERVER_SOFTWARE'],
|
||||
'upload_max_filesize' => ini_get('upload_max_filesize'),
|
||||
'post_max_size' => ini_get('post_max_size'),
|
||||
'memory_limit' => ini_get('memory_limit'),
|
||||
'max_execution_time' => ini_get('max_execution_time').'秒',
|
||||
|
||||
);
|
||||
if(!function_exists('curl_init')){
|
||||
$data['curl'] = '<font color=red>不支持</font>';
|
||||
}else{
|
||||
$data['curl'] = '<font color=green>支持</font>';
|
||||
}
|
||||
|
||||
$this->returnjson(array(
|
||||
'fields' => $fields,
|
||||
'data' => $data,
|
||||
));
|
||||
}
|
||||
|
||||
public function getinfoAjax()
|
||||
{
|
||||
$arr['title'] = getconfig('title');
|
||||
$arr['outurl'] = getconfig('outurl');
|
||||
$arr['url'] = arrvalue($GLOBALS['_tempconf'],'url');
|
||||
$arr['localurl'] = getconfig('localurl');
|
||||
$arr['apptitle'] = getconfig('apptitle');
|
||||
$arr['platurl'] = getconfig('platurl');
|
||||
$arr['reimtitle'] = getconfig('reimtitle');
|
||||
$arr['asynkey'] = getconfig('asynkey');
|
||||
$arr['openkey'] = getconfig('openkey');
|
||||
$arr['db_drive'] = getconfig('db_drive');
|
||||
$arr['xinhukey'] = getconfig('xinhukey');
|
||||
$arr['bcolorxiang'] = getconfig('bcolorxiang');
|
||||
$arr['qqmapkey'] = getconfig('qqmapkey');
|
||||
$arr['asynsend'] = getconfig('asynsend');
|
||||
$arr['defstype'] = getconfig('defstype','1');
|
||||
$arr['officeyl'] = getconfig('officeyl'); //文档预览
|
||||
$arr['officebj'] = getconfig('officebj');
|
||||
$arr['apptheme'] = getconfig('apptheme');
|
||||
$arr['officebj_key'] = getconfig('officebj_key');
|
||||
$arr['useropt'] = getconfig('useropt');
|
||||
$arr['sqllog'] = getconfig('sqllog') ? '1' : '0';
|
||||
$arr['debug'] = getconfig('debug') ? '1' : '0';
|
||||
$arr['reim_show'] = getconfig('reim_show') ? '1' : '0';
|
||||
$arr['mobile_show'] = getconfig('mobile_show') ? '1' : '0';
|
||||
$arr['companymode'] = getconfig('companymode') ? '1' : '0';
|
||||
$arr['isshou'] = $this->isshouquan() ? '1' : '0';
|
||||
$arr['editpass'] = getconfig('editpass','0');
|
||||
|
||||
$arr['asyntest'] = $this->option->getval('asyntest');
|
||||
|
||||
$loginyzm = getconfig('loginyzm');
|
||||
if(!$loginyzm)$loginyzm = '0';
|
||||
$arr['loginyzm'] = $loginyzm;
|
||||
if(getconfig('systype')=='demo'){
|
||||
$arr['xinhukey']='';
|
||||
$arr['officebj_key']='';
|
||||
}
|
||||
if(!isempt($arr['xinhukey']))$arr['xinhukey'] = substr($arr['xinhukey'],0,5).'*****'.substr($arr['xinhukey'],-5);
|
||||
|
||||
$this->returnjson($arr);
|
||||
}
|
||||
|
||||
private function isshouquan()
|
||||
{
|
||||
$key = getconfig('authorkey');
|
||||
if(!isempt($key) && $this->rock->isjm($key)){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function savecongAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')exit('演示上禁止设置');
|
||||
if($this->getsession('isadmin')!='1')exit('非管理员不能操作');
|
||||
|
||||
$puurl = $this->option->getval('reimpushurlsystem',1);
|
||||
|
||||
$_confpath = $this->rock->strformat('?0/?1/?1Config.php', ROOT_PATH, PROJECT);
|
||||
$arr = require($_confpath);
|
||||
|
||||
$title = $this->post('title');
|
||||
if(!isempt($title))$arr['title'] = $title;
|
||||
|
||||
$arr['url'] = $this->post('url');
|
||||
$arr['outurl'] = $this->post('outurl');
|
||||
$arr['reimtitle'] = $this->post('reimtitle');
|
||||
$arr['qqmapkey'] = $this->post('qqmapkey');
|
||||
$arr['platurl'] = $this->post('platurl');
|
||||
|
||||
$apptitle = $this->post('apptitle');
|
||||
if(!isempt($apptitle))$arr['apptitle'] = $apptitle;
|
||||
|
||||
$asynkey = $this->post('asynkey');
|
||||
if(!isempt($asynkey))$arr['asynkey'] = $asynkey;
|
||||
|
||||
$db_drive = $this->post('db_drive');
|
||||
if(!isempt($db_drive)){
|
||||
if($db_drive=='mysql' && !function_exists('mysql_connect'))exit('未开启mysql扩展模块');
|
||||
if($db_drive=='mysqli' && !class_exists('mysqli'))exit('未开启mysqli扩展模块');
|
||||
if($db_drive=='pdo' && !class_exists('PDO'))exit('未开启pdo扩展模块');
|
||||
$arr['db_drive'] = $db_drive;
|
||||
}
|
||||
|
||||
$arr['localurl'] = $this->post('localurl');
|
||||
$arr['openkey'] = $this->post('openkey');
|
||||
|
||||
$arr['xinhukey'] = $this->post('xinhukey');
|
||||
if(contain($arr['xinhukey'],'**'))$arr['xinhukey'] = getconfig('xinhukey');
|
||||
|
||||
$arr['bcolorxiang'] = $this->post('bcolorxiang');
|
||||
|
||||
$arr['officeyl'] = $this->post('officeyl');
|
||||
$arr['useropt'] = $this->post('useropt');
|
||||
$arr['editpass'] = $this->post('editpass');
|
||||
$arr['defstype'] = $this->post('defstype','1');
|
||||
$arr['officebj'] = $this->post('officebj');
|
||||
$arr['officebj_key']= $this->post('officebj_key');
|
||||
|
||||
$asynsend = $this->post('asynsend');
|
||||
$arr['asynsend'] = $asynsend;
|
||||
|
||||
$arr['sqllog'] = $this->post('sqllog')=='1';
|
||||
$arr['debug'] = $this->post('debug')=='1';
|
||||
$arr['reim_show'] = $this->post('reim_show')=='1';
|
||||
$arr['mobile_show'] = $this->post('mobile_show')=='1';
|
||||
$arr['companymode'] = $this->post('companymode')=='1';
|
||||
$arr['loginyzm'] = $this->post('loginyzm');
|
||||
$arr['apptheme'] = $this->post('apptheme');
|
||||
|
||||
if($asynsend == '1' && isempt($puurl))exit('未安装或开启服务端不能使用异步发送消息');
|
||||
|
||||
$xpd = explode(',', "\\,', ,<,>,*,%,&");
|
||||
$xpd[]= "\n";
|
||||
foreach($arr as $k=>$v)if(!is_bool($v))$arr[$k] = str_replace($xpd,'',$v);
|
||||
|
||||
$smarr['url'] = '系统URL';
|
||||
$smarr['localurl'] = '本地系统URL,用于服务器上浏览地址';
|
||||
$smarr['title'] = '系统默认标题';
|
||||
$smarr['neturl'] = '系统外网地址,用于公网';
|
||||
$smarr['apptitle'] = 'APP上和手机网页版上的标题';
|
||||
$smarr['reimtitle'] = 'REIM即时通信上标题';
|
||||
$smarr['weblogo'] = 'PC客户端上的logo图片';
|
||||
$smarr['db_host'] = '数据库地址';
|
||||
$smarr['db_user'] = '数据库用户名';
|
||||
$smarr['db_pass'] = '数据库密码';
|
||||
$smarr['db_base'] = '数据库名称';
|
||||
$smarr['perfix'] = '数据库表名前缀';
|
||||
$smarr['qom'] = 'session、cookie前缀';
|
||||
$smarr['highpass'] = '超级管理员密码,可用于登录任何帐号';
|
||||
$smarr['db_drive'] = '操作数据库驱动有mysql,mysqli,pdo三种';
|
||||
$smarr['randkey'] = '系统随机字符串密钥';
|
||||
$smarr['asynkey'] = '这是异步任务key';
|
||||
$smarr['openkey'] = '对外接口openkey';
|
||||
$smarr['sqllog'] = '是否记录sql日志保存'.UPDIR.'/sqllog下';
|
||||
$smarr['asynsend'] = '是否异步发送提醒消息,0同步,1自己服务端异步,2官网VIP用户异步';
|
||||
$smarr['install'] = '已安装,不要去掉啊';
|
||||
$smarr['xinhukey'] = '信呼官网key,用于在线升级使用';
|
||||
$smarr['bcolorxiang'] = '单据详情页面上默认展示线条的颜色';
|
||||
$smarr['debug'] = '为true调试开发模式,false上线模式';
|
||||
$smarr['reim_show'] = '首页是否显示REIM';
|
||||
$smarr['mobile_show'] = '首页是否显示手机版';
|
||||
$smarr['loginyzm'] = '登录方式:0仅使用帐号+密码,1帐号+密码/手机+验证码,2帐号+密码+验证码,3仅使用手机+验证码';
|
||||
$smarr['officeyl'] = '文档Excel.Doc预览类型,0自己部署插件,1使用官网支持任何平台';
|
||||
$smarr['officedk'] = '文件预览打开方式1新窗口打开';
|
||||
$smarr['useropt'] = '1记录用户操作保存到日志里,空不记录';
|
||||
$smarr['defstype'] = 'PC后台主题皮肤,可以设置1到34';
|
||||
$smarr['editpass'] = '用户登录修改密码:0不用修改,1强制用户必须修改';
|
||||
$smarr['companymode'] = '多单位模式,true就是开启';
|
||||
$smarr['outurl'] = '这个地址当你内网地址访问时向手机推送消息的地址';
|
||||
$smarr['officebj'] = '文档在线编辑,1官网提供或者自己部署';
|
||||
$smarr['officebj_key'] = '文档在线编辑agentkey';
|
||||
$smarr['apptheme'] = '系统或app的主题颜色';
|
||||
|
||||
$str1 = '';
|
||||
foreach($arr as $k=>$v){
|
||||
$bz = '';
|
||||
if(isset($smarr[$k]))$bz=' //'.$smarr[$k].'';
|
||||
if(is_bool($v)){
|
||||
$v = $v ? 'true' : 'false';
|
||||
}else{
|
||||
$v = "'$v'";
|
||||
}
|
||||
$str1.= " '$k' => $v,$bz\n";
|
||||
}
|
||||
|
||||
$str = '<?php
|
||||
if(!defined(\'HOST\'))die(\'not access\');
|
||||
//[管理员]在'.$this->now.'通过[系统→系统工具→系统设置],保存修改了配置文件
|
||||
return array(
|
||||
'.$str1.'
|
||||
);';
|
||||
@$bo = file_put_contents($_confpath, $str);
|
||||
if($bo){
|
||||
echo 'ok';
|
||||
}else{
|
||||
echo '保存失败无法写入:'.$_confpath.'';
|
||||
}
|
||||
}
|
||||
|
||||
public function logbefore($table)
|
||||
{
|
||||
$key = $this->post('key');
|
||||
$s = '';
|
||||
if($key != ''){
|
||||
$s = "and (`type`='$key' or `optname` like '$key%' or `remark` like '$key%' or `web`='$key' or `ip`='$key')";
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
|
||||
public function logintokenbefore($table)
|
||||
{
|
||||
$key = $this->post('key');
|
||||
$s = '';
|
||||
if($key != ''){
|
||||
$s = "and (`name` like '%$key%' or `cfrom` like '%$key%' or `web` like '%$key%')";
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
|
||||
public function delloginAjax()
|
||||
{
|
||||
$id = c('check')->onlynumber($this->post('id'));
|
||||
m('logintoken')->delete('id in('.$id.')');
|
||||
backmsg();
|
||||
}
|
||||
|
||||
public function dellogAjax()
|
||||
{
|
||||
$id = c('check')->onlynumber($this->post('id'));
|
||||
m('log')->delete('id in('.$id.')');
|
||||
backmsg();
|
||||
}
|
||||
|
||||
public function clearlogAjax()
|
||||
{
|
||||
$lx = (int)$this->get('lx','0');
|
||||
$where = "`type`='异步队列'";
|
||||
if($lx==0)$where = '1=1';
|
||||
m('log')->delete($where);
|
||||
return returnsuccess();
|
||||
}
|
||||
|
||||
public function saveautherAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')exit('演示上不要操作');
|
||||
$autherkey = $this->post('key');
|
||||
$ym = $this->post('ym');
|
||||
$barr = c('xinhuapi')->authercheck($autherkey, $ym);
|
||||
if($barr['success']){
|
||||
echo 'ok';
|
||||
}else{
|
||||
echo $barr['msg'];
|
||||
}
|
||||
}
|
||||
public function savelixianAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')exit('演示上不要操作');
|
||||
$aukey = $this->post('key');
|
||||
$ym = $this->post('ym');
|
||||
$path = 'config/rockauther.php';
|
||||
if(!file_exists($path))exit('没有下载签授文件到系统上');
|
||||
$da = require($path);
|
||||
$barr = c('xinhuapi')->autherfile($da, $aukey, $ym);
|
||||
if($barr['success']){
|
||||
@unlink($path);
|
||||
echo 'ok';
|
||||
}else{
|
||||
echo $barr['msg'];
|
||||
}
|
||||
}
|
||||
public function autherAjax()
|
||||
{
|
||||
$aukey = $this->option->getval('auther_aukey');
|
||||
$use = '1';
|
||||
$barr = array();
|
||||
if(isempt($aukey)){
|
||||
$use = '0';
|
||||
}else{
|
||||
$barr['enddt'] = $this->option->getval('auther_enddt');
|
||||
$barr['yuming']= $this->option->getval('auther_yuming');
|
||||
$barr['aukey'] = substr($aukey,0,5).'****'.substr($aukey,-5);
|
||||
}
|
||||
$barr['use'] = $use;
|
||||
return returnsuccess($barr);
|
||||
}
|
||||
public function autherdelAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')return returnerror('演示上不要操作');
|
||||
return c('xinhuapi')->autherdel();
|
||||
}
|
||||
public function tongbudwAjax()
|
||||
{
|
||||
$rows = m('company')->getall('iscreate=1');
|
||||
foreach($rows as $k=>$rs){
|
||||
$base = ''.DB_BASE.'_company_'.$rs['num'].'';
|
||||
$this->sevessee($base, 'auther_aukey');
|
||||
$this->sevessee($base, 'auther_enddt');
|
||||
$this->sevessee($base, 'auther_yuming');
|
||||
$this->sevessee($base, 'auther_authkey');
|
||||
}
|
||||
return '同步成功';
|
||||
}
|
||||
private function sevessee($base, $key)
|
||||
{
|
||||
$val = $this->option->getval($key);
|
||||
$sql = "update ".$base.".`[Q]option` set `value`='$val',`optdt`='{$this->now}' where `num`='$key'";
|
||||
$this->db->query($sql, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 更多保存设置
|
||||
*/
|
||||
public function savemoresetAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')return '演示不要改';
|
||||
$stype = (int)$this->post('stype','0');
|
||||
$msg = 'ok';
|
||||
if($stype==0)$msg = $this->saveconfig('title,imgcompress,watertype,video_bool,flowchehuitime,saasmode',',video_bool,');
|
||||
|
||||
return $msg;
|
||||
}
|
||||
private function saveconfig($cont, $bsto)
|
||||
{
|
||||
$path = ''.P.'/'.P.'Config.php';
|
||||
|
||||
$neir = file_get_contents($path);
|
||||
$zdar = explode(',', $cont);
|
||||
$neira= explode("\n", $neir);
|
||||
|
||||
$strs = '';
|
||||
$szida= array();
|
||||
foreach($neira as $line){
|
||||
if($line==');')break;
|
||||
$bo = false;
|
||||
foreach($zdar as $fid){
|
||||
if(contain($line,"'".$fid."'")){
|
||||
$val = $this->post($fid);
|
||||
if(contain($val,'*****')){
|
||||
$strs.="".$line."\n";
|
||||
}else{
|
||||
$val = $this->rock->xssrepstr($val);
|
||||
$vals = "'".$val."'";
|
||||
if(contain($bsto,','.$fid.','))$vals = ($val=='1') ? 'true' : 'false';
|
||||
$strs.=" '".$fid."' => ".$vals.",\n";
|
||||
}
|
||||
$bo = true;
|
||||
$szida[]=$fid;
|
||||
}
|
||||
}
|
||||
if(!$bo)$strs.="".$line."\n";
|
||||
}
|
||||
|
||||
foreach($zdar as $fid){
|
||||
if(!in_array($fid, $szida)){
|
||||
$val = $this->post($fid);
|
||||
$strs.=" '".$fid."' => '".$val."',\n";
|
||||
}
|
||||
}
|
||||
|
||||
$strs.=');';
|
||||
$bo = @file_put_contents($path,$strs);
|
||||
if(!$bo)return '无权限写入:'.$path.'';
|
||||
return 'ok';
|
||||
}
|
||||
}
|
||||
137
webmain/system/cog/rock_cog_auther.php
Normal file
137
webmain/system/cog/rock_cog_auther.php
Normal file
@@ -0,0 +1,137 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var barr = {};
|
||||
var c={
|
||||
save:function(o1){
|
||||
var key = get('autherkey_{rand}').value,mvd='msgview{rand}';
|
||||
if(!key){js.setmsg('请输入签授密钥','',mvd);return;}
|
||||
o1.disabled=true;
|
||||
$('#savewen{rand}').hide();
|
||||
js.setmsg('验证中...','',mvd);
|
||||
js.ajax(js.getajaxurl('saveauther','{mode}','{dir}'),{key:key,ym:HOST}, function(s){
|
||||
if(s!='ok'){
|
||||
js.setmsg(s,'',mvd);
|
||||
o1.disabled=false;
|
||||
}else{
|
||||
js.setmsg('验证成功','green',mvd);
|
||||
c.load();
|
||||
}
|
||||
},'post',false);
|
||||
},
|
||||
wenyz:function(o1){
|
||||
var key = get('autherkey_{rand}').value,mvd='msgview{rand}';
|
||||
if(!key){js.setmsg('请输入签授密钥','',mvd);return;}
|
||||
o1.disabled=true;
|
||||
$('#savebtn{rand}').hide();
|
||||
js.setmsg('验证中...','',mvd);
|
||||
js.ajax(js.getajaxurl('savelixian','{mode}','{dir}'),{key:key,ym:HOST}, function(s){
|
||||
if(s!='ok'){
|
||||
js.setmsg(s,'',mvd);
|
||||
o1.disabled=false;
|
||||
}else{
|
||||
js.setmsg('验证成功','green',mvd);
|
||||
c.load();
|
||||
}
|
||||
},'post',false);
|
||||
},
|
||||
load:function(){
|
||||
var mvd='msgview{rand}';
|
||||
js.setmsg('获取中...','',mvd);
|
||||
js.ajax(js.getajaxurl('auther','{mode}','{dir}'),false, function(ret){
|
||||
var da = ret.data;
|
||||
js.setmsg('','',mvd);
|
||||
if(da.use=='1'){
|
||||
$('#auther_kq{rand}').html('<font color="green">已签授</font>');
|
||||
get('autherkey_{rand}').readOnly=true;
|
||||
get('autherkey_{rand}').value=da.aukey;
|
||||
$('#auther_enddt{rand}').html(jm.uncrypt(da.enddt));
|
||||
var str = jm.uncrypt(da.yuming);
|
||||
if((','+str+',').indexOf(','+HOST+',')<0)str+='<font style="font-size:12px" color="red">(与当前'+HOST+'域名不符合)</font>';
|
||||
$('#auther_yuming{rand}').html(str);
|
||||
$('#savebtn{rand}').hide();
|
||||
$('#savewen{rand}').hide();
|
||||
$('#savedel{rand}').show();
|
||||
}else{
|
||||
$('#auther_kq{rand}').html('<font color="red">未签授</font>');
|
||||
$('#auther_enddt{rand}').html('-');
|
||||
$('#auther_yuming{rand}').html('-');
|
||||
get('autherkey_{rand}').value='';
|
||||
get('autherkey_{rand}').readOnly=false;
|
||||
$('#savebtn{rand}').show();
|
||||
$('#savewen{rand}').show();
|
||||
$('#savedel{rand}').hide();
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
savedel:function(o1){
|
||||
js.confirm('确定要删除签授吗?', function(jg){if(jg=='yes')c.savedel2(o1);});
|
||||
},
|
||||
savedel2:function(o1){
|
||||
var mvd='msgview{rand}';
|
||||
js.setmsg('删除中...','',mvd);
|
||||
o1.disabled=true;
|
||||
js.ajax(js.getajaxurl('autherdel','{mode}','{dir}'),false, function(ret){
|
||||
if(ret.success){
|
||||
js.setmsg('','',mvd);
|
||||
c.load();
|
||||
}else{
|
||||
js.setmsg(ret.msg,'',mvd);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
tongbudw:function(){
|
||||
js.loading();
|
||||
js.ajax(js.getajaxurl('tongbudw','{mode}','{dir}'),false, function(ret){
|
||||
js.msgok(ret);
|
||||
},'get');
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
c.load();
|
||||
});
|
||||
</script>
|
||||
|
||||
<div style="padding:10px;" align="center">
|
||||
<div align="left" style="width:400px">
|
||||
|
||||
<table cellspacing="0" border="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><h4>系统签授(这个跟<font color=red>授权</font>没有任何关系)</h4></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div style="font-size:13px;color:#888888;padding-bottom:20px">是为了防止系统盗版使用,需要把你部署的系统签名授权,绑定了域名和有效时间,签授后才能有效享有系统功能,更好的升级维护,登录<a href="<?=URLY?>" target="_blank">官网</a>用户中心→系统签授,获取签授密钥。</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="40" width="70">签授情况</td>
|
||||
<td><span id="auther_kq{rand}"><font color="red">未签授</font></span> <a click="load" href="javascript:;"><i class="icon-refresh"></i></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="40">有效期至</td>
|
||||
<td id="auther_enddt{rand}">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="40">绑定域名</td>
|
||||
<td><div id="auther_yuming{rand}" class="wrap">-</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="60">签授密钥</td>
|
||||
<td ><input id="autherkey_{rand}" readOnly placeholder="可从官网用户中心中获取" style="width:300px" class="form-control"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td ></td>
|
||||
<td style="padding-top:20px">
|
||||
<button click="save" id="savebtn{rand}" style="display:none" class="btn btn-success" type="button"><i class="icon-key"></i> 提交验证</button>
|
||||
<button click="wenyz" id="savewen{rand}" style="display:none" class="btn btn-primary" type="button"><i class="icon-file"></i> 文件验证</button>
|
||||
<button click="savedel" id="savedel{rand}" style="display:none" class="btn btn-danger" type="button"><i class="icon-key"></i> 删除签授</button>
|
||||
<?php
|
||||
if(!COMPANYNUM && getconfig('platdwnum'))echo ' <button click="tongbudw" class="btn btn-primary" type="button">同步到单位数据</button>';
|
||||
?>
|
||||
<span id="msgview{rand}"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
110
webmain/system/cog/rock_cog_log.php
Normal file
110
webmain/system/cog/rock_cog_log.php
Normal file
@@ -0,0 +1,110 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params};
|
||||
var atype=params.atype;
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'log',celleditor:true,sort:'id',dir:'desc',modedir:'{mode}:{dir}',params:{'atype':atype},checked:true,fanye:true,
|
||||
storebeforeaction:'logbefore',
|
||||
columns:[{
|
||||
text:'类型',dataIndex:'type'
|
||||
},{
|
||||
text:'操作人',dataIndex:'optname',sortable:true
|
||||
},{
|
||||
text:'备注',dataIndex:'remark',align:'left',renderer:function(v,d){
|
||||
if(d.url && d.level==2){
|
||||
if(d.url.indexOf('http')==0){
|
||||
v+='<br>'+d.url+'';
|
||||
}else{
|
||||
v+='<br><a href="'+d.url+'" target="_blank">查看详情</a>';
|
||||
}
|
||||
}
|
||||
if(d.url && d.level==3){
|
||||
if(!ISDEMO)v+='<br>'+d.url+'';
|
||||
if(d.result)v+='<br>运行结果:<br>'+d.result+'';
|
||||
}
|
||||
return v;
|
||||
},renderstyle:function(){
|
||||
return 'word-wrap:break-word;word-break:break-all;white-space:normal;';
|
||||
}
|
||||
},{
|
||||
text:'操作时间',dataIndex:'optdt',sortable:true
|
||||
},{
|
||||
text:'IP',dataIndex:'ip'
|
||||
},{
|
||||
text:'浏览器',dataIndex:'web'
|
||||
},{
|
||||
text:'Device',dataIndex:'device'
|
||||
},{
|
||||
text:'级别',dataIndex:'level'
|
||||
},{
|
||||
text:'ID',dataIndex:'id',sortable:true
|
||||
}],
|
||||
rendertr:function(d){
|
||||
var s = '';
|
||||
if(d.level==2)s='style="color:red"';
|
||||
return s;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var c = {
|
||||
delss:function(){
|
||||
a.del({url:js.getajaxurl('dellog','{mode}','{dir}'),checked:true});
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown();
|
||||
},
|
||||
qingkong:function(ox,lx){
|
||||
var set = ['全部','异步队列'];
|
||||
js.confirm('确定要清空'+set[lx]+'的日志记录吗?', function(jg){
|
||||
if(jg=='yes')c.qingkongs(lx);
|
||||
});
|
||||
},
|
||||
qingkongs:function(lx){
|
||||
js.loading('清空中...');
|
||||
$.get(js.getajaxurl('clearlog','{mode}','{dir}',{lx:lx}), function(){
|
||||
js.msgok('已清空');
|
||||
a.reload();
|
||||
});
|
||||
},
|
||||
loginji:function(){
|
||||
addtabs({name:'登录记录',num:'loginjl',url:'system,cog,login',icons:'legal'});
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
<table width="100%"><tr>
|
||||
<td>
|
||||
<input class="form-control" style="width:300px" id="key_{rand}" placeholder="类型/操作人/浏览器/IP/备注">
|
||||
</td>
|
||||
<td nowrap style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
<button class="btn btn-default" click="daochu,1" type="button">导出</button>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td width="80%"></td>
|
||||
<td align="right" nowrap>
|
||||
|
||||
<button class="btn btn-default" click="loginji" type="button">查看登录记录</button>
|
||||
<button class="btn btn-default" click="qingkong,1" type="button">仅清空异步队列</button>
|
||||
<button class="btn btn-default" click="qingkong,0" type="button">清空全部</button>
|
||||
<button class="btn btn-danger" id="del_{rand}" click="delss" type="button"><i class="icon-trash"></i> 删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
78
webmain/system/cog/rock_cog_login.php
Normal file
78
webmain/system/cog/rock_cog_login.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params};
|
||||
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'logintoken',celleditor:true,sort:'moddt',dir:'desc',modedir:'{mode}:{dir}',checked:true,fanye:true,
|
||||
storebeforeaction:'logintokenbefore',
|
||||
columns:[{
|
||||
text:'姓名',dataIndex:'name'
|
||||
},{
|
||||
text:'用户ID',dataIndex:'uid',sortable:true
|
||||
},{
|
||||
text:'来源',dataIndex:'cfrom',sortable:true
|
||||
},{
|
||||
text:'IP',dataIndex:'ip'
|
||||
},{
|
||||
text:'浏览器',dataIndex:'web'
|
||||
},{
|
||||
text:'Device',dataIndex:'device'
|
||||
},{
|
||||
text:'app推送',dataIndex:'ispush',type:'checkbox',sortable:true
|
||||
},{
|
||||
text:'在线状态',dataIndex:'online',type:'checkbox',sortable:true
|
||||
},{
|
||||
text:'最后在线',dataIndex:'moddt',sortable:true
|
||||
},{
|
||||
text:'ID',dataIndex:'id',sortable:true
|
||||
}],
|
||||
rendertr:function(d){
|
||||
var s = '';
|
||||
if(d.online==0)s='style="color:#aaaaaa"';
|
||||
return s;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var c = {
|
||||
delss:function(){
|
||||
a.del({url:js.getajaxurl('dellogin','{mode}','{dir}'),checked:true});
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown();
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
<table width="100%"><tr>
|
||||
<td>
|
||||
<input class="form-control" style="width:300px" id="key_{rand}" placeholder="来源/姓名/浏览器">
|
||||
</td>
|
||||
<td nowrap style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
<button class="btn btn-default" click="daochu,1" type="button">导出</button>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td width="80%"></td>
|
||||
<td align="right" nowrap>
|
||||
|
||||
<button class="btn btn-danger" id="del_{rand}" click="delss" type="button"><i class="icon-trash"></i> 删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
124
webmain/system/cog/rock_cog_moreset.php
Normal file
124
webmain/system/cog/rock_cog_moreset.php
Normal file
@@ -0,0 +1,124 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
var c = {
|
||||
init:function(){
|
||||
|
||||
},
|
||||
tesgs:function(o1,lx){
|
||||
$('#tagsl{rand}').find('li').removeClass('active');
|
||||
o1.className='active';
|
||||
$('#tablstal0{rand}').hide();
|
||||
$('#tablstal1{rand}').hide();
|
||||
$('#tablstal2{rand}').hide();
|
||||
$('#tablstal3{rand}').hide();
|
||||
$('#tablstal'+lx+'{rand}').show();
|
||||
},
|
||||
savecog:function(o1,lx){
|
||||
var msgid = 'msgview'+lx+'_{rand}';
|
||||
var da = js.getformdata('form'+lx+'_{rand}');
|
||||
js.setmsg('保存中...','', msgid);
|
||||
da.stype = lx;
|
||||
js.ajax(js.getajaxurl('savemoreset','{mode}','{dir}'), da, function(s){
|
||||
if(s=='ok'){
|
||||
js.setmsg('保存成功','green', msgid);
|
||||
}else{
|
||||
js.setmsg(s,'', msgid);
|
||||
}
|
||||
},'post');
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
c.init();
|
||||
|
||||
});
|
||||
</script>
|
||||
<div style="padding:10px 30px">
|
||||
|
||||
<ul id="tagsl{rand}" class="nav nav-tabs">
|
||||
|
||||
<li click="tesgs,0" class="active">
|
||||
<a style="TEXT-DECORATION:none"><i class="icon-cog"></i> 基本设置</a>
|
||||
</li>
|
||||
<li id="passli{rand}" style="display:none" click="tesgs,1">
|
||||
<a style="TEXT-DECORATION:none">阿里云短信</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div style="padding-top:20px">
|
||||
|
||||
<form id="tablstal0{rand}" name="form0_{rand}">
|
||||
<table cellspacing="0" border="0" cellpadding="0">
|
||||
|
||||
|
||||
<tr><td align="right" style="color:gray">系统标题:</td><td><input name="title" type="text" value="<?=getconfig('title')?>" style="width:300px" class="form-control"></td></tr>
|
||||
<tr><td height="10"></td></tr>
|
||||
|
||||
|
||||
|
||||
<tr><td align="right" style="color:gray">图片压缩尺寸:</td><td><input name="imgcompress" type="text" value="<?=getconfig('imgcompress')?>" style="width:200px" placeholder="不设置不压缩" class="form-control">
|
||||
<span style="color:#aaaaaa;">仅对jpg文件压缩格式:宽x高,如800x1000</span>
|
||||
</td></tr>
|
||||
<tr><td height="10"></td></tr>
|
||||
|
||||
<tr><td align="right" style="color:gray">详情页水印:</td><td><select style="width:200px" name="watertype" class="form-control"><option value="">默认没有开启</option><option <?php if(getconfig('watertype')=='1')echo 'selected';?> value="1">开启</option></select>
|
||||
<span style="color:#aaaaaa;"><a target="_blank" href="<?=URLY?>view_shuiyin.html">帮助</a>说明</span></td></tr>
|
||||
<tr><td height="10"></td></tr>
|
||||
|
||||
<tr><td align="right" style="color:gray">APP音视频通话:</td><td><select style="width:200px" name="video_bool" class="form-control"><option value="0">关闭</option><option <?php if(getconfig('video_bool'))echo 'selected';?> value="1">开启</option></select>
|
||||
<span style="color:#aaaaaa;">开启后需要到[系统→系统工具→插件模块]安装音视频通话的插件</span></td></tr>
|
||||
<tr><td height="10"></td></tr>
|
||||
|
||||
<tr><td align="right" style="color:gray">人员审批撤回时间:</td><td><input name="flowchehuitime" type="number" value="<?=getconfig('flowchehuitime')?>" onfocus="js.focusval=this.value" onblur="js.number(this)" min="0" style="width:200px" placeholder="默认是2小时" class="form-control"></select>
|
||||
<span style="color:#aaaaaa;">默认2小时,已完成审批不支持撤回</span></td></tr>
|
||||
<tr><td height="10"></td></tr>
|
||||
|
||||
<tr><td align="right" style="color:gray">SAAS多单位模式:</td><td><select style="width:200px" name="saasmode" class="form-control"><option value="">默认没有开启</option><option <?php if(getconfig('saasmode')=='1')echo 'selected';?> value="1">开启(用不到不要开启)</option></select>
|
||||
<span style="color:#aaaaaa;">授权版使用,<a target="_blank" href="<?=URLY?>view_xinhuduo.html">帮助</a>说明,每个单位一个访问地址数据库分开。</span></td></tr>
|
||||
<tr><td height="10"></td></tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"></td>
|
||||
<td align="left"><button click="savecog,0" class="btn btn-success" type="button"><i class="icon-save"></i> 保存</button> <span id="msgview0_{rand}"></span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
|
||||
|
||||
<form id="tablstal1{rand}" style="display:none" name="form_{rand}">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="100" align="right" height="50">旧密码:</td>
|
||||
<td><input style="width:250px" name="passoldPost" type="password" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" height="70">新密码:</td>
|
||||
<td><input style="width:250px" name="passwordPost" placeholder="至少4位字母+数字组合" type="password" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" height="70">确认密码:</td>
|
||||
<td><input style="width:250px" name="password1Post" type="password" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td height="60" align="right"></td>
|
||||
<td align="left"><input class="btn btn-success" click="savepass" name="submitbtn" value="修改" type="button"> <span id="msgview_{rand}"></span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
286
webmain/system/cog/rock_cog_set.php
Normal file
286
webmain/system/cog/rock_cog_set.php
Normal file
@@ -0,0 +1,286 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var barr = {};
|
||||
var c={
|
||||
init:function(){
|
||||
this.loadys();
|
||||
js.ajax(js.getajaxurl('getinfo','{mode}','{dir}'),{},function(a){
|
||||
barr = a;
|
||||
for(var i in a)$('#'+i+'_{rand}').val(a[i]);
|
||||
if(a.isshou=='1')$('#benquan_{rand}').html('<font color=green>授权版</font>');
|
||||
if(isempt(a.asyntest))get('asynsend_{rand}').length=1;
|
||||
if(a.officebj=='1')$('#divofficebj_key').show();
|
||||
},'get,json');
|
||||
},
|
||||
loadys:function(){
|
||||
if(!get('defstype_{rand}'))return;
|
||||
var ysarr = 'cerulean,cosmo,cyborg,darkly,flatly,journal,lumen,paper,readable,sandstone,simplex,slate,spacelab,superhero,united,xinhu,yeti';
|
||||
var sear = ysarr.split(','),i,len=sear.length,das = [];
|
||||
for(i=0;i<len;i++){
|
||||
das.push({name:sear[i],value:i+1});
|
||||
das.push({name:sear[i]+'_def',value:i+1+len});
|
||||
}
|
||||
js.setselectdata(get('defstype_{rand}'),das,'value');
|
||||
},
|
||||
isurl:function(na,dz){
|
||||
if(dz){
|
||||
if(dz.substr(0,4)!='http')return ''+na+'必须http开头';
|
||||
if(dz.substr(-1)!='/')return ''+na+'必须/结尾';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
save:function(o){
|
||||
var d={};
|
||||
for(var i in barr){
|
||||
d[i] = $('#'+i+'_{rand}').val();
|
||||
}
|
||||
if(d.title==''){
|
||||
js.msg('msg','系统标题不能为空');
|
||||
return;
|
||||
}
|
||||
var keys = d.xinhukey;
|
||||
if(keys && keys.indexOf('*')==-1 && keys.length!=32){
|
||||
js.msg('msg','官网key格式有误,是32位md5格式,请看帮助获取');
|
||||
get('xinhukey_{rand}').focus();
|
||||
return;
|
||||
}
|
||||
if(d.officeyl==5 && d.officebj!=1){
|
||||
js.msg('msg','文档在线编辑请选第二个,否则无法使用');
|
||||
get('officebj_{rand}').focus();
|
||||
return;
|
||||
}
|
||||
if(d.platurl && d.platurl==NOWURL){
|
||||
js.msg('msg','平台使用地址不能跟当前地址一样');
|
||||
get('platurl_{rand}').focus();
|
||||
return;
|
||||
}
|
||||
js.ajax(js.getajaxurl('savecong','{mode}','{dir}'), d, function(s){
|
||||
if(s!='ok')js.msg('msg', s);
|
||||
},'post',false,'保存中...,保存成功');
|
||||
},
|
||||
blurls:function(o){
|
||||
var val = strreplace(o.value);
|
||||
if(val=='')return;
|
||||
if(val.substr(0,4)!='http')val='http://'+val+'';
|
||||
var la = val.substr(-1);
|
||||
if(la!='/')val+='/';
|
||||
o.value=val;
|
||||
},
|
||||
auther:function(){
|
||||
addtabs({name:'系统签授',num:'auther',url:'system,cog,auther',icons:'key'});
|
||||
},
|
||||
moreset:function(){
|
||||
addtabs({name:'更多系统设置',num:'moreset',url:'system,cog,moreset',icons:'cog'});
|
||||
},
|
||||
changebj:function(o1){
|
||||
if(o1.value=='1'){
|
||||
$('#divofficebj_key').show();
|
||||
}else{
|
||||
$('#divofficebj_key').hide();
|
||||
}
|
||||
},
|
||||
xuanys:function(){
|
||||
var zys = ['#1389D3','#99cc66','#003366','#6666CC','#CC3333','#009966','#333333','#990066','#333300','#333366','#99CC99','#663366','#003399','#666699'];
|
||||
var h = '<div style="padding:10px"><table class="cursor"><tr>';
|
||||
for(var i=0;i<zys.length;i++){
|
||||
h+='<td width="20" onclick="xuancolora{rand}(\''+zys[i]+'\')" width="20" bgcolor="'+zys[i]+'"> </td>';
|
||||
}
|
||||
h+='</tr></table></div>';
|
||||
js.tanbody('color','选择主题颜色',310,200,{
|
||||
html:h
|
||||
});
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
c.init();
|
||||
|
||||
$('#url_{rand}').blur(function(){
|
||||
c.blurls(this);
|
||||
});
|
||||
$('#localurl_{rand}').blur(function(){
|
||||
c.blurls(this);
|
||||
});
|
||||
$('#platurl_{rand}').blur(function(){
|
||||
c.blurls(this);
|
||||
});
|
||||
$('#outurl_{rand}').blur(function(){
|
||||
c.blurls(this);
|
||||
});
|
||||
$('#officebj_{rand}').change(function(){
|
||||
c.changebj(this);
|
||||
});
|
||||
xuancolora{rand}=function(col){
|
||||
get('apptheme_{rand}').value=col;
|
||||
js.tanclose('color');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div align="left">
|
||||
<div style="padding:10px;">
|
||||
|
||||
|
||||
<table cellspacing="0" width="900" border="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td colspan="4"><div class="inputtitle">基本信息
|
||||
<div style="padding:5px;line-height:18px;font-size:12px;color:#888888">此保存在配置文件下,也可以自己打开配置文件(webmain/webmainConfig.php)来修改</div>
|
||||
</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="4" class="tdinput" ><div align="center" style="line-height:30px">系统版本:<b id="benquan_{rand}" style="font-size:20px"><font color=red>开源版</font></b><input id="isshou_{rand}" type="hidden" class="form-control"> <button click="auther" class="btn btn-success btn-xs">系统签授</button> <button click="moreset" style="display:" class="btn btn-default btn-xs">更多设置</button></div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" width="15%" width="180">系统标题:</td>
|
||||
<td class="tdinput" width="35%" ><input id="title_{rand}" class="form-control"></td>
|
||||
|
||||
<td align="right" width="15%" >APP移动端上标题:</td>
|
||||
<td class="tdinput" width="35%"><input id="apptitle_{rand}" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">REIM即时通信标题:</td>
|
||||
<td class="tdinput"><input id="reimtitle_{rand}" class="form-control"></td>
|
||||
|
||||
<td align="right"><a target="_blank" href="<?=URLY?>">信呼官网</a>key:</td>
|
||||
<td class="tdinput"><input id="xinhukey_{rand}" class="form-control">
|
||||
<font color="#888888">用于在线升级使用,看<a target="_blank" href="<?=URLY?>view_xhkey.html">[帮助]</a>获取</font></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">系统URL地址:</td>
|
||||
<td class="tdinput"><input id="url_{rand}" placeholder="为空默认自动识别" class="form-control"><font color="#888888">可以为空不用设置的,<a onclick="get('url_{rand}').value=''" href="javascript:;">[清空]</a></font></td>
|
||||
|
||||
<td align="right">系统本地地址:</td>
|
||||
<td class="tdinput"><input id="localurl_{rand}" class="form-control">
|
||||
<font color="#888888">用于计划任务异步任务使用,没有可跟系统URL一样</font></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right">系统外网地址:</td>
|
||||
<td class="tdinput"><input id="outurl_{rand}" placeholder="不知道做啥的,就不要去设置" class="form-control"></td>
|
||||
<?php if(getconfig('platdwnum')){?>
|
||||
<td align="right">平台使用地址:</td>
|
||||
<td class="tdinput"><input id="platurl_{rand}" placeholder="不能跟当前地址一样" class="form-control"></td>
|
||||
<?php }?>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">系统主题色:</td>
|
||||
<td class="tdinput">
|
||||
<div class="input-group">
|
||||
<input placeholder="RGB格式颜色" class="form-control" id="apptheme_{rand}" >
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="xuanys" type="button"><i class="icon-search"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td colspan="4"><div class="inputtitle">高级设置</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">debug模式:</td>
|
||||
<td class="tdinput"><select id="debug_{rand}" class="form-control"><option value="0">上线模式</option><option value="1">开发调试模式</option></select></td>
|
||||
|
||||
<td align="right">操作数据库驱动:</td>
|
||||
<td class="tdinput"><select id="db_drive_{rand}" class="form-control"><option value="mysql">mysql(不推荐)</option><option value="mysqli">mysqli</option><option value="pdo">pdo</option></select></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">异步任务key:</td>
|
||||
<td class="tdinput"><input id="asynkey_{rand}" class="form-control"></td>
|
||||
|
||||
<td align="right">对外接口openkey:</td>
|
||||
<td class="tdinput"><input id="openkey_{rand}" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right">提醒消息发送方式:</td>
|
||||
<td class="tdinput"><select id="asynsend_{rand}" class="form-control"><option value="0">同步发送</option><option value="1">异步发送(自己服务端)</option></select>
|
||||
<font color="#888888">提醒消息发送微信消息提示发送,邮件提醒发送等,异步发送能大大提高效率。</font></td>
|
||||
|
||||
<td align="right">是否记录访问sql日志:</td>
|
||||
<td class="tdinput"><select id="sqllog_{rand}" class="form-control"><option value="0">否</option><option value="1">是</option></select><font color="#888888">开启了日志将记录在目录<?=UPDIR?>/sqllog下</font></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">详情上线条颜色:</td>
|
||||
<td class="tdinput"><input id="bcolorxiang_{rand}" placeholder="用于单据详情默认颜色" maxlength="7" class="form-control"></td>
|
||||
|
||||
<td align="right">PC首页显示:</td>
|
||||
<td class="tdinput">REIM:<select id="reim_show_{rand}" ><option value="0">不显示</option><option value="1">显示</option></select> 手机版:<select id="mobile_show_{rand}" ><option value="0">不显示</option><option value="1">显示</option></select></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right">腾讯地图KEY:</td>
|
||||
<td class="tdinput"><input id="qqmapkey_{rand}" placeholder="可不设置,可到https://lbs.qq.com/下申请" class="form-control"></select></td>
|
||||
|
||||
<td align="right">登录方式:</td>
|
||||
<td class="tdinput"><select id="loginyzm_{rand}" class="form-control"><option value="0">仅使用帐号+密码</option><option value="1">帐号+密码/手机+手机验证码</option><option value="2">帐号+密码+手机验证码</option><option value="3">仅使用手机+手机验证码</option></select></td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right">文档在线预览:</td>
|
||||
<td class="tdinput"><select id="officeyl_{rand}" class="form-control"><option value="0">自己服务器安装office转PDF服务</option>
|
||||
<option value="1">使用官网插件(官网VIP专用),不需要安装任何插件。</option>
|
||||
<option value="2">使用微软在线预览office服务(需要公网域名)</option>
|
||||
<option value="4">自己服务器安装LibreOffice转PDF服务(Win和Linux)都可以部署</option>
|
||||
<option value="5">使用在线编辑服务预览(→右边那需要选第二个)</option>
|
||||
</select></td>
|
||||
|
||||
<td align="right">文档在线编辑:</td>
|
||||
<td class="tdinput">
|
||||
<select id="officebj_{rand}" class="form-control"><option value="">安装客户端在线编辑插件</option><option value="1">官网提供在线编辑服务(官网VIP专用)</option></select>
|
||||
<div id="divofficebj_key" style="display:none">在线编辑agentkey,看<a target="_blank" href="<?=URLY?>view_agentkey.html">[帮助]</a>获取<input class="form-control" id="officebj_key_{rand}"></div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">PC后端默认主题:</td>
|
||||
<td class="tdinput"><select id="defstype_{rand}" style="width:80px"></select> 必须去<a href="<?=URLY?>view_themes.html" target="_blank">下载主题包</a>,否则不能使用</td>
|
||||
|
||||
<td align="right">记录用户操作:</td>
|
||||
<td class="tdinput"><select id="useropt_{rand}" class="form-control"><option value="">不记录</option><option value="1">记录到日志里</option></select></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<?php if(!getconfig('platdwnum')){?>
|
||||
<td align="right">多单位模式:</td>
|
||||
<td class="tdinput"><select id="companymode_{rand}" class="form-control"><option value="0">不开启</option><option value="1">开启(各单位分开数据管理)</option></select></td>
|
||||
<?php }?>
|
||||
|
||||
<td align="right">登录修改密码:</td>
|
||||
<td class="tdinput"><select id="editpass_{rand}" class="form-control"><option value="0">不用修改</option><option value="1">强制用户必须修改</option></select></td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right"></td>
|
||||
<td style="padding:15px 0px" colspan="3" align="left"><button click="save" class="btn btn-success" type="button"><i class="icon-save"></i> 保存</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
22
webmain/system/cog/rock_cog_sysinfo.php
Normal file
22
webmain/system/cog/rock_cog_sysinfo.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
js.ajax(js.getajaxurl('sysinfo','{mode}','{dir}'),{},function(a){
|
||||
var s='<table>';
|
||||
for(var f in a.fields){
|
||||
s+='<tr><td align="right"><b>'+a.fields[f]+'</b>: </td><td>'+a.data[f]+'</td></tr>';
|
||||
}
|
||||
s+='</table>';
|
||||
$('#veiw_{rand}').html(s);
|
||||
},'get,json');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<div style="padding:50px; line-height:34px">
|
||||
<div>以下配置信息,请到系统的配置文件下修改(webmain/webmainConfig.php),<a href="?a=phpinfo" target="_blank">查看phpinfo</a></div>
|
||||
<div class="blank1"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
</div>
|
||||
150
webmain/system/dept/deptAction.php
Normal file
150
webmain/system/dept/deptAction.php
Normal file
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
class deptClassAction extends Action
|
||||
{
|
||||
public function defaultAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function dataAjax()
|
||||
{
|
||||
$carr = m('admin')->getcompanyinfo(0,5);
|
||||
$this->allid= $carr['companyallid'];
|
||||
|
||||
$this->rows = array();
|
||||
$this->getdept(0, 1);
|
||||
$errmsg = '';
|
||||
if(ISMORECOM){
|
||||
foreach($this->rows as $k1=>$rs1){
|
||||
if($rs1['companyname']=='' && $rs1['level']==2){
|
||||
$this->rows[$k1]['trbgcolor']='red';
|
||||
$errmsg = '1';
|
||||
}
|
||||
}
|
||||
if($errmsg=='1')$errmsg='红色行必须选择所属单位,请编辑';
|
||||
}
|
||||
echo json_encode(array(
|
||||
'totalCount'=> 0,
|
||||
'rows' => $this->rows,
|
||||
'carr' => $carr,
|
||||
'errmsg' => $errmsg
|
||||
));
|
||||
}
|
||||
|
||||
private function getdept($pid, $oi)
|
||||
{
|
||||
$db = m('dept');
|
||||
$menu = $db->getall("`pid`='$pid' order by `sort`",'*');
|
||||
foreach($menu as $k=>$rs){
|
||||
$comid = $rs['companyid'];
|
||||
|
||||
//开启单位模式只能看到自己单位下的组织结构
|
||||
if(!in_array($comid, $this->allid) && $this->adminid>1 && getconfig('companymode'))continue;
|
||||
|
||||
$companyname = '';
|
||||
if($comid>0 && getconfig('companymode'))$companyname = m('company')->getmou('name', $comid);
|
||||
$rs['companyname'] = $companyname;
|
||||
$sid = $rs['id'];
|
||||
$rs['level'] = $oi;
|
||||
$rs['stotal'] = $db->rows("`pid`='$sid'");
|
||||
$this->rows[] = $rs;
|
||||
|
||||
$this->getdept($sid, $oi+1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function publicbeforesave($table, $cans, $id)
|
||||
{
|
||||
$pid = (int)$cans['pid'];
|
||||
if($pid<=0 && $id != 1)return '上级ID必须大于0';
|
||||
if($pid!=0 && $id == 1)return '顶级禁止修改上级ID';
|
||||
if($pid!=0 && m($table)->rows('id='.$pid.'')==0)return '上级ID不存在';
|
||||
return '';
|
||||
}
|
||||
|
||||
public function publicaftersave($table, $cans, $id)
|
||||
{
|
||||
$name = $cans['name'];
|
||||
$db = m('admin');
|
||||
$db->update("deptname='$name'", "`deptid`=$id");
|
||||
$db->updateinfo("and instr(a.`deptpath`,'[$id]')>0");
|
||||
}
|
||||
|
||||
public function deptuserdataAjax()
|
||||
{
|
||||
$type = $this->request('changetype');
|
||||
$val = $this->request('value');
|
||||
$pid = 0;
|
||||
$rows = $this->getdeptmain($pid, $type, ','.$val.',');
|
||||
echo json_encode($rows);
|
||||
}
|
||||
|
||||
private function getdeptmain($pid, $type, $val)
|
||||
{
|
||||
$sql = $this->stringformat('select `id`,`name` from `?0` where `pid`=?1 order by `sort`', array($this->T('dept'), $pid));
|
||||
$arr = $this->db->getall($sql);
|
||||
$rows = array();
|
||||
foreach($arr as $k=>$rs){
|
||||
$children = $this->getdeptmain($rs['id'], $type, $val);
|
||||
$uchek = $this->contain($type, 'check');
|
||||
$expanded = false;
|
||||
if($this->contain($type, 'user')){
|
||||
$sql = $this->stringformat('select `id`,`name`,`sex`,`ranking`,`deptname` from `?0` where `deptid`=?1 and `status`=1 order by `sort`', array($this->T('admin'), $rs['id']));
|
||||
$usarr = $this->db->getall($sql);
|
||||
foreach($usarr as $k1=>$urs){
|
||||
$usarr[$k1]['leaf'] = true;
|
||||
$usarr[$k1]['uid'] = $urs['id'];
|
||||
$usarr[$k1]['id'] = 'u'.$urs['id'];
|
||||
$usarr[$k1]['type'] = 'u';
|
||||
$usarr[$k1]['icons'] = 'user';
|
||||
if($uchek){
|
||||
$bo = false;
|
||||
if($this->contain($type, 'dept')){
|
||||
$bo = $this->contain($val, $usarr[$k1]['id']);
|
||||
}else{
|
||||
$bo = $this->contain($val, $usarr[$k1]['uid']);
|
||||
}
|
||||
$usarr[$k1]['checked']=$bo;
|
||||
if(!$expanded)$expanded = $bo;
|
||||
}
|
||||
}
|
||||
$children= array_merge($children, $usarr);
|
||||
}
|
||||
if($pid==0)$expanded = true;
|
||||
$ars['children']= $children;
|
||||
$ars['name'] = $rs['name'];
|
||||
$ars['id'] = 'd'.$rs['id'];
|
||||
$ars['did'] = $rs['id'];
|
||||
$ars['type'] = 'd';
|
||||
$ars['expanded'] = $expanded;
|
||||
|
||||
if($this->contain($type, 'dept')){
|
||||
if($uchek){
|
||||
$bo = false;
|
||||
if($this->contain($type, 'user')){
|
||||
$bo = $this->contain($val, $ars['id']);
|
||||
}else{
|
||||
$bo = $this->contain($val, $ars['did']);
|
||||
}
|
||||
$ars['checked']=$bo;
|
||||
}
|
||||
}
|
||||
$rows[] = $ars;
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public function deptuserjsonAjax()
|
||||
{
|
||||
$udarr = m('dept')->getdeptuserdata(1);
|
||||
$userarr = $udarr['uarr'];
|
||||
$deptarr = $udarr['darr'];
|
||||
$grouparr = $udarr['garr'];
|
||||
|
||||
$arr['deptjson'] = json_encode($deptarr);
|
||||
$arr['userjson'] = json_encode($userarr);
|
||||
$arr['groupjson'] = json_encode($grouparr);
|
||||
$this->showreturn($arr);
|
||||
}
|
||||
}
|
||||
130
webmain/system/dept/rock_dept.php
Normal file
130
webmain/system/dept/rock_dept.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var companyinfoall=[];
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'dept',modenum:'dept',celleditor:true,
|
||||
url:js.getajaxurl('data','dept','system'),tree:true,
|
||||
columns:[{
|
||||
text:'名称',dataIndex:'name',align:'left'
|
||||
},{
|
||||
text:'所属单位',dataIndex:'companyname'
|
||||
},{
|
||||
text:'编号',dataIndex:'num',editor:adminid==1
|
||||
},{
|
||||
text:'负责人',dataIndex:'headman'
|
||||
},{
|
||||
text:'上级ID',dataIndex:'pid'
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort',editor:true
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
}],
|
||||
itemclick:function(d){
|
||||
var bo = false;
|
||||
if(companymode && adminid>1 && d.level==2 && d.companyid=='0')bo=true;
|
||||
btn(bo,d);
|
||||
},
|
||||
load:function(d1){
|
||||
companyinfoall=d1.carr.companyinfoall;
|
||||
if(d1.errmsg)js.alert(d1.errmsg);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true, {});
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del();
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var d1 = a.changedata,level,les='';
|
||||
if(lx==0){
|
||||
level = d1.level+1;
|
||||
}else{
|
||||
level = d1.level;
|
||||
}
|
||||
|
||||
var items = [{
|
||||
labelText:'名称',name:'name',required:true
|
||||
},{
|
||||
labelText:'编号',name:'num'
|
||||
},{
|
||||
name:'headid',type:'hidden'
|
||||
},{
|
||||
labelText:'负责人',type:'changeuser',changeuser:{
|
||||
type:'usercheck',idname:'headid',title:'选择部门负责人'
|
||||
},name:'headman',clearbool:true
|
||||
},{
|
||||
labelText:'上级ID',name:'pid',value:0,type:'number'
|
||||
},{
|
||||
labelText:'序号',name:'sort',type:'number',value:'0'
|
||||
}];
|
||||
if(level==2){
|
||||
var store = [];
|
||||
if(adminid==1)store.push({'id':'0','name':'全部单位'});
|
||||
for(var i=0;i<companyinfoall.length;i++)store.push(companyinfoall[i]);
|
||||
items.push({
|
||||
labelText:'所属单位',name:'companyid',type:'select',value:'0',valuefields:'id',displayfields:'name',store:store
|
||||
});
|
||||
les=',companyid';
|
||||
}
|
||||
var h = $.bootsform({
|
||||
title:'组织结构',height:400,width:400,
|
||||
tablename:'dept',isedit:lx,
|
||||
url:js.getajaxurl('publicsave','dept','system'),
|
||||
params:{int_filestype:'sort'},
|
||||
submitfields:'name,sort,headman,headid,pid,num'+les+'',
|
||||
items:items,
|
||||
success:function(){
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
if(lx==1){
|
||||
h.setValues(a.changedata);
|
||||
}
|
||||
h.getField('name').focus();
|
||||
return h;
|
||||
},
|
||||
clickdown:function(){
|
||||
if(a.changeid==0)return;
|
||||
var a1 = this.clickwin(false,0);
|
||||
a1.setValue('pid', a.changeid);
|
||||
},
|
||||
relad:function(){
|
||||
a.reload();
|
||||
}
|
||||
};
|
||||
|
||||
function btn(bo,d){
|
||||
if(!bo && companymode && d.id==1 && adminid>1)bo=true;//非超级管理员不能修改顶级名称
|
||||
get('edit_{rand}').disabled = bo;
|
||||
get('down_{rand}').disabled = bo;
|
||||
if(d.id==1)bo=true;
|
||||
get('del_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<ul class="floats">
|
||||
<li class="floats50">
|
||||
<!--<button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button> -->
|
||||
<button class="btn btn-success" click="clickdown" id="down_{rand}" disabled type="button"><i class="icon-plus"></i> 新增下级</button>
|
||||
</li>
|
||||
<li class="floats50" style="text-align:right">
|
||||
<button class="btn btn-default" click="relad" type="button">刷新</button>
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
<div class="tishi">1、组织结构必须只能有一个最顶级的,ID必须为1,且不允许删除,不要问为什么,我们也不知道为什么。<br>
|
||||
2、多单位模式下只能管理自己所属单位的组织机构。<br>
|
||||
3、只有2级部门才有所属单位可选。</div>
|
||||
347
webmain/system/dept/tpl_dept.html
Normal file
347
webmain/system/dept/tpl_dept.html
Normal file
@@ -0,0 +1,347 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>选择人员</title>
|
||||
<link rel="stylesheet" type="text/css" href="<?=$da['p']?>/css/css.css"/>
|
||||
<script type="text/javascript" src="js/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/js.js"></script>
|
||||
<script type="text/javascript">
|
||||
function initbody(){
|
||||
c.init();
|
||||
}
|
||||
companymode = <?=(getconfig('companymode')? 'true' : 'false')?>;
|
||||
uidid = <?=$da['adminid']?>;
|
||||
var c = {
|
||||
maxshow:300,
|
||||
grouparr:[],
|
||||
userarr:[],
|
||||
deptarr:[],
|
||||
firstpid:0,
|
||||
init:function(){
|
||||
this.changevalue = js.request('changevalue');//默认值
|
||||
this.changerange = js.request('changerange');
|
||||
var us = js.getoption('userjson');
|
||||
if(us)this.userarr = js.decode(us);
|
||||
|
||||
us = js.getoption('groupjson');
|
||||
if(us)this.grouparr = js.decode(us);
|
||||
|
||||
us = js.getoption('deptjson');
|
||||
if(us)this.deptarr = js.decode(us);
|
||||
|
||||
|
||||
if(!us || this.changerange!=''){
|
||||
this.loaddata(true);
|
||||
}else{
|
||||
this.firstpid = this.deptarr[0].pid;
|
||||
this.showlist(this.firstpid,0);
|
||||
this.initxuan();
|
||||
}
|
||||
this.resets();
|
||||
$(window).resize(this.resets);
|
||||
|
||||
$('#keywords').keydown(function(e){
|
||||
c._searchkeys(e)
|
||||
});
|
||||
$('#keywords').keyup(function(e){
|
||||
c._searchkeys(e)
|
||||
});
|
||||
},
|
||||
resets:function(lx){
|
||||
var he = winHb()-80;
|
||||
$('#zxuandiv').css('height',''+he+'px');
|
||||
$('#xuandiv').css('height',''+he+'px');
|
||||
$('#showtype').css('height',''+he+'px');
|
||||
},
|
||||
loaddata:function(iscs){
|
||||
var url = js.getajaxurl('deptuserjson','dept','system',{'changerange':this.changerange});
|
||||
$('#showdiv_0').html('<div align="center" style="margin-top:30px"><img src="images/mloading.gif"></div>')
|
||||
$.get(url,function(ret){
|
||||
var d = js.decode(ret);
|
||||
ret = d.data;
|
||||
if(c.changerange==''){
|
||||
js.setoption('deptjson', ret.deptjson);
|
||||
js.setoption('userjson', ret.userjson);
|
||||
js.setoption('groupjson', ret.groupjson);
|
||||
}
|
||||
|
||||
c.userarr = js.decode(ret.userjson);
|
||||
c.deptarr = js.decode(ret.deptjson);
|
||||
c.grouparr = js.decode(ret.groupjson);
|
||||
c.firstpid = 0;
|
||||
if(c.deptarr[0])c.firstpid=c.deptarr[0].pid;
|
||||
c.showlist(c.firstpid,0);
|
||||
if(iscs)c.initxuan();
|
||||
});
|
||||
},
|
||||
showlist:function(pid,oi){
|
||||
var a=this.deptarr,len=a.length,i,s='',ssu='',wjj,s2='',hw=24;
|
||||
var s1='<div style="width:'+(hw*oi)+'px"></div>';
|
||||
this.fid = 1;
|
||||
for(i=0;i<len;i++){
|
||||
if(a[i].pid==pid){
|
||||
if(this.fid==1)this.fid = a[i].id;
|
||||
wjj= 'images/files.png';
|
||||
if(a[i].ntotal=='0')wjj= 'images/file.png';
|
||||
s+='<div id="showssd'+a[i].id+'" class="listss">';
|
||||
s+='<table width="100%"><tr><td height="36">'+s1+'</td><td><img deptxu="'+i+'_'+oi+'" align="absmiddle" height="20" height="20" src="'+wjj+'"></td><td onclick="c.deptstr('+a[i].id+','+i+', \'showssd'+a[i].id+'\')" width="100%">'+a[i].name+'</td></tr></table>';
|
||||
s+='</div>';
|
||||
s+='<span show="false" id="showdiv_'+a[i].id+'"></span>';
|
||||
}
|
||||
}
|
||||
var xud = (oi==0)?'0' : pid;
|
||||
$('#showdiv_'+xud+'').html(s).attr('show','true');
|
||||
if(oi==0){
|
||||
this.showlist(this.fid, 1);
|
||||
this.showgroup();
|
||||
}
|
||||
|
||||
$('#showdiv_0 [deptxu]').unbind('click').click(function(){
|
||||
c._deptclicks(this);
|
||||
});
|
||||
},
|
||||
showgroup:function(){
|
||||
var a = this.grouparr,len=a.length,i,s='';
|
||||
for(i=0;i<len;i++){
|
||||
s+='<div onclick="c.groupstr('+a[i].id+','+i+', this.id)" id="showssg'+a[i].id+'" class="listsss">';
|
||||
s+=''+a[i].name+'';
|
||||
s+='</div>';
|
||||
}
|
||||
$('#groupshow').html(s);
|
||||
},
|
||||
_deptclicks:function(o){
|
||||
var sxu = $(o).attr('deptxu').split('_');
|
||||
var a = this.deptarr[sxu[0]];
|
||||
var o1 = $('#showdiv_'+a.id+'');
|
||||
var lx = o1.attr('show');
|
||||
if(lx=='false'){
|
||||
this.showlist(a.id, parseFloat(sxu[1])+1);
|
||||
}else{
|
||||
o1.toggle();
|
||||
}
|
||||
},
|
||||
initxuan:function(){
|
||||
var val = this.changevalue;
|
||||
if(!val)return;
|
||||
var vals = ','+val+',';
|
||||
var a = this.deptarr,i,len=a.length,d,s='';
|
||||
for(i=0;i<len;i++){
|
||||
d = a[i];
|
||||
if(vals.indexOf(',d'+d.id+',')>-1){
|
||||
this.xuan('d',i);
|
||||
}
|
||||
}
|
||||
|
||||
a = this.userarr;len=a.length;
|
||||
for(i=0;i<len;i++){
|
||||
d = a[i];
|
||||
if(vals.indexOf(',u'+d.id+',')>-1){
|
||||
this.xuan('u',i);
|
||||
}
|
||||
}
|
||||
|
||||
a = this.grouparr;len=a.length;
|
||||
for(i=0;i<len;i++){
|
||||
d = a[i];
|
||||
if(vals.indexOf(',g'+d.id+',')>-1){
|
||||
this.xuan('g',i);
|
||||
}
|
||||
}
|
||||
},
|
||||
chcangdi:function(ids){
|
||||
$('#'+ids+'').addClass('tract');
|
||||
if(this.changeids)$('#'+this.changeids+'').removeClass('tract');
|
||||
this.changeids = ids;
|
||||
},
|
||||
deptstr:function(did,oi, ids){
|
||||
this.chcangdi(ids);
|
||||
var d = this.deptarr[oi];
|
||||
var s = '<div onclick="c.xuan(\'d\','+oi+',this)" class="listsss">['+d.id+'.部门]'+d.name+'</div>';
|
||||
var a=this.userarr,len=a.length,i,oi=0;
|
||||
for(i=0;i<len;i++){
|
||||
if(a[i].deptpath && a[i].deptpath.indexOf('['+did+']')>-1){
|
||||
oi++;
|
||||
if(oi>this.maxshow)break;
|
||||
|
||||
s+='<div temuoi="'+i+'" onclick="c.xuan(\'u\','+i+',this)" class="listsss"><img src="'+a[i].face+'" height="24" width="24" align="absmiddle"> '+a[i].name+'<span style="font-size:12px;color:#888888">('+a[i].ranking+')</span></div>';
|
||||
}
|
||||
}
|
||||
$('#showtype').html(s);
|
||||
},
|
||||
groupstr:function(did,oi,ids){
|
||||
this.chcangdi(ids);
|
||||
var d = this.grouparr[oi];
|
||||
var s = '<div onclick="c.xuan(\'g\','+oi+',this)" class="listsss">['+d.id+'.组]'+d.name+'</div>';
|
||||
var a=this.userarr,len=a.length,i,oi=0,gids;
|
||||
for(i=0;i<len;i++){
|
||||
gids = a[i].groupname;
|
||||
if(isempt(gids))continue;
|
||||
gids = ','+gids+',';
|
||||
if(gids.indexOf(','+did+',')>-1){
|
||||
oi++;
|
||||
s+='<div temuoi="'+i+'" onclick="c.xuan(\'u\','+i+',this)" class="listsss"><img src="'+a[i].face+'" height="24" width="24" align="absmiddle"> '+a[i].name+'<span style="font-size:12px;color:#888888">('+a[i].ranking+')</span></div>';
|
||||
}
|
||||
}
|
||||
$('#showtype').html(s);
|
||||
},
|
||||
quanx:function(){
|
||||
$('#showtype div[temuoi]').each(function(){
|
||||
var o1 = $(this);
|
||||
c.xuan('u', parseFloat(o1.attr('temuoi')), this);
|
||||
});
|
||||
},
|
||||
xuan:function(lx,oi,o1){
|
||||
var d = false,s='',id='',s1;
|
||||
if(lx=='d'){
|
||||
d = this.deptarr[oi];
|
||||
id= d.id;
|
||||
s1='['+d.id+'.部门]';
|
||||
if(id==1)s1='<span class="label">全员</span>';
|
||||
s='<div id="d_'+d.id+'" onclick="$(this).remove()" class="listsss">'+s1+'<font>'+d.name+'</font></div>';
|
||||
if(companymode && id==1 && uidid>1){
|
||||
s='';
|
||||
js.msg('msg','多单位模式下不能选择最高的顶级部门');
|
||||
}
|
||||
if(this.changerange && id==1){
|
||||
s='';
|
||||
js.msg('msg','不能选最顶级部门');
|
||||
}
|
||||
}
|
||||
if(lx=='g'){
|
||||
d = this.grouparr[oi];
|
||||
id= d.id;
|
||||
s1='['+d.id+'.组]';
|
||||
s='<div id="g_'+d.id+'" onclick="$(this).remove()" class="listsss">'+s1+'<font>'+d.name+'</font></div>';
|
||||
}
|
||||
if(lx=='u'){
|
||||
d = this.userarr[oi];
|
||||
id= d.id;
|
||||
s='<div id="u_'+d.id+'" onclick="$(this).remove()" class="listsss"><img src="'+d.face+'" height="24" width="24" align="absmiddle"> <font>'+d.name+'</font><span style="font-size:12px;color:#888888">('+d.ranking+')</span></div>';
|
||||
}
|
||||
if(!d)return;
|
||||
var sid = ''+lx+'_'+id+'';
|
||||
if(sid!='d_1' && get('d_1')){
|
||||
js.msg('msg','已经选了最顶级部门,已包含全体人员了');
|
||||
return;
|
||||
}
|
||||
if(get(sid))return;
|
||||
$('#'+lx+'_'+id+'').remove();
|
||||
$('#xuandiv').append(s);
|
||||
},
|
||||
queding:function(){
|
||||
var sid='',sna='';
|
||||
$('#xuandiv').find('div').each(function(){
|
||||
var id = this.id.replace('_','');
|
||||
sid+=','+id+'';
|
||||
sna+=','+$(this).find('font').text();
|
||||
});
|
||||
if(sid!=''){
|
||||
sid = sid.substr(1);
|
||||
sna = sna.substr(1);
|
||||
}
|
||||
var call = js.request('callback');
|
||||
if(call){
|
||||
try{parent[call](sna,sid);}catch(e){}
|
||||
}else{
|
||||
console.log(sna+'|'+sid);
|
||||
}
|
||||
},
|
||||
cancel:function(){
|
||||
try{
|
||||
parent.js.tanclose('changeaction');
|
||||
}catch(e){}
|
||||
},
|
||||
|
||||
_searchkeys:function(e){
|
||||
clearTimeout(this._searchkeystime);
|
||||
this._searchkeystime=setTimeout(function(){
|
||||
c._searchkey(false);
|
||||
},500);
|
||||
},
|
||||
_searchkey:function(bo){
|
||||
var key = $('#keywords').val(),a=[],d=[],len,i,oi=0,s='';
|
||||
a=this.userarr;
|
||||
if(bo && key=='')return;
|
||||
len=a.length;
|
||||
if(key!='')for(i=0;i<len;i++)if(a[i].name.indexOf(key)>-1 || a[i].pingyin.indexOf(key)==0 || a[i].deptname.indexOf(key)>-1 || a[i].ranking.indexOf(key)>-1){
|
||||
s+='<div onclick="c.xuan(\'u\','+i+',this)" class="listsss"><img src="'+a[i].face+'" height="24" width="24" align="absmiddle"> '+a[i].name+'<span style="font-size:12px;color:#888888">('+a[i].ranking+')</span></div>';
|
||||
}
|
||||
if(bo && s=='' && key!='')js.msg('msg','无相关['+key+']的记录', 2);
|
||||
$('#showtype').html(s);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
*{font-size:14px}
|
||||
.headers{line-height:30px; background-color:#dddddd;color:#1389D3;font-size:14px;height:30px;overflow:hidden}
|
||||
.lists{line-height:34px; background-color:white;font-size:14px;padding-left:5px;border-bottom:1px #eeeeee solid;color:#888888;height:34px;overflow:hidden}
|
||||
.active{ background-color:#eeeeee;color:#000000;font-weight:bold}
|
||||
|
||||
.listsss{padding:8px; background:white;border-bottom:1px #eeeeee solid;cursor:default;font-size:14px}
|
||||
.listsss:hover{background-color:#f1f1f1}
|
||||
|
||||
.listss{background:white;border-bottom:1px #eeeeee solid;cursor:default;font-size:14px;padding:0px 5px}
|
||||
.listss:hover{background-color:#f1f1f1}
|
||||
|
||||
.listhui{color:#888888}
|
||||
.listhui img{opacity:0.5}
|
||||
|
||||
.changeuserbotton{height:30px;width:50px; background:#d9534f;color:white;font-size:14px;border:none;padding:0px;margin:0px;line-height:20px;cursor:pointer;opacity:1;outline:none;border-radius:5px}
|
||||
.changeuserbotton:hover{color:white;border:none;opacity:0.8}
|
||||
.label{font-size:12px;background:#1389D3;color:white;padding:1px 3px;border-radius:5px}
|
||||
.tract{ background-color:#d6edf9;}
|
||||
.tract:hover{background-color:#d6edf9;}
|
||||
</style>
|
||||
</head>
|
||||
<body style="padding:0px;margin:0px; overflow:hidden;" scroll="no">
|
||||
<table height="100%" width="100%">
|
||||
<tr>
|
||||
<td valign="top" width="35%" style="border:1px #eeeeee solid">
|
||||
<div class="headers"> 选择部门/组</div>
|
||||
<div style="height:300px;overflow:auto" id="zxuandiv">
|
||||
<div class="lists active">根据部门选择 v</div>
|
||||
<div id="showdiv_0"></div>
|
||||
<div class="lists">根据组选择 v</div>
|
||||
<div id="groupshow"></div>
|
||||
</div>
|
||||
</td>
|
||||
<td valign="top" width="30%" style="border:1px #eeeeee solid">
|
||||
<div class="headers"> 选择人员</div>
|
||||
<div style="height:300px;overflow:auto" id="showtype"></div>
|
||||
</td>
|
||||
<td style="padding:5px;width:10px" valign="center">
|
||||
|
||||
<div><input type="button" onclick="c.quanx()" value="全选"></div>
|
||||
<div style="height:20px"></div>
|
||||
<div><input type="button" onclick="$('#xuandiv').html('')" value="清空"></div>
|
||||
|
||||
</td>
|
||||
<td valign="top" width="35%" style="border:1px #eeeeee solid">
|
||||
<div class="headers"> √已选择</div>
|
||||
<div style="height:300px;overflow:auto" id="xuandiv"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color:#dddddd" colspan="5">
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td height="50" width="10" nowrap> </td>
|
||||
<td width="100%">
|
||||
<input type="text" id="keywords" style="border:1px #cccccc solid;height:26px;padding:2px;width:180px" placeholder="关键词搜索人员"><input onclick="c._searchkey(true)" type="button" value="搜索" style="background:#888888" class="changeuserbotton">
|
||||
</td>
|
||||
<td><input style="width:70px;border:none" type="button" onclick="c.loaddata()" class="changeuserbotton" value="刷新数据" ></td>
|
||||
<td width="20" nowrap> </td>
|
||||
<td><input class="changeuserbotton" type="button" onclick="c.cancel()" value="取消" ></td>
|
||||
<td width="20" nowrap> </td>
|
||||
<td height="50"><input style="background:#1389D3;" onclick="c.queding()" type="button" value="确定" class="changeuserbotton"></td>
|
||||
<td width="10" nowrap> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
178
webmain/system/email/emailAction.php
Normal file
178
webmain/system/email/emailAction.php
Normal file
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
class emailClassAction extends Action
|
||||
{
|
||||
public function setsaveAjax()
|
||||
{
|
||||
$this->option->setval('email_sendhost@-1', $this->post('sendhost'));
|
||||
$this->option->setval('email_sendport@-1', $this->post('sendport'));
|
||||
$this->option->setval('email_recehost@-1', $this->post('recehost'));
|
||||
$this->option->setval('email_sendsecure@-1', $this->post('sendsecure'));
|
||||
$this->option->setval('email_sysname@-1', $this->post('sysname'));
|
||||
$this->option->setval('email_sysuser@-1', $this->post('sysuser'));
|
||||
$this->option->setval('email_receyumi@-1', $this->post('receyumi'));
|
||||
$syspass = $this->post('syspass');
|
||||
if(!isempt($syspass)){
|
||||
$this->option->setval('email_syspass@-1', $this->jm->encrypt($syspass));
|
||||
}
|
||||
$this->backmsg();
|
||||
}
|
||||
|
||||
public function getsetAjax()
|
||||
{
|
||||
$arr= array();
|
||||
$arr['sendhost'] = $this->option->getval('email_sendhost');
|
||||
$arr['sendport'] = $this->option->getval('email_sendport');
|
||||
$arr['recehost'] = $this->option->getval('email_recehost');
|
||||
$arr['sendsecure'] = $this->option->getval('email_sendsecure');
|
||||
$arr['sysname'] = $this->option->getval('email_sysname');
|
||||
$arr['sysuser'] = $this->option->getval('email_sysuser');
|
||||
$arr['receyumi'] = $this->option->getval('email_receyumi');
|
||||
echo json_encode($arr);
|
||||
}
|
||||
|
||||
public function savebeforecog($table, $cans)
|
||||
{
|
||||
$emailpass = $this->post('emailpass');
|
||||
if(!isempt($emailpass)){
|
||||
$cans['emailpass'] = $this->jm->encrypt($emailpass);
|
||||
}
|
||||
return array(
|
||||
'rows' => $cans
|
||||
);
|
||||
}
|
||||
|
||||
public function coguserbeforeshow($table)
|
||||
{
|
||||
$fields = '`id`,`name`,`user`,`deptallname`,`status`,`ranking`,`email`,`sort`,`face`,`emailpass`';
|
||||
$s = '';
|
||||
$key = $this->post('key');
|
||||
if($key!=''){
|
||||
$s = m('admin')->getkeywhere($key);
|
||||
}
|
||||
return array(
|
||||
'fields'=> $fields,
|
||||
'where' => $s,
|
||||
'order' => '`sort`'
|
||||
);
|
||||
}
|
||||
public function coguseraftershow($table, $rows)
|
||||
{
|
||||
foreach($rows as $k=>$rs){
|
||||
if(!isempt($rs['emailpass']))$rows[$k]['emailpass']='******';
|
||||
}
|
||||
return array(
|
||||
'rows' => $rows
|
||||
);
|
||||
}
|
||||
|
||||
public function testsendAjax()
|
||||
{
|
||||
$msg = m('email')->sendmail_test();
|
||||
echo $msg;
|
||||
}
|
||||
|
||||
public function emailtotals($table, $rows)
|
||||
{
|
||||
$emrs = m('admin')->getone($this->adminid, 'email');
|
||||
$istxemail = $this->option->getval('txemail_corpid') ? 1 : 0;
|
||||
return array(
|
||||
'rows' => $rows,
|
||||
'email'=> $emrs,
|
||||
'istxemail'=> $istxemail,
|
||||
'total'=> m('emailm')->zongtotal($this->adminid)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//收信
|
||||
public function recemailAjax()
|
||||
{
|
||||
$barr = m('emailm')->receemail($this->adminid);
|
||||
if(is_array($barr)){
|
||||
$this->showreturn($barr['count']);
|
||||
}else{
|
||||
$this->showreturn('', $barr, 201);
|
||||
}
|
||||
}
|
||||
|
||||
//标已读
|
||||
public function biaoydAjax()
|
||||
{
|
||||
$sid = c('check')->onlynumber($this->post('sid'));
|
||||
m('emailm')->biaoyd($this->adminid, $sid);
|
||||
echo '成功标识';
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除邮件
|
||||
*/
|
||||
public function delyjAjax()
|
||||
{
|
||||
$sid = c('check')->onlynumber($this->post('sid'));
|
||||
$atype = $this->post('atype');
|
||||
$uid = $this->adminid;
|
||||
//收件箱删除
|
||||
if($atype==''){
|
||||
m('emails')->update('isdel=1','`uid`='.$uid.' and `mid` in('.$sid.') and `type` in(0,1)');
|
||||
}
|
||||
//草稿箱删除
|
||||
if($atype=='cgx'){
|
||||
m('emailm')->delete('`id` in('.$sid.') and `sendid`='.$uid.' and `isturn`=0');
|
||||
}
|
||||
//已发送删除
|
||||
if($atype=='yfs'){
|
||||
m('emails')->update('isdel=1','`uid`='.$uid.' and `mid` in('.$sid.') and `type`=2');
|
||||
}
|
||||
//已删除删除
|
||||
if($atype=='ysc'){
|
||||
m('emails')->delete('`uid`='.$uid.' and `mid` in('.$sid.') and `isdel`=1 and `type` in(0,1)');
|
||||
}
|
||||
echo '删除成功';
|
||||
}
|
||||
|
||||
//用户修改自己邮箱密码
|
||||
public function saveemaipassAjax()
|
||||
{
|
||||
$pass = $this->post('emailpass');
|
||||
if(getconfig('systype')!='demo')m('admin')->update("`emailpass`='$pass'", '`id`='.$this->adminid.'');
|
||||
$this->backmsg('','修改成功');
|
||||
}
|
||||
|
||||
|
||||
//设置自动接收邮件
|
||||
public function helpsetAction()
|
||||
{
|
||||
$this->display = false;
|
||||
$ljth = str_replace('/','\\',ROOT_PATH);
|
||||
echo '<title>自动接收邮件设置</title>';
|
||||
echo '<br>';
|
||||
|
||||
echo '<font color="red">自动接收邮件必须使用服务器的计划任务你参考以下设置。</font><br><a target="_blank" style="color:blue" href="'.URLY.'view_email.html">查看官网上帮助</a><br>';
|
||||
|
||||
echo '一、<b>Windows服务器</b>,可根据以下设置定时任务<br>';
|
||||
$str1 = '@echo off
|
||||
cd '.$ljth.'
|
||||
'.getconfig('phppath','php').' '.$ljth.'\task.php email';
|
||||
$this->rock->createtxt(''.UPDIR.'/cli/xinhuemailrun.bat', $str1);
|
||||
|
||||
echo '1、打开系统配置文件webmainConfig.php加上一个配置phppath设置php环境的目录地址如:F:\php\php-5.6.22\php.exe,设置好了,刷新本页面。<br>';
|
||||
echo '<div style="background:#caeccb;padding:5px;border:1px #888888 solid;border-radius:5px;">';
|
||||
echo "return array(<br>'title' =>'信呼OA',<br>'phppath' => 'F:\php\php-5.6.22\php.exe' <font color=#aaaaaa>//加上这个你php.exe的路径</font><br>)";
|
||||
echo '</div>';
|
||||
echo '2、在您的win服务器上,开始菜单→运行 输入 cmd 回车(管理员身份运行),输入以下命令(每30分钟运行一次):<br>';
|
||||
echo '<div style="background:#caeccb;padding:5px;border:1px #888888 solid;border-radius:5px;">';
|
||||
echo 'schtasks /create /sc DAILY /mo 1 /du "24:00" /ri 30 /sd "2018/03/01" /st "00:00:05" /tn "信呼自动接收邮件" /ru System /tr '.$ljth.'\\'.UPDIR.'\cli\xinhuemailrun.bat';
|
||||
echo '</div>';
|
||||
|
||||
|
||||
$str1 = 'cd '.ROOT_PATH.''.chr(10).'php '.ROOT_PATH.'/task.php email';
|
||||
$spath= ''.UPDIR.'/cli/xinhuemailrun.sh';
|
||||
$this->rock->createtxt($spath, $str1);
|
||||
echo '<br>二、<b>Linux服务器</b>,可用根据以下设置定时任务<br>';
|
||||
echo '根据以下命令设置运行:<br>';
|
||||
echo '<div style="background:#caeccb;padding:5px;border:1px #888888 solid;border-radius:5px;"><font color=blue>chmod</font> 777 '.ROOT_PATH.'/'.$spath.'<br>';
|
||||
echo '<font color=blue>crontab</font> -e<br>';
|
||||
echo '#信呼自动接收邮件每30分钟运行一次<br>';
|
||||
echo '*/30 * * * * '.ROOT_PATH.'/'.$spath.'</div>';
|
||||
}
|
||||
}
|
||||
230
webmain/system/email/rock_email.php
Normal file
230
webmain/system/email/rock_email.php
Normal file
@@ -0,0 +1,230 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var atype = '',nowemail='';
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'emailm',modenum:'emailm',checked:true,modedir:'{mode}:{dir}',storeafteraction:'emailtotals',fanye:true,
|
||||
columns:[{
|
||||
text:'',dataIndex:'abclx',align:'center',width:34,renderer:function(v,d){
|
||||
var s = '';
|
||||
if(d.ishui=='1'){
|
||||
s='<img title="已回复" src="mode/icons/email_go.png">';
|
||||
}else{
|
||||
s='<img src="mode/icons/email.png">'
|
||||
}
|
||||
return s;
|
||||
}
|
||||
},{
|
||||
text:'主题',dataIndex:'title',align:'left',renderer:function(v,d){
|
||||
var s = v;
|
||||
if(d.isfile=='1')s+=' <img title="有附件" src="mode/icons/attach.png">';
|
||||
if(d.type=='1' && atype=='yfs'){
|
||||
s+=' <img src="images/jian1.gif" title="外发邮件">';
|
||||
if(d.outzt=='2')s+=' <img src="images/error.png" onclick="refa{rand}('+d.id+')" title="外发失败">';
|
||||
if(d.outzt=='0')s+=' <img src="images/loadings.gif" onclick="refa{rand}('+d.id+')" title="待外发">';
|
||||
}
|
||||
return s;
|
||||
}
|
||||
},{
|
||||
text:'发件人',dataIndex:'sendname',renderer:function(v){
|
||||
return '<div style="max-width:250px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap" class="wrap">'+v+'</div>';
|
||||
}
|
||||
},{
|
||||
text:'收件人',dataIndex:'recename',renderer:function(v){
|
||||
return '<div style="max-width:250px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap" class="wrap">'+v+'</div>';
|
||||
}
|
||||
},{
|
||||
text:'发件时间',dataIndex:'senddt',sortable:true
|
||||
},{
|
||||
text:'',dataIndex:'opt',renderer:function(v,d,oi){
|
||||
var s = '<a href="javascript:;" onclick="openxiangs(\'邮件\',\'emailm\','+d.id+')">查看</a>';
|
||||
if(atype=='cgx')s+=' <a href="javascript:;" onclick="openinput(\'写邮件\',\'emailm\','+d.id+')">编辑</a>';
|
||||
return s;
|
||||
}
|
||||
}],
|
||||
rendertr:function(d){
|
||||
var s = '';
|
||||
if(d.zt=='0' && atype=='')s='style="font-weight:bold"';
|
||||
return s;
|
||||
},
|
||||
load:function(d){
|
||||
nowemail=d.email
|
||||
c.showtotal(d.total);
|
||||
if(d.istxemail==1)$('#txemail{rand}').show();
|
||||
},
|
||||
itemdblclick:function(d){
|
||||
openxiangs('邮件','emailm',d.id);
|
||||
}
|
||||
});
|
||||
function btn(bo){
|
||||
get('btn1_{rand}').disabled=bo;
|
||||
}
|
||||
var c = {
|
||||
change:function(o1,lx){
|
||||
var ars = ['','cgx','yfs','ysc'];
|
||||
atype = ars[lx];
|
||||
btn(atype!='');
|
||||
a.setparams({atype:ars[lx]}, true);
|
||||
},
|
||||
search:function(){
|
||||
var d={
|
||||
dt:get('dt2_{rand}').value,
|
||||
key:get('key_{rand}').value
|
||||
}
|
||||
a.setparams(d, true);
|
||||
},
|
||||
showtotal:function(d){
|
||||
var s1 = d.wd;
|
||||
if(d.wd>0)s1='<font color=red>'+d.wd+'</font>';
|
||||
$('#zztotal_{rand}').html('('+d.zz+'/'+s1+')');
|
||||
$('#cgtotal_{rand}').html('('+d.cgx+')');
|
||||
$('#yftotal_{rand}').html('('+d.yfs+')');
|
||||
$('#sctotal_{rand}').html('('+d.ysc+')');
|
||||
},
|
||||
recemail:function(){
|
||||
js.wait('收信中,不要关闭窗口...');
|
||||
js.ajax(js.getajaxurl('recemail', '{mode}', '{dir}'),false,function(d){
|
||||
if(d.success){
|
||||
js.tanclose('confirm');
|
||||
js.msg('success','共收取'+d.data+'封信');
|
||||
a.reload();
|
||||
}else{
|
||||
setTimeout(function(){
|
||||
js.tanclose('confirm');
|
||||
js.msg('msg',d.msg);
|
||||
},1000);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
getsid:function(){
|
||||
var sid = a.getchecked();
|
||||
if(sid==''){js.msg('msg','没选中行');return false;}
|
||||
return sid;
|
||||
},
|
||||
biaoyd:function(){
|
||||
var sid = this.getsid();
|
||||
if(!sid)return;
|
||||
js.ajax(js.getajaxurl('biaoyd','{mode}','{dir}'),{sid:sid},function(s){
|
||||
js.msg('success', s);
|
||||
a.reload();
|
||||
},'post',false,'标识中...');
|
||||
},
|
||||
delyj:function(){
|
||||
var sid = this.getsid();
|
||||
if(!sid)return;
|
||||
js.confirm('确定要删除选中的行记录吗?',function(jg){
|
||||
if(jg=='yes')c.delyjs();
|
||||
});
|
||||
},
|
||||
delyjs:function(){
|
||||
var sid = this.getsid();
|
||||
if(!sid)return;
|
||||
js.ajax(js.getajaxurl('delyj','{mode}','{dir}'),{sid:sid,atype:atype},function(s){
|
||||
js.msg('success', s);
|
||||
a.reload();
|
||||
},'post',false,'删除中...');
|
||||
},
|
||||
cogemail:function(){
|
||||
if(nowemail.email==null)nowemail.email='';
|
||||
if(nowemail.emailpass==null)nowemail.emailpass='';
|
||||
var h = $.bootsform({
|
||||
title:'邮箱设置',height:400,width:400,
|
||||
tablename:'admin',isedit:1,
|
||||
url:js.getajaxurl('saveemaipass','{mode}','{dir}'),
|
||||
submitfields:'email,sort',
|
||||
items:[{
|
||||
labelText:'我邮箱',name:'email',value:nowemail.email,readOnly:true,required:true
|
||||
},{
|
||||
labelText:'我邮箱密码',name:'emailpass',value:nowemail.emailpass,required:true
|
||||
}],
|
||||
success:function(){
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
h.isValid();
|
||||
},
|
||||
clickset:function(){
|
||||
js.open('?a=helpset&m=email&d=system');
|
||||
},
|
||||
refa:function(sid,bo){
|
||||
if(bo){
|
||||
js.loading('请求中...');
|
||||
js.ajax(publicmodeurl('emailm','reoutfa'),{sid:sid},function(s){
|
||||
js.msgok(s);
|
||||
a.reload();
|
||||
});
|
||||
}else{
|
||||
js.confirm('确定要重新发送吗?',function(jg){if(jg=='yes')c.refa(sid,true)});
|
||||
}
|
||||
},
|
||||
gototxemail:function(){
|
||||
window.open('?d=system&m=weixinqy&a=gototxemail');
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
refa{rand}=function(sid){
|
||||
c.refa(sid,false);
|
||||
}
|
||||
|
||||
if(adminid!='1')$('#msgss{rand}').html('');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr valign="top">
|
||||
<td width="180" nowrap>
|
||||
<div>
|
||||
<div style="width:100%" class="btn-group">
|
||||
<button style="width:50%" onclick="openinput('写邮件','emailm')" class="btn btn-default" type="button"><i class="icon-pencil"></i> 写信</button>
|
||||
<button style="width:50%" class="btn btn-default" click="recemail" type="button"><i class="icon-download-alt"></i> 收信</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div align="left" class="list-group">
|
||||
<div class="list-group-item active">我的邮件</div>
|
||||
<a class="list-group-item" style="TEXT-DECORATION:none" click="change,0">收件箱 <font id="zztotal_{rand}">(0/0)</font></a>
|
||||
<a class="list-group-item" style="TEXT-DECORATION:none" click="change,1">草稿箱 <font id="cgtotal_{rand}">(0)</font></a>
|
||||
<a class="list-group-item" style="TEXT-DECORATION:none" click="change,2">已发送 <font color="#aaaaaa" id="yftotal_{rand}">(0)</font></a>
|
||||
<a class="list-group-item" style="TEXT-DECORATION:none" click="change,3">已删除 <font color="#aaaaaa" id="sctotal_{rand}">(0)</font></a>
|
||||
<a click="cogemail" style="TEXT-DECORATION:none" class="list-group-item"><i class="icon-cog"></i> 邮箱设置</a>
|
||||
<a id="txemail{rand}" click="gototxemail" style="TEXT-DECORATION:none;display:none" class="list-group-item"><i class="icon-envelope-alt"></i> 打开腾讯企业邮箱</a>
|
||||
</div>
|
||||
|
||||
<div align="left" style="display:none" class="list-group">
|
||||
<div class="list-group-item active">邮件文件夹</div>
|
||||
<a class="list-group-item" style="TEXT-DECORATION:none"><i class="icon-plus"></i> 新建文件夹</a>
|
||||
</div>
|
||||
</td>
|
||||
<td width="10" nowrap></td>
|
||||
<td>
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td style="padding-right:10px">
|
||||
<div style="width:140px" class="input-group">
|
||||
<input placeholder="日期" readonly class="form-control" id="dt2_{rand}" >
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="js.changedate(this,'dt2_{rand}')" type="button"><i class="icon-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" style="width:200px" id="key_{rand}" placeholder="主题/收件人/发件人">
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
<td width="90%">
|
||||
<div id="msgss{rand}"> 自动接收邮件设置,<a href="javascript:;" click="clickset">[打开设置]</a></div>
|
||||
</td>
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-default" id="btn1_{rand}" click="biaoyd" type="button">标识已读</button>
|
||||
<button class="btn btn-danger" click="delyj" type="button"><i class="icon-trash"></i> 删除</button>
|
||||
</td>
|
||||
</tr></table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div style="overflow:auto;min-width:800px"><div id="view_{rand}"></div></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
112
webmain/system/email/rock_email_cog.php
Normal file
112
webmain/system/email/rock_email_cog.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'email_cog',celleditor:true,sort:'sort',dir:'asc',
|
||||
columns:[{
|
||||
text:'编号',dataIndex:'num'
|
||||
},{
|
||||
text:'发送名称',dataIndex:'name'
|
||||
},{
|
||||
text:'SMTP服务器',dataIndex:'serversmtp'
|
||||
},{
|
||||
text:'SMTP服务器端口',dataIndex:'serverport'
|
||||
},{
|
||||
text:'邮箱帐号',dataIndex:'emailname'
|
||||
},{
|
||||
text:'连接方式',dataIndex:'secure'
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort',editor:true,sortable:true
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del();
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var h = $.bootsform({
|
||||
title:'系统邮件帐号',height:400,width:500,
|
||||
tablename:'email_cog',isedit:lx,params:{int_filestype:'sort,serverport'},
|
||||
submitfields:'serversmtp,name,serverport,emailname,num,secure,sort',url:js.getajaxurl('publicsave','email','system'),beforesaveaction:'savebeforecog',
|
||||
items:[{
|
||||
labelText:'编号',name:'num',required:true
|
||||
},{
|
||||
labelText:'名称',name:'name',required:true
|
||||
},{
|
||||
labelText:'SMTP服务器',name:'serversmtp',required:true
|
||||
},{
|
||||
labelText:'SMTP服务器端口',name:'serverport',required:true,type:'number'
|
||||
},{
|
||||
labelText:'邮箱帐号',name:'emailname',required:true
|
||||
},{
|
||||
labelText:'邮箱密码',name:'emailpass'
|
||||
},{
|
||||
labelText:'连接方式',name:'secure',store:[['','默认'],['ssl','ssl']],type:'select',displayfields:1,valuefields:0
|
||||
},{
|
||||
labelText:'序号',name:'sort',type:'number',value:'0'
|
||||
}],
|
||||
success:function(){
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
if(lx==1){
|
||||
h.setValues(a.changedata);
|
||||
}
|
||||
h.getField('name').focus();
|
||||
},
|
||||
refresh:function(){
|
||||
a.reload();
|
||||
},
|
||||
yunx:function(){
|
||||
if(ISDEMO){js.msg('success','demo上就不要测试,我们都测试通过的');return;}
|
||||
var url = js.getajaxurl('testsend','{mode}','{dir}');
|
||||
js.ajax(url,{id:a.changeid},function(s){
|
||||
js.msg('success', s);
|
||||
},'get',false,'测试发送中...');
|
||||
}
|
||||
};
|
||||
|
||||
function btn(bo){
|
||||
get('del_{rand}').disabled = bo;
|
||||
get('edit_{rand}').disabled = bo;
|
||||
get('yun_{rand}').disabled = bo;
|
||||
}
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
<button class="btn btn-default" click="refresh" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td width="80%"></td>
|
||||
<td align="right" nowrap>
|
||||
|
||||
<button class="btn btn-default" id="yun_{rand}" click="yunx" disabled type="button">测试发送</button>
|
||||
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
<div class="tishi">提示:此功能是设置系统邮件发送的帐号,如一些邮件的提醒功能!测试发送是发送到当前登录用户的邮箱上!</div>
|
||||
120
webmain/system/email/rock_email_cogsfa.php
Normal file
120
webmain/system/email/rock_email_cogsfa.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var c={
|
||||
init:function(){
|
||||
$.get(js.getajaxurl('getset','{mode}','{dir}'), function(a){
|
||||
for(var i in a)get(''+i+'_{rand}').value = a[i];
|
||||
},'json');
|
||||
},
|
||||
save:function(o){
|
||||
var d={};
|
||||
d.sendhost = get('sendhost_{rand}').value;
|
||||
d.sendport = get('sendport_{rand}').value;
|
||||
d.recehost = get('recehost_{rand}').value;
|
||||
d.sendsecure = get('sendsecure_{rand}').value;
|
||||
d.sysname = get('sysname_{rand}').value;
|
||||
d.sysuser = get('sysuser_{rand}').value;
|
||||
d.syspass = get('syspass_{rand}').value;
|
||||
d.receyumi = get('receyumi_{rand}').value;
|
||||
if(!js.email(d.sysuser)){
|
||||
js.msg('msg','发邮件邮箱帐号的格式不对,请填写正确邮箱格式');
|
||||
return;
|
||||
}
|
||||
js.msg('wait','保存中...');
|
||||
js.ajax(js.getajaxurl('setsave','{mode}','{dir}'), d, function(s){
|
||||
js.msg('success','保存成功');
|
||||
});
|
||||
},
|
||||
test:function(){
|
||||
if(ISDEMO){js.msg('success','demo上就不要测试,我们都测试通过的');return;}
|
||||
var url = js.getajaxurl('testsend','{mode}','{dir}');
|
||||
js.ajax(url,false,function(s){
|
||||
js.msg('success', s);
|
||||
},'get',false,'测试发送中...');
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
c.init();
|
||||
});
|
||||
</script>
|
||||
|
||||
<div align="left">
|
||||
<div style="padding:10px;">
|
||||
|
||||
|
||||
|
||||
<table cellspacing="0" width="500" border="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><div class="inputtitle">发邮件设置</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="150" align="right">SMTP服务器:</td>
|
||||
<td class="tdinput"><input id="sendhost_{rand}" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">SMTP服务器端口:</td>
|
||||
<td class="tdinput"><input id="sendport_{rand}" onfocus="js.focusval=this.value" onblur="js.number(this)" type="number" class="form-control"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">发送方式:</td>
|
||||
<td class="tdinput"><select id="sendsecure_{rand}" class="form-control"><option value="ssl">ssl</option><option value="">默认</option></select></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><div class="inputtitle">系统发邮件帐号</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">名称:</td>
|
||||
<td class="tdinput"><input id="sysname_{rand}" class="form-control"><font color="#888888">用于发送系统邮件的名称</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">发邮件邮箱帐号:</td>
|
||||
<td class="tdinput"><input id="sysuser_{rand}" class="form-control"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">发邮件邮箱密码:</td>
|
||||
<td class="tdinput"><input id="syspass_{rand}" class="form-control">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"></td>
|
||||
<td class="tdinput"><button click="test" class="btn btn-default" type="button">测试发邮件</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><div class="inputtitle">IMAP收邮件设置</div></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right">IMAP连接主机:</td>
|
||||
<td class="tdinput"><input id="recehost_{rand}" class="form-control"><font color="#888888">收邮件我们使用的IMAP协议,如是其他的,本系统上没有。</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">收信邮箱域名:</td>
|
||||
<td class="tdinput"><input id="receyumi_{rand}" class="form-control">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right"></td>
|
||||
<td style="padding:15px 0px" colspan="3" align="left"><button click="save" class="btn btn-success" type="button"><i class="icon-save"></i> 保存</button> <a href="<?=URLY?>view_email.html" target="_blank">[?查看邮件帮助]</a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
65
webmain/system/email/rock_email_coguser.php
Normal file
65
webmain/system/email/rock_email_coguser.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var a = $('#admin_{rand}').bootstable({
|
||||
tablename:'admin',modenum:'user',celleditor:true,sort:'sort',dir:'asc',fanye:true,
|
||||
storebeforeaction:'coguserbeforeshow',storeafteraction:'coguseraftershow',modedir:'{mode}:{dir}',params:{atype:'all'},
|
||||
columns:[{
|
||||
text:'头像',dataIndex:'face',renderer:function(v,d){
|
||||
if(isempt(v))v='images/noface.png';
|
||||
return '<img src="'+v+'" height="24" width="24">';
|
||||
}
|
||||
},{
|
||||
text:'部门',dataIndex:'deptallname',align:'left'
|
||||
},{
|
||||
text:'姓名',dataIndex:'name',sortable:true
|
||||
},{
|
||||
text:'用户名',dataIndex:'user'
|
||||
},{
|
||||
text:'职位',dataIndex:'ranking'
|
||||
},{
|
||||
text:'邮箱',dataIndex:'email',editor:true
|
||||
},{
|
||||
text:'邮箱密码',dataIndex:'emailpass',editor:!ISDEMO
|
||||
},{
|
||||
text:'状态',dataIndex:'status',type:'checkbox',editor:true,sortable:true
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
}]
|
||||
});
|
||||
|
||||
var c = {
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
<table width="100%"><tr>
|
||||
<td>
|
||||
<div class="input-group" style="width:250px">
|
||||
<input class="form-control" id="key_{rand}" placeholder="姓名/部门/职位/用户名">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="search" type="button"><i class="icon-search"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td width="80%"></td>
|
||||
<td align="right" nowrap>
|
||||
<a class="btn btn-default" href="<?=URLY?>view_email.html" target="_blank">?查看邮件帮助</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="admin_{rand}"></div>
|
||||
<div class="tishi">此功能设置每个用户收发邮件的邮箱帐号密码,添加用户到用户管理那添加。</div>
|
||||
92
webmain/system/extent/extentAction.php
Normal file
92
webmain/system/extent/extentAction.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
class extentClassAction extends Action
|
||||
{
|
||||
public function beforeextentuser($table)
|
||||
{
|
||||
$key = $this->post('key');
|
||||
$where = '';
|
||||
if(!isempt($key))$where = m('admin')->getkeywhere($key);
|
||||
if($this->adminid>1)$where.=m('admin')->getcompanywhere();
|
||||
return array(
|
||||
'where' => 'and `status`=1 and `type`=0 '.$where.'',
|
||||
'fields'=> '`id`,`name`,`user`,`deptname`'
|
||||
);
|
||||
}
|
||||
|
||||
public function beforeextentgroup($table)
|
||||
{
|
||||
$where = '';
|
||||
if($this->adminid>1 && ISMORECOM){
|
||||
$where.= 'and `companyid` in('.m('admin')->getcompanyid().')';
|
||||
}
|
||||
return $where;
|
||||
}
|
||||
|
||||
/**
|
||||
保存
|
||||
*/
|
||||
public function saveAjax()
|
||||
{
|
||||
$type = $this->rock->post('type');
|
||||
$mid = $this->rock->post('mid');
|
||||
$checkaid = $this->rock->post('checkaid');
|
||||
if($type == 'clear'){
|
||||
$this->extentclear($mid);
|
||||
}else{
|
||||
$this->db->delete($this->T('sjoin'), "`type`='$type' and `mid`='$mid'");
|
||||
}
|
||||
$ntable = '';
|
||||
$msg = '';
|
||||
switch($type){
|
||||
case 'um';
|
||||
$ntable = ''.PREFIX.'menu';
|
||||
break;
|
||||
case 'gm';
|
||||
$ntable = ''.PREFIX.'menu';
|
||||
break;
|
||||
case 'mu';
|
||||
$ntable = ''.PREFIX.'admin';
|
||||
break;
|
||||
case 'mg';
|
||||
$ntable = ''.PREFIX.'group';
|
||||
break;
|
||||
}
|
||||
if($ntable != '' && $checkaid != '' ){
|
||||
$this->db->insert($this->T('sjoin'),'`type`,`mid`,`sid`,`indate`',"select '$type','$mid',`id`,'$this->now' from `$ntable` where `id` in($checkaid)",true);
|
||||
}
|
||||
if($msg=='')$msg='success';
|
||||
echo $msg;
|
||||
}
|
||||
|
||||
//清空用户权限
|
||||
private function extentclear($uid)
|
||||
{
|
||||
$this->db->delete($this->T('sjoin'), "( (`type` in ('um','uu','ut') and `mid`='$uid') or (`type`='mu' and `sid`='$uid') )");
|
||||
}
|
||||
|
||||
public function qingkongAjax()
|
||||
{
|
||||
$this->db->delete($this->T('sjoin'), "`type` not in ('ug','gu')");
|
||||
}
|
||||
|
||||
/**
|
||||
获取权限信息
|
||||
*/
|
||||
function getextentAjax()
|
||||
{
|
||||
$type = $this->rock->post('type');
|
||||
$mid = $this->rock->post('mid');
|
||||
$ntable = '';
|
||||
$s = '[0]';
|
||||
|
||||
//权限查看的
|
||||
if($type == 'view'){
|
||||
$s = m('sjoin')->getuserext($mid);
|
||||
}else{
|
||||
$rsa = $this->db->getall("select `sid` from `".PREFIX."sjoin` where `type`='$type' and `mid`='$mid'");
|
||||
foreach($rsa as $rs)$s.=',['.$rs['sid'].']';
|
||||
}
|
||||
echo $s;
|
||||
}
|
||||
|
||||
}
|
||||
177
webmain/system/extent/rock_extent.php
Normal file
177
webmain/system/extent/rock_extent.php
Normal file
@@ -0,0 +1,177 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params};
|
||||
var type = params.type;
|
||||
|
||||
|
||||
var ucans= {
|
||||
tablename:'admin',sort:'sort',dir:'asc',modedir:'{mode}:{dir}',storebeforeaction:'beforeextentuser',
|
||||
title:'人员',bodyStyle:'height:'+(viewheight-135)+'px;overflow:auto',
|
||||
columns:[{
|
||||
text:'姓名',dataIndex:'name',sortable:true
|
||||
},{
|
||||
text:'部门',dataIndex:'deptname',sortable:true
|
||||
},{
|
||||
text:'用户名',dataIndex:'user',sortable:true
|
||||
},{
|
||||
text:'ID',dataIndex:'id',sortable:true
|
||||
}]
|
||||
};
|
||||
|
||||
var mcans = {
|
||||
tablename:'menu',selectcls:'info',
|
||||
url:js.getajaxurl('data','menu','system',{'type':type}),
|
||||
tree:true,title:'菜单',bodyStyle:'height:'+(viewheight-135)+'px;overflow:auto',
|
||||
columns:[{
|
||||
text:'菜单名称',dataIndex:'name',align:'left'
|
||||
},{
|
||||
text:'编号',dataIndex:'num'
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
}]
|
||||
};
|
||||
|
||||
var gcans = {
|
||||
tablename:'group',sort:'sort',dir:'asc',title:'组',modedir:'{mode}:{dir}',storebeforeaction:'beforeextentgroup',
|
||||
columns:[{
|
||||
text:'组名',dataIndex:'name',sortable:true
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort',sortable:true
|
||||
},{
|
||||
text:'ID',dataIndex:'id',sortable:true
|
||||
}]
|
||||
};
|
||||
|
||||
var viewcan1,viewcan2;
|
||||
|
||||
if(type=='um' || type=='view'){
|
||||
viewcan1 = ucans;
|
||||
viewcan2 = mcans;
|
||||
viewcan1.fanye=true;
|
||||
viewcan1.bodyStyle='height:'+(viewheight-225)+'px;overflow:auto';
|
||||
}
|
||||
if(type=='mu'){
|
||||
viewcan1 = mcans;
|
||||
viewcan2 = ucans;
|
||||
}
|
||||
if(type=='gm'){
|
||||
viewcan1 = gcans;
|
||||
viewcan2 = mcans;
|
||||
}
|
||||
if(type=='mg'){
|
||||
viewcan1 = mcans;
|
||||
viewcan2 = gcans;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(type=='view'){
|
||||
$('#viessban_{rand}').html('<button class="btn btn-primary" click="qingkong" type="button">清空全部菜单权限</button> 人员菜单权限有如下得来:1、根据[人员→菜单,菜单→人员];2、如所在的组有权限,组下人员也有权限;3、在[菜单管理]没有开启验证的菜单任何人是都有权限。');
|
||||
}
|
||||
|
||||
var bool = false,changeid=0;
|
||||
|
||||
var a = $('#view1_{rand}').bootstable(js.apply(viewcan1,{
|
||||
itemclick:function(d){
|
||||
|
||||
getextent(d)
|
||||
}
|
||||
}));
|
||||
var b = $('#view2_{rand}').bootstable(js.apply(viewcan2,{
|
||||
checked:true
|
||||
}));
|
||||
$('#title1_{rand}').html(viewcan1.title);
|
||||
$('#title2_{rand}').html(viewcan2.title);
|
||||
|
||||
function getextent(d){
|
||||
setmsg('读取中...');
|
||||
if(bool)return;
|
||||
$('#title2_{rand}').html(viewcan1.title+'['+d.name+']对应'+viewcan2.title+'');
|
||||
btn(false);
|
||||
var mid = d.id;
|
||||
changeid = mid;
|
||||
$.post(js.getajaxurl('getextent','extent','system'),{mid:mid,type:type}, function(da){
|
||||
bool= false;
|
||||
setmsg('');
|
||||
var o = b.getcheckobj();
|
||||
for(var i=0;i<o.length;i++){
|
||||
o[i].checked=false;
|
||||
if(da.indexOf('['+o[i].value+']')>=0)o[i].checked=true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setmsg(txt,col){
|
||||
js.setmsg(txt,col, 'msgview_{rand}');
|
||||
}
|
||||
|
||||
function btn(bo){
|
||||
if(get('save_{rand}'))get('save_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
var c = {
|
||||
save:function(o1){
|
||||
if(type=='view' || bool || changeid==0)return false;
|
||||
var data={type:type,mid:changeid};
|
||||
data.checkaid = b.getchecked();
|
||||
var url = js.getajaxurl('save','extent','system');
|
||||
bool = true;
|
||||
setmsg('保存中...');
|
||||
btn(true);
|
||||
$.post(url,data,function(da){
|
||||
if(da!='success'){
|
||||
setmsg(da, 'red');
|
||||
}else{
|
||||
setmsg('保存成功', 'green');
|
||||
}
|
||||
bool = false;
|
||||
});
|
||||
},
|
||||
search:function(){
|
||||
a.setparams({key:$('#key_{rand}').val()}, true);
|
||||
},
|
||||
qingkong:function(){
|
||||
var url = js.getajaxurl('qingkong','extent','system');
|
||||
$.get(url, function(){
|
||||
js.confirm('菜单权限已全部清空,刷新系统重新进入',function(jg){
|
||||
location.reload();
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
js.initbtn(c);
|
||||
|
||||
if(type=='um' || type=='view')$('#soukey_{rand}').show();
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="viessban_{rand}" style="margin-bottom:10px">
|
||||
<button class="btn btn-primary" disabled id="save_{rand}" click="save" type="button"><i class="icon-save"></i> 保存设置</button> <span id="msgview_{rand}">用户类型为管理员具有全部菜单权限,权限管理中不会在人员列表上显示。</span>
|
||||
</div>
|
||||
<table width="100%">
|
||||
<tr valign="top">
|
||||
<td width="50%">
|
||||
<div class="input-group" style="width:250px;margin-bottom:10px;display:none" id="soukey_{rand}">
|
||||
<input class="form-control" id="key_{rand}" placeholder="人员关键词搜索">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="search" type="button"><i class="icon-search"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading"><h3 class="panel-title" id="title1_{rand}">人员</h3></div>
|
||||
<div id="view1_{rand}"></div>
|
||||
</div>
|
||||
</td>
|
||||
<td width="10"><div style="width:10px;overflow:hidden"></div></td>
|
||||
<td width="50%">
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-heading"><h3 class="panel-title" id="title2_{rand}">菜单</h3></div>
|
||||
<div id="view2_{rand}"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="blank10"></div>
|
||||
237
webmain/system/geren/gerenAction.php
Normal file
237
webmain/system/geren/gerenAction.php
Normal file
@@ -0,0 +1,237 @@
|
||||
<?php
|
||||
class gerenClassAction extends Action
|
||||
{
|
||||
public function getinitAjax()
|
||||
{
|
||||
$uid = $this->adminid;
|
||||
$carr= m('admin')->getcompanyinfo($uid);
|
||||
|
||||
return array(
|
||||
'gerentodo' => $this->option->getval('gerennotodo_'.$uid.''),
|
||||
'qmimgstr' => $this->option->getval('qmimgstr_'.$uid.''),
|
||||
'carr' => $carr,
|
||||
);
|
||||
}
|
||||
|
||||
public function cogsaveAjax()
|
||||
{
|
||||
$uid = $this->adminid;
|
||||
$this->option->setval('gerennotodo_'.$uid.'', $this->get('gerentodo','0'));
|
||||
}
|
||||
|
||||
//保存图片
|
||||
public function qmimgsaveAjax()
|
||||
{
|
||||
$uid = $this->adminid;
|
||||
$str = '';
|
||||
$qmimgstr = $this->post('qmimgstr');
|
||||
if(!isempt($qmimgstr)){
|
||||
if(contain($qmimgstr,'.')){
|
||||
$str = $qmimgstr;
|
||||
}else{
|
||||
$qma = explode(',', $qmimgstr);
|
||||
$str = ''.UPDIR.'/'.date('Y-m').'/'.$uid.'qming_'.rand(1000,9999).'.png';
|
||||
$this->rock->createtxt($str, base64_decode($qma[1]));
|
||||
}
|
||||
}
|
||||
$this->option->setval('qmimgstr_'.$uid.'', $str);
|
||||
}
|
||||
|
||||
public function filebefore($table)
|
||||
{
|
||||
$key = $this->post('key');
|
||||
$atype = $this->post('atype');
|
||||
$dt1 = $this->post('dt1');
|
||||
$dt2 = $this->post('dt2');
|
||||
$where = 'and optid='.$this->adminid.'';
|
||||
if($atype=='all'){
|
||||
$where='';
|
||||
if($this->adminid>1)$where=m('admin')->getcompanywhere(3);
|
||||
}
|
||||
if($key!=''){
|
||||
$where.=" and (`optname` like '%$key%' or `filename` like '%$key%' or `mtype`='$key')";
|
||||
}
|
||||
if($dt1!='')$where.=" and `adddt`>='".$dt1." 00:00:00'";
|
||||
if($dt2!='')$where.=" and `adddt`<='".$dt2." 23:59:59'";
|
||||
return array(
|
||||
'where' => $where,
|
||||
|
||||
);
|
||||
}
|
||||
public function fileafter($table, $rows)
|
||||
{
|
||||
$fobj = m('file');
|
||||
foreach($rows as $k=>&$rs){
|
||||
$rs['thumbpath'] = $fobj->getthumbpath($rs);
|
||||
$fpath = $rs['filepath'];
|
||||
|
||||
$status= 1;
|
||||
if(substr($fpath,0,4)=='http'){
|
||||
$status = 2;
|
||||
}else{
|
||||
if(isempt($rs['filenum']) && !file_exists($fpath))$status=0;
|
||||
$filepathout = arrvalue($rs, 'filepathout');
|
||||
if(!file_exists($fpath) && !isempt($filepathout)){
|
||||
if($fobj->isimg($rs['fileext']))$rs['filepath'] = $filepathout;
|
||||
$status=2;
|
||||
}
|
||||
}
|
||||
$rs['status'] = $status;
|
||||
}
|
||||
return array(
|
||||
'rows' => $rows
|
||||
);
|
||||
}
|
||||
|
||||
public function delfileAjax()
|
||||
{
|
||||
$id = c('check')->onlynumber($this->post('id','0'));
|
||||
m('file')->delfile($id);
|
||||
backmsg();
|
||||
}
|
||||
|
||||
public function defaultAction()
|
||||
{
|
||||
$this->title = '修改头像';
|
||||
$face = $this->db->getmou($this->T('admin'),'face',"`id`='$this->adminid'");
|
||||
$imgurl = '';
|
||||
if(!$this->rock->isempt($face)){
|
||||
$imgurl='../../'.preg_replace("/_crop\d{4}/",'',$face);
|
||||
}
|
||||
//$face = $this->rock->repempt($face,'images/white.gif');
|
||||
$this->smartydata['face'] = $face;
|
||||
$this->smartydata['imgurl'] = $imgurl;
|
||||
}
|
||||
|
||||
public function changestyleAjax()
|
||||
{
|
||||
$style = (int)$this->post('style','0');
|
||||
m('admin')->update('`style`='.$style.'', 'id='.$this->adminid.'');
|
||||
}
|
||||
|
||||
|
||||
public function editpassAjax()
|
||||
{
|
||||
$id = $this->adminid;
|
||||
if(getconfig('systype')=='demo')exit('演示上不要修改');
|
||||
$oldpass = $this->rock->post('passoldPost');
|
||||
$pasword = $this->rock->post('passwordPost');
|
||||
$msg = '';
|
||||
if($this->rock->isempt($pasword))$msg ='新密码不能为空';
|
||||
if($msg == ''){
|
||||
$oldpassa = $this->db->getmou($this->T('admin'),"`pass`","`id`='$id'");
|
||||
if($oldpassa != md5($oldpass))$msg ='旧密码不正确';
|
||||
if($msg==''){
|
||||
if($oldpassa == md5($pasword))$msg ='新密码不能和旧密码相同';
|
||||
}
|
||||
}
|
||||
if($msg == ''){
|
||||
if(!$this->db->record($this->T('admin'), "`pass`='".md5($pasword)."',`editpass`=`editpass`+1", "`id`='$id'"))$msg = $this->db->error();
|
||||
}
|
||||
if($msg=='')$msg='success';
|
||||
echo $msg;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
保存头像
|
||||
*/
|
||||
public function savefaceAjax()
|
||||
{
|
||||
$id = $this->adminid;
|
||||
$arr = array('face'=>$this->rock->post('facePost'));
|
||||
$msg = '';
|
||||
if(!$this->db->record($this->T('admin'),$arr, "`id`='$id'"))$msg= $this->db->error();
|
||||
if($msg=='')$msg='success';
|
||||
echo $msg;
|
||||
}
|
||||
|
||||
public function todoydAjax()
|
||||
{
|
||||
m('todo')->update("status=1,`readdt`='$this->now'", "`id` in(".$this->post('s').") and `status`=0");
|
||||
}
|
||||
|
||||
public function totaldaetods($table, $rows)
|
||||
{
|
||||
$wdtotal = m('todo')->rows("`uid`='$this->adminid' and `status`=0 and `tododt`<='$this->now'");
|
||||
return array('wdtotal'=>$wdtotal);
|
||||
}
|
||||
|
||||
public function beforetotaldaetods($table)
|
||||
{
|
||||
$s = " and `uid`='$this->adminid' and `tododt`<='$this->now'";
|
||||
$key = $this->post('key');
|
||||
if($key)$s.=" and (`title` like '%$key%' or `mess` like '%$key%')";
|
||||
return $s;
|
||||
}
|
||||
|
||||
public function getlinksAjax()
|
||||
{
|
||||
$rows = m('links')->getrows('1=1','*','`type`,`sort`');
|
||||
echo json_encode($rows);
|
||||
}
|
||||
|
||||
|
||||
//导入个人通讯录
|
||||
public function piliangaddAjax()
|
||||
{
|
||||
$rows = c('html')->importdata('name,unitname,tel,mobile,email,gname,address','name');
|
||||
$oi = 0;
|
||||
$db = m('vcard');
|
||||
foreach($rows as $k=>$rs){
|
||||
$rs['optdt'] = $this->now;
|
||||
$rs['uid'] = $this->adminid;
|
||||
$rs['optname'] = $this->adminname;
|
||||
$db->insert($rs);
|
||||
$oi++;
|
||||
}
|
||||
backmsg('','成功导入'.$oi.'条数据');
|
||||
}
|
||||
|
||||
public function filelogs_before($table)
|
||||
{
|
||||
$where = '';
|
||||
$fileid = (int)$this->post('fileid','0');
|
||||
$where = "and `fileid`='$fileid'";
|
||||
return $where;
|
||||
}
|
||||
|
||||
public function delfilelogsAjax()
|
||||
{
|
||||
$id = (int)$this->post('id','0');
|
||||
m('files')->delete($id);
|
||||
backmsg();
|
||||
}
|
||||
|
||||
|
||||
//获取背景图片
|
||||
public function getbeijingAjax()
|
||||
{
|
||||
$dev = $this->option->getval('beijing_'.$this->adminid.'','images/beijing/bj0.jpg');
|
||||
$path = ''.ROOT_PATH.'/images/beijing';
|
||||
if(!is_dir($path))return returnsuccess(array(
|
||||
'dev' => $dev,
|
||||
'rows'=> array()
|
||||
));
|
||||
$barr = array();
|
||||
$bar = glob(''.$path.'/*.jpg');
|
||||
$isno = false;
|
||||
if($bar)foreach($bar as $k=>$fil1){
|
||||
$faiar = explode('images', $fil1);
|
||||
$lujg = 'images'.$faiar[1].'';
|
||||
if($lujg==$dev)$isno = true;
|
||||
$barr[] = $lujg;
|
||||
}
|
||||
if(!$isno)$barr[] = $dev;
|
||||
return returnsuccess(array(
|
||||
'dev'=> $dev,
|
||||
'rows'=>$barr
|
||||
));
|
||||
}
|
||||
|
||||
public function savebeijingAjax()
|
||||
{
|
||||
$val = $this->post('value');
|
||||
$this->option->setval('beijing_'.$this->adminid.'',$val);
|
||||
}
|
||||
}
|
||||
350
webmain/system/geren/rock_geren_cog.php
Normal file
350
webmain/system/geren/rock_geren_cog.php
Normal file
@@ -0,0 +1,350 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
{params}
|
||||
var stype = params.stype;
|
||||
var valchange = ''+adminstyle,zleng=-1;
|
||||
var ysarr = '使用默认,cerulean,cosmo,cyborg,darkly,flatly,journal,lumen,paper,readable,sandstone,simplex,slate,spacelab,superhero,united,xinhu,yeti';
|
||||
var companyinfoall;
|
||||
var c = {
|
||||
init:function(){
|
||||
js.ajax(js.getajaxurl('getinit','{mode}','{dir}'),false,function(ret){
|
||||
get('gerentodo{rand}').checked = (ret.gerentodo=='1');
|
||||
var imgs = ret.qmimgstr;
|
||||
if(imgs){
|
||||
var s = '<br><img id="imgqianming" src="'+imgs+'" height="90">';
|
||||
$('#qianmingshow').append(s);
|
||||
}
|
||||
c.showcompany(ret.carr);
|
||||
},'get,json');
|
||||
|
||||
|
||||
var sear = ysarr.split(','),i,len=sear.length,s='<tr>',oi=0,zarr=[],za,sel='';
|
||||
zleng = len-1;
|
||||
for(i=0;i<len;i++){
|
||||
zarr.push({text:sear[i],value:i});
|
||||
if(i>0)zarr.push({text:sear[i]+'_default',value:i+zleng});
|
||||
}
|
||||
for(i=0;i<zarr.length;i++){
|
||||
za = zarr[i];
|
||||
oi++;
|
||||
sel = (valchange==za.value)?'checked' : '';
|
||||
s+='<td align="center" style="padding:10px"><label><a style="TEXT-DECORATION:none">'+za.text+'</a><br><input type="radio" '+sel+' name="_stylechange" value="'+za.value+'"></label>';
|
||||
s+='</td>';
|
||||
if(oi%7==0)s+='</tr><tr>';
|
||||
}
|
||||
s+='</tr>';
|
||||
$('#tablstal2{rand}').prepend(s);
|
||||
if(adminid!=1)$('#zhutibao{rand}').remove();
|
||||
},
|
||||
showcompany:function(ad){
|
||||
var s='',a1,i,col;
|
||||
var darr = ad.companyinfoall,s1='',act;
|
||||
companyinfoall = darr;
|
||||
$('#companylist{rand} a[temp]').remove();
|
||||
for(i=0;i<darr.length;i++){
|
||||
a1=darr[i];
|
||||
s1=a1.name;
|
||||
act='';
|
||||
//if(a1.id==ad.companyinfo.id)act=' active';
|
||||
if(!isempt(a1.city))s1+='<font color=#aaaaaa>('+a1.city+''+a1.address+')</font>';
|
||||
s+='<a temp="list" style="TEXT-DECORATION:none" class="list-group-item'+act+'"><img src="'+a1.logo+'" align="absmiddle" height="20" width="20"> '+s1+'';
|
||||
if(a1.id==ad.companyinfo.id){
|
||||
s+=' <span class="label label-success"><i class="icon-ok"></i>当前</span>';
|
||||
}else{
|
||||
s+=' <button type="button" onclick="qiehun{rand}('+i+')" class="btn btn-default btn-xs">切换</button>';
|
||||
}
|
||||
s+='</a>';
|
||||
}
|
||||
$('#companylist{rand}').append(s);
|
||||
},
|
||||
savecog:function(){
|
||||
js.msg('wait','保存中...');
|
||||
js.ajax(js.getajaxurl('cogsave','{mode}','{dir}'),{
|
||||
gerentodo:get('gerentodo{rand}').checked ? 1 : 0
|
||||
},function(ret){
|
||||
js.msg('success','保存成功');
|
||||
},'get');
|
||||
},
|
||||
savepass:function(o1){
|
||||
var fm = 'form_{rand}';
|
||||
var msgview = 'msgview_{rand}';
|
||||
|
||||
var opass = form('passoldPost',fm).value;
|
||||
var pass = form('passwordPost',fm).value;
|
||||
var pass1 = form('password1Post',fm).value;
|
||||
|
||||
if(opass==''){
|
||||
js.setmsg('旧密码不能为空','red', msgview);
|
||||
form('passoldPost',fm).focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(pass.length <4){
|
||||
js.setmsg('新密码不能少于4个字符','red', msgview);
|
||||
form('passwordPost',fm).focus();
|
||||
return false;
|
||||
}
|
||||
if(!/[a-zA-Z]{1,}/.test(pass) || !/[0-9]{1,}/.test(pass)){
|
||||
js.setmsg('新密码必须使用字母+数字','red', msgview);
|
||||
form('passwordPost',fm).focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(opass==pass){
|
||||
js.setmsg('新密码不能和旧密码相同','red', msgview);
|
||||
form('passwordPost',fm).focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(pass!=pass1){
|
||||
js.setmsg('确认密码不一致','red', msgview);
|
||||
form('password1Post',fm).focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
var data = js.getformdata(fm);
|
||||
form('submitbtn',fm).disabled=true;
|
||||
js.setmsg('修改中...','#ff6600', msgview);
|
||||
$.post(js.getajaxurl('editpass','geren','system'),data,function(da){
|
||||
if(da=='success'){
|
||||
var msg = '密码修改成功';
|
||||
js.setmsg(msg,'green', msgview);
|
||||
if(stype=='pass'){
|
||||
js.alert(msg+',点确定后继续使用系统','', function(){
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
}else{
|
||||
if(da=='')da='修改失败';
|
||||
js.setmsg(da,'red', msgview);
|
||||
form('submitbtn',fm).disabled=false;
|
||||
}
|
||||
});
|
||||
},
|
||||
tesgs:function(o1,lx){
|
||||
$('#tagsl{rand}').find('li').removeClass('active');
|
||||
o1.className='active';
|
||||
$('#tablstal0{rand}').hide();
|
||||
$('#tablstal1{rand}').hide();
|
||||
$('#tablstal2{rand}').hide();
|
||||
$('#tablstal3{rand}').hide();
|
||||
|
||||
$('#tablstal'+lx+'{rand}').show();
|
||||
if(lx==3)js.importjs('mode/plugin/jquery-signature.js');
|
||||
},
|
||||
savestyle:function(){
|
||||
adminstyle = valchange;
|
||||
js.ajax(js.getajaxurl('changestyle','geren','system'),{style:valchange},function(s){
|
||||
js.msg('success','保存成功');
|
||||
});
|
||||
},
|
||||
qmimgstr:'',
|
||||
qianming:function(o1){
|
||||
this.qianmingbo=false;
|
||||
js.tanbody('qianming','请在空白区域写上你的姓名',500,300,{
|
||||
html:'<div data-width="480" data-height="220" data-border="1px dashed #cccccc" data-line-color="#000000" data-auto-fit="true" id="qianmingdiv" style="margin:10px;height:220px;cursor:default;width:480px"></div>',
|
||||
btn:[{text:'确定签名'},{text:'重写'}]
|
||||
});
|
||||
$('#qianmingdiv').jqSignature().on('jq.signature.changed', function() {
|
||||
c.qianmingbo=true;
|
||||
});
|
||||
|
||||
|
||||
$('#qianming_btn0').click(function(){
|
||||
c.qianmingok();
|
||||
});
|
||||
$('#qianming_btn1').click(function(){
|
||||
$('#imgqianming').remove();
|
||||
$('#qianmingdiv').jqSignature('clearCanvas');
|
||||
c.qianmingbo = false;
|
||||
c.qmimgstr = '';
|
||||
});
|
||||
},
|
||||
qianmingok:function(){
|
||||
if(!this.qianmingbo)return;
|
||||
$('#imgqianming').remove();
|
||||
var dataUrl = $('#qianmingdiv').jqSignature('getDataURL');
|
||||
var s = '<br><img id="imgqianming" src="'+dataUrl+'" height="90">';
|
||||
c.qmimgstr = dataUrl;
|
||||
$('#qianmingshow').append(s);
|
||||
js.tanclose('qianming');
|
||||
},
|
||||
saveqian:function(){
|
||||
this.saveqians(false);
|
||||
},
|
||||
saveqians:function(bo){
|
||||
if(this.qmimgstr=='' && !bo){
|
||||
js.msg('msg','没有修改无需保存');
|
||||
return;
|
||||
}
|
||||
js.msg('wait','保存中...');
|
||||
js.ajax(js.getajaxurl('qmimgsave','{mode}','{dir}'),{
|
||||
qmimgstr:this.qmimgstr
|
||||
},function(ret){
|
||||
js.msg('success','保存成功');
|
||||
},'post');
|
||||
},
|
||||
saveqians1:function(){
|
||||
this.qmimgstr = '';
|
||||
$('#imgqianming').remove();
|
||||
this.saveqians(true);
|
||||
},
|
||||
qianup:function(){
|
||||
js.upload('upimg{rand}',{maxup:'1',thumbnail:'150x150','title':'上传签名图片',uptype:'image'});
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
c.init();
|
||||
|
||||
upimg{rand}=function(a){
|
||||
var f = a[0];
|
||||
$('#imgqianming').remove();
|
||||
var dataUrl = f.filepath;
|
||||
var s = '<br><img id="imgqianming" src="'+dataUrl+'" height="90">';
|
||||
c.qmimgstr = dataUrl;
|
||||
$('#qianmingshow').append(s);
|
||||
}
|
||||
|
||||
$("input[name='_stylechange']").click(function(){
|
||||
var val = parseFloat(this.value);
|
||||
valchange=val;
|
||||
var sear = ysarr.split(',')
|
||||
if(val>0){
|
||||
var xz = val+0,tou='inverse';
|
||||
if(xz>zleng){
|
||||
xz=xz-zleng;
|
||||
tou='default';
|
||||
}
|
||||
if(get('navtopheader'))get('navtopheader').className='navbar navbar-'+tou+' navbar-static-top';
|
||||
get('mainstylecss').href='mode/bootstrap3.3/css/bootstrap_'+sear[xz]+'.css';
|
||||
}else{
|
||||
js.msg('success','使用默认主题的保存后,刷新页面即可');
|
||||
}
|
||||
});
|
||||
if(stype=='pass'){
|
||||
c.tesgs(get('passli{rand}'),1);
|
||||
changetabs=c.tesgs=function(){}
|
||||
}
|
||||
|
||||
qiehun{rand}=function(oi){
|
||||
var d1 = companyinfoall[oi];
|
||||
js.confirm('确定要切换到单位上“'+d1.name+'”吗?', function(jg){
|
||||
if(jg=='yes'){
|
||||
js.loading('切换中...');
|
||||
js.ajax('api.php?m=index&a=changecompany',{id:d1.id}, function(){
|
||||
js.msgok('切换成功');
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(!companymode)$('#companylist{rand}').hide();
|
||||
});
|
||||
</script>
|
||||
<div style="padding:10px">
|
||||
|
||||
<ul id="tagsl{rand}" class="nav nav-tabs">
|
||||
|
||||
<li click="tesgs,0" class="active">
|
||||
<a style="TEXT-DECORATION:none"><i class="icon-cog"></i> 基本设置</a>
|
||||
</li>
|
||||
<li id="passli{rand}" click="tesgs,1">
|
||||
<a style="TEXT-DECORATION:none"><i class="icon-lock"></i> 修改密码</a>
|
||||
</li>
|
||||
|
||||
<li click="tesgs,2">
|
||||
<a style="TEXT-DECORATION:none"><i class="icon-magic"></i> 切换主题皮肤</a>
|
||||
</li>
|
||||
<li click="tesgs,3">
|
||||
<a style="TEXT-DECORATION:none"><i class="icon-edit"></i> 签名图片</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div style="padding-top:20px">
|
||||
|
||||
<table cellspacing="0" id="tablstal0{rand}" border="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
|
||||
<td colspan="2">
|
||||
|
||||
<div align="left" id="companylist{rand}" style="max-width:400px;margin-left:50px" class="list-group">
|
||||
<div class="list-group-item list-group-item-info">
|
||||
我加入的单位
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" width="80"></td>
|
||||
<td class="tdinput"><label><input id="gerentodo{rand}" type="checkbox"> <a style="TEXT-DECORATION:none">后台不显示提醒消息</a></label></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right"></td>
|
||||
<td style="padding:15px 0px" colspan="3" align="left"><button click="savecog" class="btn btn-success" type="button"><i class="icon-save"></i> 保存</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
<form id="tablstal1{rand}" style="display:none" name="form_{rand}">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="100" align="right" height="50">旧密码:</td>
|
||||
<td><input style="width:250px" name="passoldPost" type="password" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" height="70">新密码:</td>
|
||||
<td><input style="width:250px" name="passwordPost" placeholder="至少4位字母+数字组合" type="password" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" height="70">确认密码:</td>
|
||||
<td><input style="width:250px" name="password1Post" type="password" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td height="60" align="right"></td>
|
||||
<td align="left"><input class="btn btn-success" click="savepass" name="submitbtn" value="修改" type="button"> <span id="msgview_{rand}"></span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
|
||||
|
||||
<table id="tablstal2{rand}" style="display:none;margin-left:70px">
|
||||
|
||||
<tr>
|
||||
<td colspan="10" style="padding-left:20px"><input class="btn btn-success" click="savestyle" name="submitbtn" value="保存修改" type="button">
|
||||
<span id="zhutibao{rand}"> 切换出现无样式请到官网<a href="<?=URLY?>view_themes.html" target="_blank">下载主题包</a>。</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="tablstal3{rand}" style="display:none;margin-left:70px">
|
||||
|
||||
<tr>
|
||||
<td align="center" style="padding:15px">
|
||||
<div id="qianmingshow" align="left"><input type="button" click="qianming" class="btn btn-default btn-xs" value="手写签名"> <input type="button" click="qianup" class="btn btn-default btn-xs" value="上传签名图片"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding-left:15px"><input class="btn btn-success" click="saveqian" value="保存签名图片" type="button"> <input class="btn btn-default btn-xs" click="saveqians1" value="清空签名" type="button"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
70
webmain/system/geren/rock_geren_contacts.php
Normal file
70
webmain/system/geren/rock_geren_contacts.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'contacts',celleditor:true,sort:'sort',dir:'asc',keywhere:'and optid={adminid}',
|
||||
columns:[{
|
||||
text:'姓名',dataIndex:'uname'
|
||||
},{
|
||||
text:'用户id',dataIndex:'uid'
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort',editor:true
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del({check:function(lx){if(lx=='yes')btn(true)}});
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var h = $.bootsform({
|
||||
title:'常联系人',height:400,width:400,
|
||||
tablename:'contacts',isedit:lx,url:publicsave(),params:{int_filestype:'sort',otherfields:'optdt={now},optid={adminid},optname={admin}'},
|
||||
submitfields:'uname,sort,uid',
|
||||
items:[{
|
||||
name:'uid',type:'hidden'
|
||||
},{
|
||||
labelText:'常联系人',type:'changeuser',changeuser:{
|
||||
type:'user',idname:'uid',title:'选择人员'
|
||||
},name:'uname',clearbool:true,required:true
|
||||
},{
|
||||
labelText:'排序号',name:'sort',type:'number',value:'0'
|
||||
}],
|
||||
success:function(){
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
if(lx==1){
|
||||
h.setValues(a.changedata);
|
||||
}
|
||||
},
|
||||
refresh:function(){
|
||||
a.reload();
|
||||
}
|
||||
};
|
||||
|
||||
function btn(bo){
|
||||
get('del_{rand}').disabled = bo;
|
||||
get('edit_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<ul class="floats">
|
||||
<li class="floats50">
|
||||
<button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
<button class="btn btn-success" click="refresh" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
</li>
|
||||
<li style="text-align:right" class="floats50">
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
139
webmain/system/geren/rock_geren_file.php
Normal file
139
webmain/system/geren/rock_geren_file.php
Normal file
@@ -0,0 +1,139 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params};
|
||||
var atype=params.atype;
|
||||
var checkeds = adminid==1;
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'file',celleditor:true,sort:'id',dir:'desc',modedir:'{mode}:{dir}',params:{'atype':atype},fanye:true,checked:checkeds,
|
||||
storebeforeaction:'filebefore',storeafteraction:'fileafter',
|
||||
columns:[{
|
||||
text:'类型',dataIndex:'fileext',renderer:function(v, d){
|
||||
if(!isempt(d.thumbpath))return '<img src="'+d.thumbpath+'" width="24" height="24">';
|
||||
var lxs = js.filelxext(v);
|
||||
return '<img src="web/images/fileicons/'+lxs+'.gif">';
|
||||
}
|
||||
},{
|
||||
text:'名称',dataIndex:'filename',align:'left',renderer:function(v,d){
|
||||
var ss='';
|
||||
if(d.status==2)ss='<img title="远程文件" src="web/images/fileicons/html.gif">';
|
||||
return ''+v+''+ss+'';
|
||||
}
|
||||
},{
|
||||
text:'大小',dataIndex:'filesizecn',sortable:true
|
||||
},{
|
||||
text:'上传时间',dataIndex:'adddt',sortable:true
|
||||
},{
|
||||
text:'创建人',dataIndex:'optname',sortable:true
|
||||
},{
|
||||
text:'IP',dataIndex:'ip'
|
||||
},{
|
||||
text:'浏览器',dataIndex:'web'
|
||||
},{
|
||||
text:'下载次数',dataIndex:'downci',sortable:true,renderer:function(v,d,oi){
|
||||
return ''+v+'<a href="javascript:;" onclick="showvies{rand}('+oi+',2)">查看</a>';
|
||||
}
|
||||
},{
|
||||
text:'关联表',dataIndex:'mtype'
|
||||
},{
|
||||
text:'关联表ID',dataIndex:'mid'
|
||||
},{
|
||||
text:'ID',dataIndex:'id',sortable:true
|
||||
},{
|
||||
text:'关联模块',dataIndex:'mknum'
|
||||
},{
|
||||
text:'',dataIndex:'opt',renderer:function(v,d,oi){
|
||||
if(d.status=='0'){
|
||||
return '已删';
|
||||
}else{
|
||||
return '<a href="javascript:;" onclick="showvies{rand}('+oi+',0)">预览</a> <a href="javascript:;" onclick="showvies{rand}('+oi+',1)"><i class="icon-arrow-down"></i></a>';
|
||||
}
|
||||
}
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
},
|
||||
itemdblclick:function(d){
|
||||
c.openlogs(d);
|
||||
}
|
||||
});
|
||||
|
||||
showvies{rand}=function(oi,lx){
|
||||
var d=a.getData(oi);
|
||||
if(lx==2){
|
||||
c.openlogs(d);
|
||||
return;
|
||||
}
|
||||
if(lx==1){
|
||||
js.downshow(d.id,d.filenum)
|
||||
}else{
|
||||
js.yulanfile(d.id,d.fileext,d.filepath,d.filename,d.filenum);
|
||||
}
|
||||
}
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del({url:js.getajaxurl('delfile','{mode}','{dir}'),checked:checkeds});
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s,dt1:get('dt1_{rand}').value,dt2:get('dt2_{rand}').value},true);
|
||||
},
|
||||
openlogs:function(d){
|
||||
addtabs({name:'文件操作记录','num':'files'+d.id+'',url:'system,geren,files,fileid='+d.id+',filename='+jm.base64encode(d.filename)+''});
|
||||
},
|
||||
clickdt:function(o1, lx){
|
||||
$(o1).rockdatepicker({initshow:true,view:'date',inputid:'dt'+lx+'_{rand}'});
|
||||
}
|
||||
};
|
||||
|
||||
function btn(bo){
|
||||
//get('del_{rand}').disabled = bo;
|
||||
}
|
||||
js.initbtn(c);
|
||||
a.settishi('<div class="tishi">提示:上传的文件可能会在某些单据上,删除请谨慎。</div>');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
<table width="100%"><tr>
|
||||
<td>
|
||||
<input class="form-control" style="width:180px" id="key_{rand}" placeholder="文件名/创建人/关联表">
|
||||
</td>
|
||||
<td nowrap> 上传日期 </td>
|
||||
<td nowrap>
|
||||
<div style="width:150px" class="input-group">
|
||||
<input placeholder="" readonly class="form-control" id="dt1_{rand}" >
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="clickdt,1" type="button"><i class="icon-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td nowrap> 至 </td>
|
||||
<td nowrap>
|
||||
<div style="width:150px" class="input-group">
|
||||
<input placeholder="" readonly class="form-control" id="dt2_{rand}" >
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="clickdt,2" type="button"><i class="icon-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td width="80%"></td>
|
||||
<td align="right" nowrap>
|
||||
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" type="button"><i class="icon-trash"></i> 删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
75
webmain/system/geren/rock_geren_files.php
Normal file
75
webmain/system/geren/rock_geren_files.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params};
|
||||
var fileid=params.fileid;
|
||||
if(!fileid)fileid='';
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'files',sort:'id',dir:'desc',modedir:'{mode}:{dir}',params:{'fileid':fileid},fanye:true,
|
||||
storebeforeaction:'filelogs_before',
|
||||
columns:[{
|
||||
text:'操作人',dataIndex:'optname',sortable:true
|
||||
},{
|
||||
text:'IP',dataIndex:'ip'
|
||||
},{
|
||||
text:'浏览器',dataIndex:'web'
|
||||
},{
|
||||
text:'类型',dataIndex:'type',sortable:true,renderer:function(v){
|
||||
var s=' ';
|
||||
if(v=='0')s='预览';
|
||||
if(v=='1')s='下载';
|
||||
if(v=='2')s='在线编辑';
|
||||
return s;
|
||||
}
|
||||
},{
|
||||
text:'时间',dataIndex:'optdt',sortable:true
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del({url:js.getajaxurl('delfilelogs','{mode}','{dir}')});
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
}
|
||||
};
|
||||
|
||||
function btn(bo){
|
||||
get('del_{rand}').disabled = bo;
|
||||
}
|
||||
js.initbtn(c);
|
||||
$('#showfiels{rand}').html('<h4>文件“'+jm.base64decode(params.filename)+'”的操作记录:</h4>');
|
||||
if(admintype=='0')$('#del_{rand}').hide();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
<table width="100%"><tr>
|
||||
<td width="80%">
|
||||
<div id="showfiels{rand}"></div>
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td></td>
|
||||
<td align="right" nowrap>
|
||||
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
109
webmain/system/geren/rock_geren_todo.php
Normal file
109
webmain/system/geren/rock_geren_todo.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'todo',checked:true,fanye:true,statuschange:false,
|
||||
url:js.getajaxurl('publicstore','{mode}','{dir}'),defaultorder:'`id` desc',
|
||||
storeafteraction:'totaldaetods',storebeforeaction:'beforetotaldaetods',
|
||||
columns:[{
|
||||
text:'类型',dataIndex:'title',sortable:true,renderer:function(v,d){
|
||||
var s = v;
|
||||
if(d.status==1)s='<font color=#aaaaaa>'+v+'</font>';
|
||||
return s;
|
||||
}
|
||||
},{
|
||||
text:'信息内容',align:'left',dataIndex:'mess',renderer:function(v,d, oi){
|
||||
var s = v;
|
||||
if(d.status==1)s='<font color=#aaaaaa>'+v+'</font>';
|
||||
if(!isempt(d.modenum) && d.mid>0){
|
||||
s+=' <a href="javascript:;" onclick="chsksse{rand}('+oi+')">[查看]</a>';
|
||||
}
|
||||
return s;
|
||||
}
|
||||
},{
|
||||
text:'时间',dataIndex:'optdt',sortable:true,renderer:function(v,d){
|
||||
var s = v;
|
||||
if(d.status==1)s='<font color=#aaaaaa>'+v+'</font>';
|
||||
return s;
|
||||
}
|
||||
},{
|
||||
text:'状态',dataIndex:'status',sortable:true,renderer:function(v){
|
||||
var s = '<font color=red>未读</font>';
|
||||
if(v==1)s='<font color=#aaaaaa>已读</font>';
|
||||
return s;
|
||||
}
|
||||
}],
|
||||
itemclick:function(d,oi, o1){
|
||||
//if(d.status==0)c.yidchuls(d.id, true);
|
||||
},
|
||||
load:function(){
|
||||
$('#guestbook_wd').html(''+a.getData('wdtotal'))
|
||||
}
|
||||
});
|
||||
chsksse{rand}=function(oi){
|
||||
var d=a.getData(oi);
|
||||
openxiangs(d.title,d.modenum,d.mid);
|
||||
}
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del({checked:true});
|
||||
},
|
||||
yidu:function(o1, lx){
|
||||
var s = a.getchecked();
|
||||
if(s==''){
|
||||
js.msg('msg','没有选中行');
|
||||
return;
|
||||
}
|
||||
this.yidchuls(s, true);
|
||||
},
|
||||
yidchuls:function(s,lxs){
|
||||
if(lxs)js.msg('wait','处理中...');
|
||||
$.post(js.getajaxurl('todoyd','geren','system'),{s:s}, function(){
|
||||
if(lxs){
|
||||
js.msg('success','处理成功');
|
||||
a.reload()
|
||||
}
|
||||
});
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown();
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
js.initbtn(c);
|
||||
c{rand} = c;
|
||||
});
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-success" click="yidu,1" type="button">标为已读</button>
|
||||
</td>
|
||||
|
||||
<td width="95%" align="left">
|
||||
|
||||
<div class="input-group" style="width:220px;">
|
||||
<input class="form-control" id="key_{rand}" onkeydown="if(event.keyCode==13)c{rand}.search()" placeholder="关键词">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="search" type="button"><i class="icon-search"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-default" click="daochu" type="button">导出</button>
|
||||
<button class="btn btn-danger" click="del" type="button"><i class="icon-trash"></i> 删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
158
webmain/system/geren/rock_geren_vcard.php
Normal file
158
webmain/system/geren/rock_geren_vcard.php
Normal file
@@ -0,0 +1,158 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var pid,typeid=0,sspid=0;
|
||||
var at = $('#optionview_{rand}').bootstree({
|
||||
url:js.getajaxurl('gettreedata','option','system',{'num':'gerenvcard_'+adminid+''}),
|
||||
columns:[{
|
||||
text:'分组',dataIndex:'name',align:'left',xtype:'treecolumn',width:'79%'
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort',width:'20%'
|
||||
}],
|
||||
load:function(d){
|
||||
if(sspid==0){
|
||||
typeid = d.pid;
|
||||
sspid = d.pid;
|
||||
c.loadfile('','所有联系人');
|
||||
}
|
||||
},
|
||||
itemdblclick:function(d){
|
||||
typeid = d.id;
|
||||
c.loadfile(d.name,d.name);
|
||||
}
|
||||
});;
|
||||
var modenum = 'vcard';
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:modenum,celleditor:true,sort:'sort',dir:'asc',fanye:true,autoLoad:false,modenum:modenum,modename:'个人通讯录',
|
||||
columns:[{
|
||||
text:'姓名',dataIndex:'name'
|
||||
},{
|
||||
text:'性别',dataIndex:'sex'
|
||||
},{
|
||||
text:'单位',dataIndex:'unitname'
|
||||
},{
|
||||
text:'电话',dataIndex:'tel',editor:true
|
||||
},{
|
||||
text:'手机号',dataIndex:'mobile',editor:true
|
||||
},{
|
||||
text:'邮箱',dataIndex:'email'
|
||||
},{
|
||||
text:'所在组',dataIndex:'gname',editor:true
|
||||
},{
|
||||
text:'地址',dataIndex:'address'
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort',editor:true,sortable:true
|
||||
},{
|
||||
text:'操作时间',dataIndex:'optdt'
|
||||
},{
|
||||
text:'',dataIndex:'caozuo'
|
||||
}]
|
||||
});
|
||||
|
||||
|
||||
var c = {
|
||||
reload:function(){
|
||||
at.reload();
|
||||
},
|
||||
loadfile:function(spd,nsd){
|
||||
$('#megss{rand}').html(nsd);
|
||||
a.setparams({'gname':spd}, true);
|
||||
},
|
||||
genmu:function(){
|
||||
typeid = sspid;
|
||||
at.changedata={};
|
||||
this.loadfile('','所有联系人');
|
||||
},
|
||||
clicktypeeidt:function(){
|
||||
var d = at.changedata;
|
||||
if(d.id)c.clicktypewin(false, 1, d);
|
||||
},
|
||||
clicktypewin:function(o1, lx, da){
|
||||
var h = $.bootsform({
|
||||
title:'组',height:250,width:300,
|
||||
tablename:'option',labelWidth:50,
|
||||
isedit:lx,submitfields:'name,sort,pid',cancelbtn:false,
|
||||
items:[{
|
||||
labelText:'组名',name:'name',required:true
|
||||
},{
|
||||
labelText:'上级id',name:'pid',value:0,type:'hidden'
|
||||
},{
|
||||
labelText:'排序号',name:'sort',type:'number',value:0
|
||||
}],
|
||||
success:function(){
|
||||
at.reload();
|
||||
}
|
||||
});
|
||||
if(lx==1)h.setValues(da);
|
||||
if(lx==0)h.setValue('pid', sspid);
|
||||
return h;
|
||||
},
|
||||
typedel:function(o1){
|
||||
at.del({
|
||||
url:js.getajaxurl('deloption','option','system')
|
||||
});
|
||||
},
|
||||
adds:function(){
|
||||
openinput('个人通讯录',modenum);
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown();
|
||||
},
|
||||
daoru:function(){
|
||||
managelistvcard = a;
|
||||
addtabs({num:'daoruvcard',url:'flow,input,daoru,modenum=vcard',icons:'plus',name:'导入个人通讯录'});
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
$('#optionview_{rand}').css('height',''+(viewheight-70)+'px');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr valign="top">
|
||||
<td width="220">
|
||||
<div style="border:1px #cccccc solid">
|
||||
<div id="optionview_{rand}" style="height:400px;overflow:auto;"></div>
|
||||
<div class="panel-footer">
|
||||
<a href="javascript:" click="clicktypewin,0" onclick="return false"><i class="icon-plus"></i></a>
|
||||
<a href="javascript:" click="clicktypeeidt" onclick="return false"><i class="icon-edit"></i></a>
|
||||
<a href="javascript:" click="typedel" onclick="return false"><i class="icon-trash"></i></a>
|
||||
<a href="javascript:" click="reload" onclick="return false"><i class="icon-refresh"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td width="10"></td>
|
||||
<td>
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td align="left" nowrap>
|
||||
<button class="btn btn-primary" click="adds" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
<button class="btn btn-default" click="genmu" type="button">所有联系人</button>
|
||||
|
||||
</td>
|
||||
|
||||
<td style="padding-left:10px">
|
||||
<input class="form-control" style="width:180px" id="key_{rand}" placeholder="标题">
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
<td width="90%">
|
||||
<span id="megss{rand}"></span>
|
||||
</td>
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-default" click="daoru" type="button">导入个人通讯录</button>
|
||||
<button class="btn btn-default" click="daochu" type="button">导出</button>
|
||||
</td>
|
||||
</tr></table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
64
webmain/system/group/groupAction.php
Normal file
64
webmain/system/group/groupAction.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
class groupClassAction extends Action
|
||||
{
|
||||
public function groupusershow($table)
|
||||
{
|
||||
$s = 'and 1=2';
|
||||
$gid = $this->post('gid','0');
|
||||
if($gid>0){
|
||||
$s = " and ( id in( select `sid` from `[Q]sjoin` where `type`='gu' and `mid`='$gid') or id in( select `mid` from `[Q]sjoin` where `type`='ug' and `sid`='$gid') )";
|
||||
}
|
||||
|
||||
|
||||
return array(
|
||||
'where' => $s,
|
||||
'fields'=> 'id,user,name,deptname,ranking'
|
||||
);
|
||||
}
|
||||
|
||||
public function groupafter($table, $rows)
|
||||
{
|
||||
$nosq = 'select `id` from `[Q]admin` where `status`=1';
|
||||
m('sjoin')->delete("`type`='gu' and `sid` not in($nosq)");
|
||||
m('sjoin')->delete("`type`='ug' and `mid` not in($nosq)");
|
||||
|
||||
|
||||
$carr = m('admin')->getcompanyinfo(0,5);
|
||||
$dbs = m('company');
|
||||
foreach($rows as $k=>$rs){
|
||||
$gid = $rs['id'];
|
||||
$s = "( id in( select `sid` from `[Q]sjoin` where `type`='gu' and `mid`='$gid') or id in( select `mid` from `[Q]sjoin` where `type`='ug' and `sid`='$gid') )";
|
||||
$rows[$k]['utotal'] = $this->db->rows('[Q]admin', $s);
|
||||
$companyname = '';
|
||||
if($rs['companyid']>0 && getconfig('companymode'))$companyname = $dbs->getmou('name', $rs['companyid']);
|
||||
$rows[$k]['companyname'] = $companyname;
|
||||
}
|
||||
|
||||
return array(
|
||||
'rows' => $rows,
|
||||
'carr' => $carr,
|
||||
);
|
||||
}
|
||||
|
||||
public function saveuserAjax()
|
||||
{
|
||||
$gid = $this->post('gid','0');
|
||||
$sid = $this->post('sid','0');
|
||||
$dbs = m('sjoin');
|
||||
$dbs->delete("`mid`='$gid' and `type`='gu' and `sid` in($sid)");
|
||||
$this->db->insert('[Q]sjoin','`type`,`mid`,`sid`', "select 'gu','$gid',`id` from `[Q]admin` where `id` in($sid)", true);
|
||||
m('admin')->updateinfo('and a.`id` in('.$sid.')');
|
||||
echo 'success';
|
||||
}
|
||||
|
||||
public function deluserAjax()
|
||||
{
|
||||
$gid = $this->post('gid','0');
|
||||
$sid = $this->post('sid','0');
|
||||
$dbs = m('sjoin');
|
||||
$dbs->delete("`mid`='$gid' and `type`='gu' and `sid`='$sid'");
|
||||
$dbs->delete("`sid`='$gid' and `type`='ug' and `mid`='$sid'");
|
||||
m('admin')->updateinfo('and a.`id` in('.$sid.')');
|
||||
echo 'success';
|
||||
}
|
||||
}
|
||||
195
webmain/system/group/rock_group.php
Normal file
195
webmain/system/group/rock_group.php
Normal file
@@ -0,0 +1,195 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var gid = 0,companyinfoall=[];
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'group',celleditor:true,url:publicstore('{mode}','{dir}'),storeafteraction:'groupafter',
|
||||
modenum:'group',sort:'sort',dir:'asc',
|
||||
columns:[{
|
||||
text:'组名',dataIndex:'name',editor:true
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort',editor:true,sortable:true
|
||||
},{
|
||||
text:'所属单位',dataIndex:'companyname'
|
||||
},{
|
||||
text:'人员数',dataIndex:'utotal'
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
}],
|
||||
itemclick:function(d){
|
||||
var bo=false;
|
||||
if(companymode && adminid>1 && d.companyid=='0')bo=true;
|
||||
btn(bo);
|
||||
},
|
||||
itemdblclick:function(ad,oi,e){
|
||||
$('#downshow_{rand}').html('组<b>['+ad.name+']</b>下的人员');
|
||||
gid=ad.id;
|
||||
at.setparams({gid:gid},true);
|
||||
},
|
||||
load:function(d1){
|
||||
companyinfoall = d1.carr.companyinfoall;
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
}
|
||||
});
|
||||
var alluserid = '';
|
||||
var at = $('#veiwuser_{rand}').bootstable({
|
||||
tablename:'admin',sort:'sort',dir:'asc',
|
||||
url:publicstore('{mode}','{dir}'),
|
||||
autoLoad:false,storebeforeaction:'groupusershow',
|
||||
columns:[{
|
||||
text:'用户名',dataIndex:'user',sortable:true
|
||||
},{
|
||||
text:'姓名',dataIndex:'name',sortable:true
|
||||
},{
|
||||
text:'部门',dataIndex:'deptname',sortable:true
|
||||
},{
|
||||
text:'职位',dataIndex:'ranking'
|
||||
},{
|
||||
text:'操作',dataIndex:'opt',renderer:function(v,d){
|
||||
return '<a href="javascript:" onclick="return deluserr{rand}('+d.id+')"><i class="icon-trash"> 删</a>';
|
||||
}
|
||||
}],
|
||||
load:function(da){
|
||||
get('add_{rand}').disabled=false;
|
||||
alluserid = '';
|
||||
for(var i=0;i<da.rows.length;i++){
|
||||
alluserid+=','+da.rows[i].id+'';
|
||||
}
|
||||
if(alluserid!='')alluserid = alluserid.substr(1);
|
||||
},
|
||||
beforeload:function(){
|
||||
alluserid = '';
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del({check:function(lx){if(lx=='yes')btn(true)}});
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var items = [{
|
||||
labelText:'组名',name:'name',required:true
|
||||
},{
|
||||
labelText:'序号',name:'sort',type:'number',value:'0'
|
||||
}],les='';
|
||||
if(companymode){
|
||||
var store = [];
|
||||
if(adminid==1)store.push({'id':'0','name':'全部单位'});
|
||||
for(var i=0;i<companyinfoall.length;i++)store.push(companyinfoall[i]);
|
||||
items.push({
|
||||
labelText:'所属单位',name:'companyid',type:'select',value:'0',valuefields:'id',displayfields:'name',store:store
|
||||
});
|
||||
les=',companyid';
|
||||
}
|
||||
|
||||
var h = $.bootsform({
|
||||
title:'组',height:400,width:400,
|
||||
tablename:'group',isedit:lx,
|
||||
url:js.getajaxurl('publicsave','group','system'),
|
||||
params:{int_filestype:'sort',add_otherfields:'indate={now}'},
|
||||
submitfields:'name,sort'+les+'',
|
||||
items:items,
|
||||
success:function(){
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
if(lx==1){
|
||||
h.setValues(a.changedata);
|
||||
}
|
||||
h.getField('name').focus();
|
||||
},
|
||||
refresh:function(){
|
||||
a.reload();
|
||||
if(gid>0)at.reload();
|
||||
},
|
||||
addguser:function(){
|
||||
var cans = {
|
||||
type:'usercheck',
|
||||
title:'选择人员',
|
||||
changerangeno:alluserid,
|
||||
callback:function(sna,sid){
|
||||
c.savedist(sid);
|
||||
}
|
||||
};
|
||||
js.getuser(cans);
|
||||
return false;
|
||||
},
|
||||
savedist:function(sid){
|
||||
if(sid!=''){
|
||||
js.msg('wait','保存中...');
|
||||
js.ajax(js.getajaxurl('saveuser','{mode}','{dir}'),{sid:sid,gid:gid},function(){
|
||||
js.msg('success','保存成功');
|
||||
at.reload();
|
||||
a.reload();
|
||||
},'post');
|
||||
}
|
||||
},
|
||||
delusers:function(uid){
|
||||
js.msg('wait','删除中...');
|
||||
js.ajax(js.getajaxurl('deluser','{mode}','{dir}'),{sid:uid,gid:gid},function(){
|
||||
js.msg('success','删除成功');
|
||||
at.reload();
|
||||
a.reload();
|
||||
},'post');
|
||||
}
|
||||
};
|
||||
|
||||
function btn(bo){
|
||||
get('del_{rand}').disabled = bo;
|
||||
get('edit_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
js.initbtn(c);
|
||||
|
||||
deluserr{rand}=function(uid){
|
||||
js.confirm('确定要删除组下的人员吗?',function(lx){
|
||||
if(lx=='yes'){
|
||||
c.delusers(uid);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<table width="100%">
|
||||
<tr valign="top">
|
||||
<td width="45%">
|
||||
|
||||
|
||||
<div>
|
||||
<ul class="floats">
|
||||
<li class="floats50">
|
||||
<button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增组</button>
|
||||
<button class="btn btn-default" click="refresh,0" type="button">刷新</button>
|
||||
</li>
|
||||
<li class="floats50" style="text-align:right">
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
<div class="tishi">在组的ID列下双击,查看组下的人员,在添加组下人员</div>
|
||||
</td>
|
||||
<td width="10"></td>
|
||||
<td>
|
||||
|
||||
<div>
|
||||
<ul class="floats">
|
||||
<li class="floats50">
|
||||
<span id="downshow_{rand}"> </span>
|
||||
</li>
|
||||
<li class="floats50" style="text-align:right">
|
||||
<button class="btn btn-primary" click="addguser,0" id="add_{rand}" disabled type="button"><i class="icon-plus"></i> 添加组下人员</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiwuser_{rand}"></div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
28
webmain/system/home/homeAction.php
Normal file
28
webmain/system/home/homeAction.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
class homeClassAction extends Action
|
||||
{
|
||||
public function delhomeAjax()
|
||||
{
|
||||
$id = c('check')->onlynumber($this->post('id','0'));
|
||||
m('homeitems')->delete('id in('.$id.')');
|
||||
$this->backmsg();
|
||||
}
|
||||
|
||||
//导入默认的官网首页项
|
||||
public function daordriwsAjax()
|
||||
{
|
||||
$rows = json_decode('[{"num":"kjrk","row":"0","name":"快捷入口","sort":"0"},{"num":"kjrko","row":"0","name":"快捷入口(大图标)","sort":"0"},{"num":"gong","row":"0","name":"通知公告","sort":"0"},{"num":"bianjian","row":"0","name":"便笺","sort":"1"},{"num":"tjlogin","row":"0","name":"登录统计","sort":"5","receid":"u1","recename":"管理员"},{"num":"kqtotal","row":"0","name":"今日出勤情况","sort":"2"},{"num":"news","row":"0","name":"新闻资讯","sort":"3"},{"num":"kqdk","row":"0","name":"考勤打卡","sort":"4"},{"num":"officic","row":"1","name":"公文查阅","sort":"3"},{"num":"gwwx","row":"0","receid":"u1","recename":"管理员","name":"微信办公","sort":"10"},{"num":"apply","row":"1","name":"我的申请","sort":"0"},{"num":"meet","row":"1","name":"今日会议","sort":"2"},{"num":"syslog","receid":"u1","recename":"管理员","row":"1","name":"系统日志","sort":"3"},{"num":"about","row":"1","receid":"u1","recename":"管理员","name":"关于信呼","sort":"10"}]', true);
|
||||
$db = m('homeitems');
|
||||
foreach($rows as $k=>$rs){
|
||||
$num = $rs['num'];
|
||||
$where = "`num`='$num'";
|
||||
if($db->rows($where)==0){
|
||||
$where='';
|
||||
}else{
|
||||
unset($rs['row']);
|
||||
unset($rs['sort']);
|
||||
}
|
||||
$db->record($rs, $where);
|
||||
}
|
||||
}
|
||||
}
|
||||
108
webmain/system/home/rock_home.php
Normal file
108
webmain/system/home/rock_home.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var lestore = [[0,'第一列'],[1,'第二列'],[2,'第三列'],[3,'第四列']];
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'homeitems',celleditor:true,defaultorder:'`row`,`sort`',
|
||||
columns:[{
|
||||
text:'名称',dataIndex:'name',editor:true
|
||||
},{
|
||||
text:'编号',dataIndex:'num',editor:true
|
||||
},{
|
||||
text:'适用对象',dataIndex:'recename'
|
||||
},{
|
||||
text:'位置列',dataIndex:'row',editor:true,type:'select',store:lestore,renderer:function(v){
|
||||
var v1=parseFloat(v);
|
||||
return lestore[v1][1];
|
||||
}
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort',editor:true,type:'number'
|
||||
},{
|
||||
text:'状态',dataIndex:'status',type:'checkbox',editor:true
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
}
|
||||
});
|
||||
|
||||
function btn(bo){
|
||||
get('del_{rand}').disabled = bo;
|
||||
get('edit_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del({url:js.getajaxurl('delhome','{mode}','{dir}')});
|
||||
},
|
||||
refresh:function(){
|
||||
a.reload();
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var h = $.bootsform({
|
||||
title:'首页项',height:400,width:400,
|
||||
tablename:'homeitems',isedit:lx,
|
||||
submitfields:'name,sort,num,receid,recename,row',
|
||||
items:[{
|
||||
labelText:'名称',name:'name',required:true
|
||||
},{
|
||||
labelText:'编号',name:'num',required:true
|
||||
},{
|
||||
labelText:'适用对象',type:'changeuser',changeuser:{
|
||||
type:'deptusercheck',idname:'receid',title:'选择人员'
|
||||
},name:'recename',clearbool:true
|
||||
|
||||
},{
|
||||
name:'receid',type:'hidden'
|
||||
},{
|
||||
labelText:'位置列',name:'row',type:'select',value:'0',store:lestore,valuefields:0,displayfields:1
|
||||
},{
|
||||
labelText:'序号',name:'sort',type:'number',value:'0'
|
||||
}],
|
||||
success:function(){
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
if(lx==1){
|
||||
h.setValues(a.changedata);
|
||||
}
|
||||
h.getField('name').focus();
|
||||
},
|
||||
daoru:function(){
|
||||
js.confirm('导入官网默认项,会直接覆盖你的修改哦',function(jg){
|
||||
if(jg=='yes')c.daoruss();
|
||||
});
|
||||
},
|
||||
daoruss:function(){
|
||||
js.msg('wait','导入中...');
|
||||
js.ajax(js.getajaxurl('daordriws','{mode}', '{dir}'),{}, function(d){
|
||||
js.msg('success', '导入成功');
|
||||
a.reload();
|
||||
},'get');
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<ul class="floats">
|
||||
<li class="floats50">
|
||||
<button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增首页项</button>
|
||||
<button class="btn btn-default" click="refresh,0" type="button">刷新</button>
|
||||
<button class="btn btn-default" click="daoru" type="button">导入官网默认项</button>
|
||||
</li>
|
||||
<li class="floats50" style="text-align:right">
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
<div class="tishi">首页项内容显示需要到webmain/home/desktop下创建对应文件编写代码。</div>
|
||||
43
webmain/system/infor/inforAction.php
Normal file
43
webmain/system/infor/inforAction.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
class inforClassAction extends Action
|
||||
{
|
||||
|
||||
public function publicbeforesave($table, $cans, $id)
|
||||
{
|
||||
$num = $cans['num'];
|
||||
if($num=='')$num = $this->db->ranknum($this->T($table),'num');
|
||||
return array('rows'=>array('num'=>$num));
|
||||
}
|
||||
|
||||
public function loaddataAjax()
|
||||
{
|
||||
$id = (int)$this->get('id');
|
||||
$data = m('infor')->getone($id);
|
||||
$arr = array(
|
||||
'data' => $data,
|
||||
'infortype' => $this->option->getdata('infortype')
|
||||
);
|
||||
echo json_encode($arr);
|
||||
}
|
||||
|
||||
|
||||
//导入题库提交
|
||||
public function tikuimportAjax()
|
||||
{
|
||||
$rows = c('html')->importdata('title,typeid,type,ana,anb,anc,and,answer,explain','title,typeid,type,ana,anb,answer');
|
||||
$oi = 0;
|
||||
$db = m('knowtiku');
|
||||
foreach($rows as $k=>$rs){
|
||||
$rs['typeid'] = $this->option->gettypeid('knowtikutype',$rs['typeid']);
|
||||
$rs['type'] = contain($rs['type'],'单') ? 0 : 1;
|
||||
$rs['adddt'] = $this->now;
|
||||
$rs['optdt'] = $this->now;
|
||||
$rs['optid'] = $this->adminid;
|
||||
$rs['status'] = 1;
|
||||
$db->insert($rs);
|
||||
$oi++;
|
||||
}
|
||||
backmsg('','成功导入'.$oi.'条数据');
|
||||
}
|
||||
|
||||
}
|
||||
104
webmain/system/infor/rock_infor.php
Normal file
104
webmain/system/infor/rock_infor.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'infor',fanye:true,sort:'sort',dir:'asc',celleditor:true,
|
||||
url:publicstore('{mode}','{dir}'),storeafteraction:'inforafter',storebeforeaction:'inforbefore',
|
||||
columns:[{
|
||||
text:'类型',dataIndex:'typename',sortable:true
|
||||
},{
|
||||
text:'名称',dataIndex:'title',align:'left'
|
||||
},{
|
||||
text:'序号',dataIndex:'sort',editor:true
|
||||
},{
|
||||
text:'显示首页',dataIndex:'isshow',type:'checkbox',editor:true,sortable:true
|
||||
},{
|
||||
text:'操作人',dataIndex:'optname',sortable:true
|
||||
},{
|
||||
text:'发布者',dataIndex:'zuozhe'
|
||||
},{
|
||||
text:'时间',dataIndex:'indate',sortable:true,sortable:true,renderer:function(v){
|
||||
return v.replace(' ','<br>');
|
||||
}
|
||||
},{
|
||||
text:'发布给',dataIndex:'recename'
|
||||
},{
|
||||
text:'修改时间',dataIndex:'optdt',sortable:true,renderer:function(v){
|
||||
return v.replace(' ','<br>');
|
||||
}
|
||||
}],
|
||||
itemclick:function(d){
|
||||
btn(false, d);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
}
|
||||
});
|
||||
|
||||
function btn(bo, d){
|
||||
get('edit_{rand}').disabled = bo;
|
||||
get('del_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del();
|
||||
},
|
||||
reload:function(){
|
||||
at.reload();
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var icon='plus',name='新增信息',id=0;
|
||||
if(lx==1){
|
||||
id = a.changeid;
|
||||
icon='edit';
|
||||
name='编辑信息';
|
||||
};
|
||||
guaninforlist = a;
|
||||
addtabs({num:'inforedit'+id+'',url:'system,infor,edit,id='+id+'',icons:icon,name:name});
|
||||
},
|
||||
getcans:function(){
|
||||
var can = {key:get('key_{rand}').value};
|
||||
return can;
|
||||
},
|
||||
search:function(o1){
|
||||
a.setparams(this.getcans(), true);
|
||||
},
|
||||
view:function(ids){
|
||||
this.openview(a.changedata.id);
|
||||
},
|
||||
openview:function(ids){
|
||||
openwork(ids);
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="left" width="100">
|
||||
|
||||
<button class="btn btn-warning" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
|
||||
</td>
|
||||
<td align="left" style="padding:0px 10px;">
|
||||
<div class="input-group" style="width:300px;">
|
||||
<input class="form-control" id="key_{rand}" placeholder="类型/名称">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="search" type="button"><i class="icon-search"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td align="right">
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
<button class="btn btn-danger" click="del" disabled id="del_{rand}" type="button"><i class="icon-trash"></i> 删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
111
webmain/system/infor/rock_infor_tiku.php
Normal file
111
webmain/system/infor/rock_infor_tiku.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var modenum='knowtiku';
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:modenum,celleditor:true,autoLoad:false,modenum:modenum,fanye:true,params:{atype:'guan'},
|
||||
columns:[{
|
||||
text:'题名',dataIndex:'title',editor:false,align:'left'
|
||||
},{
|
||||
text:'分类',dataIndex:'typename'
|
||||
},{
|
||||
text:'类型',dataIndex:'type'
|
||||
},{
|
||||
text:'A',dataIndex:'ana'
|
||||
},{
|
||||
text:'B',dataIndex:'anb'
|
||||
},{
|
||||
text:'C',dataIndex:'anc'
|
||||
},{
|
||||
text:'D',dataIndex:'and'
|
||||
},{
|
||||
text:'E',dataIndex:'ane'
|
||||
},{
|
||||
text:'答案',dataIndex:'answer',editor:true
|
||||
},{
|
||||
text:'排序',dataIndex:'sort',sortable:true,editor:true
|
||||
},{
|
||||
text:'状态',dataIndex:'status',type:'checkbox',editor:true,sortable:true
|
||||
},{
|
||||
text:'',dataIndex:'caozuo'
|
||||
}],
|
||||
itemdblclick:function(d){
|
||||
openxiangs(d.title,modenum, d.id);
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del();
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown();
|
||||
},
|
||||
adds:function(){
|
||||
openinput('知识题库',modenum);
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
},
|
||||
daoru:function(){
|
||||
|
||||
managelistknowtiku = a;
|
||||
addtabs({num:'daoruknowtiku',url:'flow,input,daoru,modenum=knowtiku',icons:'plus',name:'导入题库'});
|
||||
|
||||
},
|
||||
|
||||
mobj:a,
|
||||
title:'题库分类',
|
||||
stable:'knowtiku',
|
||||
optionview:'optionview_{rand}',
|
||||
optionnum:'knowtikutype',
|
||||
rand:'{rand}'
|
||||
};
|
||||
|
||||
var c = new optionclass(c);
|
||||
|
||||
js.initbtn(c);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<div style="border:1px #cccccc solid;width:220px">
|
||||
<div id="optionview_{rand}" style="height:400px;overflow:auto;"></div>
|
||||
</div>
|
||||
</td>
|
||||
<td width="10" nowrap><div style="width:10px"> </div></td>
|
||||
<td width="95%">
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td align="left" nowrap>
|
||||
<button class="btn btn-primary" click="adds" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
<button class="btn btn-default" click="allshow" type="button">所有题库</button>
|
||||
|
||||
</td>
|
||||
|
||||
<td style="padding-left:10px">
|
||||
<input class="form-control" style="width:200px" id="key_{rand}" placeholder="题名/分类">
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
<td width="90%">
|
||||
<span id="megss{rand}"></span>
|
||||
</td>
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-default" click="daoru" type="button">导入题库</button>
|
||||
<button class="btn btn-default" click="daochu" type="button">导出</button>
|
||||
</td>
|
||||
</tr></table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
117
webmain/system/infor/rock_infor_tikuxx.php
Normal file
117
webmain/system/infor/rock_infor_tikuxx.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params};
|
||||
var num = params.num,pid,optlx=0;
|
||||
var typeid=0,sspid=0;
|
||||
var at = $('#optionview_{rand}').bootstree({
|
||||
url:js.getajaxurl('gettreedata','option','system',{'num':'knowtikutype'}),
|
||||
columns:[{
|
||||
text:'题库分类',dataIndex:'name',align:'left',xtype:'treecolumn'
|
||||
}],
|
||||
load:function(d){
|
||||
if(sspid==0){
|
||||
typeid = d.pid;
|
||||
sspid = d.pid;
|
||||
c.loadfile('0','所有题库');
|
||||
}
|
||||
},
|
||||
itemdblclick:function(d){
|
||||
typeid = d.id;
|
||||
c.loadfile(d.id,d.name);
|
||||
}
|
||||
});;
|
||||
var modenum='knowtiku';
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:modenum,celleditor:false,autoLoad:false,modenum:modenum,fanye:true,params:{atype:'xuexi'},
|
||||
columns:[{
|
||||
text:'题名',dataIndex:'title',editor:false,align:'left'
|
||||
},{
|
||||
text:'分类',dataIndex:'typename'
|
||||
},{
|
||||
text:'类型',dataIndex:'type'
|
||||
},{
|
||||
text:'A',dataIndex:'ana'
|
||||
},{
|
||||
text:'B',dataIndex:'anb'
|
||||
},{
|
||||
text:'C',dataIndex:'anc'
|
||||
},{
|
||||
text:'D',dataIndex:'and'
|
||||
},{
|
||||
text:'E',dataIndex:'ane'
|
||||
},{
|
||||
text:'答案',dataIndex:'answer',renderer:function(v,d,oi){
|
||||
return '<a href="javascript:;" onclick="openxiangs(\'知识学习\',\'knowtiku\','+d.id+')">查看</a>';
|
||||
}
|
||||
}],
|
||||
itemdblclick:function(d){
|
||||
openxiangs(d.title,modenum, d.id);
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
reload:function(){
|
||||
at.reload();
|
||||
},
|
||||
loadfile:function(spd,nsd){
|
||||
$('#megss{rand}').html(nsd);
|
||||
a.setparams({'typeid':spd}, true);
|
||||
},
|
||||
genmu:function(){
|
||||
typeid = sspid;
|
||||
at.changedata={};
|
||||
this.loadfile('0','所有题库');
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown();
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
$('#optionview_{rand}').css('height',''+(viewheight-70)+'px');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr valign="top">
|
||||
<td width="220">
|
||||
<div style="border:1px #cccccc solid">
|
||||
<div id="optionview_{rand}" style="height:400px;overflow:auto;"></div>
|
||||
<div class="panel-footer">
|
||||
<a href="javascript:" click="reload" onclick="return false"><i class="icon-refresh"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td width="10" nowrap><div style="width:10px"> </div></td>
|
||||
<td>
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td align="left" nowrap>
|
||||
<button class="btn btn-default" click="genmu" type="button">所有题库</button>
|
||||
|
||||
</td>
|
||||
|
||||
<td style="padding-left:10px">
|
||||
<input class="form-control" style="width:200px" id="key_{rand}" placeholder="题名/分类">
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
<td width="90%">
|
||||
<span id="megss{rand}"></span>
|
||||
</td>
|
||||
<td align="right">
|
||||
<button class="btn btn-default" click="daochu" type="button">导出</button>
|
||||
</td>
|
||||
</tr></table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
97
webmain/system/infor/rock_infor_zhishi.php
Normal file
97
webmain/system/infor/rock_infor_zhishi.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
|
||||
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'knowledge',celleditor:true,autoLoad:false,modenum:'knowledge',fanye:true,
|
||||
columns:[{
|
||||
text:'标题',dataIndex:'title',editor:false,align:'left'
|
||||
},{
|
||||
text:'分类',dataIndex:'typename'
|
||||
},{
|
||||
text:'添加时间',dataIndex:'adddt',sortable:true
|
||||
},{
|
||||
text:'操作时间',dataIndex:'optdt',sortable:true
|
||||
},{
|
||||
text:'操作人',dataIndex:'optname'
|
||||
},{
|
||||
text:'排序',dataIndex:'sort',sortable:true,editor:true
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
},{
|
||||
text:'',dataIndex:'caozuo'
|
||||
}],
|
||||
itemdblclick:function(d){
|
||||
openxiangs(d.title,'knowledge', d.id);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del();
|
||||
},
|
||||
adds:function(){
|
||||
openinput('知识','knowledge');
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown();
|
||||
},
|
||||
mobj:a,
|
||||
title:'知识分类',
|
||||
stable:'knowledge',
|
||||
optionview:'optionview_{rand}',
|
||||
optionnum:'knowledgetype',
|
||||
rand:'{rand}'
|
||||
};
|
||||
|
||||
var c = new optionclass(c);
|
||||
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<div style="border:1px #cccccc solid;width:220px">
|
||||
<div id="optionview_{rand}" style="height:400px;overflow:auto;"></div>
|
||||
</div>
|
||||
</td>
|
||||
<td width="10" nowrap><div style="width:10px"> </div></td>
|
||||
<td width="95%">
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td align="left" nowrap>
|
||||
<button class="btn btn-primary" click="adds" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
<button class="btn btn-default" click="allshow" type="button">所有知识</button>
|
||||
|
||||
</td>
|
||||
|
||||
<td style="padding-left:10px">
|
||||
<input class="form-control" style="width:180px" id="key_{rand}" placeholder="标题/分类">
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
<td width="90%">
|
||||
<span id="megss{rand}"></span>
|
||||
</td>
|
||||
<td align="right">
|
||||
<button class="btn btn-default" click="daochu" type="button">导出</button>
|
||||
</td>
|
||||
</tr></table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
118
webmain/system/infor/rock_infor_zhishixx.php
Normal file
118
webmain/system/infor/rock_infor_zhishixx.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params};
|
||||
var num = params.num,pid,optlx=0;
|
||||
var typeid=0,sspid=0;
|
||||
var at = $('#optionview_{rand}').bootstree({
|
||||
url:js.getajaxurl('gettreedata','option','system',{'num':'knowledgetype'}),
|
||||
columns:[{
|
||||
text:'知识分类',dataIndex:'name',align:'left',xtype:'treecolumn',width:'79%'
|
||||
},{
|
||||
text:'ID',dataIndex:'id',width:'20%'
|
||||
}],
|
||||
load:function(d){
|
||||
if(sspid==0){
|
||||
typeid = d.pid;
|
||||
sspid = d.pid;
|
||||
c.loadfile('0','所有知识');
|
||||
}
|
||||
},
|
||||
itemdblclick:function(d){
|
||||
typeid = d.id;
|
||||
c.loadfile(d.id,d.name);
|
||||
}
|
||||
});;
|
||||
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'knowledge',celleditor:true,autoLoad:false,modenum:'knowledge',
|
||||
columns:[{
|
||||
text:'标题',dataIndex:'title',editor:false,align:'left'
|
||||
},{
|
||||
text:'分类',dataIndex:'typename'
|
||||
},{
|
||||
text:'添加时间',dataIndex:'adddt',sortable:true
|
||||
},{
|
||||
text:'操作时间',dataIndex:'optdt',sortable:true
|
||||
},{
|
||||
text:'操作人',dataIndex:'optname',sortable:true
|
||||
},{
|
||||
text:'排序',dataIndex:'sort',sortable:true
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
},{
|
||||
text:'',dataIndex:'opt',renderer:function(v,d,oi){
|
||||
return '<a href="javascript:;" onclick="openxiangs(\'知识\',\'knowledge\','+d.id+')">查看</a>';
|
||||
}
|
||||
}],
|
||||
itemdblclick:function(d){
|
||||
openxiangs(d.title,'knowledge', d.id);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var c = {
|
||||
reload:function(){
|
||||
at.reload();
|
||||
},
|
||||
loadfile:function(spd,nsd){
|
||||
$('#megss{rand}').html(nsd);
|
||||
a.setparams({'typeid':spd}, true);
|
||||
},
|
||||
genmu:function(){
|
||||
typeid = sspid;
|
||||
at.changedata={};
|
||||
this.loadfile('0','所有知识');
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown();
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
$('#optionview_{rand}').css('height',''+(viewheight-70)+'px');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr valign="top">
|
||||
<td width="220">
|
||||
<div style="border:1px #cccccc solid">
|
||||
<div id="optionview_{rand}" style="height:400px;overflow:auto;"></div>
|
||||
<div class="panel-footer">
|
||||
<a href="javascript:" click="reload" onclick="return false"><i class="icon-refresh"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td width="10" nowrap><div style="width:10px"> </div></td>
|
||||
<td>
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td align="left" nowrap>
|
||||
<button class="btn btn-default" click="genmu" type="button">所有知识</button>
|
||||
|
||||
</td>
|
||||
|
||||
<td style="padding-left:10px">
|
||||
<input class="form-control" style="width:180px" id="key_{rand}" placeholder="标题/分类">
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
<td width="90%">
|
||||
<span id="megss{rand}"></span>
|
||||
</td>
|
||||
<td align="right">
|
||||
<button class="btn btn-default" click="daochu" type="button">导出</button>
|
||||
</td>
|
||||
</tr></table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
93
webmain/system/menu/menuAction.php
Normal file
93
webmain/system/menu/menuAction.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
class menuClassAction extends Action
|
||||
{
|
||||
|
||||
public function dataAjax()
|
||||
{
|
||||
$this->rows = array();
|
||||
$type = $this->get('type');
|
||||
$loadci = (int)$this->get('loadci');
|
||||
$pid = (int)$this->get('pid','0');
|
||||
$where = '';
|
||||
//权限那来的
|
||||
if($type != ''){
|
||||
$where = 'and `status`=1 and `ispir`=1 and `type`=0';
|
||||
if($type=='view')$where = 'and `status`=1 and `type`=0';
|
||||
}else{
|
||||
$this->updatepirss();
|
||||
}
|
||||
if($pid>0){
|
||||
$where.=' and (`id`='.$pid.' or `pid`='.$pid.' or `pid` in(select `id` from `[Q]menu` where `pid`='.$pid.'))';
|
||||
}
|
||||
$this->alldata = $this->db->getall('select *,(select count(1)from `[Q]menu` where `pid`=a.id '.$where.')stotal from `[Q]menu` a where 1=1 '.$where.' order by `sort`');
|
||||
|
||||
$this->getmenu(0, 1, 1);
|
||||
|
||||
$pdata = array();
|
||||
if($loadci==1){
|
||||
foreach($this->alldata as $k=>$rs){
|
||||
if($rs['pid']=='0')$pdata[] = array('name'=>$rs['name'],'id'=>$rs['id']);
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode(array(
|
||||
'totalCount'=> 0,
|
||||
'pdata' => $pdata,
|
||||
'rows' => $this->rows
|
||||
));
|
||||
}
|
||||
|
||||
private function getmenu($pid, $oi, $zt)
|
||||
{
|
||||
$downid = '';
|
||||
foreach($this->alldata as $k=>$rs){
|
||||
if($pid==$rs['pid']){
|
||||
$downid.=','.$rs['id'].'';
|
||||
$rs['level'] = $oi;
|
||||
$zthui = $rs['status'];
|
||||
if($zt==0){
|
||||
$rs['ishui']=1;
|
||||
$zthui = 0;
|
||||
}
|
||||
//if($oi>1)$rs['trstyle']='display:none;';
|
||||
$this->rows[] = $rs;
|
||||
$len = count($this->rows)-1;
|
||||
$sidss = $this->getmenu($rs['id'], $oi+1, $zthui);
|
||||
//if($sidss)$this->rows[$len]['downallid'] = substr($sidss,1);
|
||||
}
|
||||
}
|
||||
return $downid;
|
||||
}
|
||||
|
||||
//下级需要验证,那上级也必须验证的
|
||||
private function updatepirss()
|
||||
{
|
||||
$rows = $this->db->getall('select `pid` from `[Q]menu` where `pid`>0 and `ispir`=1 group by `pid`');
|
||||
$sid = '0';
|
||||
foreach($rows as $k=>$rs)$sid.=','.$rs['pid'].'';
|
||||
if($sid!='')m('menu')->update('`ispir`=1', "`id` in($sid)");
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单管理获取菜单
|
||||
*/
|
||||
public function getdataAjax()
|
||||
{
|
||||
$pvalue = (int)$this->get('pvalue','0');
|
||||
$level = (int)$this->get('level','1');
|
||||
$rows = $this->db->getall('select *,(select count(1)from `[Q]menu` where `pid`=a.id )stotal from `[Q]menu` a where `pid`='.$pvalue.' order by `sort`');
|
||||
foreach($rows as $k=>$rs)$rows[$k]['level'] = $level;
|
||||
echo json_encode(array(
|
||||
'totalCount'=> 0,
|
||||
'rows' => $rows
|
||||
));
|
||||
}
|
||||
|
||||
public function delmenuAjax()
|
||||
{
|
||||
$id = (int)$this->post('id');
|
||||
if(m('menu')->rows('pid='.$id.'')>0)return returnerror('有下级菜单不能删除');
|
||||
m('menu')->delete($id);
|
||||
return returnsuccess();
|
||||
}
|
||||
}
|
||||
149
webmain/system/menu/rock_menu.php
Normal file
149
webmain/system/menu/rock_menu.php
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var a = $('#menu_{rand}').bootstable({
|
||||
tablename:'menu',url:js.getajaxurl('data','{mode}','{dir}'),method:'get',loadtree:false,
|
||||
tree:true,celleditor:!ISDEMO,bodyStyle:'height:'+(viewheight-70)+'px;overflow:auto',
|
||||
columns:[{
|
||||
text:'菜单名称',dataIndex:'name',align:'left',editor:true,renderstyle:function(v,d){
|
||||
return 'min-width:220px';
|
||||
}
|
||||
},{
|
||||
text:'编号',dataIndex:'num' ,editor:true,renderstyle:function(v,d){
|
||||
return 'width:70px';
|
||||
}
|
||||
},{
|
||||
text:'URL',dataIndex:'url',editor:true,repEmpty:true,renderstyle:function(v,d){
|
||||
return 'word-wrap:break-word;word-break:break-all;white-space:normal;width:180px';
|
||||
}
|
||||
},{
|
||||
text:'PID',dataIndex:'pid',editor:true
|
||||
},{
|
||||
text:'图标',dataIndex:'icons',editor:true,renderstyle:function(v,d){
|
||||
return 'width:70px';
|
||||
}
|
||||
},{
|
||||
text:'启用',dataIndex:'status',type:'checkbox',editor:true
|
||||
},{
|
||||
text:'验证',dataIndex:'ispir',type:'checkbox',editor:true
|
||||
},{
|
||||
text:'显首',dataIndex:'ishs',type:'checkbox',editor:true
|
||||
},{
|
||||
text:'排序',dataIndex:'sort' ,editor:true
|
||||
},{
|
||||
text:'颜色',dataIndex:'color',editor:true
|
||||
},{
|
||||
text:'级别',dataIndex:'type',editor:true,renderer:function(v){
|
||||
var s=' ';
|
||||
if(v==1)s='系统';
|
||||
return s;
|
||||
},type:'select',store:[['0','普通'],['1','系统']]
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
},
|
||||
load:function(d){
|
||||
if(d.pdata && d.pdata.length>0){
|
||||
var o1 = get('soupid_{rand}');
|
||||
js.setselectdata(o1,d.pdata,'id');
|
||||
$(o1).change(c.changed);
|
||||
}
|
||||
}
|
||||
});
|
||||
function btn(bo){
|
||||
get('del_{rand}').disabled = bo;
|
||||
get('edit_{rand}').disabled = bo;
|
||||
get('down_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
var c = {
|
||||
changed:function(){
|
||||
a.setparams({pid:this.value},true);
|
||||
},
|
||||
del:function(){
|
||||
a.del({url:js.getajaxurl('delmenu','{mode}','{dir}')});
|
||||
},
|
||||
reload:function(){
|
||||
a.reload();
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
if(ISDEMO){js.msg('success','演示站点禁止操作');return;}
|
||||
var h = $.bootsform({
|
||||
title:'菜单',height:500,width:400,
|
||||
tablename:'menu',isedit:lx,
|
||||
params:{int_filestype:'ispir,status,sort,pid,ishs'},
|
||||
submitfields:'num,name,url,icons,ispir,status,sort,pid,ishs,color',
|
||||
items:[{
|
||||
labelText:'编号',name:'num',repEmpty:true
|
||||
},{
|
||||
labelText:'菜单名称',name:'name',required:true
|
||||
},{
|
||||
labelText:'URL地址',name:'url',repEmpty:true
|
||||
},{
|
||||
labelText:'图标',name:'icons',repEmpty:true
|
||||
},{
|
||||
labelText:'上级ID',name:'pid',required:true,value:'0',type:'number'
|
||||
},{
|
||||
name:'status',labelBox:'启用',type:'checkbox',checked:true
|
||||
},{
|
||||
name:'ispir',labelBox:'验证(未√就是任何人可使用菜单)',type:'checkbox',checked:true
|
||||
},{
|
||||
name:'ishs',labelBox:'显示在首页',type:'checkbox'
|
||||
},{
|
||||
labelText:'颜色',name:'color',repEmpty:true
|
||||
},{
|
||||
labelText:'序号',name:'sort',type:'number',value:'0'
|
||||
}],
|
||||
success:function(){
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
if(lx==1)h.setValues(a.changedata);
|
||||
h.getField('name').focus();
|
||||
if(lx==2)h.setValue('pid', a.changedata.id);
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增顶级</button>
|
||||
<button class="btn btn-success" click="clickwin,2" id="down_{rand}" disabled type="button"><i class="icon-plus"></i> 新增下级</button>
|
||||
<button class="btn btn-default" click="reload" type="button">刷新</button>
|
||||
</td>
|
||||
|
||||
<td style="padding-left:10px">
|
||||
<select class="form-control" style="width:150px" id="soupid_{rand}" >
|
||||
<option value="0">-所有的菜单-</option>
|
||||
</select>
|
||||
<!--
|
||||
<div class="input-group" style="width:100px">
|
||||
<input class="form-control" id="key_{rand}" placeholder="pid">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="search" type="button"><i class="icon-search"></i></button>
|
||||
</span>
|
||||
</div>-->
|
||||
</td>
|
||||
|
||||
<td width="80%"></td>
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="menu_{rand}"></div>
|
||||
86
webmain/system/option/optionAction.php
Normal file
86
webmain/system/option/optionAction.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
class optionClassAction extends Action
|
||||
{
|
||||
public function getlistAjax()
|
||||
{
|
||||
$num = $this->request('num');
|
||||
$name = $this->request('name');
|
||||
$key = $this->post('key');
|
||||
$id = $this->option->getnumtoid($num, $name, false);
|
||||
$this->option->update("`pid`=1,`name`='行政选项'","`num`='goods'"); //行政选项移动到数据选项下
|
||||
if(isempt($key)){
|
||||
$where = "a.`pid`='$id'";
|
||||
}else{
|
||||
$where = "1=1 and a.`name` is not null and (a.`name` like '%$key%' or a.`num`='$key') ";
|
||||
}
|
||||
|
||||
$rows = $this->db->getall("select *,(select count(1) from `[Q]option` where pid=a.id)as stotal from `[Q]option` a where $where order by a.`sort`, a.`id`");
|
||||
echo json_encode(array(
|
||||
'totalCount'=> $this->db->count,
|
||||
'rows' => $rows,
|
||||
'pid' => $id
|
||||
));
|
||||
}
|
||||
|
||||
public function getfileAjax()
|
||||
{
|
||||
$mtype = $this->request('mtype');
|
||||
$mid = $this->request('mid');
|
||||
$rows = m('file')->getfile($mtype, $mid);
|
||||
echo json_encode($rows);
|
||||
}
|
||||
|
||||
public function gettreedataAjax()
|
||||
{
|
||||
$num = $this->get('num');
|
||||
if($num=='')exit('error;');
|
||||
if(!contain($num, 'gerenvcard_') && ISMORECOM && $cnum=m('admin')->getcompanynum())$num.='_'.$cnum.'';//多单位时个人通讯不用加单位编号
|
||||
$pid = $this->option->getnumtoid($num,''.$num.'选项', false);
|
||||
$rows = $this->option->gettreedata($pid);
|
||||
$rows = array(
|
||||
'rows' => $rows,
|
||||
'pid' => $pid
|
||||
);
|
||||
$this->returnjson($rows);
|
||||
}
|
||||
|
||||
public function deloptionAjax()
|
||||
{
|
||||
$id = (int)$this->post('id','0');
|
||||
$stable = $this->post('stable');
|
||||
$delbo = true;
|
||||
if($delbo)if($this->option->rows("`pid`='$id'")>0)$delbo=false;
|
||||
if(!$delbo)$this->showreturn('','有下级分类不允许删除',201);
|
||||
$this->option->delete($id);
|
||||
if($stable!='')m($stable)->update('`typeid`=0', "`typeid`='$id'");
|
||||
$this->showreturn();
|
||||
}
|
||||
|
||||
//分类移动
|
||||
public function movetypeAjax()
|
||||
{
|
||||
$id = (int)$this->post('id','0');
|
||||
$toid = (int)$this->post('toid','0');
|
||||
$lx = (int)$this->post('lx','0');
|
||||
$spath = $this->db->getpval('[Q]option','pid','pid', $toid,'],[');
|
||||
$spath = '['.$spath.']';
|
||||
if(contain($spath,'['.$id.']')){
|
||||
echo '不能移动到自己的下级';
|
||||
}else{
|
||||
$this->option->update('pid='.$toid.'', $id);
|
||||
echo 'ok';
|
||||
}
|
||||
}
|
||||
|
||||
public function downshuafter($table, $rows)
|
||||
{
|
||||
$db = m($table);
|
||||
foreach($rows as $k=>$rs){
|
||||
$dcount = $db->rows('pid='.$rs['id'].'');
|
||||
if($dcount>0)$rows[$k]['dcount'] = $dcount;
|
||||
}
|
||||
return array(
|
||||
'rows' => $rows
|
||||
);
|
||||
}
|
||||
}
|
||||
216
webmain/system/option/rock_option.php
Normal file
216
webmain/system/option/rock_option.php
Normal file
@@ -0,0 +1,216 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params};
|
||||
var num = params.num,pid,optlx=0,dpid=0,nowid=0;
|
||||
|
||||
var at = $('#optionview_{rand}').bootstable({
|
||||
tablename:'option',celleditor:true,sort:'sort',dir:'asc',url:js.getajaxurl('getlist', 'option', 'system'),
|
||||
params:{num:num,name:nowtabs.name},
|
||||
columns:[{
|
||||
text:'名称',dataIndex:'name',align:'left'
|
||||
},{
|
||||
text:'编号',dataIndex:'num'
|
||||
},{
|
||||
text:'序号',dataIndex:'sort',editor:true,sortable:true
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
}],
|
||||
itemclick:function(ad,oi,e){
|
||||
//c.showmenu(ad,e);
|
||||
},
|
||||
itemdblclick:function(ad,oi,e){
|
||||
c.zhankai(ad);
|
||||
},
|
||||
load:function(ad){
|
||||
pid = ad.pid;
|
||||
if(dpid==0)dpid=pid;
|
||||
}
|
||||
});
|
||||
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'option',celleditor:true,sort:'sort',dir:'asc',modedir:'{mode}:{dir}',storeafteraction:'downshuafter',
|
||||
autoLoad:false,where:'and pid=-1',bodyStyle:'height:'+(viewheight-72)+'px;overflow:auto',
|
||||
columns:[{
|
||||
text:'名称',dataIndex:'name',sortable:true,editor:true
|
||||
},{
|
||||
text:'对应值',dataIndex:'value',editor:true,sortable:true
|
||||
},{
|
||||
text:'编号',dataIndex:'num',editor:true
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort',editor:true,sortable:true
|
||||
},{
|
||||
text:'下级数',dataIndex:'dcount'
|
||||
},{
|
||||
text:'启用',dataIndex:'valid',type:'checkbox',editor:true
|
||||
},{
|
||||
text:'说明',dataIndex:'explain',type:'textarea',editor:true,align:'left'
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
},{
|
||||
text:'',dataIndex:'optd',renderer:function(v,d,oi){
|
||||
var s = ' ';
|
||||
s='<a href="javascript:;" onclick="zhankai{rand}('+oi+')">展开</a>';
|
||||
return s;
|
||||
}
|
||||
}],
|
||||
load:function(){
|
||||
get('add_{rand}').disabled=false;
|
||||
get('del_{rand}').disabled=true;
|
||||
},
|
||||
itemclick:function(){
|
||||
get('del_{rand}').disabled=false;
|
||||
},
|
||||
beforeload:function(){
|
||||
get('del_{rand}').disabled=true;
|
||||
}
|
||||
});
|
||||
zhankai{rand}=function(oi){
|
||||
var d=a.getData(oi);
|
||||
c.zhankai(d);
|
||||
}
|
||||
var c = {
|
||||
zhankai:function(ad){
|
||||
$('#downshow_{rand}').html('<b>['+ad.id+'.'+ad.name+']</b>的下级选项');
|
||||
nowid = ad.id;
|
||||
a.search("and `pid`="+ad.id+"");
|
||||
},
|
||||
search:function(){
|
||||
var s = get('key_{rand}').value;
|
||||
at.setparams({key:s},true);
|
||||
},
|
||||
showmenu:function(d,e){
|
||||
if(!this.menuobj)this.menuobj = $.rockmenu({data:[],width:150,itemsclick:function(d){
|
||||
c.cliemmenus(d);
|
||||
}});
|
||||
this.optdata = d;
|
||||
var da = [{name:'打开选项',lx:0},{name:'编辑',lx:3}];
|
||||
if(d.stotal>0)da.push({name:'管理下级',lx:1});
|
||||
if(d.pid!=dpid)da.push({name:'↑回到上级',lx:2});
|
||||
this.menuobj.setData(da);
|
||||
setTimeout(function(){c.menuobj.showAt(e.clientX,e.clientY);},0);
|
||||
},
|
||||
|
||||
cliemmenus:function(d){
|
||||
var ad = this.optdata;
|
||||
if(d.lx==0){
|
||||
$('#downshow_{rand}').html('<b>['+ad.id+'.'+ad.name+']</b>的下级选项');
|
||||
a.search("and `pid`="+ad.id+"");
|
||||
}
|
||||
if(d.lx==1){
|
||||
c.xiajili();
|
||||
}
|
||||
if(d.lx==2){
|
||||
this.showdwon(num);
|
||||
}
|
||||
if(d.lx==3){
|
||||
this.clicktypeeidt();
|
||||
}
|
||||
},
|
||||
reload:function(){
|
||||
at.reload();
|
||||
},
|
||||
xiajili:function(){
|
||||
if(at.changeid==0)return;
|
||||
var bh = at.changedata.num;
|
||||
this.showdwon(bh);
|
||||
},
|
||||
showdwon:function(bh){
|
||||
if(isempt(bh))return;
|
||||
at.setparams({num:bh},true);
|
||||
},
|
||||
dingji:function(bh){
|
||||
this.showdwon(num);
|
||||
},
|
||||
clickwin:function(o, lx){
|
||||
var a = this.clicktypewin(false, 0);
|
||||
optlx = 1;
|
||||
a.setValue('pid', nowid);
|
||||
},
|
||||
clicktypeeidt:function(){
|
||||
var d = at.changedata;
|
||||
if(d.id)c.clicktypewin(false, 1, d);
|
||||
},
|
||||
clicktypewin:function(o1, lx, da){
|
||||
var h = $.bootsform({
|
||||
title:'选项',height:250,width:300,
|
||||
tablename:'option',labelWidth:50,
|
||||
isedit:lx,
|
||||
submitfields:'num,name,sort,pid',cancelbtn:false,
|
||||
items:[{
|
||||
labelText:'名称',name:'name',required:true
|
||||
},{
|
||||
labelText:'上级id',name:'pid',value:0,type:'hidden'
|
||||
},{
|
||||
labelText:'编号',name:'num'
|
||||
},{
|
||||
labelText:'排序号',name:'sort',type:'number',value:0
|
||||
}],
|
||||
success:function(){
|
||||
if(optlx==0)at.reload();
|
||||
if(optlx==1)a.reload();
|
||||
}
|
||||
});
|
||||
if(lx==1)h.setValues(da);
|
||||
if(lx==0)h.setValue('pid', pid);
|
||||
optlx = 0;
|
||||
return h;
|
||||
},
|
||||
typedel:function(o1){
|
||||
at.del({url:js.getajaxurl('deloption','option','system')});
|
||||
},
|
||||
del:function(){
|
||||
a.del({url:js.getajaxurl('deloption','option','system')});
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
$('#optionview_{rand}').css('height',''+(viewheight-142)+'px');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr valign="top">
|
||||
<td width="350">
|
||||
<div class="panel panel-info" style="margin:0px">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">选项列表(双击展开)</h3>
|
||||
</div>
|
||||
<div>
|
||||
<div class="input-group" style="width:200px">
|
||||
<input class="form-control" id="key_{rand}" placeholder="选项名称/编号">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="search" type="button"><i class="icon-search"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="optionview_{rand}" style="height:400px;overflow:auto"></div>
|
||||
<div class="panel-footer">
|
||||
<a href="javascript:" click="clicktypewin,0" onclick="return false"><i class="icon-plus"></i></a>
|
||||
<a href="javascript:" click="clicktypeeidt" onclick="return false"><i class="icon-edit"></i></a>
|
||||
<a href="javascript:" click="reload" onclick="return false"><i class="icon-refresh"></i></a>
|
||||
|
||||
<a href="javascript:" click="xiajili" onclick="return false">[管理下级]</a>
|
||||
<a href="javascript:" click="dingji" onclick="return false">[回到顶级]</a>
|
||||
<a href="javascript:" style="float:right" click="typedel" onclick="return false"><i class="icon-trash"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td width="10"></td>
|
||||
<td>
|
||||
<div>
|
||||
<ul class="floats">
|
||||
<li class="floats70">
|
||||
<button class="btn btn-primary" click="clickwin,0" disabled id="add_{rand}" type="button"><i class="icon-plus"></i> 新增对应下级</button>
|
||||
<span id="downshow_{rand}">双击左边选项列表行打开选项</span>
|
||||
</li>
|
||||
<li class="floats30" style="text-align:right">
|
||||
<button class="btn btn-danger" id="del_{rand}" disabled click="del" type="button"><i class="icon-trash"></i> 删除</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
175
webmain/system/reimplat/reimplatAction.php
Normal file
175
webmain/system/reimplat/reimplatAction.php
Normal file
@@ -0,0 +1,175 @@
|
||||
<?php
|
||||
class reimplatClassAction extends Action
|
||||
{
|
||||
|
||||
public function setsaveAjax()
|
||||
{
|
||||
$this->option->setval('reimplat_purl@-7', $this->post('purl'));
|
||||
$this->option->setval('reimplat_cnum@-7', $this->post('cnum'));
|
||||
$this->option->setval('reimplat_secret@-7', $this->post('secret'));
|
||||
$this->option->setval('reimplat_devnum@-7', $this->post('devnum'));
|
||||
$this->option->setval('reimplat_huitoken@-7', $this->post('huitoken'));
|
||||
return 'ok';
|
||||
}
|
||||
|
||||
public function getsetAjax()
|
||||
{
|
||||
$arr= array();
|
||||
$arr['purl'] = $this->option->getval('reimplat_purl');
|
||||
$arr['cnum'] = $this->option->getval('reimplat_cnum');
|
||||
$arr['secret'] = $this->option->getval('reimplat_secret');
|
||||
$arr['devnum'] = $this->option->getval('reimplat_devnum');
|
||||
$arr['huitoken'] = $this->option->getval('reimplat_huitoken');
|
||||
$arr['huiurl'] = ''.URL.'api.php?m=reimplat';
|
||||
if(COMPANYNUM)$arr['huiurl'].='&dwnum='.COMPANYNUM.'';
|
||||
echo json_encode($arr);
|
||||
}
|
||||
|
||||
//获取信呼系统上部门
|
||||
public function deptdataAjax()
|
||||
{
|
||||
$this->rows = array();
|
||||
$this->getdept(0, 1);
|
||||
|
||||
$this->returnjson(array(
|
||||
'totalCount'=> 0,
|
||||
'rows' => $this->rows
|
||||
));
|
||||
}
|
||||
private function getdept($pid, $oi)
|
||||
{
|
||||
$db = m('dept');
|
||||
$menu = $db->getall("`pid`='$pid' order by `sort`",'*');
|
||||
foreach($menu as $k=>$rs){
|
||||
$sid = $rs['id'];
|
||||
|
||||
$rs['level'] = $oi;
|
||||
$rs['stotal'] = $db->rows("`pid`='$sid'");
|
||||
|
||||
$rs['zt'] = 1;
|
||||
$this->rows[] = $rs;
|
||||
$this->getdept($rs['id'], $oi+1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function deptwxdataAjax()
|
||||
{
|
||||
$barr = m('reimplat:dept')->getdeptlist();
|
||||
if(!$barr['success'])return $barr;
|
||||
$rows = $barr['data'];
|
||||
|
||||
$this->returnjson(array(
|
||||
'totalCount'=> 0,
|
||||
'rows' => $rows
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
||||
//微信上用户操作
|
||||
public function beforeusershow($table)
|
||||
{
|
||||
$fields = 'id,name,`user`,deptname,status,tel,ranking,superman,loginci,deptid,sex,mobile,email,sort,face';
|
||||
$fields.=',deptids,deptnames';
|
||||
$s = '';
|
||||
$key = $this->post('key');
|
||||
if($key!=''){
|
||||
$s = " and (`name` like '%$key%' or `user` like '%$key%' or `ranking` like '%$key%' or `deptname` like '%$key%' ";
|
||||
$s.=" or `deptnames` like '%$key%'";
|
||||
$s.= ')';
|
||||
}
|
||||
|
||||
return array(
|
||||
'fields'=> $fields,
|
||||
'where' => $s
|
||||
);
|
||||
}
|
||||
|
||||
private function isgcstr($urs, $purs)
|
||||
{
|
||||
if(!$urs || !$purs)array(0,'');
|
||||
|
||||
$isgc = 0;
|
||||
$isgcstr = '';
|
||||
if($urs['mobile']!=$purs['mobile']){$isgc = 1;$isgcstr = '手机号';}
|
||||
if($urs['deptid']!=$purs['deptid']){$isgc = 1;$isgcstr = '部门';}
|
||||
if($urs['ranking']!=$purs['position']){$isgc = 1;$isgcstr = '职位';}
|
||||
if($urs['name']!=$purs['name']){$isgc = 1;$isgcstr = '姓名';}
|
||||
if($urs['email']!=$purs['email']){$isgc = 1;$isgcstr = '邮箱';}
|
||||
if($urs['tel']!=$purs['tel']){$isgc = 1;$isgcstr = '办公电话';}
|
||||
|
||||
return array($isgc, $isgcstr);
|
||||
}
|
||||
|
||||
public function afterusershow($table, $rows)
|
||||
{
|
||||
$obj = m('reimplat:dept');
|
||||
foreach($rows as $k=>$rs){
|
||||
$iscj = 0;
|
||||
$yurs = $obj->getuinfo($rs['user']);
|
||||
if($yurs){
|
||||
$iscj = 1;
|
||||
$rows[$k]['isgz'] = $yurs['status'];
|
||||
$nars = $this->isgcstr($rs, $yurs);
|
||||
$rows[$k]['isgc'] = $nars[0];
|
||||
$rows[$k]['isgcstr'] = $nars[1];
|
||||
}
|
||||
$rows[$k]['iscj'] = $iscj;
|
||||
$rows[$k]['yurs'] = $yurs;
|
||||
$rows[$k]['mobile'] = substr($rs['mobile'],0,3).'****'.substr($rs['mobile'],-4);
|
||||
}
|
||||
$noarr = $obj->notinadmin();
|
||||
return array('rows'=>$rows,'notstr'=>join(',', $noarr));
|
||||
}
|
||||
|
||||
public function reloaduserAjax()
|
||||
{
|
||||
return m('reimplat:dept')->getuserlist();
|
||||
}
|
||||
|
||||
public function delalluserAjax()
|
||||
{
|
||||
return m('reimplat:dept')->deleteuserall();
|
||||
}
|
||||
|
||||
public function updateuserAjax()
|
||||
{
|
||||
$id = (int)$this->get('id','0');
|
||||
$urs = m('admin')->getone($id,'`user`,`name`,`ranking`,`superman`,`isvcard`,`tel`,`mobile`,`email`,`deptid`,`deptname`,`sex`,`sort`,`pingyin`');
|
||||
$barr = m('reimplat:dept')->userupdate($urs);
|
||||
return $barr;
|
||||
}
|
||||
|
||||
public function updatealldeptAjax()
|
||||
{
|
||||
$barr = m('reimplat:dept')->deptallupdate();
|
||||
return $barr;
|
||||
}
|
||||
|
||||
public function agentdataAjax()
|
||||
{
|
||||
$barr =m('reimplat:agent')->listdata();
|
||||
$rows = array();
|
||||
if($barr['success'])$rows = $barr['data'];
|
||||
|
||||
$this->returnjson(array(
|
||||
'totalCount'=> 0,
|
||||
'rows' => $rows
|
||||
));
|
||||
}
|
||||
|
||||
public function sendmsgAjax()
|
||||
{
|
||||
$name = $this->post('name');
|
||||
$msg = $this->post('msg');
|
||||
return m('reimplat:agent')->sendxiao($this->adminid, $name, $msg);
|
||||
}
|
||||
|
||||
public function senduserAjax()
|
||||
{
|
||||
$id = (int)$this->post('id');
|
||||
$msg = $this->post('msg');
|
||||
return m('reimplat:agent')->sendxiao($id, '', $msg);
|
||||
}
|
||||
}
|
||||
108
webmain/system/reimplat/rock_reimplat_cog.php
Normal file
108
webmain/system/reimplat/rock_reimplat_cog.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var c={
|
||||
init:function(){
|
||||
$.get(js.getajaxurl('getset','{mode}','{dir}'), function(s){
|
||||
var a=js.decode(s);
|
||||
get('reimplatpurl_{rand}').value=a.purl;
|
||||
get('reimplatcnum_{rand}').value=a.cnum;
|
||||
get('reimplatsecret_{rand}').value=a.secret;
|
||||
get('reimplatdevnum_{rand}').value=a.devnum;
|
||||
get('reimplathuitoken_{rand}').value=a.huitoken;
|
||||
get('reimplathuiurl_{rand}').value=a.huiurl;
|
||||
|
||||
});
|
||||
},
|
||||
save:function(o){
|
||||
var d={};
|
||||
d.purl = get('reimplatpurl_{rand}').value;
|
||||
d.cnum = get('reimplatcnum_{rand}').value;
|
||||
d.secret = get('reimplatsecret_{rand}').value;
|
||||
d.devnum = get('reimplatdevnum_{rand}').value;
|
||||
d.huitoken = get('reimplathuitoken_{rand}').value;
|
||||
js.msg('wait','保存中...');
|
||||
js.ajax(js.getajaxurl('setsave','{mode}','{dir}'), d, function(s){
|
||||
if(s!='ok'){
|
||||
js.msg('msg',s);
|
||||
}else{
|
||||
js.msg('success','保存成功');
|
||||
}
|
||||
},'post');
|
||||
},
|
||||
cleareshe:function(){
|
||||
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
c.init();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<div align="left">
|
||||
<div style="padding:10px;">
|
||||
|
||||
|
||||
|
||||
<table cellspacing="0" width="600" border="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td align="right"><font color=red>*</font> 平台地址:</td>
|
||||
<td class="tdinput"><input onblur="this.value=strreplace(this.value)" id="reimplatpurl_{rand}" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"><font color=red>*</font> 单位编号:</td>
|
||||
<td class="tdinput"><input onblur="this.value=strreplace(this.value)" id="reimplatcnum_{rand}" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" width="190"><font color=red>*</font> 单位secret:</td>
|
||||
<td class="tdinput">
|
||||
<textarea id="reimplatsecret_{rand}" placeholder="设置了不要暴露给他人,防止企业信息泄漏" onblur="this.value=strreplace(this.value)" style="height:60px" class="form-control"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right">默认推送应用编号:</td>
|
||||
<td class="tdinput"><input placeholder="如不设置默认第一个应用" onblur="this.value=strreplace(this.value)" id="reimplatdevnum_{rand}" class="form-control"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"></td>
|
||||
<td ><div class="tishi">这个是对接<a href="<?=URLY?>view_rockreim.html" target="_blank">REIM即时通讯平台</a>的,请到对应单位下获取</a></div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><div class="inputtitle">回调Token设置(没有回调就不需要设置)</div></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right">回调URL:</td>
|
||||
<td class="tdinput"><input onfocus="this.select()" id="reimplathuiurl_{rand}" readonly class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">回调密钥:</td>
|
||||
<td class="tdinput"><input id="reimplathuitoken_{rand}" onblur="this.value=strreplace(this.value)" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right"></td>
|
||||
<td style="padding:15px 0px" colspan="3" align="left"><button click="save" class="btn btn-success" type="button"><i class="icon-save"></i> 保存</button>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
82
webmain/system/reimplat/rock_reimplat_dept.php
Normal file
82
webmain/system/reimplat/rock_reimplat_dept.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var a = $('#view1_{rand}').bootstable({
|
||||
url:js.getajaxurl('deptwxdata','{mode}','{dir}'),
|
||||
tree:true,celleditor:true,tablename:'dept',
|
||||
columns:[{
|
||||
text:'名称',dataIndex:'name',align:'left'
|
||||
},{
|
||||
text:'上级id',dataIndex:'pid'
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort'
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
}]
|
||||
});
|
||||
|
||||
var b = $('#view2_{rand}').bootstable({
|
||||
url:js.getajaxurl('deptdata','{mode}','{dir}'),
|
||||
tree:true,
|
||||
columns:[{
|
||||
text:'名称',dataIndex:'name',align:'left'
|
||||
},{
|
||||
text:'上级id',dataIndex:'pid'
|
||||
},{
|
||||
text:'负责人',dataIndex:'headman'
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort'
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
}]
|
||||
});
|
||||
var c = {
|
||||
relad:function(){
|
||||
a.reload();
|
||||
b.reload();
|
||||
},
|
||||
anaytodept:function(){
|
||||
js.loading('更新中...');
|
||||
js.ajax(js.getajaxurl('updatealldept','{mode}', '{dir}'),false, function(ret){
|
||||
if(ret.success){
|
||||
js.msgok('更新成功');
|
||||
a.reload();
|
||||
}else{
|
||||
js.msgerror(ret.msg);
|
||||
}
|
||||
},'get,json');
|
||||
}
|
||||
}
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr valign="top">
|
||||
<td width="50%">
|
||||
<div>
|
||||
<button class="btn btn-default" click="relad,0" type="button">刷新</button>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading"><h3 class="panel-title">REIM即时通讯平台上组织结构</h3></div>
|
||||
<div id="view1_{rand}"></div>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td width="10"><div style="width:10px;overflow:hidden"></div></td>
|
||||
<td width="50%">
|
||||
<div>
|
||||
<button class="btn btn-default" click="anaytodept" type="button">系统上部门一键同步到REIM平台上</button>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-heading"><h3 class="panel-title">系统上组织结构</h3></div>
|
||||
|
||||
<div id="view2_{rand}"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
181
webmain/system/reimplat/rock_reimplat_user.php
Normal file
181
webmain/system/reimplat/rock_reimplat_user.php
Normal file
@@ -0,0 +1,181 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'admin',sort:'sort',dir:'asc',celleditor:false,fanye:true,checked:true,
|
||||
storebeforeaction:'beforeusershow',storeafteraction:'afterusershow',url:publicstore('{mode}','{dir}'),
|
||||
columns:[{
|
||||
text:'头像',dataIndex:'face',renderer:function(v){
|
||||
if(isempt(v))v='images/noface.png';
|
||||
return '<img src="'+v+'" height="24" width="24">';
|
||||
}
|
||||
},{
|
||||
text:'用户名',dataIndex:'user'
|
||||
},{
|
||||
text:'姓名',dataIndex:'name'
|
||||
},{
|
||||
text:'部门',dataIndex:'deptname'
|
||||
},{
|
||||
text:'多部门',dataIndex:'deptnames'
|
||||
},{
|
||||
text:'职位',dataIndex:'ranking'
|
||||
},{
|
||||
text:'启用',dataIndex:'status',type:'checkbox',sortable:true
|
||||
},{
|
||||
text:'性别',dataIndex:'sex'
|
||||
},{
|
||||
text:'平台状态',dataIndex:'zt',align:'left',renderer:function(v,d){
|
||||
var s='';
|
||||
if(d.iscj==1){
|
||||
s='<a href="javascript:;" onclick="upsse{rand}.upuser('+d.id+')">[更新]</a>';
|
||||
if(d.isgz==1)s+='<font color=green>已关注</font>';
|
||||
if(d.isgz==0)s+='未关注';
|
||||
if(d.isgz==2)s+='<font color=#888888>已禁用</font>';
|
||||
if(d.isgc>0)s+='<font color=red>需更新('+d.isgcstr+')</font>';
|
||||
}else{
|
||||
s='<a href="javascript:;" style="color:red" onclick="upsse{rand}.upuser('+d.id+')">[创建]</a>';
|
||||
}
|
||||
return s;
|
||||
}
|
||||
},{
|
||||
text:'手机号',dataIndex:'mobile'
|
||||
},{
|
||||
text:'邮箱',dataIndex:'email'
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort'
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
}],
|
||||
load:function(d){
|
||||
var s='';
|
||||
if(d.notstr!='')s='REIM即时通讯漂亮有系统有不存在的用户:<font color=red>'+d.notstr+'</font>,请点按钮删除';
|
||||
$('#showmsg{rand}').html(s);
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
},
|
||||
faxiaox:function(){
|
||||
|
||||
},
|
||||
getlist:function(){
|
||||
js.msg('wait','获取中...');
|
||||
js.ajax(js.getajaxurl('reloaduser','{mode}', '{dir}'),{}, function(d){
|
||||
if(d.success){
|
||||
js.msg('success', '获取成功');
|
||||
a.reload();
|
||||
}else{
|
||||
js.msg('msg', d.msg);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
delaluser:function(){
|
||||
js.confirm('确定要要一键删除不存在用户吗?',function(jg){
|
||||
if(jg=='yes')c.deleteusers();
|
||||
});
|
||||
},
|
||||
deleteusers:function(){
|
||||
js.loading('删除中...');
|
||||
js.ajax(js.getajaxurl('delalluser','{mode}', '{dir}'),false, function(ret){
|
||||
if(ret.success){
|
||||
js.msgok('删除成功');
|
||||
a.reload();
|
||||
}else{
|
||||
js.msgerror(ret.msg);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
upuser:function(id){
|
||||
js.loading('更新中...');
|
||||
js.ajax(js.getajaxurl('updateuser','{mode}', '{dir}'),{id:id}, function(ret){
|
||||
if(ret.success){
|
||||
js.msgok('更新成功');
|
||||
a.reload();
|
||||
}else{
|
||||
js.msgerror(ret.msg);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
updatess:function(){
|
||||
if(this.plbool)return;
|
||||
var d = a.getcheckdata();
|
||||
if(d.length<=0){
|
||||
js.msg('msg','请先用复选框选中行');
|
||||
return;
|
||||
}
|
||||
this.checkd = d;
|
||||
this.plliangsos(0);
|
||||
},
|
||||
plliangsos:function(oi){
|
||||
var len = this.checkd.length;
|
||||
if(!get('plchushumm'))js.loading('<span id="plchushumm"></span>');
|
||||
$('#plchushumm').html('更新中('+len+'/'+(oi+1)+')...');
|
||||
if(oi>=len){
|
||||
js.msgok('更新完成');
|
||||
a.reload();
|
||||
this.plbool=false;
|
||||
return;
|
||||
}
|
||||
var ds = this.checkd[oi];
|
||||
js.ajax(js.getajaxurl('updateuser','{mode}', '{dir}'),{id:ds.id}, function(ret){
|
||||
if(ret.success){
|
||||
c.plliangsos(oi+1);
|
||||
}else{
|
||||
c.plbool=false;
|
||||
$('#plchushumm').html('<font color=red>['+ds.name+']更新失败:'+ret.msg+'</font>');
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
faxiaox:function(){
|
||||
var d=a.changedata;
|
||||
if(!d.id){js.msg('msg','请先选中人');return;}
|
||||
js.prompt('向人员['+d.name+']发送消息','消息内容',function(lx,txt){
|
||||
if(lx=='yes'&&txt)c.sheniokx(d.id,txt)
|
||||
});
|
||||
},
|
||||
sheniokx:function(id,txt){
|
||||
js.loading('发送中...');
|
||||
js.ajax(js.getajaxurl('senduser','{mode}', '{dir}'),{id:id,msg:txt}, function(d){
|
||||
if(d.success){
|
||||
js.msgok('发送成功');
|
||||
}else{
|
||||
js.msgerror(d.msg);
|
||||
}
|
||||
},'post,json');
|
||||
}
|
||||
};
|
||||
|
||||
upsse{rand} = c;
|
||||
|
||||
js.initbtn(c);
|
||||
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td><button class="btn btn-default" click="updatess" type="button">更新用户</button></td>
|
||||
<td style="padding-left:10px"><button class="btn btn-default" click="getlist" type="button">获取REIM通信平台用户</button></td>
|
||||
|
||||
<td style="padding-left:10px">
|
||||
<div class="input-group" style="width:220px;">
|
||||
<input class="form-control" id="key_{rand}" placeholder="姓名/部门/职位/用户名">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="search" type="button"><i class="icon-search"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td width="90%" style="padding-left:10px"></td>
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-info" click="faxiaox" type="button">发消息</button>
|
||||
<button class="btn btn-danger" click="delaluser" type="button">删除REIM通信平台上系统不存在的用户</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div id="showmsg{rand}" class="tishi"></div>
|
||||
87
webmain/system/reimplat/rock_reimplat_ying.php
Normal file
87
webmain/system/reimplat/rock_reimplat_ying.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'dept',sort:'sort',dir:'asc',
|
||||
url:js.getajaxurl('agentdata','{mode}','{dir}'),
|
||||
columns:[{
|
||||
text:'应用Logo',dataIndex:'picurl',renderer:function(v){
|
||||
if(isempt(v))v='images/noface.png';
|
||||
return '<img src="'+v+'" height="30" width="30">';
|
||||
}
|
||||
},{
|
||||
text:'编号',dataIndex:'num'
|
||||
},{
|
||||
text:'名称',dataIndex:'name'
|
||||
},{
|
||||
text:'类型',dataIndex:'types'
|
||||
},{
|
||||
text:'状态',dataIndex:'status',renderer:function(v){
|
||||
if(v=='0')return '停用';
|
||||
if(v=='1')return '启用';
|
||||
if(v=='2')return '仅PC端';
|
||||
if(v=='3')return '仅手机端';
|
||||
}
|
||||
},{
|
||||
text:'应用地址',dataIndex:'url',align:'left',renderer:function(v,d){
|
||||
var str='';
|
||||
if(d.url)str='PC端:'+d.url+'<br>';
|
||||
if(d.murl)str+='手机端:'+d.murl+'';
|
||||
return str;
|
||||
}
|
||||
},{
|
||||
text:'直接打开',dataIndex:'iszy',sortable:true,type:'checkbox'
|
||||
},{
|
||||
text:'适用对象',dataIndex:'recename'
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
}
|
||||
});
|
||||
|
||||
function btn(bo){
|
||||
get('faxis_{rand}').disabled = bo;
|
||||
//get('del_{rand}').disabled = bo;
|
||||
//get('edit_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
var c = {
|
||||
reloads:function(){
|
||||
a.reload();
|
||||
},
|
||||
faxiaox:function(){
|
||||
var d=a.changedata;
|
||||
js.prompt('向应用['+d.name+']发送消息','消息内容,接收人是“<b>'+adminname+'</b>”',function(lx,txt){
|
||||
if(lx=='yes'&&txt)c.sheniokx(d.name,txt)
|
||||
});
|
||||
},
|
||||
sheniokx:function(na,txt){
|
||||
js.loading('发送中...');
|
||||
js.ajax(js.getajaxurl('sendmsg','{mode}', '{dir}'),{name:na,msg:txt}, function(d){
|
||||
if(d.success){
|
||||
js.msgok('发送成功');
|
||||
}else{
|
||||
js.msgerror(d.msg);
|
||||
}
|
||||
},'post,json');
|
||||
},
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-default" click="reloads,0" type="button">刷新</button>
|
||||
</td>
|
||||
<td width="90%" style="padding-left:10px">应用管理请到REIM即时通讯平台下操作</td>
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-info" click="faxiaox" disabled id="faxis_{rand}" type="button">发送消息</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
77
webmain/system/schedule/rock_schedule_calendar.php
Normal file
77
webmain/system/schedule/rock_schedule_calendar.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var month;
|
||||
|
||||
var c = {
|
||||
change:function(o1, lx){
|
||||
mobj.fanmonth(lx);
|
||||
},
|
||||
nowchange:function(){
|
||||
mobj.nowmonth();
|
||||
},
|
||||
plusadd:function(){
|
||||
openinput('日程','schedule','','wfhoew{rand}');
|
||||
},
|
||||
loadschedule:function(){
|
||||
$.get(js.getajaxurl('loadschedule','{mode}','{dir}', {month:month}), function(da){
|
||||
for(var d1 in da){
|
||||
var s='',s1,d=da[d1],i;
|
||||
for(i=0;i<d.length;i++){
|
||||
s+='<div onclick="openreng_{rand}('+d[i].id+')" style="height:20px;line-height20px;overflow:hidden;cursor:pointer">'+(i+1)+'.['+d[i].time.substr(11,5)+']'+d[i].title+'</div>';
|
||||
}
|
||||
$('#s'+d1+'_{rand}').html('<div style="border-top:1px #eeeeee solid;margin-top:3px;">'+s+'</div>');
|
||||
}
|
||||
},'json');
|
||||
},
|
||||
guanli:function(){
|
||||
addtabs({num:'guanlieschedule',url:'{dir},{mode},guan',name:'日程管理'});
|
||||
},
|
||||
ricdaibn:function(){
|
||||
addtabs({num:'scheduld',url:'flow,page,scheduld,atype=my',name:'日程待办'});
|
||||
}
|
||||
};
|
||||
wfhoew{rand}=function(){
|
||||
c.loadschedule();
|
||||
}
|
||||
openreng_{rand}=function(id1){
|
||||
openxiangs('日程','schedule', id1);
|
||||
}
|
||||
var mobj = $('#veiw_{rand}').rockcalendar({
|
||||
height:viewheight-80,
|
||||
changemonth:function(y, m){
|
||||
$('#nowmonth_{rand}').html(''+y+'年'+xy10(m)+'月');
|
||||
month = ''+y+'-'+xy10(m)+'';
|
||||
c.loadschedule();
|
||||
},
|
||||
renderer:function(dt, s, d){
|
||||
var v = s;
|
||||
v+='<div style="font-size:12px;" id="s'+dt+'_{rand}"></div>';
|
||||
return v;
|
||||
}
|
||||
});
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="left" width="30%">
|
||||
<button type="button" click="change,-1" class="btn btn-default"><i class="icon-caret-left"></i> 上个月</button>
|
||||
<button type="button" click="nowchange" class="btn btn-default"><i class="icon-calendar"></i> 当月</button>
|
||||
<button type="button" click="guanli" class="btn btn-default"><i class="icon-cog"></i> 管理</button>
|
||||
<button type="button" click="ricdaibn" class="btn btn-default">日程待办</button>
|
||||
</td>
|
||||
<td align="center" width="40%">
|
||||
<div id="nowmonth_{rand}" style="font-size:16px">2015年06月</div>
|
||||
</td>
|
||||
<td align="right" width="30%">
|
||||
<button type="button" click="plusadd" class="btn btn-success"><i class="icon-plus"></i> 新增记录</button>
|
||||
<button type="button" click="change,1" class="btn btn-default">下个月 <i class="icon-caret-right"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
111
webmain/system/schedule/rock_schedule_guan.php
Normal file
111
webmain/system/schedule/rock_schedule_guan.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'schedule',celleditor:false,fanye:true,modenum:'schedule',sort:'id',dir:'desc',modename:'日程',
|
||||
columns:[{
|
||||
text:'标题',dataIndex:'title',editor:true,align:'left'
|
||||
},{
|
||||
text:'时间',dataIndex:'startdt',sortable:true
|
||||
},{
|
||||
text:'截止时间',dataIndex:'enddt',sortable:true
|
||||
},{
|
||||
text:'重复',dataIndex:'rate'
|
||||
},{
|
||||
text:'是否提醒',dataIndex:'txsj'
|
||||
},{
|
||||
text:'提醒给',dataIndex:'recename'
|
||||
},{
|
||||
text:'添加人',dataIndex:'optname'
|
||||
},{
|
||||
text:'状态',dataIndex:'status',type:'checkbox',editor:true,sortable:true
|
||||
}],
|
||||
itemclick:function(d){
|
||||
btn(d.uid!=adminid);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
},
|
||||
itemdblclick:function(d){
|
||||
openxiangs(this.modename,this.modenum,d.id);
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del({check:function(lx){if(lx=='yes')btn(true)}});
|
||||
},
|
||||
refresh:function(){
|
||||
a.reload();
|
||||
},
|
||||
clickdt:function(o1){
|
||||
js.changedate(o1,'dt1_{rand}');
|
||||
},
|
||||
search:function(o1){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s,dt:get('dt1_{rand}').value},true);
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var id=0;
|
||||
if(lx==1)id=a.changeid;
|
||||
openinput('日程','schedule',id,'wfhoew{rand}');
|
||||
},
|
||||
changlx:function(o1,lx){
|
||||
$("button[id^='state{rand}']").removeClass('active');
|
||||
$('#state{rand}_'+lx+'').addClass('active');
|
||||
var as = ['my','rece'];
|
||||
a.setparams({'atype':as[lx]},true);
|
||||
}
|
||||
};
|
||||
wfhoew{rand}=function(){
|
||||
c.refresh();
|
||||
}
|
||||
function btn(bo){
|
||||
get('del_{rand}').disabled = bo;
|
||||
get('edit_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
</td>
|
||||
|
||||
<td style="padding-left:10px">
|
||||
<div style="width:140px" class="input-group">
|
||||
<input placeholder="日期" readonly class="form-control" id="dt1_{rand}" >
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="clickdt,1" type="button"><i class="icon-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<input class="form-control" style="width:180px" id="key_{rand}" placeholder="标题">
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
<td width="80%" style="padding-left:10px">
|
||||
<div id="stewwews{rand}" class="btn-group">
|
||||
<button class="btn btn-default active" id="state{rand}_0" click="changlx,0" type="button">我创建</button>
|
||||
<button class="btn btn-default" id="state{rand}_1" click="changlx,1" type="button">提醒给我的</button>
|
||||
</div>
|
||||
</td>
|
||||
<td align="right" width="200" nowrap>
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
93
webmain/system/schedule/rock_schedule_list.php
Normal file
93
webmain/system/schedule/rock_schedule_list.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var columns = [{
|
||||
text:'日期',dataIndex:'dt',width:'150px'
|
||||
},{
|
||||
text:'星期',dataIndex:'week',width:'100px'
|
||||
},{
|
||||
text:'',dataIndex:'cont',align:'left'
|
||||
}];
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'schedule',fanye:false,modedir:'{mode}:{dir}',storebeforeaction:'schedulemybefore',storeafteraction:'schedulemyafter',
|
||||
columns:columns,
|
||||
loadbefore:function(d){
|
||||
get('dt1_{rand}').value=d.startdt;
|
||||
get('dt2_{rand}').value=d.enddt;
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
search:function(){
|
||||
a.setparams({
|
||||
'startdt':get('dt1_{rand}').value,
|
||||
'enddt':get('dt2_{rand}').value
|
||||
},true);
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown();
|
||||
},
|
||||
clickwin:function(){
|
||||
openinput('日程','schedule',0,'opegs{rand}');
|
||||
},
|
||||
guanli:function(){
|
||||
addtabs({num:'guanlieschedule',url:'flow,page,schedule,atype=my',name:'日程管理'});
|
||||
},
|
||||
calendarshow:function(){
|
||||
addtabs({num:'guanlieschedulemonth',url:'{dir},{mode},calendar',name:'日程月视图'});
|
||||
},
|
||||
ricdaibn:function(){
|
||||
addtabs({num:'scheduld',url:'flow,page,scheduld,atype=my',name:'日程待办'});
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
opegs{rand}=function(){
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td nowrap style="padding-right:10px">
|
||||
<button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
<button type="button" click="guanli" class="btn btn-default"><i class="icon-cog"></i> 管理</button>
|
||||
|
||||
<button type="button" click="ricdaibn" class="btn btn-default">日程待办</button>
|
||||
</td>
|
||||
<td nowrap>日期 </td>
|
||||
<td nowrap>
|
||||
<div style="width:140px" class="input-group">
|
||||
<input placeholder="" readonly class="form-control" id="dt1_{rand}" >
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="return js.selectdate(this,'dt1_{rand}')" type="button"><i class="icon-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td nowrap> 至 </td>
|
||||
<td nowrap>
|
||||
<div style="width:140px" class="input-group">
|
||||
<input placeholder="" readonly class="form-control" id="dt2_{rand}" >
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="return js.selectdate(this,'dt2_{rand}')" type="button"><i class="icon-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
<td style="padding-left:10px" width="90%">
|
||||
|
||||
|
||||
</td>
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-default" click="calendarshow" type="button"><i class="icon-calendar"></i> 月视图</button>
|
||||
<button class="btn btn-default" click="daochu,1" type="button">导出</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="tishi">列表上显示的是:我创建的日程/提醒给我的</div>
|
||||
64
webmain/system/schedule/scheduleAction.php
Normal file
64
webmain/system/schedule/scheduleAction.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
class scheduleClassAction extends Action
|
||||
{
|
||||
public function loadscheduleAjax()
|
||||
{
|
||||
$month = $this->request('month');
|
||||
$startdt= ''.$month.'-01';
|
||||
$endddt = c('date')->getenddt($month);
|
||||
$arr = m('schedule')->getlistdata($this->adminid, $startdt, $endddt);
|
||||
$this->returnjson($arr);
|
||||
}
|
||||
|
||||
|
||||
public function schedulemybefore($table)
|
||||
{
|
||||
return array(
|
||||
'where' => ' and id=0',
|
||||
'fields'=> 'id'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function schedulemyafter($table, $rows)
|
||||
{
|
||||
$dtobj = c('date');
|
||||
$startdt = $this->post('startdt', $this->date);
|
||||
$enddt = $this->post('enddt');
|
||||
if($enddt=='')$enddt = $dtobj->adddate($startdt,'d',10);
|
||||
$jg = $dtobj->datediff('d',$startdt, $enddt);
|
||||
if($jg>60){
|
||||
$jg = 60;
|
||||
$enddt = $enddt = $dtobj->adddate($startdt,'d',60);
|
||||
}
|
||||
|
||||
$rows = m('schedule')->getlistdata($this->adminid, $startdt, $enddt);
|
||||
$barr = array();
|
||||
$dt = $startdt;
|
||||
for($i=0; $i<=$jg; $i++){
|
||||
if($i>0)$dt = $dtobj->adddate($dt,'d',1);
|
||||
$w = $dtobj->cnweek($dt);
|
||||
$status = 1;
|
||||
if($w=='六'||$w=='日')$status = 0;
|
||||
$str = '';
|
||||
if(isset($rows[$dt]))foreach($rows[$dt] as $k=>$rs){
|
||||
$str.=''.($k+1).'.['.$rs['timea'].']'.$rs['title'].'';
|
||||
if($rs['optname']!=$this->adminname)$str.=' ——'.$rs['optname'].'创建';
|
||||
$str.='<br>';
|
||||
}
|
||||
$sbarr = array(
|
||||
'dt' => $dt,
|
||||
'week' => '星期'.$w,
|
||||
'status' => $status,
|
||||
'cont' => $str
|
||||
);
|
||||
$barr[] = $sbarr;
|
||||
}
|
||||
$arr['startdt'] = $startdt;
|
||||
$arr['enddt'] = $enddt;
|
||||
$arr['rows'] = $barr;
|
||||
$arr['totalCount'] = $jg+1;
|
||||
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
209
webmain/system/sms/rock_sms_cog.php
Normal file
209
webmain/system/sms/rock_sms_cog.php
Normal file
@@ -0,0 +1,209 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var utype = '0';
|
||||
var c={
|
||||
init:function(){
|
||||
var o = get('btnss{rand}');
|
||||
o.value='加载中...';
|
||||
js.ajax(js.getajaxurl('gettotal','{mode}','{dir}'),false,function(ret){
|
||||
var curl = '';
|
||||
if(ret.success){
|
||||
$('#stotal{rand}').html(ret.data.smsinfo);
|
||||
$('#typetext{rand}').html(ret.data.typetext);
|
||||
//if(ret.data.automy=='1')$('#tessh{rand}').show();
|
||||
curl = ret.data.chongurl;
|
||||
utype = ret.data.type;
|
||||
}else{
|
||||
js.msg('msg', ret.msg);
|
||||
}
|
||||
|
||||
get('sms_iscb_{rand}').value=ret.sms_iscb;
|
||||
get('sms_cbnum_{rand}').value=ret.sms_cbnum;
|
||||
get('sms_apikey_{rand}').value=ret.sms_apikey;
|
||||
get('sms_txnum_{rand}').value=ret.sms_txnum;
|
||||
get('sms_mknum_{rand}').value=ret.sms_mknum;
|
||||
get('sms_qmnum_{rand}').value=ret.sms_qmnum;
|
||||
|
||||
get('sms_yanzm_{rand}').value=ret.sms_yanzm;
|
||||
if(ret.sms_dirtype!=''){
|
||||
$('#stotal{rand}').html('请到对应短信平台下查看');
|
||||
curl='https://www.aliyun.com';
|
||||
$('#tessh{rand}').hide();
|
||||
get('sms_apikey_{rand}').value='';
|
||||
}
|
||||
|
||||
get('chong{rand}').href=curl;
|
||||
o.value='刷新';
|
||||
var arr = ret.pingtarr;
|
||||
if(arr.length>0){
|
||||
var oo2 = get('sms_dirtype_{rand}');
|
||||
oo2.length=1;
|
||||
js.setselectdata(oo2, arr,'value');
|
||||
}
|
||||
|
||||
//短信驱动
|
||||
get('sms_dirtype_{rand}').value=ret.sms_dirtype;
|
||||
|
||||
},'get,json');
|
||||
},
|
||||
ceshi:function(){
|
||||
if(get('sms_apikey_{rand}').value!=''){
|
||||
js.alert('设置了“短信APIKEY”不需要测试发送。');
|
||||
return;
|
||||
}
|
||||
js.prompt('测试发短信','输入手机号码(测试成功会扣除一条短信)',function(lx,txt){
|
||||
if(lx=='yes'&&txt)c.sheniokx(txt)
|
||||
});
|
||||
},
|
||||
sheniokx:function(sj){
|
||||
js.msg('wait','发送中...');
|
||||
var lxs = get('sms_dirtype_{rand}').value;
|
||||
js.ajax(js.getajaxurl('testsend','{mode}','{dir}'),{mobile:sj,dirtype:lxs},function(ret){
|
||||
if(ret.success){
|
||||
js.msg('success','测试发送成功');
|
||||
c.init();
|
||||
}else{
|
||||
js.msg('msg', ret.msg);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
|
||||
save:function(){
|
||||
var lxs = get('sms_dirtype_{rand}').value;
|
||||
var da = {
|
||||
sms_iscb:get('sms_iscb_{rand}').value,
|
||||
sms_cbnum:get('sms_cbnum_{rand}').value,
|
||||
sms_apikey:'',
|
||||
sms_mknum:get('sms_mknum_{rand}').value,
|
||||
sms_qmnum:get('sms_qmnum_{rand}').value,
|
||||
sms_txnum:get('sms_txnum_{rand}').value,
|
||||
sms_yanzm:get('sms_yanzm_{rand}').value,
|
||||
sms_dirtype:lxs
|
||||
};
|
||||
|
||||
if(da.sms_qmnum=='' && lxs!=''){
|
||||
js.msg('msg','使用短信签名不能为空,请输入如:信呼OA,更多查看帮助');
|
||||
return;
|
||||
}
|
||||
|
||||
if(lxs=='alisms' && da.sms_cbnum.substr(0,4)!='SMS_'){
|
||||
js.msg('msg','流程短信催办模版编号格式不对,必须SMS_开头,请查看帮助');
|
||||
return;
|
||||
}
|
||||
|
||||
js.msg('wait','保存中...');
|
||||
js.ajax(js.getajaxurl('cogsave','{mode}','{dir}'),da,function(ret){
|
||||
js.msg('success','保存成功');
|
||||
},'post');
|
||||
},
|
||||
changetype:function(o1){
|
||||
var val = o1.value;
|
||||
if(val!=''){
|
||||
if(utype=='0'){
|
||||
js.alert('不是官网vip用户无法切换短信平台');
|
||||
o1.value='';
|
||||
return;
|
||||
}
|
||||
$('#stotal{rand}').html('请到对应短信平台下查看');
|
||||
}else{
|
||||
$('#stotal{rand}').html('请到刷新查看');
|
||||
}
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
c.init();
|
||||
|
||||
$('#sms_dirtype_{rand}').change(function(){
|
||||
c.changetype(this);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div align="left">
|
||||
<div style="padding:10px;">
|
||||
|
||||
<table cellspacing="0" width="550" border="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><div class="inputtitle">基本信息
|
||||
</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">短信发送平台:</td>
|
||||
<td class="tdinput"><select id="sms_dirtype_{rand}" style="width:200px" class="form-control"><option value="">信呼短信服务</option><option value="alisms">阿里云(短信服务)</option></select></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" width="180">剩余短信:</td>
|
||||
<td class="tdinput"><span id="stotal{rand}">0.00元(0条)</span>,<a id="chong{rand}" class="btn btn-success btn-xs" href="<?=URLY?>user_index_sms_a.html" target="_blank">去充值</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" width="180">官网用户类型:</td>
|
||||
<td class="tdinput"><span id="typetext{rand}">普通用户</span></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr style="display:none" id="tessh{rand}">
|
||||
<td align="right">短信APIKEY:</td>
|
||||
<td class="tdinput"><input id="sms_apikey_{rand}" placeholder="这是从短信平台上获取,可不用写" style="width:250px" class="form-control"> <a href="<?=URLY?>view_smsapi.html" target="_blank">如何获取?</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" ></td>
|
||||
<td class="tdinput">
|
||||
<input type="button" click="init" id="btnss{rand}" value="刷新" class="btn btn-default">
|
||||
<a href="<?=URLY?>view_dxto.html" target="_blank">[使用帮助]</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><div class="inputtitle">功能设置</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">使用短信签名编号:</td>
|
||||
<td class="tdinput"><input id="sms_qmnum_{rand}" placeholder="编号到[短信签名]下获取,可不用设置。" maxlength="50" value="" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">流程是否开短信催办:</td>
|
||||
<td class="tdinput"><select id="sms_iscb_{rand}" style="width:200px" class="form-control"><option value="0">不开启</option><option value="1">开启</option></select></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">短信验证码模版编号:</td>
|
||||
<td class="tdinput"><input id="sms_yanzm_{rand}" maxlength="50" value="" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">流程短信催办模版编号:</td>
|
||||
<td class="tdinput"><input id="sms_cbnum_{rand}" maxlength="50" value="defnum" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">短信提醒给<font color=white>:</font><br>审批人模版编号:</td>
|
||||
<td class="tdinput"><input id="sms_txnum_{rand}" maxlength="50" placeholder="编号到[短信模版]下获取,建议使用:default" class="form-control"><div style="padding-top:0" class="tishi">设置了,有流程的模块当申请人提交时会短信提醒给审批人</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">要提醒的模块编号:</td>
|
||||
<td class="tdinput"><textarea id="sms_mknum_{rand}" style="height:60px" class="form-control"></textarea><div style="padding-top:0" class="tishi">编号到[流程模块→流程模块列表]下获取,多个用,分开,写all代表所有模块。</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"></td>
|
||||
<td style="padding:15px 0px" colspan="3" align="left"><button click="save" class="btn btn-success" type="button"><i class="icon-save"></i> 保存</button>
|
||||
|
||||
<input type="button" click="ceshi" id="test{rand}" value="测试发送" class="btn btn-default">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
<div class="tishi"></div>
|
||||
</div>
|
||||
</div>
|
||||
106
webmain/system/sms/rock_sms_qian.php
Normal file
106
webmain/system/sms/rock_sms_qian.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php defined('HOST') or die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'chargems',url:js.getajaxurl('getqian','{mode}','{dir}'),statuschange:false,
|
||||
columns:[{
|
||||
text:'编号',dataIndex:'num'
|
||||
},{
|
||||
text:'签名',dataIndex:'cont'
|
||||
},{
|
||||
text:'是否公开',dataIndex:'isgk',type:'checkbox'
|
||||
},{
|
||||
text:'状态',dataIndex:'statustext'
|
||||
},{
|
||||
text:'来源',dataIndex:'fromstr'
|
||||
}],
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
},
|
||||
itemclick:function(d){
|
||||
var bo = (d.isedit==1)?false:true;
|
||||
btn(bo);
|
||||
},
|
||||
load:function(d){
|
||||
if(!isempt(d.dirtype)){
|
||||
btn(true);
|
||||
get('btn1_{rand}').disabled=true;
|
||||
get('btn2_{rand}').disabled=true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function btn(bo){
|
||||
get('edit_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
var c={
|
||||
reloads:function(){
|
||||
a.reload();
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var h = $.bootsform({
|
||||
title:'短信签名',height:400,width:400,
|
||||
tablename:'sms',isedit:lx,
|
||||
url:js.getajaxurl('saveqian','{mode}','{dir}'),
|
||||
submitfields:'cont,isgk,num,explain',
|
||||
items:[{
|
||||
labelText:'签名名称',name:'cont',required:true,blankText:'3-8个字符,需要与自己单位相关'
|
||||
},{
|
||||
labelText:'',name:'num',type:'hidden'
|
||||
},{
|
||||
labelText:'申请说明',name:'explain',required:true,blankText:'如提供单位名/产品官网网址等',type:'textarea'
|
||||
},{
|
||||
name:'isgk',labelBox:'公开(让其他用户也可以使用)',type:'checkbox',checked:false
|
||||
}],
|
||||
success:function(){
|
||||
js.msg('success','保存成功');
|
||||
a.reload();
|
||||
},
|
||||
submitcheck:function(d){
|
||||
var len=d.cont.length;
|
||||
if(len<3)return '签名必须3个字符以上';
|
||||
if(len>8)return '签名不能超过8个字符';
|
||||
}
|
||||
});
|
||||
if(lx==1){
|
||||
h.setValues(a.changedata);
|
||||
}
|
||||
h.getField('cont').focus();
|
||||
},
|
||||
reloadszt:function(){
|
||||
js.msg('wait','刷新中...');
|
||||
js.ajax(js.getajaxurl('reloadsign','{mode}','{dir}'),false, function(ret){
|
||||
if(ret.success){
|
||||
js.msg('success','刷新成功');
|
||||
a.reload();
|
||||
}else{
|
||||
js.msg('msg',ret.msg);
|
||||
}
|
||||
},'get,json');
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-primary" id="btn1_{rand}" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
|
||||
<button class="btn btn-default" click="reloads" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
</td>
|
||||
<td align="right">
|
||||
<button class="btn btn-default" click="reloadszt" id="btn2_{rand}" type="button"><i class="icon-refresh"></i> 刷新状态/获取签名</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="tishi">短信签名模版使用帮助,<a href="<?=URLY?>view_smsqian.html" target="_blank">查看帮助和规则限制?</a>,如果您超3个月未使用短信,我们将会删除自定义的签名。</div>
|
||||
51
webmain/system/sms/rock_sms_record.php
Normal file
51
webmain/system/sms/rock_sms_record.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php defined('HOST') or die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'chargems',url:js.getajaxurl('getrecord','{mode}','{dir}'),checked:true,
|
||||
columns:[{
|
||||
text:'短信内容',dataIndex:'cont',align:'left',
|
||||
},{
|
||||
text:'发给手机号',dataIndex:'tomobile',align:'left',renderstyle:function(v,d){
|
||||
return 'word-wrap:break-word;word-break:break-all;white-space:normal;';
|
||||
}
|
||||
},{
|
||||
text:'发送条数',dataIndex:'count'
|
||||
},{
|
||||
text:'发送时间',dataIndex:'adddt'
|
||||
}]
|
||||
});
|
||||
|
||||
|
||||
|
||||
var c={
|
||||
reloads:function(){
|
||||
a.reload();
|
||||
},
|
||||
del:function(){
|
||||
a.del({url:js.getajaxurl('delrecord','{mode}','{dir}'),checked:true});
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
|
||||
<button class="btn btn-default" click="reloads" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
</td>
|
||||
<td align="right">
|
||||
|
||||
<button class="btn btn-danger" click="del" type="button"><i class="icon-trash"></i> 删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="tishi">默认值显示最近50条记录。</div>
|
||||
124
webmain/system/sms/rock_sms_tpl.php
Normal file
124
webmain/system/sms/rock_sms_tpl.php
Normal file
@@ -0,0 +1,124 @@
|
||||
<?php defined('HOST') or die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'chargems',url:js.getajaxurl('gettpl','{mode}','{dir}'),statuschange:false,
|
||||
columns:[{
|
||||
text:'编号',dataIndex:'num'
|
||||
},{
|
||||
text:'模版内容',dataIndex:'cont',align:'left'
|
||||
},{
|
||||
text:'是否公开',dataIndex:'isgk',type:'checkbox'
|
||||
},{
|
||||
text:'状态',dataIndex:'statustext',renderer:function(v,d){
|
||||
if(d.status=='0')v+='<a href="javascript:;" onclick="urelsd{rand}(\''+d.num+'\')">[刷新状态]</a>';
|
||||
return v;
|
||||
}
|
||||
},{
|
||||
text:'来源',dataIndex:'fromstr'
|
||||
}],
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
},
|
||||
itemclick:function(d){
|
||||
var bo = (d.isedit==1)?false:true;
|
||||
btn(bo);
|
||||
},
|
||||
load:function(d){
|
||||
if(!isempt(d.dirtype)){
|
||||
btn(true);
|
||||
get('btn1_{rand}').disabled=true;
|
||||
get('btn2_{rand}').disabled=true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function btn(bo){
|
||||
get('del_{rand}').disabled = bo;
|
||||
get('edit_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
var c={
|
||||
reloads:function(){
|
||||
a.reload();
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var h = $.bootsform({
|
||||
title:'短信模版',height:400,width:400,
|
||||
tablename:'sms',isedit:lx,
|
||||
url:js.getajaxurl('savetpl','{mode}','{dir}'),
|
||||
submitfields:'cont,num',
|
||||
items:[{
|
||||
labelText:'模版内容',type:'textarea',name:'cont',required:true,blankText:'请严格按照规范填写,变量用#name#格式。',height:150
|
||||
},{
|
||||
labelText:'',name:'num',type:'hidden'
|
||||
}],
|
||||
success:function(){
|
||||
js.msg('success','保存成功');
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
if(lx==1){
|
||||
h.setValues(a.changedata);
|
||||
}
|
||||
h.getField('cont').focus();
|
||||
},
|
||||
del:function(){
|
||||
js.confirm('确定要删除此模版吗?',function(jg){
|
||||
if(jg=='yes')c.dels();
|
||||
});
|
||||
},
|
||||
dels:function(){
|
||||
var num = a.changedata.num;
|
||||
js.msg('wait','删除中...');
|
||||
js.ajax(js.getajaxurl('deltpl','{mode}','{dir}'),{num:num}, function(ret){
|
||||
if(ret.success){
|
||||
js.msg('success','删除成功');
|
||||
a.reload();
|
||||
}else{
|
||||
js.msg('msg',ret.msg);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
getztss:function(bh){
|
||||
js.msg('wait','刷新中...');
|
||||
js.ajax(js.getajaxurl('relaodtpl','{mode}','{dir}'),{num:bh}, function(ret){
|
||||
if(ret.success){
|
||||
js.msg('success','刷新成功');
|
||||
a.reload();
|
||||
}else{
|
||||
js.msg('msg',ret.msg);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
reloadszt:function(){
|
||||
this.getztss('');
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
|
||||
urelsd{rand}=function(bh){
|
||||
c.getztss(bh);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-primary" id="btn1_{rand}" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
|
||||
<button class="btn btn-default" click="reloads" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
</td>
|
||||
<td align="right">
|
||||
<button class="btn btn-default" click="reloadszt" id="btn2_{rand}" type="button"><i class="icon-refresh"></i> 刷新状态/获取模版</button>
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="tishi">短信签名模版使用帮助,<a href="<?=URLY?>view_smsqian.html" target="_blank">查看帮助和使用规则?</a></div>
|
||||
187
webmain/system/sms/smsAction.php
Normal file
187
webmain/system/sms/smsAction.php
Normal file
@@ -0,0 +1,187 @@
|
||||
<?php
|
||||
class smsClassAction extends Action
|
||||
{
|
||||
public function initAction()
|
||||
{
|
||||
$this->smsobj = c('xinhuapi');
|
||||
}
|
||||
|
||||
public function gettotalAjax()
|
||||
{
|
||||
$barr = $this->smsobj->getdata('sms','smstotal');
|
||||
$barr['sms_iscb'] = $this->option->getval('sms_iscb','0');
|
||||
$barr['sms_cbnum'] = $this->option->getval('sms_cbnum','defnum');
|
||||
$barr['sms_apikey'] = $this->option->getval('sms_apikey');
|
||||
$barr['sms_txnum'] = $this->option->getval('sms_txnum');
|
||||
$barr['sms_mknum'] = $this->option->getval('sms_mknum');
|
||||
$barr['sms_qmnum'] = $this->option->getval('sms_qmnum');
|
||||
$barr['sms_dirtype'] = $this->option->getval('sms_dirtype');
|
||||
$barr['sms_yanzm'] = $this->option->getval('sms_yanzm');
|
||||
$barr['pingtarr'] = $this->option->getdata('syssmsplat');
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//保存设置
|
||||
public function cogsaveAjax()
|
||||
{
|
||||
$sms_dirtype = $this->post('sms_dirtype');
|
||||
if(isempt($sms_dirtype) || $sms_dirtype=='null')$sms_dirtype = '';
|
||||
$this->option->setval('sms_iscb', $this->post('sms_iscb','0'));
|
||||
$this->option->setval('sms_cbnum', $this->post('sms_cbnum')); //催办编号
|
||||
$this->option->setval('sms_apikey', $this->post('sms_apikey'));
|
||||
$this->option->setval('sms_txnum', $this->post('sms_txnum')); //审批提醒模块编号
|
||||
$this->option->setval('sms_mknum', $this->post('sms_mknum')); //要提醒的模块编号
|
||||
$this->option->setval('sms_qmnum', $this->post('sms_qmnum')); //签名
|
||||
$this->option->setval('sms_dirtype', $sms_dirtype);
|
||||
$this->option->setval('sms_yanzm', $this->post('sms_yanzm'));//验证码的短信编号
|
||||
$this->option->delete("`num` like 'alisms\_%'");
|
||||
}
|
||||
|
||||
//测试
|
||||
public function testsendAjax()
|
||||
{
|
||||
$mobile = $this->get('mobile');
|
||||
$dirtype = $this->get('dirtype');
|
||||
$lxss = $this->option->getval('sms_dirtype');
|
||||
if($dirtype!=$lxss)return returnerror('请先保存后在测试');
|
||||
|
||||
$parasm = array(
|
||||
'modename' => '模块测试',
|
||||
'sericnum' => 'AB-'.date('Ymd').'-001',
|
||||
'applyname' => $this->adminname,
|
||||
'code' => rand(100000,999999),
|
||||
);
|
||||
$bh = $this->option->getval('sms_cbnum', 'defurls');
|
||||
$barr = $this->smsobj->send($mobile, '' ,$bh, $parasm, ''.URL.'?d=we', false);
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//获取签名
|
||||
public function getqianAjax()
|
||||
{
|
||||
$type = $this->option->getval('sms_dirtype');
|
||||
if(!isempt($type)){
|
||||
$rows[] = array(
|
||||
'cont' => '非使用官网平台请到对应短信平台处理',
|
||||
'isgk' => 0
|
||||
);
|
||||
return array(
|
||||
'rows' => $rows,
|
||||
'dirtype' => $type
|
||||
);
|
||||
}
|
||||
$barr = $this->smsobj->getdata('sms','getqian');
|
||||
$rows = array();
|
||||
if($barr['success']){
|
||||
$rows = $barr['data'];
|
||||
}
|
||||
return array(
|
||||
'rows' => $rows
|
||||
);
|
||||
}
|
||||
|
||||
//获取发送记录
|
||||
public function getrecordAjax()
|
||||
{
|
||||
$barr = $this->smsobj->getdata('sms','getrecord');
|
||||
$rows = array();
|
||||
if($barr['success']){
|
||||
$rows = $barr['data'];
|
||||
}
|
||||
return array(
|
||||
'rows' => $rows
|
||||
);
|
||||
}
|
||||
|
||||
//删除短信记录
|
||||
public function delrecordAjax()
|
||||
{
|
||||
$barr = $this->smsobj->getdata('sms','delrecord', array(
|
||||
'id' => $this->post('id')
|
||||
));
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//保存签名
|
||||
public function saveqianAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')return returnerror('demo演示上禁止操作');
|
||||
$cont = trim($this->post('cont'));
|
||||
$num = $this->post('num');
|
||||
$explain = trim(htmlspecialchars($this->post('explain')));
|
||||
$isgk = (int)$this->post('isgk',1);
|
||||
$barr = $this->smsobj->postdata('sms','saveqian', array(
|
||||
'cont' => $cont,
|
||||
'num' => $num,
|
||||
'isgk' => $isgk,
|
||||
'explain' => $explain,
|
||||
));
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//获取模版
|
||||
public function gettplAjax()
|
||||
{
|
||||
$type = $this->option->getval('sms_dirtype');
|
||||
if(!isempt($type)){
|
||||
$rows[] = array(
|
||||
'cont' => '非使用官网平台请到对应短信平台处理',
|
||||
'isgk' => 0
|
||||
);
|
||||
return array(
|
||||
'rows' => $rows,
|
||||
'dirtype' => $type
|
||||
);
|
||||
}
|
||||
$barr = $this->smsobj->getdata('sms','gettpl');
|
||||
$rows = array();
|
||||
if($barr['success']){
|
||||
$rows = $barr['data'];
|
||||
}
|
||||
return array(
|
||||
'rows' => $rows
|
||||
);
|
||||
}
|
||||
//保存模版
|
||||
public function savetplAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')return returnerror('demo演示上禁止操作');
|
||||
$cont = $this->post('cont');
|
||||
$num = $this->post('num');
|
||||
$isgk = 1;
|
||||
$barr = $this->smsobj->postdata('sms','savetpl', array(
|
||||
'cont' => $cont,
|
||||
'num' => $num,
|
||||
'isgk' => 1,
|
||||
));
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//删除模版
|
||||
public function deltplAjax()
|
||||
{
|
||||
if(getconfig('systype')=='demo')return returnerror('demo演示上禁止操作');
|
||||
$num = $this->post('num');
|
||||
$barr = $this->smsobj->getdata('sms','deltpl', array(
|
||||
'num' => $num,
|
||||
));
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//刷新模版状态
|
||||
public function relaodtplAjax()
|
||||
{
|
||||
$num = $this->post('num');
|
||||
$barr = $this->smsobj->getdata('sms','reloadtpl', array(
|
||||
'num' => $num,
|
||||
));
|
||||
return $barr;
|
||||
}
|
||||
|
||||
//刷新状态
|
||||
public function reloadsignAjax()
|
||||
{
|
||||
$barr = $this->smsobj->getdata('sms','reloadsign');
|
||||
return $barr;
|
||||
}
|
||||
}
|
||||
113
webmain/system/sysfile/rock_sysfile.php
Normal file
113
webmain/system/sysfile/rock_sysfile.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
checked:false,method:'get',
|
||||
url:js.getajaxurl('getdata','{mode}','{dir}'),
|
||||
columns:[{
|
||||
text:'名称',dataIndex:'name',align:'left',renderer:function(v,d){
|
||||
return '<span title="'+jm.base64decode(d.path)+'"><i class="icon-'+d.type+'"></i> '+v+'</span>';
|
||||
}
|
||||
},{
|
||||
text:'说明',dataIndex:'explain'
|
||||
},{
|
||||
text:'大小',dataIndex:'filesize'
|
||||
},{
|
||||
text:'创建时间',dataIndex:'createdt'
|
||||
},{
|
||||
text:'最后修改',dataIndex:'lastdt'
|
||||
},{
|
||||
text:'',dataIndex:'isaz',align:'left',renderer:function(v,d){
|
||||
var str = '';
|
||||
if(d.lei==0){
|
||||
str='<a href="javascript:;" onclick="openfile{rand}('+d.lei+',\''+d.path+'\')">打开</a>';
|
||||
}else{
|
||||
if(d.isedit==1)str='<a href="javascript:;" onclick="openfile{rand}(2,\''+d.path+'\')">查看</a>';
|
||||
if(js.isimg(d.fileext))str='<a href="javascript:;" onclick="$.imgview({url:\''+jm.base64decode(d.path)+'\'})">预览</a>';
|
||||
}
|
||||
if(d.isdel==1)str+=' <a href="javascript:;" onclick="openfile{rand}(3,\''+d.path+'\')">删</a>';
|
||||
return str;
|
||||
}
|
||||
}],
|
||||
load:function(d){
|
||||
$('#sviepath').html('文件不要随意删除');
|
||||
nowpath = d.nowpath;
|
||||
var str='',i,ad2,s1='';
|
||||
ad2=d.nowpath.split('/');
|
||||
for(i=0;i<ad2.length;i++){
|
||||
if(i>0){
|
||||
str+=' <font color="#cccccc">></font> ';
|
||||
s1+='/';
|
||||
}
|
||||
s1+=''+ad2[i]+'';
|
||||
str+='<a href="javascript:;" onclick="openfile{rand}(0,\''+jm.base64encode(s1)+'\')">'+ad2[i]+'</a>';
|
||||
}
|
||||
$('#nowpath').html(str);
|
||||
},
|
||||
itemdblclick:function(d){
|
||||
if(d.lei==0)openfile{rand}(0,d.path);
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
reload:function(){
|
||||
a.reload();
|
||||
},
|
||||
clearlogs:function(){
|
||||
js.confirm('确定要全部删除<?=UPDIR?>/logs下的文件嘛?', function(jg){if(jg=='yes')c.clearlogss();});
|
||||
},
|
||||
clearlogss:function(){
|
||||
js.loading('清理中...');
|
||||
js.ajax(js.getajaxurl('clearlogs','{mode}','{dir}'),false,function(tss){
|
||||
js.msgok(tss);
|
||||
});
|
||||
},
|
||||
delfile:function(pts){
|
||||
js.confirm('确定要删除'+jm.base64decode(pts)+'吗?', function(jg){if(jg=='yes')c.delfiles(pts);});
|
||||
},
|
||||
delfiles:function(pts){
|
||||
js.loading('删除中...');
|
||||
js.ajax(js.getajaxurl('delfile','{mode}','{dir}'),{path:pts},function(tss){
|
||||
js.msgok(tss);
|
||||
a.reload();
|
||||
});
|
||||
},
|
||||
svnupdate:function(){
|
||||
js.loading('发送中...');
|
||||
js.ajax(js.getajaxurl('svnupdate','{mode}','{dir}'),false,function(tss){
|
||||
js.msgok(tss);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
openfile{rand}=function(lx,pts){
|
||||
if(lx==0)a.setparams({path:pts},true);
|
||||
if(lx==2)window.open('?m=sysfile&d=system&a=edit&path='+pts+'');
|
||||
if(lx==3)c.delfile(pts);
|
||||
}
|
||||
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td nowrap align="left">
|
||||
<button class="btn btn-default" click="reload" type="button">刷新</button>
|
||||
</td>
|
||||
<td align="left" width="100%" style="padding:0px 10px;">
|
||||
路径:<a href="javascript:;" onclick="openfile{rand}(0,'')"><?=ROOT_PATH?></a> <font color="#cccccc">></font> <span id="nowpath"></span>
|
||||
</td>
|
||||
<td align="right" nowrap>
|
||||
<?php
|
||||
if(getconfig('svnpath'))echo '<button class="btn btn-default" click="svnupdate" type="button">SVN更新系统</button>';
|
||||
?>
|
||||
<button class="btn btn-default" click="clearlogs" type="button">一键清除<?=UPDIR?>/logs下日志文件</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
179
webmain/system/sysfile/sysfileAction.php
Normal file
179
webmain/system/sysfile/sysfileAction.php
Normal file
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
class sysfileClassAction extends Action
|
||||
{
|
||||
public function initAction()
|
||||
{
|
||||
$this->isdelmu = array(''.UPDIR.'/logs', ''.UPDIR.'/sqllog',''.UPDIR.'/cache', ''.UPDIR.'/data/'.(date('Y')-1).'');
|
||||
}
|
||||
|
||||
public function getdataAjax()
|
||||
{
|
||||
$notedit = ',exe,dll,zip,rar,gz,ocx,png,gif,jpg,ico,mp4,wmv,frx,psd,';
|
||||
$this->notedit = $notedit;
|
||||
$rows = array();
|
||||
$path = '';
|
||||
$isope= getconfig('sysfileview');
|
||||
if($this->adminid!=1 || getconfig('system')=='demo' || !$isope){
|
||||
if($this->adminid!=1)$rows[]=array('name'=>'非admin管理员不能查看');
|
||||
if(getconfig('system')=='demo')$rows[]=array('name'=>'演示不能查看');
|
||||
if(!$isope)$rows[]=array('name'=>'系统配置文件没有打开sysfileview选项,不能查看,可配置加上\'sysfileview\'=>true,即可');
|
||||
}else{
|
||||
$path = $this->jm->base64decode($this->get('path'));
|
||||
$rows = $this->getfilelist($path);
|
||||
}
|
||||
|
||||
$total = count($rows);
|
||||
return array(
|
||||
'rows' => $rows,
|
||||
'totalCount'=> $total,
|
||||
'success' => true,
|
||||
'nowpath' => $path
|
||||
);
|
||||
}
|
||||
private function getfilelist($path)
|
||||
{
|
||||
$chk = c('check');
|
||||
$php5= version_compare(PHP_VERSION, '7.0.0','<');
|
||||
$dir_arr = @scandir(ROOT_PATH.'/'.$path);
|
||||
$darr1= $rows = array();
|
||||
foreach($dir_arr as $key=>$val){
|
||||
if($val == '.' || $val == '..'){
|
||||
}else{
|
||||
if($php5 && $chk->isincn($val))$val = iconv('gb2312','utf-8', $val);
|
||||
$mulu = $path.'/'.$val.'';
|
||||
if(!$path)$mulu = $val;
|
||||
if(is_dir($mulu)){
|
||||
$isdel = 0;
|
||||
foreach($this->isdelmu as $sdif)if(strpos($mulu, $sdif)===0)$isdel=1;
|
||||
$rows[] = array(
|
||||
'name' => $val,
|
||||
'type'=>'folder-close-alt',
|
||||
'lei'=>0,
|
||||
'isdel'=>$isdel,
|
||||
'path'=> $this->jm->base64encode($mulu)
|
||||
);
|
||||
}else{
|
||||
$suhs = $this->getfilew($val, $mulu,'',0);
|
||||
if($suhs)$darr1[] = $suhs;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach($darr1 as $k=>$rs)$rows[] = $rs;
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
private function getfilew($val,$mulu,$sm='',$isdel=0)
|
||||
{
|
||||
if(!file_exists($mulu))return false;
|
||||
$fileext = strtolower(substr($val,strripos($val,'.')+1));
|
||||
$isedit = 1;
|
||||
if(contain($this->notedit,','.$fileext.','))$isedit = 0;
|
||||
foreach($this->isdelmu as $sdif)if(strpos($mulu, $sdif)===0)$isdel=1;
|
||||
return array(
|
||||
'name' => $val,
|
||||
'type' => 'file',
|
||||
'lei'=>1,
|
||||
'filesize' => $this->rock->formatsize(filesize($mulu)),
|
||||
'createdt' => date('Y-m-d H:i:s',filectime($mulu)),
|
||||
'lastdt' => date('Y-m-d H:i:s',filemtime($mulu)),
|
||||
'path' => $this->jm->base64encode($mulu),
|
||||
'fileext' => $fileext,
|
||||
'isedit' => $isedit,
|
||||
'isdel' => $isdel,
|
||||
'explain' => $sm
|
||||
);
|
||||
}
|
||||
private function iscaozuo()
|
||||
{
|
||||
if($this->adminid!=1 || getconfig('system')=='demo' || !getconfig('sysfileview'))return '禁止操作';
|
||||
return '';
|
||||
}
|
||||
|
||||
public function editAction()
|
||||
{
|
||||
if($str=$this->iscaozuo())return $str;
|
||||
$path = $this->jm->base64decode($this->get('path'));
|
||||
if(isempt($path))return '无效路径';
|
||||
if(!file_exists($path))return '文件不存在';
|
||||
$pathinfo=pathinfo($path);
|
||||
|
||||
$filename = $pathinfo['basename'];
|
||||
$filesize = filesize($path);
|
||||
$content = file_get_contents($path);
|
||||
$encode = mb_detect_encoding($content, array('ASCII','UTF-8','GB2312','GBK','BIG5'));
|
||||
|
||||
if($encode && $encode != "UTF-8"){
|
||||
$content = iconv($encode,'utf-8',$content);
|
||||
}
|
||||
|
||||
$this->smartydata['filename'] = $filename;
|
||||
$fileext = strtolower(substr($path,strripos($path,'.')+1));
|
||||
$this->smartydata['fileext'] = $fileext;
|
||||
$this->smartydata['content'] = $content;
|
||||
$this->smartydata['filepath'] = $this->jm->base64encode($path);
|
||||
$this->smartydata['filesize'] = $this->rock->formatsize($filesize);
|
||||
}
|
||||
|
||||
private function delfolder($path)
|
||||
{
|
||||
$this->fileall = array();
|
||||
$this->folderall = array();
|
||||
$this->getallfile($path);
|
||||
$total = count($this->fileall);
|
||||
if($this->fileall)foreach($this->fileall as $file)unlink($file);
|
||||
if($this->folderall)foreach($this->folderall as $file)rmdir($file);
|
||||
if(is_dir($path))rmdir($path);
|
||||
return '共删除'.$total.'个文件';
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理
|
||||
*/
|
||||
public function clearlogsAjax()
|
||||
{
|
||||
if($str=$this->iscaozuo())return $str;
|
||||
$path = ''.UPDIR.'/logs';
|
||||
return $this->delfolder($path);
|
||||
}
|
||||
private function getallfile($path)
|
||||
{
|
||||
$dir_arr = @scandir($path);
|
||||
$darr1= $rows = array();
|
||||
if($dir_arr)foreach($dir_arr as $key=>$val){
|
||||
if($val == '.' || $val == '..'){
|
||||
}else{
|
||||
$mulu = $path.'/'.$val.'';
|
||||
if(is_dir($mulu)){
|
||||
$this->getallfile($mulu);
|
||||
$this->folderall[] = $mulu;
|
||||
}else{
|
||||
$this->fileall[] = $mulu;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*/
|
||||
public function delfileAjax()
|
||||
{
|
||||
if($str=$this->iscaozuo())return $str;
|
||||
$path = $this->jm->base64decode($this->get('path'));
|
||||
if(isempt($path))return '无效文件';
|
||||
$isdel = 0;
|
||||
foreach($this->isdelmu as $sdif)if(strpos($path, $sdif)===0)$isdel=1;
|
||||
if($isdel==0)return '此文件禁止删除';
|
||||
if(is_dir($path))return $this->delfolder($path);
|
||||
unlink($path);
|
||||
return '删除成功';
|
||||
}
|
||||
|
||||
public function svnupdateAjax()
|
||||
{
|
||||
$cmd = '"'.getconfig('svnpath').'" /command:update /closeonend:1 /path:"'.ROOT_PATH.'"';
|
||||
c('socket')->udpsend($cmd);
|
||||
return '已发送svn更新';
|
||||
}
|
||||
}
|
||||
137
webmain/system/sysfile/tpl_sysfile_edit.html
Normal file
137
webmain/system/sysfile/tpl_sysfile_edit.html
Normal file
@@ -0,0 +1,137 @@
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title><?=$da['filename']?></title>
|
||||
<script type="text/javascript" src="js/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/js.js"></script>
|
||||
<link rel="shortcut icon" href="favicon.ico" />
|
||||
<style>
|
||||
|
||||
</style>
|
||||
<script>
|
||||
var fileext = '<?=$da['fileext']?>';
|
||||
function save(o1){
|
||||
var cont = get('content').innerText;
|
||||
js.setmsg('保存中...');
|
||||
o1.disabled = true;
|
||||
js.ajax({
|
||||
type:'post',
|
||||
url:'?m=sysfile&a=savefile&path=<?=$da['filepath']?>',
|
||||
data:{content:cont},
|
||||
success:function(res){
|
||||
if(res=='ok'){
|
||||
js.setmsg('保存成功,可修改继续保存','green');
|
||||
o1.disabled=false;
|
||||
}else{
|
||||
js.setmsg(res);
|
||||
o1.disabled=false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function initbody(){
|
||||
var hei = winHb()-40;
|
||||
|
||||
$('#lineheihtss').css('height',''+hei+'px');
|
||||
$('#content').scroll(scrollss);
|
||||
|
||||
$('#content').css('height',''+(hei-10)+'px');
|
||||
$('#content').css('width',''+(winWb()-62)+'px');
|
||||
|
||||
var cont = get('content').innerHTML;
|
||||
var arr = cont.split("\n"),i,s1='';
|
||||
for(i=0;i<arr.length;i++){
|
||||
if(i>0)s1+='<br>';
|
||||
s1+=''+(i+1)+'';
|
||||
}
|
||||
$('#lineheiht').html(s1+'<br> ');
|
||||
|
||||
var sphe = ',php,js,java,';
|
||||
|
||||
|
||||
if(sphe.indexOf(','+fileext+',')>-1){
|
||||
//var rNote = /(?:^|\n|\r)\s*\/\/.*(?:\r|\n|$)|(\/\*(.|\s)*?\*\/)/g;
|
||||
var rNote = /(\/\*(.|\s)*?\*\/)/g;
|
||||
var emu = cont.match(rNote),st1;
|
||||
if(emu != null){
|
||||
for(i=0;i<emu.length; i++){
|
||||
st1=emu[i];
|
||||
cont = cont.replace(st1,'<span>'+st1+'</span>');
|
||||
}
|
||||
}
|
||||
get('content').innerHTML=phpjcq(cont,fileext);
|
||||
}
|
||||
if(fileext=='conf')confini(cont,'#');
|
||||
if(fileext=='ini')confini(cont,';');
|
||||
}
|
||||
|
||||
function phpjcq(cont, lx){
|
||||
if(lx=='php'){
|
||||
var jcz = 'include_once,$_GET,isset,unset,explode,foreach,isempt,if,else,extends,require,public,function,protected,array,return,echo,private,exit,is_numeric,property_exists,this'.split(','),i,reg;
|
||||
for(i=0;i<jcz.length;i++){
|
||||
reg = new RegExp(jcz[i], 'g');
|
||||
cont = cont.replace(reg,'<font>'+jcz[i]+'</font>');
|
||||
}
|
||||
}
|
||||
if(cont.indexOf('\/\/')==-1)return cont;
|
||||
var arr = cont.split("\n"),i,s1='',xu,s2;
|
||||
for(i=0;i<arr.length;i++){
|
||||
if(i>0)s1+='\n';
|
||||
s2 = arr[i]
|
||||
xu = s2.indexOf('\/\/');
|
||||
if(xu>-1 && s2.indexOf(':\/\/')==-1){
|
||||
s1+=s2.substr(0, xu)+'<span>'+s2.substr(xu)+'</span>';
|
||||
}else{
|
||||
s1+=s2;
|
||||
}
|
||||
}
|
||||
return s1;
|
||||
}
|
||||
function confini(cont, lx){
|
||||
var arr = cont.split("\n"),i,s1='';
|
||||
for(i=0;i<arr.length;i++){
|
||||
if(i>0)s1+='\n';
|
||||
if(arr[i].indexOf(lx)==0 || arr[i].indexOf(' '+lx)==0){
|
||||
s1+='<span>'+arr[i]+'</span>';
|
||||
}else{
|
||||
s1+=arr[i];
|
||||
}
|
||||
}
|
||||
get('content').innerHTML=s1;
|
||||
}
|
||||
|
||||
function scrollss(){
|
||||
get('lineheihtss').scrollTop=get('content').scrollTop;
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
pre span{color:#999999}
|
||||
pre font{color:blue}
|
||||
table {
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body style="background:white;padding:0px;margin:0px;overflow:hidden">
|
||||
<table style="width:100%;height:100%" border=0><tr>
|
||||
<td valign="top" style="background:#e4e4e4;"><div id="lineheihtss" style="width:50px;height:300px;overflow:hidden"><div style="line-height:20px;padding-top:5px;text-align:right;padding-right:3px;font-size:14px" id="lineheiht">1<br>2<br></div></div></td>
|
||||
<td valign="top" style="width:100%;height:100%;padding:0px">
|
||||
<div id="contentdiv" style="overflow:hidden;background:#caeccb;">
|
||||
<pre id="content" contenteditable="plaintext-only" style="height:100%;width:100%;border:0px #aaaaaa solid;background:none;line-height:20px;font-size:14px;overflow:auto;padding:5px;margin:0px;outline:none"><?=htmlspecialchars($da['content'])?></pre></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td style="height:40px;overflow:hidden">
|
||||
|
||||
<div ><span id="msgview">大小:<?=$da['filesize']?>,查找请用Ctrl+F</span>,文件:<?=$rock->jm->base64decode($da['filepath'])?></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
104
webmain/system/table/rock_table_fields.php
Normal file
104
webmain/system/table/rock_table_fields.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params}
|
||||
var tabelss = params.table;
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'table',celleditor:true,url:js.getajaxurl('tablefields','{mode}','{dir}'),
|
||||
params:{'table':tabelss},
|
||||
columns:[{
|
||||
text:'字段名',dataIndex:'name'
|
||||
},{
|
||||
text:'类型',dataIndex:'type'
|
||||
},{
|
||||
text:'类型',dataIndex:'types'
|
||||
},{
|
||||
text:'是否为空',dataIndex:'isnull'
|
||||
},{
|
||||
text:'默认值',dataIndex:'dev'
|
||||
},{
|
||||
text:'说明',dataIndex:'explain',type:'textarea',align:'left'
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del({
|
||||
url:js.getajaxurl('delfields','{mode}','{dir}'),
|
||||
params:{table:tabelss}
|
||||
});
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var h = $.bootsform({
|
||||
title:'字段',height:400,width:500,
|
||||
tablename:'',isedit:lx,url:js.getajaxurl('savefields','{mode}','{dir}',{table:tabelss}),
|
||||
submitfields:'name,type,explain,lens,isnull,dev',
|
||||
items:[{
|
||||
labelText:'字段名',name:'name',required:true
|
||||
},{
|
||||
labelText:'类型',name:'type',type:'select',required:true,store:[['varchar','varchar(字符串)'],['int','int(长整数)'],['smallint','smallint(中整数)'],['tinyint','tinyint(短整数)'],['bigint','bigint(超长整数)'],['date','date(日期)'],['datetime','datetime(日期时间)'],['decimal','decimal(浮点数)'],['mediumint','mediumint(中等整数)'],['text','text(长文本域)']],valuefields:0,displayfields:1
|
||||
},{
|
||||
labelText:'长度',name:'lens',value:'0'
|
||||
},{
|
||||
labelText:'默认值',name:'dev'
|
||||
},{
|
||||
labelText:'说明',name:'explain'
|
||||
},{
|
||||
name:'isnull',labelText:'是否为空',type:'select',store:[['YES','是'],['NO','否']],valuefields:0,displayfields:1
|
||||
}],
|
||||
success:function(){
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
if(lx==1){
|
||||
h.setValues(a.changedata);
|
||||
var tys=a.changedata.types.split('(');
|
||||
var cd='0';
|
||||
if(tys[1])cd=tys[1].replace(')','');
|
||||
h.setValue('lens', cd);
|
||||
}
|
||||
h.getField('name').focus();
|
||||
},
|
||||
refresh:function(){
|
||||
a.reload();
|
||||
}
|
||||
};
|
||||
|
||||
function btn(bo){
|
||||
get('del_{rand}').disabled = bo;
|
||||
get('edit_{rand}').disabled = bo;
|
||||
}
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增字段</button>
|
||||
<button class="btn btn-default" click="refresh" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
</td>
|
||||
|
||||
|
||||
<td width="80%">
|
||||
<font color="red"> 数据表字段关系到系统运行,请谨慎操作,</font>更好用的管理请使用其他工具。
|
||||
</td>
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
|
||||
82
webmain/system/table/rock_table_list.php
Normal file
82
webmain/system/table/rock_table_list.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'table',fanye:true,modedir:'{mode}:{dir}',storebeforeaction:'tablebefore',celleditor:true,
|
||||
cellurl:js.getajaxurl('tablesm','{mode}','{dir}'),
|
||||
columns:[{
|
||||
text:'表名',dataIndex:'id',sortable:true
|
||||
},{
|
||||
text:'引擎',dataIndex:'engine'
|
||||
},{
|
||||
text:'总记录数',dataIndex:'rows',sortable:true
|
||||
},{
|
||||
text:'说明',dataIndex:'explain',editor:true
|
||||
},{
|
||||
text:'创建时间',dataIndex:'cjsj',sortable:true
|
||||
},{
|
||||
text:'字符集',dataIndex:'TABLE_COLLATION'
|
||||
},{
|
||||
text:'更新时间',dataIndex:'gxsj',sortable:true
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
}
|
||||
});
|
||||
|
||||
function btn(bo){
|
||||
get('edit_{rand}').disabled = bo;
|
||||
get('kanbtn_{rand}').disabled = bo;
|
||||
}
|
||||
var c={
|
||||
clickwin:function(){
|
||||
var name=a.changeid;
|
||||
addtabs({num:'tablefields'+name+'',url:'system,table,fields,table='+name+'',name:'['+name+']字段管理'});
|
||||
},
|
||||
kanjili:function(){
|
||||
var name=a.changeid;
|
||||
addtabs({num:'tablerecord'+name+'',url:'system,table,record,table='+name+'',name:'['+name+']记录'});
|
||||
},
|
||||
search:function(){
|
||||
a.setparams({
|
||||
key:get('key_{rand}').value
|
||||
},true);
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td >
|
||||
<input class="form-control" style="width:180px" id="key_{rand}" placeholder="表名">
|
||||
</td>
|
||||
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
|
||||
<td width="80%" style="padding-left:10px">
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
<button class="btn btn-default" id="kanbtn_{rand}" click="kanjili" disabled type="button">查看记录</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="tishi">数据库表格管理请谨慎操作!</div>
|
||||
77
webmain/system/table/rock_table_record.php
Normal file
77
webmain/system/table/rock_table_record.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params}
|
||||
var tabs = params.table,bool=false;
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'option',fanye:true,modedir:'{mode}:{dir}',storebeforeaction:'tablerecord_before',
|
||||
storeafteraction:'tablerecord_after',params:{'stable':jm.encrypt(tabs)},checked:false,statuschange:false,
|
||||
columns:[{
|
||||
text:'ID',dataIndex:'id',sortable:true
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
},
|
||||
loadbefore:function(d){
|
||||
if(!bool){
|
||||
a.setColumns(d.fieldsarr);
|
||||
var str = '',i;
|
||||
for(i=0;i<d.fieldsarr.length;i++)str+='<option value="'+d.fieldsarr[i].dataIndex+'">'+d.fieldsarr[i].text+'</option>';
|
||||
bool = true;
|
||||
$('#fields_{rand}').html(str);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function btn(bo){
|
||||
|
||||
}
|
||||
var c={
|
||||
|
||||
search:function(){
|
||||
a.setparams({
|
||||
key:get('key_{rand}').value,
|
||||
fields:get('fields_{rand}').value
|
||||
},true);
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td >
|
||||
<select class="form-control" style="width:180px" id="fields_{rand}" >
|
||||
<option value="id">ID</option>
|
||||
</select>
|
||||
</td>
|
||||
<td >
|
||||
<input class="form-control" style="width:180px" id="key_{rand}" placeholder="等于值">
|
||||
</td>
|
||||
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
|
||||
<td width="80%" style="padding-left:10px">
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td align="right" nowrap>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="tishi">数据库记录管理请谨慎操作!</div>
|
||||
129
webmain/system/table/tableAction.php
Normal file
129
webmain/system/table/tableAction.php
Normal file
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
class tableClassAction extends Action
|
||||
{
|
||||
public function initAction()
|
||||
{
|
||||
if($this->getsession('isadmin')!='1')backmsg('别乱来');
|
||||
if(getconfig('systype')=='demo')backmsg('演示的不要改');
|
||||
}
|
||||
|
||||
public function tablebefore($table)
|
||||
{
|
||||
$key = $this->post('key');
|
||||
$where = 'and `TABLE_SCHEMA`=\''.DB_BASE.'\'';
|
||||
if($key!='')$where.=" and (`TABLE_NAME` like '%$key%' or `TABLE_COMMENT` like '%$key%')";
|
||||
return array(
|
||||
'table' => 'information_schema.`TABLES`',
|
||||
'fields'=> '`TABLE_NAME` as id,`ENGINE` as `engine`,`TABLE_ROWS` as `rows`,`TABLE_COMMENT` as `explain`,`CREATE_TIME` as `cjsj`,`UPDATE_TIME` as `gxsj`,`TABLE_COLLATION`',
|
||||
'where' => $where
|
||||
);
|
||||
}
|
||||
|
||||
//保存表备注
|
||||
public function tablesmAjax()
|
||||
{
|
||||
$id = $this->post('id');
|
||||
$value = $this->post('value');
|
||||
$sql = "ALTER TABLE `$id` COMMENT '$value';";
|
||||
$this->db->query($sql);
|
||||
return 'success';
|
||||
}
|
||||
|
||||
public function tablefieldsAjax()
|
||||
{
|
||||
$table = $this->post('table');
|
||||
$rows = $this->db->gettablefields($table);
|
||||
foreach($rows as $k=>$rs)$rows[$k]['id']=$rs['name'];
|
||||
$arr['rows'] = $rows;
|
||||
$this->returnjson($arr);
|
||||
}
|
||||
|
||||
public function savefieldsAjax()
|
||||
{
|
||||
|
||||
$table = $this->post('table');
|
||||
$allfields = $this->db->getallfields($table);
|
||||
$name = strtolower($this->post('name'));
|
||||
if(c('check')->isincn($name))backmsg('字段名不能有中文');
|
||||
$type = $this->post('type');
|
||||
$dev = $this->post('dev');
|
||||
$isnull = $this->post('isnull');
|
||||
if($table=='' || $name=='' || $type=='')backmsg('hehe');
|
||||
|
||||
$lens = $this->post('lens');
|
||||
$sm = $this->post('explain');
|
||||
$sql = "ALTER TABLE `$table`";
|
||||
if(!in_array($name, $allfields)){
|
||||
$sql.=' ADD';
|
||||
}else{
|
||||
$sql.=' MODIFY';
|
||||
}
|
||||
$sql.=" `$name`";
|
||||
$cew = '[varchar][mediumint][int][bigint][smallint][tinyint][decimal]';
|
||||
if(contain($cew,'['.$type.']')){
|
||||
if($lens=='0')$lens='10';
|
||||
$sql.=" $type($lens)";
|
||||
}else{
|
||||
$sql.=" $type";
|
||||
}
|
||||
if($isnull=='NO')$sql.=' NOT NULL';
|
||||
if($dev==''){
|
||||
//$sql.=' DEFAULT NULL';
|
||||
}else{
|
||||
$sql.=" DEFAULT '$dev'";
|
||||
}
|
||||
$sql.=" COMMENT '$sm'";
|
||||
$bo = $this->db->query($sql);
|
||||
$msg = '';
|
||||
if(!$bo)$msg='错误《'.$sql.'》';
|
||||
backmsg($msg);
|
||||
}
|
||||
|
||||
public function delfieldsAjax()
|
||||
{
|
||||
$table = $this->post('table');
|
||||
$id = $this->post('id');
|
||||
$sql = "ALTER table `$table` DROP COLUMN `$id`;";
|
||||
$msg = '';
|
||||
$bo = $this->db->query($sql);
|
||||
if(!$bo)$msg='错误《'.$sql.'》';
|
||||
backmsg($msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function tablerecord_before()
|
||||
{
|
||||
$stable = $this->post('stable','', 1);
|
||||
$key = $this->post('key');
|
||||
$fid = $this->post('fields','id');
|
||||
$this->nowtablename = $stable;
|
||||
$where = '';
|
||||
if(!isempt($key))$where=" and `$fid`='$key'";
|
||||
return array(
|
||||
'table' => $stable,
|
||||
'order' => 'id desc',
|
||||
'where' => $where
|
||||
);
|
||||
}
|
||||
public function tablerecord_after($table, $rows)
|
||||
{
|
||||
$fieldsar = array();
|
||||
if($this->loadci==1){
|
||||
$fieldsarr = $this->db->gettablefields($this->nowtablename);
|
||||
foreach($fieldsarr as $k1=>$rs1){
|
||||
$sortable = in_array($rs1['type'], array('int','date','datetime','tinyint','smallint','decimal'));
|
||||
$text = $rs1['name'];
|
||||
if(!isempt($rs1['explain']))$text.='('.$rs1['explain'].')';
|
||||
$fieldsar[] = array(
|
||||
'text' => $text,
|
||||
'dataIndex' => $rs1['name'],
|
||||
'sortable' => $sortable
|
||||
);
|
||||
}
|
||||
}
|
||||
return array(
|
||||
'fieldsarr' => $fieldsar
|
||||
);
|
||||
}
|
||||
}
|
||||
189
webmain/system/task/rock_task.php
Normal file
189
webmain/system/task/rock_task.php
Normal file
@@ -0,0 +1,189 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'task',celleditor:true,modenum:'task',sort:'sort',dir:'asc',
|
||||
columns:[{
|
||||
text:'分类',dataIndex:'fenlei',editor:true,sortable:true
|
||||
},{
|
||||
text:'名称',dataIndex:'name',editor:true,align:'left'
|
||||
},{
|
||||
text:'地址',dataIndex:'url',editor:true
|
||||
},{
|
||||
text:'频率',dataIndex:'type',editor:true
|
||||
},{
|
||||
text:'运行时间',dataIndex:'time',editor:true
|
||||
},{
|
||||
text:'运行说明',dataIndex:'ratecont',editor:true
|
||||
},{
|
||||
text:'状态',dataIndex:'status',editor:true,type:'checkbox',editor:true,sortable:true
|
||||
},{
|
||||
text:'排序号',dataIndex:'sort',editor:true,sortable:true
|
||||
},{
|
||||
text:'最后运行',dataIndex:'lastdt',sortable:true,renderer:function(v){
|
||||
return v.replace(' ','<br>');
|
||||
}
|
||||
},{
|
||||
text:'最后状态',dataIndex:'state',renderer:function(v){
|
||||
var s='<font color=#888888>待运行</font>';
|
||||
if(v==1)s='<font color=green>成功</font>';
|
||||
if(v==2)s='<font color=red>失败</font>';
|
||||
return s;
|
||||
}
|
||||
},{
|
||||
text:'最后内容',dataIndex:'lastcont'
|
||||
},{
|
||||
text:'说明',dataIndex:'explain',type:'textarea',editor:true,align:'left'
|
||||
},{
|
||||
text:'提醒给',dataIndex:'todoname'
|
||||
},{
|
||||
text:'ID',dataIndex:'id'
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del({check:function(lx){if(lx=='yes')btn(true)}});
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var h = $.bootsform({
|
||||
title:'计划任务',height:400,width:500,
|
||||
tablename:'task',isedit:lx,
|
||||
params:{int_filestype:'sort,status'},
|
||||
submitfields:'fenlei,name,url,sort,status,type,time,ratecont,todoid,todoname',
|
||||
items:[{
|
||||
labelText:'分类',name:'fenlei',required:true
|
||||
},{
|
||||
labelText:'名称',name:'name',required:true
|
||||
},{
|
||||
labelText:'运行地址',name:'url',required:true
|
||||
},{
|
||||
labelText:'频率',name:'type',required:true
|
||||
},{
|
||||
labelText:'运行时间',name:'time',required:true
|
||||
},{
|
||||
labelText:'说明',name:'ratecont'
|
||||
},{
|
||||
name:'status',labelBox:'启用',type:'checkbox',checked:true
|
||||
},{
|
||||
name:'todoid',type:'hidden'
|
||||
},{
|
||||
labelText:'通知给',type:'changeuser',changeuser:{
|
||||
type:'usercheck',idname:'todoid',title:'选择人员'
|
||||
},name:'todoname',clearbool:true
|
||||
},{
|
||||
labelText:'序号',name:'sort',type:'number',value:'0'
|
||||
}],
|
||||
success:function(){
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
if(lx==1){
|
||||
h.setValues(a.changedata);
|
||||
}
|
||||
h.getField('name').focus();
|
||||
},
|
||||
refresh:function(){
|
||||
a.reload();
|
||||
},
|
||||
creaefile:function(){
|
||||
js.msg('wait','创建中...');
|
||||
js.ajax(js.getajaxurl('creaefile','{mode}','{dir}'),{},function(s){
|
||||
js.msg('success','创建成功');
|
||||
});
|
||||
},
|
||||
yunx:function(){
|
||||
if(a.changedata.status!=1){
|
||||
js.msg('msg','没有启用不能运行');
|
||||
return;
|
||||
}
|
||||
js.msg('wait','运行中...');
|
||||
var url='task.php?m=runt&a=run&mid='+a.changeid+'';
|
||||
var ase = a.changedata.url.split(',');
|
||||
var url='task.php?m='+ase[0]+'|runt&a='+ase[1]+'&runid='+a.changeid+'';
|
||||
js.ajax(url,{},function(s){
|
||||
if(s.indexOf('success')>=0){
|
||||
if(s!='success'){
|
||||
js.msg();
|
||||
js.alert(jm.base64decode('6L!Q6KGM5oiQ5Yqf77yM6ICM5L2g5Y!v6IO955So6K6w5LqL5pys5L!u5pS557O757uf5paH5Lu25LqG77yM6K!35Yiw5L!h5ZG85a6Y572R5pCc57Si4oCc6K6w5LqL5pys4oCd5p!l55yL5biu5Yqp'));
|
||||
}else{
|
||||
js.msg('success','运行成功');
|
||||
}
|
||||
a.reload();
|
||||
}else{
|
||||
js.msg('msg','运行失败:'+s+'');
|
||||
}
|
||||
});
|
||||
},
|
||||
start:function(lx){
|
||||
js.msg('wait','处理中...');
|
||||
js.ajax(js.getajaxurl('starttask','{mode}','{dir}'),{lx:lx},function(ret){
|
||||
if(ret.success){
|
||||
js.msg('success', ret.data);
|
||||
}else{
|
||||
js.msg('msg', ret.msg);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
clearzt:function(){
|
||||
js.msg('wait','清空中...');
|
||||
js.ajax(js.getajaxurl('clearzt','{mode}','{dir}'),{},function(s){
|
||||
js.msg();
|
||||
a.reload();
|
||||
});
|
||||
},
|
||||
openanz:function(){
|
||||
js.open(js.getajaxurl('downbat','{mode}','{dir}'));
|
||||
},
|
||||
openqueue:function(){
|
||||
js.open('?a=queue&m=task&d=system');
|
||||
},
|
||||
qidong:function(){
|
||||
this.start(0);
|
||||
}
|
||||
};
|
||||
|
||||
function btn(bo){
|
||||
if(ISDEMO)return;
|
||||
get('del_{rand}').disabled = bo;
|
||||
get('edit_{rand}').disabled = bo;
|
||||
get('yun_{rand}').disabled = bo;
|
||||
}
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
<button class="btn btn-default" click="refresh" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
<button class="btn btn-default" click="clearzt" type="button">清空状态</button>
|
||||
<?php if(!COMPANYNUM){?>
|
||||
<button class="btn btn-success" click="qidong" type="button"><i class="icon-stop"></i> 启动计划任务</button>
|
||||
<?php }?>
|
||||
</td>
|
||||
|
||||
|
||||
<?php if(!COMPANYNUM){?>
|
||||
<td width="80%"> <a href="javascipt:;" click="openanz">[查看计划任务安装]</a> <a href="javascipt:;" click="openqueue">[计划任务队列]</a> <a href="<?=URLY?>view_taskrun.html"target="_blank">[帮助]</a></td>
|
||||
<?php }?>
|
||||
<td align="right" nowrap>
|
||||
|
||||
<button class="btn btn-default" id="yun_{rand}" click="yunx" disabled type="button">运行</button>
|
||||
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
<div class="tishi">提示:执行地址如[sys,beifen]也就是运行webmain/task/runt/sysAction.php文件的beifenAction方法,以此类推。频率d每天,i分钟,w周,m月,y年,h小时</div>
|
||||
89
webmain/system/task/taskAction.php
Normal file
89
webmain/system/task/taskAction.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
//计划任务列表控制器
|
||||
class taskClassAction extends Action
|
||||
{
|
||||
|
||||
public function getrunlistAjax()
|
||||
{
|
||||
$barr = m('task')->getlistrun($this->date);
|
||||
$this->returnjson($barr);
|
||||
}
|
||||
public function starttaskAjax()
|
||||
{
|
||||
$lx = (int)$this->get('lx','0');
|
||||
$tobj = m('task');
|
||||
$tobj->cleartask();
|
||||
if($lx==0){
|
||||
$carr = $tobj->pdlocal();
|
||||
if(!$carr['success'])return $carr;
|
||||
$barr = $tobj->starttask();
|
||||
if($barr['success']){
|
||||
return returnsuccess('启动成功');
|
||||
}else{
|
||||
return returnsuccess('无法启动可能未开启服务端:'.$barr['msg'].'');
|
||||
}
|
||||
}else{
|
||||
if($lx==1){
|
||||
$barr = c('xinhuapi')->starttask();
|
||||
if($barr['success'])$barr['data'] = '已通过官网服务开启计划任务';
|
||||
}
|
||||
if($lx==2){
|
||||
$barr = c('xinhuapi')->stoptask();
|
||||
if($barr['success'])$barr['data'] = '已停止使用官网计划任务';
|
||||
}
|
||||
return $barr;
|
||||
}
|
||||
}
|
||||
|
||||
public function clearztAjax()
|
||||
{
|
||||
m('task')->update('state=0,lastdt=null,lastcont=null','1=1');
|
||||
}
|
||||
|
||||
|
||||
public function downbatAjax()
|
||||
{
|
||||
$ljth = str_replace('/','\\',ROOT_PATH);
|
||||
echo '<title>计划任务开启方法</title>';
|
||||
|
||||
echo '<font color="red">如您有安装信呼服务端,就不用根据下面来开启计划任务了</font><br><a target="_blank" style="color:blue" href="'.URLY.'view_taskrun.html">查看官网上帮助</a><br>';
|
||||
echo '计划任务的运行时间需要设置为5的倍数才可以运行到。<br>';
|
||||
|
||||
|
||||
|
||||
echo '一、<b>Windows服务器</b>,可根据以下设置定时任务<br>';
|
||||
$str1 = '@echo off
|
||||
cd '.$ljth.'
|
||||
'.getconfig('phppath','php').' '.$ljth.'\task.php runt,task';
|
||||
$this->rock->createtxt(''.UPDIR.'/cli/xinhutaskrun.bat', $str1);
|
||||
echo '1、打开系统配置文件webmainConfig.php加上一个配置phppath设置php环境的目录地址如:F:\php\php-5.6.22\php.exe,设置好了,刷新本页面。<br>';
|
||||
echo '<div style="background:#caeccb;padding:5px;border:1px #888888 solid;border-radius:5px;">';
|
||||
echo "return array(<br>'title' =>'信呼OA',<br>'phppath' => 'F:\php\php-5.6.22\php.exe' <font color=#aaaaaa>//加上这个,路径如果有空格请加入环境变量,这个设置为php即可</font><br>)";
|
||||
echo '</div>';
|
||||
echo '2、在您的win服务器上,开始菜单→运行 输入 cmd 回车(管理员身份运行),输入以下命令(每5分钟运行一次):<br>';
|
||||
echo '<div style="background:#caeccb;padding:5px;border:1px #888888 solid;border-radius:5px;">';
|
||||
echo 'schtasks /create /sc DAILY /mo 1 /du "24:00" /ri 5 /sd "2017/04/01" /st "00:00:05" /tn "信呼计划任务" /ru System /tr '.$ljth.'\\'.UPDIR.'\cli\xinhutaskrun.bat';
|
||||
echo '</div>';
|
||||
|
||||
|
||||
$str1 = 'cd '.ROOT_PATH.''.chr(10).'php '.ROOT_PATH.'/task.php runt,task';
|
||||
$spath= ''.UPDIR.'/cli/xinhutaskrun.sh';
|
||||
$this->rock->createtxt($spath, $str1);
|
||||
echo '<br>二、<b>Linux服务器</b>,可用根据以下设置定时任务<br>';
|
||||
echo '根据以下命令设置运行:<br>';
|
||||
echo '<div style="background:#caeccb;padding:5px;border:1px #888888 solid;border-radius:5px;"><font color=blue>chmod</font> 777 '.ROOT_PATH.'/'.$spath.'<br>';
|
||||
echo '<font color=blue>crontab</font> -e<br>';
|
||||
echo '#信呼计划任务每5分钟运行一次<br>';
|
||||
echo '*/5 * * * * '.ROOT_PATH.'/'.$spath.'</div>';
|
||||
|
||||
echo '<br><br>三、<b>浏览器窗口运行</b>,用于你的是虚拟主机没办法管理服务器时<br>';
|
||||
echo '打开<a href="?m=task&a=queue&d=system" style="color:blue">[计划任务队列]</a> 来启用计划任务。<br>';
|
||||
}
|
||||
|
||||
public function queueAction()
|
||||
{
|
||||
$this->title = '计划任务队列';
|
||||
$tasklist = m('task')->getrunlist('',1);
|
||||
$this->smartydata['tasklist'] = $tasklist;
|
||||
}
|
||||
}
|
||||
82
webmain/system/task/tpl_task_queue.html
Normal file
82
webmain/system/task/tpl_task_queue.html
Normal file
@@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title><?=$da['title']?></title>
|
||||
<link rel="stylesheet" type="text/css" href="<?=$da['p']?>/css/css.css"/>
|
||||
<link rel="shortcut icon" href="favicon.ico" />
|
||||
<script type="text/javascript" src="js/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/js.js"></script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<div style="padding:10px">
|
||||
<div><font color="red">长时间打开这个页面,不关闭,也可以达到开启计划任务功能。</font></div>
|
||||
<div>以下是待运行任务共<span id="allshu">(<?=count($da['tasklist'])?>)</span>条,现在是:<span id="nowdate"><?=$rock->now?></span></div>
|
||||
<?php
|
||||
foreach ($da['tasklist'] as $k=>$rs){
|
||||
$oi = $k+1;
|
||||
$runtimes = date('Y-m-d H:i:s', $rs['runtime']);
|
||||
$da['tasklist'][$k]['runtimes'] = $runtimes;
|
||||
$runtimesa = explode(' ', $runtimes);
|
||||
echo '<div oi="'.$oi.'" style="padding:2px">'.$oi.'、['.$runtimesa[1].']'.$rs['name'].', <span id="zt_'.$oi.'"><font color="#888888">(待运行)</font></span></div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var tasklist = <?=json_encode($da['tasklist'])?>;
|
||||
var nowoi = 0;
|
||||
var nowdt = '';
|
||||
var alloi = tasklist.length;
|
||||
function startrun(){
|
||||
var now = js.now('now');
|
||||
var nowa = now.split(' '),bstdt = nowa[0];
|
||||
if(nowdt=='')nowdt = bstdt;
|
||||
var i,d,url;
|
||||
$('#nowdate').html(now);
|
||||
var suxh = nowoi;
|
||||
for(i= nowoi;i<nowoi+10;i++){
|
||||
d = tasklist[i];
|
||||
if(d && d.runtimes==now){
|
||||
url = d.url.split('task.php');
|
||||
if(url.length==2){
|
||||
url = 'task.php'+url[1];
|
||||
}else{
|
||||
url = d.url;
|
||||
}
|
||||
runrurl(url, i);
|
||||
suxh = i;
|
||||
alloi--;
|
||||
}
|
||||
}
|
||||
nowoi = suxh;
|
||||
$('#allshu').html('('+alloi+')');
|
||||
//到了第二天了就要刷新喽
|
||||
if(nowdt != bstdt){
|
||||
location.reload();
|
||||
}
|
||||
setTimeout('startrun()',1000);
|
||||
}
|
||||
function runrurl(url, i){
|
||||
var oi = i+1;
|
||||
var o = $('#zt_'+oi+'');
|
||||
o.html('<font color="#ff6600">运行中</font>');
|
||||
$.get(url, function(s){
|
||||
if(s=='success'){
|
||||
o.html('<font color="green">运行成功</font>');
|
||||
}else{
|
||||
o.html('<font color="red">运行失败</font>');
|
||||
}
|
||||
});
|
||||
}
|
||||
startrun();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
70
webmain/system/txcloud/rock_txcloud_cog.php
Normal file
70
webmain/system/txcloud/rock_txcloud_cog.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var c={
|
||||
init:function(){
|
||||
$.get(js.getajaxurl('getset','{mode}','{dir}'), function(s){
|
||||
var a=js.decode(s);
|
||||
get('txcloud_secretid_{rand}').value=a.secretid;
|
||||
get('txcloud_secretkey_{rand}').value=a.secretkey;
|
||||
get('txcloud_rlroupid_{rand}').value=a.rlroupid;
|
||||
});
|
||||
},
|
||||
save:function(o){
|
||||
var d={};
|
||||
d.secretid = get('txcloud_secretid_{rand}').value;
|
||||
d.secretkey = get('txcloud_secretkey_{rand}').value;
|
||||
d.rlroupid = get('txcloud_rlroupid_{rand}').value;
|
||||
js.msg('wait','保存中...');
|
||||
js.ajax(js.getajaxurl('setsave','{mode}','{dir}'), d, function(s){
|
||||
js.msg('success','保存成功');
|
||||
},'post');
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
c.init();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<div align="left">
|
||||
<div style="padding:10px;">
|
||||
|
||||
|
||||
|
||||
<table cellspacing="0" width="650" border="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td align="right"><font color=red>*</font> API密钥SecretId:</td>
|
||||
<td class="tdinput"><input id="txcloud_secretid_{rand}" onblur="this.value=strreplace(this.value)" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"><font color=red>*</font> API密钥SecretKey:</td>
|
||||
<td class="tdinput"><input id="txcloud_secretkey_{rand}" onblur="this.value=strreplace(this.value)" class="form-control">
|
||||
<font id="showddd_{rand}" color="#888888">请到<a href="https://console.cloud.tencent.com/cam/capi" target="_blank">[腾讯云管理后台]</a>下获取。</font>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><div class="inputtitle">产品应用设置</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">使用人脸人员库ID:</td>
|
||||
<td class="tdinput"><input onblur="this.value=strreplace(this.value)" id="txcloud_rlroupid_{rand}" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right"></td>
|
||||
<td style="padding:15px 0px" colspan="3" align="left"><button click="save" class="btn btn-success" type="button"><i class="icon-save"></i> 保存</button>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
16
webmain/system/txcloud/rock_txcloud_objfile.php
Normal file
16
webmain/system/txcloud/rock_txcloud_objfile.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
|
||||
var c = {
|
||||
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<div id="view_{rand}"><h1>文件上传到腾讯云的对象存储中</h1><br>查看这个<a target="_blank" href="<?=URLY?>view_txcos.html">帮助</a>去配置。</div>
|
||||
100
webmain/system/txcloud/rock_txcloud_renlian.php
Normal file
100
webmain/system/txcloud/rock_txcloud_renlian.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'wxtx_renlian',celleditor:true,fanye:true,statuschange:true,
|
||||
url:publicstore('{mode}','{dir}'),storebeforeaction:'beforeuserdshow',storeafteraction:'aftereuserdshow',
|
||||
columns:[{
|
||||
text:'姓名',dataIndex:'personname',sortable:true
|
||||
},{
|
||||
text:'人员库ID',dataIndex:'personid'
|
||||
},{
|
||||
text:'人脸图片数',dataIndex:'imgshu'
|
||||
},{
|
||||
text:'启用',dataIndex:'status',type:'checkbox',editor:true,sortable:true
|
||||
},{
|
||||
text:'关联OA用户ID',dataIndex:'uid',editor:true,type:'number'
|
||||
},{
|
||||
text:'关联OA用户姓名',dataIndex:'name'
|
||||
},{
|
||||
text:'关联OA用户部门',dataIndex:'deptallname'
|
||||
}],
|
||||
itemclick:function(){
|
||||
get('delbtn{rand}').disabled=false;
|
||||
},
|
||||
beforeload:function(){
|
||||
get('delbtn{rand}').disabled=true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
var c = {
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
},
|
||||
getlist:function(){
|
||||
js.msg('wait','获取中...');
|
||||
js.ajax(js.getajaxurl('reloaduser','{mode}', '{dir}'),{}, function(d){
|
||||
if(d.success){
|
||||
js.msg('success', d.data);
|
||||
a.reload();
|
||||
}else{
|
||||
js.msg('msg', d.msg);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
delaluser:function(){
|
||||
a.del({url:js.getajaxurl('delrenlian','{mode}','{dir}')});
|
||||
},
|
||||
adduser:function(){
|
||||
var h = $.bootsform({
|
||||
title:'用户人脸',height:400,width:500,
|
||||
tablename:'wxtx_renlian',isedit:0,
|
||||
url:js.getajaxurl('createurenlian','{mode}','{dir}'),
|
||||
submitfields:'uid,personname',
|
||||
items:[{
|
||||
name:'uid',type:'hidden'
|
||||
},{
|
||||
labelText:'对应用户',type:'changeuser',changeuser:{
|
||||
type:'user',idname:'uid',title:'选择uid'
|
||||
},name:'personname',clearbool:true,required:true
|
||||
},{
|
||||
labelText:'人脸图片地址',name:'imgurl',blankText:'系统目录下图片,不能超过1M,60x60像素以上'
|
||||
}],
|
||||
success:function(){
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding-right:10px"><button class="btn btn-primary" click="adduser" type="button"><i class="icon-plus"></i> 创建人员</button></td>
|
||||
<td style="padding-right:10px"><button class="btn btn-default" click="getlist" type="button">获取人脸用户库上人员</button></td>
|
||||
<td>
|
||||
<div class="input-group" style="width:250px;">
|
||||
<input class="form-control" id="key_{rand}" placeholder="姓名/关联用户部门">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="search" type="button"><i class="icon-search"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td width="90%" style="padding-left:10px">
|
||||
|
||||
</td>
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-danger" disabled id="delbtn{rand}" click="delaluser" type="button">删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
81
webmain/system/txcloud/txcloudAction.php
Normal file
81
webmain/system/txcloud/txcloudAction.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
class txcloudClassAction extends Action
|
||||
{
|
||||
|
||||
|
||||
public function setsaveAjax()
|
||||
{
|
||||
$secretid = $this->post('secretid');
|
||||
$secretkey = $this->post('secretkey');
|
||||
if(!contain($secretid,'****'))
|
||||
$this->option->setval('txcloud_secretid@-6', $this->jm->encrypt($secretid));
|
||||
if(!contain($secretkey,'****'))
|
||||
$this->option->setval('txcloud_secretkey@-6', $this->jm->encrypt($secretkey));
|
||||
|
||||
$this->option->setval('txcloud_rlroupid@-6', $this->post('rlroupid'));
|
||||
$this->backmsg();
|
||||
}
|
||||
|
||||
public function getsetAjax()
|
||||
{
|
||||
$arr= array();
|
||||
$arr['secretid'] = $this->option->getval('txcloud_secretid');
|
||||
$arr['secretkey'] = $this->option->getval('txcloud_secretkey');
|
||||
$arr['rlroupid'] = $this->option->getval('txcloud_rlroupid');
|
||||
if(!isempt($arr['secretid'])){
|
||||
$secretid = $this->jm->uncrypt($arr['secretid']);
|
||||
$arr['secretid'] = substr($secretid,0,5).'******'.substr($secretid,-5);
|
||||
}
|
||||
if(!isempt($arr['secretkey'])){
|
||||
$secretkey = $this->jm->uncrypt($arr['secretkey']);
|
||||
$arr['secretkey'] = substr($secretkey,0,5).'******'.substr($secretkey,-5);
|
||||
}
|
||||
echo json_encode($arr);
|
||||
}
|
||||
|
||||
//获取
|
||||
public function reloaduserAjax()
|
||||
{
|
||||
return m('txcloud:renlian')->GetPersonList();
|
||||
}
|
||||
|
||||
//删除
|
||||
public function delrenlianAjax()
|
||||
{
|
||||
return m('txcloud:renlian')->deleteRenlian((int)$this->post('id','0'));
|
||||
}
|
||||
|
||||
public function beforeuserdshow($table)
|
||||
{
|
||||
$where = '';
|
||||
$key = $this->post('key');
|
||||
if(!isempt($key))$where=" and (a.`personname` like '%$key%' or b.`deptallname` like '%$key%')";
|
||||
return array(
|
||||
'where' => $where,
|
||||
'fields'=> 'a.*,b.name,b.deptallname',
|
||||
'table' => '`[Q]'.$table.'` a left join `[Q]admin` b on a.uid=b.id'
|
||||
);
|
||||
}
|
||||
public function aftereuserdshow($table, $rows)
|
||||
{
|
||||
foreach($rows as $k=>$rs){
|
||||
if($rs['uid']>0 && $rs['personname']!=$rs['name']){
|
||||
$rows[$k]['name'].='<font color=red>,关联的姓名不一样</font>';
|
||||
}
|
||||
if(!isempt($rs['faceids']))$rows[$k]['imgshu'] = count(explode(',', $rs['faceids']));
|
||||
}
|
||||
return array(
|
||||
'rows' => $rows
|
||||
);
|
||||
}
|
||||
//创建用户
|
||||
public function createurenlianAjax()
|
||||
{
|
||||
return m('txcloud:renlian')->createUser(array(
|
||||
'id' => (int)$this->post('id'),
|
||||
'uid' => (int)$this->post('uid'),
|
||||
'personname' => $this->post('personname'),
|
||||
'imgurl' => $this->post('imgurl'),
|
||||
));
|
||||
}
|
||||
}
|
||||
207
webmain/system/upgrade/rock_upgrade.php
Normal file
207
webmain/system/upgrade/rock_upgrade.php
Normal file
@@ -0,0 +1,207 @@
|
||||
<?php defined('HOST') or die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var istongbu=false,wodekey='';
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'chargems',url:js.getajaxurl('data','{mode}','{dir}'),
|
||||
columns:[{
|
||||
text:'名称',dataIndex:'name'
|
||||
},{
|
||||
text:'说明',dataIndex:'explain',align:'left',width:'45%'
|
||||
},{
|
||||
text:'更新时间',dataIndex:'updatedt'
|
||||
},{
|
||||
text:'价格',dataIndex:'price',renderer:function(v){
|
||||
var s='<font color=#ff6600>免费</font>';
|
||||
if(v==1)s='<font color=gray>授权版可用</font>';
|
||||
if(v>1)s=v+'元';
|
||||
return s;
|
||||
}
|
||||
},{
|
||||
text:'详情',dataIndex:'view'
|
||||
},{
|
||||
text:'操作',dataIndex:'opt',align:'left',renderer:function(v,d){
|
||||
if(d.isaz=='0')return '<font color=#888888>无需安装</font>';
|
||||
var s='';
|
||||
if(v==1)s='<font color=green>已安装</font> ';
|
||||
if(v==2)s='<button onclick="upsho{rand}(2,'+d.id+',\''+d.key+'\')" class="btn btn-danger btn-sm" type="button">升级</button>';
|
||||
if(v==0)s='<button onclick="upsho{rand}(0,'+d.id+',\''+d.key+'\')" class="btn btn-info btn-sm" type="button">安装</button>';
|
||||
if(v==0||v==2){
|
||||
if(d.price=='0')s+=' <a href="javascript:;" onclick="downup{rand}('+d.id+',\''+d.name+'\')">文件对比</a>';
|
||||
$('#shiw_{rand}').html('有系统模块需要升级/安装!');
|
||||
}
|
||||
if(d.id=='1'){
|
||||
istongbu=false;
|
||||
if(v==1){
|
||||
istongbu=true;
|
||||
}
|
||||
}
|
||||
return '<span id="msg'+d.id+'_{rand}">'+s+'</span>';
|
||||
}
|
||||
}],
|
||||
beforeload:function(){
|
||||
istongbu=false;
|
||||
$('#shiw_{rand}').html('');
|
||||
get('resede_{rand}').disabled=true;
|
||||
},
|
||||
itemclick:function(){
|
||||
get('resede_{rand}').disabled=false;
|
||||
},
|
||||
load:function(d){
|
||||
wodekey=d.wodekey;
|
||||
}
|
||||
});
|
||||
|
||||
var c={
|
||||
reloads:function(){
|
||||
a.reload();
|
||||
},
|
||||
bool:false,
|
||||
upsho:function(lx,id,key, slx){
|
||||
if(this.bool){js.msg('msg','其他模块升级中,请稍后');return;}
|
||||
var msgid='msg'+id+'_{rand}',lxs='安装';
|
||||
if(lx==2)lxs='升级';
|
||||
js.setmsg(''+lxs+'中...','', msgid);
|
||||
this.msgid = msgid;
|
||||
this.lxsss = lxs;
|
||||
this.upadd = {id:id,key:key,slx:slx};
|
||||
this.bool = true;
|
||||
js.ajax(js.getajaxurl('shengjian','{mode}','{dir}'),this.upadd,function(d){
|
||||
if(d.success){
|
||||
c.uparr = d.data;
|
||||
c.upstart(0);
|
||||
}else{
|
||||
c.bool=false;
|
||||
js.setmsg(d.msg,'red', c.msgid);
|
||||
}
|
||||
},'post,json',function(s){
|
||||
c.bool=false;
|
||||
js.setmsg(s,'red', c.msgid);
|
||||
});
|
||||
},
|
||||
upstart:function(oi){
|
||||
var len = this.uparr.length,lxs = this.lxsss;
|
||||
var ad = this.upadd;
|
||||
if(oi>=len){
|
||||
js.setmsg(''+lxs+'完成','green', this.msgid);
|
||||
if(ad.id=='1'){
|
||||
js.confirm('系统核心文件升级完成需要重新进入系统哦!',function(jg){
|
||||
location.reload();
|
||||
});
|
||||
}else{
|
||||
a.reload();
|
||||
}
|
||||
c.bool=false;
|
||||
return;
|
||||
}
|
||||
var d = this.uparr[oi];
|
||||
js.setmsg(''+lxs+'中('+len+'/'+(oi+1)+')...','', this.msgid);
|
||||
ad.fileid = d.id;
|
||||
ad.updatedt = d.updatedt;
|
||||
ad.lens = len;
|
||||
ad.oii = oi;
|
||||
ad.ban = jm.encrypt($(jm.base64decode('I2hvbWVmb290ZXI:')).html(),wodekey);
|
||||
js.ajax(js.getajaxurl('shengjianss','{mode}','{dir}'),ad,function(s){
|
||||
if(s=='ok'){
|
||||
c.upstart(oi+1);
|
||||
}else{
|
||||
c.bool=false;
|
||||
js.setmsg(s,'red', c.msgid);
|
||||
}
|
||||
},'post',function(s){
|
||||
c.bool=false;
|
||||
js.setmsg(s,'red', c.msgid);
|
||||
});
|
||||
},
|
||||
upshos:function(lx,id,kes){
|
||||
if(kes=='null')kes='';
|
||||
if(id==22&&!istongbu){
|
||||
js.alert('请先升级系统到最新才能安装');
|
||||
return;
|
||||
}
|
||||
js.prompt('模块安装','安装key(免费模块可不输入,直接点确定)',function(lxbd,msg){
|
||||
if(lxbd=='yes'){
|
||||
c.upsho(lx,id,msg, 0);
|
||||
}
|
||||
},kes);
|
||||
},
|
||||
tontbudata:function(lx, o,snum){
|
||||
o.innerHTML=js.getmsg('同步中...');
|
||||
if(!snum)snum='';
|
||||
var ad = {'lx':lx,'snum':snum};
|
||||
ad.ban = jm.encrypt($(jm.base64decode('I2hvbWVmb290ZXI:')).html(),wodekey);
|
||||
js.ajax(js.getajaxurl('tontbudata','{mode}','{dir}'),ad,function(s){
|
||||
o.innerHTML=js.getmsg(s,'green');
|
||||
});
|
||||
},
|
||||
delreload:function(){
|
||||
a.del({
|
||||
url:js.getajaxurl('delmodel', '{mode}','{dir}'),
|
||||
msg:'确定要删除选中模块后可重新安装的!'
|
||||
});
|
||||
},
|
||||
lianwcs:function(){
|
||||
js.open('?m=index&a=testnet');
|
||||
}
|
||||
};
|
||||
upsho{rand}=function(lx,id,kes){
|
||||
if(ISDEMO){js.msg('msg','演示系统不要操作');return;}
|
||||
c.upshos(lx,id,kes);
|
||||
}
|
||||
downup{rand}=function(id,na){
|
||||
addtabs({num:'upgradefile'+id+'','url':'system,upgrade,file,id='+id+'','name':'['+na+']文件对比'});
|
||||
}
|
||||
js.initbtn(c);
|
||||
|
||||
upfetwontbu=function(lx, o){
|
||||
if(ISDEMO){js.msg('msg','演示系统不要操作');return;}
|
||||
if(!istongbu && lx!=3){
|
||||
js.alert('请先升级系统到最新才能同步');
|
||||
return;
|
||||
}
|
||||
if(lx==5){
|
||||
js.prompt('从官网中拉取模块同步','输入要同步的模块编号如(gong):将会覆盖你模块设置。', function(jg,txt){
|
||||
if(jg=='yes' && txt)c.tontbudata(lx, o, txt);
|
||||
});
|
||||
return;
|
||||
}
|
||||
js.confirm('谨慎啊,确定要同步嘛?同步了将覆盖你原先配置好的哦!',function(jg){
|
||||
if(jg=='yes')c.tontbudata(lx, o);
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-default" click="reloads" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
<button class="btn btn-default" click="lianwcs" type="button">测试联网</button>
|
||||
<font color="red" id="shiw_{rand}"></font>
|
||||
</td>
|
||||
<td align="right">
|
||||
<button class="btn btn-default" click="delreload" disabled id="resede_{rand}" type="button">删除重新安装</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="blank10"></div>
|
||||
<div><h4><b>系统同步:</b></h4></div>
|
||||
<div class="blank10"></div>
|
||||
<div>1、同步菜单,系统上操作菜单会和官网同步,也可到【系统→菜单管理】下管理。<a onclick="upfetwontbu(0,this)" href="javascript:;">[同步]</a></div>
|
||||
<div class="blank10"></div>
|
||||
<div>2、同步流程模块,流程模块会和官网同步,也可到【流程模块】下管理。<a onclick="upfetwontbu(1,this)" href="javascript:;">[1.同步]</a>,<a onclick="upfetwontbu(4,this)" href="javascript:;">[2.同步完全和官网一致]</a>,<a onclick="upfetwontbu(5,this)" href="javascript:;">[3.根据模块完成同步]</a></div>
|
||||
<div style="color:#888888"><font color=white>2、</font>[1.同步]:同步了不会覆盖自己的配置信息,[2.同步完全和官网一致]:会完成和官网一致,同时会删除自己配置和新建的模块,谨慎。[3.根据模块完成同步]:自己选择模块编号同步。</div>
|
||||
<!--<div><font color=white>2、</font>输入要同步的模块编号:<input style="width:250px" placeholder="模块编号多个,分开,输入all为全部" class="inputs"></div>-->
|
||||
<div class="blank10"></div>
|
||||
<div>3、同步桌面版/手机上应用,应用会和官网同步,也可到【系统→即时通信管理→应用管理】下管理。<a onclick="upfetwontbu(2,this)" href="javascript:;">[同步]</a></div>
|
||||
<div class="blank10"></div>
|
||||
<div>4、<font color=red>建议同步计划任务</font>,让系统更好运行,计划任务会和官网同步,也可到【系统→系统工具→计划任务】下管理。<a onclick="upfetwontbu(3,this)" href="javascript:;">[同步]</a></div>
|
||||
<div class="blank10"></div>
|
||||
<div><h4><b>更多升级方法:</b></h4></div>
|
||||
<div style="line-height:35px">
|
||||
1、使用svn/git地址升级(推荐),地址:<a href="https://gitee.com/rainrock/xinhu" target="_blank">https://gitee.com/rainrock/xinhu</a>,<a href="https://github.com/rainrocka/xinhu" target="_blank">https://github.com/rainrocka/xinhu</a><br>
|
||||
2、去官网下载源码全部覆盖升级,如果您自己修改,请谨慎覆盖。<br>
|
||||
3、根据列表升级安装。
|
||||
</div>
|
||||
66
webmain/system/upgrade/rock_upgrade_file.php
Normal file
66
webmain/system/upgrade/rock_upgrade_file.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php defined('HOST') or die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params}
|
||||
var id = params.id;
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'chargems',url:js.getajaxurl('datadubi','{mode}','{dir}',{id:id}),
|
||||
checked:true,
|
||||
columns:[{
|
||||
text:'类型',dataIndex:'type',renderer:function(v){
|
||||
var s='文件';
|
||||
if(v==1)s='数据库';
|
||||
return s;
|
||||
}
|
||||
},{
|
||||
text:'文件路径',dataIndex:'filepath',align:'left'
|
||||
},{
|
||||
text:'文件大小',dataIndex:'filesize'
|
||||
},{
|
||||
text:'文件说明',dataIndex:'explain'
|
||||
},{
|
||||
text:'',dataIndex:'ishui',renderer:function(v, d){
|
||||
var s='<font color="green">可更新</font>';
|
||||
if(v==1)s='已忽略';
|
||||
if(d.ting=='1')s='不同步更新模块';
|
||||
return s;
|
||||
}
|
||||
},{
|
||||
text:'状态',dataIndex:'zt'
|
||||
}]
|
||||
});
|
||||
|
||||
var c={
|
||||
reloads:function(){
|
||||
a.reload();
|
||||
},
|
||||
huliesss:function(o1,lx){
|
||||
var sid = a.getchecked();
|
||||
if(sid==''){js.msg('msg','没有选中行');return;}
|
||||
|
||||
js.ajax(js.getajaxurl('hullue','{mode}','{dir}'),{sid:sid,id:id,lx:lx},function(s){
|
||||
a.reload();
|
||||
},'post','','处理中...,处理完成');
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-default" click="reloads" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
</td>
|
||||
<td align="right">
|
||||
<button class="btn btn-default" click="huliesss,0" type="button">忽略选中文件更新</button>
|
||||
<button class="btn btn-default" click="huliesss,1" type="button">取消忽略选中文件更新</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="tishi">没有记录表示没有可更新文件。</div>
|
||||
118
webmain/system/upgrade/rock_upgrade_install.php
Normal file
118
webmain/system/upgrade/rock_upgrade_install.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params}
|
||||
var path = params.path;
|
||||
|
||||
var c={
|
||||
menuarr:{},
|
||||
init:function(){
|
||||
this.setmsg('加载中...');
|
||||
this.loadmode(path);
|
||||
},
|
||||
save:function(o1){
|
||||
var csn = {'path':path};
|
||||
for(var i in this.menuarr){
|
||||
if(this.menuarr[i]=='-1'){
|
||||
|
||||
}
|
||||
csn['menupid'+i+'']=this.menuarr[i];
|
||||
}
|
||||
o1.disabled = true;
|
||||
this.setmsg('安装中...');
|
||||
js.ajax(js.getajaxurl('newinstallinfo','{mode}','{dir}'),csn,function(ret){
|
||||
if(ret!='ok'){
|
||||
c.setmsg(ret);
|
||||
o1.disabled = false;
|
||||
}else{
|
||||
c.setmsg('');
|
||||
js.msgok('安装完成可刷新查看效果');
|
||||
}
|
||||
});
|
||||
},
|
||||
setmsg:function(st){
|
||||
js.setmsg(st,'', 'msgview_{rand}');
|
||||
},
|
||||
loadmode:function(ljs){
|
||||
js.ajax(js.getajaxurl('loadinstallinfo','{mode}','{dir}'),{path:ljs},function(ret){
|
||||
if(!ret.success){
|
||||
js.msgerror(ret.msg);
|
||||
get('btn_{rand}').disabled=true;
|
||||
}else{
|
||||
c.showdata(ret.data);
|
||||
}
|
||||
c.setmsg('');
|
||||
},'get,json');
|
||||
},
|
||||
showdata:function(da){
|
||||
$('#ver_{rand}').html(da.ver);
|
||||
$('#name_{rand}').html(da.name);
|
||||
$('#zuozhe_{rand}').html(da.zuozhe);
|
||||
$('#explain_{rand}').html(da.explain);
|
||||
$('#filesizecn_{rand}').html(da.filesizecn);
|
||||
$('#modelist_{rand}').html(da.modestr);
|
||||
$('#tablelist_{rand}').html(da.tablestr);
|
||||
$('#menulist_{rand}').html(da.menustr);
|
||||
$('#agentlist_{rand}').html(da.agentstr);
|
||||
$('#filelist_{rand}').html(da.filestr);
|
||||
this.menuarr = da.menuarr;
|
||||
path = da.pathstr;
|
||||
js.initbtn(c);
|
||||
},
|
||||
xuancaid:function(o1, id){
|
||||
$.selectdata({
|
||||
title:'选择上级菜单',
|
||||
url:js.getajaxurl('getmenu','{mode}','{dir}'),
|
||||
checked:false,maxshow:500,
|
||||
onselect:function(d1,sna,sid){
|
||||
o1.value='已选【'+sna+'】';
|
||||
c.menuarr[id] = sid;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
c.init();
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<div style="padding:10px" align="center">
|
||||
<div style="max-width:730px" align="left">
|
||||
|
||||
<h3>安装zip包信息</h3>
|
||||
|
||||
<div style="border-bottom:1px #cccccc solid"></div>
|
||||
<div>
|
||||
<div><font color="gray">名称:</font><span id="name_{rand}"></span> <font color="gray">版本:</font><span id="ver_{rand}"></span> <font color="gray">作者:</font><span id="zuozhe_{rand}"></span> <font color="gray">文件大小:</font><span id="filesizecn_{rand}"></span>
|
||||
</div>
|
||||
<div><font color="gray">说明:</font><span id="explain_{rand}"></span></div>
|
||||
|
||||
</div>
|
||||
|
||||
<h4>包含的模块</h4>
|
||||
<div style="border-bottom:1px #cccccc solid"></div>
|
||||
<div class="wrap" id="modelist_{rand}"></div>
|
||||
|
||||
<h4>包含数据库</h4>
|
||||
<div style="border-bottom:1px #cccccc solid"></div>
|
||||
<div class="wrap" id="tablelist_{rand}"></div>
|
||||
|
||||
<h4>包含的文件</h4>
|
||||
<div style="border-bottom:1px #cccccc solid"></div>
|
||||
<div class="wrap" id="filelist_{rand}"></div>
|
||||
|
||||
<h4>包含的菜单(不选上级菜单就是不添加菜单)</h4>
|
||||
<div style="border-bottom:1px #cccccc solid"></div>
|
||||
<div class="wrap" id="menulist_{rand}"></div>
|
||||
|
||||
<h4>包含的应用</h4>
|
||||
<div style="border-bottom:1px #cccccc solid"></div>
|
||||
<div class="wrap" id="agentlist_{rand}"></div>
|
||||
|
||||
<div class="blank10"></div>
|
||||
<div >
|
||||
<button class="btn btn-success" id="btn_{rand}" click="save" type="button">确定安装</button> <span id="msgview_{rand}"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
107
webmain/system/upgrade/rock_upgrade_other.php
Normal file
107
webmain/system/upgrade/rock_upgrade_other.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?php defined('HOST') or die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params}
|
||||
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'chargems',url:js.getajaxurl('otherdata','{mode}','{dir}'),fanye:true,method:'get',
|
||||
columns:[{
|
||||
text:'名称',dataIndex:'name'
|
||||
},{
|
||||
text:'类型',dataIndex:'typename'
|
||||
},{
|
||||
text:'版本',dataIndex:'version'
|
||||
},{
|
||||
text:'作者',dataIndex:'zuozhe'
|
||||
},{
|
||||
text:'发布者',dataIndex:'fabuzhe'
|
||||
},{
|
||||
text:'价格',dataIndex:'money',sortable:true,renderer:function(v){
|
||||
if(v=='0')v='免费';
|
||||
return v;
|
||||
}
|
||||
},{
|
||||
text:'说明',dataIndex:'explain',align:'left'
|
||||
},{
|
||||
text:'更新时间',dataIndex:'updatedt'
|
||||
},{
|
||||
text:'客服',dataIndex:'behst',renderer:function(v,d){
|
||||
return '<a href="'+d.kefuurl+'" target="_blank"><i class="icon-comment-alt"></i>客服</a>';
|
||||
}
|
||||
},{
|
||||
text:'',dataIndex:'anzt',renderer:function(v,d){
|
||||
var s = ' ';
|
||||
if(v==1)s='<font color=green>已安装</font> ';
|
||||
if(v==2)s='<button onclick="upsho{rand}.install(2,'+d.id+')" class="btn btn-danger btn-sm" type="button">升级</button>';
|
||||
if(v==0)s='<button onclick="upsho{rand}.install(0,'+d.id+')" class="btn btn-info btn-sm" type="button">安装</button>';
|
||||
return '<span id="msg'+d.id+'_{rand}">'+s+'</span>';
|
||||
}
|
||||
}],
|
||||
beforeload:function(){
|
||||
get('resede_{rand}').disabled=true;
|
||||
},
|
||||
itemclick:function(){
|
||||
get('resede_{rand}').disabled=false;
|
||||
}
|
||||
});
|
||||
|
||||
var c={
|
||||
reloads:function(){
|
||||
a.reload();
|
||||
},
|
||||
huliesss:function(){
|
||||
js.upload('_zpichangback',{maxup:'1','title':'选择要安装的zip包',uptype:'zip','urlparams':'noasyn:yes'});
|
||||
},
|
||||
bool:false,
|
||||
install:function(lx,id){
|
||||
if(this.bool)return;
|
||||
var msgid='msg'+id+'_{rand}',lxs='安装';
|
||||
if(lx==2)lxs='升级';
|
||||
js.setmsg(''+lxs+'中...','', msgid);
|
||||
this.bool = true;
|
||||
js.ajax(js.getajaxurl('otherinstall','{mode}','{dir}'),{id:id},function(ret){
|
||||
c.bool = false;
|
||||
if(ret.success){
|
||||
js.setmsg(ret.data.msg,'green', msgid);
|
||||
addtabs({name:'模块插件['+ret.data.name+']安装',num:'zipinstall',url:'system,upgrade,install,path='+jm.base64encode(ret.data.path)+''});
|
||||
}else{
|
||||
js.setmsg(ret.msg,'', msgid);
|
||||
}
|
||||
},'get,json');
|
||||
},
|
||||
delreload:function(){
|
||||
a.del({
|
||||
url:js.getajaxurl('delother', '{mode}','{dir}'),
|
||||
msg:'确定要删除选中模块插件后可重新安装的!'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c);
|
||||
|
||||
_zpichangback=function(da){
|
||||
if(da[0]){
|
||||
addtabs({name:'zip模块插件安装',num:'zipinstall',url:'system,upgrade,install,path='+jm.base64encode(da[0].filepath)+''});
|
||||
}
|
||||
}
|
||||
upsho{rand} = c;
|
||||
if(ISDEMO || adminid!=1)get('upbtnd{rand}').disabled=true;
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
<h4>此列表模块插件来自信呼开发团队,<a href="<?=URLY?>view_anbao.html"target="_blank">进去看看</a><h4>
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
</td>
|
||||
<td align="right">
|
||||
<button class="btn btn-default" id="upbtnd{rand}" click="huliesss,0" style="<?php if(!getconfig('rockinzip'))echo 'display:none;'; ?>" type="button">本地上传安装</button>
|
||||
<button class="btn btn-default" click="delreload" disabled id="resede_{rand}" type="button">删除重新安装</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
8
webmain/system/upgrade/upgradeAction.php
Normal file
8
webmain/system/upgrade/upgradeAction.php
Normal file
File diff suppressed because one or more lines are too long
1
webmain/system/wding/rock_wding_cog.php
Normal file
1
webmain/system/wding/rock_wding_cog.php
Normal file
@@ -0,0 +1 @@
|
||||
<div style="font-size:30px;padding:100px">信呼的钉钉办公模块,需要购买,去<a href="http://www.rockoa.com/view_ding.html" target="_blank" style="font-size:30px">【看看】</a></div>
|
||||
1
webmain/system/wding/rock_wding_dept.php
Normal file
1
webmain/system/wding/rock_wding_dept.php
Normal file
@@ -0,0 +1 @@
|
||||
<div style="font-size:30px;padding:100px">信呼的钉钉办公模块,需要购买,去<a href="http://www.rockoa.com/view_ding.html" target="_blank" style="font-size:30px">【看看】</a></div>
|
||||
1
webmain/system/wding/rock_wding_user.php
Normal file
1
webmain/system/wding/rock_wding_user.php
Normal file
@@ -0,0 +1 @@
|
||||
<div style="font-size:30px;padding:100px">信呼的钉钉办公模块,需要购买,去<a href="http://www.rockoa.com/view_ding.html" target="_blank" style="font-size:30px">【看看】</a></div>
|
||||
1
webmain/system/wding/rock_wding_ying.php
Normal file
1
webmain/system/wding/rock_wding_ying.php
Normal file
@@ -0,0 +1 @@
|
||||
<div style="font-size:30px;padding:100px">信呼的钉钉办公模块,需要购买,去<a href="http://www.rockoa.com/view_ding.html" target="_blank" style="font-size:30px">【看看】</a></div>
|
||||
1
webmain/system/weixinqy/rock_weixinqy_cog.php
Normal file
1
webmain/system/weixinqy/rock_weixinqy_cog.php
Normal file
@@ -0,0 +1 @@
|
||||
<div style="font-size:30px;padding:100px">信呼的企业微信模块,需要购买,去<a href="http://www.rockoa.com/view_weixinqy.html" target="_blank" style="font-size:30px">【看看】</a></div>
|
||||
1
webmain/system/weixinqy/rock_weixinqy_dept.php
Normal file
1
webmain/system/weixinqy/rock_weixinqy_dept.php
Normal file
@@ -0,0 +1 @@
|
||||
<div style="font-size:30px;padding:100px">信呼的企业微信模块,需要购买,去<a href="http://www.rockoa.com/view_weixinqy.html" target="_blank" style="font-size:30px">【看看】</a></div>
|
||||
1
webmain/system/weixinqy/rock_weixinqy_user.php
Normal file
1
webmain/system/weixinqy/rock_weixinqy_user.php
Normal file
@@ -0,0 +1 @@
|
||||
<div style="font-size:30px;padding:100px">信呼的企业微信模块,需要购买,去<a href="http://www.rockoa.com/view_weixinqy.html" target="_blank" style="font-size:30px">【看看】</a></div>
|
||||
1
webmain/system/weixinqy/rock_weixinqy_ying.php
Normal file
1
webmain/system/weixinqy/rock_weixinqy_ying.php
Normal file
@@ -0,0 +1 @@
|
||||
<div style="font-size:30px;padding:100px">信呼的企业微信模块,需要购买,去<a href="http://www.rockoa.com/view_weixinqy.html" target="_blank" style="font-size:30px">【看看】</a></div>
|
||||
312
webmain/system/word/rock_word_guan.php
Normal file
312
webmain/system/word/rock_word_guan.php
Normal file
@@ -0,0 +1,312 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params};
|
||||
var num = params.num,pid,optlx=0,movefid='',showlx=params.showlx;
|
||||
var typeid=0,sspid=0;
|
||||
if(!showlx)showlx = '0';
|
||||
var sname = '个人';
|
||||
if(showlx=='1'){
|
||||
sname = '部门';
|
||||
}
|
||||
var at = $('#optionview_{rand}').bootstree({
|
||||
url:js.getajaxurl('getmywordtype','word','system'),params:{showlx:showlx},
|
||||
columns:[{
|
||||
text:''+sname+'文档类型',dataIndex:'name',align:'left',xtype:'treecolumn',width:'79%',renderer:function(v,d){
|
||||
var s1 = v;
|
||||
if(!isempt(d.recename))s1+=' <span style="font-size:10px;color:#888888"><i title="共享给:'+d.recename+'" class="icon-share-alt"></i></span>';
|
||||
return s1;
|
||||
}
|
||||
},{
|
||||
text:'序号',dataIndex:'sort',width:'20%'
|
||||
}],
|
||||
load:function(d){
|
||||
if(sspid==0){
|
||||
typeid = d.pid;
|
||||
sspid = d.pid;
|
||||
c.loadfile('0','所有文档');
|
||||
}
|
||||
},
|
||||
itemdblclick:function(d){
|
||||
typeid = d.id;
|
||||
c.loadfile(d.id,d.name);
|
||||
},
|
||||
itemclick:function(d){
|
||||
c.typeclidks(d);
|
||||
c.ismoveok(d);
|
||||
}
|
||||
});
|
||||
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'file',celleditor:true,autoLoad:false,checked:true,modedir:'{mode}:{dir}',storebeforeaction:'wordbeforeaction',fanye:true,params:{showlx:showlx},
|
||||
columns:[{
|
||||
text:'',dataIndex:'fileext',renderer:function(v){
|
||||
var lxs = js.filelxext(v);
|
||||
return '<img src="web/images/fileicons/'+lxs+'.gif">';
|
||||
}
|
||||
},{
|
||||
text:'名称',dataIndex:'filename',editor:true,align:'left'
|
||||
},{
|
||||
text:'大小',dataIndex:'filesizecn',sortable:true
|
||||
},{
|
||||
text:'添加时间',dataIndex:'optdt',sortable:true
|
||||
},{
|
||||
text:'分类',dataIndex:'typename'
|
||||
},{
|
||||
text:'上传者',dataIndex:'optname'
|
||||
},{
|
||||
text:'共享给',dataIndex:'shate'
|
||||
},{
|
||||
text:'文件ID',dataIndex:'id'
|
||||
},{
|
||||
text:'下载次数',dataIndex:'downci',sortable:true
|
||||
},{
|
||||
text:'',dataIndex:'opt',renderer:function(v,d,oi){
|
||||
return '<a href="javascript:;" onclick="showvies{rand}('+oi+',0)">预览</a> <a href="javascript:;" onclick="showvies{rand}('+oi+',1)"><i class="icon-arrow-down"></i></a>';
|
||||
}
|
||||
}],
|
||||
itemclick:function(){
|
||||
get('del_{rand}').disabled=false;
|
||||
},
|
||||
beforeload:function(){
|
||||
get('del_{rand}').disabled=true;
|
||||
}
|
||||
});
|
||||
_editfacech{rand}angback=function(a,typeid,pars2,sid){
|
||||
c.savefile(typeid, sid);
|
||||
};
|
||||
showvies{rand}=function(oi,lx){
|
||||
var d=a.getData(oi);
|
||||
if(lx==1){
|
||||
js.downshow(d.id)
|
||||
}else{
|
||||
if(js.isimg(d.fileext)){
|
||||
$.imgview({url:d.filepath,downbool:false});
|
||||
}else{
|
||||
var urls = '?m=public&a=fileviewer&id='+d.id+'&wintype=max';
|
||||
openxiangs(d.filename, urls);
|
||||
}
|
||||
}
|
||||
}
|
||||
var c = {
|
||||
reload:function(){
|
||||
at.reload();
|
||||
},
|
||||
uploadfile:function(){
|
||||
var na = at.changedata.name;
|
||||
if(!na)na='文件';
|
||||
js.upload('_editfacech{rand}angback',{'title':'上传'+na+'','params1':typeid});
|
||||
},
|
||||
loadfile:function(spd,nsd){
|
||||
$('#megss{rand}').html(nsd);
|
||||
a.setparams({'typeid':spd}, true);
|
||||
},
|
||||
genmu:function(){
|
||||
typeid = sspid;
|
||||
at.changedata={};
|
||||
this.loadfile('0','所有文档');
|
||||
},
|
||||
savefile:function(tps, sid){
|
||||
if(sid=='')return;
|
||||
js.ajax(js.getajaxurl('savefile','{mode}','{dir}'),{'typeid':tps,'sid':sid},function(s){
|
||||
a.reload();
|
||||
},'get',false, '保存中...,保存成功');
|
||||
},
|
||||
sharefile:function(){
|
||||
var fid = a.getchecked();
|
||||
if(fid==''){js.msg('msg','没有选中');return;}
|
||||
var cans = {
|
||||
type:'deptusercheck',
|
||||
title:'共享给...',
|
||||
callback:function(sna,sid){
|
||||
if(sid)c.sharefiles(sna,sid, fid);
|
||||
}
|
||||
}
|
||||
js.getuser(cans);
|
||||
},
|
||||
sharefiles:function(sna,sid, fid){
|
||||
if(sid==''||fid=='')return;
|
||||
js.ajax(js.getajaxurl('sharefile','{mode}','{dir}'),{'sid':sid,'sna':sna,'fid':fid},function(s){
|
||||
a.reload();
|
||||
},'post',false, '共享中...,共享成功');
|
||||
},
|
||||
qxsharefile:function(){
|
||||
var fid = a.getchecked();
|
||||
if(fid==''){js.msg('msg','没有选中');return;}
|
||||
js.ajax(js.getajaxurl('sharefile','{mode}','{dir}'),{'fid':fid},function(s){
|
||||
a.reload();
|
||||
},'post',false, '取消共享中...,取消成功');
|
||||
},
|
||||
movefile:function(){
|
||||
var fid = a.getchecked();
|
||||
if(fid==''){js.msg('msg','没有选中');return;}
|
||||
movefid=fid;
|
||||
js.msg('success','已选中,请在5秒内选择左边类型确认移动');
|
||||
clearTimeout(this.cmoeefese);
|
||||
this.cmoeefese=setTimeout(function(){movefid='';},5000);
|
||||
},
|
||||
typeclidks:function(d){
|
||||
if(movefid=='')return;
|
||||
js.confirm('确定将选中的文件移动到【'+d.name+'】下吗?',function(jg){
|
||||
if(jg=='yes'){
|
||||
c.movefiles(d.id, movefid);
|
||||
}
|
||||
});
|
||||
},
|
||||
movefiles:function(tid, moid){
|
||||
if(moid=='')return;
|
||||
movefid='';
|
||||
js.ajax(js.getajaxurl('movefile','{mode}','{dir}'),{'fid':moid,'tid':tid},function(s){
|
||||
a.reload();
|
||||
},'post',false, '移动中...,移动成功');
|
||||
},
|
||||
clicktypeeidt:function(){
|
||||
var d = at.changedata;
|
||||
if(d.id)c.clicktypewin(false, 1, d);
|
||||
},
|
||||
clicktypewin:function(o1, lx, da){
|
||||
var h = $.bootsform({
|
||||
title:'文档类型',height:250,width:300,
|
||||
tablename:'option',labelWidth:50,
|
||||
isedit:lx,submitfields:'name,sort,pid',cancelbtn:false,
|
||||
items:[{
|
||||
labelText:'名称',name:'name',required:true
|
||||
},{
|
||||
labelText:'上级id',name:'pid',value:0,type:'hidden'
|
||||
},{
|
||||
labelText:'排序号',name:'sort',type:'number',value:0
|
||||
}],
|
||||
success:function(){
|
||||
if(optlx==0)at.reload();
|
||||
if(optlx==1)a.reload();
|
||||
}
|
||||
});
|
||||
if(lx==1)h.setValues(da);
|
||||
if(lx==0)h.setValue('pid', typeid);
|
||||
optlx = 0;
|
||||
return h;
|
||||
},
|
||||
typedel:function(o1){
|
||||
at.del({
|
||||
url:js.getajaxurl('deloption','option','system'),params:{'stable':'word'}
|
||||
});
|
||||
},
|
||||
del:function(){
|
||||
a.del({url:js.getajaxurl('delword','{mode}','{dir}')});
|
||||
},
|
||||
movedata:false,
|
||||
move:function(){
|
||||
var d = at.changedata;
|
||||
if(!d){js.msg('msg','没有选中行');return;}
|
||||
this.movedata = d;
|
||||
js.msg('success','请在5秒内选择其他类型确认移动');
|
||||
clearTimeout(this.cmoeefese);
|
||||
this.cmoeefese=setTimeout(function(){c.movedata=false;},5000);
|
||||
},
|
||||
ismoveok:function(d){
|
||||
var md = this.movedata;
|
||||
if(md && md.id!=d.id){
|
||||
js.confirm('确定要将['+md.name+']移动到['+d.name+']下吗?',function(jg){
|
||||
if(jg=='yes'){
|
||||
c.movetoss(md.id,d.id,0);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
moveto:function(){
|
||||
var d = at.changedata;if(!d)return;
|
||||
js.confirm('确定要将['+d.name+']移动到顶级吗?',function(jg){
|
||||
if(jg=='yes'){
|
||||
c.movetoss(d.id,sspid,1);
|
||||
}
|
||||
});
|
||||
},
|
||||
movetoss:function(id,toid,lx){
|
||||
js.ajax(js.getajaxurl('movetype','option','system'),{'id':id,'toid':toid,'lx':lx},function(s){
|
||||
if(s!='ok'){
|
||||
js.msg('msg', s);
|
||||
}else{
|
||||
at.reload();
|
||||
}
|
||||
},'get',false, '移动中...,移动成功');
|
||||
c.movedata=false;
|
||||
},
|
||||
floadshate:function(){
|
||||
var d = at.changedata;
|
||||
if(!d){js.msg('msg','没有选中行');return;}
|
||||
if(isempt(d.receid)){
|
||||
var cans = {
|
||||
type:'deptusercheck',
|
||||
title:'文档['+d.name+']共享给...',
|
||||
callback:function(sna,sid){
|
||||
if(sid)c.floadshates(sna,sid, d.id);
|
||||
}
|
||||
}
|
||||
js.getuser(cans);
|
||||
}else{
|
||||
js.confirm('确定要将['+d.name+']取消共享吗?',function(jg){
|
||||
if(jg=='yes'){
|
||||
c.floadshatess(d.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
floadshates:function(sna,sid,fid){
|
||||
if(sid==''||fid=='')return;
|
||||
js.ajax(js.getajaxurl('sharefileer','{mode}','{dir}'),{'sid':sid,'sna':sna,'fid':fid},function(s){
|
||||
at.reload();
|
||||
},'post',false, '共享中...,共享成功');
|
||||
},
|
||||
floadshatess:function(fid){
|
||||
if(fid=='')return;
|
||||
js.ajax(js.getajaxurl('sharefileer','{mode}','{dir}'),{'sid':'','sna':'','fid':fid},function(s){
|
||||
at.reload();
|
||||
},'get',false, '取消中...,取消成功');
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
$('#optionview_{rand}').css('height',''+(viewheight-70)+'px');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr valign="top">
|
||||
<td width="220">
|
||||
<div style="border:1px #cccccc solid">
|
||||
<div id="optionview_{rand}" style="height:400px;overflow:auto;"></div>
|
||||
<div class="panel-footer">
|
||||
<a href="javascript:" title="新增" click="clicktypewin,0" onclick="return false"><i class="icon-plus"></i></a>
|
||||
<a href="javascript:" title="编辑" click="clicktypeeidt" onclick="return false"><i class="icon-edit"></i></a>
|
||||
<a href="javascript:" title="删除" click="typedel" onclick="return false"><i class="icon-trash"></i></a>
|
||||
<a href="javascript:" title="刷新" click="reload" onclick="return false"><i class="icon-refresh"></i></a>
|
||||
<a href="javascript:" title="移动" click="move" onclick="return false"><i class="icon-move"></i></a>
|
||||
<a href="javascript:" title="移动到顶级" click="moveto" onclick="return false"><i class="icon-arrow-up"></i></a>
|
||||
|
||||
<a href="javascript:" title="共享/取消共享" click="floadshate" onclick="return false"><i class="icon-share-alt"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td width="10"></td>
|
||||
<td>
|
||||
<div>
|
||||
<table width="100%"><tr>
|
||||
<td align="left">
|
||||
<button class="btn btn-primary" click="uploadfile" type="button"><i class="icon-upload-alt"></i> 上传文件</button>
|
||||
<button class="btn btn-default" click="genmu" type="button">所有文档</button>
|
||||
<span id="megss{rand}"></span>
|
||||
</td>
|
||||
|
||||
<td align="right">
|
||||
<button class="btn btn-default" click="sharefile" type="button"><i class="icon-share-alt"></i> 共享</button>
|
||||
<button class="btn btn-default" click="qxsharefile" type="button">取消共享</button>
|
||||
<button class="btn btn-default" click="movefile" type="button">移动</button>
|
||||
<button class="btn btn-danger" id="del_{rand}" disabled click="del" type="button"><i class="icon-trash"></i> 删除</button>
|
||||
</td>
|
||||
</tr></table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
93
webmain/system/word/rock_word_shate.php
Normal file
93
webmain/system/word/rock_word_shate.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'word',url:publicmodeurl('worc','getfiledata'),fanye:true,params:{'atype':'shateall'},
|
||||
columns:[{
|
||||
text:'类型',dataIndex:'fileext',renderer:function(v, d){
|
||||
if(!isempt(d.thumbpath))return '<img src="'+d.thumbpath+'" width="24" height="24">';
|
||||
var lxs = js.filelxext(v);
|
||||
return '<img src="web/images/fileicons/'+lxs+'.gif">';
|
||||
}
|
||||
},{
|
||||
text:'名称',dataIndex:'filename',editor:true,align:'left'
|
||||
},{
|
||||
text:'大小',dataIndex:'filesizecn',sortable:true
|
||||
},{
|
||||
text:'创建者',dataIndex:'optname',sortable:true
|
||||
},{
|
||||
text:'创建时间',dataIndex:'optdt',sortable:true
|
||||
},{
|
||||
text:'下载次数',dataIndex:'downci',sortable:true
|
||||
},{
|
||||
text:'',dataIndex:'opt',renderer:function(v,d,oi){
|
||||
if(d.ishui=='1')return '已删';
|
||||
return '<a href="javascript:;" onclick="showvies{rand}('+oi+',0)">预览</a> <a href="javascript:;" onclick="showvies{rand}('+oi+',1)"><i class="icon-arrow-down"></i></a>';
|
||||
}
|
||||
}]
|
||||
});
|
||||
showvies{rand}=function(oi,lx){
|
||||
var d=a.getData(oi);
|
||||
if(lx==1){
|
||||
js.downshow(d.fileid)
|
||||
}else{
|
||||
js.yulanfile(d.fileid,d.fileext,d.filepath,d.filename);
|
||||
}
|
||||
}
|
||||
var c = {
|
||||
reload:function(){
|
||||
a.reload();
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown(nowtabs.name);
|
||||
},
|
||||
changlx:function(o1,lx){
|
||||
$("button[id^='state{rand}']").removeClass('active');
|
||||
$('#state{rand}_'+lx+'').addClass('active');
|
||||
var as = ['shateall','shatewfx'];
|
||||
a.setparams({'atype':as[lx]},true);
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
$('#optionview_{rand}').css('height',''+(viewheight-24)+'px');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td>
|
||||
<input class="form-control" style="width:180px" id="key_{rand}" placeholder="文件名/创建者">
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
<td width="90%" style="padding-left:10px">
|
||||
|
||||
<div id="stewwews{rand}" class="btn-group">
|
||||
<button class="btn btn-default active" id="state{rand}_0" click="changlx,0" type="button">所有共享</button>
|
||||
<button class="btn btn-default" id="state{rand}_1" click="changlx,1" type="button">我共享的</button>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-default" click="daochu,1" type="button">导出</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
136
webmain/system/word/wordAction.php
Normal file
136
webmain/system/word/wordAction.php
Normal file
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
class wordClassAction extends Action
|
||||
{
|
||||
|
||||
public function getmywordtypeAjax()
|
||||
{
|
||||
$showlx = (int)$this->post('showlx',0); //0个人,1部门
|
||||
$bo = $showlx==1;
|
||||
$pid = m('word')->getfolderid($this->adminid, $bo);
|
||||
$rows = m('word')->getfoldrows($this->adminid, $bo);
|
||||
$rows = array(
|
||||
'rows' => $rows,
|
||||
'pid' => $pid
|
||||
);
|
||||
$this->returnjson($rows);
|
||||
}
|
||||
|
||||
public function getshatewordtypeAjax()
|
||||
{
|
||||
$rows = array();
|
||||
$rows = array(
|
||||
'rows' => $rows
|
||||
);
|
||||
$this->returnjson($rows);
|
||||
}
|
||||
|
||||
public function wordbeforeaction($table)
|
||||
{
|
||||
$typeid = (int)$this->post('typeid',0);
|
||||
$showlx = (int)$this->post('showlx',0); //0个人,1部门
|
||||
$bo = $showlx==1;
|
||||
if($showlx==0){
|
||||
//$pid = m('word')->getfolderid($this->adminid);
|
||||
//$where = " and a.optid=".$this->adminid."";
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
$pid = m('word')->getfolderid($this->adminid, $bo);
|
||||
$alltpeid = $this->option->getalldownid($pid);
|
||||
$where = " and a.typeid in($alltpeid)";
|
||||
|
||||
if($pid==$typeid || $typeid==0){
|
||||
|
||||
}else{
|
||||
$alltpeid = $this->option->getalldownid($typeid);
|
||||
$where.=" and a.typeid in($alltpeid)";
|
||||
}
|
||||
|
||||
return array(
|
||||
'table' => '`[Q]word` a left join `[Q]file` b on a.fileid=b.id left join `[Q]option` c on c.id=a.typeid',
|
||||
'fields'=> 'b.id,a.shate,a.typeid,b.filepath,a.optname,a.optid,a.optdt,b.filename,b.fileext,b.filesizecn,b.downci,c.`name` as typename',
|
||||
'where' => "and b.id is not null $where",
|
||||
'order' => 'a.id desc'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function savefileAjax()
|
||||
{
|
||||
$typeid = (int)$this->post('typeid',0);
|
||||
$sid = $this->post('sid');
|
||||
$sadid = explode(',', $sid);
|
||||
|
||||
$arr['optid'] = $this->adminid;
|
||||
$arr['optname'] = $this->adminname;
|
||||
$arr['optdt'] = $this->now;
|
||||
$arr['typeid'] = $typeid;
|
||||
$file = m('file');
|
||||
foreach($sadid as $fid){
|
||||
$arr['fileid'] = $fid;
|
||||
$sid = m('word')->insert($arr);
|
||||
$file->addfile($fid, 'word', $sid, 'word');
|
||||
}
|
||||
echo 'ok';
|
||||
}
|
||||
|
||||
public function sharefileAjax()
|
||||
{
|
||||
$fileid = $this->post('fid','0');
|
||||
$arr['shateid'] = $this->post('sid');
|
||||
$arr['shate'] = $this->post('sna');
|
||||
m('word')->update($arr, "optid='$this->adminid' and fileid in($fileid)");
|
||||
}
|
||||
|
||||
public function sharefileerAjax()
|
||||
{
|
||||
$fileid = (int)$this->post('fid','0');
|
||||
$arr['receid'] = $this->post('sid');
|
||||
$arr['recename'] = $this->post('sna');
|
||||
m('option')->update($arr, "id ='$fileid'");
|
||||
}
|
||||
|
||||
|
||||
public function shatebefore($talbe)
|
||||
{
|
||||
$key = $this->post('key');
|
||||
$atype = $this->post('atype');
|
||||
$where = m('admin')->getjoinstrs('a.shateid', $this->adminid, 1);
|
||||
$optid = 0;
|
||||
if($atype=='wfx'){
|
||||
$where = " and a.optid=".$this->adminid." and a.shate is not null";
|
||||
$optid = $this->adminid;
|
||||
}
|
||||
$alsid = $this->option->getreceiddownall($this->adminid, $optid);
|
||||
if($alsid != ''){
|
||||
$where = ' and ((1 '.$where.') or a.`typeid` in('.$alsid.') )';
|
||||
}
|
||||
|
||||
if($key!=''){
|
||||
$where.=" and (a.`optname` like '%$key%' or b.`filename` like '%$key%' or c.`name` like '%$key%')";
|
||||
}
|
||||
return array(
|
||||
'table' => '`[Q]word` a left join `[Q]file` b on a.fileid=b.id left join `[Q]option` c on c.id=a.typeid',
|
||||
'where' => 'and b.id is not null '.$where.'',
|
||||
'fields'=> 'b.id,a.shate,a.typeid,a.optname,a.optid,b.filepath,a.optdt,b.filename,b.fileext,b.filesizecn,b.downci,c.`name` as typename',
|
||||
'order' => 'a.id desc'
|
||||
);
|
||||
}
|
||||
|
||||
public function delwordAjax()
|
||||
{
|
||||
$fid = $this->post('id','0');
|
||||
m('word')->delete("`fileid`='$fid'");
|
||||
m('file')->delfile($fid);
|
||||
backmsg();
|
||||
}
|
||||
|
||||
//移动
|
||||
public function movefileAjax()
|
||||
{
|
||||
$fid = $this->post('fid','0');
|
||||
$tid = $this->post('tid','0');
|
||||
m('word')->update("`typeid`='$tid'","`fileid` in ($fid)");
|
||||
}
|
||||
}
|
||||
86
webmain/system/wxgzh/rock_wxgzh_cog.php
Normal file
86
webmain/system/wxgzh/rock_wxgzh_cog.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var c={
|
||||
init:function(){
|
||||
$.get(js.getajaxurl('getset','{mode}','{dir}'), function(s){
|
||||
var a=js.decode(s);
|
||||
get('wxgzhappid_{rand}').value=a.appid;
|
||||
get('wxgzhsecret_{rand}').value=a.secret;
|
||||
get('wxgzhtplmess_{rand}').value=a.tplmess;
|
||||
|
||||
});
|
||||
},
|
||||
save:function(o){
|
||||
var d={};
|
||||
d.appid = get('wxgzhappid_{rand}').value;
|
||||
d.secret = get('wxgzhsecret_{rand}').value;
|
||||
d.tplmess = get('wxgzhtplmess_{rand}').value;
|
||||
js.msg('wait','保存中...');
|
||||
js.ajax(js.getajaxurl('setsave','{mode}','{dir}'), d, function(s){
|
||||
js.msg('success','保存成功');
|
||||
},'post');
|
||||
}
|
||||
,
|
||||
testss:function(o1,lx){
|
||||
if(ISDEMO){js.msg('success','demo上就不要测试,我们都测试通过的');return;}
|
||||
js.msg('wait','测试中...');
|
||||
js.ajax(js.getajaxurl('testsend','{mode}','{dir}'),{lx:lx}, function(a){
|
||||
if(a.success){
|
||||
js.msg('success',a.msg);
|
||||
}else{
|
||||
js.msg('msg',a.msg);
|
||||
}
|
||||
},'get,json');
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
c.init();
|
||||
});
|
||||
</script>
|
||||
|
||||
<div align="left">
|
||||
<div style="padding:10px;">
|
||||
|
||||
|
||||
|
||||
<table cellspacing="0" width="600" border="0" cellpadding="0">
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right"><font color=red>*</font> AppID(应用ID):</td>
|
||||
<td class="tdinput"><input id="wxgzhappid_{rand}" class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" width="180"><font color=red>*</font>AppSecret(应用密钥):</td>
|
||||
<td class="tdinput">
|
||||
<textarea id="wxgzhsecret_{rand}" style="height:60px" class="form-control"></textarea>
|
||||
<font color="#888888">可以使用公众号的订阅号/服务号都可以,到公众号后台【开发→基本配置】下获取,<a href="<?=URLY?>view_wxgzh.html" target="_blank">[帮助]</a></font>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">使用模版消息:</td>
|
||||
<td class="tdinput"><select id="wxgzhtplmess_{rand}" class="form-control"><option value="">否</option><option value="1">是(需认证的服务号,OA系统安装企业微信插件)</option></select></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"></td>
|
||||
<td class="tdinput" align="left"><button click="testss,0" class="btn btn-default" type="button">测试是否有效</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right"></td>
|
||||
<td style="padding:15px 0px" colspan="3" align="left"><button click="save" class="btn btn-success" type="button"><i class="icon-save"></i> 保存</button>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
1
webmain/system/wxgzh/rock_wxgzh_tpl.php
Normal file
1
webmain/system/wxgzh/rock_wxgzh_tpl.php
Normal file
@@ -0,0 +1 @@
|
||||
<div style="font-size:30px;padding:100px">信呼的微信公众模版消息,需要购买,去<a href="http://www.rockoa.com/view_weixinqy.html" target="_blank" style="font-size:30px">【看看】</a></div>
|
||||
142
webmain/system/wxgzh/rock_wxgzh_tpledit.php
Normal file
142
webmain/system/wxgzh/rock_wxgzh_tpledit.php
Normal file
@@ -0,0 +1,142 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
{params}
|
||||
var id = params.id;
|
||||
|
||||
var c = {
|
||||
init:function(){
|
||||
js.ajax(js.getajaxurl('gettpledit','{mode}','{dir}',{id:id}),false,function(ret){
|
||||
c.showdatas(ret);
|
||||
},'get,json');
|
||||
$('#mosel_{rand}').change(function(){
|
||||
c.moselchang(this.value);
|
||||
});
|
||||
},
|
||||
save:function(){
|
||||
var soi = get('mosel_{rand}').value;
|
||||
if(soi==''){
|
||||
js.msg('msg','请选择关联OA系统模版');
|
||||
return;
|
||||
}
|
||||
var i,len=this.farr.length,fid,s1='',v1,c1;
|
||||
if(len==0){
|
||||
js.msg('msg','无法设置没有参数的模版消息');
|
||||
return;
|
||||
}
|
||||
for(i=0;i<len;i++){
|
||||
fid = this.farr[i];
|
||||
v1 = get('selectcan{rand}_'+i+'').value;
|
||||
c1 = get('selectcol{rand}_'+i+'').value;
|
||||
if(v1==''){
|
||||
js.msg('msg','请设置参数'+fid+'的值');
|
||||
get('selectcan{rand}_'+i+'').focus();
|
||||
return;
|
||||
}
|
||||
s1+=',"'+fid+'":{"value":"'+v1+'","color":"'+c1+'"}';
|
||||
}
|
||||
s1='{'+s1.substr(1)+'}';
|
||||
js.msg('wait','处理中...');
|
||||
js.ajax(js.getajaxurl('savetpledit','{mode}','{dir}'),{
|
||||
'modename' : this.marr[soi].title,
|
||||
'modeparams':s1,
|
||||
'id':id
|
||||
},function(){
|
||||
js.msg('success','保存成功');
|
||||
});
|
||||
},
|
||||
showdatas:function(ret){
|
||||
get('tplid_{rand}').value = ret.data.title;
|
||||
get('tpl_cont{rand}').value = ret.data.content;
|
||||
var i,s='',fid,v1,c1;
|
||||
s='<table class="table table-striped table-bordered" ><tr><th>参数</th><th><font color=red>*</font>设置参数</th><th>显示颜色</th></tr>';
|
||||
this.farr = [];
|
||||
this.marr = ret.marr;
|
||||
var sdt = [],xsl='';
|
||||
for(i=0;i<this.marr.length;i++){
|
||||
sdt.push({'value':i,'name':this.marr[i].title});
|
||||
if(this.marr[i].title==ret.data.modename)xsl=''+i+'';
|
||||
}
|
||||
js.setselectdata(get('mosel_{rand}'),sdt,'value');
|
||||
get('mosel_{rand}').value=xsl;
|
||||
this.moselchang(xsl);
|
||||
var csnse = {};
|
||||
if(!isempt(ret.data.modeparams))csnse=js.decode(ret.data.modeparams);
|
||||
for(i=0;i<ret.farr.length;i++){
|
||||
fid = ret.farr[i].replace('{','').replace('.DATA','');
|
||||
this.farr.push(fid);
|
||||
v1='';
|
||||
c1='';
|
||||
if(csnse[fid]){
|
||||
v1=csnse[fid].value;
|
||||
c1=csnse[fid].color;
|
||||
}
|
||||
s+='<tr><td>'+fid+'</td><td><input value="'+v1+'" onfocus="welecewete{rand}(this,1)" id="selectcan{rand}_'+i+'" style="width:300px" class="form-control"></td><td><input id="selectcol{rand}_'+i+'" value="'+c1+'" class="form-control" maxlength="7" style="width:100px" ></td></tr>';
|
||||
}
|
||||
s+='</table>';
|
||||
$('#setview{rand}').html(s);
|
||||
|
||||
},
|
||||
moselchang:function(v){
|
||||
var s = '',v1;
|
||||
if(v!=''){
|
||||
var da = this.marr[v].params;
|
||||
for(v1 in da)s+='<a href="javascript:;" onclick="welecewete{rand}(\''+v1+'\',0)">+'+da[v1]+'('+v1+')</a> ';
|
||||
}
|
||||
$('#moselv_{rand}').html(s);
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
c.init();
|
||||
welecewete{rand}=function(ov,lx){
|
||||
if(lx==1){
|
||||
c.selobj = ov;
|
||||
}else{
|
||||
if(c.selobj)c.selobj.value=''+c.selobj.value+'{'+ov+'}';
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<div align="left">
|
||||
<div style="padding:10px;">
|
||||
|
||||
|
||||
|
||||
<table cellspacing="0" width="700" border="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="right">模版标题:</td>
|
||||
<td class="tdinput"><input id="tplid_{rand}" readonly class="form-control"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right" width="180">模版内容:</td>
|
||||
<td class="tdinput">
|
||||
<textarea id="tpl_cont{rand}" readonly style="height:150px" class="form-control"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><font color=red>*</font> 关联OA系统模版:</td>
|
||||
<td class="tdinput"><select id="mosel_{rand}" style="width:200px" class="form-control"><option value="">-请选择-</option></select><div id="moselv_{rand}"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" width="180">设置模版参考:</td>
|
||||
<td class="tdinput" id="setview{rand}">
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"></td>
|
||||
<td style="padding:15px 0px" colspan="3" align="left"><button click="save" class="btn btn-success" type="button"><i class="icon-save"></i> 保存</button>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
91
webmain/system/wxgzh/rock_wxgzh_user.php
Normal file
91
webmain/system/wxgzh/rock_wxgzh_user.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'wouser',fanye:true,
|
||||
modedir:'{mode}:{dir}',
|
||||
storebeforeaction:'wouser_before',
|
||||
columns:[{
|
||||
text:'头像',dataIndex:'headimgurl',renderer:function(v){
|
||||
return '<img src="'+v+'" width="40">';
|
||||
}
|
||||
},{
|
||||
text:'微信昵称',dataIndex:'nickname'
|
||||
},{
|
||||
text:'openid',dataIndex:'openid'
|
||||
},{
|
||||
text:'性别',dataIndex:'sex',sortable:true,renderer:function(v){
|
||||
if(v=='1')v='男';
|
||||
if(v=='2')v='女';
|
||||
return v;
|
||||
}
|
||||
},{
|
||||
text:'国家',dataIndex:'country'
|
||||
},{
|
||||
text:'省份',dataIndex:'province',sortable:true
|
||||
},{
|
||||
text:'城市',dataIndex:'city',sortable:true
|
||||
},{
|
||||
text:'授权时间',dataIndex:'adddt',sortable:true
|
||||
},{
|
||||
text:'操作时间',dataIndex:'optdt',sortable:true
|
||||
},{
|
||||
text:'ID',dataIndex:'id',sortable:true
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
}
|
||||
});
|
||||
|
||||
//编辑和删除按钮可用状态切换
|
||||
function btn(bo){
|
||||
|
||||
}
|
||||
|
||||
|
||||
var c={
|
||||
|
||||
|
||||
refresh:function(){
|
||||
a.reload();//刷新列表的方法
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c); //这个是将上面的方法绑定到对应按钮上
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
|
||||
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-default" click="refresh" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
</td>
|
||||
|
||||
<td width="80%">
|
||||
|
||||
<div class="input-group" style="width:220px;">
|
||||
<input class="form-control" id="key_{rand}" placeholder="昵称/城市/省份">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="search" type="button"><i class="icon-search"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-default" id="fstest_{rand}" disabled click="testcs" type="button">测试发模板消息</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
97
webmain/system/wxgzh/rock_wxgzh_xcyuser.php
Normal file
97
webmain/system/wxgzh/rock_wxgzh_xcyuser.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'wxxcyus',fanye:true,
|
||||
modedir:'{mode}:{dir}',
|
||||
storebeforeaction:'wouser_before',
|
||||
storeafteraction:'wxxcyus_after',
|
||||
columns:[{
|
||||
text:'头像',dataIndex:'avatarUrl',renderer:function(v){
|
||||
return '<img src="'+v+'" width="40">';
|
||||
}
|
||||
},{
|
||||
text:'微信昵称',dataIndex:'nickName'
|
||||
},{
|
||||
text:'openid',dataIndex:'openid'
|
||||
},{
|
||||
text:'性别',dataIndex:'gender',sortable:true,renderer:function(v){
|
||||
if(v=='1')v='男';
|
||||
if(v=='2')v='女';
|
||||
return v;
|
||||
}
|
||||
},{
|
||||
text:'类型',dataIndex:'xcytype',sortable:true
|
||||
},{
|
||||
text:'省份',dataIndex:'province',sortable:true
|
||||
},{
|
||||
text:'城市',dataIndex:'city',sortable:true
|
||||
},{
|
||||
text:'绑定手机号',dataIndex:'mobile'
|
||||
},{
|
||||
text:'推送提醒',dataIndex:'dingyue'
|
||||
},{
|
||||
text:'授权时间',dataIndex:'adddt',sortable:true
|
||||
},{
|
||||
text:'最后操作',dataIndex:'optdt',sortable:true
|
||||
},{
|
||||
text:'ID',dataIndex:'id',sortable:true
|
||||
}],
|
||||
itemclick:function(){
|
||||
btn(false);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
}
|
||||
});
|
||||
|
||||
//编辑和删除按钮可用状态切换
|
||||
function btn(bo){
|
||||
get('del_{rand}').disabled=bo;
|
||||
}
|
||||
|
||||
|
||||
var c={
|
||||
del:function(){
|
||||
a.del();
|
||||
},
|
||||
refresh:function(){
|
||||
a.reload();//刷新列表的方法
|
||||
},
|
||||
search:function(){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s},true);
|
||||
}
|
||||
};
|
||||
|
||||
js.initbtn(c); //这个是将上面的方法绑定到对应按钮上
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
|
||||
|
||||
<table width="100%"><tr>
|
||||
<td nowrap>
|
||||
<button class="btn btn-default" click="refresh" type="button"><i class="icon-refresh"></i> 刷新</button>
|
||||
</td>
|
||||
|
||||
<td width="95%" align="left">
|
||||
|
||||
<div class="input-group" style="width:220px;">
|
||||
<input class="form-control" id="key_{rand}" placeholder="昵称/城市/省份">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="search" type="button"><i class="icon-search"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
121
webmain/system/wxgzh/wxgzhAction.php
Normal file
121
webmain/system/wxgzh/wxgzhAction.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
class wxgzhClassAction extends Action
|
||||
{
|
||||
|
||||
public function setsaveAjax()
|
||||
{
|
||||
m('wxgzh:index')->clearalltoken();
|
||||
$pid = m('wxgzh:index')->optionpid;
|
||||
$this->option->setval('wxgzh_appid@'.$pid.'', $this->post('appid'));
|
||||
$this->option->setval('wxgzh_secret@'.$pid.'', $this->post('secret'));
|
||||
$this->option->setval('wxgzh_tplmess@'.$pid.'', $this->post('tplmess'));
|
||||
$this->backmsg();
|
||||
}
|
||||
|
||||
public function getsetAjax()
|
||||
{
|
||||
$arr= array();
|
||||
$arr['appid'] = $this->option->getval('wxgzh_appid');
|
||||
$arr['secret'] = $this->option->getval('wxgzh_secret');
|
||||
$arr['tplmess'] = $this->option->getval('wxgzh_tplmess');
|
||||
echo json_encode($arr);
|
||||
}
|
||||
|
||||
public function testsendAjax()
|
||||
{
|
||||
$lx = (int)$this->get('lx');
|
||||
if($lx==0){
|
||||
$val = m('wxgzh:wxgzh')->getticket();
|
||||
}else{
|
||||
$val = 'ok';
|
||||
}
|
||||
if($val==''){
|
||||
showreturn('','测试失败');
|
||||
}else{
|
||||
showreturn('','测试成功');
|
||||
}
|
||||
}
|
||||
|
||||
//获取模版消息列表
|
||||
public function getlisttplAjax()
|
||||
{
|
||||
return m('wxgzh:index')->gettpllist();
|
||||
}
|
||||
|
||||
|
||||
public function wotpl_before($table)
|
||||
{
|
||||
return array(
|
||||
'order' => 'status desc'
|
||||
);
|
||||
}
|
||||
|
||||
public function wouser_before($table)
|
||||
{
|
||||
$where = '';
|
||||
$key = $this->post('key');
|
||||
if(!isempt($key)){
|
||||
$where=" and (`nickname` like '%$key%' or `province`='$key' or `city`='$key')";
|
||||
}
|
||||
return $where;
|
||||
}
|
||||
|
||||
public function wotpl_after($table, $rows)
|
||||
{
|
||||
|
||||
return array(
|
||||
'rows' => $rows
|
||||
);
|
||||
}
|
||||
|
||||
public function wxxcyus_after($table, $rows)
|
||||
{
|
||||
$dm = getconfig('systype');
|
||||
foreach($rows as $k=>$rs){
|
||||
if(!isempt($rs['mobile'])){
|
||||
$rows[$k]['mobile'] = substr($rs['mobile'],0,3).'****'.substr($rs['mobile'],-4);
|
||||
if($dm=='demo')$rows[$k]['mobile']='已绑定';
|
||||
}
|
||||
|
||||
}
|
||||
return array(
|
||||
'rows' => $rows
|
||||
);
|
||||
}
|
||||
public function gettpleditAjax()
|
||||
{
|
||||
$id = (int)$this->get('id','0');
|
||||
$rs = m('wotpl')->getone($id);
|
||||
$cont = $rs['content'];
|
||||
$farr = $this->rock->matcharr($cont);
|
||||
|
||||
return array(
|
||||
'data' => $rs,
|
||||
'farr' => $farr,
|
||||
'marr' => m('wxgzh:index')->getxinhutpl()
|
||||
);
|
||||
}
|
||||
public function savetpleditAjax()
|
||||
{
|
||||
$id = (int)$this->post('id','0');
|
||||
m('wotpl')->update(array(
|
||||
'modename' => $this->post('modename'),
|
||||
'modeparams' => $this->post('modeparams')
|
||||
),$id);
|
||||
}
|
||||
|
||||
public function testsendtplAjax()
|
||||
{
|
||||
$id = (int)$this->post('id','0');
|
||||
$openid = $this->post('openid');
|
||||
if(isempt($openid))return returnerror('没有输入openid');
|
||||
|
||||
$urs = m('wouser')->getone("`openid`='$openid'");
|
||||
if(!$urs)return returnerror('没有找到此授权的微信人');
|
||||
|
||||
$barr = m('wxgzh:index')->sendtpl($openid, $id, array(), true);
|
||||
if($barr['errcode']!=0)return returnerror($barr['errcode'].'.'.$barr['msg']);
|
||||
|
||||
return returnsuccess($barr['msg']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user