0 && $clsConfig->langMulti) {
echo '
';
} else {
echo '
'.
showInput($af,$data).'
';
}
}
}
}
if(!function_exists('showInput')) {
function showInput($af,$data) {
global $ACT,$db, $strSesName;
global $index, $id; // add since sortCnt //
if($ACT=='view' && !$af['customView']) {
if($af['type']=='image') {
// $path = '../'.end(explode('|',$data[$af['Name']]));
$tempA = explode('|',$data[$af['Name']]);
$path = '../'.end($tempA);
return '
';
} elseif($af['type']=='file') {
return '';
} elseif($af['type']=='multiupload_s') {
/* ********** ********** Load Attachment ********** ********** ********** */
$sql = "SELECT * FROM attachment WHERE a_ref_id = '".$GLOBALS[id]."' AND a_ref_type = '".$af[ref_type]."' ORDER BY a_sort_id, a_crt_dt DESC";
$query = $db->execSQL($sql);
while($a = $db->fetchAry($query)) {
if(file_exists('../'.img_path($a['a_path'],'thumb'))) {
$fPath = img_path($a['a_path'],'thumb');
} else {
$fPath = $a['a_path'];
}
$uploaded_file .= '';
}
return '
';
/* ********** ********** ********** ********** ********** ********** ********** */
} elseif($af['type']=='multiupload') {
/* ********** ********** Load Attachment ********** ********** ********** */
$sql = "SELECT * FROM attachment WHERE a_ref_id = '".$GLOBALS[id]."' AND a_ref_type = '".$af[ref_type]."' ORDER BY a_sort_id, a_crt_dt DESC";
$query = $db->execSQL($sql);
while($a = $db->fetchAry($query)) {
if(file_exists('../'.img_path($a['a_path'],'thumb'))) {
$fPath = img_path($a['a_path'],'thumb');
} else {
$fPath = $a['a_path'];
}
$uploaded_file .= '';
}
return '
';
/* ********** ********** ********** ********** ********** ********** ********** */
} elseif($af['type']=='multiupload_c') {
/* ********** ********** Load Attachment ********** ********** ********** */
$sql = "SELECT * FROM attachment WHERE a_ref_id = '".$GLOBALS[id]."' AND a_ref_type = '".$af[ref_type]."' ORDER BY a_sort_id, a_crt_dt DESC";
$query = $db->execSQL($sql);
while($a = $db->fetchAry($query)) {
if(file_exists('../'.img_path($a['a_path'],'thumb'))) {
$fPath = img_path($a['a_path'],'thumb');
} else {
$fPath = $a['a_path'];
}
$uploaded_file .= '';
}
return '
';
/* ********** ********** ********** ********** ********** ********** ********** */
} else {
if($af['option']) {
$val = showOption($af['option'],$data[$af['Name']],$af['type']);
} else {
$val = $data[$af['Name']];
}
return $af['type']=='textarea' ? '','</textarea>',$val).'' : '';
}
}
switch($af['type']) {
case 'textarea':
return '';
break;
case 'select':
$optionList = '';
foreach($af['option'] as $o) {
$optionList .= '';
}
return '';
break;
case 'radio':
$optionList = '';
foreach($af['option'] as $key => $o) {
$optionList .= '';
}
return ''.$optionList.'
';
break;
case 'checkbox':
$optionList = ''; $selected = array();
$e = explode(',',str_replace('*','',$data[$af['Name']]));
foreach($e as $sted) {
$selected[] = $sted;
}
foreach($af['option'] as $key => $o) {
$optionList .= '';
}
return ''.$optionList.'
';
break;
case 'time':
for($i=0;$i<24;$i++) { $v = str_pad($i,2,0,STR_PAD_LEFT); $hList[] = array(v=>$v); }
for($i=0;$i<59;($af['timePeriod']>1 ? $i+=$af['timePeriod'] : $i++)) { $v = str_pad($i,2,0,STR_PAD_LEFT); $mList[] = array(v=>$v); }
foreach($hList as $h) {
$hOption .= '';
}
foreach($mList as $m) {
$mOption .= '';
}
$sList .= ' : ';
return $sList;
break;
/*
// SWF version backup //
case 'multiupload_s':
global $swfuId, $swfuJs;
$swfuId++;
if($swfuId==1) { $swfuJs .= '$("a[rel=photo]").fancybox();'; }
$swfuJs .= 'var swfu'.$swfuId.';';
$swfuJs .= 'var setting;';
$swfuJs .= 'setting = getSwfu('.$swfuId.');';
$swfuJs .= 'setting.post_params = {PHPSESSID: "'.session_id().'", "upload_id" : "'.$_SESSION[$GLOBALS['index']]['upload_id'].'", ref_type: "'.$af['ref_type'].'", resize: "'.$af['resize'].'"};';
if($af['file_types']) { $swfuJs .= "setting.file_types = '".$af['file_types']."'; setting.file_types_description = 'FILES';"; }
if(is_array($af['swfu']) && count($af['swfu'])>0) {
foreach($af['swfu'] as $swKey => $sws) {
$swfuJs .= "setting.$swKey = '$sws';";
}
}
$swfuJs .= 'swfu'.$swfuId.' = new SWFUpload(setting);';
$uploaded_file_num = 0;
if($ACT=='edit') {
// ********** ********** Load Attachment ********** ********** ********** //
$uploaded_file_num = $uploaded_photo_num = 0;
$sql = "SELECT * FROM attachment WHERE a_ref_id = '".$GLOBALS[id]."' AND a_ref_type = '".$af[ref_type]."' ORDER BY a_sort_id, a_crt_dt DESC";
$query = $db->execSQL($sql);
while($a = $db->fetchAry($query)) {
if(file_exists('../'.img_path($a['a_path'],'thumb'))) {
$fPath = img_path($a['a_path'],'thumb');
} else {
$fPath = $a['a_path'];
}
$uploaded_file .= '
'.($a['a_width']>0 ? '

' :
'
').'
';
$uploaded_file_num++;
}
// ********** ********** ********** ********** ********** ********** ********** //
}
return '
Uploaded files (total: '.$uploaded_file_num.')
'.($af['allowSort'] ? '
' : '').'
'.$uploaded_file.'
Upload Queue
';
break;
// */
/*
// SWF version backup //
case 'multiupload':
global $swfuId, $swfuJs;
$swfuId++;
if($swfuId==1) { $swfuJs .= '$("a[rel=photo]").fancybox();'; }
$swfuJs .= 'var swfu'.$swfuId.';';
$swfuJs .= 'var setting;';
$swfuJs .= 'setting = getSwfu('.$swfuId.');';
$swfuJs .= 'setting.post_params = {PHPSESSID: "'.session_id().'", "upload_id" : "'.$_SESSION[$GLOBALS[index]]['upload_id'].'", ref_type: "'.$af['ref_type'].'", resize: "'.$af['resize'].'"};';
if($af['file_types']) { $swfuJs .= "setting.file_types = '".$af['file_types']."'; setting.file_types_description = 'FILES';"; }
if(is_array($af['swfu']) && count($af[swfu])>0) {
foreach($af['swfu'] as $swKey => $sws) {
$swfuJs .= "setting.$swKey = '$sws';";
}
}
$swfuJs .= 'swfu'.$swfuId.' = new SWFUpload(setting);';
$uploaded_file_num = 0;
if($ACT=='edit') {
// ********** ********** Load Attachment ********** ********** ********** //
$uploaded_file_num = $uploaded_photo_num = 0;
$sql = "SELECT * FROM attachment WHERE a_ref_id = '".$GLOBALS['id']."' AND a_ref_type = '".$af['ref_type']."' ORDER BY a_sort_id, a_crt_dt DESC";
$query = $db->execSQL($sql);
while($a = $db->fetchAry($query)) {
if(file_exists('../'.img_path($a['a_path'],'thumb'))) {
$fPath = img_path($a['a_path'],'thumb');
} else {
$fPath = $a['a_path'];
}
$uploaded_file .= '
'.($a['a_width']>0 ? '

' :
'
').'
';
$uploaded_file_num++;
}
// ********** ********** ********** ********** ********** ********** ********** //
}
return '
Uploaded files (total: '.$uploaded_file_num.')
'.($af['allowSort'] ? '
' : '').'
'.$uploaded_file.'
Upload Queue
'.$uploaded_file_num.' Files Uploaded
';
break;
// */
case 'multiupload':
global $swfuId, $swfuJs;
$swfuId++;
$uploaded_file_num = 0;
if($ACT=='edit') {
// ********** ********** Load Attachment ********** ********** ********** //
$uploaded_file_num = $uploaded_photo_num = 0;
$sql = "SELECT * FROM attachment WHERE a_ref_id = '".$GLOBALS['id']."' AND a_ref_type = '".$af['ref_type']."' ORDER BY a_sort_id, a_crt_dt DESC";
// fShowSQL($sql);
//yyyy 修改的時候需要拼接
//$sql = "SELECT * FROM attachment WHERE a_ref_id = '".$GLOBALS['id']."' AND a_ref_type = '".$af['ref_type']."' AND a_type_name = '".$index."' ORDER BY a_sort_id, a_crt_dt DESC";
//yyyy
$query = $db->execSQL($sql);
while($a = $db->fetchAry($query)) {
if(file_exists('../'.img_path($a['a_path'],'thumb'))) {
$fPath = img_path($a['a_path'],'thumb');
} else {
$fPath = $a['a_path'];
}
$uploaded_file .= '
'.($a['a_width']>0 ? '

' :
'
').'
';
$uploaded_file_num++;
}
// ********** ********** ********** ********** ********** ********** ********** //
}
$vHtml = '
Uploaded files (total: '.$uploaded_file_num.')
'.($af['allowSort'] ? '
' : '').'
'.$uploaded_file.'
0 Files Uploaded
';
//$iFrameUrl = 'index.php?index=ajax&act=btnmultiupload&noframe=yes';
$iFrameUrl = 'include/btnmultiupload.php?';
$iFrameUrl.= '&id='.$GLOBALS['id'];
$iFrameUrl.= '&upload_id='.$_SESSION[$strSesName.'_ADMIN_'.$index]['upload_id'];
$iFrameUrl.= '&resize='.$af['resize'];
$iFrameUrl.= '&refType='.$af['ref_type'];
$iFrameUrl.= '&swfuId='.$swfuId;
$iFrameUrl.= '&pageIndex='.$index;
$iFrameUrl.= '&fldName='.$af['Name'];
$vHtml.= '
';
//$vHtml.= "{$iFrameUrl}";
return $vHtml;
/*
// SWF version backup //
case 'multiupload_c':
global $swfuId, $swfuJs;
$swfuId++;
if($swfuId==1) { $swfuJs .= '$("a[rel=photo]").fancybox();'; }
$swfuJs .= 'var swfu'.$swfuId.';';
$swfuJs .= 'var setting;';
$swfuJs .= 'setting = getSwfu2('.$swfuId.');';
$swfuJs .= 'setting.post_params = {PHPSESSID: "'.session_id().'", "upload_id" : "'.$_SESSION[$GLOBALS['index']]['upload_id'].'", ref_type: "'.$af['ref_type'].'", resize: "'.$af['resize'].'"};';
if($af['file_types']) { $swfuJs .= "setting.file_types = '".$af['file_types']."'; setting.file_types_description = 'FILES';"; }
if(is_array($af['swfu']) && count($af['swfu'])>0) {
foreach($af['swfu'] as $swKey => $sws) {
$swfuJs .= "setting.$swKey = '$sws';";
}
}
$swfuJs .= 'swfu'.$swfuId.' = new SWFUpload(setting);';
$uploaded_file_num = 0;
if($ACT=='edit') {
// ********** ********** Load Attachment ********** ********** ********** //
$uploaded_file_num = $uploaded_photo_num = 0;
$sql = "SELECT * FROM attachment WHERE a_ref_id = '".$GLOBALS[id]."' AND a_ref_type = '".$af[ref_type]."' ORDER BY a_sort_id, a_crt_dt DESC";
$query = $db->execSQL($sql);
while($a = $db->fetchAry($query)) {
if(file_exists('../'.img_path($a['a_path'],'thumb'))) {
$fPath = img_path($a['a_path'],'thumb');
} else {
$fPath = $a['a_path'];
}
$uploaded_file .= '
'.($a['a_width']>0 ? '

' :
'
').'
';
$uploaded_file_num++;
}
// ********** ********** ********** ********** ********** ********** ********** //
}
return '
Uploaded files (total: '.$uploaded_file_num.')
'.($af['allowSort'] ? '
' : '').'
'.$uploaded_file.'
Upload Queue
'.$uploaded_file_num.' Files Uploaded
';
break;
// */
case 'file':
$input = ' ';
// $filePath = '../'.end(explode('|',$data[$af['Name']]));
$tempA = explode('|',$data[$af['Name']]);
$filePath = '../'.end($tempA);
if($data[$af['Name']] && file_exists($filePath)) {
$input .= '
';
}
return $input;
break;
case 'image':
$input = ' ';
// $filePath = '../'.end(explode('|',$data[$af['Name']]));
$tempA = explode('|',$data[$af['Name']]);
$filePath = '../'.end($tempA);
if($data[$af['Name']] && file_exists($filePath)) {
$input .= 'View Existing
';
}
return $input;
break;
case 'custom':
eval('$input = '.$af['loopFunction'].';');
return $input;
break;
default:
return ' '.$af['lblDesc'];
}
}
}
?>