<style>
    .dialog567{width: 300px;}
    .realFbtnbox{padding: 10px 0 0 60px;}
</style>
<div style="display:none;" id = 'dialog_real' class="dialog radius5 dialog567">
    <form id = 'real_form' name = 'real_form' method = 'post' enctype = 'multipart/form-data'>
        <div class="hd">

            <span class="close close-win" title="关闭">Χ</span>
        </div>
        <div class="mod">
                <div class="realFCheckbox">
                    <label style="margin-left: 30px;">
                        确定对该条房源放心看设置吗?
                    </label>
                </div>
                <div class="realFbtnbox">
                    <a class="btn btnCon radius5 close-win" href="####" onclick='sub_real_form()'>确定</a>
                    <a class="btn btnCon radius5 close-win" href="####">取消</a>
                </div>
            </div>
        </div>
        <input type="hidden" name='rowid' id='real_set_rowid' value=''>
        <input type="hidden" name='secret_key' id='real_secret_key' value=''>
    </form>
</div>
<script type="text/javascript">
    var swfu0;
    swfu0 = new SWFUpload({
        // Backend Settings
        upload_url: "<?= $upload_pic_url ?>",
        post_params: {"PHPSESSID": "<?php echo session_id(); ?>"},
        // File Upload Settings
        file_size_limit: "1 MB", // 1MB
        file_types: "*.jpg",
        file_types_description: "JPG Images",
        file_upload_limit: "1",
        file_queue_limit: "5",
        custom_settings: {
            upload_target: "divFileProgressContainer0",
            upload_limit: 1,
            upload_fail: "divFileProgressFail0",
            upload_nail: "thumbnails0",
            upload_infotype: 1
        },
        // Event Handler Settings - these functions as defined in Handlers.js
        //  The handlers are not part of SWFUpload but are part of my website and control how
        //  my website reacts to the SWFUpload events.
        swfupload_loaded_handler: swfUploadLoaded,
        file_queue_error_handler: fileQueueError,
        file_dialog_start_handler: fileDialogStart,
        file_dialog_complete_handler: fileDialogComplete,
        upload_progress_handler: uploadProgress,
        upload_error_handler: uploadError,
        upload_success_handler: uploadSuccess,
        upload_complete_handler: uploadComplete,
        // Button Settings
        button_image_url: "<?= STATIC_SOURCE_URL ?>/common/js/swf/btn61x22.png",
        button_placeholder_id: "spanButtonPlaceholder0",
        button_width: 61,
        button_height: 22,
        button_cursor: SWFUpload.CURSOR.HAND,
        // Flash Settings
        flash_url: "/swfupload.swf",
        // Debug Settings
        debug: false
    });
    
    var swfu1;
    swfu1 = new SWFUpload({
        // Backend Settings
        upload_url: "<?= $upload_pic_url ?>",
        post_params: {"PHPSESSID": "<?php echo session_id(); ?>"},
        // File Upload Settings
        file_size_limit: "1 MB", // 1MB
        file_types: "*.jpg",
        file_types_description: "JPG Images",
        file_upload_limit: "5",
        file_queue_limit: "5",
        custom_settings: {
            upload_target: "divFileProgressContainer1",
            upload_limit: 5,
            upload_fail: "divFileProgressFail1",
            upload_nail: "thumbnails1",
            upload_infotype: 2
        },
        // Event Handler Settings - these functions as defined in Handlers.js
        //  The handlers are not part of SWFUpload but are part of my website and control how
        //  my website reacts to the SWFUpload events.
        swfupload_loaded_handler: swfUploadLoaded,
        file_queue_error_handler: fileQueueError,
        file_dialog_start_handler: fileDialogStart,
        file_dialog_complete_handler: fileDialogComplete,
        upload_progress_handler: uploadProgress,
        upload_error_handler: uploadError,
        upload_success_handler: uploadSuccess,
        upload_complete_handler: uploadComplete,
        // Button Settings
        button_image_url: "<?= STATIC_SOURCE_URL ?>/common/js/swf/btn61x22.png",
        button_placeholder_id: "spanButtonPlaceholder1",
        button_width: 61,
        button_height: 22,
        button_cursor: SWFUpload.CURSOR.HAND,
        // Flash Settings
        flash_url: "/swfupload.swf",
        // Debug Settings
        debug: false
    });
    
    function sub_real_form()
    {

        //弹出处理遮罩层
       // openWin('docation_loading');
        var form = $("#search_form");
        
        $.ajax({
            type: "post",
            url: "<?php echo GB_WO_URL;?>/sell/house_real_set",
            data: $('#real_form').serialize(),
            dataType: "json",
            success: function(data)
            {
                console.log(data);
                //return ;
                close_doaction_loading();
                $("#gTipsCoverdocation_loading").hide();
                //return ;
				if(data.errorCode == '401')
				{
					jump_win('<?php echo GB_WO_URL;?>/sell/jump/login' , '请重新登录');
					return false;
				}
                if (data.is_ok == '1')
                {
                   // window.open(data.url);
                    $("#atction_type").val("ajax_rest_assured");

                    $("#dialogSaveDiv3").html("为避免您的放心看保证金受损，请您仔细核对并确认该套房源当前是否可售可看、价格是否为业主最新报价、房源信息填写是否准确（面积、税费、楼层、朝向、装修）、房源标题及描述与房源基本信息是否一致、房源图片及户型图与实际是否一致。");

                    $('.radius5 .gocheck').attr('href',data.url);
                    openWin("dialog_rest");
/*
                    $("#dialogts #dialog_tip").html(data.msg);
                    openWin('dialogts');
                    form.submit();*/
                }else if(data.is_ok == '2')
                {
                    alert("请先补充完整楼栋门牌信息");
                    location.replace('/sell/modify/'+data.msg);
                    return false;
                }
                else
                {
                    $("#dialogts #dialog_tip").html(data.msg);
                    openWin('dialogts');
                    //form.submit();
                }
            }
        });
    }
    
    
    function ajax_rest_assured() {
        var option = $('#real_form').serialize();
        $.ajax({
            type: "post",
            url: "<?php echo GB_WO_URL;?>/sell/ajax_rest_assured",
            data: $('#real_form').serialize(),
            dataType: "json",
            success: function(data) {
                if(data.is_ok == 1){
                    $("#dialogts #dialog_tip").html(data.msg);
                    openWin('dialogts');
                    location.reload();
                }else{
                    $("#dialogts #dialog_tip").html(data.msg);
                    openWin('dialogts');
                }
            }
        });
    }
    
</script>
