<!DOCTYPE html>
<html>
<head>
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<![endif]-->
<meta charset="gbk" />
<title>多文件上传程序</title>
<link href="<?=base_url()?>csdj/swfupload/upload.css" rel="stylesheet" type="text/css" />
<script src="<?=base_url()?>csdj/swfupload/jquery-1.10.1.min.js"></script>
<script src="<?=base_url()?>csdj/swfupload/jquery.uploadify.min.js"></script>
</head>
<body>
<div id="content">
	<form class="left">
		<div id="queue"></div>
		<input type="button" id="start" class="uploadify-button" value="上传" />
		<input id="file" name="file_upload" type="file" multiple="true" />
	</form>
</div>
<script type="text/javascript">
(function(){
    $('#file').uploadify({
        'fileSizeLimit': '<?=$size?>',
        'queueSizeLimit': <?=$limit?>,
        'multi': true,
        'buttonText': '选择文件',
        'auto': false,
        'width':85,
        'fileTypeDesc':'<?=$title?>',
        'fileTypeExts':'<?=$types?>',
        'swf': '<?=base_url()?>csdj/swfupload/uploadify.swf',
        'uploader': '<?=$uplink?>',
        'onSelect': function(file){
        },
        'onUploadStart': function(){
        },
        'onUploadComplete': function(){
        },
        'onQueueComplete': function(){
        },
        'onUploadSuccess': function(file, data, response){
            if(data!='' && data!='no'){
                 var msg= data.split('=cscms=');
                 var url=msg[0];
                 var dx=msg[1];
                 var yz=msg[2];
                 var sc=msg[3];
		 if(url==''){
                       alert('上传失败！');
		 }else{
		 window.parent.document.getElementById('<?=$fhurl?>').value= url;
                 <?php if (!empty($dxurl) && $dxurl!='undefined'){ ?>
		 window.parent.document.getElementById('<?=$dxurl?>').value= dx;
                 <?php } ?>
                 <?php if (!empty($yzurl) && $yzurl!='undefined'){ ?>
		 window.parent.document.getElementById('<?=$yzurl?>').value= yz;
                 <?php } ?>
                 <?php if (!empty($scurl) && $scurl!='undefined'){ ?>
		 window.parent.document.getElementById('<?=$scurl?>').value= sc;
                 <?php } ?>
                 <?php if (!empty($msgurl) && $msgurl!='undefined'){ ?>
		 window.parent.document.getElementById('<?=$msgurl?>').innerHTML='<font color=#0000ff>恭喜您，文件上传成功!</font>';
                 <?php } ?>
		 parent.Dialog.close();
		 }
            }else{
                 alert('上传失败！');
            }
        }
    });
    $('#start').click(function(){
        $('#file').uploadify('upload', '*');
    });
})();
</script>
</body>
</html>
