Subversion Repositories SmartDukaan

Rev

Rev 11992 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11992 Rev 12112
Line 1... Line 1...
1
<html>
1
<html>
2
<head>
2
<head>
3
<title>Private Deal Items</title>
3
<title>Private Deal Items</title>
4
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
4
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script>
-
 
5
<script type="text/javascript" src="/content/js/jQuery.viewSource.min.js"></script>
5
<script>
6
<script>
6
$(document).ready(function() {
7
$(document).ready(function() {
7
    $('#btnRight').live('click', function(e) {
8
    $('#btnRight').on('click', function(e) {
8
        var selectedOpts = $('#lstBox1 option:selected');
9
        var selectedOpts = $('#lstBox1 option:selected');
9
        if (selectedOpts.length == 0) {
10
        if (selectedOpts.length == 0) {
10
            alert("Please select an Item.");
11
            alert("Please select an Item.");
11
            e.preventDefault();
12
            e.preventDefault();
12
        }
13
        }
13
 
14
 
14
        $('#lstBox2').append($(selectedOpts).clone());
15
        $('#lstBox2').append($(selectedOpts).clone());
15
        $(selectedOpts).remove();
16
        $(selectedOpts).remove();
16
        e.preventDefault();
17
        e.preventDefault();
17
    });
18
    });
-
 
19
	
-
 
20
	$('#viewSourceCode').on('click', function(e) {
-
 
21
		$('#generated-news-letter').hide();
-
 
22
		$("#source-code").show();
-
 
23
    });
-
 
24
	
-
 
25
	$('#viewHtml').on('click', function(e) {
-
 
26
		$('#generated-news-letter').show();
-
 
27
		$("#source-code").hide();
-
 
28
    });
18
 
29
 
19
    $('#btnLeft').live('click', function(e) {
30
    $('#btnLeft').on('click', function(e) {
20
        var selectedOpts = $('#lstBox2 option:selected');
31
        var selectedOpts = $('#lstBox2 option:selected');
21
        if (selectedOpts.length == 0) {
32
        if (selectedOpts.length == 0) {
22
            alert("Nothing to move.");
33
            alert("Nothing to move.");
23
            e.preventDefault();
34
            e.preventDefault();
24
        }
35
        }
Line 63... Line 74...
63
    });  
74
    });  
64
</script>
75
</script>
65
<script>
76
<script>
66
function StoreSubTypes()
77
function StoreSubTypes()
67
{
78
{
68
	var _Catalogids = new Array();
79
        var _Catalogids = new Array();
69
    $("#lstBox2 option").each(
80
    $("#lstBox2 option").each(
70
    function(index, option)
81
    function(index, option)
71
    {
82
    {
72
      _Catalogids[index] = option;
83
      _Catalogids[index] = option.value;
73
    }
84
    }
74
   );
85
   );
-
 
86
          console.log(_Catalogids.toString());
-
 
87
   jQuery.ajax({
75
   $.post(/Support/news-letter!createPrivateDealsNewsLetter,{ '_Catalogids[]': Catalogids }, function(data){
88
   		url: window.location.href+"!createPrivateDealsNewsLetter?itemIds="+_Catalogids,
-
 
89
        type: 'POST',
-
 
90
        async: false,
-
 
91
		success : function(response) {
-
 
92
			$('#generated-news-letter').empty();
-
 
93
			$("#source-code").text('');
-
 
94
			$('<iframe id="newsletter-iframe" style="width:100%;height:100%;margin-top:20px;"/>').appendTo('#generated-news-letter')
-
 
95
                          .contents().find('body').append(response);
-
 
96
			$("#source-code").text(response);
-
 
97
			$('#generated-news-letter').show();
-
 
98
			$('#buttons').show();
-
 
99
        },
-
 
100
        cache: false,
-
 
101
        contentType: "application/x-www-form-urlencoded",
76
          console.log(data);
102
        processData: false
77
    },'html');
103
    });
-
 
104
    return false;
78
}
105
}
79
</script>
106
</script>
-
 
107
<style>
-
 
108
	td {
-
 
109
    padding: 20px;
-
 
110
	}
-
 
111
</style>
80
</head>
112
</head>
81
<body>
113
<body>
-
 
114
<div style="border: 2px solid blue; height: 10%; padding: 10px; width: 30%;" class="searchBox">
-
 
115
<label style="font-weight: bold; margin-right: 10px;">Search Item</label>
82
<input id="textbox" type="text" /><br />	
116
<input type="text" id="textbox" style="width: 50%;">	
-
 
117
</div>
83
<table style="width: 100%">
118
<table style="width: 100%; border: 2px solid blue; margin-top: 20px;">
84
<tr>
119
<tr>
85
    <td style='width:300px;'align = 'left'>
120
    <td style='min-width:300px;'align = 'left'>
86
           <b>Active Private Deal Items :</b><br/>
121
           <b>Active Private Deal Items :</b><br/>
87
           <select multiple="multiple" id='lstBox1' width='100%'>
122
           <select multiple="multiple" id='lstBox1' style="width:100%">
88
			#set($items = $action.getPrivateDealItems())
123
			#set($items = $action.getPrivateDealItems())
89
			#foreach ( $item in $items )
124
			#foreach ( $item in $items )
90
				  <option value="$item.getCatalogItemId()">$item.getId() $item.getBrand() $item.getModelName() $item.getModelNumber() $item.getColor()</option>
125
				  <option value="$item.getId()">$item.getId() $item.getBrand() $item.getModelName() $item.getModelNumber() $item.getColor()</option>
91
			#end
126
			#end
92
           </select>
127
           </select>
93
    </td>
128
    </td>
94
    <td style='width:100%;text-align:center;vertical-align:middle;' >
129
    <td style='width:100%;text-align:center;vertical-align:middle;' >
95
        <input type='button' id='btnRight' value ='  >  '/>
130
		<input type="button" style="margin-bottom: 15px;" id="btnRight" value="&gt;">
-
 
131
        <br/>
96
        <br/><input type='button' id='btnLeft' value ='  <  '/>
132
		 <input type="button" value="&lt;" id="btnLeft" style="margin-bottom: 15px;">
-
 
133
		<br/>
-
 
134
		<button onclick="StoreSubTypes()" type="button">Generate NewsLetter</button>
97
    </td>
135
    </td>
98
    <td style='width:300px;' align = 'right' width='100%'>
136
    <td align="" width="100%" style="min-width: 300px;">
99
        <b>Selected Active Deal Items :</b><br/>
137
        <b>Selected Active Deal Items :</b><br/>
100
        <select multiple="multiple" id='lstBox2'>
138
        <select id="lstBox2" multiple="multiple" style="width: 100%;">
101
        </select>
139
        </select>
102
    </td>
140
    </td>
103
</tr>
141
</tr>
104
<button type="button" onclick="StoreSubTypes()">Generate NewsLetter</button>
-
 
105
</table>
142
</table>
-
 
143
<div id="buttons" style="float: right; border: 2px solid blue; display: block;height:50px;margin-top:15px;display:none;">
-
 
144
<button id="viewSourceCode" type="button" style="float: right; margin-top: 15px; margin-right: 10px;">View Source</button>
-
 
145
<button id="viewHtml" type="button" style="float: right; margin: 15px;">View New Letter</button>
-
 
146
</div>
-
 
147
<div id="generated-news-letter" style="margin-top:30px;display:none;">
-
 
148
</div>
-
 
149
<textarea id="source-code" style="width: 100%;height: 100%;font-size: 12px;color:black;font-weight: 14px;font-family: sans-serif;margin-top:20px;display:none;border:2px solid grey;"></textarea>
106
</body>
150
</body>
107
</html>
151
</html>
108
152