Subversion Repositories SmartDukaan

Rev

Rev 9155 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
        <script type="text/javascript" src="/js/jquery-1.4.2.js"></script>
    <script type="text/javascript" src="/js/jquery.validate.js"></script>
        <script type="text/javascript">
     function showHide(option) {
     if (option.value == 'True') {
         document.getElementById('image-map-div').style.display = 'block';
        }
        else{
        document.getElementById('image-map-div').style.display = 'none';
        }
     }
    </script>
        <script type="text/javascript">
function validateForm()
{
var x=document.forms["uploadFileToMyFolder"]["bannerName"].value;
if (x==null || x=="")
  {
  alert("Banner name must be filled out");
  return false;
  }
var y=document.forms["uploadFileToMyFolder"]["userImage"].value;
        if (y==null || y=="")
  {
  alert("No image file selected");
  return false;
  }
}
</script>

        <script type="text/javascript">
        $(function() {
        $('#add-map').live('click', function(){
                $('<br/><br/><label>Coordinates : </label> <input id="mapCoordinates" name = "mapCoordinates" type = "textbox"/>'
                                +'<br/><br/><label>Link : </label> <input id="mapLink" name = "mapLink" type = "textbox"/>').appendTo('#image-map-container');
         });
        });
        $(document).ready(function() {
  //alert("document ready");
  $('#cancelbutton').click(function(e) {
    window.location.href = '/user-image';
  });
});
        </script>
<script>
$(function() {
        $('#add-uri').live('click', function(){
                $('<br/><br/><label>On Page: </label> <input id="uri" name = "uri" type = "textbox"/>'
                +'<br><br><label>Acitive / InActive : </label><select id ="isActive" name="isActive"><option selected="selected" value="False">InActive</option><option value="True">Active</option></select><br><br><label>Target: </label><select id ="linkTarget" name="linkTarget"><option selected="selected" value="False">Same Window</option><option value="True">New Window</option></select>').appendTo('#uri-container');
         });
        });
</script>
                <style type="text/css">
                * { font-family: Verdana; font-size: 96%; }
                label {
    float: left;
    width: 150px;
}
    #image-map-div {
     display:none;
    }
select {
    width: 100px;
}
                </style>
<title>Upload Banner</title>
</head>
<body>
<a href="/user-image">Back to listing</a>
<h2>New Banner</h2>
<div style="padding-bottom: 20px;" id="upload-form">
<form id="uploadFileToMyFolder" name="userImage" action="/user-image" onsubmit="return validateForm()" enctype="multipart/form-data" method="post">
          <label for="imagePath">Image Path : </label>
          <input name="userImage" id="file" type="file">
          <br></br>
          <label for="bannerName">Banner Name : </label>
      <input id="bannerName" name="bannerName" type="text"/>
      <br></br>
          <label for="bannerType">Banner Type : </label>
          <select name="bannerType" id="bannerType"><option selected="selected" value="WEBSITE">WEBSITE</option><option value="MOBILE_SITE">MOBILE_SITE</option></select>
          <br></br>
          <label for="fileExtenstion">Image Extention : </label>
          <select name="fileExtention" id="fileExtention"><option selected="selected" value="jpg">jpg</option><option value="jpeg">jpeg</option><option value="png">png</option><option value="gif">gif</option></select>
          <br></br>
      <label for="link">Link : </label>
      <input id="link" name="link" type="text"/>
          <br></br>
          <div id="uri-div">
                <div id="uri-container">
                        <label>On Page: </label>
                        <input id="uri" name="uri" type="textbox"/>
                        <br><br>
                        <label>Acitive / InActive : </label>
                        <select id ="isActive" name="isActive"><option selected="selected" value="False">InActive</option><option value="True">Active</option></select>
                        <br><br>
                        <label>Target : </label>
                        <select id ="linkTarget" name="linkTarget"><option selected="selected" value="False">Same Window</option><option value="True">New Window</option></select>
                </div>
          <img id = "add-uri" src = "/images/add.png" />
          <br></br>
          </div>
      <label for="priority">Priority : </label>
      <select name="priority">
                #foreach( $val in [1..10] )
                        #if ($val == 1)
                                <option value='$val' selected="selected">$val</option>
                        #else
                                <option value='$val'>$val</option>
                        #end    
                #end
                </select>
          <br></br>
          <label for="hasMap">Add Map : </label>
      <select name="hasMap" id="has_Map" onchange="showHide(this)"><option selected="selected" value="False">No</option><option value="True">Yes</option></select>
      <br></br>
          <div id = "image-map-div" align = "left">
                                <h3>Map Details</h5>
                <div id = "image-map-container">
                                <label>Coordinates : </label>
                                <input id="mapCoordinates" name = "mapCoordinates" type = "textbox"/>
                                        <br></br>
                                <label>Link : </label>
                                <input id="mapLink" name = "mapLink" type = "textbox"/>
                </div>
                                <img id = "add-map" src = "/images/add.png" />
            </div>
          <br>
          <input style="margin-top: 8px;" name="upload" value="Upload" type="submit">
          <input type="button" id="cancelbutton" name="cancel" value="Cancel"/>
</form>
</div>
</body>
</html>