Commit | Line | Data |
---|---|---|
ecfebb09 PM |
1 | <?PHP |
2 | $title = 'MEPS - Invite Links'; | |
3 | include_once('header.php'); | |
dcc88684 | 4 | slack_general('Share Links Loaded ('.$_COOKIE['invite'].')','md-petition'); |
ecfebb09 PM |
5 | $q = "select * from website_text where id = '8'"; |
6 | $r = $petition->query($q); | |
7 | $d = mysqli_fetch_array($r); | |
8 | ?> | |
9 | <script>document.title = "<?PHP echo $title;?>";</script> | |
10 | <div class='col-sm-12' style='height:100px; text-align:center;'><h2><?PHP echo $d['text_title'];?></h2><p><?PHP echo $d['text_block'];?></p></div> | |
99b2fc7f | 11 | |
2970e405 PM |
12 | |
13 | <div id="fb-root"></div> | |
14 | <script>(function(d, s, id) { | |
15 | var js, fjs = d.getElementsByTagName(s)[0]; | |
16 | if (d.getElementById(id)) return; | |
17 | js = d.createElement(s); js.id = id; | |
18 | js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0"; | |
19 | fjs.parentNode.insertBefore(js, fjs); | |
20 | }(document, 'script', 'facebook-jssdk'));</script> | |
21 | ||
99b2fc7f PM |
22 | <script> |
23 | function myFunction(short_code) { | |
24 | /* Get the text field */ | |
25 | var copyText = document.getElementById(short_code); | |
2970e405 | 26 | |
99b2fc7f PM |
27 | /* Select the text field */ |
28 | copyText.select(); | |
29 | copyText.setSelectionRange(0, 99999); /*For mobile devices*/ | |
2970e405 | 30 | |
99b2fc7f PM |
31 | /* Copy the text inside the text field */ |
32 | document.execCommand("copy"); | |
2970e405 | 33 | |
99b2fc7f PM |
34 | /* Alert the copied text */ |
35 | alert("Copied the Link: " + copyText.value); | |
36 | } | |
37 | </script> | |
1f263eba | 38 | <center> |
2970e405 PM |
39 | <table border="1" cellpadding="2" cellspacing="0"> |
40 | <?PHP | |
8031cbb9 | 41 | $q2 = "SELECT * FROM petitions where admin_status = 'approved'"; |
2970e405 PM |
42 | $r2 = $petition->query($q2); |
43 | while($d2 = mysqli_fetch_array($r2)){ | |
0d84931f PM |
44 | $link = "?invite=$d2[web_short_name]"; |
45 | if ($d2['landing_page'] != ''){ | |
46 | $link = $d2['landing_page']; | |
47 | } | |
99b2fc7f PM |
48 | echo "<tr> |
49 | <td align='center'><small>$d2[petition_name]<small></td> | |
50 | <td><div class=\"fb-share-button\" | |
b1c12120 | 51 | data-href=\"http://md-petition.com/$link\" |
1f263eba | 52 | data-layout=\"box_count\" data-size=\"large\"> |
99b2fc7f | 53 | </div></td> |
d7d197ba | 54 | <td><input type='text' size='50' value='http://md-petition.com/$link' id='$d2[web_short_name]'><button onclick='myFunction(\"$d2[web_short_name]\")'>Copy Link</button></td> |
99b2fc7f | 55 | </tr>"; |
2970e405 PM |
56 | } |
57 | ?> | |
58 | </table> | |
1f263eba | 59 | </center> |
99b2fc7f | 60 | <?PHP include_once('footer.php'); |