Exemplo n.º 1
0
 public function getTable()
 {
     ensure_user_access(TRUE, array('admin'));
     $params = array('iDisplayStart' => $this->input->get_post('iDisplayStart', true), 'iDisplayLength' => $this->input->get_post('iDisplayLength', true), 'iSortCol_0' => $this->input->get_post('iSortCol_0', true), 'iSortingCols' => $this->input->get_post('iSortingCols', true), 'sSearch' => $this->input->get_post('sSearch', true), 'sEcho' => $this->input->get_post('sEcho', true));
     $listing = $this->company_m->ajax_get_parts($params);
     foreach ($listing['aaData'] as &$qrow) {
         $ID = $qrow['ID'];
         $company_name = $qrow['company_name'];
         /*$qrow[count($qrow)-3] = tz_text($qrow[count($qrow)-3]);*/
         /* data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Event permission <small>'.$company_name.'</small>", "modal" : {"buttons" : true}, "params" : "echo"}\'*/
         $qrow = array($qrow['company_name'], $qrow['phone'], $qrow['default_contact'], tz_text($qrow['gmt_offset']), $qrow['created_by_name'], theme_button_dropdown(array('edit' => array('href' => site_url('companies/edit/' . $ID), 'title' => 'Edit Company', 'text' => 'Edit Company', 'params' => ' data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Edit Company <small>' . $company_name . '</small>", "modal" : {"buttons" : true}, "params" : "echo"}\'', 'class' => array()), 'delete' => array('href' => site_url('companies/delete/' . $ID), 'title' => 'Delete Company', 'text' => 'Delete Company', 'params' => ' data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Delete Company <small>' . $company_name . '</small>", "modal" : {"buttons" : true}, "params" : "echo"}\'', 'class' => array()), 'notes' => array('href' => site_url('notes/index/' . wdp_arr_encode(array(WDP_REF_ID => $ID, WDP_NOTE_TYPE_ID => NOTE_TYPE_COMPANY))), 'title' => 'Notes <small>(Company: ' . $company_name . ')</small>', 'text' => 'Notes', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Notes <small>(Company: ' . $company_name . ')</small>", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true, "nopadd" : false, "modal_before_close_callback" : "wdp.notes.close_grid(g);", "callback" : "wdp.notes.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "next"}}\'', 'class' => array()), 'new_note' => array('href' => site_url('notes/create/' . wdp_arr_encode(array(WDP_REF_ID => $ID, WDP_NOTE_TYPE_ID => NOTE_TYPE_COMPANY))), 'title' => 'Add Note <small>(Company: ' . $company_name . ')</small>', 'text' => 'Add Note', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Note Detail <small>(Company: ' . $company_name . ')</small>", "modal" : {"buttons" : true}, "params" : "echo"}\'', 'class' => array()), 'contacts' => array('href' => site_url('contacts/index/' . wdp_arr_encode(array(WDP_REF_ID => $ID, WDP_TYPE_ID => CONTACT_TYPE_COMPANY))), 'title' => 'Show Contacts <small>(Company: ' . $company_name . ')</small>', 'text' => 'Show Contacts', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Contacts <small>(Company: ' . $company_name . ')</small>", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true, "nopadd" : false, "modal_before_close_callback" : "wdp.contacts.close_grid(g);", "callback" : "wdp.contacts.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "next"}}\'', 'class' => array()), 'new_contact' => array('href' => site_url('contacts/create/' . wdp_arr_encode(array(WDP_REF_ID => $ID, WDP_TYPE_ID => CONTACT_TYPE_COMPANY))), 'title' => 'Contact Detail<small>(Company: ' . $company_name . ')</small>', 'text' => 'Add Contact', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Contact Detail <small>(Company: ' . $company_name . ')</small>", "modal" : {"buttons" : true}, "params" : "echo"}\'', 'class' => array())), array('detail_icon' => ICON_COMPANIES)) . theme_button_dropdown(array('settings' => array('href' => site_url('settings/triggers/index/' . $ID), 'title' => 'Trigger Settings', 'text' => 'Trigger Settings', 'params' => '', 'class' => array()), 'account_settings' => array('href' => site_url('settings/myaccount/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'Company Settings', 'text' => 'Company Settings', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "POST", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Account Settings' . ($this->current_user->group_id == 1 ? ' (' . $qrow['company_name'] . ')' : '') . '", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true}, "params" : "echo"}\'', 'class' => array()), 'permission_settings' => array('href' => site_url('settings/mygroups/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'Permission Settings', 'text' => 'Permission Settings', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "POST", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Account Permission Settings' . ($this->current_user->group_id == 1 ? ' (' . $qrow['company_name'] . ')' : '') . '", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true}, "params" : "echo"}\'', 'class' => array()), 'cstfld_settings' => array('href' => site_url('settings/custom_fields/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'Custom Field Settings', 'text' => 'Custom Field Settings', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Custom Field Settings' . ($this->current_user->group_id == 1 ? ' (' . $qrow['company_name'] . ')' : '') . '", "modal" : {"buttons" : true, "override" : true}, "params" : "echo"}\'', 'class' => array()), 'my_pdf_templates_settings' => array('href' => site_url('settings/pdf_templates/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'PDF Template Settings', 'text' => 'PDF Template Settings', 'params' => '', 'class' => array()), 'timesheet' => array('href' => site_url('jobs/timesheet/index/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'Timesheet', 'text' => 'Timesheet', 'params' => '', 'class' => array()), 'cost' => array('href' => site_url('cost/index/' . $ID), 'title' => 'Unassigned Labour/Mileage', 'text' => 'Unassigned Labour/Mileage', 'params' => '', 'class' => array())), array('detail_icon' => ICON_SETTING, 'detail_margin' => 'ml5', 'group_seperator' => FALSE)) . theme_button_dropdown(array('clients' => array('href' => site_url('clients/index/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'Clients <small>' . $company_name . '</small>', 'text' => 'Clients', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Clients <small>(Company: ' . $company_name . ')</small>", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true, "nopadd" : false, "modal_before_close_callback" : "wdp.clients.close_grid(g);", "callback" : "wdp.clients.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "next"}}\'', 'class' => array()), 'new_client' => array('href' => site_url('clients/create/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'New Client <small>' . $company_name . '</small>', 'text' => 'New Client', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Client Detail", "modal" : {"buttons" : true}, "params" : "echo", "form_data" : {"company_id" : ' . $ID . '}}\'', 'class' => array()), 'invoices' => array('href' => site_url('invoices/index/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'Invoices <small>' . $company_name . '</small>', 'text' => 'Invoices', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Invoices <small>(Company: ' . $company_name . ')</small>", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true, "nopadd" : false, "modal_before_close_callback" : "wdp.invoice.listing.close_grid(g);", "callback" : "wdp.invoice.listing.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "next"}}\'', 'class' => array()), 'new_invoice' => array('href' => site_url('invoices/create/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'New Invoice <small>' . $company_name . '</small>', 'text' => 'New Invoice', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Invoice Detail", "modal" : {"buttons" : true}, "params" : "echo", "form_data" : {"company_id" : ' . $ID . '}}\'', 'class' => array()), 'consumables' => array('href' => site_url('consumables/index/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'Consumables <small>' . $company_name . '</small>', 'text' => 'Consumables', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Consumables <small>(Company: ' . $company_name . ')</small>", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true, "nopadd" : false, "modal_before_close_callback" : "wdp.consumable.listing.close_grid(g);", "callback" : "wdp.consumable.listing.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "next"}}\'', 'class' => array()), 'new_consumable' => array('href' => site_url('consumables/create/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'New Consumable Set <small>' . $company_name . '</small>', 'text' => 'New Consumable Set', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Consumable Set", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true}, "params" : "echo"}\'', 'class' => array()), 'suppliers' => array('href' => site_url('suppliers/index/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'Suppliers <small>' . $company_name . '</small>', 'text' => 'Suppliers', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Suppliers <small>(Company: ' . $company_name . ')</small>", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true, "nopadd" : false, "modal_before_close_callback" : "wdp.supplier.listing.close_grid(g);", "callback" : "wdp.supplier.listing.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "next"}}\'', 'class' => array()), 'new_supplier' => array('href' => site_url('suppliers/create/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'New Supplier <small>' . $company_name . '</small>', 'text' => 'New Supplier', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Suppliers Detail", "modal" : {"buttons" : true}, "params" : "echo"}\'', 'class' => array()), 'parts' => array('href' => site_url('parts_list/index/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'Parts <small>' . $company_name . '</small>', 'text' => 'Parts', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Parts <small>(Company: ' . $company_name . ')</small>", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true, "nopadd" : false, "modal_before_close_callback" : "wdp.parts.listing.close_grid(g);", "callback" : "wdp.parts.listing.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "next"}}\'', 'class' => array()), 'new_part' => array('href' => site_url('parts_list/create/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'New Part <small>' . $company_name . '</small>', 'text' => 'New Part', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Part Detail", "modal" : {"buttons" : true}, "params" : "echo"}\'', 'class' => array()), 'quotes' => array('href' => site_url('quotes/index/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'Quotes <small>' . $company_name . '</small>', 'text' => 'Quotes', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Quotes <small>(Company: ' . $company_name . ')</small>", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true, "nopadd" : false, "modal_before_close_callback" : "wdp.quotes.listing.close_grid(g);", "callback" : "wdp.quotes.listing.load_grid(g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "next"}}\'', 'class' => array()), 'new_quote' => array('href' => site_url('quotes/create/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'New Quote <small>' . $company_name . '</small>', 'text' => 'New Quote', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Quote Detail", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true}, "params" : "echo"}\'', 'class' => array()), 'jobs' => array('href' => site_url('summary/index/' . wdp_arr_encode(array(WDP_COMPANY_ID => $ID))), 'title' => 'Jobs <small>(Company: ' . $company_name . ')</small>', 'text' => 'Jobs', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Jobs <small>(Company: ' . $company_name . ')</small>", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true, "nopadd" : false, "modal_before_close_callback" : "wdp.jobs.close_grid(g);", "callback" : "wdp.jobs.fm(frm, g);"}, "params" : "echo", "grid" : {"_init" : true, "gType" : "next"}}\'', 'class' => array()), 'new_job' => array('href' => site_url('job/create'), 'title' => 'Job Detail <small>(Company: ' . $company_name . ')</small>', 'text' => 'New Job', 'params' => 'data-ajax="wdpajax" data-options=\'{"form_method" : "POST", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "Job Detail", "modal" : {"buttons" : false, "footer" : false, "size" : "modal-lg", "wizard" : true, "override" : true}, "params" : "echo", "form_data" : {"company_id" : ' . $ID . '}}\'', 'class' => array())), array('detail_icon' => ICON_TASKS, 'detail_margin' => 'ml5', 'group_seperator' => FALSE)));
     }
     echo json_encode($listing);
 }
Exemplo n.º 2
0
                    ?>
" title="<?php 
                    echo $attachment->original_name;
                    ?>
"><i class="fa fa-link"></i></a>
							<?php 
                }
            }
            ?>
						
							<a href="<?php 
            echo site_url('purchase_orders/po_request_show/' . wdp_arr_encode(array(WDP_PO_REQUEST_ID => $por_row->id)));
            ?>
" title="View PO Request" data-ajax="wdpajax" data-options='{"form_method" : "GET", "data_type" : "HTML", "role" : "modal", "created_new" : true, "title" : "PO Request Detail", "modal" : {"buttons" : false, "size" : "modal-lg"}, "params" : "echo"}' style="width:auto;"><span class="fa fa-eye" style="margin-right:5px;"></span></a>
							<a href="<?php 
            echo site_url('purchase_orders/po_request_update/' . wdp_arr_encode(array(WDP_PO_REQUEST_ID => $por_row->id)));
            ?>
"  title="Mark As Complete" style="width:auto;"><span class="fa fa-check"></span></a>
						</span>
					</li>
					<?php 
        }
        ?>
				<?php 
    } else {
        ?>
				<li>No New records(s)</li>
				<?php 
    }
    ?>
				<li class="new"><a href="<?php