Add reload facility with image from http://www.veryicon.com/icon/png/Internet%20...
[infodrom/phone] / index.php
index 579282b..b227cf5 100644 (file)
--- a/index.php
+++ b/index.php
@@ -4,9 +4,19 @@ include_once('phone.php');
 if (!empty($_POST['func'])) {
   $data = array();
   if ($_POST['func'] == 'incoming') {
-    $data['incoming'] = get_incoming();
+    $data['incoming'] = read_directory('incoming');
+  } elseif ($_POST['func'] == 'archive') {
+    $data['archive'] = read_directory('archive');
+  } elseif ($_POST['func'] == 'archive_call') {
+    archive_call($_POST['call']);
+  } elseif ($_POST['func'] == 'delete_call') {
+    delete_call($_POST['dir'],$_POST['call']);
   } elseif ($_POST['func'] == 'callinfo') {
     $data = callinfo($_POST['dir'],$_POST['call']);
+    $data['dir'] = $_POST['dir'];
+    $data['call'] = $_POST['call'];
+  } elseif ($_POST['func'] == 'save') {
+    save_call();
   }
   header('Content-type: application/json; charset=UTF-8');
   echo json_encode($data);
@@ -49,6 +59,10 @@ if (!empty($_POST['func'])) {
 
 </div>
 
+<div class="controls">
+<img src="lib/reload.png" onclick="reload()" title="Check phone box">
+</div>
+
 <div class="phonecall">
 <p class="title">Play message</p>
 <p id="callspeaker">&nbsp;</p>
@@ -57,5 +71,20 @@ if (!empty($_POST['func'])) {
 <p id="callnote"></p>
 </div>
 
+<div class="editcall">
+<p class="title">Edit message</p>
+<div style="padding-left: 5px;">
+<form id="edit_form">
+<span id="edit_date">&nbsp;</span><br>
+<input id="edit_dir" type="hidden">
+<input id="edit_call" type="hidden">
+Name<br><input id="edit_name" type="text" size="31"><br>
+Note<br><input id="edit_note" type="text" size="31"><br>
+<input type="button" class="button" value="Save" onclick="save()" style="margin-top: 5px;">
+<span id="edit_status"></span>
+</form>
+</div>
+</div>
+
 </body>
 </html>