<?php
/**
 * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
 *
 * @author Double Bastion LLC
 *
 * @license GNU AGPL version 3 or any later version
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
 *
 * You should have received a copy of the GNU Affero General Public
 * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

declare(strict_types=1);

script('pax_fax', 'sendfax');
style('pax_fax', 'style');

?>

<div id="pax_fax_vbar">

    <div id="currentbaldiv"><a class="providername" href="https://console.phaxio.com/sf_guard_users/sign_in" target="_blank" rel="noreferrer noopener">Phaxio</a> balance:
            <div id="currentbalance"></div>
            <button id="checkbalance" title="Refresh to see the current balance."></button>
    </div>

    <div id="faxnumbersdiv" class="cllridcls">
            <div id="pickid">Set ID:</div>
            <select id="currentfaxnmbrs" class="optselectfxnb">
               <option value="" selected="selected" disabled hidden class="optselectfxnb">click refresh button</option>
            </select>
            <button id="selectcalleridbttn" title="Refresh the list of Sender IDs."></button>
            <div class="fortooltipinit">
                 <div id="infosetid">i</div>
                 <span class="calleridtooltip">The Caller ID is the 'From' number that the receiver sees on the fax that you send. You can leave it blank or you can set as
                       Caller ID one of your Phaxio fax numbers (first refresh the list, then select from the drop-down)
                 </span>
            </div>
    </div>

    <div  class="pfheader">
            Enter the recipient's number as:
    </div>
    <div class="faxnbformat">
            <a id="countryCallCode" href="https://en.wikipedia.org/wiki/List_of_country_calling_codes#Alphabetical_listing_by_country_or_region"
               target="_blank" rel="noreferrer noopener">CountryCallingCode</a><font style="color:#aa2e4b">FaxNumber</font>
    </div>
    <div class="fortooltip">
         <div id="infonumber">i</div>
         <span class="fortooltiptext">
            For example, to send a fax to the German fax number 1212121212, enter 491212121212, where 49 is the country calling code of Germany. (For US the calling
            code is 1, for UK 44, for France 33, etc.) The <a href="https://en.wikipedia.org/wiki/List_of_country_calling_codes#Alphabetical_listing_by_country_or_region"
            target="_blank" rel="noreferrer noopener" style="color:#1b60ba">country calling code</a> must be always included, even if the fax is sent locally. 
            You don't need to add the '+' sign or '00' in front of the number, because the '+' sign will be added automatically. If you want to send the same fax simultaneously 
            to multiple numbers, add them one after the other separated by a comma like this: 497777777777,442222222222 You can send a fax to up to 15 numbers at once.
         </span>
    </div>

    <div id="faxtodiv">
         <input type="text" id="faxto" name="faxto" />
    </div>

    <div class="pfheader">Choose the document(s) that you want to send as fax:</div>
    <div class="fortooltipsec">
          <div id="infoformat">i</div>
          <span class="fortooltiptextsec">
              Supported formats are: pdf, odt, jpeg/jpg, png, txt, tiff/tif, html, doc, docx. You can send up to 20 files with a cumulative size of up to 20 MB and up to 200 pages, in one fax call. (docx and doc files can be sent as fax but cannot be previewed in the adjoining preview pane; docx and doc files should be previewed outside Pax Fax before sending them.)
          </span>
    </div>

    <div id="filestotsize">Total files size:<div id="filessizetext"></div></div>

    <div id="fileuploadednm" class="fileuploadstl"></div>
    <div class="uploadfiledv">
          <form class="uploadflbt"  enctype="multipart/form-data" >
                <div id="uploadFile">Upload a file</div>
                <input id="uploadfileforfax" class="fileupload" name="uploadedtofax[]" type="file" multiple />
                <label for="uploadfileforfax" class="button icon-upload svg" id="uploadfileforfax" </label>
          </form>
    </div>

    <div id="pf_upload_msg"></div>

    <div id="filespickednc" class="filesfromnc"></div>
  
    <div id="pickFromNext">Pick from Nextcloud</div>

    <button id="choosefilen"></button>

    <div id="pf_choose_msg"></div>

    <p class="pickedflnm"></p>

    <input type="submit" id="submitfax" value="Send Fax" />

    <div id="pf_submit_msg"></div>

    <div id="dirbuttons">
       <button id="receivedfaxdir" class="openfaxfolder">Received Faxes</button>
       <button id="sentfaxdir" class="openfaxfolder">Sent Faxes</button>
       <button id="receivedfaileddir" class="openfaxfolder">Failed Received Faxes</button>
       <button id="sentfaileddir" class="openfaxfolder">Failed Sent Faxes</button>
    </div>

</div>
