| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <?php include_once('pdqconnect.inc'); ?>
- <html>
- <head>
- <script src="jquery.min.js"></script>
- <script>$(document).ready(function(){ // jquery stuff in here
- Reload();
- setInterval(function(){
- if(dontreload==0){
- Reload();
- }
- },60000); // 1000 = 1 second
- $( "#messages" ).focusout(function() {
- var newData=$(this).html();
- billsMessage(newData);
- $(this).attr("contenteditable", "false");
- $(this).css("background-color", "orange");
- })
- $( "#messages" ).dblclick(function() {
- dontreload=1;
- globalOldData = $(this).html();
- if($(this).attr("contenteditable")=="true"){
- return;
- } else {
- $(this).css("background-color", "yellow");
- $(this).attr("contenteditable", "true");
-
- }
- })
-
- })</script>
- <script>
- function billsMessage(newmessage){
- var sendMe = 'newmessage=' + encodeURIComponent(newmessage);
- $.post("bin/PDQmessage.php",sendMe,
- function(data,status){
- dontreload=0;
- if(data=='Success' ){
- $("#messages").css("background-color", '');
- } else {
- $("#messages").css("background-color", 'red');
- alert("error: " + data);
- }
- }
- );
- }
- var globalOldData;
- var dontreload=0;
- function sendUpdates(subKID, column, current, callingObject){
- var sendMe = "subKID=" + encodeURIComponent(subKID) + "&column=" + encodeURIComponent(column)+ "¤t=" + encodeURIComponent(current);
- $.post("bin/PDQacknowledge.php",sendMe,
- function(data,status){
- dontreload=0;
- if(data=="Success" ){
- $(callingObject).html("");
- $(callingObject).css("background-color", "");
- Reload();
- } else {
- $(callingObject).css("background-color", "red");
- alert("error: " + data);
- }
- }
- );
- }
- function Reload(){
- $.get( "bin/billstable.php", function( data ) {
- $( "#billstable" ).html( data );
- $( ".updatableDiv" ).dblclick(function() {
- //alert('wh');
- //dontreload=1;
- globalOldData = $(this).html();
- var subKID=$(this).attr("data-subkid");
- var column=$(this).attr("data-column");
- sendUpdates(subKID, column, $(this).html(), this);
- $(this).css("background-color", "orange");
- })
-
- // put current time in caption
- var currentdate = new Date();
- var datetime = "Last Sync: " + (currentdate.getMonth()+1) + "/" + currentdate.getDate() + " : " +currentdate.getHours() + ":" + currentdate.getMinutes();
- $("#tableCap").html(datetime);
- $("#tableCap").css("font-size","26pt");
- });
- }
- </script>
- <style>
- #messages{
- font-size:24px;
- min-height:20px;
- border:1px solid;
- }
- body{
- margin-left:5%;
- }
- .smaller{
- font-size:18pt;
- }
- .right{
- text-align:right;
- }
- .center{
- text-align:center;
- }
- .tc{
- display:table-cell;
- padding-left:25px;
- font-size:16pt;
- }
- th{
- padding-left:25px;
- padding-right:25px;
- font-size:30pt;
- }
- td{
- padding-left:25px;
- padding-right:25px;
- font-size:30pt;
- }
- tr:hover{
- background-color:rgba(49,13,84,.08);
- }
- .colorRow{
- background-color:rgba(49,13,84,.08);
- }
- .rjust{
- text-align:right;
- }
- .smalltext{
- font-size:10pt;
- }
- </style>
- </head>
- <body>
- <div id='messages' contenteditable="False" >
- <?php
- $sql = "select message from PDQMessage where PDQMid=0";
- $rs=mysqli_query($mydb,$sql) or die(mysqli_error());
- $row=mysqli_fetch_assoc($rs);
- echo $row['message'];
- ?>
- </div>
- <div id='billstable'>
- </div>
- </body>
- </html>
|