no commit message
This commit is contained in:
@@ -37,4 +37,112 @@ class colorChajian extends Chajian{
|
||||
$h = floor(($n / 16)) % 16;
|
||||
return ''.$hexch[$h].''.$hexch[$l].'';
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取颜色值
|
||||
*/
|
||||
public function colorTorgb($color)
|
||||
{
|
||||
if(!empty($color)&&(strlen($color)==7)){
|
||||
$r=hexdec(substr($color,1,2));
|
||||
$g=hexdec(substr($color,3,2));
|
||||
$b=hexdec(substr($color,5));
|
||||
}else{
|
||||
$r=$g=$b='00';
|
||||
}
|
||||
return array($r, $g, $b);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取样式的
|
||||
*/
|
||||
public function getApptheme($nohui=true, $ism=false)
|
||||
{
|
||||
$arr = $this->getColor();
|
||||
$color = $arr['color'];
|
||||
$colors = $arr['colors'];
|
||||
$colora = $arr['colora'];
|
||||
|
||||
$bodybgcolor = 'rgba('.$colors.',0.03)';
|
||||
$hgcolor = 'rgba('.$colors.',0.15)';
|
||||
$vgcolor = 'rgba('.$colors.',0.1)';
|
||||
$str[] = '<style type="text/css">';
|
||||
|
||||
|
||||
//暗黑模式的var(--rgb-r),var(--rgb-g),var(--rgb-b)
|
||||
$ishei = false;
|
||||
if(($color == '#333333' || $color=='#555555') && $nohui)$ishei = true;
|
||||
|
||||
$str[] = 'body{';
|
||||
$str[] = 'background:'.$bodybgcolor.';';
|
||||
|
||||
$str[] = '--rgb-r:'.$colora[0].';';
|
||||
$str[] = '--rgb-g:'.$colora[1].';';
|
||||
$str[] = '--rgb-b:'.$colora[2].';';
|
||||
$str[] = '--main-color:'.$color.';';
|
||||
if($ism)$str[] = '--font-size:16px;';
|
||||
$str[] = '--main-hgcolor:'.$hgcolor.';';
|
||||
if(!$ishei){
|
||||
$str[] = '--main-vgcolor:'.$vgcolor.';';
|
||||
$str[] = '--border:0.5px rgba('.$colors.',0.1) solid;';
|
||||
$str[] = '--main-border:rgba('.$colors.',0.1);';
|
||||
}
|
||||
$str[] = '}';
|
||||
|
||||
if($ishei){
|
||||
$str[] = '.rock-table .rock-table-tr:nth-child(odd){background:rgba(0,0,0,0.03);}';
|
||||
$str[] = '.rock-table .rock-table-tr:hover{background:rgba(0,0,0,0.1);}';
|
||||
}
|
||||
|
||||
if($ishei){
|
||||
$bgcol = 'rgba('.$colors.',0.9)';
|
||||
$bgcolor = 'rgba('.$colors.',0.5)';
|
||||
$str[] = 'body{background:'.$bgcol.';color:white;--main-bgcolor:'.$bgcolor.'}';
|
||||
$str[] = 'a:link,a:visited,input{color:white;}';
|
||||
$str[] = '.input,.textarea,.form-control,.inputs{background:'.$bgcol.';color:white}';
|
||||
$str[] = '.input:focus,.inputs:focus,.textarea:focus,.form-control:focus{border:.5px rgba(255,255,255,0.1) solid}';
|
||||
$str[] = '.zhu{color:white}';
|
||||
$str[] = '.webbtn:disabled,.btn:disabled{background:var(--main-bgcolor);color:#888888}';
|
||||
$str[] = '.webbtn-default,.webbtn-default:link,.webbtn-default:visited,.btn{background:var(--main-color);color:white;border:none;}';
|
||||
}else{
|
||||
$str[] = '.rockmenuli{background:rgba('.$colora[0].','.$colora[1].','.$colora[2].',0.05)}';
|
||||
}
|
||||
$str[] = '</style>';
|
||||
$str[] = '<script type="text/javascript">';
|
||||
$str[] = 'maincolor = "'.$color.'";';
|
||||
if(!$ishei)$str[] = 'bootsSelectColor = "var(--main-hgcolor)";';
|
||||
$str[] = '</script>';
|
||||
$path = 'webmain/css/rockmy.css';
|
||||
if(file_exists($path))$str[] = '<link rel="stylesheet" type="text/css" href="'.$path.'?'.time().'" />';
|
||||
$str[] = '';
|
||||
return join(PHP_EOL, $str);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取样式
|
||||
*/
|
||||
public function getColor()
|
||||
{
|
||||
$color = $this->getTheme();
|
||||
$maincolora = $this->colorTorgb($color);
|
||||
$colors = ''.$maincolora[0].','.$maincolora[1].','.$maincolora[2].'';
|
||||
return array(
|
||||
'color' => $color,
|
||||
'colors' => $colors,
|
||||
'colora' => $maincolora,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对应颜色
|
||||
*/
|
||||
public function getTheme()
|
||||
{
|
||||
$color = getconfig('apptheme','#1389D3');
|
||||
//$apptheme = $this->rock->get('apptheme');
|
||||
//if(strlen($apptheme)==6)$this->rock->savecookie('apptheme', $apptheme);
|
||||
//if(!$apptheme)$apptheme = $this->rock->cookie('apptheme');
|
||||
//if(strlen($apptheme)==6)$color = '#'.$apptheme.'';
|
||||
return $color;
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ class htmlChajian extends Chajian{
|
||||
|
||||
public function createtable($fields, $arr, $title='',$lx='',$bcolor='')
|
||||
{
|
||||
if(isempt($bcolor))$bcolor = '#cccccc';
|
||||
if(isempt($bcolor))$bcolor = 'var(--main-border)';
|
||||
if($lx=='print'){
|
||||
$bcolor = '#000000';
|
||||
$title='';
|
||||
@@ -44,12 +44,13 @@ class htmlChajian extends Chajian{
|
||||
if($title != ''){
|
||||
$s .= '<tr><td colspan="2" align="center" style="border:1px '.$bcolor.' solid;padding:10px;font-size:16px;background:#D2E9FF;">'.$title.'</td></tr>';
|
||||
}
|
||||
$pstr = '';
|
||||
foreach($fields as $fid=>$na){
|
||||
$val = '';
|
||||
$sty = 'padding:8px;';
|
||||
if(isset($arr[$fid]))$val = $arr[$fid];
|
||||
if(isset($arr[$fid.'_style']))$sty .= $arr[$fid.'_style'];
|
||||
$s .= '<tr><td align="right" nowrap style="border:1px '.$bcolor.' solid;padding:5px 8px;">'.$na.'</td><td style="border:1px '.$bcolor.' solid;'.$sty.'" align="left">'.$val.'</td></tr>';
|
||||
$s .= '<tr><td align="right" nowrap style="border:1px '.$bcolor.' solid;'.$pstr.'padding:5px 8px;">'.$na.'</td><td style="border:1px '.$bcolor.' solid;'.$pstr.''.$sty.'" align="left">'.$val.'</td></tr>';
|
||||
}
|
||||
$s .='</table>';
|
||||
|
||||
@@ -84,7 +85,7 @@ class htmlChajian extends Chajian{
|
||||
$head[] = explode(',', $te_str);
|
||||
}
|
||||
$txt = '';
|
||||
$style = "padding:3px;border:1px ".$bor." solid";
|
||||
$style = "padding:3px;border:1px ".$bor." solid;border:var(--border)";
|
||||
if($lx=='print')$style = "border:.5pt #000000 solid";
|
||||
$txt .= '<table width="100%" class="createrows" border="0" cellspacing="0" cellpadding="0" align="center" style="border-collapse:collapse;" >';
|
||||
$txt .= '<tr>';
|
||||
@@ -95,7 +96,7 @@ class htmlChajian extends Chajian{
|
||||
if($h==0)$stls.=';border-left:none';
|
||||
if($h==$lens)$stls.=';border-right:none';
|
||||
}
|
||||
$txt.= '<td style="'.$stls.'" bgcolor="#eeeeee" align="'.$head[$h][2].'"><b>'.$head[$h][1].'</b></td>';
|
||||
$txt.= '<td style="background:#eeeeee; background:var(--main-hgcolor);'.$stls.'" align="'.$head[$h][2].'"><b>'.$head[$h][1].'</b></td>';
|
||||
}
|
||||
$txt .= '</tr>';
|
||||
foreach($rows as $k=>$rs){
|
||||
@@ -211,15 +212,18 @@ class htmlChajian extends Chajian{
|
||||
return $bo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function importdata($fields,$btfid='', $fid='')
|
||||
private $importerrarr = array();
|
||||
public function importerrda()
|
||||
{
|
||||
return $this->importerrarr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据处理
|
||||
*/
|
||||
public function importdata($fields,$btfid='', $fid='', $lx=0)
|
||||
{
|
||||
$this->importerrarr = array();
|
||||
if($fid=='')$fid='importcont';
|
||||
$rows = array();
|
||||
$val = $this->rock->post($fid);
|
||||
@@ -227,7 +231,7 @@ class htmlChajian extends Chajian{
|
||||
$arrs = explode("\n", $val);
|
||||
$farr = explode(',', $fields);
|
||||
$fars = explode(',', $btfid);
|
||||
foreach($arrs as $valss){
|
||||
foreach($arrs as $xu=>$valss){
|
||||
$dars = explode(' ', $valss);
|
||||
$barr = array();
|
||||
foreach($farr as $k=>$fid){
|
||||
@@ -236,8 +240,13 @@ class htmlChajian extends Chajian{
|
||||
}
|
||||
$bos = true;
|
||||
foreach($fars as $fids){
|
||||
if(isset($barr[$fids]) && isempt($barr[$fids]))$bos = false;
|
||||
if(isset($barr[$fids]) && isempt($barr[$fids])){
|
||||
$bos = false;
|
||||
$this->importerrarr[$xu] = ''.$fids.'是必须的';
|
||||
break;
|
||||
}
|
||||
}
|
||||
if($lx==1)$barr['drxu'] = $xu;
|
||||
if($bos)$rows[] = $barr;
|
||||
}
|
||||
return $rows;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
class imapChajian extends Chajian
|
||||
{
|
||||
private $supportbool = true;
|
||||
private $supportbool = true,$marubox,$struck_tearr;
|
||||
|
||||
protected function initChajian()
|
||||
{
|
||||
|
||||
@@ -63,7 +63,7 @@ class inputChajian extends Chajian
|
||||
$str = '<input class="inputs" style="border:none;background:none" name="base_sericnum" value="'.$this->flow->createnum().'" readonly>';
|
||||
}
|
||||
if($fid=='file_content'){
|
||||
$str = '<input name="fileid" type="hidden" id="fileidview-inputEl"><div id="view_fileidview" style="width:98%;height:auto;min-height:60px;border:1px #cccccc solid; background:white;overflow:auto"></div><div id="fileupaddbtn"><a href="javascript:;" class="blue" onclick="c.upload()"><u>+添加文件</u></a></div>';
|
||||
$str = '<input name="fileid" type="hidden" id="fileidview-inputEl"><div id="view_fileidview" style="width:98%;flex:1;height:auto;min-height:60px;border:1px #cccccc solid;border:var(--border); background:white;background:var(--main-bgcolor);border-radius:5px;;overflow:auto"></div><div id="fileupaddbtn"><a href="javascript:;" class="blue" onclick="c.upload()"><u>+添加文件</u></a></div>';
|
||||
}
|
||||
|
||||
if($fid=='删'){
|
||||
@@ -202,18 +202,16 @@ class inputChajian extends Chajian
|
||||
));
|
||||
}
|
||||
if($type=='selectdatafalse' || $type=='selectdatatrue'){
|
||||
$str = '<table width="98%" cellpadding="0" border="0"><tr><td width="100%"><input '.$attr.''.$onblue.''.$styles.' class="inputs" style="width:99%" value="'.$val.'" readonly type="text" name="'.$fname.'"></td>';
|
||||
$str .= '<td nowrap>';
|
||||
$str = '<div class="btn-group"><input '.$attr.''.$onblue.''.$styles.' class="inputs" style="flex:1" value="'.$val.'" readonly type="text" name="'.$fname.'">';
|
||||
if($isbt=='0')$str .= '<button onclick="c.selectdataclear(\''.$fname.'\',\''.$data.'\','.$iszb.')" class="webbtn" type="button">x</button>';
|
||||
$str .= '<button type="button" onclick="c.selectdata(\''.$data.'\','.substr($type,10).',\''.$fname.'\',\''.$fieldname.'\','.$iszb.')" class="webbtn">选</button></td></tr></table>';
|
||||
$str .= '<button type="button" onclick="c.selectdata(\''.$data.'\','.substr($type,10).',\''.$fname.'\',\''.$fieldname.'\','.$iszb.')" class="webbtn">选</button></div>';
|
||||
}
|
||||
if($type=='ditumap'){
|
||||
$zbnae = $data;
|
||||
if($iszb>0)$zbnae = ''.($iszb-1).''.$leox.'';
|
||||
$str = '<table width="99%" cellpadding="0" border="0"><tr><td width="100%"><input '.$attr.''.$onblue.''.$styles.''.$lenstr.' class="inputs" style="width:99%" value="'.$val.'" type="text" name="'.$fname.'"></td>';
|
||||
$str .= '<td nowrap>';
|
||||
$str = '<div class="btn-group"><input '.$attr.''.$onblue.''.$styles.''.$lenstr.' class="inputs" style="flex:1" value="'.$val.'" type="text" name="'.$fname.'">';
|
||||
if($isbt=='0')$str .= '<button onclick="c.selectmapclear(\''.$fname.'\',\''.$zbnae.'\','.$iszb.')" class="webbtn" type="button">x</button>';
|
||||
$str .= '<button type="button" onclick="c.selectmap(\''.$fname.'\',\''.$zbnae.'\',\''.$fieldname.'\','.$iszb.')" class="webbtn">选</button></td></tr></table>';
|
||||
$str .= '<button type="button" onclick="c.selectmap(\''.$fname.'\',\''.$zbnae.'\',\''.$fieldname.'\','.$iszb.')" class="webbtn">选</button></div>';
|
||||
}
|
||||
if($type=='htmlediter'){
|
||||
$iszhang= false;
|
||||
@@ -233,12 +231,12 @@ class inputChajian extends Chajian
|
||||
}
|
||||
if($type=='uploadfile'){
|
||||
$str = '<input name="'.$fname.'" value="'.$val.'" type="hidden">';
|
||||
$str.= '<div style="display:inline-block" id="fileview_'.$fname.'"><div onclick="c.uploadfilei(\''.$fname.'\',\''.$a['attr'].'\')" style="display:;border:dashed 1px #cccccc" id="'.$fname.'_divadd" class="upload_items"><img class="imgs" src="images/jia.png"></div></div>';
|
||||
$str.= '<div style="display:inline-block" id="fileview_'.$fname.'"><div onclick="c.uploadfilei(\''.$fname.'\',\''.$a['attr'].'\')" style="display:;border:dashed 1px rgba(0,0,0,0.1)" id="'.$fname.'_divadd" class="upload_items"><img class="imgs" src="images/jia.png"></div></div>';
|
||||
$str.= '<div style="display:none" tsye="file" tnam="'.$fname.'" tdata="'.$data.'" id="filed_'.$fname.'"><input type="file" style="width:120px" multiple="multiple" id="filed_'.$fname.'_inp"></div>';
|
||||
}
|
||||
if($type=='graph'){
|
||||
$str = '<input name="'.$fname.'" value="'.$val.'" type="hidden">';
|
||||
$str.= '<div id="graphview_'.$fname.'" >';
|
||||
$str.= '<div id="graphview_'.$fname.'" class="btn-group">';
|
||||
$str.= '<button type="button" onclick="c.autograph(\''.$fname.'\',0)" class="webbtn">手写</button><button type="button" onclick="c.autograph(\''.$fname.'\',1)" class="webbtn">引入</button><button onclick="c.autograph(\''.$fname.'\',2)" class="webbtn" type="button">x</button></div>';
|
||||
}
|
||||
if($type=='auto'){
|
||||
@@ -289,8 +287,8 @@ class inputChajian extends Chajian
|
||||
$_vals0 = $valea[0];
|
||||
$_vals1 = arrvalue($valea,1, $oarr['valueid']);
|
||||
|
||||
$str = '<table width="99%" cellpadding="0" border="0"><tr><td width="100%"><input class="inputs" style="width:99%" '.$oarr['attr'].' placeholder="'.$oarr['placeholder'].'" id="change'.$fname.'" value="'.$_vals0.'" readonly type="text" name="'.$fname.'"><input name="'.$zbnae.'" value="'.$_vals1.'" id="change'.$fname.'_id" type="hidden"></td>';
|
||||
$str .= '<td nowrap><button onclick="js.changeclear(\'change'.$fname.'\')" class="webbtn" type="button">x</button><button id="btnchange_'.$fname.'" onclick="js.changeuser(\'change'.$fname.'\',\''.$type.'\',\''.$oarr['title'].'\' ,{changerange:\''.$oarr['changerange'].'\'})" type="button" class="webbtn">选</button></td></tr></table>';
|
||||
$str = '<div class="btn-group"><input class="inputs" style="flex:1" '.$oarr['attr'].' placeholder="'.$oarr['placeholder'].'" id="change'.$fname.'" value="'.$_vals0.'" readonly type="text" name="'.$fname.'"><input name="'.$zbnae.'" value="'.$_vals1.'" id="change'.$fname.'_id" type="hidden">';
|
||||
$str .= '<button onclick="js.changeclear(\'change'.$fname.'\')" class="webbtn" type="button">x</button><button id="btnchange_'.$fname.'" onclick="js.changeuser(\'change'.$fname.'\',\''.$type.'\',\''.$oarr['title'].'\' ,{changerange:\''.$oarr['changerange'].'\'})" type="button" class="webbtn">选</button></div>';
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
62
include/chajian/rockkefuChajian.php
Normal file
62
include/chajian/rockkefuChajian.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* 客服
|
||||
*/
|
||||
|
||||
class rockkefuChajian extends Chajian{
|
||||
|
||||
public $openkey,$updatekel,$updatekey;
|
||||
|
||||
protected function initChajian()
|
||||
{
|
||||
$url = getconfig('rockkefu_url');
|
||||
$urlb = getconfig('rockkefu_localurl');
|
||||
if($urlb)$url = $urlb;
|
||||
$this->openkey = getconfig('rockkefu_key');
|
||||
if(substr($url,-1)!='/')$url.='/';
|
||||
$this->updatekel = $url;
|
||||
$this->updatekey = $url.'api.php';
|
||||
}
|
||||
|
||||
|
||||
public function geturlstr($mod, $act, $can=array())
|
||||
{
|
||||
$url = $this->updatekey;
|
||||
$url.= '?m='.$mod.'&a='.$act.'';
|
||||
$url.= '&openkey='.md5($this->openkey).'';
|
||||
foreach($can as $k=>$v)$url.='&'.$k.'='.$v.'';
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get获取数据
|
||||
*/
|
||||
public function getdata($mod, $act, $can=array())
|
||||
{
|
||||
$url = $this->geturlstr($mod, $act, $can);
|
||||
$cont = c('curl')->getcurl($url);
|
||||
if(!isempt($cont) && contain($cont, 'success')){
|
||||
$data = json_decode($cont, true);
|
||||
}else{
|
||||
$data = returnerror('无法访问,'.$cont.'');
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* post发送数据
|
||||
*/
|
||||
public function postdata($mod, $act, $can=array(), $cans=array())
|
||||
{
|
||||
$url = $this->geturlstr($mod, $act, $cans);
|
||||
$cont = c('curl')->postcurl($url, $can);
|
||||
if(!isempt($cont) && contain($cont, 'success')){
|
||||
$data = json_decode($cont, true);
|
||||
}else{
|
||||
$data = returnerror('无法访问,'.$cont.'');
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user