diff options
author | Britney Fransen <brfransen@gmail.com> | 2023-01-13 20:26:17 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2023-01-13 20:26:17 (GMT) |
commit | 006fb5a9dd30bdbfcf47b599c489fa51da289b8d (patch) | |
tree | b7f0c40a828884a27d12285bef53fa7b82555b79 /linhes/linhes-web/website/contents/calllog.py | |
parent | 25b6fc226dd86c5a42d577a52b44ceb3d3926507 (diff) | |
download | linhes_pkgbuild-006fb5a9dd30bdbfcf47b599c489fa51da289b8d.zip linhes_pkgbuild-006fb5a9dd30bdbfcf47b599c489fa51da289b8d.tar.gz linhes_pkgbuild-006fb5a9dd30bdbfcf47b599c489fa51da289b8d.tar.bz2 |
linhes-web: cleanup for lh 9
Diffstat (limited to 'linhes/linhes-web/website/contents/calllog.py')
-rw-r--r-- | linhes/linhes-web/website/contents/calllog.py | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/linhes/linhes-web/website/contents/calllog.py b/linhes/linhes-web/website/contents/calllog.py deleted file mode 100644 index 0b2fb22..0000000 --- a/linhes/linhes-web/website/contents/calllog.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/python2 -# import MySQL module - -import MySQLdb -import sys -import getopt -import socket - - -def main(argv): - grandtotal=0 - grandtotal_current=0 - db = MySQLdb.connect(host="localhost", user="mythtv", passwd="mythtv", db="ncid") - # create a cursor - cursor = db.cursor() - # execute SQL statement - # cursor.execute("select name,number,count(number) as '# calls' from cid group by number,name order by '# calls' DESC limit 20;") - # result = cursor.fetchall() - - - #Top 20 callers - #print '<div id="content"> <p></p>' - print '<div> <p></p>' - print '<table class="calllog">' - print "Top 20 callers" - searchstring='''<td> <a href="http://www.google.com/search?q=%s" target="_blank" > %s </a> </td> ''' - cursor.execute("select name,number,count(number) from cid group by number,name order by count(number) DESC limit 20;") - result = cursor.fetchall() - for row in result: - print " <tr>" - #print " <td>",row[0],"</td>" - print searchstring % (row[0], row [0]) - print " <td>",row[2],"</td>" - #print " <td>",row[1],"</td>" - print searchstring % (row[1], row [1]) - print " </tr>" - #print "%40s %26s %10s" %(row[0],row[2],row[1]) - print "</table>" - print "</div>" - - - #last 20 calls - print '<br>' - print '<br>' - #print '<div id="content"> <p></p>' - print '<div> <p></p>' - print '<table class="calllog">' - print "Last 20 calls" - print '<br>' - cursor.execute("select date,time,name,number from cid order by date(ts) DESC ,time DESC limit 20 ;" ) - result = cursor.fetchall() - for row in result: - print " <tr>" - print " <td> %s </td>" %(row[0]) - print " <td>",row[1],"</td>" - #print " <td>",row[2],"</td>" - print searchstring % (row[2], row [2]) - #print " <td>",row[3],"</td>" - print searchstring % (row[3], row [3]) - print " </tr>" -# print "%26s %26s %26s %26s " %(row[0],row[1],row[2],row[3]) - print "</table>" - print "</div>" - -if __name__ == "__main__": - main(sys.argv[1:]) |