b227cf5fbf1533201d0211ca6e378fa9aaa457d1
[infodrom/phone] / index.php
1 <?
2 include_once('phone.php');
3
4 if (!empty($_POST['func'])) {
5   $data = array();
6   if ($_POST['func'] == 'incoming') {
7     $data['incoming'] = read_directory('incoming');
8   } elseif ($_POST['func'] == 'archive') {
9     $data['archive'] = read_directory('archive');
10   } elseif ($_POST['func'] == 'archive_call') {
11     archive_call($_POST['call']);
12   } elseif ($_POST['func'] == 'delete_call') {
13     delete_call($_POST['dir'],$_POST['call']);
14   } elseif ($_POST['func'] == 'callinfo') {
15     $data = callinfo($_POST['dir'],$_POST['call']);
16     $data['dir'] = $_POST['dir'];
17     $data['call'] = $_POST['call'];
18   } elseif ($_POST['func'] == 'save') {
19     save_call();
20   }
21   header('Content-type: application/json; charset=UTF-8');
22   echo json_encode($data);
23   exit;
24 } elseif (!empty($_GET['dir']) && !empty($_GET['call'])) {
25   send_call($_GET['dir'], $_GET['call']);
26   exit;
27 }
28
29 ?>
30 <html>
31 <head>
32 <title>Infodrom Phone Answering Machine</title>
33 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
34 <link href="phone.css" rel="stylesheet" type="text/css">
35 </head>
36 <script type="text/javascript" src="lib/json_parse.js"></script>
37 <script type="text/javascript" src="lib/basics.js"></script>
38 <script type="text/javascript" src="phone.js"></script>
39 <script type="text/javascript" src="lib/debug_joey.js"></script>
40
41 <body onload="page_init()">
42 <div style="margin-top: -5px">
43 </div>
44
45 <div>
46 <div class="phonelist" id="incoming">
47 <p class="title">Incoming Calls</p>
48 <ul class="phonelist" id="incoming_calls">
49 <li>Loading data...</li>
50 </ul>
51 </div>
52
53 <div class="phonelist" id="archive">
54 <p class="title">Archived Calls</p>
55 <ul class="phonelist" id="archive_calls">
56 <li>Loading data...</li>
57 </ul>
58 </div>
59
60 </div>
61
62 <div class="controls">
63 <img src="lib/reload.png" onclick="reload()" title="Check phone box">
64 </div>
65
66 <div class="phonecall">
67 <p class="title">Play message</p>
68 <p id="callspeaker">&nbsp;</p>
69 <iframe class="phonecall" id="phonecall"></iframe>
70 <p id="calldate">&nbsp;</p>
71 <p id="callnote"></p>
72 </div>
73
74 <div class="editcall">
75 <p class="title">Edit message</p>
76 <div style="padding-left: 5px;">
77 <form id="edit_form">
78 <span id="edit_date">&nbsp;</span><br>
79 <input id="edit_dir" type="hidden">
80 <input id="edit_call" type="hidden">
81 Name<br><input id="edit_name" type="text" size="31"><br>
82 Note<br><input id="edit_note" type="text" size="31"><br>
83 <input type="button" class="button" value="Save" onclick="save()" style="margin-top: 5px;">
84 <span id="edit_status"></span>
85 </form>
86 </div>
87 </div>
88
89 </body>
90 </html>