public function getTable($pkey = '') { _has_user_access_permission(TRUE, array('admin', 'location_manager', 'location_user')); $params = ($params = unserialize_object($pkey)) && is_array($params) ? $params : array(); $note_type_id = isset($params[SYS_NOTE_TYPE_ID]) && gtzero_integer($params[SYS_NOTE_TYPE_ID]) ? (int) $params[SYS_NOTE_TYPE_ID] : 0; $ref_id = isset($params[SYS_REF_ID]) && gtzero_integer($params[SYS_REF_ID]) ? (int) $params[SYS_REF_ID] : 0; $params = array('iDisplayStart' => $this->input->post('iDisplayStart', true), 'iDisplayLength' => $this->input->post('iDisplayLength', true), 'iSortCol_0' => $this->input->post('iSortCol_0', true), 'iSortingCols' => $this->input->post('iSortingCols', true), 'sSearch' => $this->input->post('sSearch', true), 'sEcho' => $this->input->post('sEcho', true), 'note_type_id' => $note_type_id, 'ref_id' => $ref_id); $qrows = $this->notes_m->ajax_gets($params); foreach ($qrows['aaData'] as &$qrow) { $qrow = array($qrow['note_description'], $qrow['created_by_name'], local_time($qrow['created_on'], 'M d, Y'), theme_button_groups(array('view' => array('href' => site_url('notes/show/' . serialize_object(array(SYS_NOTE_ID => $qrow['ID']))), 'title' => 'Note Detail', 'text' => 'View Note', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Note Detail", "modal" : {"buttons" : false, "footer" : false}, "params" : "echo"}\'', 'class' => array())))); } echo json_encode($qrows); }
public function getTable($pkey = '') { _has_user_access_permission(TRUE, array('admin', 'location_manager', 'user_company')); $params = ($params = unserialize_object($pkey)) && is_array($params) ? $params : array(); $type_id = isset($params[SYS_CONTACT_TYPE_ID]) && gtzero_integer($params[SYS_CONTACT_TYPE_ID]) ? to_int($params[SYS_CONTACT_TYPE_ID]) : 0; $ref_id = isset($params[SYS_REF_ID]) && gtzero_integer($params[SYS_REF_ID]) ? to_int($params[SYS_REF_ID]) : 0; $params = array('iDisplayStart' => $this->input->post('iDisplayStart', true), 'iDisplayLength' => $this->input->post('iDisplayLength', true), 'iSortCol_0' => $this->input->post('iSortCol_0', true), 'iSortingCols' => $this->input->post('iSortingCols', true), 'sSearch' => $this->input->post('sSearch', true), 'sEcho' => $this->input->post('sEcho', true), 'type_id' => $type_id, 'ref_id' => $ref_id); $qrows = $this->contact_m->ajax_gets($params); foreach ($qrows['aaData'] as &$qrow) { $qrow = array($qrow->full_name, $qrow->email, $qrow->address, $qrow->phone, $qrow->mobile, to_int($qrow->is_default) == 1 ? 'Yes' : 'No', $qrow->created_by_name, local_time($qrow->created_on, 'M d, Y'), theme_button_groups(array('edit' => array('href' => site_url('contacts/edit/' . serialize_object(array(SYS_CONTACT_ID => $qrow->contact_id, SYS_REF_ID => $qrow->ref_id, SYS_CONTACT_TYPE_ID => $qrow->contact_type_id))), 'title' => 'Contact Detail <small>' . $qrow->full_name . '</small>', 'text' => 'Edit Contact', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Contact Detail (<small>' . $qrow->full_name . '</small>)", "modal" : {"buttons" : true, "override" : true, "modal_success_callback" : "gl.contact.listing.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "default"}}\'', 'class' => array()), 'delete' => array('href' => site_url('contacts/delete/' . serialize_object(array(SYS_CONTACT_ID => $qrow->contact_id, SYS_REF_ID => $qrow->ref_id, SYS_CONTACT_TYPE_ID => $qrow->contact_type_id))), 'title' => 'Delete Contact <small>' . $qrow->full_name . '</small>', 'text' => 'Delete Contact', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Contact (<small>' . $qrow->full_name . '</small>)", "modal" : {"buttons" : true, "override" : true, "modal_success_callback" : "gl.contact.listing.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "default"}}\'', 'class' => array())))); } echo json_encode($qrows); }
public function getTable($pkey = '') { _has_user_access_permission(TRUE, array('admin', 'management_company')); $params = ($params = unserialize_object($pkey)) && is_array($params) ? $params : array(); $company_id = $this->current_user->group_id == 1 ? array_key_exists(SYS_COMPANY_ID, $params) && gtzero_integer($params[SYS_COMPANY_ID]) ? to_int($params[SYS_COMPANY_ID]) : 0 : $this->current_user->company_id; $input = array('iDisplayStart' => $this->_post_args('iDisplayStart', ARGS_TYPE_INT), 'iDisplayLength' => $this->_post_args('iDisplayLength', ARGS_TYPE_INT, 0, array('gtzero' => FALSE)), 'iSortCol_0' => $this->_post_args('iSortCol_0', ARGS_TYPE_STRING), 'iSortingCols' => $this->_post_args('iSortingCols', ARGS_TYPE_INT), 'sSearch' => $this->_post_args('sSearch', ARGS_TYPE_STRING), 'sEcho' => $this->_post_args('sEcho', ARGS_TYPE_STRING), 'company_id' => $this->current_user->group_id == 1 ? $this->_post_args('company_id', ARGS_TYPE_INT, $company_id, array('override' => TRUE)) : $this->current_user->company_id, 'group_id' => $this->_post_args('group_id', ARGS_TYPE_INT)); $qrows = $this->user_m->ajax_gets($input); foreach ($qrows['aaData'] as &$qrow) { $actions = array('view' => array('href' => site_url('users/show/' . serialize_object(array(SYS_USER_ID => $qrow->user_id))), 'title' => 'User Detail (<small>' . $qrow->full_name . '</small>)', 'text' => 'User Detail', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "User Detail <small>' . $qrow->full_name . '</small>", "modal" : {"buttons" : false, "size" : ""}, "params" : "echo"}\'', 'class' => array()), 'edit' => array('href' => site_url('users/edit/' . serialize_object(array(SYS_USER_ID => $qrow->user_id))), 'title' => 'User Detail (<small>' . $qrow->full_name . '</small>)', 'text' => 'Edit User', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "User Detail <small>' . $qrow->full_name . '</small>", "modal" : {"buttons" : true, "override" : true, "size" : "", "modal_success_callback" : "gl.user.listing.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "default"}}\'', 'class' => array()), 'delete' => array('href' => site_url('users/delete/' . serialize_object(array(SYS_USER_ID => $qrow->user_id))), 'title' => 'User <small>' . $qrow->full_name . '</small>', 'text' => 'Delete User', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "User Detail <small>' . $qrow->full_name . '</small>", "modal" : {"buttons" : true, "override" : true, "modal_success_callback" : "gl.user.listing.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "default"}}\'', 'class' => array())); $qrow = array($qrow->company_name, $qrow->full_name, $qrow->email, $qrow->phone, $qrow->group_description, $qrow->user_id == $this->current_user->user_id ? gtzero_integer($qrow->active) ? 'Active' : 'Inactive' : theme_anchor_button(array('type' => BUTTON_TYPE_ANCHOR, 'href' => gtzero_integer($qrow->active) ? site_url("users/deactivate/" . serialize_object(array(SYS_USER_ID => $qrow->user_id))) : site_url("users/activate/" . serialize_object(array(SYS_USER_ID => $qrow->user_id))), 'title' => gtzero_integer($qrow->active) ? 'De-activate User' : 'Activate User', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "' . (gtzero_integer($qrow->active) ? 'Deactivate' : 'Activate') . ' User <small>' . $qrow->full_name . '</small>", "modal" : {"buttons" : true, "override" : true, "modal_success_callback" : "gl.user.listing.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "default"}}\'', 'class' => implode(' ', array(NOICON_BUTTON, gtzero_integer($qrow->active) ? 'btn-success' : 'btn-danger', 'btn-xs btip')), 'icon' => ICON_STATUS_CHANGE . ' mr5', 'text' => gtzero_integer($qrow->active) ? 'Active' : 'Inactive')), local_time($qrow->created_on, 'M d, Y @ h:ia'), $qrow->user_id == $this->current_user->user_id ? '' : theme_button_dropdown($actions)); if (_check_company_user_access()) { unset($qrow[0]); $qrow = array_values($qrow); } } echo json_encode($qrows); }
public function getTable($pkey = '') { _has_user_access_permission(TRUE, array('admin', 'staff')); $params = ($params = unserialize_object($pkey)) && is_array($params) ? $params : array(); $input = array('iDisplayStart' => $this->_post_args('iDisplayStart', ARGS_TYPE_INT), 'iDisplayLength' => $this->_post_args('iDisplayLength', ARGS_TYPE_INT, 0, array('gtzero' => FALSE)), 'iSortCol_0' => $this->_post_args('iSortCol_0', ARGS_TYPE_STRING), 'iSortingCols' => $this->_post_args('iSortingCols', ARGS_TYPE_INT), 'sSearch' => $this->_post_args('sSearch', ARGS_TYPE_STRING), 'sEcho' => $this->_post_args('sEcho', ARGS_TYPE_STRING)); $listing = $this->company_m->ajax_get_parts($input); foreach ($listing['aaData'] as &$qrow) { $company_id = $qrow->company_id; $company_name = $qrow->company_name; $actions = array(); $actions['view'] = array('href' => site_url('agencies/show/' . serialize_object(array(SYS_COMPANY_ID => $qrow->company_id))), 'title' => 'Agency Detail (<small>' . $company_name . '</small>)', 'text' => 'Agency Detail', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Agency Detail <small>' . $company_name . '</small>", "modal" : {"buttons" : false}, "params" : "echo"}\'', 'class' => array()); if ($this->current_user->group_id == GROUP_ADMIN) { $actions['edit'] = array('href' => site_url('agencies/edit/' . serialize_object(array(SYS_COMPANY_ID => $qrow->company_id))), 'title' => 'Agency Detail (<small>' . $company_name . '</small>)', 'text' => 'Edit Agency', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Agency Detail <small>' . $company_name . '</small>", "modal" : {"buttons" : true, "override" : true, "modal_success_callback" : "updateData();"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "default"}}\'', 'class' => array()); $actions['delete'] = array('href' => site_url('agencies/delete/' . serialize_object(array(SYS_COMPANY_ID => $qrow->company_id))), 'title' => 'Agency <small>' . $company_name . '</small>', 'text' => 'Delete Agency', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Agency Detail <small>' . $company_name . '</small>", "modal" : {"buttons" : true, "override" : true, "modal_success_callback" : "updateData();"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "default"}}\'', 'class' => array()); } /* if( in_array($this->current_user->group_id, array(GROUP_ADMIN)) ) { $actions['contacts'] = array( 'href' => site_url('contacts/index/'.serialize_object(array( SYS_REF_ID => $qrow->company_id, SYS_CONTACT_TYPE_ID => CONTACT_TYPE_COMPANY) )), 'title' => 'Contacts <small>(Client: '.$company_name.')</small>', 'text' => 'Contacts', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Contacts <small>(Agency: '.$company_name.')</small>", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true, "nopadd" : false, "modal_before_close_callback" : "gl.contact.listing.close_grid(g);", "callback" : "gl.contact.listing.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "next"}}\'', 'class' => array() ); } if( in_array($this->current_user->group_id, array(GROUP_ADMIN)) ) { $actions['new_contact'] = array( 'href' => site_url('contacts/create/'.serialize_object(array( SYS_REF_ID => $qrow->company_id, SYS_CONTACT_TYPE_ID => CONTACT_TYPE_COMPANY))), 'title' => 'Contact Detail <small>(Client: '.$company_name.')</small>', 'text' => 'New Contact', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "POST", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Contact Detail <small>(Agency: '.$company_name.')</small>", "modal" : {"buttons" : true}, "params" : "echo"}\'', 'class' => array() ); } */ $qrow = array($qrow->company_name, $qrow->address, !empty($qrow->gmt_offset) ? _date_lang_shorttag($qrow->gmt_offset) : '', $this->current_user->group_id == GROUP_ADMIN ? theme_anchor_button(array('type' => BUTTON_TYPE_ANCHOR, 'href' => gtzero_integer($qrow->active) ? site_url("agencies/deactivate/" . serialize_object(array(SYS_COMPANY_ID => $qrow->company_id))) : site_url("agencies/activate/" . serialize_object(array(SYS_COMPANY_ID => $qrow->company_id))), 'title' => gtzero_integer($qrow->active) ? 'De-activate Agency' : 'Activate Agency', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "' . (gtzero_integer($qrow->active) ? 'Deactivate' : 'Activate') . ' Agency <small>' . $company_name . '</small>", "modal" : {"buttons" : true, "override" : true, "modal_success_callback" : "updateData();"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "default"}}\'', 'class' => implode(' ', array(NOICON_BUTTON, gtzero_integer($qrow->active) ? 'btn-success' : 'btn-danger', 'btn-xs btip')), 'icon' => ICON_STATUS_CHANGE . ' mr5', 'text' => gtzero_integer($qrow->active) ? 'Active' : 'Inactive')) : (gtzero_integer($qrow->active) ? 'Active' : 'Inactive'), local_time($qrow->created_on, 'M d, Y @ h:ia'), $qrow->created_by_name, theme_button_dropdown($actions)); } echo json_encode($listing); }
<div class="form-group client_option" <?php echo _has_company_non_resources($group_id) && gtzero_integer($company_id) ? '' : 'style="display:none;"'; ?> > <label class="col-sm-4 control-label no-padding-right" for="client_ids">Client:</label> <div class="col-sm-8"> <div class="row"> <div class="col-sm-10"> <?php echo form_dropdown('client_ids[]', clients_dropdown('return', array('company_id' => $company_id, 'first_row' => TRUE)), $client_ids, 'id="client_ids" class="form-control input-sm" data-placeholder="Select a Client" multiple="multiple"'); ?> </div> <div class="col-sm-2"> <a href="<?php echo site_url('clients/create/' . serialize_object()); ?> " class="btn btn-primary btn-xs" data-ajax="wdpajax" data-options='{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Client detail", "modal" : {"buttons" : true, "modal_success_callback" : "gl.user.form._init_clients(response);", "override" : true}, "params" : "echo"}'> <i class="fa fa-level-up mr5"></i> </a> </div> </div> <?php echo form_error('client_ids', '<label class="error">', '</label>'); ?> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label no-padding-right" for="email">Email:</label> <div class="col-sm-8">
<tr> <td><?php echo $sform_row->name; ?> </td> <td><a href="<?php echo site_url('survey/questions/' . serialize_object(array(SYS_FORM_TYPE_ID => $sform_row->id))); ?> " class="btn btn-xs btn-warning" ><i class="fa fa-question mr5"></i>List</a> <?php if (in_array($current_user->group_id, array(GROUP_ADMIN))) { ?> <td> <a href="<?php echo site_url('survey/sfedit/' . serialize_object(array(SYS_FORM_TYPE_ID => $sform_row->id))); ?> " class="btn btn-xs btn-warning" data-ajax="wdpajax" data-options='{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Site Form Detail", "modal" : {"buttons" : true, "override" : true, "modal_success_callback" : "gl.sfform.listing.load_grid();"}, "params" : "echo"}'><i class="fa fa-pencil"></i></a> <a href="<?php echo site_url('survey/sfdelete/' . serialize_object(array(SYS_FORM_TYPE_ID => $sform_row->id))); ?> " class="btn btn-xs btn-warning" data-ajax="wdpajax" data-options='{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Site Form Detail", "modal" : {"buttons" : true, "override" : true, "modal_success_callback" : "gl.sfform.listing.load_grid();"}, "params" : "echo"}'><i class="fa fa-trash-o"></i></a> </td> <?php } ?> <?php } ?> </tbody> <tfoot></tfoot> </table>
public function show($pkey, $method = "echo") { _has_user_access_permission(TRUE, array('admin', 'management_company', 'user_company')); $params = ($params = unserialize_object($pkey)) && is_array($params) ? $params : array(); $company_id = $this->current_user->group_id == 1 ? $this->_post_args('company_id', ARGS_TYPE_INT, array_key_exists(SYS_COMPANY_ID, $params) && gtzero_integer($params[SYS_COMPANY_ID]) ? to_int($params[SYS_COMPANY_ID]) : 0) : $this->current_user->company_id; $client_id = isset($params[SYS_CLIENT_ID]) && gtzero_integer($params[SYS_CLIENT_ID]) ? (int) $params[SYS_CLIENT_ID] : 0; $redirect_url = $this->_post_args('redirect_url', ARGS_TYPE_STRING, $this->agent->referrer()); $client_info = $this->client_m->details($client_id, $company_id); if (!$client_info || _has_company_group_access($this->current_user->group_id) && $client_info->company_id != $this->current_user->company_id) { $this->show_permission_denied_error($method); } $company_id = $this->current_user->group_id == 1 ? $this->_post_args('company_id', ARGS_TYPE_INT, $client_info->company_id) : $this->current_user->company_id; $doc_key = $this->_post_args('doc_key', ARGS_TYPE_STRING) ? $this->_post_args('doc_key', ARGS_TYPE_STRING) : keygen(); $csrf = _get_csrf_nonce(); $data = array("client_id" => $client_id, 'notes_listing_url' => site_url('notes/index/' . serialize_object(array(SYS_REF_ID => $client_id, SYS_NOTE_TYPE_ID => NOTE_TYPE_CLIENT))), 'form_action' => site_url('clients/edit/' . $pkey), 'cancel_url' => $redirect_url, 'page' => 'clients/show', 'title' => 'Client Detail', 'submit_btn_text' => 'Save Changes', 'company_id' => $company_id, 'company_name' => $client_info->company_name, 'client_name' => $client_info->full_name, 'first_name' => $client_info->first_name, 'last_name' => $client_info->last_name, 'address' => $client_info->address, 'postcode' => $client_info->postcode, 'phone' => $client_info->phone, 'email' => $client_info->email, 'avatar' => $client_info->avatar, 'contact_first_name' => $client_info->contact_first_name, 'contact_last_name' => $client_info->contact_last_name, 'contact_address' => $client_info->contact_address, 'contact_email' => $client_info->contact_email, 'contact_phone' => $client_info->contact_phone, 'contact_mobile' => $client_info->contact_mobile, 'contact_fax' => $client_info->contact_fax, 'notes' => $this->_post_args('notes', ARGS_TYPE_STRING), 'scripts' => array('clients/show.js'), 'hiddenvars' => array_merge($csrf, array('redirect_url' => $redirect_url))); if ($this->input->is_ajax_request()) { $html = $this->template->raw_view('pages/clients/show_modal', $data, TRUE); if ($method == "ajax") { $output['html'] = $html; $this->_output_request($output, $redirect_url); } else { echo $html; } } else { if (!empty($output['status'])) { set_flash_data($output['status'], $output['message'], FALSE); } $this->template->load('default', $data); } }
<a data-toggle="collapse" class="collapsed" data-parent="#sortable_accordion" href="#collapse_<?php echo $qrow->question_id; ?> "><?php echo $qrow->description; ?> </a> <?php if (in_array($current_user->group_id, array(GROUP_ADMIN))) { ?> <a style="padding:5px;line-height:14px;margin:-36px 45px 0 0;" href="<?php echo site_url('survey/qedit/' . serialize_object(array(SYS_FORM_TYPE_ID => $form_type_id, SYS_QUESTION_ID => $qrow->question_id))); ?> " class="btn btn-xs btn-warning btn-edit pull-right wht" data-ajax="wdpajax" data-options='{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Question Detail", "modal" : {"buttons" : true, "override" : true, "modal_success_callback" : "gl.qform.listing._sort_callback();"}, "params" : "echo"}'><i class="fa fa-pencil"></i></a> <a style="padding:5px;line-height:14px;margin:-36px 15px 0 0;" href="<?php echo site_url('survey/qdelete/' . serialize_object(array(SYS_FORM_TYPE_ID => $form_type_id, SYS_QUESTION_ID => $qrow->question_id))); ?> " class="btn btn-xs btn-warning btn-edit pull-right wht" data-ajax="wdpajax" data-options='{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Delete Question", "modal" : {"buttons" : true, "override" : true, "modal_success_callback" : "gl.qform.listing._sort_callback();"}, "params" : "echo"}'><i class="fa fa-trash-o"></i></a> <?php } ?> </h3> </div> <div id="collapse_<?php echo $qrow->question_id; ?> " class="panel-collapse collapse"> <div class="panel-body"> <?php echo $qrow->description; ?>
public function show($pkey, $method = "echo") { _has_user_access_permission(TRUE, array('admin', 'management_company', 'staff', 'engineer')); $params = ($params = unserialize_object($pkey)) && is_array($params) ? $params : array(); $company_id = in_array($this->current_user->group_id, array(GROUP_ADMIN, GROUP_STAFF, GROUP_ENGINEER)) ? $this->_post_args('company_id', ARGS_TYPE_INT, array_key_exists(SYS_COMPANY_ID, $params) && gtzero_integer($params[SYS_COMPANY_ID]) ? to_int($params[SYS_COMPANY_ID]) : 0) : $this->current_user->company_id; $site_id = isset($params[SYS_SITE_ID]) && gtzero_integer($params[SYS_SITE_ID]) ? to_int($params[SYS_SITE_ID]) : 0; $redirect_url = $this->_post_args('redirect_url', ARGS_TYPE_STRING, $this->agent->referrer()); $site_info = $this->site_m->details($site_id, $company_id); if (!$site_info || _has_company_group_access($this->current_user->group_id) && $site_info->company_id != $this->current_user->company_id) { $this->show_permission_denied_error($method); } $company_id = in_array($this->current_user->group_id, array(GROUP_ADMIN, GROUP_STAFF, GROUP_ENGINEER)) ? $this->_post_args('company_id', ARGS_TYPE_INT, $site_info->company_id) : $this->current_user->company_id; $doc_key = $this->_post_args('doc_key', ARGS_TYPE_STRING) ? $this->_post_args('doc_key', ARGS_TYPE_STRING) : keygen(); $csrf = _get_csrf_nonce(); $data = array("site_id" => $site_id, 'notes_listing_url' => site_url('notes/index/' . serialize_object(array(SYS_REF_ID => $site_id, SYS_NOTE_TYPE_ID => NOTE_TYPE_SITE))), 'form_action' => site_url('sites/show/' . $pkey), 'cancel_url' => $redirect_url, 'page' => 'sites/show', 'title' => 'Site Detail', 'submit_btn_text' => 'Save Changes', 'company_id' => $company_id, 'company_name' => $site_info->company_name, 'site_id' => $site_info->id, 'district_no' => $site_info->district_no, 'site_code' => $site_info->site_code, 'town' => $site_info->town, 'address' => $site_info->address, 'street' => $site_info->street, 'postcode' => $site_info->postcode, 'site_ref' => $site_info->site_ref, 'upload_date' => !empty($site_info->upload_date) ? valid_date($site_info->upload_date, 'd/m/Y') : local_time(curr_timestamp(), 'd/m/Y'), 'static_scroller' => $site_info->static_scroller, 'shelter_fsu' => $site_info->shelter_fsu, 'easting' => $site_info->easting, 'northing' => $site_info->northing, 'shelter_type' => $site_info->shelter_type, 'site_configuration' => $site_info->site_configuration, 'height' => $site_info->height, 'panel' => $site_info->panel, 'ranking' => $site_info->ranking, 'embargo_start_date' => $site_info->embargo_start_date, 'status' => $site_info->status, 'power_build_pack_requested' => $site_info->power_build_pack_requested, 'power_build_pack_received_ttc' => $site_info->power_build_pack_received_ttc, 'actual_power_cost' => $site_info->actual_power_cost, 'power_build_date' => $site_info->power_build_date, 'meter_build_date' => $site_info->meter_build_date, 'site_forms' => $site_info->site_forms, 'site_statuses' => array('' => '', 1 => 'OPEN', 2 => 'SUBMITTED', 3 => 'COMPLETED'), 'scripts' => array('sites/show.js'), 'hiddenvars' => array_merge($csrf, array('redirect_url' => $redirect_url))); if ($this->input->is_ajax_request()) { $html = $this->template->raw_view('pages/sites/show_modal', $data, TRUE); if ($method == "ajax") { $output['html'] = $html; $this->_output_request($output, $redirect_url); } else { echo $html; } } else { if (!empty($output['status'])) { set_flash_data($output['status'], $output['message'], FALSE); } $this->template->load('default', $data); } }
echo local_time($site_form->completed_on, 'M d, Y @ h:ia'); ?> </td> <?php /*<td><?php echo $site_form->completed_by_name;?></td>*/ ?> <td> <a href="<?php echo site_url('sites/feedback/' . serialize_object(array(SYS_SITE_FORM_ID => $site_form->id, SYS_SITE_ID => $site_form->site_id, SYS_FORM_TYPE_ID => $site_form->form_type_id))); ?> " class="btn btn-xs btn-warning"><i class="fa fa-eye"></i></a> <?php if ($current_user->group_id == GROUP_ADMIN) { ?> <a href="<?php echo site_url('sites/sfstatus/' . serialize_object(array(SYS_SITE_FORM_ID => $site_form->id, SYS_SITE_ID => $site_form->site_id, SYS_FORM_TYPE_ID => $site_form->form_type_id))); ?> " class="btn btn-xs btn-warning"><i class="fa fa-check"></i></a> <?php } ?> </td> </tr> <?php } ?> </tbody> <?php if (!$site_forms) { ?>
public function qgetTable($pkey = '', $method = "echo") { _has_user_access_permission(TRUE, array('admin', 'staff')); $params = ($params = unserialize_object($pkey)) && is_array($params) ? $params : array(); $form_type_id = isset($params[SYS_FORM_TYPE_ID]) && gtzero_integer($params[SYS_FORM_TYPE_ID]) ? to_int($params[SYS_FORM_TYPE_ID]) : 0; $redirect_url = $this->_post_args('redirect_url', ARGS_TYPE_STRING, $this->agent->referrer()); $form_info = $this->survey_m->form_type_details($form_type_id); if (!$form_info) { $this->show_permission_denied_error($method); } $data = array('page' => 'survey/question_listing', 'title' => 'Site Form Questions', 'plugins' => array(), 'new_qcreate_url' => site_url('survey/qcreate/' . serialize_object(array(SYS_FORM_TYPE_ID => $form_type_id))), 'question_sort_update_url' => site_url('survey/sort_question/' . serialize_object(array(SYS_FORM_TYPE_ID => $form_type_id))), 'questions_url' => site_url('survey/qgetTable/' . serialize_object(array(SYS_FORM_TYPE_ID => $form_type_id))), 'qrows' => $this->survey_m->get_questions_by_form_id($form_type_id), 'form_type_id' => $form_type_id, 'scripts' => array('survey/questions.js')); echo $this->template->raw_view('pages/survey/questions', $data, TRUE); }
<div data-role="footer" data-position="fixed"> <div data-role="navbar"> <ul> <li><a href="<?php echo site_url('sites/survey/' . serialize_object()); ?> " data-ajax="false" data-role="false">Search Site</a></li> <li><a href="<?php echo site_url('auth/logout'); ?> " data-ajax="false" data-role="false">Logout</a></li> <?php /*<li><a href="#">Menu item 3</a></li>*/ ?> </ul> </div> <h4 style="display:none;">Footer</h4> </div>
public function synctimezone() { $front_gmt_offset = $this->input->post("front_gmt_offset"); $recheck = ($recheck = $this->input->post("recheck")) && gtzero_integer($recheck) ? TRUE : FALSE; $user_info = $this->user_m->get_user_info($this->current_user->user_id); $gmt_options = $this->session->userdata('gmt_options'); if (!empty($gmt_options)) { $this->session->unset_userdata('gmt_options'); } $gmt_options = array('recheck' => $recheck); $this->session->set_userdata('gmt_options', serialize_object($gmt_options)); header('Content-Type: application/json'); echo json_encode(array('gmt_options' => $gmt_options)); die; }