Пример #1
0
 public function index($method = "echo")
 {
     $company_id = $this->current_user->group_id == 1 ? $this->input->post('company_id') ? $this->input->post('company_id') : 0 : $this->current_user->company_id;
     $client_id = $this->input->post('client_id') ? $this->input->post('client_id') : 0;
     $site_id = $this->input->post('site_id') ? $this->input->post('site_id') : 0;
     $job_id = $this->input->post('job_id') ? $this->input->post('job_id') : 0;
     $quote_id = $this->input->post('quote_id') ? $this->input->post('quote_id') : 0;
     $equipment_id = $this->input->post('equipment_id') ? $this->input->post('equipment_id') : 0;
     $option_type = ($option_type = $this->input->post('option_type')) && gtzero_integer($option_type) ? (int) $option_type : 0;
     $document_type_id = 9;
     if (gtzero_integer($company_id)) {
         $document_type_id = 6;
     }
     if (gtzero_integer($client_id)) {
         $document_type_id = 7;
     }
     if (gtzero_integer($site_id)) {
         $document_type_id = 8;
     }
     if (gtzero_integer($job_id)) {
         $document_type_id = 1;
     }
     if (gtzero_integer($quote_id)) {
         $document_type_id = 2;
     }
     if (gtzero_integer($equipment_id)) {
         $document_type_id = 10;
     }
     /*print_r(array(
     			'company_id'			=> $company_id
     			,'document_type_id'		=> $document_type_id
     			,'client_id'			=> $client_id
     			,'site_id'				=> $site_id
     			,'job_id'				=> $job_id
     			,'quote_id'				=> $quote_id
     			,'equipment_id'			=> $equipment_id
     			,'option_type'			=> $option_type
     		));die;*/
     $files = $this->document_model->get_docs_by_many(array('company_id' => $company_id, 'document_type_id' => $document_type_id, 'client_id' => $client_id, 'site_id' => $site_id, 'job_id' => $job_id, 'quote_id' => $quote_id, 'equipment_id' => $equipment_id));
     $folders = $this->document_model->get_doc_types_by_many(array('company_id' => $company_id, 'document_type_id' => $document_type_id, 'client_id' => $client_id, 'site_id' => $site_id, 'job_id' => $job_id, 'quote_id' => $quote_id, 'equipment_id' => $equipment_id, 'option_type' => $option_type));
     //print_r($folders);die;
     $document_types = array("" => "", '1' => 'job', '2' => 'quote', '4' => 'Email Attachments');
     if ($this->current_user->group_id == 1) {
         //$document_types['']
     }
     $data = array('page' => 'docs/form', 'title' => 'Documents', 'folders' => $folders, 'files' => $files, 'companies' => $this->current_user->group_id == 1 ? companies_dropdown('return', TRUE, "") : FALSE, 'document_types' => $document_types, 'company_id' => $company_id, 'client_id' => $client_id, 'site_id' => $site_id, 'job_id' => $job_id, 'quote_id' => $quote_id, 'equipment_id' => $equipment_id, 'plugins' => array('gallery', 'dropzone'), 'js_files' => array('docs/index.js'));
     if ($this->input->is_ajax_request()) {
         $html = $this->template->raw_view('pages/docs/listing', $data, TRUE);
         if ($method == "ajax") {
             $output['html'] = $html;
             $this->_output_request($output, 'document');
         } else {
             echo $html;
         }
     } else {
         $this->template->load('default', $data);
     }
 }
Пример #2
0
if ($current_user->group_id == GROUP_ADMIN) {
    ?>
						<div class="form-group company_option" <?php 
    if (!_has_company_group_access($group_id)) {
        ?>
style="display:none;"<?php 
    }
    ?>
>
							<label class="col-sm-4 control-label no-padding-right" for="company_id">Agency:</label>
							<div class="col-sm-8">
								<div class="row">
									
									<div class="col-sm-10">
										<?php 
    echo form_dropdown('company_id', companies_dropdown('return', array('first_row' => TRUE)), $company_id, 'id="company_id" class="form-control input-sm" data-placeholder="Select a Agency"');
    ?>
									</div>
									<div class="col-sm-2">
										<a href="<?php 
    echo site_url('agencies/create');
    ?>
" class="btn btn-primary  btn-xs" data-ajax="wdpajax" data-options='{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Agency Detail", "modal" : {"buttons" : true, "modal_success_callback" : "gl.user.form._init_companies(response);", "override" : true}, "params" : "echo"}'>
											<i class="fa fa-level-up"></i>
										</a>
									</div>
								</div>
								<?php 
    echo form_error('company_id', '<label class="error">', '</label>');
    ?>
							</div>
Пример #3
0
                <h4 class="panel-title">File Detail</h4>
			</div>
			
			<?php 
echo form_open_multipart($form_action, ' name="frm-import" class="form-horizontal"');
?>
			<div class="panel-body">
				
				<?php 
if ($current_user->group_id == 1) {
    ?>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="company_id">Company</label>
					<div class="col-sm-7">
						<?php 
    echo form_dropdown('company_id', companies_dropdown('return', TRUE), $company_id, 'id="company_id" class="required form-control" style="width:250px;" data-placeholder="Select Company"');
    ?>
						<?php 
    echo form_error('company_id', '<label class="error">', '</label>');
    ?>
					</div>
				</div>
				<?php 
}
?>

				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="import_sheet">File</label>
					<div class="col-sm-7">
						<?php 
echo form_upload('import_sheet', '', 'id="import_sheet" class="form-control required"');
Пример #4
0
 public function get_all_companies()
 {
     ensure_user_access(TRUE, array('admin'));
     companies_dropdown('ajax');
 }
Пример #5
0
if (in_array($current_user->group_id, array(GROUP_ADMIN, GROUP_STAFF))) {
    ?>
			<a href="<?php 
    echo $new_site_url;
    ?>
" class="btn btn-sm btn-warning mr5 mb10 pull-right wht" style="margin-top:-5px;" data-ajax="wdpajax" data-options='{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Site Detail", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true, "modal_success_callback" : "gl.site.listing.load_grid(g);"}, "params" : "echo" , "grid" : {"_init" : true, "gType" : "default"}}'><i class="fa fa-plus mr5"></i>New Site</a>
			<?php 
}
?>
			
			<?php 
if (in_array($current_user->group_id, array(GROUP_ADMIN, GROUP_STAFF, GROUP_ENGINEER))) {
    ?>
			<div class="pull-right" style="width:300px;margin-right:16px;margin-top:-5px;">
				<?php 
    echo form_dropdown('company', companies_dropdown('return', array('first_row' => TRUE)), $company_id, 'id="companySelect" class="pull-right form-control" data-placeholder="All Companies"');
    ?>
			</div>
			<?php 
}
?>
		</h3>
	</div>
	
	<div class="panel-body">
	
		<div class="table-responsive">

			<table cellpadding="0" id="site_data_table" cellspacing="0" border="0" class="table table-striped table-bordered table-hover">
				<thead>
					<tr>
Пример #6
0
 public function get_all_companies()
 {
     _has_user_access_permission(TRUE, array('admin'));
     companies_dropdown('ajax');
 }
Пример #7
0
						</div>
						
						<div class="tab-pane mb30" id="tab_efn_1">
							
							<div class="row">
								
								<div class="col-sm-12">
							
									<?php 
if (in_array($current_user->group_id, array(GROUP_ADMIN, GROUP_STAFF, GROUP_ENGINEER))) {
    ?>
									<div class="form-group">
										<label class="col-sm-4 control-label no-padding-right" for="company_id">Agency:</label>
										<div class="col-sm-6">
											<?php 
    echo form_dropdown('company_id', companies_dropdown('return', array('first_row' => TRUE)), $company_id, 'id="company_id" class="required form-control" style="width:250px;" data-placeholder="Select Agency"');
    ?>
											<?php 
    echo form_error('company_id', '<label class="error">', '</label>');
    ?>
										</div>
									</div>
									<?php 
}
?>

									<div class="form-group">
										<label class="col-sm-4 control-label no-padding-right" for="district_no">District No:</label>
										<div class="col-sm-6">
											<?php 
echo form_input('district_no', $district_no, 'id="district_no" class="form-control input-sm"');
Пример #8
0
<div class="grid-list">
	<form name="grid-list-param" data-options='{"grid" : { "_grid_url" : "<?php 
echo $grid_action;
?>
" }}' style="display:none;"></form>
	<div class="mb20">
		<label>Agencies</label>
		<?php 
echo form_dropdown('company_id', companies_dropdown('return', array('first_row' => TRUE)), '', 'id="companySelect" data-placeholder="All Companies" data-role="none"');
?>
	</div>
	<table cellpadding="0" id="site_data_table" cellspacing="0" border="0" class="table">
		<thead>
			<tr>
				<th>Site ID</th>
					<?php 
if ($current_user->group_id == 1) {
    ?>
					<th>Company</th>
					<?php 
}
?>
					<th>Address</th>
					<th>Street</th>
					<th>Town</th>
					<th>Postcode</th>
					<th>Date Added</th>
					<th>Added By</th>
					<th>Added On</th>
					<th>Action</th>
			</tr>