forked from gautamkrishnar/Be-Like-Bill
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_bill.php
More file actions
94 lines (92 loc) · 2.71 KB
/
Copy pathmake_bill.php
File metadata and controls
94 lines (92 loc) · 2.71 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
<html>
<head>
<title>Be like Bill</title>
<link rel="shortcut icon" href="icon.png" />
<!-- Facebook API -->
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '293143591037696',
xfbml : true,
version : 'v2.5'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut" src="icon.png" />
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<center>
<?php
require_once('billgen.php');
if($_SERVER['REQUEST_METHOD'] === 'POST'){
// Echoing the image url to src tag of img
echo '<img src="';
genbill();
echo $path;
echo '" class="billimg"/>';
echo '<br/><br/>';
echo '<a class="btn" onclick="share_prompt()">Share on Facebook</a>';
}
else if($_SERVER['REQUEST_METHOD'] === 'GET'){
echo '<img src="';
if (isset($_GET['name']))
{
genbill();
}
echo $path;
echo '" class="billimg"/>';
echo '<br/><br/>';
echo '<a class="btn" href="index.php">Create your own</a>';
}
else {
echo '<img src="';
genbill();
echo $path;
echo '" class="billimg"/>';
}
?>
<br/><br/><br/>
<?php
echo '<a class="btn" href="'.$path.'" download="'.$path.'">Download</a>';
?>
<br/>
<br/><br/><b>
Created with <img src="http://www.clker.com/cliparts/V/a/r/B/D/o/love-md.png" width="15px" height="inherit"/>
By <a href="http://github.com/gautamkrishnar/" target="_blank">Gautam krishna R.</a><br/>
API documentation and source code is available <a href="https://github.com/gautamkrishnar/Be-Like-Bill" target="_blank"> here. </a></b>
</center>
<!-- Facebook Share -->
<script>
function share_prompt() {
FB.ui(
{
method: 'share',
href: '<?php echo $siteurl."/make_bill.php?name=".$name."&sex=".$sex."&rand=".$ran_mem; ?>',
title: 'Be Like <?php echo $name; ?>',
picture: '<?php echo $path; ?>',
caption: '<?php echo $siteurl ?>',
description: 'Check out the Be-Like-Bill Meme generator',
},
// callback
function(response) {
if (response && !response.error_message) {
alert("Thanks for sharing...");
} else {
alert("Error, Can't share the Bill...");
}
}
);
}
</script>
</body>
</html>