/source/gl/dy/index.php
http://prosporous.googlecode.com/ · PHP · 762 lines · 674 code · 20 blank · 68 comment · 161 complexity · a8ff3fb0fd45447182ee7daeac5d4471 MD5 · raw file
- <?php
- /* * ??????UTF-8???.
- * Created on 2010-10-2
- *
- * @author EXT <isrn@qq.com>
- *
- */
- include ('../../includes/global.php');
- include ('../global.php');
- include ("../power.php");
- include ("../clas/ext.php");
- $plugurl = array();
- $plugjs = array();
- $fckplugin = '';
- function grv($type, $blm, $dvalue=false) {
- //print_r($type);
- if ($dvalue) {
- return $dvalue;
- } else {
- switch ($type) {
- case 'function': {
- $a = explode('#', $blm);
- return $a[0]($a[1]);
- break;
- }
- case '$_GET': {
- return $_GET[$blm];
- break;
- }
- case '$_SESSION': {
- return $_SESSION[$blm];
- break;
- }
- case '$_POST': {
- return $_POST[$blm];
- break;
- }
- case '$_COOKIE': {
- return $_COOKIE[$blm];
- break;
- }
- case '$_SERVER': {
- return $_SERVER[$blm];
- break;
- }
- case '$_ENV': {
- return $_ENV[$blm];
- break;
- }
- case '$_FILES': {
- return $_FILES[$blm];
- break;
- }
- case '0': {
- return $blm;
- break;
- }
- case '1': {
- break;
- }
- default: {
- return $blm;
- break;
- }
- }
- }
- }
- Tr('index.php', 'thisurl');
- Tr('??', 'thistitle');
- $tmpml = 'dy/';
- Tr($_GET['tid'], 'tid');
- Tr('5', 'pagenum');
- $paixu = array('zd' => 'id', 'order' => 'DESC');
- Tr($paixu, 'paixu');
- Tr($_GET['tid'], 'rightid');
- Tr($_REQUEST['lg'], 'lg');
- Tr($_REQUEST['bdid'], 'bdid');
- Tr($_REQUEST['bdtid'], 'bdtid');
-
-
- //$_SESSION['rcg']!='A'&&$_SESSION['rcg']['zdgxkey'][$_GET['tid']]=1;$_GET['tid']='105';$_POST['tid']='105';
- /* $showcf=array(
- 0=>array('title'=>'????','zd'=>array('tt','ct','pic1','input1','input2','ubb1'))Tr('106','rightid');
- );
-
- $listcf=array('show'=>array('tt','ct','pic1','input1','input2'),
- 'xnlist'=>array(
- array('id'=>451,'fname'=>'num','type'=>'input','name'=>'??','wd'=>100,'url'=>""),
- array('id'=>450,'fname'=>'yuding','type'=>'button','name'=>'??','wd'=>100,'url'=>"")
- ),
- 'gj'=>array('user','ct','usertype'),
- //'ss'=>'ct',//olny one
- //'pt'=>" and user like '".$_SESSION['userinfo']['user']."' ",//sql
- 'editdisble'=>array('tt','ct','pic1','input1','input2','ubb1'),
- //'zdgx'=>array('ct'),
- //'zdgxkey'=>array('ct'),
- 'save'=>array('user','ct'),
- 'zd'=>array('user','ct')
- );
- */
- switch ($_REQUEST['op']) {
- case 'list': {
- $_REQUEST['lg'] != '' && $condition = " and lg like '" . $_REQUEST['lg'] . "' ";
- $fldata = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "del!=1 and tid = '" . $_GET['tid'] . "' " . $condition . " order by px asc ",
- 'tn' => "fld"
- ));
- Tr($_GET['bdtid'], 'bdtid');
- Tr($_GET['bdid'], 'bdid');
- if (count($listcf['show']) > 0) {
- foreach ($fldata as $key => $v) {
- if (in_array($v['fname'], $listcf['show'])) {
- $xr[] = $v;
- }
- }
- } else {
- foreach ($fldata as $key => $v) {
- if ($v['xr'] == 0) {
- $xr[] = $v;
- }
- }
- }
- if (count($listcf['xnlist']) > 0) {
- foreach ($listcf['xnlist'] as $v) {
- $xr[] = $v;
- }
- }
- Tr($xr, 'xr');
- if (count($listcf['gj']) > 0) {
- foreach ($fldata as $key => $v) {
- if (in_array($v['fname'], $listcf['gj'])) {
- $gj[] = $v;
- }
- }
- } else {
- foreach ($fldata as $key => $v) {
- if ($v['gj'] == 1) {
- $gj[] = $v;
- }
- }
- }
- if ($gj != '') {
- foreach ($gj as $key => $value) { $js[] = EXT::GG($value['id']); }
- }
- Tr($ckbox, 'ckbox');
- Tr($js, 'js');
- $gj && Tr('1', 'gjright');
- if ($listcf['ss']) { Tr($listcf['ss'], 'titlesearch'); } else { Tr('title', 'titlesearch'); }
- $tree = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "del!=1 and id = '" . $_GET['tid'] . "' ",
- 'tn' => "tree",
- 'limit' => 1
- ));
- Tr($tree, 'tree');
- if ($tree['expand']) {
- $fstree = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "del!=1 and id in (0," . $tree['expand'] . ") ",
- 'tn' => "tree"
- )); }
- $fsstr = '';
- if ($fstree) {
- foreach ($fstree as $fsvalue) {
- $ttree = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "del!=1 and id = " . $fsvalue['id'] . "",
- 'tn' => "tree",
- 'limit' => '1'
- ));
- if ($ttree['config'] != '' && $ttree['config'] != '{"lg":""}') { $fsstr.=",{xtype:\"button\",text:\"??" . $fsvalue['title'] . "\",iconCls:\"fsadd\",pressed:true,handler:function(){
- var record = grid.getStore().getAt(rowIndex);
- fsadd('" . $fsvalue['id'] . "','" . $fsvalue['title'] . "',\"./dy/index.php?op=loaddata&tid=" . $fsvalue['id'] . "&bdtid=" . $_GET['tid'] . "&bdid=\",record.data.id); }}
- ,{xtype:\"button\",text:\"??" . $fsvalue['title'] . "\",iconCls:\"fslist\",pressed:true,handler:function(){
- var record = grid.getStore().getAt(rowIndex);
- fslist('" . $fsvalue['id'] . "','" . $fsvalue['title'] . "',\"./dy/index.php?tid=" . $fsvalue['id'] . "&bdtid=" . $_GET['tid'] . "&bdid=\",record.data.id);
- }}";
- } else {
- $fsstr.=",{xtype:\"button\",text:\"??" . $fsvalue['title'] . "\",iconCls:\"fsadd\",pressed:true,handler:function(){
- var record = grid.getStore().getAt(rowIndex);
- fsadd('" . $fsvalue['id'] . "','" . $fsvalue['title'] . "',\"./show1/i.php?op=add&tid=" . $fsvalue['id'] . "&bdtid=" . $_GET['tid'] . "&bdid=\",record.data.id); }}
- ,{xtype:\"button\",text:\"??" . $fsvalue['title'] . "\",iconCls:\"fslist\",pressed:true,handler:function(){
- var record = grid.getStore().getAt(rowIndex);
- fslist('" . $fsvalue['id'] . "','" . $fsvalue['title'] . "',\"./show1/l.php?op=list&tid=" . $fsvalue['id'] . "&bdtid=" . $_GET['tid'] . "&bdid=\",record.data.id);
- }}";
- }
- } }
-
- /**
- * ???????
- */
- $config_tmp = json_decode($tree['config'],true);
- if (1 == $config_tmp['realtime_price'] || 1 == $config_tmp['realtime_room']){
- $realtime_title = '??';
- //????
- $realtime_url = "/gl/price/real_time.php?bdb={$fsvalue['id']}";
- $realtime_title_tmp = array();
- //??????:?????
- $realtime_type = '';
- if (1 == $config_tmp['realtime_price']){
- $realtime_title_tmp[] = '??';
- $realtime_type .= '&realtime_show_price=1';
- }
- if (1 == $config_tmp['realtime_room']){
- $realtime_title_tmp[] = '??';
- $realtime_type .= '&realtime_show_room=1';
- }
- $realtime_title .= implode('/', $realtime_title_tmp);
- $realtime_url .= $realtime_type;
- $fsstr .= <<<EQT
- ,{
- xtype:"button",
- text:"{$realtime_title}",
- iconCls:"real_time",
- pressed:true,
- handler:function(){
- var record = grid.getStore().getAt(rowIndex);
- //createTab('tab_'+record.data.id,record.data.title+'-{$realtime_title}','{$realtime_url}&bdid='+record.data.id);
- fsadd('tab_{$fsvalue['id']}',record.data.title+'-{$fsvalue['title']}','{$realtime_url}&&bdid=',record.data.id);
- //fslist('{$fsvalue['id']}','{$realtime_title}',"./dy/index.php?tid={$fsvalue['id']}&bdtid={$_GET['tid']}&bdid=",record.data.id);
- }
- }
- EQT;
- }
-
- Tr($fsstr, 'fstree');
-
- $table = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "del!=1 and id = '" . $tree['table'] . "' ",
- 'tn' => "datamod",
- 'limit' => 1
- ));
- Tr($table, 'table');
-
- Ts('dy/list.html');
- break;
- }
- case 'fy': {
- if ($_SESSION['rcg'] != 'A' && !$_SESSION['rcg']['c'][$_POST['tid']]) {
- $pt = $listcf['pt'];
- }
- $_REQUEST['lg'] != '' && $lgcondition = " and lg like '" . $_REQUEST['lg'] . "' ";
- $fldata = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "del!=1 and tid = '" . $_POST['tid'] . "' " . $lgcondition . " order by px asc ",
- 'tn' => "fld"
- ));
- $zhuanyi = array();
- $btsc = array();
- $gjsc = array();
- foreach ($fldata as $key => $value) {
- if ($value['zy'] == 1) {
- $zhuanyi[] = $value;
- }
- if ($value['bt'] == 1) {
- $btsc[$value['fname']] = $value['type'];
- }
- /*
- * ??????????????
- */
- if (($value['type'] == 'textfield' || $value['type'] == 'fckeditor') && $_POST['title']!=''){
- $_search_array_tmp [] = " {$value['fname']} like '%{$_POST['title']}%'";
- }
- }
- //?? ???????
- if($_search_array_tmp!='') {
- $_search_array_tmp = ' and ('.join(' or ',$_search_array_tmp).') ';
- }
-
- $condition = $_search_array_tmp;
- //$_POST['user']&&$condition.="and user like '%".$_POST['user']."%' ";
- $_POST['bdtid'] && $condition.="and bdtid = '" . $_POST['bdtid'] . "' ";
- $_POST['bdid'] && $condition.="and bdid = '" . $_POST['bdid'] . "' ";
- //$_POST['title'] && $condition.="and title = '%" . $_POST['title'] . "%' ";
- if (count($listcf['gj']) > 0) {
- foreach ($fldata as $key => $v) {
- if (in_array($v['fname'], $listcf['gj'])) {
- $gj[] = $v;
- }
- }
- } else {
- foreach ($fldata as $key => $v) {
- if ($v['gj'] == 1) {
- $gj[] = $v;
- }
- }
- }
- if ($gj != '') {
- $xzt = array('combo', 'recommend', 'radiogroup', 'combo1');
- foreach ($gj as $value) {
- if (in_array($value['type'], $xzt)) {
- $_POST[$value['fname']] != '' && $condition.="and " . $value['fname'] . " = '" . $_POST[$value['fname']] . "' ";
- } else {
- if ($value['type'] == 'checkboxgroup') {
- if ($_POST[$value['fname']]) {
- foreach ($_POST[$value['fname']] as $cv) {
- $cv != '' && $condition.="and " . $value['fname'] . " like '%" . $cv . "%' ";
- }
- }
- } else {
- $_POST[$value['fname']] != '' && $condition.="and " . $value['fname'] . " like '%" . $_POST[$value['fname']] . "%' ";
- }
- }
- }
- }
- $dbinfo = Dgd(array(
- 'db' => 'd_sevenel',
- 'tn' => $_POST['dbname'],
- 'start' => $_POST['start'],
- 'limit' => $_POST['limit'],
- 'total' => true,
- // 'ce'=>1,
- 'cd' => "tid = '" . $_POST['tid'] . "' " . $condition . " and del != '1' " . $pt . " " . $lgcondition . " order by " . $paixu['zd'] . " " . $paixu['order'] . " "
- ));
- //??
- //??
- $tempb = 0;
- foreach ($dbinfo['data'] as $key => $value) {
- // $tempb+=$value['ct'];
-
- foreach ($zhuanyi as $zyv) {
- switch ($zyv['type']) {
- case 'fileup': {
- //echo $dbinfo['data'][$key][$zyv['fname']];
- $config = json_decode($zyv['cfg'], true);
- $config['sclj'] || $config['sclj'] = 'pic';
- $dvalue = array(0 => array('rar', 'zip', 'tar', '.tz'),
- 1 => array('jpg', 'gif', 'png', 'bmp'),
- 2 => array('mp3', 'mp4', 'avi', 'wmv', 'mid', '.rm', 'mvb', 'mov', 'wma', 'wav'),
- 3 => array('doc', 'xls', 'txt', 'ocx', 'lsx', 'ppt', 'pdf', 'chm'),
- 4 => array('doc', 'xls', 'txt', 'ocx', 'lsx', 'ppt', 'pdf', 'chm', 'mp3', 'mp4', 'avi', 'wmv', 'mid', '.rm', 'mvb', 'mov', 'wma', 'wav', 'jpg', 'gif', 'png', 'bmp', 'rar', 'zip', 'tar', '.tz')
- );
- $otype = substr(strtolower($dbinfo['data'][$key][$zyv['fname']]), -3);
- if (in_array($otype, $dvalue[0])) {
- $dbinfo['data'][$key][$zyv['fname']] = "<a href=\"/uplods/{$config['sclj']}/" . $dbinfo['data'][$key][$zyv['fname']] . "\" target='_blank'><img src=\"../img/archive.png\">??[Download]</a>";
- }
- if (in_array($otype, $dvalue[1])) {
- if ($config['sl1'] == 1) {
- $dbinfo['data'][$key][$zyv['fname']] = "<img src=\"/uplods/thumb1/" . $dbinfo['data'][$key][$zyv['fname']] . "\" >";
- } elseif ($config['sl2'] == 1) {
- $dbinfo['data'][$key][$zyv['fname']] = "<img src=\"/uplods/thumb2/" . $dbinfo['data'][$key][$zyv['fname']] . "\" >";
- } elseif ($config['sypic'] == 1 || $config['sytxt'] == 1) {
- $dbinfo['data'][$key][$zyv['fname']] = "<img src=\"/uplods/sytp/" . $dbinfo['data'][$key][$zyv['fname']] . "\" width=\"100px\">";
- } else {
- $dbinfo['data'][$key][$zyv['fname']] = "<img src=\"/uplods/pic/" . $dbinfo['data'][$key][$zyv['fname']] . "\" width=\"100px\">";
- }
- }
- if (in_array($otype, $dvalue[2])) {
- $dbinfo['data'][$key][$zyv['fname']] = "<a href=\"/uplods/pic/" . $dbinfo['data'][$key][$zyv['fname']] . "\" target='_blank'><img src=\"../img/film_link.png\">??[Download]</a>";
- }
- if (in_array($otype, $dvalue[3])) {
- $dbinfo['data'][$key][$zyv['fname']] = "<a href=\"/uplods/pic/" . $dbinfo['data'][$key][$zyv['fname']] . "\" target='_blank'><img src=\"../img/report_word.png\">??[Download]</a>";
- }
- break;
- }
- case 'radiogroup': {
- $tempxx = json_decode($zyv['zyz'], true);
- foreach ($tempxx as $value) {
- if ($value['yv'] == $dbinfo['data'][$key][$zyv['fname']]) {
- $dbinfo['data'][$key][$zyv['fname']] = $value['xv'];
- }
- }
- break;
- }
- case 'checkboxgroup': {
- $tempxx = json_decode($zyv['zyz'], true);
- $nowv = explode('#_#', $dbinfo['data'][$key][$zyv['fname']]);
- $dbinfo['data'][$key][$zyv['fname']] = '';
- foreach ($tempxx as $value) {
- if (in_array($value['yv'], $nowv)) {
- $dbinfo['data'][$key][$zyv['fname']].=$value['xv'] . "<BR>";
- }
- }
- break;
- }
- case 'combo': {
- $tempxx = json_decode($zyv['zyz'], true);
- foreach ($tempxx as $value) {
- if ($value['yv'] == $dbinfo['data'][$key][$zyv['fname']]) {
- $dbinfo['data'][$key][$zyv['fname']] = $value['xv'];
- }
- }
- break;
- }
- case 'combo1': {
- $config = json_decode($zyv['cfg'], true);
- $tq = Dgd(array(
- 'db' => 'd_sevenel',
- 'tn' => $config['table'],
- 'cd' => "del!=1 and " . $config['y'] . " = '" . $dbinfo['data'][$key][$zyv['fname']] . "' and " . $config['conditon'],
- 'limit' => 1
- ));
- $dbinfo['data'][$key][$zyv['fname']] = $tq[$config['x']];
- break;
- }
- case 'recommend': {
- $config = json_decode($zyv['cfg'], true);
- if ($dbinfo['data'][$key][$zyv['fname']] != 0) {
- $dbinfo['data'][$key][$zyv['fname']] = "<a href=\"#\" onclick='gxzd(\"" . $dbinfo['data'][$key]['id'] . "\",\"" . $zyv['fname'] . "\",\"0\")' title=\"??????????\" > <img src=\"../img/" . $config['paixu'] . "\"></a> " . (($config['px']) ? ("<a href=\"#\" title=\"??[order]\" onclick='tjpx(\"" . $_POST['tid'] . "@" . $_POST['dbname'] . "\",\"" . $zyv['fname'] . "\")' > <img src=\"../img/sucaiwcom8170000bzc.gif\" ait=\"??[order]\"></a>") : ("")) . " ";
- } else {
- $dbinfo['data'][$key][$zyv['fname']] = "<a href=\"#\" onclick='gxzd(\"" . $dbinfo['data'][$key]['id'] . "\",\"" . $zyv['fname'] . "\",\"1\")' title=\"????????\" ><img src=\"../img/flag.png\"></a> " . (($config['px']) ? ("<a href=\"#\" title=\"??[order]\" onclick='tjpx(\"" . $_POST['tid'] . "@" . $_POST['dbname'] . "\",\"" . $zyv['fname'] . "\")' > <img src=\"../img/sucaiwcom8170000bzc.gif\" ait=\"??[order]\"></a>") : ("")) . "";
- }
- break;
- }
- }
- }
- /* $dbinfo['data'][$key]['yuding']="<input type='button' value='???' onclick='yuding(".$dbinfo['data'][$key]['id'].")'/>";
- $dbinfo['data'][$key]['num']="<input type='text' value='1' name='num".$dbinfo['data'][$key]['id']."' id='num".$dbinfo['data'][$key]['id']."' />";
- */ }
- /*
- $tempz=$d_sevenel->Dqsql("select sum(ct) as total from `se_user` where tid = '".$_POST['tid']."' and del != '1' ");
- $dbinfo['dq']=$tempb;
- $dbinfo['zong']=$tempz[0]['total'];
- */ echo json_encode($dbinfo);
- break;
- }
- case 'width_change': {
- $id = $_POST['id'];
- Du('sevenel', 'fld', array('wd' => $_POST['width']), 'id', $id, 1);
- echo 'ok';
- break;
- }
- case 'del': {
- $_POST['del'] = 1;
- $_POST['ids'] = json_decode(stripslashes($_POST['ids']));
- if (is_array($_POST['ids'])) {
- foreach ($_POST['ids'] as $id) {
- Du('sevenel', $_POST['dbname'], $_POST, 'id', $id, 0);
- }
- } else {
- Du('sevenel', $_POST['dbname'], $_POST, 'id', $id, 0);
- }
- echo '{success:true,msg:\'ok\'}';
- break;
- }
-
- case 'add': {
- $tree_id = $_GET['tid'];
- Tr($_GET['tid'], 'tid');
- Tr($_GET['bdtid'], 'bdtid');
- Tr($_GET['bdid'], 'bdid');
- Tr($_GET['gid'], 'gid');
-
- $tree = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "del!=1 and id = $tree_id",
- 'tn' => "tree",
- 'limit' => 1
- ));
- $tname = gettabname($tree['table'], $dbcfg['prefix'], true);
- Tr($tname, 'tname');
- if ($_GET['id']) {
- Tr($_GET['id'], 'id');
- $fdada = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "id = '" . $_GET['id'] . "' and del != '1' ",
- 'tn' => "$tname",
- 'limit' => 1
- ));
- Tr(preg_replace("/[\s]{2,}/", "", $fdada['lg']), 'lg');
- }
- if ($_GET['id'] == 0) {
- Tr('??', 'action');
- } else {
- Tr('??', 'action');
- }
- $_REQUEST['lg'] != '' && $condition = " and lg like '" . $_REQUEST['lg'] . "' ";
- $fldata = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "del!=1 and tid = '" . $_GET['tid'] . "' " . $condition . " order by px asc ",
- 'tn' => "fld"
- ));
-
-
- $fcf = '';
- $fcf.="{
- xtype:'fieldset',
- title: '????',
- autoHeight: true,
- items: [";
- foreach ($fldata as $value) {
- $fcf.=EXT::GB($value['fname']) . ",";
- }
- $fcf = substr($fcf, 0, -1);
- $fcf.="]},";
-
- $fcf = substr($fcf, 0, -1);
- Tr($fcf, 'fcf');
- Tr($plugurl, 'plugurl');
- Tr($plugjs, 'plugjs');
- Tr($fckplugin, 'fckplugin');
-
- Ts($tmpml . 'add.html');
- break; }
- case 'save': {
-
- $condition = " and lg like 'zh' ";
- $id = $_POST['id'];
- $tree_id = $_POST['tid'];
- $tree = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "del!=1 and id = $tree_id ",
- 'tn' => "tree",
- 'limit' => '1'
- ));
- $tabname = gettabname($tree['table'], '', true);
- $fld = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "del!=1 and tid = $tree_id {$condition}",
- 'tn' => "fld"
- ));
- /* if(!$id){
- $wyyz='user';
- $wztemp=Dgd(array(
- 'db'=>'d_sevenel',
- 'cd'=>"$wyyz like '".$_POST[$wyyz]."'",
- 'tn'=>$tabname,
- 'limit'=>'1'
- ));
- if($wztemp!=''){
- ext_request_failure('??????');
- exit();
- }
- }
- */ foreach ($fld as $key => $value) {
- switch ($value['type']) {
-
- case 'datefield':
- case 'my97': {
- if ($value['zy'] != 1) {
- if (strtotime($_POST[$value['fname']])) {
- $save[$value['fname']] = strtotime($_POST[$value['fname']]);
- } else {
- $save[$value['fname']] = $_POST[$value['fname']];
- }
- } else {
- $save[$value['fname']] = $_POST[$value['fname']];
- }
- break; }
- case 'checkboxgroup': {
- $save[$value['fname']] = implode("#_#", $_POST[$value['fname']]);
- break; }
- case 'password';
- {
- if ($value['yxwk'] == '1') {
- if ($_POST[$value['fname']] == $_POST[$value['fname'] . '-cfrm']) {
- $save [$value['fname']] = md5($_POST[$value['fname']]);
- } else {
- ext_request_failure('???????');
- exit();
- }
- } else {
- $save [$value['fname']] = md5($_POST[$value['fname']]);
- }
- break; }
- case 'fileup': {
- //print_r($_FILES);exit;
- if ($_FILES[$value['fname']]['name'] != '') {
- $cp = 1;
- //????
- $config = json_decode($value['cfg'], true);
-
-
- $dvalue = array(0 => array('rar', 'zip', 'tar', '.tz'),
- 1 => array('jpg', 'gif', 'png', 'bmp'),
- 2 => array('mp3', 'mp4', 'avi', 'wmv', 'mid', '.rm', 'mvb', 'mov', 'wma', 'wav'),
- 3 => array('doc', 'xls', 'txt', 'ocx', 'lsx', 'ppt', 'pdf', 'chm'),
- 4 => array('doc', 'xls', 'txt', 'ocx', 'lsx', 'ppt', 'pdf', 'chm', 'mp3', 'mp4', 'avi', 'wmv', 'mid', '.rm', 'mvb', 'mov', 'wma', 'wav', 'jpg', 'gif', 'png', 'bmp', 'rar', 'zip', 'tar', '.tz')
- );
- if (!$_FILES[$value['fname']]['name']) {
- $cp = 0;
- }
- $otype = substr(strtolower($_FILES[$value['fname']]['name']), -3);
- if (!in_array($otype, $dvalue[$config['type']])) {
- $cp = 0;
- header("Content-type: text/html; charset: UTF-8");
- echo "{success:true,msg:'%u4E0A%u4F20%u683C%u5F0F%u4E0D%u5141%u8BB8%21%u8BF7%u8054%u7CFB%u7BA1%u5458%21<BR> Upload format is not allowed! Please contact the administrator!'}";
- exit;
- }
- if ($_FILES[$value['fname']]['size'] / 1000 > $config['size']) {
- $cp = 0;
- header("Content-type: text/html; charset: UTF-8");
- echo "{success:true,msg:'%u6587%u4EF6%u5927%u5C0F%u8D85%u8FC7%u9650%u5236%21<br> The file size limit expired!'}";
- exit;
- }
- if ($cp) {
- $bsname = floor(Bic());
- $bcname = $bsname . "." . $otype;
- $filename = "../../uplods/pic/" . $bcname;
- $copymes = copy($_FILES[$value['fname']]['tmp_name'], $filename);
- $save[$value['fname']] = $bcname;
- }
- if (in_array($otype, $dvalue[1])) {
- if ($config['sl1'] == 1) {
- @createthumb($_FILES[$value['fname']]['tmp_name'], "." . $otype, $bsname, $config['sl1x'], $config['sl1y'], '1');
- }
- if ($config['sl2'] == 1) {
- @createthumb($_FILES[$value['fname']]['tmp_name'], "." . $otype, $bsname, $config['sl2x'], $config['sl2y'], '2');
- }
- if ($config['sypic'] == 1) {
- $sypicname = "../../uplods/sypic/" . $bcname;
- $sypicwz = "../../uplods/" . $config['sytp'] . "";
- //echo $sypicwz ,$config['sytp'],$config['sywz'];
- @imageWaterMark($filename, $sypicname, $config['sypicwz'], $sypicwz, "", 20, 'wqy-microhei-lite.ttc', "#00FF00");
- }
- if ($config['sytxt'] == 1) {
- $sypicname = "../../uplods/sytxt/" . $bcname;
- $sypicwz = "";
- @imageWaterMark($filename, $sypicname, $config['sytxtwz'], "", $config['sywz'], $config['sywzdx'], $config['syzt'], "#" . $config['syys']);
- }
- if ($config['sytxt'] == 1 && $config['sypic'] == 1) {
- $filename = "../../uplods/sypic/" . $bcname;
- $sypicname = "../../uplods/sytp/" . $bcname;
- $sypicwz = "";
- @imageWaterMark($filename, $sypicname, $config['sytxtwz'], "", $config['sywz'], $config['sywzdx'], $config['syzt'], "#" . $config['syys']);
- }
- }
- }
- break; }
- default: {
- $save[$value['fname']] = $_POST[$value['fname']];
- }
- }
- }
- $save['tid'] = $tree_id;
- $save['lg'] = $_POST['lg'];
- !$save['lg'] && $save['lg'] = 'zh';
- $_POST['bdid'] && $save['bdid'] = $_POST['bdid'];
- $_POST['bdtid'] && $save['bdtid'] = $_POST['bdtid'];
- $save['gid'] = $_POST['gid'];
- !$save['gid'] && $save['gid'] = Mct();
- $save['at'] = time();
- //???
- if ($id != 0) {
- if ($listcf['editdisble'] != '') {
- foreach ($listcf['editdisble'] as $tv) {
- unset($save[$tv]);
- }
- }
- if (Du('sevenel', $tabname, $save, 'id', $id, 1)) ext_request('ok');
- }else {
- if (Di('sevenel', $tabname, $save)) ;
- ext_request('ok');
- }
- break; }
- case 'yuding': {
- $id = $_POST['id'];
- $prodinfo = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "del!=1 and id = $id",
- 'tn' => "info",
- 'limit' => '1'
- ));
- if ($prodinfo) {
- $insert['tid'] = '108';
- $insert['tt'] = $prodinfo['tt'];
- $insert['pic1'] = $prodinfo['pic1'];
- $insert['ct'] = $prodinfo['ct'];
- $insert['input2'] = $prodinfo['input2'];
- $insert['input1'] = $prodinfo['input1'];
- $insert['ubb1'] = $prodinfo['ubb1'];
- $insert['input4'] = $_SESSION['userinfo']['user'];
- $insert['input5'] = $_POST['num'];
- $insert['input6'] = $_POST['num'] * $prodinfo['ct'];
- $insert['tj1'] = 2;
- $insert['lg'] = 'zh';
- $insert['bdid'] = $prodinfo['id'];
- $insert['bdtid'] = $prodinfo['tid'];
- $insert['gid'] = Mct();
- $insert['at'] = time();
- Di('sevenel', 'info', $insert);
- echo "????????????";
- exit;
- } else {
- echo "????,??????";
- exit;
- }
-
- break; }
- case 'qkzd': {
- $save[$_POST['zd']] = '';
- if (Du('sevenel', $_POST['tname'], $save, 'id', $_POST['id'], 1)) ext_request('ok'); break;
- }
- case 'gxzd': {
- $save[$_POST['zd']] = $_POST['xz'];
- if (Du('sevenel', $_POST['tname'], $save, 'id', $_POST['id'], 1)) ext_request('ok'); break;
- }
- case 'loaddata': {
-
- $tid = $_GET['tid'];
- Tr($tid, 'tid');
- $tree = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "del!=1 and id = $tid",
- 'tn' => "tree",
- 'limit' => '1'
- ));
- Tr($_GET['tid'], 'tid');
- Tr($_GET['bdtid'], 'bdtid');
- Tr($_GET['bdid'], 'bdid');
- $tname = gettabname($tree['table'], $dbcfg['prefix'], true);
- Tr($tname, 'tname');
- if ($_GET['id']) {
- Tr($_GET['id'], 'id');
- $fdada = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "del!=1 and id = '" . $_GET['id'] . "' and del != '1' ",
- 'tn' => "$tname",
- 'limit' => 1
- ));
- Tr($fdada['gid'], 'gid');
- $gid = $fdada['gid'];
- $fdada = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => " gid = '" . $fdada['gid'] . "' and del != '1' ",
- 'tn' => "$tname"
- ));
- foreach ($fdada as $value) {
- $templg[$value['lg']] = $value['id'];
- }
- }
- !$gid && $gid = Mct();
- if ($tree['config'] != '') {
- $tconfig = json_decode($tree['config'], true);
- $nowlg = explode('|', $tconfig['lg']);
- foreach ($nowlg as $tv) {
- $standlang[$tv] && $xhlg[] = array('lg' => $tv, 'value' => $standlang[$tv], 'id' => $templg[$tv], 'gid' => $gid);
- }
- if ($xhlg) {
- Tr($xhlg, 'dy');
- }
- Tr($_GET['lg'], 'slg');
- Ts($tmpml . 'info.html');
- }
- break;
- }
- default: {
- $tid = $_GET['tid'];
- Tr($tid, 'tid');
- $tree = Dgd(array(
- 'db' => 'd_sevenel',
- 'cd' => "del!=1 and id = $tid",
- 'tn' => "tree",
- 'limit' => '1'
- ));
- if ($tree['config'] != '') {
- $tconfig = json_decode($tree['config'], true);
- $nowlg = explode('|', $tconfig['lg']);
- foreach ($nowlg as $tv) {
- $standlang[$tv] && $xhlg[] = array('lg' => $tv, 'value' => $standlang[$tv], 'bdid' => $_GET['bdid'], 'bdtid' => $_GET['bdtid']);
- }
- if ($xhlg) {
- Tr($xhlg, 'dy');
- }
- Ts($tmpml . 'index.html');
- }
- break;
- }
- }
- ?>