echo form_input($slug); ?> <br /><?php echo form_error('slug'); ?> </li> <li> <label for="status">Post Status</label> <?php echo form_generic_dropdown('status', $status['value'], $post_status); ?> </li> <li> <label for="status">Comments are...</label> <?php echo form_generic_dropdown('comment_status', $comment_status['value'], $comment_statuses); ?> </li> <li> <label for="post_body">Post Content:</label> <?php echo form_textarea($post_body, NULL, 'style="width:700px;height:500px" class="tinymce"'); ?> <br /><?php echo form_error('post_body'); ?> </li> <li class="actions"> <?php echo form_submit('submit', 'Save Post'); ?>
</li> <li> <label for="source_id">Ad Campaign</label> <?php echo form_input($adcampaign_id['name'], $adcampaign_id['value'], $adcampaign_id); ?> <br /><?php echo form_error('adcampaign_id'); ?> </li> <li> <label for="source_id">Show Ad</label> <?php echo form_generic_dropdown($showad['name'], $showad['value'], array('N' => 'No', 'Y' => 'Yes')); ?> <br /><?php echo form_error('showad'); ?> </li> <li class="actions"> <?php echo form_submit('submit', 'Save Expert'); ?> <?php if ($id != NULL) { ?>
<label for="group_id">Group ID <span class="required">(required)</span></label> <?php echo form_generic_dropdown('group_ids', $group_id['value'], $group_ids); ?> >> <?php echo form_input($group_id); ?> <br /><?php echo form_error('group_id'); ?> <label for="show_provider">Show Ad Provider Link?</label> <?php echo form_generic_dropdown($show_provider['name'], $show_provider['value'], array('Y' => 'Yes', 'N' => 'No')); ?> <br /><?php echo form_error('show_provider'); ?> <label for="provider_name">Provider Name</label> <?php echo form_input($provider_name); ?> <br /><?php echo form_error('provider_name'); ?> <label for="provider_link">Provider Link</label> <?php
?> <br /><?php echo form_error('pixwidth'); ?> <label for="size_height">Ad Height</label> <?php echo form_input($pixheight); ?> <br /><?php echo form_error('pixheight'); ?> <label for="size_height">Mime Type</label> <?php echo form_generic_dropdown('mimetype', $mimetype['value'], $mimetypes); ?> <?php } ?> </li> <li class="actions"> <?php echo form_submit('submit', 'Save Image'); ?> <?php if ($id != NULL) { ?>
switch ($filters[$heading_name]['type']) { case 'text': echo '<INPUT type="text" name="filters[' . $heading_name . ']" value="' . $value . '" style="min-width:50px;display: table-cell;">'; break; case 'dropdown': if ($value == NULL) { $value = '*'; } echo form_generic_dropdown('filters[' . $heading_name . ']', $value, $filters[$heading_name]['data'], 'class="filter_dropdown" style="min-width:75px;width:100%;display: table-cell;"'); break; case 'date': echo '<INPUT type="text" name="filters[' . $heading_name . ']" value="' . $value . '" class="datepicker" style="min-width:75px;display: table-cell;">'; break; case 'price': echo '<span style="white-space:nowrap;">'; echo form_generic_dropdown('filter_operators[' . $heading_name . ']', $operator, array('less' => '<', 'lesseq' => '<=', 'eq' => '=', 'moreeq' => '>=', 'more' => '>'), ' style="min-width:50px;width:50px;display: table-cell;"'); echo ' <INPUT type="text" name="filters[' . $heading_name . ']" value="' . $value . '" style="min-width:60px;width:60px;display: table-cell;">'; echo '<span>'; break; } ?> <?php } elseif ($heading_name == 'actions') { ?> <?php echo form_submit('filter_submit', 'Filter', 'id="filter_submit"'); ?> <?php } else { ?>
function edit($id) { if ($id == NULL) { redirect(base_url() . 'auth/'); } // make sure user is an admin if (!$this->ion_auth->is_admin()) { $this->session->set_flashdata('message', 'You must be an admin to view this page.'); redirect('auth/login'); } // get groups list $groups = $this->ion_auth->get_groups_array(); //validate standard form input $this->form_validation->set_rules('username', 'Username', 'required|xss_clean|callback_username_check[' . $id . ']'); $this->form_validation->set_rules('email', 'E-mail Address', 'required|valid_email|xss_clean|callback_email_check[' . $id . ']'); $this->form_validation->set_rules('group_id', 'User Group', 'required'); // only validate if we're change the password if ($this->input->post('password1')) { $this->form_validation->set_rules('password1', 'Password', 'required|min_length[4]|xss_clean'); $this->form_validation->set_rules('password2', 'Confirm Password', 'required|matches[password1]|xss_clean'); } $this->form_validation->set_rules('opt_in', 'Opt-in to newsletter', ''); if ($this->form_validation->run() == TRUE) { if ($this->input->post('delete')) { // deleting user if ($this->ion_auth->delete_user($id)) { $this->session->set_flashdata('alert_string', 'User deleted successfully.'); } else { $this->session->set_flashdata('error_string', 'Could not delete user. Please contact the site administrator.'); } redirect(base_url() . 'auth/', 'refresh'); } else { // saving user if ($this->input->post('opt_in') == '1') { $opt_in = 'Y'; } else { $opt_in = 'N'; } $user_changes = array('email' => $this->input->post('email'), 'username' => $this->input->post('username'), 'group_id' => $this->input->post('group_id'), 'opt_in' => $opt_in); // change password if entered if ($this->input->post('password1') != NULL) { $user_changes['password'] = $this->input->post('password1'); } if ($this->ion_auth->update_user($id, $user_changes) == TRUE) { $alert_string = 'User saved successfully.'; } else { $error_string = 'User changes did not save. Please contact the site administrator.'; } if (isset($alert_string)) { $this->session->set_flashdata('alert_string', $alert_string); } if (isset($error_string)) { $this->session->set_flashdata('error_string', $error_string); } redirect(base_url('auth/index')); } } $this->data['message'] = validation_errors() ? validation_errors() : $this->session->flashdata('message'); // Load the user record to get default values $this->user_rec = $this->ion_auth->get_user($id); if ($this->user_rec == NULL) { redirect(base_url() . 'auth/', 'refresh'); } // password fields $this->data['password1'] = array('name' => 'password1', 'id' => 'password1', 'type' => 'password', 'value' => NULL); $this->data['password2'] = array('name' => 'password2', 'id' => 'password2', 'type' => 'password', 'value' => NULL); // email, group and newsletter opt-in $this->data['username'] = array('name' => 'username', 'id' => 'username', 'type' => 'text', 'value' => $this->form_validation->set_value('username', $this->user_rec->username)); $this->data['email'] = array('email' => 'email', 'id' => 'email', 'name' => 'email', 'type' => 'text', 'value' => $this->form_validation->set_value('email', $this->user_rec->email)); $this->data['group_id_dropdown'] = form_generic_dropdown('group_id', $this->user_rec->group_id, $groups); if ($this->user_rec->opt_in == 'Y') { $opt_in_checkbox = TRUE; } else { $opt_in_checkbox = FALSE; } $this->data['opt_in'] = array('name' => 'opt_in', 'id' => 'opt_in', 'value' => '1', 'checked' => $opt_in_checkbox); $this->data['user'] = $this->user_rec; if ($this->input->is_ajax_request()) { // ajax request, return the form only $this->load->view('auth/edit', $this->data); } else { // not ajax, return the whole page $this->template->title('User Editor')->build('auth/edit', $this->data); } }
</li> <li> <label for="name">Company Name <span class="required">(required)</span></label> <?php echo form_input($name, NULL, 'class="medium"'); ?> <br /><?php echo form_error('name'); ?> </li> <li> <label for="sector_id">Sector</label> <?php echo form_generic_dropdown($sector_id['name'], $sector_id['value'], $sectors); ?> <br /><?php echo form_error('sector_id'); ?> </li> <li> <label for="extra_notes">Notes</label> <?php echo form_textarea($notes, NULL, 'style="width:300px;height:200px" class="tinymce"'); ?> <br /><?php echo form_error('notes'); ?> </li>
</li> <li> <label for="goal">$ Goal</span></label> <?php echo form_input($goal); ?> <br /><?php echo form_error('goal'); ?> </li> <li> <label for="ownership_id">Own or Relationship?</label> <?php echo form_generic_dropdown($ownership_id['name'], $ownership_id['value'], $ownership); ?> <br /><?php echo form_error('ownership_id'); ?> </li> <li class="actions"> <?php echo form_submit(array('name' => 'submit', 'id' => 'submit', 'value' => 'Save Opinion')); ?> <?php if ($id != NULL) { ?> <input type="button" class="cancel" value="Cancel" onClick="window.location.reload()"> <button type="submit" name="submit" class="delete" value="delete" >Delete Opinion</button>