PageRenderTime 54ms CodeModel.GetById 11ms app.highlight 35ms RepoModel.GetById 1ms app.codeStats 0ms

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