/source/gl/personnel/i.php

http://prosporous.googlecode.com/ · PHP · 816 lines · 783 code · 20 blank · 13 comment · 55 complexity · 5e8ff531dfa483b8329cadd7b6422ac6 MD5 · raw file

  1. <?php
  2. /**??????UTF-8???.
  3. * Created on 2010-6-29
  4. *
  5. * @author EXT <isrn@qq.com>
  6. *
  7. */
  8. include ('../../includes/global.php');
  9. include ('../global.php');
  10. include ("../power.php");
  11. $dbcfg=Sys::Gp(array('dbcfg','sevenel'));
  12. $donotrender = array('htmleditor','fckeditor','password','hidden');
  13. function grv($type,$blm,$dvalue=false){
  14. //print_r($type);
  15. if($dvalue){
  16. return $dvalue;
  17. }else{
  18. switch($type){
  19. case 'function':{
  20. $a=explode('#',$blm);
  21. return $a[0]($a[1]);
  22. break;
  23. }
  24. case '$_GET':{
  25. return $_GET[$blm];
  26. break;
  27. }
  28. case '$_SESSION':{
  29. return $_SESSION[$blm];
  30. break;
  31. }
  32. case '$_POST':{
  33. return $_POST[$blm];
  34. break;
  35. }
  36. case '$_COOKIE':{
  37. return $_COOKIE[$blm];
  38. break;
  39. }
  40. case '$_SERVER':{
  41. return $_SERVER[$blm];
  42. break;
  43. }
  44. case '$_ENV':{
  45. return $_ENV[$blm];
  46. break;
  47. }
  48. case '$_FILES':{
  49. return $_FILES[$blm];
  50. break;
  51. }
  52. case '0':{
  53. return $blm;
  54. break;
  55. }
  56. case '1':{
  57. break;
  58. }
  59. default:{
  60. return $blm;
  61. break;
  62. }
  63. }
  64. }
  65. }
  66. switch($_REQUEST['op']){
  67. case 'add':{
  68. if($_SESSION[userinfo][rcfg]==4){
  69. $cab = "and fname!='tj2' and fname!='tj3'";
  70. }else{
  71. $cab = "";
  72. }
  73. $tree_id = $_GET['tid'];
  74. Tr($_GET['tid'],'tid');
  75. Tr($_GET['bdtid'],'bdtid');
  76. Tr($_GET['bdid'],'bdid');
  77. $field=Dgd(array(
  78. 'db'=>'d_sevenel',
  79. 'cd'=>"tid = $tree_id ".$cab." order by px asc",
  80. 'tn'=>"fld"
  81. ));
  82. $tree=Dgd(array(
  83. 'db'=>'d_sevenel',
  84. 'cd'=>"id = $tree_id",
  85. 'tn'=>"tree",
  86. 'limit'=>1
  87. ));
  88. $tname=gettabname($tree['table'],$dbcfg['prefix'],true);
  89. Tr($tname,'tname');
  90. if($_GET['id']){
  91. Tr($_GET['id'],'id');
  92. $fdada=Dgd(array(
  93. 'db'=>'d_sevenel',
  94. 'cd'=>" id = '".$_GET['id']."' and del != '1' ",
  95. 'tn'=>"$tname",
  96. 'limit'=>1
  97. ));
  98. Tr($fdada['gid'],'gid');
  99. Tr(preg_replace("/[\s]{2,}/","",$fdada['lg']),'lg');
  100. }
  101. foreach($field as $arrow=>$value){
  102. $back = is_odd($arrow+1)?"itemCls:'hang',":"";
  103. if($value['cfg']!=''){
  104. $config =json_decode($value['cfg'],true);
  105. }else{$config =''; }
  106. /* if($config!=''){foreach($config as $key=>$v){
  107. $config[$key]=adxx($v);
  108. }}
  109. */ $config['STR']=str_replace("\r","",$config['STR']);
  110. $config['STR']=str_replace("\n","",$config['STR']);
  111. $config['STR']=str_replace("\t","",$config['STR']);
  112. switch($value['type']){
  113. case 'hidden':{
  114. $js[] ="{
  115. xtype: 'hidden',
  116. value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
  117. ".(($config['STR'])?("".$config['STR'].""):(""))."
  118. name: '".$value['fname']."'
  119. }";
  120. break;}
  121. case 'textfield':{
  122. $js[] ="{
  123. xtype: 'textfield',
  124. value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
  125. fieldLabel:'".$value['name']."',
  126. ".(($value['id'])?("id:'".$value['id']."',"):(""))."
  127. ".(($value['width'])?("width:'".$value['width']."px',"):("grow:true,growMin:68,growMax:300,"))."
  128. ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
  129. ".(($config['readonly'])?("readOnly:'true',"):(""))."
  130. ".(($config['STR'])?("".$config['STR'].""):(""))."
  131. ".$back."
  132. name: '".$value['fname']."'
  133. }";
  134. break;}
  135. case 'password':{
  136. $js[] ="{
  137. xtype: 'textfield',
  138. value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
  139. fieldLabel:'".$value['name']."',
  140. inputType: 'password',
  141. id: '".$value['fname']."',
  142. width:'150',
  143. ".(($config['STR'])?("".$config['STR'].""):(""))."
  144. ".$back."name: '".$value['fname']."'
  145. }";
  146. if($value['yxwk']){
  147. $js[] ="{
  148. xtype: 'textfield',
  149. value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
  150. fieldLabel:'??".$value['name']."',
  151. inputType: 'password',
  152. vtype: 'password',
  153. width:'150',
  154. ".(($config['STR'])?("".$config['STR'].""):(""))."
  155. initialPassField: '".$value['fname']."',
  156. ".$back."name: '".$value['fname']."-cfrm'
  157. }";
  158. $plugurl[] = '/Plug-in/ext/adv-vtypes.js';
  159. }
  160. break;}
  161. case 'fileup':{
  162. if($fdada[$value['fname']]==''){
  163. $fdada[$value['fname']]='zwtp.jpg';
  164. }
  165. $dvalue=array( 0=>array('rar','zip','tar','.tz'),
  166. 1=>array('jpg','gif','png','bmp'),
  167. 2=>array('mp3','mp4','avi','wmv','mid','.rm','mvb','mov','wma','wav'),
  168. 3=>array('doc','xls','txt','ocx','lsx','ppt','pdf','chm'),
  169. 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')
  170. );
  171. $otype=substr(strtolower($fdada[$value['fname']]),-3);
  172. if(in_array($otype,$dvalue[0])){
  173. $zs="<a href=\"/uplods/pic/".$fdada[$value['fname']]."\" target=\'_blank\'><img src=\"../img/archive.png\">??[Download]</a>";
  174. }
  175. if(in_array($otype,$dvalue[1])){
  176. if($config['sypic']==1||$config['sytxt']==1){
  177. $zs="<img src=\"/uplods/sytp/".$fdada[$value['fname']]."\" >";
  178. }else{
  179. $zs="<img src=\"/uplods/pic/".$fdada[$value['fname']]."\" >";
  180. }
  181. }
  182. if(in_array($otype,$dvalue[2])){
  183. $zs="<a href=\"/uplods/pic/".$fdada[$value['fname']]."\" target=\'_blank\'><img src=\"../img/film_link.png\">??[Download]</a>";
  184. }
  185. if(in_array($otype,$dvalue[3])){
  186. $zs="<a href=\"/uplods/pic/".$fdada[$value['fname']]."\" target=\'_blank\'><img src=\"../img/report_word.png\">??[Download]</a>";
  187. }
  188. $qk=" <a href=\"#\" onclick=qkzd(\"".$fdada['id']."\",\"".$value['fname']."\") ><img src=\"../img/001_02.gif\">?????</a>";
  189. $js[] ="{
  190. xtype: 'textfield',
  191. fieldLabel:'".$value['name']."',
  192. inputType: 'file',
  193. ".(($value['id'])?("id:'".$value['id']."',"):(""))."
  194. width:'150',
  195. ".(($config['STR'])?("".$config['STR'].""):(""))."
  196. ".$back."name: '".$value['fname']."'
  197. },{".$back."html:'<div style=\"float:left;width:300px;\" align=center>".$zs."".$qk."</div>'}";
  198. break;}
  199. case 'textarea':{
  200. $js[] =preg_replace("/[\s]{2,}/","","{
  201. xtype: 'textarea',
  202. value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
  203. fieldLabel:'".$value['name']."',
  204. grow:true,
  205. ".(($value['id'])?("id:'".$value['id']."',"):(""))."
  206. ".(($value['width'])?("width:'".$value['width']."px',"):("width:'400px',"))."
  207. ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
  208. ".(($config['readonly'])?("readOnly:'true',"):(""))."
  209. ".(($config['STR'])?("".$config['STR'].""):(""))."
  210. ".$back."
  211. name: '".$value['fname']."'
  212. }");
  213. break;}
  214. case 'htmleditor':{
  215. $js[] =preg_replace("/[\s]{2,}/","","{
  216. xtype: 'htmleditor',
  217. value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
  218. fieldLabel:'".$value['name']."',
  219. ".(($value['id'])?("id:'".$value['id']."',"):(""))."
  220. ".(($value['width'])?("width:".$value['width'].","):("anchor:'98%',"))."
  221. ".(($config['height'])?("height:".$config['height'].","):(""))."
  222. ".(($config['STR'])?("".$config['STR'].""):(""))."
  223. ".$back."
  224. name: '".$value['fname']."'
  225. }");
  226. break;}
  227. case 'fckeditor':{
  228. $js[] =preg_replace("/[\s]{2,}/","","{
  229. xtype:\"textarea\",
  230. ".(($value['id'])?("id:'".$value['id']."',"):(""))."
  231. value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
  232. ".(($value['width'])?("width:".$value['width'].","):("anchor:'98%',"))."
  233. ".(($config['height'])?("height:".$config['height'].","):("height:300,"))."
  234. fieldLabel:'".$value['name']."',
  235. ".$back."
  236. listeners:{
  237. focus:function(f){
  238. var myMask = new Ext.LoadMask(Ext.getBody(), {msg:'???'});
  239. myMask.show();
  240. var w=f.getSize();
  241. fckEditor = new FCKeditor('".$value['fname']."') ;
  242. fckEditor.Height=".(($config['height'])?($config['height']):(300)).";
  243. fckEditor.Width=".(($value['width'])?($value['width']):(800)).";
  244. fckEditor.SkinPath = '/Plug-in/fck/editor/skins/silver/' ;
  245. fckEditor.BasePath = '/Plug-in/fck/' ;
  246. fckEditor.Config['ToolbarStartExpanded'] = ".(($config['zhed'])?("false"):('true')).";
  247. ".(($config['STR'])?($config['STR']):(""))."
  248. fckEditor.ReplaceTextarea() ;
  249. myMask.hide();
  250. }
  251. },
  252. name: '".$value['fname']."'
  253. }");
  254. $fckplugin.="try{var fckobj_temp = FCKeditorAPI.GetInstance('".$value['fname']."');
  255. fckobj_temp.UpdateLinkedField();}catch(err){
  256. };";
  257. $plugurl[] = '/Plug-in/fck/fckeditor.js'; // fckEditor.ReplaceTextarea() ;
  258. break;}
  259. case 'kindeditor':{
  260. $yuan = array("</script>", "vegetables", "fiber");
  261. $tyuan = array("<\/script>", "beer", "ice cream");
  262. $js[] =preg_replace("/[\s]{2,}/","","{
  263. xtype:\"textarea\",
  264. id:'".$value['fname']."',
  265. ".$back."
  266. value:\"".(grv($value['qzfs'],$value['blm'],str_replace($yuan, $tyuan,adxx(preg_replace("'([\r\n])[\s]+'", "", $fdada[$value['fname']])))))."\",
  267. ".(($value['width'])?("width:".$value['width'].","):("anchor:'98%',"))."
  268. ".(($config['height'])?("height:".$config['height'].","):("height:300,"))."
  269. fieldLabel:'".$value['name']."',
  270. listeners:{
  271. render:function(f){
  272. try{KE.show({id : '".$value['fname']."',
  273. width :".(($value['width'])?("'".$value['width']."px'"):('70%')).",
  274. height : ".(($config['height'])?("'".$config['height']."px'"):('300px')).",
  275. ".(($config['STR'])?($config['STR']):(""))."
  276. ".(($config['jd'])?("resizeMode : 1,
  277. allowPreviewEmoticons : false,
  278. allowUpload : false,
  279. items : [
  280. 'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
  281. 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
  282. 'insertunorderedlist', '|', 'emoticons', 'image', 'link'],"):(""))."
  283. filterMode : false});}catch(err){
  284. };
  285. }
  286. },
  287. name: '".$value['fname']."'
  288. }");
  289. $fckplugin.="KE.util.setData('".$value['fname']."');";
  290. $plugurl[] = '/Plug-in/kind/kindeditor.js'; // fckEditor.ReplaceTextarea() ;
  291. break;}
  292. case 'datefield':{
  293. if(is_numeric($fdada[$value['fname']])){
  294. $fdada[$value['fname']]=date($config['zqgs'],$fdada[$value['fname']]);
  295. }
  296. $js[] ="{
  297. xtype: 'datefield',
  298. ".$back."
  299. value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
  300. fieldLabel:'".$value['name']."',
  301. ".(($value['id'])?("id:'".$value['id']."',"):(""))."
  302. ".(($value['width'])?("width:".$value['width'].","):(""))."
  303. disabledDays :[".@implode(',',$config['pbxq'])."],
  304. ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
  305. ".(($config['zwxs'])?("readOnly:'true',"):(""))."
  306. ".(($config['STR'])?("".$config['STR'].""):(""))."
  307. ".(($config['zqgs'])?("format:'".$config['zqgs']."',"):(""))."
  308. name: '".$value['fname']."'
  309. }";
  310. if($config['zwxs']==1){$plugjs[] ='Date.dayNames = ["?", "?", "?", "?", "?", "?", "?"];
  311. if (Ext.DatePicker) {
  312. Ext.apply(Ext.DatePicker.prototype, {
  313. todayText: "??",
  314. minText: "?????????",
  315. maxText: "?????????",
  316. disabledDaysText: "",
  317. disabledDatesText: "",
  318. monthNames: Date.monthNames,
  319. dayNames: Date.dayNames,
  320. nextText: "?? (Control+Right)",
  321. prevText: "?? (Control+Left)",
  322. monthYearText: "????? (Control+Up/Down ????)",
  323. todayTip: "{0} (Spacebar)",
  324. okText: "??",
  325. cancelText: "??",
  326. format: "y?m?d?"
  327. });
  328. }';}
  329. break;}
  330. case 'swfupload':{
  331. $js[] ="{
  332. xtype: '{$value['type']}',
  333. ".$back."
  334. name: '{$value['fname']}',
  335. id: '{$value['fname']}',
  336. fieldLabel: '{$value['name']}',
  337. anchor:'99%',
  338. height: {$config['height']}
  339. }";
  340. break;}
  341. case 'combo':{
  342. $tempxx = json_decode($value['zyz'],true);
  343. $config_num = count($tempxx);
  344. $items='';
  345. if($config_num != 0){
  346. foreach($tempxx as $key => $data){
  347. if($data['ck']=='1'){
  348. $fdada[$value['fname']]?$fdada[$value['fname']]:$fdada[$value['fname']]=$data['xv'];}
  349. $items.= "['".$data['xv']."','".$data['yv']."']";
  350. if($key < $config_num-1){
  351. $items.= ",";
  352. }
  353. }
  354. }
  355. $js[] ="{
  356. ".$back."
  357. value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
  358. fieldLabel:'".$value['name']."',
  359. ".(($value['id'])?("id:'".$value['id']."',"):(""))."
  360. ".(($value['width'])?("width:".$value['width'].","):(""))."
  361. ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
  362. ".(($config['readonly'])?("readOnly:'true',"):(""))."
  363. typeAhead: true,
  364. name: '".$value['fname']."_',
  365. hiddenName : '".$value['fname']."',
  366. editable: false,xtype: 'combo',
  367. store:new Ext.data.SimpleStore({
  368. fields:['name','value'],
  369. data:[".$items."]}),
  370. mode:'local',
  371. displayField:'name',
  372. selectOnFocus:true,
  373. valueField :'value',
  374. ".(($config['STR'])?("".$config['STR'].""):(""))."
  375. triggerAction:'all'
  376. }";
  377. break;}
  378. case 'combo1':{
  379. $js[] ="{
  380. ".$back."
  381. value:\"".(adxx($fdada[$value['fname']])?adxx($fdada[$value['fname']]):$config['dy'])."\",
  382. fieldLabel:'".$value['name']."',
  383. ".(($value['id'])?("id:'".$value['id']."',"):(""))."
  384. ".(($value['width'])?("width:".$value['width'].","):(""))."
  385. ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
  386. ".(($config['readonly'])?("readOnly:'true',"):(""))."
  387. typeAhead: true,
  388. emptyText:'".$config['dx']."',
  389. name: '".$value['fname']."_',
  390. id: '".$value['fname']."_',
  391. hiddenName : '".$value['fname']."',
  392. editable: false,xtype: 'combo',
  393. store:new Ext.data.Store({
  394. proxy: new Ext.data.HttpProxy({
  395. url: '../cascade/getcascade.php?id=".$value['id']."'
  396. }),
  397. listeners : {
  398. load : function(){
  399. if(typeof(chuzai)=='undefined'){
  400. Ext.getCmp('".$value['fname']."_"."').setValue('".(adxx($fdada[$value['fname']])?adxx($fdada[$value['fname']]):$config['dy'])."');
  401. chuzai=1;
  402. }
  403. }
  404. } ,
  405. autoLoad:true,
  406. reader: new Ext.data.ArrayReader({
  407. }, [
  408. {name: '".$config['y']."', mapping: '".$config['y']."'},
  409. {name: '".$config['x']."', mapping: '".$config['x']."'}
  410. ])
  411. }),
  412. mode:'local',
  413. displayField:'".$config['x']."',
  414. selectOnFocus:true,
  415. valueField :'".$config['y']."',
  416. ".(($config['STR'])?("".$config['STR'].""):(""))."
  417. triggerAction:'all'
  418. }";
  419. break;}
  420. case 'combo2':{
  421. $js[] ="{
  422. ".$back."
  423. value:\"".(adxx($fdada[$value['fname']])?adxx($fdada[$value['fname']]):$config['dy'])."\",
  424. fieldLabel:'".$value['name']."',
  425. ".(($value['id'])?("id:'".$value['id']."',"):(""))."
  426. ".(($value['width'])?("width:".$value['width'].","):(""))."
  427. ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
  428. ".(($config['readonly'])?("readOnly:'true',"):(""))."
  429. typeAhead: true,
  430. ".(($value['zy'])?("emptyText:'".$config['x2']."',"):("emptyText:'".$config['x1']."',"))."
  431. name: '".$value['fname']."_',
  432. id: '".$value['fname']."_',
  433. hiddenName : '".$value['fname']."',
  434. editable: false,xtype: 'combo',
  435. store:new Ext.data.Store({
  436. proxy: new Ext.data.HttpProxy({
  437. url: '".(($config['zy'])?(($fdada[$config['jlzd']])?("../cascade/getcascade.php?op=sort&id=".$fdada[$config['jlzd']].""):("")):("../cascade/getcascade.php?op=sort&id=".$config['pid'].""))."'
  438. }),
  439. listeners : {
  440. load : function(){
  441. ".(($config['zy'])?("if(typeof(chuzai1)=='undefined'){
  442. Ext.getCmp('".$value['fname']."_"."').setValue('".(adxx($fdada[$value['fname']])?adxx($fdada[$value['fname']]):$config['y2'])."');
  443. chuzai1=1;
  444. }
  445. } "):("if(typeof(chuzai)=='undefined'){
  446. Ext.getCmp('".$value['fname']."_"."').setValue('".(adxx($fdada[$value['fname']])?adxx($fdada[$value['fname']]):$config['y1'])."');
  447. chuzai=1;
  448. }
  449. } "))."
  450. } ,
  451. autoLoad:true,
  452. reader: new Ext.data.ArrayReader({
  453. }, [
  454. {name: 'id', mapping: 'id'},
  455. {name: 'title', mapping: 'title'}
  456. ])
  457. }),
  458. mode:'local',
  459. displayField:'title',
  460. selectOnFocus:true,
  461. valueField :'id',
  462. ".(($config['STR'])?("".$config['STR'].""):(""))."
  463. triggerAction:'all'
  464. ".(($config['zy'])?(""):(",
  465. listeners:{
  466. select : function(combo, record,index){
  467. Ext.getCmp('".$config['jlzd']."_"."').store.proxy= new Ext.data.HttpProxy({url: '../cascade/getcascade.php?op=sort&id=' + combo.value}); Ext.getCmp('".$config['jlzd']."_"."').store.load(); Ext.getCmp('".$config['jlzd']."_"."').setValue('');
  468. }
  469. }"))."
  470. }";break;}
  471. case 'combo3':{
  472. $url='';$chuzai='';$select='';
  473. switch($config['jb']){
  474. case 1:{
  475. $url="../cascade/getcascade.php?op=sort&id=".$config['pid'];
  476. $chuzai="if(typeof(chuzai1)=='undefined'){
  477. Ext.getCmp('".$value['fname']."_"."').setValue('".(adxx($fdada[$value['fname']])?adxx($fdada[$value['fname']]):$config['y'])."');
  478. chuzai1=1;
  479. }";
  480. $select=" Ext.getCmp('".$config['jl1']."_"."').store.proxy= new Ext.data.HttpProxy({url: '../cascade/getcascade.php?op=sort&id='+combo.value}); Ext.getCmp('".$config['jl1']."_"."').store.load();
  481. Ext.getCmp('".$config['jl2']."_"."').store.proxy= new Ext.data.HttpProxy({url: '../cascade/getcascade.php?op=kong'}); Ext.getCmp('".$config['jl2']."_"."').store.load();
  482. Ext.getCmp('".$config['jl1']."_"."').setValue('');
  483. Ext.getCmp('".$config['jl2']."_"."').setValue(''); ";
  484. break;
  485. }
  486. case 2:{
  487. $url=$fdada[$config['jl1']]?"../cascade/getcascade.php?op=sort&id=".$fdada[$config['jl1']]:"";
  488. $chuzai="if(typeof(chuzai2)=='undefined'){
  489. Ext.getCmp('".$value['fname']."_"."').setValue('".(adxx($fdada[$value['fname']])?adxx($fdada[$value['fname']]):$config['y'])."');
  490. chuzai2=1;
  491. }";
  492. $select=" Ext.getCmp('".$config['jl2']."_"."').store.proxy= new Ext.data.HttpProxy({url: '../cascade/getcascade.php?op=sort&id=' + combo.value}); Ext.getCmp('".$config['jl2']."_"."').store.load();
  493. Ext.getCmp('".$config['jl2']."_"."').setValue('');";
  494. break;
  495. }
  496. case 3:{
  497. $url=$fdada[$config['jl2']]?"../cascade/getcascade.php?op=sort&id=".$fdada[$config['jl2']]:"";
  498. $chuzai="if(typeof(chuzai3)=='undefined'){
  499. Ext.getCmp('".$value['fname']."_"."').setValue('".(adxx($fdada[$value['fname']])?adxx($fdada[$value['fname']]):$config['y'])."');
  500. chuzai3=1;
  501. }";
  502. break;
  503. }
  504. }
  505. $js[] ="{
  506. ".$back."
  507. value:\"".(adxx($fdada[$value['fname']])?adxx($fdada[$value['fname']]):$config['y'])."\",
  508. fieldLabel:'".$value['name']."',
  509. ".(($value['id'])?("id:'".$value['id']."',"):(""))."
  510. ".(($value['width'])?("width:".$value['width'].","):(""))."
  511. ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
  512. ".(($config['readonly'])?("readOnly:'true',"):(""))."
  513. typeAhead: true,
  514. emptyText:'".$config['x']."',
  515. name: '".$value['fname']."_',
  516. id: '".$value['fname']."_',
  517. hiddenName : '".$value['fname']."',
  518. editable: false,xtype: 'combo',
  519. store:new Ext.data.Store({
  520. proxy: new Ext.data.HttpProxy({
  521. url: '".$url."'
  522. }),
  523. listeners : {
  524. load : function(){
  525. ".$chuzai."
  526. }} ,
  527. autoLoad:true,
  528. reader: new Ext.data.ArrayReader({
  529. }, [
  530. {name: 'id', mapping: 'id'},
  531. {name: 'title', mapping: 'title'}
  532. ])
  533. }),
  534. mode:'local',
  535. displayField:'title',
  536. selectOnFocus:true,
  537. valueField :'id',
  538. ".(($config['STR'])?("".$config['STR'].""):(""))."
  539. triggerAction:'all',
  540. listeners:{
  541. select : function(combo, record,index){".$select."}
  542. }
  543. }";break;}
  544. case 'radiogroup':{
  545. $tempxx = json_decode($value['zyz'],true);
  546. $config_num = count($tempxx);
  547. if($config_num != 0){
  548. $items='';
  549. if($_GET['id']!=''){
  550. foreach($tempxx as $key => $data){
  551. if($data['yv']==$fdada[$value['fname']]){
  552. $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."',inputValue:'".$data['yv']."',checked: true}";}else{
  553. $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."',inputValue:'".$data['yv']."'}";}
  554. if($key < $config_num-1){
  555. $items.= ",";
  556. }
  557. }
  558. }else{
  559. foreach($tempxx as $key => $data){
  560. if($data['ck']=='1'){
  561. $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."',inputValue:'".$data['yv']."',checked: true}";}else{
  562. $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."',inputValue:'".$data['yv']."'}";}
  563. if($key < $config_num-1){
  564. $items.= ",";
  565. }
  566. }
  567. }
  568. }
  569. $js[] ="{
  570. xtype: 'radiogroup',
  571. ".$back."
  572. ".(($value['width']&&$value['width']<=$config_num)?("columns:".$value['width'].","):(""))."
  573. ".(($config['vertical'])?("vertical: true,"):(""))."
  574. ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
  575. anchor: '95%',
  576. items: [".$items."],
  577. ".(($config['STR'])?("".$config['STR'].""):(""))."
  578. fieldLabel:'".$value['name']."'
  579. }";
  580. break;}
  581. case 'recommend':{
  582. $items='';
  583. if(1==$fdada[$value['fname']]){
  584. $items.= "{boxLabel:'???',name:'".$value['fname']."',inputValue:'1',checked: true},";
  585. $items.= "{boxLabel:'???',name:'".$value['fname']."',inputValue:'0'}";
  586. }else{
  587. $items.= "{boxLabel:'???',name:'".$value['fname']."',inputValue:'1'},";
  588. $items.= "{boxLabel:'???',name:'".$value['fname']."',inputValue:'0',checked: true}";
  589. }
  590. $js[] ="{
  591. xtype: 'radiogroup',
  592. ".$back."
  593. ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
  594. anchor: '95%',
  595. items: [".$items."],
  596. ".(($config['STR'])?("".$config['STR'].""):(""))."
  597. fieldLabel:'".$value['name']."'
  598. }";
  599. break;}
  600. case 'checkboxgroup':{
  601. $tempxx = json_decode($value['zyz'],true);
  602. $config_num = count($tempxx);
  603. if($config_num != 0){
  604. $items='';
  605. if($_GET['id']!=''){
  606. $xsarray=explode("#_#",$fdada[$value['fname']]);
  607. foreach($tempxx as $key => $data){
  608. if(in_array($data['yv'],$xsarray)){
  609. $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."[".$key."]',inputValue:'".$data['yv']."',checked: true}";}else{
  610. $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."[".$key."]',inputValue:'".$data['yv']."'}";}
  611. if($key < $config_num-1){
  612. $items.= ",";
  613. }
  614. }
  615. }else{
  616. foreach($tempxx as $key => $data){
  617. if($data['ck']=='1'){
  618. $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."[".$key."]',inputValue:'".$data['yv']."',checked: true}";}else{
  619. $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."[".$key."]',inputValue:'".$data['yv']."'}";}
  620. if($key < $config_num-1){
  621. $items.= ",";
  622. }
  623. }
  624. }
  625. }
  626. $js[] ="{
  627. xtype:'checkboxgroup',
  628. ".$back."
  629. ".(($value['width']&&$value['width']<=$config_num)?("columns:".$value['width'].","):(""))."
  630. ".(($config['vertical'])?("vertical: true,"):(""))."
  631. ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
  632. anchor: '95%',
  633. items: [".$items."],
  634. ".(($config['STR'])?("".$config['STR'].""):(""))."
  635. fieldLabel:'".$value['name']."'
  636. }";
  637. break;}
  638. default:{
  639. $js[] ="{
  640. xtype: 'textfield',
  641. fieldLabel: '{$value['name']}',
  642. name: '{$value['fname']}',
  643. ".$back."
  644. anchor:'60%'
  645. }";
  646. }
  647. }
  648. }
  649. Tr($plugurl,'plugurl');
  650. Tr($plugjs,'plugjs');
  651. Tr($fckplugin,'fckplugin');
  652. Tr($js,'js');
  653. if($_GET['id']==0){
  654. Tr('??','action');
  655. }else{
  656. Tr('??','action');
  657. }
  658. Ts('show1/add.html');
  659. break;
  660. }
  661. case 'save':{
  662. $id = $_POST['id'];
  663. $tree_id = $_POST['tid'];
  664. $tree=Dgd(array(
  665. 'db'=>'d_sevenel',
  666. 'cd'=>"id = $tree_id",
  667. 'tn'=>"tree",
  668. 'limit'=>'1'
  669. ));
  670. $tabname = gettabname($tree['table'],'',true);
  671. $fld=Dgd(array(
  672. 'db'=>'d_sevenel',
  673. 'cd'=>"tid = $tree_id",
  674. 'tn'=>"fld"
  675. ));
  676. foreach($fld as $key => $value){
  677. switch($value['type']){
  678. case 'datefield':{
  679. if($value['zy']!=1){
  680. if(strtotime($_POST[$value['fname']])){
  681. $save[$value['fname']] = strtotime($_POST[$value['fname']]);
  682. }else{
  683. $save[$value['fname']]=$_POST[$value['fname']];
  684. }
  685. }else{
  686. $save[$value['fname']]=$_POST[$value['fname']];
  687. }
  688. break;}
  689. case 'checkboxgroup':{
  690. $save[$value['fname']]=implode("#_#",$_POST[$value['fname']]);
  691. break;}
  692. case 'password';{
  693. if($value['yxwk']=='1'){
  694. if($_POST[$value['fname']]==$_POST[$value['fname'].'-cfrm']){
  695. $save [$value['fname']] = md5($_POST[$value['fname']]);
  696. }else{
  697. ext_request_failure('???????');
  698. exit();
  699. }
  700. }else{
  701. $save [$value['fname']] = md5($_POST[$value['fname']]);
  702. }
  703. break;}
  704. case 'fileup':{
  705. //print_r($_FILES);exit;
  706. if($_FILES[$value['fname']]['name']!=''){
  707. $cp=1;
  708. //????
  709. $config=json_decode($value['cfg'],true);
  710. $dvalue=array( 0=>array('rar','zip','tar','.tz'),
  711. 1=>array('jpg','gif','png','bmp'),
  712. 2=>array('mp3','mp4','avi','wmv','mid','.rm','mvb','mov','wma','wav'),
  713. 3=>array('doc','xls','txt','ocx','lsx','ppt','pdf','chm'),
  714. 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')
  715. );
  716. if(!$_FILES[$value['fname']]['name']){
  717. $cp=0;
  718. }
  719. $otype=substr(strtolower($_FILES[$value['fname']]['name']),-3);
  720. if(!in_array($otype,$dvalue[$config['type']])){
  721. $cp=0;
  722. header("Content-type: text/html; charset: UTF-8");
  723. 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!'}";
  724. exit;
  725. }
  726. if($_FILES[$value['fname']]['size']/1000>$config['size']){
  727. $cp=0;
  728. header("Content-type: text/html; charset: UTF-8");
  729. echo "{success:true,msg:'%u6587%u4EF6%u5927%u5C0F%u8D85%u8FC7%u9650%u5236%21<br> The file size limit expired!'}";
  730. exit;
  731. }
  732. if($cp){
  733. $bsname=time().rand(10000, 999999);
  734. $bcname=$bsname.".".$otype;
  735. $filename="../../uplods/pic/".$bcname;
  736. $copymes=copy($_FILES[$value['fname']]['tmp_name'],$filename);
  737. $save[$value['fname']]=$bcname;
  738. }
  739. if(in_array($otype,$dvalue[1])){
  740. if($config['sl1']==1){
  741. @createthumb($_FILES[$value['fname']]['tmp_name'],".".$otype,$bsname,$config['sl1x'],$config['sl1y'],'1');
  742. }
  743. if($config['sl2']==1){
  744. @createthumb($_FILES[$value['fname']]['tmp_name'],".".$otype,$bsname,$config['sl2x'],$config['sl2y'],'2');
  745. }
  746. if($config['sypic']==1){
  747. $sypicname="../../uplods/sypic/".$bcname;
  748. $sypicwz="../../uplods/".$config['sytp']."";
  749. //echo $sypicwz ,$config['sytp'],$config['sywz'];
  750. @imageWaterMark($filename,$sypicname,$config['sypicwz'],$sypicwz,"",20,'wqy-microhei-lite.ttc',"#00FF00");
  751. }
  752. if($config['sytxt']==1){
  753. $sypicname="../../uplods/sytxt/".$bcname;
  754. $sypicwz="";
  755. @imageWaterMark($filename,$sypicname,$config['sytxtwz'],"",$config['sywz'],$config['sywzdx'],$config['syzt'],"#".$config['syys']);
  756. }
  757. if($config['sytxt']==1&&$config['sypic']==1){
  758. $filename="../../uplods/sypic/".$bcname;
  759. $sypicname="../../uplods/sytp/".$bcname;
  760. $sypicwz="";
  761. @imageWaterMark($filename,$sypicname,$config['sytxtwz'],"",$config['sywz'],$config['sywzdx'],$config['syzt'],"#".$config['syys']);
  762. }
  763. }
  764. }
  765. break;}
  766. default:{
  767. $save[$value['fname']]=$_POST[$value['fname']];
  768. }
  769. }
  770. }
  771. $save['tid'] = $tree_id;
  772. !$_POST['lg']&&$save['lg']='zh';
  773. $_POST['bdid']&&$save['bdid']=$_POST['bdid'];
  774. $_POST['bdtid']&&$save['bdtid']=$_POST['bdtid'];
  775. !$_POST['gid']&&$save['gid']=Mct();
  776. $save['at']=time();
  777. if($id!=0){
  778. if(Du('sevenel',$tabname,$save,'id',$id,1))
  779. ext_request('ok');
  780. }else{
  781. if(Di('sevenel',$tabname,$save));
  782. ext_request('ok');
  783. }
  784. break;}
  785. case 'qkzd':{
  786. $save[$_POST['zd']]='';
  787. if(Du('sevenel',$_POST['tname'],$save,'id',$_POST['id'],1))
  788. ext_request('ok'); break;
  789. }
  790. case 'gxzd':{
  791. $save[$_POST['zd']]=$_POST['xz'];
  792. if(Du('sevenel',$_POST['tname'],$save,'id',$_POST['id'],1))
  793. ext_request('ok'); break;
  794. }
  795. }
  796. ?>