<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
    <h4 class="tw-mt-0 tw-mb-3 tw-font-semibold tw-text-lg section-heading section-heading-open-ticket">
        <?php echo _l('propertybase_open_maintenance_request'); ?>
    </h4>
<?php echo form_open_multipart(PROPERTYBASE_MODULE_NAME . '/propertybase_client/request_maintenance/' . $property_id, ['id' => 'open-new-maintenance-request']); ?>
    <div class="row">
        <div class="col-md-12">
            <?php hooks()->do_action('before_propertybase_client_open_request_maintenance_form_start'); ?>
            <div class="panel_s">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group open-ticket-subject-group">
                                <label for="maintenance_title"><?php echo _l('customer_ticket_subject'); ?></label>
                                <input type="text" class="form-control" name="maintenance_title" id="maintenance_title"
                                       value="<?php echo set_value('subject'); ?>">
                                <?php echo form_error('maintenance_title'); ?>
                            </div>
                        </div>
                    </div>
                    <div class="form-group open-ticket-message-group">
                        <label for="maintenance_description"><?php echo _l('propertybase_request_description'); ?></label>
                        <textarea name="maintenance_description" id="maintenance_description" class="form-control"
                                  placeholder="<?php echo _l('propertybase_request_description'); ?>"
                                  rows="8"><?php echo set_value('maintenance_description'); ?></textarea>
                    </div>

                    <div class="attachments_area open-ticket-attachments-area">
                        <div class="attachments">
                            <div class="attachment tw-max-w-md">
                                <div class="form-group">
                                    <label for="attachment" class="control-label">
                                        <?php echo _l('clients_ticket_attachments'); ?>
                                    </label>
                                    <div class="input-group">
                                        <input type="file"
                                               extension="<?php echo str_replace(['.', ' '], '', get_option('ticket_attachments_file_extensions')); ?>"
                                               filesize="<?php echo file_upload_max_size(); ?>" class="form-control"
                                               name="attachments[0]"
                                               accept="<?php echo get_ticket_form_accepted_mimes(); ?>">
                                        <span class="input-group-btn">
                                        <button class="btn btn-default add_more_attachments"
                                                data-max="<?php echo get_option('maximum_allowed_ticket_attachments'); ?>"
                                                type="button">
                                            <i class="fa fa-plus"></i>
                                        </button>
                                    </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel-footer text-right">
                    <button type="submit" class="btn btn-primary" data-form="#open-new-maintenance-request"
                            autocomplete="off"
                            data-loading-text="<?php echo _l('wait_text'); ?>">
                        <?php echo _l('submit'); ?>
                    </button>
                </div>
            </div>
        </div>
    </div>
<?php echo form_close(); ?>