@@ -34,7 +34,6 @@
echo "access denied";
exit;
}
require_once "config.php";
//require_once "edit/header.php";

echo "<html>";
@@ -50,191 +49,188 @@
echo "</style>";

function isfile($filename) {
if (@filesize($filename) > 0) { return true; } else { return false; }
if (@filesize($filename) > 0) { return true; } else { return false; }
}

function space($count) {
$r=''; $i=0;
while($i < $count) {
$r .= ' ';
$i++;
}
return $r;
$r=''; $i=0;
while($i < $count) {
$r .= ' ';
$i++;
}
return $r;
}

echo "<script type=\"text/javascript\" language=\"javascript\">\n";
echo " function makeRequest(url, strpost) {\n";
echo " var http_request = false;\n";
echo "\n";
echo " if (window.XMLHttpRequest) { // Mozilla, Safari, ...\n";
echo " http_request = new XMLHttpRequest();\n";
echo " if (http_request.overrideMimeType) {\n";
echo " http_request.overrideMimeType('text/xml');\n";
echo " // See note below about this line\n";
echo " }\n";
echo " } else if (window.ActiveXObject) { // IE\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n";
echo " } catch (e) {\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n";
echo " } catch (e) {}\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " if (!http_request) {\n";
echo " alert('Giving up :( Cannot create an XMLHTTP instance');\n";
echo " return false;\n";
echo " }\n";
echo " http_request.onreadystatechange = function() { returnContent(http_request); };\n";
echo " if (http_request.overrideMimeType) {\n";
echo " http_request.overrideMimeType('text/html');\n";
echo " }\n";
echo " http_request.open('POST', url, true);\n";
echo "\n";
echo "\n";
echo " if (strpost.length == 0) {\n";
echo " //http_request.send(null);\n";
echo " http_request.send('name=value&foo=bar');\n";
echo " }\n";
echo " else {\n";
echo " http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n";
echo " http_request.send(strpost);\n";
echo " }\n";
echo "\n";
echo " }\n";
echo "\n";
echo " function returnContent(http_request) {\n";
echo "\n";
echo " if (http_request.readyState == 4) {\n";
echo " if (http_request.status == 200) {\n";

echo " parent.editAreaLoader.setValue('edit1', http_request.responseText); \n";
echo "\n";

echo " }\n";
echo " else {\n";
echo " alert('There was a problem with the request.');\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " }\n";
echo "</script>";

echo "<SCRIPT LANGUAGE=\"JavaScript\">\n";
//echo "// ---------------------------------------------\n";
//echo "// --- http://www.codeproject.com/jscript/dhtml_treeview.asp\n";
//echo "// --- Name: Easy DHTML Treeview --\n";
//echo "// --- Author: D.D. de Kerf --\n";
//echo "// --- Version: 0.2 Date: 13-6-2001 --\n";
//echo "// ---------------------------------------------\n";
echo "function Toggle(node) {\n";
echo " // Unfold the branch if it isn't visible\n";
echo " if (node.nextSibling.style.display == 'none') {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/minus.gif\";\n";
echo " }\n";

echo " }\n";
echo " \n";
echo " node.nextSibling.style.display = 'block';\n";
echo " }\n";
echo " // Collapse the branch if it IS visible\n";
echo " else {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/plus.gif\";\n";
echo " }\n";
echo " }\n";
echo " node.nextSibling.style.display = 'none';\n";
echo " }\n";
echo "\n";
echo "}\n";
echo "</SCRIPT>";
echo "<script type=\"text/javascript\" language=\"javascript\">\n";
echo " function makeRequest(url, strpost) {\n";
echo " var http_request = false;\n";
echo "\n";
echo " if (window.XMLHttpRequest) { // Mozilla, Safari, ...\n";
echo " http_request = new XMLHttpRequest();\n";
echo " if (http_request.overrideMimeType) {\n";
echo " http_request.overrideMimeType('text/xml');\n";
echo " // See note below about this line\n";
echo " }\n";
echo " } else if (window.ActiveXObject) { // IE\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n";
echo " } catch (e) {\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n";
echo " } catch (e) {}\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " if (!http_request) {\n";
echo " alert('Giving up :( Cannot create an XMLHTTP instance');\n";
echo " return false;\n";
echo " }\n";
echo " http_request.onreadystatechange = function() { returnContent(http_request); };\n";
echo " if (http_request.overrideMimeType) {\n";
echo " http_request.overrideMimeType('text/html');\n";
echo " }\n";
echo " http_request.open('POST', url, true);\n";
echo "\n";
echo "\n";
echo " if (strpost.length == 0) {\n";
echo " //http_request.send(null);\n";
echo " http_request.send('name=value&foo=bar');\n";
echo " }\n";
echo " else {\n";
echo " http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n";
echo " http_request.send(strpost);\n";
echo " }\n";
echo "\n";
echo " }\n";
echo "\n";
echo " function returnContent(http_request) {\n";
echo "\n";
echo " if (http_request.readyState == 4) {\n";
echo " if (http_request.status == 200) {\n";

echo " parent.editAreaLoader.setValue('edit1', http_request.responseText); \n";
echo "\n";

echo " }\n";
echo " else {\n";
echo " alert('There was a problem with the request.');\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " }\n";
echo "</script>";

echo "<SCRIPT LANGUAGE=\"JavaScript\">\n";
//echo "// ---------------------------------------------\n";
//echo "// --- http://www.codeproject.com/jscript/dhtml_treeview.asp\n";
//echo "// --- Name: Easy DHTML Treeview --\n";
//echo "// --- Author: D.D. de Kerf --\n";
//echo "// --- Version: 0.2 Date: 13-6-2001 --\n";
//echo "// ---------------------------------------------\n";
echo "function Toggle(node) {\n";
echo " // Unfold the branch if it isn't visible\n";
echo " if (node.nextSibling.style.display == 'none') {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/minus.gif\";\n";
echo " }\n";

echo " }\n";
echo " \n";
echo " node.nextSibling.style.display = 'block';\n";
echo " }\n";
echo " // Collapse the branch if it IS visible\n";
echo " else {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/plus.gif\";\n";
echo " }\n";
echo " }\n";
echo " node.nextSibling.style.display = 'none';\n";
echo " }\n";
echo "\n";
echo "}\n";
echo "</SCRIPT>";

echo "<head>";
echo "<body onfocus='null;'>";

echo "<div align='center' valign='1'>";
echo "<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='2'>\n";

echo "<tr class='border'>\n";
echo " <td align=\"left\" valign='top' nowrap>\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD><a href='javascript:void(0);' onclick=\"window.open('clipoptions.php?id=".$row[id]."','null','left=20,top=20,width=310,height=300,toolbar=0,resizable=0');\" style='text-decoration:none;' title=''><IMG SRC=\"images/folder.gif\" border='0'> Clip Library</a><DIV style=''>\n"; //display:none

$sql = "";
$sql .= "select * from v_clip_library ";
$sql .= "order by clip_folder ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);

if ($result_count > 0) { //no results
$last_folder = '';
$tag_open = '';
$x = 0;
$current_depth = 0;
$previous_depth = 0;
foreach($result as $row) {
$current_depth = count(explode ("/", $row[clip_folder]));
if ($current_depth < $previous_depth) {
$count = ($previous_depth - $current_depth);
$i=0;
while($i < $count){
echo "</DIV></TD></TR></TABLE>\n";
$i++;
}
echo "</DIV></TD></TR></TABLE>\n";
}

if ($last_folder != $row[clip_folder]) {
$clip_folder_name = str_replace ($previous_folder_name, "", $row[clip_folder]);
$clip_folder_name = str_replace ("/", "", $clip_folder_name);
echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD><A href='javascript:void(0);' onClick=\"Toggle(this);\"><IMG SRC=\"images/plus.gif\" border='none'> <IMG SRC=\"images/folder.gif\" border='none'> &nbsp;".$clip_folder_name." &nbsp; </A><DIV style='display:none'>\n\n";
$tag_open = 1;
}

$previous_depth = $current_depth;
$previous_folder_name = $row[clip_folder];

echo "<textarea style='display:none' id='clip_lib_start".$row[id]."'>".$row[clip_text_start]."</textarea>\n";
echo "<textarea style='display:none' id='clip_lib_end".$row[id]."'>".$row[clip_text_end]."</textarea>\n";
echo "\n";
echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=12></TD><TD align='bottom'><IMG SRC=\"images/file.png\" border='0'> \n";
echo "<a href='javascript:void(0);' onclick=\"parent.editAreaLoader.insertTags('edit1', document.getElementById('clip_lib_start".$row[id]."').value, document.getElementById('clip_lib_end".$row[id]."').value);\">".$row[clip_name]."</a>\n";
echo "</TD></TR></TABLE>\n";
echo "\n\n";

$last_folder = $row[clip_folder];

if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);

} //end if results

echo "\n";
echo " </DIV></TD></TR></TABLE>\n";

echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>";

echo "<br><br>";
//require_once "includes/footer.php";

unset ($result_count);
unset ($result);
unset ($key);
unset ($val);
unset ($c);

echo "</body>";
echo "</html>";
echo "<div align='center' valign='1'>";
echo "<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\" valign='top' nowrap>\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD><a href='javascript:void(0);' onclick=\"window.open('clipoptions.php?id=".$row[id]."','null','left=20,top=20,width=310,height=300,toolbar=0,resizable=0');\" style='text-decoration:none;' title=''><IMG SRC=\"images/folder.gif\" border='0'> Clip Library</a><DIV style=''>\n"; //display:none

$sql = "select * from v_clips ";
$sql .= "order by clip_folder ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);

if ($result_count > 0) { //no results
$last_folder = '';
$tag_open = '';
$x = 0;
$current_depth = 0;
$previous_depth = 0;
foreach($result as $row) {
$current_depth = count(explode ("/", $row['clip_folder']));
if ($current_depth < $previous_depth) {
$count = ($previous_depth - $current_depth);
$i=0;
while($i < $count){
echo "</DIV></TD></TR></TABLE>\n";
$i++;
}
echo "</DIV></TD></TR></TABLE>\n";
}

if ($last_folder != $row['clip_folder']) {
$clip_folder_name = str_replace ($previous_folder_name, "", $row['clip_folder']);
$clip_folder_name = str_replace ("/", "", $clip_folder_name);
echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD><A href='javascript:void(0);' onClick=\"Toggle(this);\"><IMG SRC=\"images/plus.gif\" border='none'> <IMG SRC=\"images/folder.gif\" border='none'> &nbsp;".$clip_folder_name." &nbsp; </A><DIV style='display:none'>\n\n";
$tag_open = 1;
}

$previous_depth = $current_depth;
$previous_folder_name = $row['clip_folder'];

echo "<textarea style='display:none' id='clip_lib_start".$row['clip_uuid']."'>".$row['clip_text_start']."</textarea>\n";
echo "<textarea style='display:none' id='clip_lib_end".$row['clip_uuid']."'>".$row['clip_text_end']."</textarea>\n";
echo "\n";
echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=12></TD><TD align='bottom'><IMG SRC=\"images/file.png\" border='0'> \n";
echo "<a href='javascript:void(0);' onclick=\"parent.editAreaLoader.insertTags('edit1', document.getElementById('clip_lib_start".$row['clip_uuid']."').value, document.getElementById('clip_lib_end".$row['clip_uuid']."').value);\">".$row['clip_name']."</a>\n";
echo "</TD></TR></TABLE>\n";
echo "\n\n";

$last_folder = $row['clip_folder'];

if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);

} //end if results

echo "\n";
echo " </DIV></TD></TR></TABLE>\n";

echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>";

echo "<br><br>";
//require_once "includes/footer.php";

unset ($result_count);
unset ($result);
unset ($key);
unset ($val);
unset ($c);

echo "</body>";
echo "</html>";

?>
@@ -33,22 +33,18 @@
echo "access denied";
exit;
}
require_once "config.php";
require_once "header.php";


echo "<div align='left'>";
echo "<table border='0' style=\"height: 100%; width: 100%;\">\n";
echo "<form method='post' name='frm' action=''>";
echo "<tr><td colspan='2'><div id='selectedclip'>Selected Clip: <input type='text' name='clip_name' id='clip_name' value=''><input type='hidden' name='clipid' id='clipid' value=''></div></td></tr>\n";
echo "<tr><td colspan='2'><div id='selectedclip'>Selected Clip: <input type='text' name='clip_name' id='clip_name' value=''><input type='hidden' name='clip_uuid' id='clip_uuid' value=''></div></td></tr>\n";
echo "</form>";
echo "<tr>\n";
echo "<td valign='top' width='200' nowrap>";

echo " <IFRAME SRC='clipoptionslist.php' style='border: solid 1px #CCCCCC; height: 100%; width: 100%;' WIDTH='100%' TITLE=''>\n";
echo " <!-- Clip List: Requires IFRAME support -->\n";
echo " </IFRAME>";

echo "</td>\n";
echo "<td valign='top' style=\"height: 100%;\">";

@@ -57,15 +53,13 @@
//echo " <tr><th>Options</th></tr>\n";
//echo " <tr><td colspan='1'><img src='images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";

echo " <tr><td><input type='button' class='btn' name='' onclick=\"window.location='clipupdate.php?id='+document.getElementById('clipid').value;\" value='Edit Clip'></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"window.location='clipupdate.php?id='+document.getElementById('clip_uuid').value;\" value='Edit Clip'></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"window.location='clipadd.php'\" value='Add Clip'></td></tr>\n";
//echo " <tr><td><input type='button' class='btn' name='' onclick=\"window.location='clipadd.php'\" value=' Search '></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"if (confirm('Are you sure you want to delete the selected clip?')){ window.location='clipdelete.php?id='+document.getElementById('clipid').value; }\" value=' Delete '></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"if (confirm('Are you sure you want to delete the selected clip?')){ window.location='clipdelete.php?id='+document.getElementById('clip_uuid').value; }\" value=' Delete '></td></tr>\n";
echo " <tr><td><br><br><br><br><br><br><br><br><br><br><br></td></tr>\n";

echo " <tr><td><input type='button' class='btn' name='' onclick='javascript:self.close();' value=' Close '></td></tr>\n";


echo " </table>";

echo "</td>\n";
@@ -74,4 +68,4 @@
echo "</div>";

require_once "footer.php";
?>
?>
@@ -33,7 +33,6 @@
echo "access denied";
exit;
}
require_once "config.php";

echo "<html>";
echo "<head>";
@@ -48,183 +47,181 @@
echo "</style>";

function isfile($filename) {
if (@filesize($filename) > 0) { return true; } else { return false; }
if (@filesize($filename) > 0) { return true; } else { return false; }
}

function space($count) {
$r=''; $i=0;
while($i < $count) {
$r .= ' ';
$i++;
}
return $r;
$r=''; $i=0;
while($i < $count) {
$r .= ' ';
$i++;
}
return $r;
}

echo "<script type=\"text/javascript\" language=\"javascript\">\n";
echo " function makeRequest(url, strpost) {\n";
echo " var http_request = false;\n";
echo "\n";
echo " if (window.XMLHttpRequest) { // Mozilla, Safari, ...\n";
echo " http_request = new XMLHttpRequest();\n";
echo " if (http_request.overrideMimeType) {\n";
echo " http_request.overrideMimeType('text/xml');\n";
echo " // See note below about this line\n";
echo " }\n";
echo " } else if (window.ActiveXObject) { // IE\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n";
echo " } catch (e) {\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n";
echo " } catch (e) {}\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " if (!http_request) {\n";
echo " alert('Giving up :( Cannot create an XMLHTTP instance');\n";
echo " return false;\n";
echo " }\n";
echo " http_request.onreadystatechange = function() { returnContent(http_request); };\n";
echo " http_request.overrideMimeType('text/html');\n";
echo " http_request.open('POST', url, true);\n";
echo "\n";
echo " if (strpost.length == 0) {\n";
echo " //http_request.send(null);\n";
echo " http_request.send('name=value&foo=bar');\n";
echo " }\n";
echo " else {\n";
echo " http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n";
echo " http_request.send(strpost);\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " function returnContent(http_request) {\n";
echo "\n";
echo " if (http_request.readyState == 4) {\n";
echo " if (http_request.status == 200) {\n";
echo " parent.editAreaLoader.setValue('edit1', http_request.responseText); \n";
echo " }\n";
echo " else {\n";
echo " alert('There was a problem with the request.');\n";
echo " }\n";
echo " }\n";
echo " }\n";
echo "</script>";

echo "<SCRIPT LANGUAGE=\"JavaScript\">\n";
//echo "// ---------------------------------------------\n";
//echo "// --- http://www.codeproject.com/jscript/dhtml_treeview.asp\n";
//echo "// --- Name: Easy DHTML Treeview --\n";
//echo "// --- Author: D.D. de Kerf --\n";
//echo "// --- Version: 0.2 Date: 13-6-2001 --\n";
//echo "// ---------------------------------------------\n";
echo "function Toggle(node) {\n";
echo " // Unfold the branch if it isn't visible\n";
echo " if (node.nextSibling.style.display == 'none') {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/minus.gif\";\n";
echo " }\n";

echo " }\n";
echo " \n";
echo " node.nextSibling.style.display = 'block';\n";
echo " }\n";
echo " // Collapse the branch if it IS visible\n";
echo " else {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/plus.gif\";\n";
echo " }\n";
echo " }\n";
echo " node.nextSibling.style.display = 'none';\n";
echo " }\n";
echo "\n";
echo "}\n";
echo "</SCRIPT>";
echo "<script type=\"text/javascript\" language=\"javascript\">\n";
echo " function makeRequest(url, strpost) {\n";
echo " var http_request = false;\n";
echo "\n";
echo " if (window.XMLHttpRequest) { // Mozilla, Safari, ...\n";
echo " http_request = new XMLHttpRequest();\n";
echo " if (http_request.overrideMimeType) {\n";
echo " http_request.overrideMimeType('text/xml');\n";
echo " // See note below about this line\n";
echo " }\n";
echo " } else if (window.ActiveXObject) { // IE\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n";
echo " } catch (e) {\n";
echo " try {\n";
echo " http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n";
echo " } catch (e) {}\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " if (!http_request) {\n";
echo " alert('Giving up :( Cannot create an XMLHTTP instance');\n";
echo " return false;\n";
echo " }\n";
echo " http_request.onreadystatechange = function() { returnContent(http_request); };\n";
echo " http_request.overrideMimeType('text/html');\n";
echo " http_request.open('POST', url, true);\n";
echo "\n";
echo " if (strpost.length == 0) {\n";
echo " //http_request.send(null);\n";
echo " http_request.send('name=value&foo=bar');\n";
echo " }\n";
echo " else {\n";
echo " http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n";
echo " http_request.send(strpost);\n";
echo " }\n";
echo " }\n";
echo "\n";
echo " function returnContent(http_request) {\n";
echo "\n";
echo " if (http_request.readyState == 4) {\n";
echo " if (http_request.status == 200) {\n";
echo " parent.editAreaLoader.setValue('edit1', http_request.responseText); \n";
echo " }\n";
echo " else {\n";
echo " alert('There was a problem with the request.');\n";
echo " }\n";
echo " }\n";
echo " }\n";
echo "</script>";

echo "<SCRIPT LANGUAGE=\"JavaScript\">\n";
//echo "// ---------------------------------------------\n";
//echo "// --- http://www.codeproject.com/jscript/dhtml_treeview.asp\n";
//echo "// --- Name: Easy DHTML Treeview --\n";
//echo "// --- Author: D.D. de Kerf --\n";
//echo "// --- Version: 0.2 Date: 13-6-2001 --\n";
//echo "// ---------------------------------------------\n";
echo "function Toggle(node) {\n";
echo " // Unfold the branch if it isn't visible\n";
echo " if (node.nextSibling.style.display == 'none') {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/minus.gif\";\n";
echo " }\n";

echo " }\n";
echo " \n";
echo " node.nextSibling.style.display = 'block';\n";
echo " }\n";
echo " // Collapse the branch if it IS visible\n";
echo " else {\n";
echo " // Change the image (if there is an image)\n";
echo " if (node.childNodes.length > 0) {\n";
echo " if (node.childNodes.item(0).nodeName == \"IMG\") {\n";
echo " node.childNodes.item(0).src = \"images/plus.gif\";\n";
echo " }\n";
echo " }\n";
echo " node.nextSibling.style.display = 'none';\n";
echo " }\n";
echo "\n";
echo "}\n";
echo "</SCRIPT>";

echo "<head>";
echo "<body>";

echo "<div align='center' valign='1'>";
echo "<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='2'>\n";

echo "<tr class='border'>\n";
echo " <td align=\"left\" valign='top' nowrap>\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD><a onclick=\"window.open('clipoptions.php?id=".$row[id]."','Clip Options','left=20,top=20,width=500,height=500,toolbar=0,resizable=0');\" style='text-decoration:none;' title=''><IMG SRC=\"images/folder.gif\" border='0'> Clip Library</a><DIV style=''>\n"; //display:none

$sql = "";
$sql .= "select * from v_clip_library ";
$sql .= "order by clip_folder ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);

if ($result_count > 0) { //no results
$last_folder = '';
$tag_open = '';
$x = 0;
$current_depth = 0;
$previous_depth = 0;
foreach($result as $row) {
$current_depth = count(explode("/", $row[clip_folder]));
if ($current_depth < $previous_depth) {
$count = ($previous_depth - $current_depth);
$i=0;
while($i < $count){
echo "</DIV></TD></TR></TABLE>\n";
$i++;
}
echo "</DIV></TD></TR></TABLE>\n";

}

if ($last_folder != $row[clip_folder]) {
$clip_folder_name = str_replace ($previous_folder_name, "", $row[clip_folder]);
$clip_folder_name = str_replace ("/", "", $clip_folder_name);
echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD><A onClick=\"Toggle(this);\"><IMG SRC=\"images/plus.gif\"> <IMG SRC=\"images/folder.gif\"> &nbsp;".$clip_folder_name." &nbsp; </A><DIV style='display:none'>\n\n";
$tag_open = 1;
}

$previous_depth = $current_depth;
$previous_folder_name = $row[clip_folder];

echo "<textarea style='display:none' id='clip_lib_start".$row[id]."'>".$row[clip_text_start]."</textarea>\n";
echo "<textarea style='display:none' id='clip_lib_end".$row[id]."'>".$row[clip_text_end]."</textarea>\n";
echo "\n";
echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=12></TD><TD align='bottom'><IMG SRC=\"images/file.png\" border='0'> \n";
echo "<a href='javascript:void(0);' onclick=\"parent.document.getElementById('clip_name').value='".$row[clip_name]."';parent.document.getElementById('clipid').value=".$row[id].";\">".$row[clip_name]."</a>\n";

echo "</TD></TR></TABLE>\n";
echo "\n\n";

$last_folder = $row[clip_folder];

if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);
} //end if results

echo "\n";
echo " </div></td></tr></table>\n";

echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>";

echo "<br><br>";

unset ($result_count);
unset ($result);
unset ($key);
unset ($val);
unset ($c);

echo "</body>";
echo "</html>";
echo "<div align='center' valign='1'>";
echo "<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='2'>\n";

echo "<tr class='border'>\n";
echo " <td align=\"left\" valign='top' nowrap>\n";
echo " <TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD><a onclick=\"window.open('clipoptions.php','Clip Options','left=20,top=20,width=500,height=500,toolbar=0,resizable=0');\" style='text-decoration:none;' title=''><IMG SRC=\"images/folder.gif\" border='0'> Clip Library</a><DIV style=''>\n"; //display:none

$sql = "select * from v_clips ";
$sql .= "order by clip_folder ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);

if ($result_count > 0) { //no results
$last_folder = '';
$tag_open = '';
$x = 0;
$current_depth = 0;
$previous_depth = 0;
foreach($result as $row) {
$current_depth = count(explode("/", $row[clip_folder]));
if ($current_depth < $previous_depth) {
$count = ($previous_depth - $current_depth);
$i=0;
while($i < $count){
echo "</DIV></TD></TR></TABLE>\n";
$i++;
}
echo "</DIV></TD></TR></TABLE>\n";

}

if ($last_folder != $row['clip_folder']) {
$clip_folder_name = str_replace ($previous_folder_name, "", $row['clip_folder']);
$clip_folder_name = str_replace ("/", "", $clip_folder_name);
echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=10></TD><TD><A onClick=\"Toggle(this);\"><IMG SRC=\"images/plus.gif\"> <IMG SRC=\"images/folder.gif\"> &nbsp;".$clip_folder_name." &nbsp; </A><DIV style='display:none'>\n\n";
$tag_open = 1;
}

$previous_depth = $current_depth;
$previous_folder_name = $row['clip_folder'];

echo "<textarea style='display:none' id='clip_lib_start".$row['clip_uuid']."'>".$row['clip_text_start']."</textarea>\n";
echo "<textarea style='display:none' id='clip_lib_end".$row['clip_uuid']."'>".$row['clip_text_end']."</textarea>\n";
echo "\n";
echo "<TABLE BORDER=0 cellpadding='0' cellspacing='0'><TR><TD WIDTH=12></TD><TD align='bottom'><IMG SRC=\"images/file.png\" border='0'> \n";
echo "<a href='javascript:void(0);' onclick=\"parent.document.getElementById('clip_uuid').value='".$row['clip_uuid']."';parent.document.getElementById('clip_name').value='".$row['clip_name']."';\">".$row['clip_name']."</a>\n";

echo "</TD></TR></TABLE>\n";
echo "\n\n";

$last_folder = $row['clip_folder'];
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);
} //end if results

echo "\n";
echo " </div></td></tr></table>\n";

echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>";

echo "<br><br>";

unset ($result_count);
unset ($result);
unset ($key);
unset ($val);
unset ($c);

echo "</body>";
echo "</html>";

?>
@@ -24,7 +24,6 @@
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "edit/includes/config.php";
require_once "includes/checkauth.php";
if (permission_exists('php_editor_view')) {
//access granted
@@ -35,158 +34,147 @@
}

if (count($_POST)>0) {
$id = $_POST["id"];
$clip_name = $_POST["clip_name"];
$clip_folder = $_POST["clip_folder"];
$clip_text_start = $_POST["clip_text_start"];
$clip_text_end = $_POST["clip_text_end"];
$clip_desc = $_POST["clip_desc"];
$clip_order = $_POST["clip_order"];


require_once "header.php";
echo "<div align='left'>";
echo "<table width='175' border='0' cellpadding='0' cellspacing='2'>\n";

echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";


$sql = "";
$sql .= "select * from v_clip_library ";
$sql .= "where ";
if (strlen($id) > 0) { $sql .= "and id like '%$id%' "; }
if (strlen($clip_name) > 0) { $sql .= "and clip_name like '%$clip_name%' "; }
if (strlen($clip_folder) > 0) { $sql .= "and clip_folder like '%$clip_folder%' "; }
if (strlen($clip_text_start) > 0) { $sql .= "and clip_text_start like '%$clip_text_start%' "; }
if (strlen($clip_text_end) > 0) { $sql .= "and clip_text_end like '%$clip_text_end%' "; }
if (strlen($clip_desc) > 0) { $sql .= "and clip_desc like '%$clip_desc%' "; }
if (strlen($clip_order) > 0) { $sql .= "and clip_order like '%$clip_order%' "; }


$sql = trim($sql);
if (substr($sql, -5) == "where"){ $sql = substr($sql, 0, (strlen($sql)-5)); }
$sql = str_replace ("where and", "where", $sql);
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);

$c = 0;
$row_style["0"] = "background-color: #F5F5DC;";
$row_style["1"] = "background-color: #FFFFFF;";

echo "<div align='left'>\n";
echo "<table border='0' cellpadding='1' cellspacing='1'>\n";
echo "<tr><td colspan='1'><img src='/edit/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>";

if ($result_count == 0) { //no results
echo "<tr><td>&nbsp;</td></tr>";
}
else { //received results

echo "<tr>";
//echo "<th nowrap>&nbsp; &nbsp; Id&nbsp; &nbsp; </th>";
echo "<th nowrap>&nbsp; &nbsp; clip_name Search &nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_folder&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_text_start&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_text_end&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_desc&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_order&nbsp; &nbsp; </th>";
echo "</tr>";
echo "<tr><td colspan='1'><img src='images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";

foreach($result as $row) {
//print_r( $row );
echo "<tr style='".$row_style[$c]."'>\n";
//echo "<td valign='top'><a href='update.php?id=".$row[id]."'>".$row[id]."</a></td>";
echo "<td valign='top'><a href='clipupdate.php?id=".$row[id]."'>".$row[clip_name]."</a></td>";
//echo "<td valign='top'>".$row[clip_folder]."</td>";
//echo "<td valign='top'>".$row[clip_text_start]."</td>";
//echo "<td valign='top'>".$row[clip_text_end]."</td>";
//echo "<td valign='top'>".$row[clip_desc]."</td>";
//echo "<td valign='top'>".$row[clip_order]."</td>";
echo "</tr>";

echo "<tr><td colspan='1'><img src='images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach unset($sql, $result, $row_count);

echo "</table>\n";
echo "</div>\n";


echo " <br><br>";
echo " </td>\n";
echo "</tr>\n";

} //end if results

echo "</table>\n";
echo "</div>";

echo "<br><br>";
require_once "footer.php";

unset ($result_count);
unset ($result);
unset ($key);
unset ($val);
unset ($c);

}
else {

require_once "header.php";
echo "<div align='left'>";
echo "<table with='175' border='0' cellpadding='0' cellspacing='2'>\n";

echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";


echo "<form method='post' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Name:</td>";
echo " <td><input type='text' class='txt' name='clip_name'></td>";
echo " </tr>";
echo " <tr>";
echo " <td>Folder:</td>";
echo " <td><input type='text' class='txt' name='clip_folder'></td>";
echo " </tr>";
echo " <tr>";
echo " <td>Start:</td>";
echo " <td><input type='text' class='txt' name='clip_text_start'></td>";
echo " </tr>";
echo " <tr>";
echo " <td>End:</td>";
echo " <td><input type='text' class='txt' name='clip_text_end'></td>";
echo " </tr>";
echo " <tr>";
echo " <td>Desc:</td>";
echo " <td><input type='text' class='txt' name='clip_desc'></td>";
echo " </tr>";
//echo " <tr>";
//echo " <td>clip_order:</td>";
//echo " <td><input type='text' class='txt' name='clip_order'></td>";
//echo " </tr>";
echo " <tr>";
echo " <td colspan='2' align='right'><input type='submit' name='submit' value='Search'></td>";
echo " </tr>";
echo "</table>";
echo "</form>";


echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";


require_once "footer.php";
$clip_uuid = $_POST["id"];
$clip_name = $_POST["clip_name"];
$clip_folder = $_POST["clip_folder"];
$clip_text_start = $_POST["clip_text_start"];
$clip_text_end = $_POST["clip_text_end"];
$clip_desc = $_POST["clip_desc"];
$clip_order = $_POST["clip_order"];

require_once "header.php";
echo "<div align='left'>";
echo "<table width='175' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";

$sql .= "select * from v_clips ";
$sql .= "where ";
if (strlen($clip_uuid) > 0) { $sql .= "and id = '$clip_uuid' "; }
if (strlen($clip_name) > 0) { $sql .= "and clip_name like '%$clip_name%' "; }
if (strlen($clip_folder) > 0) { $sql .= "and clip_folder like '%$clip_folder%' "; }
if (strlen($clip_text_start) > 0) { $sql .= "and clip_text_start like '%$clip_text_start%' "; }
if (strlen($clip_text_end) > 0) { $sql .= "and clip_text_end like '%$clip_text_end%' "; }
if (strlen($clip_desc) > 0) { $sql .= "and clip_desc like '%$clip_desc%' "; }
if (strlen($clip_order) > 0) { $sql .= "and clip_order like '%$clip_order%' "; }

$sql = trim($sql);
if (substr($sql, -5) == "where"){ $sql = substr($sql, 0, (strlen($sql)-5)); }
$sql = str_replace ("where and", "where", $sql);
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);

$c = 0;
$row_style["0"] = "background-color: #F5F5DC;";
$row_style["1"] = "background-color: #FFFFFF;";

echo "<div align='left'>\n";
echo "<table border='0' cellpadding='1' cellspacing='1'>\n";
echo "<tr><td colspan='1'><img src='/edit/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>";

if ($result_count == 0) {
//no results
echo "<tr><td>&nbsp;</td></tr>";
}
else { //received results
echo "<tr>";
//echo "<th nowrap>&nbsp; &nbsp; Id&nbsp; &nbsp; </th>";
echo "<th nowrap>&nbsp; &nbsp; clip_name Search &nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_folder&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_text_start&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_text_end&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_desc&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_order&nbsp; &nbsp; </th>";
echo "</tr>";
echo "<tr><td colspan='1'><img src='images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";

foreach($result as $row) {
//print_r( $row );
echo "<tr style='".$row_style[$c]."'>\n";
//echo "<td valign='top'><a href='update.php?id=".$row[id]."'>".$row[id]."</a></td>";
echo "<td valign='top'><a href='clipupdate.php?id=".$row[id]."'>".$row[clip_name]."</a></td>";
//echo "<td valign='top'>".$row[clip_folder]."</td>";
//echo "<td valign='top'>".$row[clip_text_start]."</td>";
//echo "<td valign='top'>".$row[clip_text_end]."</td>";
//echo "<td valign='top'>".$row[clip_desc]."</td>";
//echo "<td valign='top'>".$row[clip_order]."</td>";
echo "</tr>";

echo "<tr><td colspan='1'><img src='images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach unset($sql, $result, $row_count);
echo "</table>\n";
echo "</div>\n";

echo " <br><br>";
echo " </td>\n";
echo "</tr>\n";

} //end if results

echo "</table>\n";
echo "</div>";
echo "<br><br>";
require_once "footer.php";

unset ($result_count);
unset ($result);
unset ($key);
unset ($val);
unset ($c);

}
else {

//show the content
require_once "header.php";
echo "<div align='left'>";
echo "<table with='175' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";

echo "<form method='post' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Name:</td>";
echo " <td><input type='text' class='txt' name='clip_name'></td>";
echo " </tr>";
echo " <tr>";
echo " <td>Folder:</td>";
echo " <td><input type='text' class='txt' name='clip_folder'></td>";
echo " </tr>";
echo " <tr>";
echo " <td>Start:</td>";
echo " <td><input type='text' class='txt' name='clip_text_start'></td>";
echo " </tr>";
echo " <tr>";
echo " <td>End:</td>";
echo " <td><input type='text' class='txt' name='clip_text_end'></td>";
echo " </tr>";
echo " <tr>";
echo " <td>Desc:</td>";
echo " <td><input type='text' class='txt' name='clip_desc'></td>";
echo " </tr>";
//echo " <tr>";
//echo " <td>clip_order:</td>";
//echo " <td><input type='text' class='txt' name='clip_order'></td>";
//echo " </tr>";
echo " <tr>";
echo " <td colspan='2' align='right'><input type='submit' name='submit' value='Search'></td>";
echo " </tr>";
echo "</table>";
echo "</form>";

echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";

require_once "footer.php";

} //end if not post
?>
@@ -33,112 +33,106 @@
echo "access denied";
exit;
}
require_once "config.php";

if (count($_POST)>0) {
$id = check_str($_POST["id"]);
$clip_name = check_str($_POST["clip_name"]);
$clip_folder = check_str($_POST["clip_folder"]);
$clip_text_start = check_str($_POST["clip_text_start"]);
$clip_text_end = check_str($_POST["clip_text_end"]);
$clip_desc = check_str($_POST["clip_desc"]);
$clip_order = check_str($_POST["clip_order"]);

//sql update
$sql = "update v_clip_library set ";
$sql .= "clip_name = '$clip_name', ";
$sql .= "clip_folder = '$clip_folder', ";
$sql .= "clip_text_start = '$clip_text_start', ";
$sql .= "clip_text_end = '$clip_text_end', ";
$sql .= "clip_desc = '$clip_desc', ";
$sql .= "clip_order = '$clip_order' ";
$sql .= "where id = '$id' ";
$count = $db->exec(check_sql($sql));
//echo "Affected Rows: ".$count;


//edit: make sure the meta redirect url is correct
require_once "header.php";
echo "<meta http-equiv=\"refresh\" content=\"1;url=clipoptions.php\">\n";
echo "Update Complete";
require_once "footer.php";
return;
$clip_uuid = check_str($_POST["id"]);
$clip_name = check_str($_POST["clip_name"]);
$clip_folder = check_str($_POST["clip_folder"]);
$clip_text_start = check_str($_POST["clip_text_start"]);
$clip_text_end = check_str($_POST["clip_text_end"]);
$clip_desc = check_str($_POST["clip_desc"]);
$clip_order = check_str($_POST["clip_order"]);

//sql update
$sql = "update v_clips set ";
$sql .= "clip_name = '$clip_name', ";
$sql .= "clip_folder = '$clip_folder', ";
$sql .= "clip_text_start = '$clip_text_start', ";
$sql .= "clip_text_end = '$clip_text_end', ";
$sql .= "clip_desc = '$clip_desc', ";
$sql .= "clip_order = '$clip_order' ";
$sql .= "where clip_uuid = '$clip_uuid' ";
$count = $db->exec(check_sql($sql));
//echo "affected rows: ".$count;

//redirect the browser
require_once "header.php";
echo "<meta http-equiv=\"refresh\" content=\"1;url=clipoptions.php\">\n";
echo "Update Complete";
require_once "footer.php";
return;
}
else {
//get data from the db
$id = $_GET["id"];

$sql = "";
$sql .= "select * from v_clip_library ";
$sql .= "where id = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$clip_name = $row["clip_name"];
$clip_folder = $row["clip_folder"];
$clip_text_start = $row["clip_text_start"];
$clip_text_end = $row["clip_text_end"];
$clip_desc = $row["clip_desc"];
$clip_order = $row["clip_order"];
break; //limit to 1 row
}
echo "</table>";
echo "<div>";}

require_once "header.php";
echo "<div align='left'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";

echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";

echo "<form method='post' action=''>";
echo "<table border='0' width='100%'>";
echo " <tr>";
echo " <td>Name:</td>";
echo " <td><input type='text' class='txt' name='clip_name' value='$clip_name'></td>";
echo " </tr>";

echo " <tr>";
echo " <td>Folder:</td>";
echo " <td><input type='text' class='txt' name='clip_folder' value='$clip_folder'></td>";
echo " </tr>";

echo " <tr>";
echo " <td colspan='2'>Before Selection:<br>";
echo " <textarea class='txt' name='clip_text_start'>$clip_text_start</textarea>";
echo " </td>";
echo " </tr>";

echo " <tr>";
echo " <td colspan='2'>After Selection:<br>";
echo " <textarea class='txt' name='clip_text_end'>$clip_text_end</textarea>";
echo " </td>";
echo " </tr>";

echo " <tr>";
echo " <td colspan='2'>Notes:<br>";
echo " <textarea class='txt' name='clip_desc'>$clip_desc</textarea>";
echo " </td>";
echo " </tr>";


echo " <tr>";
echo " <td colspan='2' align='right'>";
echo " <input type='hidden' name='id' value='$id'>";
echo " <input type='submit' name='submit' value='Update'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";


echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";


require_once "footer.php";
?>
//get the uuid from http values
$clip_uuid = check_str($_GET["id"]);

//get the clip
$sql = "select * from v_clips ";
$sql .= "where clip_uuid = '$clip_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$clip_name = $row["clip_name"];
$clip_folder = $row["clip_folder"];
$clip_text_start = $row["clip_text_start"];
$clip_text_end = $row["clip_text_end"];
$clip_desc = $row["clip_desc"];
$clip_order = $row["clip_order"];
break; //limit to 1 row
}
}

//show the content
require_once "header.php";
echo "<div align='left'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";

echo "<form method='post' action=''>";
echo "<table border='0' width='100%'>";
echo " <tr>";
echo " <td>Name:</td>";
echo " <td><input type='text' class='txt' name='clip_name' value='$clip_name'></td>";
echo " </tr>";

echo " <tr>";
echo " <td>Folder:</td>";
echo " <td><input type='text' class='txt' name='clip_folder' value='$clip_folder'></td>";
echo " </tr>";

echo " <tr>";
echo " <td colspan='2'>Before Selection:<br>";
echo " <textarea class='txt' name='clip_text_start'>$clip_text_start</textarea>";
echo " </td>";
echo " </tr>";

echo " <tr>";
echo " <td colspan='2'>After Selection:<br>";
echo " <textarea class='txt' name='clip_text_end'>$clip_text_end</textarea>";
echo " </td>";
echo " </tr>";

echo " <tr>";
echo " <td colspan='2'>Notes:<br>";
echo " <textarea class='txt' name='clip_desc'>$clip_desc</textarea>";
echo " </td>";
echo " </tr>";

echo " <tr>";
echo " <td colspan='2' align='right'>";
echo " <input type='hidden' name='id' value='$clip_uuid'>";
echo " <input type='submit' name='submit' value='Update'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";

echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";

require_once "footer.php";
?>

This file was deleted.

@@ -33,58 +33,53 @@
echo "access denied";
exit;
}
require_once "config.php";

$folder = $_GET["folder"];
$folder = str_replace ("\\", "/", $folder);
if (substr($folder, -1) != "/") { $folder = $folder.'/'; }
$file = $_GET["file"];

//echo $folder.$file;

if (strlen($folder) > 0 && strlen($file) > 0) {
unlink($folder.$file);
header("Location: fileoptions.php");
unlink($folder.$file);
header("Location: fileoptions.php");
}
else {//display form

require_once "header.php";
echo "<br>";
echo "<div align='left'>";
echo "<form method='get' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Path:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$folder.$file."</td>";
echo " </tr>";
echo "</table>";

echo "<br />";

echo "<table>";
echo " <tr>";
echo " <td>File Name:</td>";
echo " </tr>";

echo " <tr>";
echo " <td><input type='text' name='file' value=''></td>";
echo " </tr>";

echo " <tr>";
echo " <td colspan='1' align='right'>";
echo " <input type='hidden' name='folder' value='$folder'>";
echo " <input type='submit' value='New File'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo "</div>";

require_once "footer.php";
require_once "header.php";
echo "<br>";
echo "<div align='left'>";
echo "<form method='get' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Path:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$folder.$file."</td>";
echo " </tr>";
echo "</table>";

}
echo "<br />";

echo "<table>";
echo " <tr>";
echo " <td>File Name:</td>";
echo " </tr>";

echo " <tr>";
echo " <td><input type='text' name='file' value=''></td>";
echo " </tr>";

echo " <tr>";
echo " <td colspan='1' align='right'>";
echo " <input type='hidden' name='folder' value='$folder'>";
echo " <input type='submit' value='New File'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo "</div>";

require_once "footer.php";
}

?>
@@ -33,7 +33,6 @@
echo "access denied";
exit;
}
require_once "config.php";
require_once "header.php";

function isfile($filename) {
@@ -49,7 +48,6 @@ function space($count) {
return $r;
}


function recur_dir($dir) {
clearstatcache();
$htmldirlist = '';
@@ -121,7 +119,6 @@ function recur_dir($dir) {
return $htmldirlist ."\n". $htmlfilelist;
}


echo "<script type=\"text/javascript\" language=\"javascript\">\n";
echo " function makeRequest(url, strpost) {\n";
//echo " alert(url); \n";
@@ -224,11 +221,8 @@ function recur_dir($dir) {
echo "}\n";
echo "</SCRIPT>";



echo "<div align='center' valign='1'>";
echo "<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='2'>\n";

echo "<tr class='border'>\n";
echo " <td align=\"left\" valign='top' nowrap>\n";
//echo " <br>";
@@ -274,7 +268,6 @@ function recur_dir($dir) {
echo " </DIV></TD></TR></TABLE>\n";
*/


echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
@@ -39,56 +39,50 @@
if (substr($folder, -1) != "/") { $folder = $folder.'/'; }
$file = $_GET["file"];

//echo $folder.$file;

if (strlen($folder) > 0 && strlen($file) > 0) {

//create new file
$handle = fopen($folder.$file, 'wb') or die("Error!!");
$content = "<?php\n\n?>";
fwrite($handle, $content);
fclose($handle);

header("Location: fileoptions.php");
//create new file
$handle = fopen($folder.$file, 'wb') or die("Error!!");
$content = "<?php\n\n?>";
fwrite($handle, $content);
fclose($handle);
header("Location: fileoptions.php");
}
else {//display form
else {
require_once "header.php";
echo "<br>";
echo "<div align='left'>";
echo "<form method='get' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Path:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$folder.$file."</td>";
echo " </tr>";
echo "</table>";

echo "<br />";

echo "<table>";
echo " <tr>";
echo " <td>File Name:</td>";
echo " </tr>";

require_once "header.php";
echo "<br>";
echo "<div align='left'>";
echo "<form method='get' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Path:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$folder.$file."</td>";
echo " </tr>";
echo "</table>";
echo " <tr>";
echo " <td><input type='text' name='file' value=''></td>";
echo " </tr>";

echo "<br />";

echo "<table>";
echo " <tr>";
echo " <td>File Name:</td>";
echo " </tr>";

echo " <tr>";
echo " <td><input type='text' name='file' value=''></td>";
echo " </tr>";

echo " <tr>";
echo " <td colspan='1' align='right'>";
echo " <input type='hidden' name='folder' value='$folder'>";
echo " <input type='submit' value='New File'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo "</div>";

require_once "footer.php";
echo " <tr>";
echo " <td colspan='1' align='right'>";
echo " <input type='hidden' name='folder' value='$folder'>";
echo " <input type='submit' value='New File'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo "</div>";

require_once "footer.php";
}

?>
@@ -33,7 +33,6 @@
echo "access denied";
exit;
}
require_once "config.php";
require_once "header.php";

$file = $_GET["file"];
@@ -60,27 +59,21 @@

echo "<tr>\n";
echo "<td valign='top' width='200' nowrap>";

echo " <IFRAME SRC='fileoptionslist.php' style='border: solid 1px #CCCCCC; height: 100%; width: 100%;' TITLE=''>\n";
echo " <!-- Clip List: Requires IFRAME support -->\n";
echo " </IFRAME>";

echo "</td>\n";
echo "<td valign='top' style=\"height: 100%;\">";

echo "<div align='left'>";
echo "<table width='100%' class='border'>";

//echo " <tr><td><input type='button' class='btn' name='' onclick=\"window.location='$urlpath'+document.getElementById('folder').value;\" value=' www '></td></tr>\n";

echo " <tr><td><input type='button' class='btn' name='' onclick=\"window.location='filenew.php?folder='+document.getElementById('folder').value;\" value='Add File'></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"window.location='foldernew.php?folder='+document.getElementById('folder').value;\" value='Add Dir'></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"window.location='filerename.php?folder='+document.getElementById('folder').value+'&filename='+document.getElementById('filename').value;\" value='Rename File'></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"if (confirm('Are you sure you want to delete the selected file?')){ window.location='filedelete.php?folder='+document.getElementById('folder').value+'&file='+document.getElementById('filename').value; }\" value='Delete File'></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick=\"if (confirm('Are you sure you want to delete the selected folder?')){ window.location='folderdelete.php?folder='+document.getElementById('folder').value; }\" value='Delete Dir'></td></tr>\n";
echo " <tr><td><br><br><br><br><br></td></tr>\n";
echo " <tr><td><input type='button' class='btn' name='' onclick='javascript:self.close();' value='Close'></td></tr>\n";

echo "</table>";
echo "</div>";

Large diffs are not rendered by default.

@@ -43,59 +43,59 @@


if (strlen($folder) > 0 && strlen($newfilename) > 0) {
//echo "new file: ".$newfilename."<br>";
//echo "folder: ".$folder."<br>";
//echo "orig filename: ".$filename."<br>";;
rename($folder.$filename, $folder.$newfilename);
header("Location: fileoptions.php");
//echo "new file: ".$newfilename."<br>";
//echo "folder: ".$folder."<br>";
//echo "orig filename: ".$filename."<br>";;
rename($folder.$filename, $folder.$newfilename);
header("Location: fileoptions.php");
}
else { //display form

require_once "header.php";
echo "<br>";
echo "<div align='left'>";
echo "<form method='get' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Path:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$folder.$filename."</td>";
echo " </tr>";
echo " <tr>";
echo " <td><br></td>";
echo " </tr>";
echo " <tr>";
echo " <td>Original file name:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$filename."</td>";
echo " </tr>";
echo "</table>";

echo "<br />";

echo "<table>";
echo " <tr>";
echo " <td>Rename file to:</td>";
echo " </tr>";

echo " <tr>";
echo " <td><input type='text' name='newfilename' value=''></td>";
echo " </tr>";

echo " <tr>";
echo " <td colspan='1' align='right'>";
echo " <input type='hidden' name='folder' value='$folder'>";
echo " <input type='hidden' name='filename' value='$filename'>";
echo " <input type='submit' value='Rename File'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo "</div>";

require_once "footer.php";
require_once "header.php";
echo "<br>";
echo "<div align='left'>";
echo "<form method='get' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Path:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$folder.$filename."</td>";
echo " </tr>";
echo " <tr>";
echo " <td><br></td>";
echo " </tr>";
echo " <tr>";
echo " <td>Original file name:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$filename."</td>";
echo " </tr>";
echo "</table>";

echo "<br />";

echo "<table>";
echo " <tr>";
echo " <td>Rename file to:</td>";
echo " </tr>";

echo " <tr>";
echo " <td><input type='text' name='newfilename' value=''></td>";
echo " </tr>";

echo " <tr>";
echo " <td colspan='1' align='right'>";
echo " <input type='hidden' name='folder' value='$folder'>";
echo " <input type='hidden' name='filename' value='$filename'>";
echo " <input type='submit' value='Rename File'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo "</div>";

require_once "footer.php";

}

@@ -41,11 +41,6 @@
$handle = fopen($filename, 'wb') or die("Error!!");
fwrite($handle, $content);
fclose($handle);

//echo "File Saved: \n $filename";
//echo "\n\nContent: $content\n";

echo $content;


?>
@@ -37,8 +37,6 @@
$folder = $_GET["folder"];
$folder = str_replace ("\\", "/", $folder);

//echo $folder;

if (strlen($folder) > 0) {
//delete the folder
rmdir($folder); //, 0700
@@ -33,59 +33,51 @@
echo "access denied";
exit;
}
require_once "config.php";


$folder = $_GET["folder"];
$folder = str_replace ("\\", "/", $folder);
$foldername = $_GET["foldername"];

//echo $folder.$file;

if (strlen($folder) > 0 && strlen($foldername) > 0) {
//create new folder
mkdir($folder.'/'.$foldername); //, 0700
header("Location: fileoptions.php");
}
else { //display form
require_once "header.php";
echo "<br>";
echo "<div align='left'>";
echo "<form method='get' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Path:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$folder."</td>";
echo " </tr>";
echo "</table>";

require_once "header.php";
echo "<br>";
echo "<div align='left'>";
echo "<form method='get' action=''>";
echo "<table>";
echo " <tr>";
echo " <td>Path:</td>";
echo " </tr>";
echo " <tr>";
echo " <td>".$folder."</td>";
echo " </tr>";
echo "</table>";

echo "<br />";

echo "<table>";
echo " <tr>";
echo " <td>Folder Name:</td>";
echo " </tr>";

echo " <tr>";
echo " <td><input type='text' name='foldername' value=''></td>";
echo " </tr>";

echo " <tr>";
echo " <td colspan='1' align='right'>";
echo " <input type='hidden' name='folder' value='$folder'>";
echo " <input type='submit' value='New Folder'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo "</div>";

require_once "footer.php";
echo "<br />";

}
echo "<table>";
echo " <tr>";
echo " <td>Folder Name:</td>";
echo " </tr>";

echo " <tr>";
echo " <td><input type='text' name='foldername' value=''></td>";
echo " </tr>";

echo " <tr>";
echo " <td colspan='1' align='right'>";
echo " <input type='hidden' name='folder' value='$folder'>";
echo " <input type='submit' value='New Folder'>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</form>";
echo "</div>";

require_once "footer.php";
}
?>
@@ -95,7 +95,6 @@
echo "//-->\n";
echo "</style>";


echo "<SCRIPT language=\"JavaScript\">\n";
echo "<!--\n";
echo "function confirmdelete(url)\n";
@@ -111,5 +110,4 @@
echo "<body>";
echo "<div align='center'>";


?>
@@ -31,92 +31,76 @@
echo "access denied";
exit;
}

require_once "admin/edit/config.php";
require_once "admin/edit/header.php";
echo "<div align='left'>";
echo "<table width='175' border='0' cellpadding='0' cellspacing='2'>\n";

echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";


$sql = "";
$sql .= "select * from v_clip_library ";

$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);

$c = 0;
$row_style["0"] = "background-color: #F5F5DC;";
$row_style["1"] = "background-color: #FFFFFF;";

echo "<div align='left'>\n";
echo "<table width='100%' border='0' cellpadding='1' cellspacing='1'>\n";
echo "<tr><td colspan='1'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>";

if ($result_count == 0) { //no results
echo "<tr><td>&nbsp;</td></tr>";
}
else { //received results

echo "<tr>";
//echo "<th nowrap>&nbsp; &nbsp; Id &nbsp;</th>";
echo "<th nowrap>&nbsp; &nbsp; clip_name &nbsp;</th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_folder&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_text_start&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_text_end&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_desc&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_order&nbsp; &nbsp; </th>";
echo "</tr>";
echo "<tr><td colspan='1'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";

foreach($result as $row) {
//print_r( $row );
echo "<tr style='".$row_style[$c]."'>\n";
//echo "<td valign='top'><a href='update.php?id=".$row[id]."'>".$row[id]."</a></td>";
echo "<td valign='top'><a href='/edit/update.php?id=".$row[id]."'>".$row[clip_name]."</a></td>";
//echo "<td valign='top'>".$row[clip_folder]."</td>";
//echo "<td valign='top'>".$row[clip_text_start]."</td>";
//echo "<td valign='top'>".$row[clip_text_end]."</td>";
//echo "<td valign='top'>".$row[clip_desc]."</td>";
//echo "<td valign='top'>".$row[clip_order]."</td>";
echo "</tr>";

echo "<tr><td colspan='1'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach unset($sql, $result, $row_count);



echo "</table>\n";
echo "</div>\n";


//echo " <br><br>";
echo " </td>\n";
echo "</tr>\n";

} //end if results

echo "</table>\n";

echo "<table width='175'><tr><td align='right'>\n";
echo "<input type='button' class='btn' name='' onclick=\"window.location='clipsearch.php'\" value='Search'>&nbsp; &nbsp;\n";
echo "<input type='button' class='btn' name='' onclick=\"window.location='clipadd.php'\" value='Add'>&nbsp; &nbsp;\n";
echo "</td></tr><table>\n";
echo "</div>";

echo "<br><br>";
require_once "admin/edit/footer.php";

unset ($result_count);
unset ($result);
unset ($key);
unset ($val);
unset ($c);

?>
echo "<div align='left'>";
echo "<table width='175' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";

$sql = "select * from v_clips ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);

$c = 0;
$row_style["0"] = "background-color: #F5F5DC;";
$row_style["1"] = "background-color: #FFFFFF;";

echo "<div align='left'>\n";
echo "<table width='100%' border='0' cellpadding='1' cellspacing='1'>\n";
echo "<tr><td colspan='1'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>";

if ($result_count == 0) { //no results
echo "<tr><td>&nbsp;</td></tr>";
}
else { //received results
echo "<tr>";
echo "<th nowrap>&nbsp; &nbsp; clip name &nbsp;</th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_folder&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_text_start&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_text_end&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_desc&nbsp; &nbsp; </th>";
//echo "<th nowrap>&nbsp; &nbsp; clip_order&nbsp; &nbsp; </th>";
echo "</tr>";
echo "<tr><td colspan='1'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";

foreach($result as $row) {
echo "<tr style='".$row_style[$c]."'>\n";
//echo "<td valign='top'><a href='update.php?id=".$row[id]."'>".$row['clip_uuid']."</a></td>";
echo "<td valign='top'><a href='/edit/update.php?id=".$row['clip_uuid']."'>".$row['clip_name']."</a></td>";
//echo "<td valign='top'>".$row[clip_folder]."</td>";
//echo "<td valign='top'>".$row[clip_text_start]."</td>";
//echo "<td valign='top'>".$row[clip_text_end]."</td>";
//echo "<td valign='top'>".$row[clip_desc]."</td>";
//echo "<td valign='top'>".$row[clip_order]."</td>";
echo "</tr>";

echo "<tr><td colspan='1'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach unset($sql, $result, $row_count);
echo "</table>\n";
echo "</div>\n";

echo " </td>\n";
echo "</tr>\n";
} //end if results
echo "</table>\n";

echo "<table width='175'><tr><td align='right'>\n";
echo "<input type='button' class='btn' name='' onclick=\"window.location='clipsearch.php'\" value='Search'>&nbsp; &nbsp;\n";
echo "<input type='button' class='btn' name='' onclick=\"window.location='clipadd.php'\" value='Add'>&nbsp; &nbsp;\n";
echo "</td></tr><table>\n";
echo "</div>";

echo "<br><br>";
require_once "admin/edit/footer.php";

unset ($result_count);
unset ($result);
unset ($key);
unset ($val);
unset ($c);

?>