<div class="postbox">
    <div class="inside">
        <form method="POST" action="options.php">
            <?php settings_fields( 'wpcfe_settings_group' ); ?>
            <?php do_settings_sections( 'wpcfe_settings_group' ); ?>
            <table class="form-table">
                <tr>
                    <th><?php esc_html_e('Disable Create Order', 'wpcargo-frontend-manager' ); ?></th>
                    <td>
                        <input type="checkbox" name="wpcfe_add_shipment_deactivated" value="1" <?php echo checked( $add_shipment_deactivated, 1 ) ?>>
                        <p class="description"><?php esc_html_e('Note: This will remove the Create Shipment functionality in the front-end dashboard.', 'wpcargo-frontend-manager' ); ?></p>
                    </td>
                </tr>
                <tr>
                    <th><?php esc_html_e('Allow Employee Access all Shipment?', 'wpcargo-frontend-manager' ); ?></th>
                    <td>
                        <input type="checkbox" name="wpcfe_employee_all_access" value="1" <?php echo checked( $wpcfe_employee_all_access, 1 ) ?>>
                        <p class="description"><?php esc_html_e('Note: This will allow wpcargo employee access all the shipment.', 'wpcargo-frontend-manager' ); ?></p>
                    </td>
                </tr>
                <tr>
                    <th><?php esc_html_e('Allow Client to Add Shipment?', 'wpcargo-frontend-manager' ); ?></th>
                    <td>
                        <input type="checkbox" name="wpcfe_client_can_add_shipment" value="1" <?php echo checked( $wpcfe_client_can_add_shipment, 1 ) ?>>
                        <p class="description"><?php esc_html_e('Note: This will allow wpcargo client to add shipment in the dashboard page.', 'wpcargo-frontend-manager' ); ?></p>
                    </td>
                </tr>
                <tr>
                    <th><?php esc_html_e('Set default shipment status', 'wpcargo-frontend-manager' ); ?></th>
                    <td>
                        <?php
                        if( !empty($status) ){
                            ?><select id="wpfe-admin" name="wpcfe_default_status" class="wpcfe-select" style="width:360px;"><?php
                                ?><option value=""><?php esc_html_e('Select Status', 'wpcargo-frontend-manager' ); ?></option><?php
                                foreach ( $status as $stat ) {
									?><option value="<?php echo $stat; ?>" <?php echo selected( $wpcfe_default_status, $stat ); ?>><?php echo $stat; ?></option><?php
							    }
                            ?></select><?php
                        }else{
                            esc_html_e('NO Status found.', 'wpcargo-frontend-manager' );
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <th><?php esc_html_e('Set Page as Frontend Dashboard admin', 'wpcargo-frontend-manager' ); ?></th>
                    <td>
                        <?php
                        if( !empty($pages) ){
                            ?><select id="wpfe-admin" name="wpcfe_admin" class="wpcfe-select" style="width:360px;"><?php
                                ?><option value=""><?php esc_html_e('Select Page', 'wpcargo-frontend-manager' ); ?></option><?php
                                foreach ( $pages as $page ) {
									?><option value="<?php echo $page->ID; ?>" <?php echo selected( $wpcfe_admin, $page->ID ); ?>><?php echo $page->post_title; ?></option><?php
							    }
                            ?></select><?php
                        }else{
                            esc_html_e('NO pages found.', 'wpcargo-frontend-manager' );
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <th><?php esc_html_e('Access Frontend Dashboard Roles', 'wpcargo-frontend-manager' ); ?></th>
                    <td>
                        <select class="wpcfe-select" name="wpcfe_access_dashboard_role[]" multiple="multiple" style="width:360px;">
                            <?php
                            if( !empty( $roles ) ){
                                foreach ($roles as $_key => $_value) {
                                    ?><option value="<?php echo $_key; ?>" <?php echo in_array( $_key, $access_dashboard_role ) ? 'selected' : '' ; ?>><?php echo $_value; ?></option><?php
                                }
                            }
                            ?>
                        </select>
                        <p class="description"><?php esc_html_e('Note: This options applicable only in front end dashboard.', 'wpcargo-frontend-manager'); ?></p>
                    </td>
                </tr>
                <tr>
                    <th><?php esc_html_e('Update Shipments Roles', 'wpcargo-frontend-manager' ); ?></th>
                    <td>
                        <select class="wpcfe-select" name="wpcfe_update_shipment_role[]" multiple="multiple" style="width:360px;">
                            <?php
                            if( !empty( $roles ) ){
                                foreach ($roles as $_key => $_value) {
                                    ?><option value="<?php echo $_key; ?>" <?php echo in_array( $_key, $update_shipment_role ) ? 'selected' : '' ; ?>><?php echo $_value; ?></option><?php
                                }
                            }
                            ?>
                        </select>
                        <p class="description"><?php esc_html_e('Note: This options applicable only in front end dashboard.', 'wpcargo-frontend-manager'); ?></p>
                    </td>
                </tr>
                <tr>
                    <th><?php esc_html_e('Delete Shipments Roles', 'wpcargo-frontend-manager'); ?></th>
                    <td>
                        <select class="wpcfe-select" name="wpcfe_delete_shipment_role[]" multiple="multiple" style="width:360px;">
                            <?php
                            if( !empty( $roles ) ){
                                foreach ($roles as $_key => $_value) {
                                    ?><option value="<?php echo $_key; ?>" <?php echo in_array( $_key, $delete_shipment_role ) ? 'selected' : '' ; ?>><?php echo $_value; ?></option><?php
                                }
                            }
                            ?>
                        </select>
                        <p class="description"><?php esc_html_e('Note: This options applicable only in front end dashboard.', 'wpcargo-frontend-manager'); ?></p>
                    </td>
                </tr>
                <tr>
                    <th><?php esc_html_e('Enable Chinese Fonts', 'wpcargo-frontend-manager' ); ?></th>
                    <td>
                        <input type="checkbox" name="wpcfe_customfont_enable" value="1" <?php echo checked( wpcfe_customfont_enable(), 1 ) ?>>
                        <p class="description"><?php esc_html_e('Note: This will add additional font family for simplified chinese fonts. Enable this option only if you use simplified chinese fonts in you site.', 'wpcargo-frontend-manager' ); ?></p>
                    </td>
                </tr>
                <tr>
                    <th><?php esc_html_e('Enable Print BOL', 'wpcargo-frontend-manager' ); ?></th>
                    <td>
                        <input type="checkbox" name="wpcfe_bol_enable" value="1" <?php echo checked( wpcfe_bol_enable(), 1 ) ?>>
                        <p class="description"><?php esc_html_e('Note: This will add additional print functionality for BOL.', 'wpcargo-frontend-manager' ); ?></p>
                    </td>
                </tr>
                <tr>
                    <th><?php esc_html_e('Waybill Paper Size', 'wpcargo-frontend-manager'); ?></th>
                    <td>
                        <select name="wpcfe_waybill_paper_size" style="width:360px;">
                            <option value=""><?php esc_html_e('Select Size', 'wpcargo-frontend-manager'); ?></option>
                            <option value="a1" <?php selected( $wpcfe_waybill_paper_size, 'a1'); ?>><?php esc_html_e('A1', 'wpcargo-frontend-manager'); ?></option>
                            <option value="a2" <?php selected( $wpcfe_waybill_paper_size, 'a2'); ?>><?php esc_html_e('A2', 'wpcargo-frontend-manager'); ?></option>
                            <option value="a3" <?php selected( $wpcfe_waybill_paper_size, 'a3'); ?>><?php esc_html_e('A3', 'wpcargo-frontend-manager'); ?></option>
                            <option value="a4" <?php selected( $wpcfe_waybill_paper_size, 'a4'); ?>><?php esc_html_e('A4', 'wpcargo-frontend-manager'); ?></option>
                            <option value="a5" <?php selected( $wpcfe_waybill_paper_size, 'a5'); ?>><?php esc_html_e('A5', 'wpcargo-frontend-manager'); ?></option>
                            <option value="letter" <?php selected( $wpcfe_waybill_paper_size, 'letter'); ?>><?php esc_html_e('Letter', 'wpcargo-frontend-manager'); ?></option>
                            <option value="legal" <?php selected( $wpcfe_waybill_paper_size, 'legal'); ?>><?php esc_html_e('Legal', 'wpcargo-frontend-manager'); ?></option>
                            <option value="tabloid" <?php selected( $wpcfe_waybill_paper_size, 'tabloid'); ?>><?php esc_html_e('Tabloid', 'wpcargo-frontend-manager'); ?></option>
                            <option value="executive" <?php selected( $wpcfe_waybill_paper_size, 'executive'); ?>><?php esc_html_e('Executive', 'wpcargo-frontend-manager'); ?></option>
                            <option value="folio" <?php selected( $wpcfe_waybill_paper_size, 'folio'); ?>><?php esc_html_e('Folio', 'wpcargo-frontend-manager'); ?></option>
                            <option value="tabloid" <?php selected( $wpcfe_waybill_paper_size, 'tabloid'); ?>><?php esc_html_e('Tabloid', 'wpcargo-frontend-manager'); ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th><?php esc_html_e('Waybill Paper Orientation', 'wpcargo-frontend-manager'); ?></th>
                    <td>
                        <select name="wpcfe_waybill_paper_orient" style="width:360px;">
                            <option value=""><?php esc_html_e('Select Orientation', 'wpcargo-frontend-manager'); ?></option>
                            <option value="landscape" <?php selected( $wpcfe_waybill_paper_orient, 'landscape'); ?> ><?php esc_html_e('Landscape', 'wpcargo-frontend-manager'); ?></option>
                            <option value="portrait" <?php selected( $wpcfe_waybill_paper_orient, 'portrait'); ?>><?php esc_html_e('Portrait', 'wpcargo-frontend-manager'); ?></option>
                        </select>
                    </td>
                </tr>
				<?php if ( in_array( 'woocommerce/woocommerce.php', get_option( 'active_plugins' ) ) ) : ?>
					<tr>
						<th><?php esc_html_e('Print documents on checkout', 'wpcargo-frontend-manager'); ?></th>
						<td>
							<?php if( !empty( $wpcfe_print_options ) ): ?>
								<select class="wpcfe-select" name="wpcfe_checkout_print[]" multiple="multiple" style="width:360px;">
									<?php foreach( $wpcfe_print_options as $print_key => $print_label ): ?>
										<option value="<?php echo $print_key?>" <?php echo in_array( $print_key, $wpcfe_print_checkout ) ? 'selected' : '' ; ?>>
											<?php echo $print_label; ?>
										</option>
									<?php endforeach; ?>
								</select>
							<?php endif; ?>
						</td>
					</tr>
				<?php endif; ?>
            </table>
            <?php require_once( WPCFE_PATH.'admin/templates/address-mapping.tpl.php' ); ?>
            <input class="primary button-primary" type="submit" name="submit" value="<?php esc_html_e('Save Settings', 'wpcargo-frontend-manager' ); ?>" />
        </form>
    </div>
</div>