Jump to content

Search the Community

Showing results for tags 'Java'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 61 results

  1. I have modified this script to include a call-to-action button when a video ends. What I'm trying to do is get the button to work on mouse rollover and click. The button works and comes up after the video ends but I can't seem to place the attributes in a logical place to get them to work. It's a little advanced for me so I'm hoping that someone can do this and explain what they did so I can learn. I've spent hours on this! LOL Here's the whole script... <div id="player"></div> <script type="text/javascript"> jwplayer("player").setup({ playlist: [{ image: "http://disc.maximumimpact.ca/videos/DISC-Title.png", sources: [{ file: "http://disc.maximumimpact.ca/videos/DISC Assessment Intro.m4v" },{ file: "http://disc.maximumimpact.ca/videos/DISC Assessment Intro.webm" }] }], width: 853, height: 480, stretching: "fill" }); jwplayer().onComplete(function() { var el = document.createElement("div"); var el2 = document.createElement("div"); var el3 = document.createElement("div"); var el4 = document.createElement("div"); var txt = document.createElement('a'); if (jwplayer().getRenderingMode() == "html5"){ var theBody = document.getElementById(player.id); } else { var theBody = document.getElementById(player.id+"_wrapper"); } var playerWidthPX2 = theBody.style.width; var playerWidthPX = parseFloat(playerWidthPX2); var playerHeightPX2 = theBody.style.height; var playerHeightPX = parseFloat(playerHeightPX2); el3.setAttribute('id', 'bg'); el3.style.height = playerHeightPX + "px"; el3.style.width = playerWidthPX2; el3.style.background = "#ffffff"; el3.style.opacity = "0.70"; el3.style.position = "absolute"; el3.style.backgroundImage="url('background.png')"; el.setAttribute('src', 'background.png'); if (jwplayer().getRenderingMode() == "html5"){ } else { el3.style.top = playerHeightPX-playerHeightPX+"px"; } el3.style.zIndex = "999"; el3.width = playerWidthPX; el3.height = playerHeightPX; el2.setAttribute('id', 'bg2'); el2.style.height = playerHeightPX + "px"; el2.style.width = playerWidthPX2; el2.style.position = "absolute"; el2.style.zIndex = "999"; el2.width = playerWidthPX; el2.height = playerHeightPX; theBody.appendChild(el3); theBody.appendChild(el2); el2.style.textAlign = "center"; el2.style.left = "center"; el2.style.top = ((playerHeightPX*3)/6) -"40" + "px"; el.setAttribute('id', 'hyperlink'); el.style.height = "30px"; el.style.width = "30px"; el2.width = "30"; el2.height = "30"; el.style.position = "relative"; el.setAttribute('frameBorder', '0'); el.style.top = "11px"; el.style.left = "202px"; el.style.textAlign = "center"; el.style.marginBottom = "-16px"; el.style.marginRight = "8px"; el4.setAttribute('id', 'replay'); el4.style.height = "20px"; el4.style.width = "20px"; el4.height = "20"; el4.width = "20"; el4.style.position = "absolute"; el4.style.top = "-" + playerHeightPX/2 + "px"; el4.style.marginTop = "50px"; el4.style.left = playerWidthPX/2 + "px"; el4.style.marginLeft = "50px"; el4.style.backgroundImage="url('replay.png')"; el4.setAttribute('src', 'replay.png'); el2.appendChild(txt); txt.outerHTML = '<a href="http://google.com" onMouseOver="return changeImage()" onMouseOut= "return changeImageBack()" onMouseDown="return handleMDown()" onMouseUp="return handleMUp()"><img name="jsbutton" src="http://disc.maximumimpact.ca/button/ClickHere-Normal.png" width="402" height="127" border="0" alt="javascript button"></a>'; el2.appendChild(el); el2.appendChild(el4); el.style.backgroundImage="url('hyperlink.png')"; el.setAttribute('src', 'hyperlink.png'); el.style.cursor = "pointer"; el.style.display = "table"; el2.style.display = "table"; el3.style.display = "table"; el4.style.display = "table"; txt.style.display = "table"; el.onmouseup = function(){ window.open("http://google.com"); } el4.style.cursor = "pointer"; el4.onmouseup = function(){ el.style.display = "none"; el2.style.display = "none"; el3.style.display = "none"; el4.style.display = "none"; txt.style.display = "none"; jwplayer().play(); } }); </script> Here is a complete script of the button that works... <a href="http://www.google.com" onMouseOver="return changeImage()" onMouseOut= "return changeImageBack()" onMouseDown="return handleMDown()" onMouseUp="return handleMUp()" ><img name="jsbutton" src="http://disc.maximumimpact.ca/button/ClickHere-Normal.png" width="402" height="127" border="0" alt="javascript button"></a> <script language="JavaScript"> upImage = new Image(); upImage.src = "http://disc.maximumimpact.ca/button/ClickHere-Rollover.png"; downImage = new Image(); downImage.src = "http://disc.maximumimpact.ca/button/ClickHere-Click.png" normalImage = new Image(); normalImage.src = "http://disc.maximumimpact.ca/button/ClickHere-Normal.png"; function changeImage() { document.images["jsbutton"].src= upImage.src; return true; } function changeImageBack() { document.images["jsbutton"].src = normalImage.src; return true; } function handleMDown() { document.images["jsbutton"].src = downImage.src; return true; } function handleMUp() { changeImage(); return true; } </script> I'm trying to put them together!
  2. I Am Creating A iOS WebApp [ StandAlone] Which Looks Like A iOS Application The Only Difference That It Written In HtmlAnd JavascriptWhen You Go To A Website and click on add to home screen it creates an icon with the site content [webclip] i have created a website and i need help with one little detail i found that script in my site it permit all links to open in the webapp i was trying to make the links open in safari but when i manage to do that, the navigation menu doesn't work could any one help me please ?heres the code Detect if iOS WebApp Engaged and permit navigation without deploying Safari (function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(d.href.indexOf("http")||~d.href.indexOf(e.host))&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone") i need to open the links in safari rather than the webapp thats it
  3. Hey there, i have a Java MVC Web Application that uses the Spring-Library for the Backend and then JSP files for the frontend. Now, in various JSP files i am using Ajax to have some smooth design when needed. This whole application is running on an Apache Tomcat Server. I have to admit that i am still very new in the whole Web-Development thing, so bare with me.Following problem: In the current state, i feel like the tomcat server is automatically handeling the Sesions, including session-timeouts. So, i can specify the time when a session is supposed to count as timed out and everything, the server recognized this correctly and whenever i try to request something with a timedout session the server automatically logs me out and brings me back to the login page. I havent found any implementation of such behavior in the source-code, hence i assume that this is somehow implemented by some standard tomcat routine. The problem with this behavior is, that the server sends a 302 redirect message specifying the login-Page as Location in the response-header. While this works fine for normal requests it is bad for ajax-requests, as these cannot handle 302 codes. The browser catches that one and the ajax-call has no chance to ever process the reply. I am experiencing weird cookie problems and i supsect that this might be the cause of the problem. Now, it shouldnt be hard to check whether or not a request is done by an ajax-call or not. However, i have no clue WHERE i should do so. Edit: I know that there is a way of specifying Filters and there is a way of setting up a listner that gets informed about Session-creations and destructions. However, none of these suit what i want. I need to cut in at a level that allows me to process a request, see if it is an ajax-call and then see if the session used along it is timed out and then i need to be able to decide how i respond to it. Using a filter i am BEHIND that step. I get controll when stuff regarding session timeout has happened already. Using a Session-Lifetime listner i do not have any infromation about the request. I cannot respond to anyone because i have no information about any Requests. How could i go about implementing my custom session-timeout behavior without interfering with the servers implementation?Am i even right assuming that the server automatically handles these cases? It feels kind of odd that the server knows that it has to logg someone out and also knows what to redirect to. Thanks in advance If there are any questions regarding mine ... ask away
  4. Hello so I made an array and it works fine when you refresh the page the image changes but at lower screen resolutions the image cuts of the edge. With my basic code it worked fine I was wondering what I was doing wrong. This was my old code which was just one image and at lower resolutions it would still fit on the screen <center><img src="my image url" width=47%> </center> But when I use my array it cuts of I want to make the image center and just put width=47% like the top code but not sure where to put it <script language="JavaScript"><!--function random_imglink(){var myimages=new Array()myimages[1]="my image url"myimages[2]="my image url"myimages[3]="my image url"myimages[4]="my image url"myimages[5]="my image url"myimages[6]="my image url"var ry=Math.floor(Math.random()*myimages.length)if (ry==0)ry=1document.write('<img src="'+myimages[ry]+'" width=47%')}random_imglink()//--></script> If you could help me it would be much appreciated
  5. which of these is NOT equivalent to 1000102 + 1000002 ? A) 6610 B)1128 C)4216 D)10000102 E)All are equivalent the answer is B because 1000102 + 1000002 = 3410 + 3210 = 6610 = 1028 = 4216 = 1000102 Can anyone help explain how these numbers relate to each other? DOC120914-12092014150849.pdf
  6. Chi è disposto ad aiutarmi per sostenere un esame di XML ? C'è anche un progettino da implementare in Java. Prego chiamarmi al 3400513727
  7. I am somewhat new to javascripting and am working on a page load for specific content. My interal client has requested an alert to occur when someone navigates to the home page. I added a popup alert to my webpage with the following javascripting: function loadImage() { alert("This reference material contains confidential information and is not to be shared with team members who do not service private exchange business.");} <body onload="loadImage()"> It's pretty simple, but my business partner has now asked that instead of it presenting on every load, they wish it to only present on the intial load of the webpage. I have searched w3schools, but can't seem to find any expressions that will handle this type of request.
  8. Dear Experts,I'm trying to parse an odd XML file that looks like this:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>Major Version</key><integer>1</integer><key>Minor Version</key><integer>1</integer><key>Application Version</key><string>9.2.1</string><key>Features</key><integer>5</integer><key>Show Content Ratings</key><true/><key>Library Persistent ID</key><string>9210E514389C76D3</string><key>Tracks</key><dict><key>732</key><dict><key>Track ID</key><integer>732</integer><key>Name</key><string>Tears All Over Town</string><key>Artist</key><string>A Girl Called Eddy</string><key>Album Artist</key><string>A Girl Called Eddy</string>...</dict><key>760</key><dict><key>Track ID</key><integer>760</integer><key>Name</key><string>The Nightingale</string><key>Artist</key><string>Angelo Badalamenti</string><key>Album</key><string>Twin Peaks</string><key>Genre</key><string>Soundtrack</string><key>Kind</key><string>MPEG audio file</string><key>Size</key><integer>7109800</integer><key>Total Time</key><integer>296150</integer><key>Disc Number</key><integer>1</integer><key>Disc Count</key><integer>1</integer><key>Track Number</key><integer>4</integer><key>Track Count</key><integer>11</integer><key>Year</key><integer>1990</integer><key>Date Modified</key><date>2006-01-04T06:51:56Z</date><key>Date Added</key><date>2009-04-02T02:04:11Z</date><key>Bit Rate</key><integer>192</integer><key>Sample Rate</key><integer>44100</integer><key>Play Count</key><integer>4</integer><key>Play Date</key><integer>3493240930</integer><key>Play Date UTC</key><date>2014-09-11T05:42:10Z</date><key>Sort Name</key><string>Nightingale</string><key>Persistent ID</key><string>9B002DC50111B620</string><key>Track Type</key><string>File</string><key>File Folder Count</key><integer>4</integer><key>Library Folder Count</key><integer>1</integer></dict><key>762</key>...Every field in the Itunes format has <key> for the fieldname, and the <datatype> surrounding the value.This looks a lot different from the xml format that I saw in this tutorial.http://www.stat.purdue.edu/~mdw/490M/STAT490Mday29.txt<CD><TITLE>Picture book</TITLE><ARTIST>Simply Red</ARTIST><COUNTRY>EU</COUNTRY><COMPANY>Elektra</COMPANY><PRICE>7.20</PRICE><YEAR>1985</YEAR></CD>First I experimented using grep on cygwin. But I don't know how to get a specific set of three lines out of the grouping with grep.With R, I was trying to parse the file, until I looked and saw that the format was different from all the examples.This post made it look easy:How can I export my iTunes library information to a spreadsheet?https://www.quora.com/How-can-I-export-my-iTunes-library-information-to-a-spreadsheetBut it completely failed. The xml doc got imported into Open Office as a document. Not a spreadsheet.For each CD, I want to extract the Artist, Album, and Composer (if it's there)Questions:Is there a name for this type of XML file?What would be the best tool and way to parse the info from the file?grep on cygwinRPythonJavaXQuerysomething else???Thanks a lot!
  9. Hello internet, I was not sure if I should put this in JAVASCRIPT or php – in the end the form gets submitted so I decided to put this in the PHP forum. Here is my dilemma – I have several JAVASCRIPT checks to make sure people fill out their name, phone number, feedback content, and have a valid email address. On occasion it seems like people are getting around that JAVASCRIPT just to prove a point. Blank forms are being submitted. What can I do to prevent this?
  10. Hello, I'm trying to make a method that creates objects of a parameterized type randomly, but also to store the hashCode of different objects created and if at any time the percentage of different objects is less than 50% throw an exception. This last part is where I've gotten stuck. I have created a population property where I store the different hashCodes and update it in the method adding the new hashCode from the new object. But I don't know how to do for to know if the percentage of different objects is less than 50%. See if someone can help me out. Regards!
  11. Hi, First, i need to tell you that i am not experienced in CSS or coding myself but i have fairly good overall technical knowledge. I'm in need of a very simple full screen slideshow consisting of 4 images. I found a CSS3/javascript for this here: http://tympanus.net/codrops/2012/01/02/fullscreen-background-image-slideshow-with-css3/ I've tried to tweak it a bit to suite my needs. However, its not really optimal. I would like to change it so it doesnt fade between the images, a fast cut would be better. Also the original was for 6 images but i tried to change it to a 4 image slideshow but im not sure i did it correctly. Can someone help me with these two issues? thanks guys! the HTML looks like this: <!DOCTYPE html><!--[if lt IE 7 ]> <html class="ie ie6 no-js" lang="en"> <![endif]--><!--[if IE 7 ]> <html class="ie ie7 no-js" lang="en"> <![endif]--><!--[if IE 8 ]> <html class="ie ie8 no-js" lang="en"> <![endif]--><!--[if IE 9 ]> <html class="ie ie9 no-js" lang="en"> <![endif]--><!--[if gt IE 9]><!--><html class="no-js" lang="en"><!--<![endif]--> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Claires slideshow Screen 1</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="Fullscreen Background Image Slideshow with CSS3 - A Css-only fullscreen background image slideshow" /> <meta name="keywords" content="css3, css-only, fullscreen, background, slideshow, images, content" /> <link rel="shortcut icon" href="../favicon.ico"> <link rel="stylesheet" type="text/css" href="css/demo.css" /> <link rel="stylesheet" type="text/css" href="css/style1.css" /> <script type="text/javascript" src="js/modernizr.custom.86080.js"></script> </head> <body id="page"> <ul class="cb-slideshow"> <li><span>Image 01</span><div></div></li> <li><span>Image 02</span><div></div></li> <li><span>Image 03</span></div></li> <li><span>Image 04</span><div></div></li> </ul> </body></html> and the CSS looks like this: .cb-slideshow,.cb-slideshow:after { position: fixed; width: 100%; height: 100%; top: 0px; left: 0px; z-index: 0; }.cb-slideshow li span { width: 100%; height: 100%; position: absolute; top: 0px; left: 0px; color: transparent; background-size: cover; background-position: 50% 50%; background-repeat: none; opacity: 0; z-index: 0; -webkit-backface-visibility: hidden; -webkit-animation: imageAnimation 72s linear infinite 0s; -moz-animation: imageAnimation 72s linear infinite 0s; -o-animation: imageAnimation 72s linear infinite 0s; -ms-animation: imageAnimation 72s linear infinite 0s; animation: imageAnimation 72s linear infinite 0s; }.cb-slideshow li:nth-child(1) span { background-image: url(../images/1.jpg) }.cb-slideshow li:nth-child(2) span { background-image: url(../images/2.jpg); -webkit-animation-delay: 18s; -moz-animation-delay: 18s; -o-animation-delay: 18s; -ms-animation-delay: 18s; animation-delay: 18s; }.cb-slideshow li:nth-child(3) span { background-image: url(../images/3.jpg); -webkit-animation-delay: 36s; -moz-animation-delay: 36s; -o-animation-delay: 36s; -ms-animation-delay: 36s; animation-delay: 36s; }.cb-slideshow li:nth-child(4) span { background-image: url(../images/4.jpg); -webkit-animation-delay: 54s; -moz-animation-delay: 54s; -o-animation-delay: 54s; -ms-animation-delay: 54s; animation-delay: 54s; }/* Animation for the slideshow images */@-webkit-keyframes imageAnimation { 0% { opacity: 0 } 1% { opacity: 1 } 2% { opacity: 1 } 25% { opacity: 1 } 26% { opacity: 0 } 27% { opacity: 0 } 100% { opacity: 0 }}@-moz-keyframes imageAnimation { 0% { opacity: 0 } 1% { opacity: 1 } 2% { opacity: 1 } 25% { opacity: 1 } 26% { opacity: 0 } 27% { opacity: 0 } 100% { opacity: 0 }}@-o-keyframes imageAnimation { 0% { opacity: 0 } 1% { opacity: 1 } 2% { opacity: 1 } 25% { opacity: 1 } 26% { opacity: 0 } 27% { opacity: 0 } 100% { opacity: 0 }}@-ms-keyframes imageAnimation { 0% { opacity: 0 } 1% { opacity: 1 } 2% { opacity: 1 } 25% { opacity: 1 } 26% { opacity: 0 } 27% { opacity: 0 } 100% { opacity: 0 }}@keyframes imageAnimation { 0% { opacity: 0 } 1% { opacity: 1 } 2% { opacity: 1 } 25% { opacity: 1 } 26% { opacity: 0 } 27% { opacity: 0 } 100% { opacity: 0 }} /Joel
  12. i just wanna create mansory look for my newly updated article and it should have "more" option to preview the full article...... i.e. for mansory........ here(above) pic here(above) pic here(above) pic a small content from the article -more-
  13. I am using this code to run python program from terminal with '34' as argument command line in terminal: import java.lang.*; import java.lang.Process.*; import java.io.*; public class java3 { public static void main(String args[]) { try{ Runtime.getRuntime().exec(new String[] { "xterm","-e","python","pthon1.py","34" }); } } catch(IOException e) { System.out.println("error:"+e); } } } but i want to store that value '34' in a integer variable and then pass to terminal. please any suggestions ???
  14. I am trying to learn any programming language and I have looked into several sites including Oracle and I must say everything I've tried to learn hasn't stayed in well. I personally love the layout and the design as well as the ability to try it yourself on W3Schools' site. I Understand that W3Schools was made to teach everything you need to know to create a webpage, or to be used as a reference to commands in a language used in making a webpage, but I and many others would greatly benefit if W3Schools could adopt a programming section. I am starting to learn Java and as for right now I only request Java, But I would like to see all commonly used programming language. I used W3Schools to learn HTML, CSS, and a little bit of JavaScript, It took me a little under 7 hours to learn a large portion of HMTL and CSS. I just love W3Schools' Website and Teaching ways. I would love to learn every language possible here, I find this the best way to learn Computer languages.
  15. arunk.fun

    HTML Button

    Hello All, I put my question straight here. If my website address is www.abcd.in a ""Click Here"" button should be linked to http://www.XXXXXXXX.com/?r=1234567 [FIXED] If my website address is www.abcd.in/?r=1111111 a ""Click Here"" button should be linked to http://www.XXXXXXXX.com/?r=1111111 ["1111111" Its a 7digit number may vary per user] Please help me a HTML Code with javascript in it for creating a Click here button. Refer: www.click2rupee.com www.click2rupee.com = CLICK HERE Button= http://www.clixsense.com/?r=3488429 www.click2rupee.com/?r=12312312 = CLICK HERE Button= http://www.clixsense.com/?r=12312312 Thanks All.
  16. Hello guys, i need some basic info here. I need to build string, which must be builded into "'%name%'", when name is a variable. Using concat, its easy to do that:String myString = "'%" + name + "%'";how to do that with String.format() ?I`m trying to do like: String myString = String.format("'%%s%'", name); << it appears a problem with "%'" tag. how to avoid that ? How to use double %`s in the quotas ?Any suggestions ? Linas.
  17. This should be easier than I am trying so maybe I am not thinking about it correctly. I need to insert a "click here" button on a webpage that when clicked would open a 2nd page beside the first. It would not Close the first page as they both need to be open. As a for instance, the 2nd page might contain detailed instructions on how to do something on the first page but not everyone would need them So I created webpage inside a subfolder of the first page. (It is a VERY simple site that really only has varying views of the first page. Only one Index.php) The second page is also a stand alone. If you typed in the full path to enter that subfolder it has its own index.php and would open as a standalone page. I know I have seen a method of setting the page width (or I thought I had) to 50% so that two pages could co-exist at the same time for the viewer it would look like page 1 and page 2 of a book separated by the book spine, Optionally, it could be done after the fact if the 2nd page opened in a second window instead of a tab,. There may be other ways I have not considered but any help would be appreciated. Thanks If I can crate a sample screenshot view I will come back and attach it. right now I have maybe 10 tabs open. and if I switch between then I cannot see the tab I was on when I leave it. but it it were 10 separate instances of IE I could open both at the same time and resize easily with the win+left or right arrow key. doing that in tabs wont work to get two pages open at once.
  18. Hi All, i'm doing sample ajax exercise and getting the response from server but the response work fine in IE browser but not in firefox/chrome browser. below is the code snippet also find the snippet ========================= ajaxdemo.html =========================l <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <input type="text" id="inputDisplay" /> <button type="button" onclick="sendMessageToServer()">Send To Server</button><br/> <input type="text" id="textDisplay"/> <script type="text/javascript"> var xmlhttp; if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { isIE = true; xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } function sendMessageToServer() { xmlhttp.open("POST","/LabAjax04/AjaxDemoServlet?name="+document.getElementById("inputDisplay").value,true); xmlhttp.onreadystatechange=receiveMessageFromServer; xmlhttp.send(); document.getElementById("inputDisplay").value=''; } function receiveMessageFromServer() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { alert(xmlhttp.responseXML.getElementsByTagName("responseFromServer")[0].text);// displays undefined alert(xmlhttp.responseText);//display the response from server document.getElementById("textDisplay").value=xmlhttp.responseXML.getElementsByTagName("responseFromServer")[0].text; } } </script> </body> </html> ======================= java file ====================== package com.sample.ajax; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Servlet implementation class AjaxDemoServlet */ public class AjaxDemoServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public AjaxDemoServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {} /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("server recived the folwwoing messgae from client:"+request.getParameter("name")); response.setContentType("text/xml"); response.getWriter().println("<responseFromServer>"+request.getParameter("name")+"</responseFromServer>"); System.out.println("server replied with the folwwoing messgae to client:"+request.getParameter("name")); } } ========= web.xml ========= <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>LabAjax04</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <servlet> <description></description> <display-name>AjaxDemoServlet</display-name> <servlet-name>AjaxDemoServlet</servlet-name> <servlet-class>com.sample.ajax.AjaxDemoServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>AjaxDemoServlet</servlet-name> <url-pattern>/AjaxDemoServlet</url-pattern> </servlet-mapping> </web-app> Thanks in advance!!!
  19. I'm trying to make a XMLHttpRequest from a JavaScript page to a Java Servlet.I found out lots of problem because it's first time that I do this. The main problem it's that the servlet doesn't work!It give me this error: HTTP Status 500 - Servlet execution threw an exception type: Exception report message: Servlet execution threw an exception description: The server encountered an internal error that prevented it from fulfilling this request. exception: javax.servlet.ServletException: Servlet execution threw an exceptionroot cause java.lang.NoClassDefFoundError: com/google/appengine/api/channel/ChannelServiceFactoryProvaServer.Server.doPost(Server.java:30)javax.servlet.http.HttpServlet.service(HttpServlet.java:647)javax.servlet.http.HttpServlet.service(HttpServlet.java:728)root cause java.lang.ClassNotFoundException: com.google.appengine.api.channel.ChannelServiceFactoryorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)ProvaServer.Server.doPost(Server.java:30)javax.servlet.http.HttpServlet.service(HttpServlet.java:647)javax.servlet.http.HttpServlet.service(HttpServlet.java:728) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.33 logs. This is the Java Servlet code: package ProvaServer; import java.lang.Object;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import com.google.appengine.api.channel.*;import com.google.appengine.api.channel.ChannelServiceFactory; @WebServlet(description = "prova", urlPatterns = { "/provaFinale" })public class Server extends HttpServlet { private static final long serialVersionUID = 1L; public Server() { super(); // TODO Auto-generated constructor stub } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String userId = request.getParameter("idUser"); ChannelService channelService = ChannelServiceFactory.getChannelService(); //the problem is here! String token = channelService.createChannel(userId); System.out.println("IdUser:" + userId); System.out.println("Token:" + token); String url="mona.html?user="+userId+"&token="+token; response.sendRedirect(url); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {}} and this is the web.xml servlet mapping file: <?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>Server</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> <servlet> <servlet-name>ServerServlet</servlet-name> <servlet-class>ProvaServer.Server</servlet-class> </servlet> <servlet-mapping> <servlet-name>ServerServlet</servlet-name> <url-pattern>/provaFinale</url-pattern> </servlet-mapping></web-app> The problem come out when servlet try to run this code: ChannelService channelService = ChannelServiceFactory.getChannelService() but i can't understand what is the error.Could someone help me to understand? Thanks for the attention!
  20. I have the need to have custom JSP tags in my web application.My custom tag works well when I run the application.Since I use Ajax (Javascript + Servlet + JSON) i tried to create my custom tag as a DIV element child in my Ajax Callback function.I tried using innetHTML method and createElement methods, and none of them works.So, I was wondering is this possible to do (or not) and how if it is?Thank You.
  21. I currently need to finish a task for my project which needs me to create a Create a display component to show Select pet shop name and total Pets in that shop. For this tasks i created a several components,I had a function call "getPetsInPetShop" to do what i mention public static ArrayList<Pet> getPetsInPetShop(Petshop petshopName) { // this should go through all pets and return only those whose // pet shop name is the same as the parameter... //new arrylist to store information about pets ArrayList<Pet> result = new ArrayList<Pet>(); //loop thought the csv file for (Pet p : pet) { //if the user input a petshop name that can be found in the csv file if (p.getShop().equals(petshopName)) { //return thouse pet p result.add(p); } } //Here is the output return result; } I assume this can allow me to loop thought how many pets i got inside the selected pet shop and return it. On the other hand this is my code to pass the function when the program run. This is mousevent function, when the user click on it , a new panel will appear for them to input information. public class SelectPetShopControl implements MouseListener{ @Override public void mouseClicked(MouseEvent e) { JLabel clicked = (JLabel)e.getSource(); String PetShopName, TotalPets; SelectPetShopPanel spsp = (SelectPetShopPanel)clicked.getParent(); PetShopName = JOptionPane.showInputDialog("Enter a pet shop name"); if(PetShopName != null){ TotalPets = ApplicationModel.getPetsInPetShop(TotalPets); spsp.setPetshop("Pet Shop Nmae: "+PetShopName); spsp.setTotalPets("Total: "+TotalPets); } } Everything in here is right expect "TotalPets = ApplicationModel.getPetsInPetShop(TotalPets);"The error message in here is incompatible types. I had look at some example and try to fix it by myself,but i realize i don't have enough technology to finish it. Many thanks
  22. My website is runing on WP Platform running PHP and MYSQL. I'm trying to buid a simple search form that will work as follow: The search form will have 5 fields as follow: Select a StateSelect a CountySelect a CitySelect a CompanyAgent Type If a user click and select the State the form will automatically select all counties within that state, then the third field will auto select every city when the user select the county and so fourth. When the user is done and is ready to hit submit the form will manually redirect the user to that specific page he or she selcted. Here is the code that I have so far: SEARCH: <form role="search" method="post" id="searchform" action="#" > <input type="hidden" value="" name="s" /> <input type="hidden" value="listing" name="post_type" /> <select name='State' id='State' class='state'> <option value="Select a State" selected>Select a State</option> <option value="AL" >Alabama</option> <option value="AK" >Alaska</option> <option value="AZ" >Arizona</option> <option value="AR" >Arkansas</option> <option value="CA" >California</option> <option value="CO" >Colorado</option> <option value="CT" >Connecticut</option> <option value="DE" >Delaware</option> <option value="FL" >Florida</option> <option value="GA" >Georgia</option> <option value="HI" >Hawaii</option> <option value="ID" >Idaho</option> <option value="IL" >Illinois</option> <option value="IN" >Indiana</option> <option value="IA" >Iowa</option> <option value="KS" >Kansas</option> <option value="KY" >Kentucky</option> <option value="LA" >Louisiana</option> <option value="ME" >Maine</option> <option value="MD" >Maryland</option> <option value="MA" >Massachusetts</option> <option value="MI" >Michigan</option> <option value="MN" >Minnesota</option> <option value="MS" >Mississippi</option> <option value="MO" >Missouri</option> <option value="MT" >Montana</option> <option value="NE" >Nebraska</option> <option value="NV" >Nevada</option> <option value="NH" >New Hampshire</option> <option value="NJ" >New Jersey</option> <option value="NM" >New Mexico</option> <option value="NY" >New York</option> <option value="NC" >North Carolina</option> <option value="ND" >North Dakota</option> <option value="OH" >Ohio</option> <option value="OK" >Oklahoma</option> <option value="OR" >Oregon</option> <option value="PA" >Pennsylvania</option> <option value="RI" >Rhode Island</option> <option value="SC" >South Carolina</option> <option value="SD" >South Dakota</option> <option value="TN" >Tennessee</option> <option value="TX" >Texas</option> <option value="UT" >Utah</option> <option value="VT" >Vermont</option> <option value="VA" >Virginia</option> <option value="WA" >Washington</option> <option value="WV" >West Virginia</option> <option value="WI" >Wisconsin</option> <option value="WY" >Wyoming</option></select><select name='county' id='county' class='county'> <option value="Select a County">Select a County</option></select><select name='city' id='city' class='city'> <option value="Select a City">Select a City</option></select><select name='company' id='company' class='company'> <option value="Select a Company">Select a Company</option></select><select name='agent type' id='agent type' class='agent type'> <option value="Agents Type">Agents Type</option></select><input type="submit" id="searchsubmit" class="searchsubmit" value="Submit" /></form> Thank you so much for all your help!
  23. Nuker_Viper

    Shorter Version

    i created this section of code to accept a multi award system... i am trying to find a shorter way to run through the check list. <?phpif($submit) {/// Multiple Award Script / Function ///$ga = getHasItInfo($award, $member);$man = $medal_award_number;$ma = getMedalInfo('multi_awardable', $award);$max = getMedalInfo('max_awardable', $award);if($ma == 1 AND $man < $max) { /// Creates a Loop to make sure the award number is correct. /// /// Gets A checks List $check1 = getHasItInfo($award, $member_id); if($check1 > 0) { $tf1 == "T"; } else { $tf1 == "F";} $check2 = getHasItInfo($award.1, $member_id); if($check2 > 0) { $tf2 == "T"; } else { $tf2 == "F";} $check3 = getHasItInfo($award.2, $member_id); if($check3 > 0) { $tf3 == "T"; } else { $tf3 == "F";} $check4 = getHasItInfo($award.3, $member_id); if($check4 > 0) { $tf4 == "T"; } else { $tf4 == "F";} $check5 = getHasItInfo($award.4, $member_id); if($check5 > 0) { $tf5 == "T"; } else { $tf5 == "F";} $check6 = getHasItInfo($award.5, $member_id); if($check6 > 0) { $tf6 == "T"; } else { $tf6 == "F";} $check7 = getHasItInfo($award.6, $member_id); if($check7 > 0) { $tf7 == "T"; } else { $tf7 == "F";} $check8 = getHasItInfo($award.7, $member_id); if($check8 > 0) { $tf8 == "T"; } else { $tf8 == "F";} $check9 = getHasItInfo($award.8, $member_id); if($check9 > 0) { $tf9 == "T"; } else { $tf9 == "F";} $check10 = getHasItInfo($award.9, $member_id); if($check10 > 0) { $tf10 == "T"; } else { $tf10 == "F";} $check11 = getHasItInfo($award.10, $member_id); if($check11 > 0) { $tf11 == "T"; } else { $tf11 == "F";} $check12 = getHasItInfo($award.11, $member_id); if($check12 > 0) { $tf12 == "T"; } else { $tf12 == "F";} $check13 = getHasItInfo($award.12, $member_id); if($check13 > 0) { $tf13 == "T"; } else { $tf13 == "F";} $check14 = getHasItInfo($award.13, $member_id); if($check14 > 0) { $tf14 == "T"; } else { $tf14 == "F";} $check15 = getHasItInfo($award.14, $member_id); if($check15 > 0) { $tf15 == "T"; } else { $tf15 == "F";} $check16 = getHasItInfo($award.15, $member_id); if($check16 > 0) { $tf16 == "T"; } else { $tf16 == "F";} $check17 = getHasItInfo($award.16, $member_id); if($check17 > 0) { $tf17 == "T"; } else { $tf17 == "F";} $check18 = getHasItInfo($award.17, $member_id); if($check18 > 0) { $tf18 == "T"; } else { $tf18 == "F";} $check19 = getHasItInfo($award.18, $member_id); if($check19 > 0) { $tf19 == "T"; } else { $tf19 == "F";} $check20 = getHasItInfo($award.19, $member_id); if($check20 > 0) { $tf20 == "T"; } else { $tf20 == "F";} $check21 = getHasItInfo($award.20, $member_id); if($check21 > 0) { $tf21 == "T"; } else { $tf21 == "F";} $check22 = getHasItInfo($award.21, $member_id); if($check22 > 0) { $tf22 == "T"; } else { $tf22 == "F";} $check23 = getHasItInfo($award.22, $member_id); if($check23 > 0) { $tf23 == "T"; } else { $tf23 == "F";} $check24 = getHasItInfo($award.23, $member_id); if($check24 > 0) { $tf24 == "T"; } else { $tf24 == "F";} $check25 = getHasItInfo($award.24, $member_id); if($check25 > 0) { $tf25 == "T"; } else { $tf25 == "F";} $check26 = getHasItInfo($award.25, $member_id); if($check26 > 0) { $tf26 == "T"; } else { $tf26 == "F";} /// Processes the Check List till the right award number is found to be awarded then ends the search.. if($tf1 == "T" AND $tf2 == "F" AND $tf3 == "F" AND $tf4 == "F" AND $tf5 == "F" AND $tf6 == "F" AND $tf7 == "F" AND $tf8 == "F" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.1); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "F" AND $tf4 == "F" AND $tf5 == "F" AND $tf6 == "F" AND $tf7 == "F" AND $tf8 == "F" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.2); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "F" AND $tf5 == "F" AND $tf6 == "F" AND $tf7 == "F" AND $tf8 == "F" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.3); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "F" AND $tf6 == "F" AND $tf7 == "F" AND $tf8 == "F" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.4); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "F" AND $tf7 == "F" AND $tf8 == "F" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.5); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "F" AND $tf8 == "F" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.6); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "F" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.7); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.8); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "F" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.9; $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.10); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.11); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.12); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.13); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.14); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.15); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.16); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.17); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.18); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.19); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "T" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.20); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "T" AND $tf21 == "T" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.21); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "T" AND $tf21 == "T" AND $tf22 == "T" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.22); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "T" AND $tf21 == "T" AND $tf22 == "T" AND $tf23 == "T" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.23); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "T" AND $tf21 == "T" AND $tf22 == "T" AND $tf23 == "T" AND $tf24 == "T" AND $tf25 == "F" AND $tf26 == "F") { $newAward = ($award+.24); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "T" AND $tf21 == "T" AND $tf22 == "T" AND $tf23 == "T" AND $tf24 == "T" AND $tf25 == "T" AND $tf26 == "F") { $newAward = ($award+.25); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "T" AND $tf21 == "T" AND $tf22 == "T" AND $tf23 == "T" AND $tf24 == "T" AND $tf25 == "T" AND $tf26 == "T") { $newAward = ($award+.26); $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'"; $result = mysql_query($query) or die(mysql_error()); $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')"; $result = mysql_query($query) or die(mysql_error()); $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> SUCCESS! -- <br> Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br> Request for Award Was Approved and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> "; } }elseif($ma != 1) { $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> ERROR - Member Already has selected Award. <br> Award IS NOT a Multi-Aceievable Award. <br> Request for Award Was Deined and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Error', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> ";}elseif($ma == 1 AND $man >= $max) { $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'"; $result = mysql_query($query) or die(mysql_error()); echo " <div style='display: none' id='successBox'> <p align='center'> ERROR - Member Already has selected Award.<br> Award IS a Multi-Aceievable Award, but the member has the Maximum Amount allowed.<br> Request for Award Was Deined and Deleted! </p> </div> <script type='text/javascript'> popupDialog('Award Request: Error', 'console.php?pid=$pid&p=ManageAll', 'successBox'); </script> ";}}?>
  24. Trying to write a script that will check the value in the form is a number between the range of 1 to 99999. 1) The script work mostly except for two things if you put a number then letter it won’t detect that you entered letters as well as numbers 2) I want it to run the script on onblur event, however every time I try the script does not work at all. Did study java years and year ago and found I forgotten most things if people can point out where I am going wrong would be very greatful <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type" /><title>Please enter your age</title><script language="JavaScript1.2">function checknumber(){var x=document.checknum.pnum.value/*does it contain non digits */var anum=/(^\D+$)|(^\D+\.\D+$)/if (anum.test(x)){alert("Please input a valid Runner ID between 1 to 99999 !")testresult=false}/*is it above 99999*/else if (x > 99999){alert("Please input a valid Runner ID between 1 to 99999 !")testresult=false}/*is it below 1*/else if (x < 1){alert("Please input a valid Runner ID between 1 to 99999 !")testresult=false}return (testresult)}</script></head><body><form name="checknum" onSubmit="return checknumber()">Please input a valid Runner ID between 1 to 99999:<input type="text" name="pnum" onchange="checknumber()"><input type="submit" value="Submit"></form></body></html> Many Thanks Damien
  25. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <body><script> function alertTotal() { var aSelect = document.getElementById('a'); var bSelect = document.getElementById('b'); var cSelect = document.getElementById('c'); var aValue = aSelect.options[aSelect.selectedIndex].value; var bValue = bSelect.options[bSelect.selectedIndex].value; var cValue = cSelect.options[cSelect.selectedIndex].value; alert(parseInt(aValue) + parseInt(bValue) + parseInt(cValue)); }</script>CPU #######:<select id="a"><option value="0">Not selected</option> <option value="3500">I7 R3500.00</option> <option value="2500">I5 R2500.00</option> <option value="1500">I3 R1500</option> </select><br>Mother Board :<select id="b" width="230" STYLE="width: 430px" size="0"><option value="0">Not selected</option> <option value="363">Intel Houlton D2500 Mini-ITX - Supports 2 x DDR3 (Max 4GB). Up to 8 USB 2.0 Ports, 2 x SATA, 1 x Parallel Port, 2 x Serial Ports (via Header) 1 x D-Sub, 1 x Conventional PCI Slot, 10/100/1000 LAN</option> <option value="2">2</option> <option value="3">3</option> </select><br>RAM:#######<select id="c"><option value="0">Not selected</option> <option value="100">2GB DDR3 1333, 240-Pin Memory Module - PATRIOT</option> <option value="190">4GB DDR3 1333, 240-Pin Memory Module - PATRIOT</option> <option value="250">4GB DDR3 1333, 240-Pin Memory Module - Kingston </option> </select><br><br><br><br><button onclick="alertTotal();">Show Total</button> </body> When i click the total works fine but when i add the scritp to show the total i get nothing , i don't want to click to see the total Price: R<span id="alertTotal();"></span>
×
×
  • Create New...