{assign var='title' value=$i.basic_personalappointmentplaner}
{include file='Mobile/r_basic/htmlheader.tpl'}

    <div data-role="page" id="start" data-theme="a">

        <div data-role="header">
            <h1>{$title}</h1>
        </div><!-- /header -->
        
        <div data-role="content">
            
            <form action="{site_url url="mobile/open/mobile_persapp/change/"}" method="post" id="appointform" data-ajax="false">
                {include file='r/hidden.tpl' name="personalapp_edit" default=$personalapp->id}{* What entry do we edit *}
                
                <div data-role="fieldcontain">
                    <label for="personalapp_staff">{$i.personalapp_staff}:<br /></label>
                    {if count($personalapp->multistaff)>=2}
                        <fieldset data-role="controlgroup" disabled="disabled">
                            {foreach from=$personalapp->multistaff item=multistaff}
                                <input type="checkbox" name="checkbox-1" id="checkbox-{$multistaff->staff_id}" disabled="disabled" checked="checked" />
                                <label for="checkbox-{$multistaff->staff_id}">{$multistaff->staff_name|truncate:80:"..."}</label>
                            {/foreach}
                        </fieldset>
                    {else}
                        {include file='r/select-only.tpl' name="personalapp_staff" default=$personalapp->multistaff.0->staff_id
                            noempty=1 filter_extra="required data-native-menu='false'" class="required" 
                            list=$appoint_staff_list id="id" text="staff_name"}
                    {/if}
                </div>
                

                {include file='Mobile/persapp/appoint_edit_only.tpl'}
                
                <hr /><!-- -------------------------------------------------------------------------------------------------------------------- -->
                
                <div data-role="fieldcontain">
                    <label for="personalapp_multistaff">{$i.personalapp_participants}:<br /></label>
                    {foreach from=$personalapp->participants item=participant}
                        <a data-role="button" href="{site_url url="mobile/open/mobile_addrs/item/`$participant->address_id`"}" data-rel="dialog" data-icon="info" data-theme="e" data-transition="pop">
                        {$participant->address_name|truncate:80:"..."}
                        </a>
                    {/foreach}
                </div>
                
                <div data-role="fieldcontain">
                    <label for="personalapp_created_by_id">{$i.personalapp_created_by_id}:</label>
                    <input name="personalapp_created_by_id" id="personalapp_created_by_id" type="text" maxlength=255
                        placeholder="{$i.personalapp_created_by_id}" value="{$personalapp->staff_from_name}" disabled="disabled" />
                </div>
                <div data-role="fieldcontain">
                    <label for="personalapp_created_date">{$i.personalapp_created_date}:</label>
                    <input name="personalapp_created_date" id="personalapp_created_date" type="text" maxlength=255
                       placeholder="{$i.personalapp_created_date}" value="{$personalapp->created_date->us_date()}" disabled="disabled" />
                </div>

                <fieldset data-role="controlgroup" id="appointform_submit">
                    <button data-icon="check" type="submit">{$i.basic_save}</button>

                    <a href="{site_url url="mobile/open/mobile_persapp/index/"}" data-role="button" data-rel="back"
                        data-icon="delete" data-dom-cache="false"
                        data-transition="pop">{$i.basic_cancel}</a>
                </fieldset>
            </form>
        </div><!-- /content -->

    </div><!-- /page -->

{include file='Mobile/r_basic/htmlfooter.tpl'}