Recently written pages (with images uploaded, single images and multiple images)

Source: Internet
Author: User

<%@ page contenttype= "Text/html;charset=utf-8" language= "java"%>
<%@ taglib uri= "Http://java.sun.com/jsp/jstl/core" prefix= "C"%>
<%@ taglib uri= "http://java.sun.com/jsp/jstl/functions" prefix= "FN"%>
<title> Add pages </title>
<meta http-equiv= "x-ua-compatible" content= "Ie=edge"/>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<meta name= "apple-mobile-web-app-capable" content= "yes"/>
<c:set var= "BasePath" value= "${pagecontext.request.scheme}${"://'}${pagecontext.request.servername}${': '}${ Pagecontext.request.serverport}${pagecontext.request.contextpath} "></c:set>
<script type= "Text/javascript" src= "Http://i0.ulechina.com/j/lib/jquery.js" ></script>
<script type= "Text/javascript" src= "Http://i0.ule.com/j/jend/jend.js" ></script>
<script type= "Text/javascript" src= "${basepath}/js/item/jslib/ajaxfileupload.js" ></script>
<script type= "Text/javascript" src= "${basepath}/js/jquery.uploadify.js" ></script>
<script type= "Text/javascript" src= "${basepath}/js/jquery.json.js" ></script>
<script type= "Text/javascript" >
$ (document). Ready (function () {
$ ("#uploadPic_input"). Click (function () {
if ($ ("#brandLogoImage"). attr ("src") = = "") {
JEND.page.dialog.show ({
Title: ' Upload brand image ',
ID: ' Uploadbranddiv ',
width:600,
height:500
});

} else {
Jend.load (' Util.dialog ', function () {
JEND.util.dialog.alert (' trademark already exists ');
})
}
});
}

);
Picture of the Flyer
function Ajaxfileupload () {
var ofile = document.getElementById (' filetoupload ');
if (!ofile.value = = "") {
$.ajaxfileupload ({
URL: ' ${basepath}/uploadimgjquery?method=brandimg ',
Secureuri:false,
Fileelementid: ' Filetoupload ',
DataType: ' JSON ',
Success:function (data) {
if (Data.returncode = = "0000") {
Jend.load (' Util.dialog ', function () {
JEND.util.dialog.alert (' image upload succeeded ');
});
$ ("#brandLogo"). Val (Data.imgurl);
$ ("#brandLogoImage"). attr ("src", data.imgurl);
$ ("#logo")
. Append (
' ');
JEND.page.closeDialog ();
} else {
Jend.load (' Util.dialog ', function () {
JEND.util.dialog.alert (' image upload failed ');
});
$ ("#brandLogoImage"). attr ("src", "")
}
},
Error:function (data, status, E) {
JEND.util.dialog.alert ("Image Server Exception");
}
})
return false;
}else{
JEND.util.dialog.alert ("No pictures selected");
}
return false;
}
$ (document). Ready (function () {
$ ("#uploadImg"). Click (function () {
JEND.page.dialog.show ({
Title: ' Upload brand image ',
ID: ' UploadBrandDiv1 ',
width:600,
height:500
});
});
});
Upload multiple images
function AjaxFileUpload1 () {
var ofile = document.getElementById (' FileToUpload1 ');
if (!ofile.value = = "") {
$.ajaxfileupload ({
URL: ' ${basepath}/uploadimgjquery?method=brandimg ',
URL: ' ${basepath}/uploadeamge ',
Secureuri:false,
Fileelementid: ' FileToUpload1 ',
DataType: ' JSON ',
Success:function (data) {
if (Data.returncode = = "0000") {
JEND.util.dialog.alert ("Image upload success");
$ ("#brandRegCer")
. Append (
" ");
$ ("#brandRegCer")
. Append (
' $ ("#uploadImg"). attr ("style",
"display:inline-block;margin-top:10px")
JEND.page.closeDialog ();
} else {
JEND.util.dialog.alert ("Picture upload failed, reason for failure"
+ data.returnmessage);
$ ("#brandLogoImage"). attr ("src", "")
}
},
Error:function (data, status, E) {
JEND.util.dialog.alert ("Image Server Exception");
}
})
return false;
}else{
JEND.util.dialog.alert ("No pictures selected");
}
return false;
}
function Saveclick () {

var name = $.trim ($ ("#brandName"). Val ());
if (name) {
var Nameen = $.trim ($ ("#brandNameEn"). Val ());
var Brandlogo = $ ("#brandLogo"). Val ();
var sort = $.trim ($ ("#sort"). Val ());
var Displayflag = $ (' input:radio:checked '). Val ();
var Brandregcerurl = $ ("#brandRegCerurl"). Val ();
var list = $ (". Cerurls");
var strsrc = "";
var num
for (var i = 0; i < list.length; i++) {
num = List[i];
STRSRC + = ("|*|" + $ (num). attr ("src"))
}
STRSRC = Strsrc.substr (3, Strsrc.length)
$ (' #brandRegCerUrl '). Val (STRSRC);
$
. Ajax ({
Type: "POST",
DataType: "JSON",
URL: "${basepath}/brand/api/savebrand.action",
Data: {
Brandname:name,
Brandnameen:nameen,
Brandlogo:brandlogo,
Displayseq:sort,
Displayflag:displayflag,
Brandregcerurl:strsrc
},
Beforesend:function (data) {
$ ("#brandName_span"). Text ("");
},
Success:function (data) {
if (Data.num = = "200") {
Boolclick = true;
$ ("#brandName_span"). HTML ("");


JEND.page.alert ({
Message: ' Add brand success ',
Callback:function () {
Window.location.href = "${basepath}/brand/querybrandall.action";
},
TOP:200,
Closekey: ' ESC '
});
} else if (Data.num = = "400") {
Jend.load (' Util.dialog ', function () {
JEND.util.dialog.alert (Data.message);
$ ("#brandName_span"). HTML (data.message);
$ ("#brandName_span"). CSS ("Color", "red");
$ ("#brandName"). Val ("");

});
$ ("#brandName_span"). HTML ("");
} else if (Data.num = = "500") {
Jend.load (' Util.dialog ', function () {
JEND.util.dialog.alert (Data.message);
});
}
},
Error:function () {
$ ("#brandName_span"). HTML ("error");
}
});
} else {
Jend.load (' Util.dialog ', function () {
JEND.util.dialog.alert (' brand name cannot be empty ');
});

}

}

function Returnclick () {
Location = "${basepath}/brand/querybrandall.action";
}
function Removeimage (obj) {
if ($ (obj). attr (' id ') = = "Removelogo") {
$ (obj). Prev (). attr (' src ', ');
$ ("#brandLogo"). Val ("");
$ (obj). Remove ();
} else {
var b = $ (obj). Prev (). attr (' src ');
$ ("#uploadImg"). attr ("style",
"display:inline-block;margin-top:10px")
var Brandid = $ (' #brandId '). Val ();
$ (obj). Prev (). remove ();
$ (obj). Remove ();
if ($ ("#brandRegCer img"). Length > 0) {
$ ("#uploadImg"). attr ("style",
"display:inline-block;margin-top:10px")
} else {
$ ("#uploadImg"). attr ("style",
"Display:inline-block;margin-top:113px")
}
}

}
function CheckName () {
$ ("#brandName_span"). HTML ("");
}
</script>
<body>
<div id= "base" class= "" >

<div id= "U50" class= "text" >
<p>
<span style= "color: #0066CC;" >&nbsp;&nbsp; <a href= "#" class= "score-0" > Admin system </a>&gt</span>
<span style= "color: #333333;" > <a href= "${basepath}/brand/showbrandmanage.action" class= "score-0" > Brand management </a></span>
<span style= "color: #333333;" >&gt;</span>
<span style= "color: #333333;" > Add Brand </span>
</p>
</div>
<form action= "#" Name= "Addbrandform" id= "Addbrandform" method= "POST"
Enctype= "Multipart/form-data" >
<input id= "Brandlogo" name= "Brandlogo" type= "hidden"/> <input
Id= "Brandregcerurl" name= "Brandregcerurl" type= "hidden"/>
<table id= "u0" border= "1px" table-layout= "fixed" >
<tr>
&LT;TD width= "align=" "left" ><span
style= "font-family: ' Arial negreta ', ' Arial '; font-weight:700; Color: #FF0000; " >*</span><span
style= "font-family: ' Arial Normal ', ' Arial '; font-weight:400; Color: #333333; " > Brand name:</span>
</td>
<td><input id= "brandname" name= "brandname" type= "text"
Onfocus= "CheckName ()"/> <span id= "Brandname_span" ></span></td>
</tr>
<tr>
&LT;TD width= "align=" "left" ><span
style= "font-family: ' Arial Normal ', ' Arial '; font-weight:400; Color: #333333; " > Brand English name </span>
</td>
<td><input id= "Brandnameen" name= "Brandnameen" type= "text"
Onkeyup= "Value=value.replace (/[^\w\.\/]/ig,") "Value=" "/></td>
</tr>
<tr style= "height:75px;" >
&LT;TD width= "><span></span><span>" Brand logo:</span></td>
&LT;TD valign= "Bottom" align= "left" >
<div id= "logo" class= "logo" align= "left" style= "Display:inline" >
Style= "Display:inline-block; width:100px; height:100px; "/>
</div>
<div style= "Display:inline" >
<span> <input id= "uploadpic_input" type= "button"
value= "Select Picture" style= "margin-top:90px"/> <span
style= "COLOR: #333333;" > Brand logo must be consistent with the trademark registration and graphic information </span><span
style= "COLOR: #333333;" >,</span><span style= "color: #333333;" > Format </span><span
style= "COLOR: #FF0000;" >jpg</span><span style= "color: #333333;" >,</span><span
style= "COLOR: #333333;" > image size not exceeding </span><span
style= "COLOR: #FF0000;" >100k</span><span style= "color: #333333;" >. </span></span>
</div>
</td>
</tr>
<tr style= "height:150px; Valign:baseline ">
&LT;TD width= "align=" "left" > Trademark Registration Certificate:</td>
<td class= "Tal pl10 img-td" style= "Valign:baseline" >
<div id= "Brandregcer" class= "logo" align= "left"
Style= "Display:inline" ></div>
<div>
<input type= "button" value= "Select Picture" Name= "uploadimg" id= "uploadimg"
margin-top= "113PX"
Style= "Display:inline-block; Margin-top:113px "/>
<!--<span style= "color:brown;padding:10px 0 10px 0;font-weight:normal;font-size:12px" > Forward placement, clear, stamped red seal, File format requirements are JPG, GIF, PNG, BMP, one of the size, please limit within 1M. </span>
<span style= "color: #333333;" > Forward positioning, clear, stamped red seal, file format requirements for </span><span
style= "COLOR: #FF0000;" >jpg, GIF, PNG, Bmp</span><span
style= "COLOR: #333333;" One of the > sizes, please limit the </span><span
style= "COLOR: #FF0000;" >1m</span><span style= "color: #333333;" > Within </span><span
style= "COLOR: #333333;" >. </span>

</div>
</td>
</tr>
<tr>
&LT;TD width= "align=" "left" ><span> sort </span></td>
<td><input id= "Sort" name= "sort" type= "text"
Onkeyup= "This.value=this.value.replace (/\d/g, ')"
Onafterpaste= "This.value=this.value.replace (/\d/g, ')"/></td>
</tr>
<tr>
&LT;TD width= "align=" "left" ><span></span><span> display:</span></td>
<td><input type= "Radio" name= "Displayflag" value= "1" checked/> Yes
<input type= "Radio" name= "Displayflag" value= "0"/> Not shown </td>
</tr>

<tr>

&LT;TD colspan= "2" >

<input class= "Button2" style= "margin-left:116px;height:26px;width:77px" type= "button" value= "Save" onclick= " Saveclick () "/>
<input class= "Button2" style= "margin-left:71px;height:26px;width:77px" type= "button" value= "Return" onclick= " Returnclick () "/>
</td>
</tr>
</table>
</form>
</div>
<div id= "Uploadbranddiv" style= "display:none; margin:10px 20px; " >
<form name= "Uploadform" id= "Uploadform" action= "" method= "POST"
Enctype= "Multipart/form-data" >
<br>
<p style= "margin:5px;" >
<input id= "filetoupload" type= "file" Name= "Filetoupload"
class= "Input" >
</p>
<p style= "MARGIN:5PX;FONT-SIZE:18PX;" > uploaded brand logo must be consistent with the trademark registration and graphic information </p><br>
<p style= "MARGIN:5PX;FONT-SIZE:18PX;" > Size 400x200 pixels, format jpg</p><br>
<p style= "MARGIN:5PX;FONT-SIZE:18PX;" > image size not exceeding 100k</p><br>
<p style= "MARGIN:5PX;FONT-SIZE:18PX;" >
<button class= "btn borange fw7" id= "Buttonupload" style= "Height:40px;width:124px;font-size:18px;color: #fff; Background-color: #ff7f00; "
onclick= "return ajaxfileupload ();" > Uploading Files </button>
</p>
<p>&nbsp;</p>
</form>
</div>
<div id= "UploadBrandDiv1" style= "display:none; margin:10px 20px; " >
<form name= "UploadForm1" id= "UploadForm1" action= "" method= "POST"
Enctype= "Multipart/form-data" >
<br>
<p style= "margin:5px;" >
<input id= "FileToUpload1" type= "file" Name= "FileToUpload1"
class= "Input1"/>
</p><br>
<p style= "MARGIN:5PX;FONT-SIZE:18PX;" > uploaded brand logo must be consistent with the trademark registration and graphic information </p><br>
<p style= "MARGIN:5PX;FONT-SIZE:18PX;" > Size 400x200 pixels, format jpg</p><br>
<p style= "MARGIN:5PX;FONT-SIZE:18PX;" > image size not exceeding 100k</p><br>
<p style= "margin:5px;" >
<button class= "btn borange fw7" id= "ButtonUpload1" style= "Height:40px;width:124px;font-size:18px;color: #fff; Background-color: #ff7f00; "
onclick= "return AjaxFileUpload1 ();" > Uploading Files </button>
</p>
<p>&nbsp;</p>
</form>
</div>
</body>
<style>
Body {
margin:0px;
Background-image:none;
position:static;
Left:auto;
width:970px;
margin-left:0;
margin-right:0;
Text-align:left;
}

#base {
Position:absolute;
z-index:0;
}

#u0 {
Position:absolute;
left:18px;
top:40px;
width:957px;
}

#u50 {
?????? -Position:static;
left:100px;
top:0px;
width:350px;
Word-wrap:break-word;
font-size:12px;
}

#u0 {
Border-collapse:collapse;
}

TD {
border:1px solid #D9D9F3;
padding:5px 15px;
font-size:12px;
}

TR {
height:25px;
}

#button2 {
top:450;
left:100;
}
. button2 {
Color: #fff;
border:1px solid #f60;
Background-color: #ffb44d;
Background-image:-webkit-linear-gradient (Top, #f90, #f40);
}
</style>

Recently written pages (with images uploaded, single images and multiple images)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.