-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforward_fax.php
More file actions
88 lines (81 loc) · 2.99 KB
/
forward_fax.php
File metadata and controls
88 lines (81 loc) · 2.99 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
<?php
/**
* Copyright (C) 2019-2024 Paladin Business Solutions
*/
ob_start();
session_start();
require_once('includes/ringcentral-functions.inc');
require_once('includes/ringcentral-php-functions.inc');
show_errors();
page_header(0);
function show_form ($message, $label = "", $print_again = false) { ?>
<table class="CustomTable">
<tr class="CustomTable">
<td colspan="2" class="CustomTableFullCol">
<img src="images/rc-logo.png"/>
<h2><?php echo_plain_text("Forward a Fax", "red", "large"); ?></h2>
<?php
if ($print_again == true) {
echo "<p class='msg_bad'>" . $message . "</strong></font>";
} else {
echo "<p class='msg_good'>" . $message . "</p>";
} ?>
</td>
</tr>
<form action="" method="post" enctype="multipart/form-data">
<tr class="CustomTable">
<td class="center_col">
<p style='display: inline;'>Receiving Fax #:</p>
<input type="text" name="to_fax_number">
<input type="submit" class="submit_button" value=" Send forward " name="forward_fax">
<br/>
<hr>
</td>
</tr>
<?php $filename = view_fax($_GET['id']); ?>
<tr class="CustomTable">
<td class="CustomTableFullCol">
<div id="pdf-container">
<!-- Embed the PDF using iframe -->
<iframe src="<?php echo $filename; ?>" width="100%" height="100%" style="border: none;"></iframe>
</div>
</td>
</tr>
<tr class="CustomTable">
<td colspan="2" class="CustomTableFullCol">
<br/>
<input type="submit" class="submit_button" value=" Return to List " name="list_faxes">
<input type="submit" class="submit_button" value=" Home " name="home_page">
</td>
</tr>
<tr class="CustomTable">
<td colspan="2" class="CustomTableFullCol">
<hr>
</td>
</tr>
</form>
</table>
<?php
}
/* ============= */
/* --- MAIN --- */
/* ============= */
if (isset($_POST['home_page'])) {
header("Location: index.php");
} elseif (isset($_POST['forward_fax'])) {
if (send_forward_fax ($_POST['to_fax_number'], $_GET['id']) == false) {
$message = "Fax forward failed";
} else {
$message = "The selected Fax was forwarded successfully.";
}
show_form($message);
} elseif (isset($_POST['list_faxes'])) {
header("Location: list_faxes.php");
} else {
$message = "Showing your selected fax. Please provide forwarding fax number<br/><br/>";
show_form($message);
}
ob_end_flush();
page_footer();