| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <?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();
- }
- },120000); // 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>
- var globalOldData;
- var dontreload=0;
- function Reload(){
- $.get( "bin/ICGstable.php", function( data ) {
- $( "#billstable" ).html( data );
-
- $( ".updatableDiv" ).focusout(function() {
- var subKID=$(this).attr("data-subKID");
- var newData=$(this).html();
- var column=$(this).attr("data-column");
- if($(this).html()==globalOldData){
- $(this).css("background-color", "");
- $(this).attr("contenteditable", "false");
- dontreload=0;
- } else {
- sendUpdates(subKID, newData, column, this);
- $(this).attr("contenteditable", "false");
- $(this).css("background-color", "orange");
- }
- })
- $( ".updatableDiv" ).dblclick(function() {
- dontreload=1;
- globalOldData = $(this).html();
- if($(this).attr("contenteditable")=="true"){
- return;
- } else {
- $(this).css("background-color", "yellow");
- $(this).attr("contenteditable", "true");
-
- }
- })
- $( ".updateStatus" ).dblclick(function() {
- dontreload=1;
- var column=$(this).attr("data-column");
- var subKID=$(this).attr("data-subKID");
- sendUpdates(subKID, $(this).html(), column, this);
- })
- })
- }
- 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);
- }
- }
- );
- }
- function sendUpdates(subKID, newData, column, callingObject){
- var sendMe = 'subKID=' + encodeURIComponent(subKID) + '&newData=' + encodeURIComponent(newData) + '&column=' + encodeURIComponent(column);
- $.post("bin/PDQUpdates.php",sendMe,
- function(data,status){
- dontreload=0;
-
- if(data=='Success' ){
- $(callingObject).css("background-color", '');
- } else {
- $(callingObject).css("background-color", 'red');
- alert("error: " + data);
- }
- if(column=="subKstatus"){Reload();}
- }
- );
- }
- </script>
- <style>
- #messages{
- min-height:30px;
- font-size:18pt;
- 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($mydb));
- $row=mysqli_fetch_assoc($rs);
- echo $row['message'];
- ?>
- </div>
- <div>
- <button onclick="location.href='bin/PDQAddOne.php'">Add One</button>
- </div>
- <div id='billstable'>
- </div>
- </body>
- </html>
|