Exemplo n.º 1
0
def info_add():
    start_response()
    #print(yate.start_response('text/plain;charset="UTF-8"'))
    obj = deal_mysql()
    msg = '''select id,comment from u_apptype '''
    items = obj.askdata(msg)
    msgs = '''SELECT ulv.channel_id,tvs.chname 
    from ulv_genchannels as ulv
    inner join tvs_channel as tvs
    on tvs.chid=ulv.channel_id; '''
    channel_items = obj.askdata(msgs)
    obj.Close()
    
    print(yate.render_guidepage_header('首页内容增加','首页内容增加','op_guidepage_infodeal.py','别名'))   
 
    
    print(yate.start_div('types'))
    print("<label for='types'>类型</label>")
    print(yate.start_select_onblur('types','types','setdisabled(this);'))
    print(yate.select_option(items))
    print(yate.end_select())
    print(yate.end_div())
    
    print(yate.render_guidepage_form('类型包名','logo地址'))
    
    print(yate.start_div('channel'))
    #print(yate.para('类型选择了APK请在URL栏输入地址,类型选择了频道请在频道下拉框中选一个相应的频道'))
    print("<label for='channel'>频道</label>")
    print(yate.select_id_name('channel','channel'))
    print(yate.select_option(channel_items))
    print(yate.end_select())
    print(yate.end_div())

    value = '确定' 
    print(yate.rend_guidepage_end(value))
Exemplo n.º 2
0
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()
Exemplo n.º 3
0
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())
Exemplo n.º 4
0
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()  
Exemplo n.º 5
0
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>')