<script type="text/javascript"> google.charts.load('current', {'packages':['table']}); google.charts.setOnLoadCallback(drawTable); var datasource = 'https://spreadsheets.google.com/tq?key=rh_6pF1K_XsruwVr_doofvw&pub=1'; var query, options, container; sendAndDraw(); function drawTable() { drawToolbar();
query = new google.visualization.Query(datasource); data = document.getElementById("table"); options = {'pageSize': 10}; var data = new google.visualization.DataTable(); var data = google.visualization.arrayToDataTable([ ['Ticket#','age','Created','Type','Subject','Queue','First Response Time','Solution Time','Sla','Priority','State','Owner'], <?php while($row = pg_fetch_assoc($result)){ echo "['".$row["ticket_number"]."','".$row["age"]."','".$row["create_time"]."','".$row["ticket_type"]."', '".$row["subject"]."', '".$row["queue_name"]."', '".$row["response_time"]."', '".$row["solution_time"]."', '".$row["sla"]."','".$row["ticket_priority"]."','".$row["ticket_state"]."','".$row["ticket_agent"]."'],"; } ?> ]); var table = new google.visualization.Table(document.getElementById('table_div')); table.draw(data, {page: 'enable',pageSize:'10', width: '100%'}); google.visualization.events.addListener(table, 'select', function() { var row = table.getSelection()[0].row; alert('You selected ' + data.getValue(row, 0)); }); /********** function for refresh the page**************/ setTimeout(function(){ window.location.reload(1); }, 30000); } /********** function for refresh the page end**************/ function sendAndDraw() { query.abort(); var tableQueryWrapper = new TableQueryWrapper(query, container, options); tableQueryWrapper.sendAndDraw(); } function setOption(prop, value) { options[prop] = value; sendAndDraw(); } /**********************function for export csv******************/ function drawToolbar() { var components = [ {type: 'csv', datasource: 'https://spreadsheets.google.com/tq?key=rh_6pF1K_XsruwVr_doofvw&pub=1'}, ]; var table_div = document.getElementById('toolbar_div'); google.visualization.drawToolbar(table_div, components); }; /***************function for export csv end*************/ </script> -- *Disclaimer :* The contents of this e-mail and attachment(s) thereto are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or Unotech Software Pvt. Ltd. or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of Unotech Software Pvt. Ltd. or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at https://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/d033ee91-2dea-4fa8-90a0-d112ccae72f9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.