· 10 years ago · Sep 05, 2016, 04:38 PM
1<?php
2/**
3*
4* @ IonCube Priv8 Decoder V1 By H@CK3R $2H
5*
6* @ Version : 1
7* @ Author : H@CK3R $2H
8* @ Release on : 14-Feb-2014
9* @ Email : Hacker.S2h@Gmail.com
10*
11**/
12
13 if (!defined( 'EvolutionScript' )) {
14 exit( 'Hacking attempt...' );
15}
16
17$chkadmin = new VData( );
18
19$localkey = $db->fetchOne( 'SELECT localkey FROM localkey WHERE id=1' );
20
21$chkadmin->getinfo( $localkey );
22
23 if ($chkadmin->info['fixed_ptc_advertisements'] != 'enable') {
24 $chkadmin->details( $ptcevolution->config['Misc']['license'] );
25 $chkadmin->masterkey;
26 $chkadmin->getinfo( $chkadmin->masterkey );
27 $chkadmin->masterkey;
28
29 if ($chkadmin->info['fixed_ptc_advertisements'] == 'enable') {
30 $data = array( 'localkey' => $chkadmin->masterkey );
31 $db->update( 'localkey', $data, 'id=1' );
32 echo '<script>location.href="./?view=addon_modules&module=fixed_ptc_advertisements";</script>';
33 return 1;
34 }
35
36 echo 'You need to purchase this addon before use it.';
37 return 1;
38 }
39
40 $verifyaddon == $db->fetchOne( 'SELECT COUNT(*) AS NUM FROM addon WHERE name=\'fixed_ptc_advertisements\'' );
41
42 if ($verifyaddon == 0) {
43 if ($_GET['install'] == 'do') {
44 $install = array( 'name' => 'fixed_ptc_advertisements' );
45 $db->insert( 'addon', $install );
46 $db->query( 'INSERT INTO settings (field ,value)VALUES (\'fixed_ads\', \'yes\')' );
47 $db->query( 'INSERT INTO settings (field ,value)VALUES (\'fixedads_refcom\', \'yes\')' );
48 $db->query( 'INSERT INTO settings (field ,value)VALUES (\'fixedads_hidedescr\', \'no\')' );
49 $db->query( 'INSERT INTO settings (field ,value)VALUES (\'fixedads_editad\', \'yes\')' );
50 $db->query( 'INSERT INTO settings (field ,value)VALUES (\'fixedads_fee\', \'0.50\')' );
51 $db->query( 'CREATE TABLE IF NOT EXISTS `fixed_ads` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL DEFAULT \'0\', `token` varchar(200) NOT NULL, `title` varchar(100) NOT NULL, `descr` varchar(200) DEFAULT NULL, `img` varchar(100) DEFAULT NULL, `url` varchar(200) NOT NULL, `value` decimal(11,5) NOT NULL, `time` int(3) NOT NULL, `membership` mediumtext NOT NULL, `expires` int(11) NOT NULL DEFAULT \'0\', `clicks` int(11) NOT NULL, `outside_clicks` int(11) NOT NULL, `clicks_today` int(11) NOT NULL DEFAULT \'0\', `country` text NOT NULL, `status` varchar(100) NOT NULL DEFAULT \'Inactive\', PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;' );
52 $db->query( 'ALTER TABLE members ADD fixedadvisto TEXT NULL' );
53 $db->query( 'CREATE TABLE fixedads_price (id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,days INT( 11 ) NOT NULL DEFAULT \'0\',price DECIMAL( 11, 2 ) NOT NULL DEFAULT \'0\', value DECIMAL( 11, 5 ) NOT NULL DEFAULT \'0\', seconds INT( 11 ) NOT NULL DEFAULT \'0\')' );
54 $db->query( 'INSERT INTO fixedads_price (days, price, value, seconds) VALUES(\'30\',\'15\',\'0.001\',\'10\')' );
55 $db->query( 'INSERT INTO buyoptions (name ,tblname ,fieldassign ,comtype ,autoassign ,descr ,hook_verify ,enable) VALUES (\'fixedads_credits\', \'fixedads_price\', \'days\', NULL , \'yes\', \'\', NULL , \'yes\')' );
56 $db->query( 'INSERT INTO `cron_settings` (`field` ,`value`)VALUES (\'lastfixedad_cron\', \'0000-00-00\')' );
57 echo '<script>location.href="./?view=addon_modules&module=fixed_ptc_advertisements";</script>';
58 exit( );
59 }
60
61 echo 'Welcome to Fixed PTC Advertisements for PTCEvolution v4.x.<br>To start the installation, click in the following button.<br><br>';
62 echo '<input type="button" value="Install" onclick="location.href=\'?view=addon_modules&module=fixed_ptc_advertisements&install=do\';">';
63 return 1;
64 }
65
66
67 if ($_GET['uninstall'] == 'do') {
68 $db->delete( 'settings', 'field=\'fixed_ads\'' );
69 $db->delete( 'settings', 'field=\'fixedads_refcom\'' );
70 $db->delete( 'settings', 'field=\'fixedads_hidedescr\'' );
71 $db->delete( 'settings', 'field=\'fixedads_editad\'' );
72 $db->delete( 'settings', 'field=\'fixedads_fee\'' );
73 $db->delete( 'addon', 'name=\'fixed_ptc_advertisements\'' );
74 $db->query( 'DROP TABLE fixed_ads' );
75 $db->query( 'ALTER TABLE members DROP fixedadvisto' );
76 $db->query( 'DROP TABLE fixedads_price' );
77 $db->delete( 'buyoptions', 'name=\'fixedads_credits\'' );
78 $db->delete( 'cron_settings', 'field=\'lastfixedad_cron\'' );
79 echo '<script>location.href="./?view=addon_modules&module=fixed_ptc_advertisements";</script>';
80 exit( );
81 }
82
83
84 if ($input->p['action']) {
85 if (is_array( $input->p['mid'] )) {
86 foreach ($input->p['mid'] as $mid) {
87 switch ($input->p['a']) {
88 case 'delete': {
89 $db->delete( 'fixed_ads', 'id=' . $mid );
90 break;
91 }
92
93 case 'selfsponsored': {
94 $setupd = array( 'user_id' => '0' );
95 $db->update( 'fixed_ads', $setupd, 'id=' . $mid );
96 break;
97 }
98
99 default: {
100 $setupd = array( 'status' => $input->p['a'] );
101 $db->update( 'fixed_ads', $setupd, 'id=' . $mid );
102 break;
103 }
104 }
105 }
106 }
107 }
108
109
110 if ($input->r['do'] == 'search') {
111 $searchvars = array( 'owner', 'username', 'expires', 'status', 'url', 'title', 'descr' );
112 foreach ($searchvars as $k) {
113
114 if ($input->r[$k]) {
115 switch ($k) {
116 case 'owner': {
117 if ($input->rc[$k] == 'selfsponsored') {
118 $cond &= 'user_id=0 AND ';
119 }
120else {
121 if (( $input->rc[$k] = 'single' && $input->rc['username'] != '' )) {
122 $user_id = $db->fetchOne( 'SELECT id FROM members WHERE username=\'' . $input->rc['username'] . '\'' );
123 $cond &= 'user_id=' . $user_id . ' AND ';
124 }
125 }
126
127 break;
128 }
129
130 case 'username': {
131 break;
132 }
133
134 case 'expires': {
135 $expires = daterange( $input->rc[$k] );
136 $cond &= '(' . $k . '>=\'' . $expires[0] . '\' AND ' . $k . '<=\'' . $expires[1] . '\') AND ';
137 break;
138 }
139
140 case 'url': {
141 $cond &= '(' . $k . ' LIKE \'%' . $input->rc[$k] . '%\') AND ';
142 break;
143 }
144
145 case 'title': {
146 $cond &= '(' . $k . ' LIKE \'%' . $input->rc[$k] . '%\') AND ';
147 break;
148 }
149
150 case 'descr': {
151 $cond &= '(' . $k . ' LIKE \'%' . $input->rc[$k] . '%\') AND ';
152 break;
153 }
154
155 default: {
156 $cond &= '' . $k . '=\'' . $input->rc[$k] . '\' AND ';
157 break;
158 }
159 }
160
161 $adlink &= '' . $k . '=' . $input->r[$k] . '&';
162 continue;
163 }
164 }
165
166
167 if ($cond) {
168 $cond = substr( $cond, 0, 0 - 5 );
169 }
170
171
172 if ($adlink) {
173 $adlink = 'do=search&' . $adlink;
174 }
175 }
176
177 $paginator = new Pagination( 'fixed_ads', $cond );
178 $paginator->setOrders( 'expires', 'DESC' );
179 $paginator->setPage( $input->gc['page'] );
180 $paginator->allowedfield( $allowed );
181 $paginator->setNewOrders( $input->gc['orderby'], $input->gc['sortby'] );
182 $paginator->setLink( './?view=addon_modules&module=fixed_ptc_advertisements&' . $adlink );
183 $q = $paginator->getQuery( );
184 echo ' <div class="info_box">
185 ';
186 echo '<s';
187 echo 'trong>Fixed PTC Advertisements</strong> is installed in your website, if you do not want continue using this addon, you can uninstall it <a href="?view=addon_modules&module=fixed_ptc_advertisements&uninstall=do">clicking here</a>.
188 </div>
189';
190 echo '<s';
191 echo 'cript type="text/javascript">
192function addonfrm(id){
193 $(\'#\'+id).l2block();
194 httplocal = \'/admin/modules/fixed_ptc_advertisements.php\';
195 var jqxhr = $.post(httplocal,$("#"+id).serialize(), function(data) {
196 if(data.status == 0){
197 $("#"+id).l2error(data.msg);
198 $("#"+id).l2unblock();
199 }else if(data.status == 1){
200 $("#"+id).l2success(data.msg);
201 $("#"+id).l2unblock();
202 }else if(d';
203 echo 'ata.status == 2){
204 eval(data.msg);
205 }
206 }, "json");
207 return false;
208}
209</script>
210
211
212 <div>
213
214';
215 $showtabs = true;
216
217 if (is_numeric( $input->g['edit_link'] )) {
218 $verify = $db->fetchOne( 'SELECT COUNT(*) AS NUM FROM fixed_ads WHERE id=' . $input->gc['edit_link'] );
219
220 if ($verify != 0) {
221 $showtabs = false;
222 $data = $db->fetchRow( 'SELECT * FROM fixed_ads WHERE id=' . $input->gc['edit_link'] );
223 echo '<form method="post" id="ptcform" onsubmit="return addonfrm(this.id);">
224 <input type="hidden" name="do" value="upd_link" />
225 <input type="hidden" name="linkid" value="';
226 echo $data['id'];
227 echo '" />
228<table width="100%" class="widget-tbl">
229 <tr>
230 <td width="150">Title</td>
231 <td><input name="title" type="text" id="title" value="';
232 echo $data['title'];
233 echo '" /></td>
234 </tr>
235 <tr>
236 <td>Subtitle</td>
237 <td><input name="subtitle" type="text" id="subtitle" value="';
238 echo $data['descr'];
239 echo '" maxlength="80" /></td>
240 </tr>
241 <tr>
242 <td>Target URL</td>
243 <td><input name="url" type="text" id="url" value="';
244 echo $data['url'];
245 echo '" /></td>
246 </tr>
247 <tr>
248 <td>Image URL (optional)</td>
249 <td><input name="img" type="text" id="img" value="';
250 echo $data['img'];
251 echo '" /></td>
252 </tr>
253 <tr>
254 <td>Target Membership</td>
255 <td>
256 <div class="widget-title"><input type="checkbox" name="membership_all" value="all" id="checkall" />All Memberships</div>
257 <div class="widget-content" style="background:#FFFFFF; overflow:auto; height:75px;">
258 ';
259 $memlist = $db->query( 'SELECT id, name FROM membership ORDER BY id ASC' );
260
261 if ($row = $db->fetch_array( $memlist )) {
262 $vermembership = strpos( $data['membership'], ',' . $row['id'] . ',' );
263
264 if ($vermembership == false) {
265 echo '<input type="checkbox" name="membership[]" value="' . $row[id] . '" class="checkall" /> ' . $row[name] . '<br />';
266 }
267
268 echo '<input type="checkbox" name="membership[]" value="' . $row[id] . '" class="checkall" checked /> ' . $row[name] . '<br />';
269 }
270
271 echo ' </div>
272 </td>
273 </tr>
274 <tr>
275 <td>Target Country</td>
276 <td>
277 <div class="widget-title"><input type="checkbox" name="country_all" value="all" id="checkall2" />All Countries</div>
278 <div class="widget-content" style="overflow:auto; height:100px; background:#FFFFFF">
279 ';
280 $listcountry = $db->query( 'SELECT * FROM ip2nationCountries ORDER BY country ASC' );
281 $ad_countries = explode( ',', $data['country'] );
282
283 if ($country = $db->fetch_array( $listcountry )) {
284 if (!in_array( $country[country], $ad_countries )) {
285 echo '<input type="checkbox" name="country[]" value="' . $country[country] . '" class="checkall2" /> ' . $country[country] . '<br />';
286 }
287
288 echo '<input type="checkbox" name="country[]" value="' . $country[country] . '" class="checkall2" checked /> ' . $country[country] . '<br />';
289 }
290
291 echo ' </div> </td>
292 </tr>
293 <tr>
294 <td>Ad Value</td>
295 <td><input type="text" name="value" value="';
296 echo $data['value'];
297 echo '" /></td>
298 </tr>
299 <tr>
300 <td>Ad Seconds</td>
301 <td><input type="text" name="time" value="';
302 echo $data['time'];
303 echo '" /></td>
304 </tr>
305 <tr>
306 <td>Expires</td>
307 <td><input type="text" name="expires" value="';
308 echo date( 'm/d/Y', $data['expires'] );
309 echo '" class="datepicker" /> (mm/dd/YYYY)</td>
310 </tr>
311 <tr>
312 <td></td>
313 <td>
314 <input type="submit" name="create" value="Update" />
315 <input type="button" name="btn" value="Return" onclick="location.href=\'./?view=addon_modules&module=fixed_ptc_advertisements\';" />
316 </td>
317 </tr>
318</table>
319</form>
320
321';
322 }
323 }
324
325
326 if ($showtabs == true) {
327 echo '
328
329
330
331<div id="tabs">
332 <ul>
333 <li><a href="#tab-1">Manage Ads</a></li>
334 <li><a href="#tab-2">Add New Ad</a></li>
335 <li><a href="#tab-3">Settings</a></li>
336 </ul>
337 <div id="tab-1">
338<div class="ui-tabs ui-widget ui-widget-content ui-corner-all">
339 <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
340 <li class="ui-state-default ui-corner-top ui';
341 echo '-tabs-selected ui-state-active"><a href="javascript:void(0);" onclick="$(\'#search-content\').slideToggle();" style="cursor:pointer">Search</a></li>
342 </ul>
343 <div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="search-content" ';
344 echo (!$adlink ? 'style="display:none"' : '');
345 echo '>
346<form method="post">
347 <input type="hidden" name="do" value="search" />
348 <table width="100%" class="widget-tbl">
349 <tr>
350 <td align="right">Owner:</td>
351 <td>
352 ';
353 echo '<s';
354 echo 'elect name="owner" onchange="selectowner();" id="owner">
355 <option value="">all members</option>
356 <option value="single" ';
357 echo ($input->r['owner'] = 'single' ? 'selected' : '');
358 echo '>single member</option>
359 <option value="selfsponsored" ';
360 echo ($input->r['owner'] = 'selfsponsored' ? 'selected' : '');
361 echo '>self-sponsored</option>
362 </select>
363 <input type="text" name="username" value="';
364 echo $input->r['username'];
365 echo '" id="username" ';
366 echo ($input->r['owner'] = 'single' ? '' : 'style="display:none"');
367 echo ' />
368 </td>
369 <td align="right">Expires on:</td>
370 <td><input type="text" name="expires" class="datepicker" value="';
371 echo $input->r['expires'];
372 echo '" /> (mm/dd/YYYY)
373 </td>
374 </tr>
375 <tr>
376 <td align="right">Status</td>
377 <td>
378 ';
379 echo '<s';
380 echo 'elect name="status">
381 <option value="">All</option>
382 ';
383 $statusvalues = array( 'Active', 'Inactive', 'Pending', 'Expired', 'Paused' );
384 foreach ($statusvalues as $v) {
385
386 if ($v == $input->r['status']) {
387 echo '<option value=\'' . $v . '\' selected>' . $v . '</option>';
388 continue;
389 }
390
391 echo '<option value=\'' . $v . '\'>' . $v . '</option>';
392 }
393
394 echo ' </select>
395 </td>
396 <td align="right">URL:</td>
397 <td><input type="text" name="url" value="';
398 echo $input->r['url'];
399 echo '" /></td>
400 </tr>
401 <tr>
402 <td align="right">Ad Title:</td>
403 <td><input type="text" name="title" value="';
404 echo $input->r['title'];
405 echo '" /></td>
406 <td align="right">Ad Description:</td>
407 <td><input type="text" name="descr" value="';
408 echo $input->r['descr'];
409 echo '" /></td>
410 </tr>
411 <tr>
412 <td colspan="4" align="center"><input type="submit" name="send" value="Search">
413 </tr>
414 </table>
415 </form>
416 </div>
417</div>
418
419
420<form method="post" action="';
421 echo $paginator->gotopage( );
422 echo '">
423 <table width="100%" class="widget-tbl">
424 <tr class="titles">
425 <td width="20"><input type="checkbox" id="checkall"></td>
426 <td>';
427 echo $paginator->linkorder( 'user_id', 'Owner' );
428 echo '</td>
429 <td align="center">';
430 echo $paginator->linkorder( 'title', 'Ad' );
431 echo ' / ';
432 echo $paginator->linkorder( 'url', 'URL' );
433 echo '</td>
434 <td align="center">';
435 echo $paginator->linkorder( 'clicks', 'Clicks' );
436 echo ' / ';
437 echo $paginator->linkorder( 'outside_clicks', 'Outside' );
438 echo '</td>
439 <td align="center">';
440 echo $paginator->linkorder( 'expires', 'Expires' );
441 echo '</td>
442 <td align="center">';
443 echo $paginator->linkorder( 'clicks_today', 'Clicks Today' );
444 echo '</td>
445 <td align="center">';
446 echo $paginator->linkorder( 'value', 'Value' );
447 echo ' / ';
448 echo $paginator->linkorder( 'time', 'Time' );
449 echo '</td>
450 <td align="center">';
451 echo $paginator->linkorder( 'status', 'Status' );
452 echo '</td>
453 <td></td>
454 </tr>
455 ';
456
457 if ($r = $db->fetch_array( $q )) {
458 $tr = ($tr = 'tr1' ? 'tr2' : 'tr1');
459 $username = ($r['user_id'] = 0 ? '<span style="color:green">Administrator</span>' : '<a href="./?view=members&edit=' . $r['user_id'] . '">' . $db->fetchOne( 'SELECT username FROM members WHERE id=' . $r['user_id'] ) . '</a>');
460 echo ' <tr class="';
461 echo $tr;
462 echo ' normal_linetbl">
463 <td align="center"><input type="checkbox" name="mid[]" value="';
464 echo $r['id'];
465 echo '" class="checkall" /></td>
466 <td>';
467 echo $username;
468 echo '</td>
469 <td>';
470
471 if (35 < strlen( $r['title'] )) {
472 echo substr( $r['title'], 0, 35 ) . '...';
473 }
474else {
475 echo $r['title'];
476 }
477
478 echo '<br>';
479 echo '<s';
480 echo 'pan style="font-size:11px">
481 <a href="';
482 echo $r['url'];
483 echo '" target="_blank" style="color:#CC66CC">
484 ';
485
486 if (35 < strlen( $r['url'] )) {
487 echo substr( $r['url'], 0, 35 ) . '...';
488 }
489else {
490 echo $r['url'];
491 }
492
493 echo ' </a>
494 </span></td>
495 <td align="center">
496 ';
497 echo '<s';
498 echo 'pan style="color:green">';
499 echo $r['clicks'];
500 echo '</span> / ';
501 echo '<s';
502 echo 'pan style="color:#990000">';
503 echo $r['outside_clicks'];
504 echo '</span>
505 </td>
506 <td align="center">
507 ';
508 echo '<s';
509 echo 'pan style="color:#000099">';
510 echo date( 'dS M, Y', $r['expires'] );
511 echo '</span>
512 </td>
513 <td align="center">
514 ';
515 echo '<s';
516 echo 'pan style="color:#000099">';
517 echo $r['clicks_today'];
518 echo '</span>
519 </td>
520 <td align="center" style="white-space:nowrap">
521 ';
522 echo '<s';
523 echo 'pan style="color:#400080">$';
524 echo $r['value'] + 1;
525 echo ' - ';
526 echo $r['time'];
527 echo ' seconds</span>
528 </td>
529 <td align="center">';
530 echo '<s';
531 echo 'pan style="color:
532 ';
533 switch ($r['status']) {
534 case 'Active': {
535 echo '#009900';
536 break;
537 }
538
539 case 'Inactive': {
540 echo 'orange';
541 break;
542 }
543
544 case 'Expired': {
545 echo '#990000';
546 break;
547 }
548
549 default: {
550 echo '#996600';
551 break;
552 }
553 }
554
555 echo ' ">';
556 echo $r['status'];
557 echo '</span></td>
558 <td align="center"><a href="./?view=addon_modules&module=fixed_ptc_advertisements&edit_link=';
559 echo $r['id'];
560 echo '"><img src="./css/images/edit.png" border="0" title="Edit Ad" /></a>
561 </td>
562 </tr>
563 ';
564 }
565
566
567 if ($paginator->totalResults( ) = 0) {
568 echo ' <tr>
569 <td colspan="8" align="center">Records not found</td>
570 </tr>
571 ';
572 }
573
574 echo ' </table>
575 <div style="margin-top:10px">
576 <input type="button" value="← Prev Page" ';
577 echo (( $paginator->totalPages( ) = 1 || $paginator->getPage( ) = 1 ) ? 'disabled class="btn-disabled"' : 'onclick="location.href=\'' . $paginator->prevpage( ) . '\';";');
578 echo ' />
579
580 <input type="button" value="Next Page →" ';
581 echo (( $paginator->totalPages( ) = 0 || $paginator->totalPages( ) = $paginator->getPage( ) ) ? 'disabled class="btn-disabled"' : 'onclick="location.href=\'' . $paginator->nextpage( ) . '\';";');
582 echo ' />
583 ';
584
585 if (1 < $paginator->totalPages( )) {
586 echo ' <div style="float:right">
587 Jump to page:
588 ';
589 echo '<s';
590 echo 'elect name="p" style="min-width:inherit;" id="pagid" onchange="gotopage(this.value)">
591 ';
592 $i = 20;
593
594 while ($i <= $paginator->totalPages( )) {
595 if ($i = $paginator->getPage( )) {
596 echo '<option selected value="' . $paginator->gotopage( $i ) . '">' . $i . '</option>';
597 }
598else {
599 echo '<option value="' . $paginator->gotopage( $i ) . '">' . $i . '</option>';
600 }
601
602 ++$i;
603 }
604
605 echo ' </select>
606 ';
607 echo '<s';
608 echo 'cript type="text/javascript">
609 function gotopage(pageid){
610 location.href=pageid;
611 }
612 </script>
613 </div>
614 <div class="clear"></div>
615 ';
616 }
617
618 echo ' </div>
619
620 ';
621
622 if (0 < $paginator->totalPages( )) {
623 echo ' <div class="widget-title" style="margin-top:5px">Action</div>
624 <div class="widget-content">
625 ';
626 echo '<s';
627 echo 'elect name="a">
628 <option value="">Select one</option>
629 <option value="delete">Delete (irreversible)</option>
630 <option value="Active">Set Active</option>
631 <option value="Inactive">Set Inactive</option>
632 <option value="Expired">Set Expired</option>
633 <option value="Paused">Set Paused</option>
634 <option valu';
635 echo 'e="selfsponsored">Set Self-sponsored</option>
636 </select>
637 <input type="submit" name="action" value="Submit" />
638 </div>
639 ';
640 }
641
642 echo '<input type="hidden" name="sesion_id" value="';
643 echo sesion_id( );
644 echo '" />
645</form>
646
647
648
649
650 </div>
651 <div id="tab-2">
652 ';
653 echo '<s';
654 echo 'cript type="text/javascript">
655 $(function(){
656 $("#checkall3").click(function () {
657 $(".checkall3").attr("checked",this.checked);
658 });
659 });
660 </script>
661 <form method="post" id="frm2" onsubmit="return addonfrm(this.id);">
662 <input type="hidden" name="do" value="add_ptcad" />
663 <table width="100%" class="widget-tbl">
664 <tr>
665 <td width="150">Title</td>
666 ';
667 echo ' <td><input name="title" type="text" id="title" /></td>
668 </tr>
669 <tr>
670 <td>Subtitle</td>
671 <td><input name="subtitle" type="text" id="subtitle" maxlength="80" /></td>
672 </tr>
673 <tr>
674 <td>Target URL</td>
675 <td><input name="url" type="text" id="url" value="http://" /></td>
676 </tr>
677 <tr>
678 <td>Imag';
679 echo 'e URL (optional)</td>
680 <td><input name="img" type="text" id="img" value="http://" /></td>
681 </tr>
682 <tr>
683 <td>Target Membership</td>
684 <td>
685 <div class="widget-title"><input type="checkbox" name="membership_all" value="all" id="checkall3" />All Memberships</div>
686 <div class="widget-content" style="overflow:auto; height:75px; backgroun';
687 echo 'd:#FFFFFF">
688 ';
689 $memlist = $db->query( 'SELECT id, name FROM membership ORDER BY id ASC' );
690
691 if ($row = $db->fetch_array( $memlist )) {
692 $vermembership = strpos( $data['membership'], ',' . $row['id'] . ',' );
693 echo '<input type="checkbox" name="membership[]" value="' . $row[id] . '" class="checkall3" /> ' . $row[name] . '<br />';
694 }
695
696 echo ' </div>
697 </td>
698 </tr>
699 <tr>
700 <td>Target Country</td>
701 <td>
702 <div class="widget-title"><input type="checkbox" name="country_all" value="all" id="checkall2" />All Countries</div>
703 <div class="widget-content" style="overflow:auto; height:100px; background:#FFFFFF">
704 ';
705 $listcountry = $db->query( 'SELECT * FROM ip2nationCountries ORDER BY country ASC' );
706
707 if ($country = $db->fetch_array( $listcountry )) {
708 echo '<input type="checkbox" name="country[]" value="' . $country[country] . '" class="checkall2" /> ' . $country[country] . '<br />';
709 }
710
711 echo ' </div>
712 </td>
713 </tr>
714 <tr>
715 <td>Ad Value</td>
716 <td><input type="text" name="advalue" value="0.001" /></td>
717 </tr>
718 <tr>
719 <td>Ad Seconds</td>
720 <td><input type="text" name="adseconds" value="10" /></td>
721 </tr>
722 <tr>
723 <td>Expires</td>
724 <td><input type="text"';
725 echo ' name="expires" value="';
726 echo date( 'm/d/Y' );
727 echo '" class="datepicker" /> (mm/dd/YYYY)</td>
728 </tr>
729 <tr>
730 <td></td>
731 <td>
732 <input type="submit" name="create" value="Send" />
733 </td>
734 </tr>
735 </table>
736 </form>
737 </div>
738
739
740 <div id="tab-3">
741
742 <div class="widget-content">
743 <div class="widget-main-title">General</div>
744 <div class="widget-content"';
745 echo '>
746 <form method="post" id="frm3" onsubmit="return addonfrm(this.id);">
747 <input type="hidden" name="do" value="save_settings" />
748 <table width="100%" class="widget-tbl">
749 <tr>
750 <td align="right" width="300">Fixed PTC Advertisements Enable?</td>
751 <td><input type="checkbox" name="fixed_ads" value="yes" ';
752
753 if ($settings['fixed_ads'] == 'yes') {
754 echo 'checked';
755 }
756
757 echo ' /> Tick to enable</td>
758 </tr>
759 <tr>
760 <td align="right">Allow ref earning:</td>
761 <td>
762 ';
763 echo '<s';
764 echo 'elect name="fixedads_refcom" class="default">
765 <option value="yes" ';
766
767 if ($settings['fixedads_refcom'] == 'yes') {
768 echo 'selected';
769 }
770
771 echo '>Yes</option>
772 <option value="no" ';
773
774 if ($settings['fixedads_refcom'] != 'yes') {
775 echo 'selected';
776 }
777
778 echo '>No</option>
779 </select> ';
780 echo '<s';
781 echo 'pan style="font-size:11px">(Member will earn per referral click)</span>
782 </td>
783 </tr>
784 <tr>
785 <td align="right">Hide ad descr:</td>
786 <td> ';
787 echo '<s';
788 echo 'elect name="fixedads_hidedescr" class="default">
789 <option value="yes" ';
790
791 if ($settings['fixedads_hidedescr'] == 'yes') {
792 echo 'selected';
793 }
794
795 echo '>Yes</option>
796 <option value="no" ';
797
798 if ($settings['fixedads_hidedescr'] != 'yes') {
799 echo 'selected';
800 }
801
802 echo '>No</option>
803 </select></td>
804 </tr>
805 <tr>
806 <td align="right">Allow to member edit own adv.:</td>
807 <td> ';
808 echo '<s';
809 echo 'elect name="fixedads_editad" class="default">
810 <option value="yes" ';
811
812 if ($settings['fixedads_editad'] == 'yes') {
813 echo 'selected';
814 }
815
816 echo '>Yes</option>
817 <option value="no" ';
818
819 if ($settings['fixedads_editad'] != 'yes') {
820 echo 'selected';
821 }
822
823 echo '>No</option>
824 </select></td>
825 </tr>
826 <tr>
827 <td align="right">Fee for editing ad:</td>
828 <td><input type="text" name="fixedads_fee" value="';
829 echo $settings['fixedads_fee'];
830 echo '"></td>
831 </tr>
832
833 <tr>
834 <td></td>
835 <td>
836 <input type="submit" name="btn" value="Save" />
837 </td>
838 </tr>
839 </table>
840 </form>
841 </div>
842 <div class="widget-title">Add new price</div>
843 <div class="widget-content">
844 <form method="post" id="frm7" onsubm';
845 echo 'it="return addonfrm(this.id);">
846 <input type="hidden" name="do" value="newprice" />
847 <table width="100%" class="widget-tbl">
848 <tr>
849 <td width="100" align="right">Days:</td>
850 <td><input type="text" name="days" value="" size="5" /></td>
851 <td width="100" align="right">Price:</td>
852 <td>$<input type="text" name="price" value="" s';
853 echo 'ize="5" />
854 </td>
855 </tr>
856 <tr>
857 <td width="100" align="right">Value:</td>
858 <td>$<input type="text" name="value" value="" size="5" /></td>
859 <td width="100" align="right">Seconds:</td>
860 <td><input type="text" name="seconds" value="" size="5" />
861 </td>
862 </tr>
863 <tr>
864 ';
865 echo '<td colspan="4" align="center"><input type="submit" name="btn" value="Save" /></td>
866 </tr>
867 </table>
868 </form>
869 </div>
870
871 <form method="post" id="frm8" onsubmit="return addonfrm(this.id);">
872 <input type="hidden" name="do" value="save_prices" />
873 <table width="100%" class="widget-tbl">
874 <tr class="titles">
875 <td align="center">Day';
876 echo 's</td>
877 <td align="center">Price</td>
878 <td align="center">Value</td>
879 <td align="center">Seconds</td>
880 <td></td>
881 </tr>
882 ';
883 $q = $db->query( 'SELECT * FROM fixedads_price ORDER BY value DESC, seconds DESC' );
884
885 if ($row = $db->fetch_array( $q )) {
886 echo ' <tr>
887 <td align="center"><input type="text" name="days[';
888 echo $row['id'];
889 echo ']" value="';
890 echo $row['days'];
891 echo '" size="5" /></td>
892 <td align="center">$<input type="text" name="price[';
893 echo $row['id'];
894 echo ']" value="';
895 echo $row['price'];
896 echo '" size="5" /></td>
897 <td align="center">$<input type="text" name="value[';
898 echo $row['id'];
899 echo ']" value="';
900 echo $row['value'];
901 echo '" size="5" /></td>
902 <td align="center"><input type="text" name="seconds[';
903 echo $row['id'];
904 echo ']" value="';
905 echo $row['seconds'];
906 echo '" size="5" /></td>
907 <td align="center"><input type="hidden" name="id[]" value="';
908 echo $row['id'];
909 echo '" />[<a href="./modules/fixed_ptc_advertisements.php?deleteadprice=';
910 echo $row['id'];
911 echo '">Delete</a>]</td>
912 </tr>
913 ';
914 }
915
916 echo ' <tr>
917 <td colspan="5" align="center">
918 <input type="submit" name="btn" value="Save" />
919 </td>
920 </tr>
921 </table>
922 </form>
923 </div>
924
925
926 </div>
927</div>
928
929
930
931
932';
933 }
934
935?>