Repository navigation
Expand file tree
/
Copy pathcreate_category.php
More file actions
289 lines (264 loc) · 12.8 KB
/
Copy pathcreate_category.php
File metadata and controls
289 lines (264 loc) · 12.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<?php
include("header.php");
?>
<script type="text/javascript">
function moderator(i)
{
document.getElementById("mod").value=i;
//alert(document.getElementById("mod").value);
if(i==1)
{
document.getElementById("mode1").style.background="-moz-linear-gradient(center top , #eb594e 0%, #c12419 100%) repeat scroll 0 0 transparent";
document.getElementById("mode1").style.border="1px solid #c12419";
document.getElementById("mode").style.background="-moz-linear-gradient(center top , #454545 0%, #303030 100%) repeat scroll 0 0 transparent";
document.getElementById("mode").style.border="1px solid #303030";
}
else
{
document.getElementById("mode").style.background="-moz-linear-gradient(center top , #eb594e 0%, #c12419 100%) repeat scroll 0 0 transparent";
document.getElementById("mode").style.border="1px solid #c12419";
document.getElementById("mode1").style.background="-moz-linear-gradient(center top , #454545 0%, #303030 100%) repeat scroll 0 0 transparent";
document.getElementById("mode1").style.border="1px solid #303030";
}
}
function upload_file()
{
document.form1.action='image_crop/uploadfile.php';
document.form1.target='frmiframe';
document.getElementById('uploadfile').value='yes';
document.form1.submit();
}
function upload_new_file()
{
document.getElementById('uploadimageopt').checked=true;
document.form1.action='image_crop/uploadfile.php';
document.form1.target='frmiframe';
document.getElementById('uploadfile').value='';
document.getElementById('uploadfilenew').value='newfile';
document.form1.submit();
}
function show_croper(name)
{
document.getElementById('popup_cover_corp').style.display='block';
document.getElementById('editCoverPicturebodyfrm').src = 'crop_coverimage_view.php?file='+name;
}
function show_croper2(name)
{
document.getElementById('popup_cover_corp').style.display='block';
document.getElementById('editCoverPicturebodyfrm').src = 'crop_image_view.php?file='+name;
}
function use_default_image()
{
var name = document.getElementById('b990_image').value;
document.getElementById('popup_cover_corp').style.display='block';
document.getElementById('editCoverPicturebodyfrm').src = 'crop_image_view.php?file='+name;
}
</script>
<link href="scripts/jQuery-Impromptu/jquery-impromptu.css" rel="stylesheet" type="text/css" />
<link href="scripts/fineuploader/fineuploader.css" rel="stylesheet" type="text/css" />
<link href="scripts/Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="scripts/jquery-1.8.3.min.js"></script>
<!--
<script type="text/javascript" src="scripts/jQuery-Impromptu/jquery-impromptu.js"></script>
<script type="text/javascript" src="scripts/fineuploader/jquery.fineuploader-3.0.min.js"></script>
<script type="text/javascript" src="scripts/Jcrop/jquery.Jcrop.min.js"></script>
<script type="text/javascript" src="scripts/jquery-uberuploadcropper.js"></script>
-->
<style>
.qq-upload-list li.qq-upload-success {
background-color: #5DA30C;
color: #FFFFFF;
margin-bottom: 5px;
margin-top: 5px;
width: 240px;
}
</style>
<script type="text/javascript">
$(function() {
$('#UploadImages').uberuploadcropper({
//---------------------------------------------------
// uploadify options..
//---------------------------------------------------
fineuploader: {
//debug : true,
request : {
// params: {}
endpoint: 'upload.php'
},
validation: {
//sizeLimit : 0,
allowedExtensions: ['jpg','jpeg','png','gif']
}
},
//---------------------------------------------------
//now the cropper options..
//---------------------------------------------------
jcrop: {
aspectRatio : 1,
allowSelect : true, //can reselect
allowResize : true, //can resize selection
setSelect : [ 0, 0, 250, 214 ], //these are the dimensions of the crop box x1,y1,x2,y2
minSize : [ 990, 214 ], //if you want to be able to resize, use these
maxSize : [ 500, 500 ]
},
//---------------------------------------------------
//now the uber options..
//---------------------------------------------------
folder : 'uploads/', // only used in uber, not passed to server
cropAction : 'crop.php', // server side request to crop image
onComplete : function(e,imgs,data){
var $PhotoPrevs = $('#PhotoPrevs');
var name="";
for(var i=0,l=imgs.length; i<l; i++){
name=imgs[i].filename+","+name;
//alert(imgs[i].filename);
$PhotoPrevs.append('<img style="height:100px;" src="uploads/'+ imgs[i].filename +'?d='+ (new Date()).getTime() +'" /> <input type="hidden" name="catimg" value="'+name+'">');
}
}
});
});
</script>
<div id="main-wrapper" style="padding-top:100px;">
<?php
if (isset($_GET['msg'])=='alexist')
{
$msg='This category already exist. Please use a different name.';
echo '<div class="white-wrapper-error" style="margin-left:20%;width:554px">'.$msg.'</div>';
}
?>
<div class="white-wrapper">
<div style="padding:15px;">
<div class="red-color-heading">Create a <span class="black-color-heading">Category</span></div>
<div class="clear"></div>
<div id="left-panelform">
<form name="form1" id="form1" action="main.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="user_id" value="<?php echo $_SESSION['user_id']?>">
<div style="float:left;height:50px;">
<div class="formpanel-text form-text">Category Name: </div>
<div class="inputpanel-rightCategory"><input name="catname" id="catname" type="text" class="input" style="width:263px;" onkeyup="emptyfield('form1_catname_errorloc')" onkeydown="emptyfield('form1_catname_errorloc')"/></div>
<div class="error" id="form1_catname_errorloc" style="visibility:hidden;">Please enter valid Password</div>
</div>
<div class="clear"></div>
<div style="float:left;height:60px;height:auto;">
<div class="formpanel-text form-text">Category Image :<br/>
(990px X 272px)</div>
<div class="inputpanel-rightCategory">
<div id="wrapper" style="margin-bottom:20px;">
<!--
<div id="UploadImages">
</div>
-->
<input type="hidden" name="uploadfile" id="uploadfile" value="">
<input type="hidden" name="uploadfilenew" id="uploadfilenew" value="">
<input type="hidden" name="b990_image" id="b990_image" value="">
<input type="hidden" name="p250_image" id="p250_image" value="">
<div class="qq-upload-button" style="position: relative; overflow: hidden; direction: ltr;">
<div >Upload</div>
<input onchange="upload_file();" type="file" multiple="multiple" name="file" style="position: absolute; right: 0px; top: 0px; font-family: Arial; font-size: 118px; margin: 0px; padding: 0px; cursor: pointer; opacity: 0;">
</div>
<div id="PhotoPrevs" style="float:left;width:150px;">
</div>
<div id="PhotoPrevs1" style="float:left;width:120px;">
</div>
<br>
<div id="imageoptions" style="display:none;margin-top:5px;width:275px;float:left;">
<input type="radio" name="setimage" id="setdefaultopt" onclick="use_default_image();"> Use same image for Mosaic<br>
<input type="radio" name="setimage" id="uploadimageopt" onclick=""> Upload New
<input onchange="upload_new_file();" type="file" multiple="multiple" name="uploadnewfile" style="float: left; margin-left: -105px; opacity: 0; position: absolute; width: 10px;cursor:pointer;">
</div>
</div>
</div>
<div class="error" id="form1_catimage_errorloc" style="visibility:hidden;">Please enter valid Password</div>
</div>
<div class="clear"></div>
<div style="float:left;height:50px;">
<div class="formpanel-text form-text">Is your category:</div>
<div class="inputpanel-rightCategory">
<select name="cat_referance" class="input" style="width:200px;">
<option>Regional</option>
<option>Global</option>
</select>
</div>
</div>
<div class="clear"></div>
<div style="float:left;height:50px;">
<div class="formpanel-text form-text">Review Defaults: </div>
<div class="inputpanel-rightCategory"><input name="defreview" id="defreview" type="text" class="input" style="width:263px;" onkeyup="emptyfield('form1_defreview_errorloc')" onkeydown="emptyfield('form1_defreview_errorloc')"/></div>
<div class="error" id="form1_defreview_errorloc" style="visibility:hidden;">Please enter valid Password</div>
</div>
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
</div>
<div id="right-panelform"><div class="formpanel-text-rightCategory form-text">Category Rules:</div>
<div class="inputpanel-rightCategory2"> <textarea name="catrules" rows="8" class="textarea" style="width:270px;" onkeyup="emptyfield('form1_catrules_errorloc')" onkeydown="emptyfield('form1_catrules_errorloc')"></textarea>
<div class="error" id="form1_catrules_errorloc" style="visibility:hidden;">Please enter valid Password</div>
</div>
<div id="right-panelform"><div class="formpanel-text-rightCategory form-text"> Category Descripition:</div>
<div class="inputpanel-rightCategory2"> <textarea name="catdes" rows="8" class="textarea" style="width:270px;" onkeyup="emptyfield('form1_catdes_errorloc')" onkeydown="emptyfield('form1_catdes_errorloc')"></textarea>
<div class="error" id="form1_catdes_errorloc" style="visibility:hidden;">Please enter valid Password</div>
</div>
</div>
</div>
<div class="clear"></div>
<div class="form-text" style="float:left;margin-left:20px;">Do you want to apply for Moderator (MOD)? </div><input type="button" id="mode" name="mode" value="YES" class="button-form-new" style="margin-left:40px;" onclick="moderator(1)"><input type="button" class="button-form-new" name="mode1" id="mode1" value="N0" onclick="moderator(0)">
<input type="hidden" name="mod" id="mod">
<div class="clear"></div>
<div><img src="images/line-flip.png" alt="#" /></div>
<div class="clear"></div>
<div align="center"><span style="margin-bottom:20px;">
<input name="create_cat" type="submit" class="submit-buttons-round" value="Submit" />
<input name="Clear" type="reset" class="clear-button" value="Clear" />
</span></div>
</form>
</div></div>
<iframe id="frmiframe" frameborder="0" width="0" height="0" src="image_crop/uploadfile.php" name="frmiframe" ></iframe>
<div id="popup_cover_corp" class="popup" style="display: none; width: 1024px; height:500px; margin: 0px auto; position: absolute; top: 50px; z-index: 99999; left:180px;">
<div class="popup-header">
<a class="close pull-right" style="float:right;" onclick="close_popup_cover_corp();"> </a>
</div>
<div id="crop_core_body" class="bodycontent" style="min-height:350px;">
<iframe id="editCoverPicturebodyfrm" frameborder="0" name="editCoverPicturebodyfrm" style=" height: 490px; margin-left: -9px; width: 1101px;"></iframe>
</div>
</div>
<div id="popup_cover_corp" class="popup" style="display: none; width: 1024px; height:500px; margin: 0px auto; position: absolute; top: 50px; z-index: 99999; left:180px;">
<div class="popup-header">
<a class="close pull-right" style="float:right;" onclick="close_popup_cover_corp();"> </a>
</div>
<div id="crop_core_body" class="bodycontent" style="min-height:350px;">
<iframe id="editCoverPicturebodyfrm" frameborder="0" name="editCoverPicturebodyfrm" style=" height: 490px; margin-left: -9px; width: 1101px;"></iframe>
</div>
</div>
<script language="javascript" type="text/javascript">
function close_popup_cover_corp()
{
parent.document.getElementById('popup_cover_corp').style.display="none";
}
function show_other_image(name)
{
document.getElementById('PhotoPrevs').innerHTML = '<img src="review_images/'+name+'" width="135" height="60">';
document.getElementById('imageoptions').style.display='block';
document.getElementById('b990_image').value=name;
document.form1.action='main.php';
document.form1.target='';
}
function show_other_image2(name)
{
document.getElementById('PhotoPrevs1').innerHTML = '<img src="review_images/thumb_'+name+'" width="120" height="60">';
document.getElementById('imageoptions').style.display='block';
document.getElementById('p250_image').value=name;
document.form1.action='main.php';
document.form1.target='';
}
var frmvalidator = new Validator("form1");
//frmvalidator.EnableOnPageErrorDisplay();
frmvalidator.EnableMsgsTogether();
frmvalidator.addValidation("catname","req","Please enter Category name");
frmvalidator.addValidation("catname","alpha_s", "Please enter alphabet only");
frmvalidator.addValidation("catname","maxlen=50", "Maximum length for Category Name is 50");
frmvalidator.addValidation("catrules","req","Please enter your rules");
frmvalidator.addValidation("catdes","req","Please enter your description");
</script>
<?php include("footer.php")?>
</div>