def ft_channels_editFirst(): obj = deal_mysql() msg = ('''SELECT ulv.channel_id,tvs.chname from ulv_genchannels as ulv inner join tvs_channel as tvs on tvs.chid=ulv.channel_id order by ulv.sort_id, ulv.channel_id;''') result = obj.askdata(msg) headers = ["频道名称"] print(yate.start_response()) print(yate.include_header("频道维护")) print(yate.start_form("ft_channels_edit.py")) print(yate.start_table(tb_width="100%", tb_border="1px solid")) print(yate.tb_header(headers)) print(yate.start_row()) print(yate.select('which_chid')) #for array in result: print(yate.select_option(result)) print(yate.end_select()) print(yate.end_row()) print(yate.start_row()) print(yate.end_form("确定")) print(yate.end_row()) print(yate.end_table()) obj.Close()
def genaddress_publish(): # channel_list allchannel = {} allcatagory = {} conn = my_sql.connect() cur = conn.cursor() cur.execute( """select live_url.chid,live_url.live_urlid,tvs_channel.chname from tvs_channel, live_url where tvs_channel.status=0 and live_url.status=0 and live_url.chid=tvs_channel.chid order by tvs_channel.chid""" ) dic = cur.fetchall() apd = "" for each in dic: apd = " ".join([str(each[0]), str(each[1])]) allchannel[apd] = each[2].encode("utf-8") apd = "" # print allchannel # select catagory id cur.execute("""select sort_id,sort_name from live_sort """) catagorydic = cur.fetchall() conn.close() for each in catagorydic: allcatagory[each[0]] = each[1].encode("utf-8") print(yate.start_response()) print(yate.render_publish(urls="edit.py")) # print(yate.start_form("edit.py")) print(yate.select("mix")) print(yate.select_list_new(allchannel)) print(yate.end_select()) print(yate.select("sortid")) print(yate.select_list_new(allcatagory)) print(yate.end_select()) """ print(yate.select('logo')) print(yate.select_list_n(alllogoname)) print(yate.end_select()) """ # print(yate.end_form("add")) print(yate.submit())
def channels_publish(): cmdmsg = ("""SELECT tvs_channel.chid, tvs_channel.chname FROM tvs_channel NATURAL JOIN ulv_genaddress WHERE tvs_channel.`status` <> 1 AND tvs_channel.chid = ulv_genaddress.channel_id order by tvs_channel.chid""") conn = my_sql.connect() cur = conn.cursor() cur.execute(cmdmsg) result = cur.fetchall() msg = ("""select sort_id,sort_name from ulv_sort""") cur.execute(msg) sortinfo = cur.fetchall() conn.close() print(yate.start_response()) print(yate.include_header("上线频道")) print("<p ><b>通过下面的复选框选择要上线的频道</b></p>") print(yate.start_form("ft_channels_publish.py")) print(yate.start_table(tb_width="50%", tb_border="1px solid")) print(yate.start_row()) print("<center>") print(yate.select("channel_id")) print(yate.select_option(result)) print(yate.end_select()) print('</center>') print(yate.end_row()) print(yate.start_row()) print("<center>") print(yate.select("sort_id")) print(yate.select_option(sortinfo)) print(yate.end_select()) print('</center>') print(yate.end_row()) print(yate.start_row()) print(yate.end_form("确定")) print(yate.end_row()) print(yate.end_table())
def channels_collect(): start_response() obj = deal_mysql() msg = ("""SELECT chid,chname from tvs_channel where status=0""") result = obj.askdata(msg) #info = result.pop(0) headers = ["频道信息"] print(yate.include_header("新频道收录")) print(yate.start_form("ft_channels_collectDone.py")) print(yate.start_table(tb_width="50%", tb_border="1px solid")) print(yate.tb_header(headers)) print(yate.start_row()) print(yate.select('which_chid')) print(yate.select_option(result)) print(yate.end_select()) print('<input type="text" name="which_addr" />') print(yate.end_row()) print(yate.start_row()) print(yate.end_form("确定")) print(yate.end_row()) print(yate.end_table()) obj.Close()
for each in logodic: alllogoname[each[0]] = each[1].encode('utf-8') #select catagory id cur.execute("""select sort_id,sort_name from live_sort """) catagorydic = cur.fetchall() allcatagory = {} for each in catagorydic: allcatagory[each[0]] = each[1].encode('utf-8') print(yate.start_response()) print(yate.render_publish()) print(yate.start_form("edit.py")) print(yate.select('cid')) print(yate.select_list_n(allchannel)) print(yate.end_select()) print(yate.select('catagory')) print(yate.select_list_n(allcatagory)) print(yate.end_select()) """ print(yate.select('serverip')) print(yate.select_list_n(allserver)) print(yate.end_select()) print(yate.select('storagepath')) print(yate.select_list_n(allstor_path)) print(yate.end_select())
live_url,tvs_channel where live_url.chid = tvs_channel.chid and (live_url.status is null or live_url.status=1)""") res = cur.fetchall() conn.close() for eachi in res: allstor_path[eachi[0]] = eachi[1] #print(yate.start_response()) print(yate.render_addrpublish(urls="addrpublish.py")) #print(yate.start_form("addrpublish.py")) print(yate.select_addr('cid')) print(yate.select_list_new(allchannel)) print(yate.end_select()) print(yate.select('serverip')) print(yate.select_list_n(allserver)) print(yate.end_select()) #print(yate.select('storagepath')) #print(yate.select_list_new(allstor_path)) #print(yate.end_select()) print(' <td align="center" class="td_bg" width="25%" height="15" id="obj"><input type=text name="storagepath" id="txtHint"></td>') """ print(yate.select('logo')) print(yate.select_list_n(alllogoname)) print(yate.end_select()) """ #print(yate.end_form("add"))
# print allchannel # select catagory id cur.execute("""select sort_id,sort_name from live_sort """) catagorydic = cur.fetchall() conn.close() for each in catagorydic: allcatagory[each[0]] = each[1].encode("utf-8") print(yate.start_response()) print(yate.render_publish(urls="edit.py")) # print(yate.start_form("edit.py")) print(yate.select("mix")) print(yate.select_list_new(allchannel)) print(yate.end_select()) print(yate.select("sortid")) print(yate.select_list_new(allcatagory)) print(yate.end_select()) """ print(yate.select('logo')) print(yate.select_list_n(alllogoname)) print(yate.end_select()) """ # print(yate.end_form("add")) print(yate.submit())
def guidpage_arrange(): spid = get_formData('which_spid') obj = deal_mysql() msg = '''select id,alias from u_items''' results = obj.askdata(msg) nummsg = '''select item_id,position from u_homepage where spid=%s''' % spid[0] homeitem= obj.askdata(nummsg) obj.Close() nobj = deal_mysql('uspset.ini') nmsg = """select name from u_sp where id=%s""" % spid[0] spname = nobj.askdata(nmsg) nobj.Close() #headers = ["频道名称", "频道编号"] print(yate.start_response()) aa = "频道运营" aa.encode('utf-8') print(yate.include_header(aa)) print(yate.start_form("op_guidepage_storage.py")) print(yate.start_table(tb_width="75%", tb_border="1px solid")) print(yate.start_row()) print('<input type="radio" checked="checked" name="which_sp" value="'+(spid[0])+'"/>"'+spname[0][0]+'"') print(yate.end_row()) print(yate.end_table()) print(yate.start_table(tb_width="75%", tb_border="5px solid")) ''' spid has in u_homepage ''' if homeitem !=(): position = dict() for eachItem in homeitem: position.update({eachItem[0]:eachItem[1]}) for i in range(2): print(yate.start_tr()) for iters in range(3): if i == 1: iters = iters + 3 print(yate.start_td()) pos = 'pos'+str(iters) print(yate.select(pos)) for item in results: if item[0] in position.keys() and position[item[0]]==iters+1: print(yate.select_optione_with_selected(item,True)) else: print(yate.select_optione_with_selected(item)) print(yate.end_select()) print(yate.end_td()) print(yate.end_tr()) else: for i in range(2): print(yate.start_tr()) for iters in range(3): if i == 1: iters = iters + 3 print(yate.start_td()) pos = 'pos'+str(iters) print(yate.select(pos)) print(yate.select_option(results)) print(yate.end_select()) print(yate.end_td()) print(yate.end_tr()) print(yate.end_table()) print(yate.start_table(tb_width="75%", tb_border="1px solid")) print(yate.start_row()) print(yate.end_form("确定")) print(yate.end_row()) print(yate.end_table()) print('</body></html>')