· 10 years ago · Sep 12, 2016, 09:18 AM
1<?php
2
3
4$servername = "localhost";
5$username = "deniiynz_host";
6$password = "aois9290s";
7$dbname = "deniiynz_manual";
8$conn = new mysqli($servername, $username, $password, $dbname);
9
10if ($conn->connect_error) {
11 die("Connection failed: " . $conn->connect_error);
12}
13
14$sql = "SELECT id, title, value, shlink, vlink FROM manualsurf_links";
15$result = $conn->query($sql);
16
17$sql5="SELECT * FROM manualsurf_links ORDER BY `credits`";
18$records=mysql_query($sql5);
19
20$res=mysql_query("SELECT * FROM manualsurf_setup");
21$setupRow=mysql_fetch_array($res);
22
23$title = $_POST['title'];
24$value = $_POST['value'];
25$shlink = $_POST['shlink'];
26$vlink = $_POST['vlink'];
27$credits = $_POST['credits'];
28$show = '<h2>he</h2>';
29$bow1 = '<form method="post">
30<div class="info_box">Manual Surf is installed in your website, if you do not want continue using this addon, you can uninstall it by.
31<input type="submit" name="ungo" value="Uninstall">
32</div>
33<tr><td><input type="submit" value="Add Links" name="setgo1" ></td> <input type="submit" value="Manage Links" name="setgo" ></td> <input type="submit" value="Settings" name="addgo" ></td> <input type="submit"
34
35value="About" name="addgo" ></td></tr>
36</form>
37<center>
38<br>
39<h3><b>Add Links</b></h3>
40<br>
41</center>
42<center>
43<form method="post" >
44<p>Title : <input type="text" name="title" ></p>
45<p>Value : <input type="text" name="value" ></p>
46<p>Short link : <input type="text" name="shlink" ></p>
47<p>Valid Link : <input type="text" name="vlink" ></p>
48<p>Credits : <input type="text" name="credits" ></p>
49<br>
50</center>
51<center>
52<input type="submit" value="Add Link" name="addgo" >
53</center>
54</form>
55<br>
56</form>
57
58
59';
60$bow2 = '<center>
61<br>
62<br>
63<h3>Click on "Install" button to process the installation.</h3>
64<br>
65<br>
66<img src="../images/IA7uX.png">
67<br>
68<p>Monetize your ptc site with shorten links without problems.</p>
69<br>
70<form method="post" >
71<input type="submit" value="Install" name="installgo" >
72</form>
73<br>
74<br>
75</center>';
76
77while($mansurf=mysql_fetch_Assoc($records)){
78$bow3 = '<form method="post">
79<div class="info_box">Manual Surf is installed in your website, if you do not want continue using this addon, you can uninstall it by.
80<input type="submit" name="ungo" value="Uninstall">
81</div>
82<tr><td><input type="submit" value="Add Links" name="setgo1" ></td> <input type="submit" value="Manage Links" name="setgo" ></td> <input type="submit" value="Settings" name="addgo" ></td> <input type="submit"
83value="About" name="addgo" ></td></tr><p></form>
84<center>
85<br>
86<h3><b>Manage Links</b></h3>
87<br>
88</center>
89<tr>
90<style type="text/css">
91.tg {border-collapse:collapse;border-spacing:0;}
92.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
93.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
94.tg .tg-lnt9{background-color:#4c4c4c;color:#ffffff;vertical-align:top}
95.tg .tg-cxkv{background-color:#ffffff}
96.tg .tg-fx22{background-color:#4c4c4c;color:#ffffff}
97.tg .tg-yw4l{vertical-align:top}
98</style>
99<table class="tg" style="undefined;table-layout: fixed; width: 940px">
100<colgroup>
101<col style="width: 10px">
102<col style="width: 20px">
103<col style="width: 20px">
104<col style="width: 20px">
105<col style="width: 20px">
106<col style="width: 20px">
107<col style="width: 20px">
108</colgroup>
109
110 <tr>
111 <th class="tg-fx22">ID</th>
112 <th class="tg-fx22">Title</th>
113 <th class="tg-fx22">Value</th>
114 <th class="tg-fx22">Short Link</th>
115 <th class="tg-lnt9">Valid Link</th>
116 <th class="tg-lnt9">Credits</th>
117 <th class="tg-lnt9">Actions</th>
118 </tr>
119 <tr>
120 <td class="tg-z2zr">'.$mansurf[id].'</td>
121
122 <td class="tg-z2zr">'.$mansurf['title'].'</td>
123
124 <td class="tg-z2zr">'.$mansurf['value'].'$</td>
125
126 <td class="tg-z2zr">'.$mansurf['shlink'].'</td>
127
128 <td class="tg-z2zr">'.$mansurf['vlink'].'</td>
129
130 <td class="tg-z2zr">'.$mansurf['credits'].'</td>
131
132 <td class="tg-z2zr">'.$mansurf['remove'].'/'.$mansurf['edit'].'</td>
133
134 </tr>
135</table>
136<br>
137<br>
138 ';
139}
140
141
142
143if(isset($_POST['ungo'])) {
144$ungo = "DROP TABLE manualsurf_links;";
145if($conn->query($ungo) === TRUE) {
146$ungo1 = "DROP TABLE manualsurf_setup;";
147if($conn->query($ungo1) === TRUE) {
148 echo '<script>location.href="./?view=addon_modules&module=manualsurf";</script>';
149 } else {
150 echo "Error";
151
152}
153}
154}
155
156$dep = $_POST['usrid'];
157
158if(isset($_POST['remove'])){
159$ep = "DELETE FROM `deniiynz_manual`.`manualsurf_links` WHERE `manualsurf_links`.`id` ='$dep'";
160if($conn->query($ep) === TRUE) {
161echo '<div class="l2successptcform success_box"><span class="icon"></span>Link is successfully removed from the list.</div>';
162}
163}
164
165
166if(isset($_POST['setgo'])) {
167$bow1 = $bow3;
168}
169
170if(isset($_POST['setgo1'])) {
171$bow3 = $bow1;
172}
173
174$be = "1";
175$bossw = '<form method="post"><input type="hidden" name="usrid" value="18"><input type="submit" name="remove" value="Remove"></form>';
176$bossw = mysql_real_escape_string($bossw);
177if(isset($_POST['addgo'])){
178if($title == "" || $value == "" || $shlink == "" || $vlink == "") {
179echo '<div class="info_box">Please make sure to fill all textboxs.</div>';
180} else {
181$ago = "INSERT INTO `deniiynz_manual`.`manualsurf_links` (`id`, `title`, `value`, `shlink`, `vlink`, `credits`, `remove`) VALUES (NULL, '$title', '$value', '$shlink', '$vlink', '$credits, '$bossw');";
182if($conn->query($ago) === TRUE) {
183echo '<div class="l2successptcform success_box"><span class="icon"></span>New link was successfully added.</div>';
184} else {
185echo '<div class="error_box">Error something went wrong.</div>';
186}
187}
188}
189
190if($setupRow['status'] == "Installed") {
191echo $bow1;
192} else {
193echo $bow2;
194
195}
196
197if(isset($_POST['installgo'])) {
198
199$updo1 = "CREATE TABLE IF NOT EXISTS `manualsurf_links` (
200 `id` int(11) NOT NULL AUTO_INCREMENT,
201 `title` varchar(10) NOT NULL,
202 `value` double NOT NULL DEFAULT '0.0001',
203 `shlink` varchar(255) NOT NULL,
204 `vlink` varchar(255) NOT NULL,
205 `credits` int(200) NOT NULL,
206 `remove` text NOT NULL,
207 PRIMARY KEY (`id`)
208) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;";
209if($conn->query($updo1) === TRUE) {
210$upto2 = "CREATE TABLE IF NOT EXISTS `manualsurf_setup` (
211 `id` int(11) NOT NULL AUTO_INCREMENT,
212 `status` varchar(255) NOT NULL DEFAULT 'uninstalled',
213 PRIMARY KEY (`id`)
214) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;";
215if($conn->query($upto2) === TRUE) {
216$upto4 = "INSERT INTO `manualsurf_setup` (`id`, `status`) VALUES
217(1, 'Installed');";
218if($conn->query($upto4) === TRUE) {
219echo '<script>location.href="./?view=addon_modules&module=manualsurf";</script>';
220 } else {
221 echo "Error";
222
223}
224}
225}
226}
227
228?>