{extends file="layout.html"}
{block name=title}LMS: {$layout.pagetitle|striphtml}{/block}
{block name=module_content}
<!--// $Id$ //-->
<script>

    function PrintList() {
        document.voipaccountsearch.action = "?m=voipaccountsearch&search=1&print=1";
        document.voipaccountsearch.target = "_BLANK";
        document.voipaccountsearch.submit();
    }

    function Search() {
        document.voipaccountsearch.action = "?m=voipaccountsearch&search=1";
        document.voipaccountsearch.target = "";
        document.voipaccountsearch.submit();
    }

</script>
<h1>{$layout.pagetitle}</h1>
<form method="post" action="?m=voipaccountsearch&amp;search" name="voipaccountsearch">
    <input type="submit" class="hiddenbtn">
    <input type="hidden" name="m" value="voipaccountsearch">
    <table class="lmsbox">
        <colgroup>
            <col style="width: 1%;"/>
            <col style="width: 99%;"/>
        </colgroup>
        <thead>
            <tr>
                <td colspan="2">
                    <strong>{trans("Find VoIP accounts matching the following search criteria:")}</strong>
                </td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="bold nobr">
                    {icon name="login"}
                    <strong>{trans("Login")}</strong>
                </td>
                <td>
                    <input type="text" name="search[login]" {tip text="Enter login or it's fragment"}>
                </td>
            </tr>
            <tr>
                <td class="nobr">
                    {icon name="password"}
                    <strong>{trans("Password")}</strong>
                </td>
                <td>
                    <input type="text" name="search[password]" {tip text="Enter password or it's fragment"}>
                </td>
            </tr>
            <tr>
                <td class="nobr">
                    {icon name="phone"}
                    <strong>{trans("Phone number")}</strong>
                </td>
                <td>
                    <input type="tel" name="search[phone]" {tip text="Enter phone number or it's fragment"}>
                </td>
            </tr>
            <tr>
                <td class="nobr">
                    {icon name="service"}
                    <strong>{trans("Service provider")}</strong>
                </td>
                <td>
                    <select name="search[serviceproviderid]">
                        <option value="">{trans("— all —")}</option>
                        {foreach $serviceproviders as $serviceprovider}
                            <option value="{$serviceprovider.id}">{$serviceprovider.name|escape}</option>
                        {/foreach}
                    </select>
                </td>
            </tr>
            <tr>
                <td class="nobr">
                    {icon name="operator"}
                    <strong>{trans("Qualification operator")}</strong>
                </td>
                <td>
                    <label>
                        <input class="radio light" type="radio" value="AND" name="k"{if $k != 'OR'} checked{/if}>
                        {trans("and")}
                    </label>
                    <label>
                        <input class="radio light" type="radio" value="OR" name="k"{if $k == 'OR'} checked{/if}>
                        {trans("or")}
                    </label>
                </td>
            </tr>
            <tr>
                <td class="lms-ui-box-buttons" colspan="2">
                    {button icon="search" label="Search" onclick="Search()"}
                    {button icon="print" label="Print"  onclick="PrintList()"}
                </td>
            </tr>
        </tbody>
    </table>
</form>
<script>

	$(function() {
		$('form[name="voipaccountsearch"] [name="search[login]"]').focus();
	});

</script>
{/block}
