Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
20424 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
<link href="/hotspot/css/imgareaselect-default.css" type="text/css" rel="stylesheet">
5
<script type="text/javascript" src="/hotspot/js/jquery-1.4.2.js"></script>
6
<script type="text/javascript" src="/hotspot/js/jquery.validate.js"></script>
7
<script src="/hotspot/js/jquery.imgareaselect.pack.js" type="text/javascript"></script>
8
<script type="text/javascript">
9
function validateForm()
10
{
11
var x=document.forms["uploadFileToMyFolder"]["bannerName"].value;
12
if (x==null || x=="")
13
  {
14
  alert("Banner name must be filled out");
15
  return false;
16
  }
17
}
18
</script>
19
<script type="text/javascript">
20
	$(function() {
21
	$('#add-map').live('click', function(){
22
		$('<br/><br/><label>Coordinates : </label> <input id="mapCoordinates" name = "mapCoordinates" type = "textbox"/>'
23
				+'<br/><br/><label>Link : </label> <input id="mapLink" name = "mapLink" type = "textbox"/>').appendTo('#image-map-container');
24
	});
25
   });
26
   $(document).ready(function() {
27
  $('#cancelbutton').click(function(e) {
28
    window.location.href = '/banner';
29
  });
30
});
31
</script>
32
<script type="text/javascript">
33
function preview(img, selection) {
34
    if (!selection.width || !selection.height)
35
        return;
36
 
37
    var scaleX = 100 / selection.width;
38
    var scaleY = 100 / selection.height;
39
 
40
    $('#preview img').css({
41
        width: Math.round(scaleX * 300),
42
        height: Math.round(scaleY * 300),
43
        marginLeft: -Math.round(scaleX * selection.x1),
44
        marginTop: -Math.round(scaleY * selection.y1)
45
    });
46
 
47
    $('#x1').val((Math.round(selection.x1*2.46)));
48
    $('#y1').val((Math.round(selection.y1*3.76)));
49
    $('#x2').val((Math.round(selection.x2*2.46)));
50
    $('#y2').val((Math.round(selection.y2*3.76)));  
51
}
52
 
53
$(function () {
54
    $('#photo').imgAreaSelect({ handles: true,
55
        fadeSpeed: 200, onSelectChange: preview });
56
});
57
</script>
58
<style>
59
* { font-family: Verdana; font-size: 96%; }
60
		label {
61
    float: left;
62
    width: 150px;
63
}
64
select {
65
    width: 100px;
66
}
67
</style>
68
<title>Edit $bannerObj.getBannerName()</title>
69
</head>
70
<body>
71
<a href="/banner">Back to listing</a>
72
<h2>Edit $bannerObj.getBannerName()</h2>
73
<div id="image" style="padding-bottom: 10px; height: 175px;">
74
	<img src='/hotspot/images/banners/$bannerObj.getImageName()' id="photo" style="float: left; width: 550px; height: 150px;">
75
		<div style="float: left; width: 18%; margin-bottom: 10px; margin-left: 10px;">
76
    <table style="">
77
      <thead>
78
        <tr>
79
          <th colspan="2" style="font-size: 110%; font-weight: bold; text-align: left; padding-left: 0.1em;">
80
            Coordinates
81
          </th>
82
        </tr>
83
      </thead>
84
      <tbody>
85
        <tr>
86
          <td style="width: 10%;"><b>X<sub>1</sub>:</b></td>
87
 		      <td style="width: 30%;"><input type="text" id="x1" value="-"></td>
88
        </tr>
89
        <tr>
90
          <td><b>Y<sub>1</sub>:</b></td>
91
          <td><input type="text" id="y1" value="-"></td>
92
        </tr>
93
        <tr>
94
          <td><b>X<sub>2</sub>:</b></td>
95
          <td><input type="text" id="x2" value="-"></td>
96
          <td></td>
97
          <td></td>
98
        </tr>
99
        <tr>
100
          <td><b>Y<sub>2</sub>:</b></td>
101
          <td><input type="text" id="y2" value="-"></td>
102
          <td></td>
103
          <td></td>
104
        </tr>
105
      </tbody>
106
    </table>
107
  </div>
108
	</div>
109
<div style="padding-bottom: 20px;" id="upload-form">
110
<form id="uploadFileToMyFolder" name="banner" action="/hotspot/banner!update" onsubmit="return validateForm()" enctype="multipart/form-data" method="post">
111
	  <label for="imagePath">Image Path: </label>
112
	  <input name="userImage" id="file" type="file">
113
	  <br></br>
114
	  <label for="bannerName">Banner Name: </label>
115
      <input id="bannerName" name="bannerName" value='$bannerObj.getBannerName()'type="text"/>
116
      <br></br>
117
	  <label for="fileExtenstion">Image Extention : </label>
118
	  <select name="fileExtention" id="fileExtention">
119
	  #foreach( $ext in ['jpg','jpeg','png','gif'] )
120
		#if ($ext == $bannerObj.getFileExtention())
121
				<option value='$ext' selected="selected">$ext</option>
122
			#else
123
				<option value='$ext'>$ext</option>
124
			#end	
125
	  #end
126
	  </select>
127
	  <br></br>
128
	  <label>Target : </label>
129
    	#if ($bannerObj.isSameWindowTarget())
130
    		<select name="sameWindowTarget"><option selected="selected" value="true">Same Window</option><option value="false">New Window</option></select>
131
    	#else
132
    		<select name="sameWindowTarget"><option selected="selected" value="false">New Window</option><option value="true">Same Window</option></select>
133
    	#end
134
	  <br></br>
135
      <label for="link">Link: </label>
136
      <input id="link" name="link" value='$bannerObj.getLink()' type="text"/>
137
	  <br></br>
138
	  <label>Acitive / InActive : </label>
139
	  #if ($bannerObj.isActive())
140
			<select name="isActive"><option selected="selected" value="true">Active</option><option value="false">InActive</option></select>
141
	  #else
142
			<select name="isActive"><option selected="selected" value="false">InActive</option><option value="true">Active</option></select>
143
	  #end
144
	  <br><br>	
145
      <label for="priority">Priority: </label>
146
	  <select name="priority">
147
		#foreach( $val in [1..5] )
148
			#if ($val == $bannerObj.getPriority())
149
				<option value='$val' selected="selected">$val</option>
150
			#else
151
				<option value='$val'>$val</option>
152
			#end	
153
		#end
154
		</select>
155
	  <br></br>
156
	  <div id = "image-map-div" align = "left">
157
				<h3>Map Details</h5>
158
                <div id = "image-map-container">
159
					#if (!$bannerObj.getBannerList().size() > 0)
160
						<label>Coordinates : </label>
161
    				    <input id="mapCoordinates" name = "mapCoordinates" type = "textbox"/>
162
					    <br></br>
163
    				    <label>Link : </label>
164
    				    <input id="mapLink" name = "mapLink" type = "textbox"/>
165
					#end
166
					#foreach($bannerMap in $bannerObj.getBannerList())
167
    				<label>Coordinates : </label>
168
    				<input id="mapCoordinates" name = "mapCoordinates" value="$bannerMap.get('coordinates')" type = "text"/>
169
					<br></br>
170
    				<label>Link : </label>
171
    				<input id="mapLink" name = "mapLink" value="$bannerMap.get('link')" type = "text"/>
172
					<br></br>
173
					#end
174
                </div>
175
				<img id = "add-map" src = "/hotspot/images/add.png" />
176
            </div>
177
	  <br>
178
	  <input style="margin-top: 8px;" name="upload" value="Update" type="submit">
179
	  <input type="button" id="cancelbutton" name="cancel" value="Cancel"/>
180
	  <input id="bannerId" value="$bannerObj.get_id()" name="id" style="visibility: hidden;" />
181
</form>
182
</div>
183
</body>
184
</html>