<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>{lang_admin('network_pictures')}</title>
    <link href="./common/js/upimg/dialog.css" rel="stylesheet" type="text/css"/>

    <link href="./common/font/simple/css/font.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="./common/js/upimg/jquery.js"></script>
    <script type="text/javascript" src="./common/js/upimg/dialog.js"></script>
    <script type="text/javascript" language="JavaScript">
        var filemanage_js_upfile_zoomsize  = "{lang_admin('sorry_the_size_of_the_picture_is_invalid_or_wrong_please_fill_in_the_integer_type')}";
        var filemanage_js_upfile_driname_err  = "{lang_admin('sorry_document_address_is_not_filled_in_please_go_back_and_choose_again')}";
        var filemanage_js_upfile_ok = "{lang_admin('congratulations_file_added_successfully')}";
        var filemanage_js_upfile_no = "{lang_admin('sorry_file_addition_failed')}";
        var fheight="405";
        $(window).load(function(){
            var h = parseInt(fheight);
            $('#mainbodybottonauto').css({height:h-39});
            var options = {
                beforeSubmit: formverify,
                success:saveResponse
            }
            $('#upfile').submit(function() {
                $(this).ajaxSubmit(options);
                return false;
            });
        });

        function formverify(formData, jqForm, options) {
            var queryString = $.param(formData);
            var get=urlarray(queryString);
            if(get['upfilepath']=='') {
                document.upfile.upfilepath.focus();
                alert(filemanage_js_upfile_driname_err);
                return false;
            }
        }

        function saveResponse(options){
            var inputstr='<td class="trtitle02" id="upfilepath"><input type="text" name="upfilepath" maxlength="200" size="50" class="infoInput"> "{lang_admin('must_start_with_http')}"</td>';
            $("#upfilepath").replaceWith(inputstr);

            var strarray = options.split('|');
            if (strarray[1]!=undefined){
                $("#resulttable").removeClass('displaynone');

                if (strarray[1]=='img'){
                    if (strarray[2]=='1'){
                        var upresult='<td class="trtitle02" id="upresult"><a onclick="javascript:refile(\''+strarray[0]+'\',\''+strarray[2]+'\',\''+strarray[3]+'\',\''+strarray[4]+'\',\''+strarray[5]+'\');" href="#" onclick="gotourl(this)"   data-dataurl="#body" hidefocus="true"><img src="'+ strarray[0] + '" width="100"></a></td>';
                    }else{
                        var upresult='<td class="trtitle02" id="upresult"><a onclick="javascript:refile(\''+strarray[0]+'\',\''+strarray[2]+'\',\''+strarray[3]+'\',\''+strarray[4]+'\',\''+strarray[5]+'\');" href="#" onclick="gotourl(this)"   data-dataurl="#body" hidefocus="true"><img src="'+ strarray[0] + '" height="100"></a></td>';
                    }
                    $("#upresult").replaceWith(upresult);
                }else{
                    var upresult='<td class="trtitle02" id="upresult"><a class="lnglist" onclick="javascript:refile(\''+strarray[0]+'\',\''+strarray[2]+'\',\''+strarray[3]+'\',\''+strarray[4]+'\',\''+strarray[5]+'\');" href="#" onclick="gotourl(this)"   data-dataurl="#body" hidefocus="true">' + strarray[0] + '</a></td>';
                    $("#upresult").replaceWith(upresult);
                }
                $("#title").val("");
                alert(filemanage_js_upfile_ok);
                $("#netupfile").attr("style"," display: none;");
            }else{
                alert(strarray[0]);
            }
        }

        function refile(filename,iswidth,alt,width,height){
            parent.refile(filename,iswidth,alt,width,height);
        }
    </script>
</head>

<body class="bodyflow">
<form name="upfile" id="upfile" method="post" action="index.php?case=file&act=netfilesave&admin_dir={get('admin_dir',true)}" >
    <div id="mainbodybottonauto" class="managebottonadd">
        <div class="maindobycontent">
            <div class="maneditcontent">
                <table id="netupfile" class="formtablewin">
                    <tr class="trstyle2">
                        <td class="trtitle02" id="upfilepath">
                            <div class="input-group">
        <span class="input-group-addon">
            {lang_admin('please_fill_in_the_website')}
        </span>
                                <input type="text" name="upfilepath" class="infoInput form-control" style="width:100%;">
                            </div>
                            <div class="blank5"></div>
                            <p class="tips">
                                <i class="icon-info"></i>
                                {lang_admin('must_start_with_http')}
                            </p>
                        </td>
                    </tr>
                    <tr class="trstyle2">
                        <td class="trtitle02" id="upfilepath">
                            <div class="input-group">
        <span class="input-group-addon">
                        {lang_admin('caption')}
</span>
                                <input type="text" name="alt" id="alt" class="config form-control" style="width:96%;" />
                            </div>
                            <div class="blank15"></div>

                            <div style="width:45%;float:left;">
                                <div class="input-group">
        <span class="input-group-addon">
				    {lang_admin('width')}
             </span>
                                    <input name="width" type="text" id="width" class="config form-control">
                                    <span class="input-group-addon">
        PX
        </span>
                                </div>
                            </div>

                            <div style="width:45%;float:right;">
                                <div class="input-group">
        <span class="input-group-addon">
				    {lang_admin('height')}
            </span>
                                    <input name="height" type="text" id="height" class="config  form-control">
                                    <span class="input-group-addon">
            PX
</span>
                                </div>
                            </div>

                        </td>
                    </tr>

                </table>
                <table class="formtablewin displaynone" id="resulttable">
                    <tr class="trstyle3">
                        <td id="upresult">
                            <center>
                                <img src="images/pic.png" class="img-responsive">
                            </center>
                        </td>
                    </tr>
                    <tr class="trstyle2">
                        <td><p class="tips text-center"><i class="icon-info"></i>&nbsp;&nbsp;{lang_admin('tip_click_on_the_above_results_select_the_file_and_close_the_window')}</p></td>
                    </tr>
                </table>

            </div>
        </div>
    </div>
    <div id="downbotton">
        <div id="subbotton">
            <div id="bottonsubmit">
                <input style="float:right;margin-left:15px;" type="submit" name="Submit"  id="submitbotton" value="{lang_admin('determine')}" class="buttonface" title="{lang_admin('determine')}"/></td>

                <input style="float:right;" type="reset" name="reset" onClick="javascript:parent.resetwindow();" id="release" value="{lang_admin('close')}" class="buttonface2"  title="{lang_admin('close')}" />

            </div>
        </div>
    </div>
</form>
<!-- {getCopyRight()} -->
</body>
</html>
