<?php
    global $vis_language;
    $count=count($tweets->statuses); ?><div id="vis_twitter_list">
<div class="vis_main_window vis_shadow vis_round_corner">
    <div class="vis_main_header"><?= $title ?></div>
    <div class="vis_main_window_content vis_round_corner">
        <form id="vis_ticket_tweet_form"><table width="100%" cellspacing="3" cellpadding="3">
            <tr><td><input name="vis_query" id="vis_query" class="vis_input" value="<?= $content ?>" /></td><td width="50"><span class="vis_button" onclick="$('#vis_twitter_list').visExecution('load_operations',{'vis_module':'ticket', 'vis_operation':'search_media', 'vis_form':'vis_ticket_tweet_form'})"><? echo $vis_language['TXTSEARCH']; ?></span></td></tr>
        </table><input type="hidden" name="vis_domain" id="vis_domain" value="<?= $operation['vis_domain_id']; ?>" /></form>
        <div class="vis_seperator_horizontal"></div>
    <table cellpadding="5" cellspacing="5" width="100%"><?
    for($i=0;$i<$count;$i++) { ?>
        <tr><td width="120"><span class="vis_button" onclick="$(this).visInterface('load_dialog', {'vis_module':'ticket', 'vis_operation':'new_ticket_step_one', 'vis_static_area':'vis_open_new_dialog', 'vis_channel_id':4, 'vis_tweet_details':'<?= base64_encode(serialize($tweets->statuses[$i])) ?>' })"><?= $vis_language['TXTCONVEERTTKT'] ?></span></td><td><?= '<a target="_blank" href="http://twitter.com/'.$tweets->statuses[$i]->from_user.'">'.$tweets->statuses[$i]->from_user_name.'</a>: '.$tweets->statuses[$i]->text ?></td></tr> <? //vis_submit_tweet_ticket('<?= base64_encode(serialize($tweets->results[$i]))
    } ?>
    </table>
    </div>
</div>
<script>
    function vis_submit_tweet_ticket(tweet) {
        $(this).visInterface('load_dialog', {'vis_module':'ticket', 'vis_operation':'new_ticket_step_one', 'vis_static_area':'vis_open_new_dialog', 'vis_channel_id':4, 'vis_tweet_details':tweet });
        //$('#vis_workpanel_div').visExecution('load_module','<? echo $vis_language['TXTOPENNEWTICKETS']; ?>', {'vis_module':'ticket','vis_operation':'new_ticket', 'cache':true, 'department_id': $('#vis_department_new').val(), 'channel_id': 4<? if(isset($client) && $client!=-1) echo ", 'vis_client_id': ".$client['client_id']; ?>, 'vis_tweet_details':tweet});
    }
</script></div>