예제 #1
0
                    filename=dirname+'/indexpage.log')
        
form_data = cgi.FieldStorage() 
if 'position' in form_data:
    position = form_data['position']
    results = get_results(sql)
    if results:
        for each in results:
            apname = each[0]
            pircurl= each[1]
            loadurl= each[2]
            types = each[3]
            position = each[4]    
    print(yate.do_table_head())
    print(yate.sub_table(apname,pircurl,loadurl,types))    
    print(yate.do_table_end('indexedit.py'))

if 'apname' in form_data and 'picurl'in form_data and 'loadurl' in form_data and types in form_data and position in form_data:
    apname = form_data['apname']
    pircurl= form_data['picurl']
    loadurl= form_data['loadurl']
    types = form_data['types']
    position = form_data['position'] 
    print(yate.do_table_head())
    print(yate.do_table(key, cn, si, sp, ss))
    print(yate.do_table_end(myapp))
    print('update success!!!')



    
예제 #2
0
info1 = """from tvs_channel,live_channel,live_server,live_url,live_status where tvs_channel.chid=live_channel.chid and """
info2 = """live_status.statusid=live_channel.statusid and live_url.live_urlid=live_channel.live_urlid and live_url.serverid = live_server.serverid """
info3 = """and live_url.status=0 order by live_channel.chid ASC"""

message = info + info1 + info2+info3
#print message
#newms = """select live_channel.chid,tvs_channel.chname,live_status.sname,live_url.live_path from tvs_channel,live_channel,live_status,live_url """
#newms = newms + """where tvs_channel.chid=live_channel.chid and live_status.statusid=live_channel.statusid and """
#newms = newms + """live_channel.live_urlid is null and live_url.chid=live_channel.chid order by live_channel.chid """
#print newms
conn = mysql.connect()
cursor = conn.cursor()
cursor.execute(message)
result = cursor.fetchall()
#print result
#cursor.execute(newms)
#nres = cursor.fetchall()
#print 'nres',nres
conn.close()    
#print dics
print(yate.do_table_head())

for array in result:
    #print array[0]
    print(yate.do_table(array[0],array[1].decode('utf-8'),array[2],array[3],array[4].encode('utf-8'))) 
#for array in nres:
    #print(yate.do_table(array[0],array[1].decode('utf-8'),' ',array[3],array[2].encode('utf-8')))
print(yate.do_table_end("edit.py",u'删除'.encode('utf-8'),u'修改'.encode('utf-8')))


예제 #3
0
if not sig and cid:  
    cursor.execute(message)
    conn.commit()
conn.close()


#select form order_list and show in tables
dics = {}
info = """select live_channel.chid,tvs_channel.chname,live_server.live_ip,live_server.storage_addr,live_status.sname """
info1 = """from tvs_channel,live_channel,live_server,live_status where tvs_channel.chid=live_channel.chid and """
info2 = """live_status.status=live_channel.statusid and live_server.chid=live_channel.chid order by tvs_channel.chid ASC """

message = info + info1 + info2
#print message

conn = mysql.connect()
cursor = conn.cursor()
cursor.execute(message)
result = cursor.fetchall()
conn.close()    
#print dics
print(yate.start_form('edit.py'))
print(yate.do_table_head())

for array in result:
    #print array[0]
    print(yate.do_table(array[0],array[1],array[2],array[3],array[4]))    
print(yate.do_table_end())