Subversion Repositories SmartDukaan

Rev

Rev 6848 | Rev 8433 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6848 kshitij.so 1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<html>
3
<head>
4
	<script type="text/javascript" src="/js/jquery-1.4.2.js"></script>
5
    <script type="text/javascript" src="/js/jquery.validate.js"></script>
6
	<script type="text/javascript">
7
     function showHide(option) {
8
     if (option.value == 'True') {
9
         document.getElementById('image-map-div').style.display = 'block';
10
        }
11
        else{
12
        document.getElementById('image-map-div').style.display = 'none';
13
        }
14
     }
15
    </script>
6875 kshitij.so 16
	<script>
17
function validateForm()
18
{
19
var x=document.forms["uploadFileToMyFolder"]["bannerName"].value;
20
var y=document.forms["uploadFileToMyFolder"]["imageName"].value;
21
if (x==null || x=="")
22
  {
23
  alert("Banner name must be filled out");
24
  return false;
25
  }
26
if (y==null || y=="" )
27
  {
28
  alert("Image name must be filled out along with file extension");
29
  return false;
30
  }
31
}
32
</script>
33
 
6848 kshitij.so 34
	<script type="text/javascript">
35
	$(function() {
36
	$('#add-map').live('click', function(){
37
		$('<br/><br/><label>Coordinates : </label> <input id="mapCoordinates" name = "mapCoordinates" type = "textbox"/>'
38
				+'<br/><br/><label>Link : </label> <input id="mapLink" name = "mapLink" type = "textbox"/>').appendTo('#image-map-container');
39
	 });
40
	});
6875 kshitij.so 41
	$(document).ready(function() {
42
  //alert("document ready");
43
  $('#cancelbutton').click(function(e) {
44
    window.location.href = '/user-image';
45
  });
46
});
6848 kshitij.so 47
	</script>
48
		<style type="text/css">
49
		* { font-family: Verdana; font-size: 96%; }
50
		label {
51
    float: left;
52
    width: 150px;
53
}
54
    #image-map-div {
55
     display:none;
56
    }
57
select {
58
    width: 100px;
59
}
60
		</style>
61
<title>Upload Banner</title>
62
</head>
63
<body>
64
<h2>New Banner</h2>
65
<div style="padding-bottom: 20px;" id="upload-form">
6875 kshitij.so 66
<form id="uploadFileToMyFolder" name="userImage" action="/user-image" onsubmit="return validateForm()" enctype="multipart/form-data" method="post">
6848 kshitij.so 67
	  <label for="isActive">Active / InActive : </label>
68
      <select name="isActive"><option selected="selected" value="False">InActive</option><option value="True">Active</option></select>
69
      <br></br>
70
	  <label for="imagePath">Image Path : </label>
71
	  <input name="userImage" id="file" type="file">
72
	  <br></br>
73
	  <label for="bannerName">Banner Name : </label>
74
      <input id="bannerName" name="bannerName" type="text"/>
75
      <br></br>
76
	  <label for="imageName">Image Name : </label>
77
      <input id="imageName" name="imageName" type="text"/>
6875 kshitij.so 78
	  <span class="red" style="color: red;">*File extension mandatory<span></span></span>
6848 kshitij.so 79
      <br></br>
80
      <label for="link">Link : </label>
81
      <input id="link" name="link" type="text"/>
82
	  <br></br>
83
      <label for="priority">Priority : </label>
84
      <select name="priority">
85
		#foreach( $val in [1..10] )
86
			#if ($val == 1)
87
				<option value='$val' selected="selected">$val</option>
88
			#else
89
				<option value='$val'>$val</option>
90
			#end	
91
		#end
92
		</select>
93
	  <br></br>
94
	  <label for="hasMap">Add Map : </label>
95
      <select name="hasMap" id="has_Map" onchange="showHide(this)"><option selected="selected" value="False">No</option><option value="True">Yes</option></select>
96
      <br></br>
97
	  <div id = "image-map-div" align = "left">
98
				<h3>Map Details</h5>
99
                <div id = "image-map-container">
100
    				<label>Coordinates : </label>
101
    				<input id="mapCoordinates" name = "mapCoordinates" type = "textbox"/>
102
					<br></br>
103
    				<label>Link : </label>
104
    				<input id="mapLink" name = "mapLink" type = "textbox"/>
105
                </div>
106
				<img id = "add-map" src = "/images/add.png" />
107
            </div>
108
	  <br>
109
	  <input style="margin-top: 8px;" name="upload" value="Upload" type="submit">
6875 kshitij.so 110
	  <input type="button" id="cancelbutton" name="cancel" value="Cancel"/>
6848 kshitij.so 111
</form>
112
</div>
113
</body>
114
</html>