forked from colorindarkness/BenFund
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flyer_manager_adv.php
156 lines (149 loc) · 5.66 KB
/
flyer_manager_adv.php
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
<?php
session_start();
if (!isset($_SESSION[valid_user])){
header('Location:../login.php');
}else{
$page_title = "Advanced Editor";
require ("../includes/globals.php");
require($ROOT."/functions/common.php");
require ($ROOT."/functions/editor.php");
$error = '<font color="#0000FF"><strong>You must be logged in to view this page</strong></font>';
benfund_connect();
$query = "SELECT id, m_type, name, contact_name, address, address2, city, state, zip, phone, alt_phone, email, ssn2, tax2, password, pin, goal, activated, settings FROM merchant WHERE id = '$mid' ";
$results = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($results) or die(mysql_error());
$uid = $row['id'];
$m_type = $row['m_type'];
$name = $row['name'];
$c_name = $row['contact_name'];
//Here we define out main variables
$welcome_string="Welcome!";
$numeric_date=date("G");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>BenFund - Advanced Flyer Editor</title>
<?php include ($ROOT."/includes/head.php") ?>
<?php simple_editor(); ?>
<script language="javascript" type="text/javascript">
function addtext() {
var newtext = "test";
document.myform.mce_editor_0.value += newtext;
}
</script>
<script type="text/javascript" src="https://www.benfund.com/includes/js/preload.js"></script>
<script type="text/javascript">womOn();</script>
<body onLoad="document.getElementById('loading').style.display = 'none';">
<div class="container">
<table cellspacing="0" cellpadding="0" align="center">
<!--HEADER START-->
<tr>
<td colspan="2" valign="top">
<?php include ($ROOT."/includes/header.php") ?>
</td>
</tr>
<!--HEADER END-->
<!--LEFT COLUMN START-->
<tr>
<td class="leftcolumn" width="150px" valign="top">
<?php include ($ROOT."/includes/left.php") ?>
</td>
<!--LEFT COLUMN END-->
<td valign="top" valign="top">
<!--PATHWAY START-->
<?php include ($ROOT."/includes/pathway.php") ?>
<!--PATHWAY END-->
<!--MAINBODY START-->
<?php if($m_type == 1){ m_menu1(); } if($m_type == 2){ m_menu2(); } ?>
<div class="content_outer">
<div class="content_inner">
<span class="pagetitle">Advanced Flyer Editor</span>
<div class="hr"></div>
<form action="<?=$PHP_SELF?>" method="post" enctype="multipart/form-data" name="myform" id="myform">
<a href="javascript:tinyMCE.execCommand('mceInsertContent', false, '<img src=https://www.benfund.com/images/illuminati.jpg border=0>');"><div class="buttongreen">Insert Image</div></a></p>
<span class="subtitle" >Footer:</span><br />You can put your contact information here of feelfree to do something original like a slogan, phrase or quote.<br />
<textarea style="width: 550px; height: 100px" name="outputtext" id="outputtext">
<?php echo $footer ?>
</textarea>
<?php
if (isset($HTTP_POST_VARS['submit'])) {
if (!is_uploaded_file($HTTP_POST_FILES['file']['tmp_name'])) {
$error2 = "You did not upload a file!";
unlink($HTTP_POST_FILES['file']['tmp_name']);
// assign error message, remove uploaded file, redisplay form.
} else {
//a file was uploaded
$maxfilesize=1625292;
if ($HTTP_POST_FILES['file']['size'] > $maxfilesize) {
$error2 = "file is too large";
unlink($HTTP_POST_FILES['file']['tmp_name']);
// assign error message, remove uploaded file, redisplay form.
} else {
if ($HTTP_POST_FILES['file']['type'] != "image/pjpeg" && $HTTP_POST_FILES['file']['type'] != "image/jpeg") {
$error2 = "This file type is not allowed";
unlink($HTTP_POST_FILES['file']['tmp_name']);
// assign error message, remove uploaded file, redisplay form.
} else {
//File has passed all validation, copy it to the final destination and remove the temporary file:
$filename = $HTTP_POST_FILES['file']['name'];
copy($HTTP_POST_FILES['file']['tmp_name'],"images/$id.jpg");
unlink($HTTP_POST_FILES['file']['tmp_name']);
require ("functions/image_resize.php");
$img = "images/$id.jpg";
scale($img,'480','360');
echo "The file $filename has been successfully uploaded!";
include("approval_email.php");
}
}
}
}
?>
<p>
<?php
$im = "images/approved/$id.jpg";
$im2 = getimagesize($im);
$im = "https://www.benfund.com/images/approved/$id.jpg";
if(isset($im2[0])){ ?>
<img SRC="<?php echo $im; ?>">
<?php } ?>
<br>
<?php if (isset($error2)){ echo $error2; }
?>
<br>
<p>This Image will be available for use on your flyer.</p>
Please Choose an image to upload:<br>
<input type="file" name="file" class="big" size="30">
<br>
<b>Allowable maximum image size is 1.5MB and must have a .jpg extension</b><p>
Images are subject to approval.<p>
Images may not contain nudity, sexually explicit content, violent, offensive
material, or be copyrighted. Do not upload images of other people without
their permission.<p>
Image approval can take as long as two business days.<br>
When the image has been approved, you will recieve an email informing
you of approval and the image will appear above.</p>
<p>
<input type="submit" name="submit" value="Upload Image" class="big">
</p>
</form>
</div>
</div>
</td>
</tr>
<!--MAINBODY END-->
<!--FOOTER START-->
<tr>
<td colspan="2">
<?php include ($ROOT."/includes/footer.php") ?>
</td>
</tr>
<!--FOOTER START-->
</table>
<?php include ($ROOT."/includes/foot.php"); ?>
</body>
</html>
<?php
}
?>