print_form_container_close();
    echo form_close();
    echo "</div></div>";

    echo '<p style="color: red">Note: your login will only work for one session. Enter your email address in the form above to re-apply for access if your session has expired.</p>';
} else {

    echo form_open(base_url().'login', array('id' => 'login_form', 'class' => 'form-horizontal'));
    print_form_container_open();
    print_input_element(array(
        'label' => 'Username',
        'name' => 'username',
        'size' => 25,
        'required' => true
    ));
    print_password_element(array(
        'label' => 'Password',
        'name' => 'password',
        'size' => 25,
        'required' => true
    ));

    print_static_form_element('', '<a href="login/reset_password">Forgot your username or password?</a>');
    print_submit_container_open();
    echo form_submit('button', 'Login', 'id="submit_button" class="btn btn-primary"');
    print_submit_container_close();
    print_form_container_close();
    echo form_close();
}
?>
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" onclick="$('.modal').modal('hide');" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h3 class="modal-title"><?php 
echo $title;
?>
</h3>
            </div>

            <div class="modal-body">
                <?php 
echo form_hidden('job_site_id', $job_site_id);
print_form_container_open();
if (!empty($booking)) {
    echo form_hidden('id', $booking->id);
    print_static_form_element('Booking ID', $booking->id);
}
print_textarea_element(array('label' => 'Message', 'name' => 'message', 'required' => true, 'rows' => 3, 'cols' => 30, 'default_value' => @$booking->message));
print_date_element(array('label' => 'Booking date', 'name' => 'booking_date', 'required' => true, 'default_value' => unix_to_human(@$booking->booking_date)));
print_checkbox_element(array('label' => 'Confirmed', 'name' => 'confirmed', 'value' => 1, 'default_value' => @$booking->confirmed));
print_multiselect_element(array('label' => 'Email recipients', 'name' => 'recipients[]', 'options' => $staff, 'default_value' => $recipients));
print_form_container_close();
?>
            </div>
            <div class="modal-footer">
                <button class="btn btn-lg btn-primary" type="submit" onclick="return validate_form($(this).parents('form'));"><i class="fa fa-save"></i>Save</button>
                <?php 
if (!empty($booking)) {
    ?>
<button class="btn btn-lg btn-danger" type="button" onclick="if(deletethis()){delete_booking(<?php 
    echo $booking->id;
 public function get_html()
 {
     if (!$this->show) {
         return null;
     }
     $asterisk = $this->required ? '<span class="required">*</span>' : '';
     $required_class = $this->required ? ' required ' : '';
     $error_class = $this->error ? ' error ' : '';
     $error_html = $this->error ? '<span class="validation_error">' . $this->error . '</span>' : '';
     $info_html = $this->info_text ? get_info_icon($this->label, $this->info_text) : '';
     $disabledif_string = $this->get_disable_string('if');
     $disabledunless_string = $this->get_disable_string('unless');
     if ($this->render_static) {
         if ($this->show_label === false) {
             $this->label = '';
         }
         return print_static_form_element($this->label, '<span id="' . $this->name . '" data-id="' . $this->static_value . '" ' . $disabledif_string . ' ' . $disabledunless_string . '>' . $this->static_displayvalue . '</span>');
     }
     if ($this->popover) {
         $return_html = '<div data-toggle="tooltip" data-placement="left" title="' . $this->label . '" class="form-group ' . $error_class . $required_class . '" ' . $disabledif_string . ' ' . $disabledunless_string . '>';
         if ($this->show_label) {
             $return_html .= "<label>{$this->label}</label>";
         }
         $return_html .= $this->html . $info_html . '</div>';
     } else {
         $return_html = '<div class="form-group ' . $error_class . '">';
         if (is_null($this->show_label) || $this->show_label) {
             $return_html .= '<label class="control-label col-lg-2">' . $this->label . ' ' . $asterisk . $info_html . '</label>';
         }
         $return_html .= '<div class="col-lg-10 ' . $required_class . '" ' . $disabledif_string . ' ' . $disabledunless_string . '>' . $this->html . '<span class="help-inline">' . $error_html . '</span></div></div>';
     }
     return $return_html;
 }
 * users may share and modify this code, but must give credit and
 * share improvements. However, for proper details please
 * read the full License, available at
 *  	http://vizsage.com/license/Vizsage-License-BY-NC-SA.html
 * and the handy reference for understanding the full license at
 *  	http://vizsage.com/license/Vizsage-Deed-BY-NC-SA.html
 *
 * Unless required by applicable law or agreed to in writing, any
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */
echo form_open(base_url().'login/reset_password', array('id' => 'reset_password_form', 'class' => 'form-horizontal'));
print_form_container_open();
print_static_form_element('', 'Enter your username <b><i><u>OR</u></i></b> your email address to receive a new password.');
print_input_element(array(
    'label' => 'Username',
    'name' => 'username',
    'size' => 25,
    'required' => false
));
print_input_element(array(
    'label' => 'Email address',
    'name' => 'email',
    'size' => 25,
    'required' => false
));

print_submit_container_open();
echo form_submit('button', 'Submit', 'id="submit_button" class="btn btn-default"');
Example #5
0
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */
?>
<div id="detailsmessage"></div>
<?=form_open($form_action, array('id' => 'userform', 'class' => 'form-horizontal', 'role' => 'form'))?>
<div class="panel panel-info">
    <?php print_hidden_element(array('name' => 'user_id'))?>
    <?php print_hidden_element(array('name' => 'action'))?>
    <div class="panel-heading"><?=get_title($details_title_options)?></div>
    <div id="details" class="panel-body">
        <div id="detailsmessage"></div>
<?php
        if (!empty($user_id)) print_static_form_element('ID', $user_id);
        print_input_element(array('name' => 'first_name', 'label' => 'First Name', 'required' => true));
        print_input_element(array('name' => 'last_name', 'label' => 'Last Name', 'required' => true));

        $back_link = base_url()."users/user";
        if ($type == 'staff') {
            print_input_element(array('name' => 'username', 'label' =>'Username'));

            // Only show password if admin has donanything for users
            if (empty($user_id) || (has_capability('site:doanything') || ($this->session->userdata('user_id') == $user_id && has_capability('users:editownaccount')))) {
                print_password_element(array('label' => 'Password', 'name' => 'password', 'required' => false));
            }

            print_textarea_element(array('name' => 'signature', 'cols' => 40, 'rows' => 3, 'label' => 'Signature'));
        } else if ($type == 'contact') {
            $back_link = base_url()."users/contact";
print_form_container_open();
print_fieldset_open('Dates');
print_static_form_element('Call date', '<span id="call_date">' . $srd['call_date'] . '</span>');
print_static_form_element('Appointment date', '<span id="appointment_date">' . $srd['appointment_date'] . '</span>');
print_fieldset_close();
print_fieldset_open('Location');
print_static_form_element('Business name', $srd['company_name']);
$full_address = "{$srd['address_street']}, {$srd['address_city']}, {$srd['address_state']}, {$srd['address_postcode']}";
print_static_form_element('Job site address', $full_address);
print_static_form_element('Address details', $srd['address_description']);
print_fieldset_close();
$can_view_unit_management = $this->order_model->check_statuses($sr_id, array('ALLOCATED', 'LOCKED FOR AMENDMENT'), 'OR', array('REVIEWED', 'READY FOR REVIEW', 'LOCKED FOR REVIEW')) && !$locked;
$statuses_for_summary_table = array('UNDER REVIEW', 'REVIEWED', 'ON HOLD', 'COMPLETE', 'ARCHIVED', 'NEEDS JOB NUMBER');
if ($can_view_unit_management) {
    print_fieldset_open('Service details', 'id="order_units"');
    print_static_form_element('Notes', $srd['notes']);
    ?>
        <div class="table-responsive">
        <table class="table table-bordered table-condensed">
            <thead>
                <tr><th>Type</th><th>Brand</th><th>Location served</th><th>Fault(s)</th><th class="actions">Actions</th></tr>
            </thead>
            <tbody>
                <tr>
                    <td colspan="5">
                        <button class="btn btn-success" type="button" id="new_unit_button">Create a unit</button>
                    </td>
                </tr>
                <tr id="new_unit_row" style="display: none">
                <td><?php 
    echo form_dropdown('unit_type_id', $dropdowns['unit_types']);