{config_load file="lang" section='support'}
{if isset($user_actions_allowed)}
<div id="result_datas" style="display:none">
    <h1>{#support_action_result#}</h1>
    
    <p id="close_ok" style="display:none;" class="success">{#result_support_close_ok#}</p>
    <p id="reply_is_ok" style="display:none;" class="success">{#result_support_admin_reply_ok#}</p>
    <p id="err_req_message_missing" style="display:none;" class="error">{#error_message_missing#}</p>
    <p id="err_req_message" style="display:none;" class="error">{#error_message_format#}</p>
    <p id="err_ticket_id" style="display:none;" class="error">{#error_ticket_id_not_valid#}</p>
    <p id="err_database_update" style="display:none;" class="error">{#error_database_query#}</p>
</div>
{/if}
<div id="details_table">
    <h1>{#support_show#}</h1>
    <table style="width: 720px;">
        <tr>
            <td>{#ticket_date_legend#}</td>
            <td>{$ticket->open_date}</td>
        </tr>
        <tr>
            <td>{#ticket_hosting_legend#}</td>
            <td>
            {if !isset($ticket->hosting_name)}
            {#no_hosting_associated#}
            {else}
            {$ticket->hosting_name}
            {/if}
            </td>
        </tr>
        <tr>
            <td>{#ticket_subject_legend#}</td>
            <td>{$ticket->subject}</td>
        </tr>
        <tr>
            <td>{#ticket_avail_actions#}</td>
            <td>
                <input type="button" style="width: 45%" value="{#mnu_reply_ticket#}" onclick="$('#form_admin_reply_container').slideDown('slow'); $('#details_table').slideUp('slow');" />
                <input type="button" style="width: 45%" value="{#mnu_close_ticket#}" onclick="$('#form_admin_close_container').slideDown('slow'); $('#details_table').slideUp('slow');" />
            </td>
        </tr>
    </table>
</div>
        <div id="form_admin_reply_container" style="display:none">
            <h1>{#mnu_reply_ticket#}</h1>
            <form id="form_admin_reply" action="">
                <table>
                    <tr>
                        <td id="form_msg" title="{#ticket_msg_title#}" style="vertical-align:top;">{#ticket_reply_legend#} :</td>
                        <td>
                            <textarea class="textarea" name="req_message" id="req_message"></textarea>
                            <input type="hidden" name="reply_ticket_id" id="reply_ticket_id" value="{$ticket->id}" />
                        </td>
                    </tr>
                    <tr>
                        <td><input type="button" value="{#button_cancel_legend#}" onclick="$('#form_admin_reply_container').slideUp('slow'); $('#details_table').slideDown('slow');" /></td>
                        <td><input type="button" value="{#button_reply_legend#}" onclick="validateForm('form_admin_reply', 1);" /></td>
                    </tr>
                </table>
            </form>
        </div>
        <div id="form_admin_close_container" style="display:none">
            <h1>{#mnu_close_ticket#}</h1>
            <p>{#support_close_intro#}</p>
            <form id="form_admin_close" action="">
                <input type="hidden" name="close_ticket_id" id="close_ticket_id" value="{$ticket->id}" />
                <input type="button" style="width: 45%" value="{#button_cancel_legend#}" onclick="$('#form_admin_close_container').slideUp('slow'); $('#details_table').slideDown('slow');" /> &nbsp;
                <input type="button" style="width: 45%" value="{#mnu_close_ticket#}" onclick="validateForm('form_admin_close', 1);" />
            </form>
        </div>
<p>{#support_show_intro#}</p>
    <table style="width: 720px;">
		<thead>
			<tr>
				<th>Auteur / Date</th>
				<th>Message</th>
			</tr>
		</thead>
		<tbody id="tbl_admin_ticket_details">
			<tr><td></td><td></td></tr>
		</tbody>
    </table>
	<p class="pageslinks" id="tbl_admin_ticket_details_pg_links"></p>
	{literal}<script type="text/javascript">
		$(document).ready(function () { getPage('tbl_admin_ticket_details',1,{/literal}{$pages_count},1, '{$ticket->id}'{literal}); });
	</script>{/literal}
