Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PHPgrid
<?php
#DISPLAYS UNIT EQUIPMENT LIST (unit_equipment_list.php)
##################
# INCLUDED FILES #
##################
include_once("assets/auth.php"); //USER PERMISSIONS
include_once("data/config.php"); //PHP GRID CONNECTION STRING
include_once("data/connect.php"); //DATA BASE CONNECTION STRING (MINE)
include("lib/inc/jqgrid_dist.php"); //GRID INCLUDE
include_once('lib/PHPExcel-1.8/Classes/PHPExcel/IOFactory.php');
#####################
# CHECK PERMISSIONS #
#####################
if(isset($_SESSION['user'])) { $uname = $_SESSION['user']; }
####################
# GET ADMIN STATUS #
####################
$sql = mysqli_query($conn, "SELECT * FROM tbl_users WHERE user_name = '$uname'");
$u = mysqli_fetch_array($sql);
$utype = $u['user_type'];
##################################
# SEE IF UNIT/JOB INFO IS PASSED #
##################################
if(isset($_GET['job']))
{
$jid=$_GET['job'];
}
if(isset($_GET['unit']))
{
$uid=$_GET['unit'];
} else { $uid=0; }
#########################
# GET JOB AND UNIT INFO #
#########################
//QUERY TABLE UNIT FOR JOB AND CUSTOMER INFO
$q_info1=mysqli_query($conn, "SELECT * FROM tbl_unit
LEFT JOIN tbl_job ON fk_job_id = job_id
LEFT JOIN tbl_customer ON fk_customer = customer_id
WHERE unit_id = '$uid'
");
//IF UNIT NUMBER FROM URL IS NOT THERE - QUERY TABLE FOR JOB NUMBER AND CUSTOMER
if (mysqli_num_rows($q_info1)== 0) {
$q_info1=mysqli_query($conn, "SELECT * FROM tbl_job
LEFT JOIN tbl_customer ON fk_customer = customer_id
WHERE job_id = $jid");
}
$q_info2=mysqli_fetch_array($q_info1);
#######################
# SEND DATABASE FILES #
#######################
$db_conf = array(
"type" => PHPGRID_DBTYPE,
"server" => PHPGRID_DBHOST,
"user" => PHPGRID_DBUSER,
"password" => PHPGRID_DBPASS,
"database" => PHPGRID_DBNAME
);
#################
# SET MENU PAGE #
#################
$current = '';
$title = 'EQUIPMENT LIST';
###################
# CREATE NEW GRID #
###################
$g = new jqgrid($db_conf);
//$g->debug = 0;
#####################
# CHECK PERMISSIONS #
#####################
if(isset($_SESSION['user'])) { $uname = $_SESSION['user']; }
##########################
# CHANGE DESCRIPTION BAR #
##########################
if ($uid != 0) {
$desc1 = "UNIT#: " . $q_info2['unit_number'] . " - " . $q_info2['unit_description'] ." <br> " . $q_info2['company_name'] . " - " . $q_info2['job_description'] . " - KODIAK GROUP PROJECT #" . $q_info2['job_number'];
} else {
$desc1 = "SELECT UNIT NUMBER <br>" . $q_info2['company_name'] . " - " . $q_info2['job_description'] . " - KODIAK GROUP PROJECT #" . $q_info2['job_number'];
}
#############
# JOB NOTES #
#############
$qnotes = mysqli_query($conn, "SELECT * FROM job_notes WHERE fk_job_id = $jid");
if (mysqli_num_rows($qnotes)== 0) {
$desc2 = $desc1 . "<span style='float: right; padding-left: 20px;'> <a title='Job Notes' target='_blank' class='fancybox fas fa-comment-slash' data-fancybox-type='iframe' href='assets/job_notes.php?job=$jid'></a></span>";
} else {
$desc2 = $desc1 . "<span style='float: right; padding-left: 20px;'> <a title='Job Notes' target='_blank' class='fancybox fas fa-comment' data-fancybox-type='iframe' href='assets/job_notes.php?job=$jid'></a></span>";
}
################
# JOB CONTACTS #
################
$qcontacts = mysqli_query($conn, "SELECT * FROM job_contacts WHERE fk_job_id = $jid");
if (mysqli_num_rows($qcontacts )== 0) {
$desc3 = $desc2 . "<span style='float: right; padding-left: 80px; color: LightGray;'> <a title='Job Contacts' target='_blank' class='fancybox fas fa-users' data-fancybox-type='iframe' href='assets/job_contacts.php?job=$jid'></a></span>";
} else {
$desc3 = $desc2 . "<span style='float: right; padding-left: 80px;'> <a title='Job Contacts' target='_blank' class='fancybox fas fa-users' data-fancybox-type='iframe' href='assets/job_contacts.php?job=$jid'></a></span>";
}
$desc = $desc3;
##############################################
# FLASH ARCHIVED IF FILE IS AN ARCHIVED FILE #
##############################################
if ($q_info2['job_status'] == "ARCHIVED") {
$arch = 1;
$desc = $desc . "<br> <div class='blink'> *** ARCHIVED ***</div>";
}
################
# GRID OPTIONS #
################
$grid = array(); // grid as array
$grid["caption"] = $title; // caption of grid
$grid["sortname"] = 'kodiak_part_number'; // sort by kodiak job number
$grid["sortorder"] = "ASC"; // ascending order
$grid["reloadedit"] = true; // reload on update / edit
$grid["subGrid"] = true; // sungrid page on
$grid["subgridurl"] = "eq_documents.php"; // subgrid page
$grid["subgridparams"] = "fk_eq_id"; // comma sep. fields. will be POSTED from parent grid to subgrid, can be fetching using $_REQUEST in subgrid
$grid["autowidth"] = false; // expand grid to screen width
$grid["height"] = "100%";
$grid["rowList"] = array(100,200,300);
$grid["rowNum"] = 100;
$grid["loadComplete"] = "function (id) { grid_load(id); }"; //
$grid["onSelectRow"] = "function (id) { grid_select(id); }"; //
$grid["loadComplete"] = "function(ids) { grid_onload(ids); }";
$g->set_options($grid); // set grid options
##############################
# SET GRID C.R.U.D. SETTINGS #
##############################
#Change options if or if not a unit is selected / and permissions
if ($arch != 1 && $uid != 0) {
$g->set_actions(array(
"add"=>true, // Enable / Disable add operation on grid. Defaults to true.
"edit"=>true, // Enable / Disable edit operation on grid. Defaults to true.
"delete"=>true, // Enable / Disable delete operation on grid. Defaults to true.
"view"=>false, // Enable / Disable view operation on grid. Defaults to true.
"inline"=>true, // Enable / Disable button to perform insertion inline. Defaults to false.
"search" => "advance", // Search property can have 3 values, simple, advance or false to hide.
"export_excel"=>false, // export excel button
"export_pdf"=>true, // export pdf button
"export_csv"=>false, // export csv button
"import"=> false, // Enable / Disable import data option. Defaults to false.
"showhidecolumns" => false // Enable / Disable button to hide certain columns from client side. Defaults to true.
)
);
} else {
$g->set_actions(array(
"add"=>false, // Enable / Disable add operation on grid. Defaults to true.
"edit"=>false, // Enable / Disable edit operation on grid. Defaults to true.
"delete"=>false, // Enable / Disable delete operation on grid. Defaults to true.
"autofilter" => false, // Show/hide autofilter for search
"view"=>false, // Enable / Disable view operation on grid. Defaults to true.
"inline"=>false, // Enable / Disable button to perform insertion inline. Defaults to false.
"search" => false, // Search property can have 3 values, simple, advance or false to hide.
"export"=>false, // Enable / Disable export to excel option. Defaults to false.
"showhidecolumns" => false // Enable / Disable button to hide certain columns from client side. Defaults to true.
)
);
}
###############################
# MAIN QUERY (EQUIPMENT LIST) #
###############################
$g->select_command = "SELECT * FROM tbl_unit_info
INNER JOIN tbl_equipment ON tbl_equipment.eq_id = tbl_unit_info.fk_eq_id
LEFT JOIN tbl_ship_to ON tbl_ship_to.ship_id = tbl_unit_info.fk_ship_to
LEFT JOIN tbl_customer ON tbl_customer.customer_id = tbl_unit_info.fk_supplier
WHERE tbl_unit_info.fk_unit_id ='$uid'
";
###################################
# REMOVE BUTTONS FROM GRID HEADER #
###################################
$g->navgrid["param"]["edit"] = false; // remove edit from top menu
$g->navgrid["param"]["add"] = false; // remove add from top menu
######################
# SET DATABASE TABLE #
######################
$g->table = "tbl_unit_info";
####################################
# SETUP COLUMNS TO DISPLAY IN GRID #
####################################
/////////////
// UNIT ID //
/////////////
$col = array();
$col["title"] = "Id";
$col["name"] = "unit_info_id";
$col["width"] = "20";
$col["hidden"] = true;
$col["export"] = false;
$cols[] = $col;
/////////////
// CHANGE REQUEST //
/////////////
$col = array();
$col["title"] = "change_req";
$col["name"] = "change_req";
$col["width"] = "100";
$col["editable"] = true;
$col["hidden"] = true;
$col["export"] = false;
$cols[] = $col;
////////////////////
// PURCHASE ORDER //
////////////////////
$col = array();
$col["title"] = "Purchase_Order";
$col["name"] = "purchase_order";
$col["editable"] = true;
$col["hidden"] = true;
$col["width"] = "70";
$col["export"] = false;
$cols[] = $col;
//////////////////
// QUOTE SUBMIT //
//////////////////
$col = array();
$col["title"] = "ui_qoute_submit";
$col["name"] = "ui_qoute_submit";
$col["editable"] = true;
$col["hidden"] = true;
$col["width"] = "70";
$col["export"] = false;
$cols[] = $col;
//////////////
// LOCK ROW //
//////////////
$col = array();
$col["title"] = "P.O.<br>Lock";
$col["name"] = "lock_row";
$col["width"] = "30";
$col["export"] = false;
$col["search"] = false;
$col["sortable"] = false;
$col["align"] = "center";
//$row_unlocked = "<i class='fa fa-unlock fa-lg' aria-hidden='true'></i>";
//$row_locked="<a style='font-size: 12px; color: Red;' title='Job Contacts' target='_blank' class='fancybox' data-fancybox-type='iframe' href='eq_change_request.php?eqid={fk_eq_id}&unit=$uid&job=$jid&uiid={unit_info_id}'><i class='fa fa-lock fa-lg' aria-hidden='true'></i></a>";
$col["on_data_display"] = array("display_keyword","");
//$col["condition"] = array('$row["purchase_order"] > 0', $row_locked, $row_unlocked);
$col["export"] = false;
$cols[] = $col;
//CONDITIONAL BUTTONS
function display_keyword($data)
{
global $uid;
global $jid;
$eq_id = $data['fk_eq_id'];
$unid = $data['unit_info_id'];
// CHANGE_REQ
// 0 = NO REQUEST
// 1 = PENDING
// 2 = ACCEPTED
//NO PO, & NO REQUEST
if ($data["ui_qoute_submit"] <= 0 && $data["change_req"] <= 0)
{
$code = "<i class='fa fa-unlock fa-lg' aria-hidden='true'></i>";
}
//PO EXISTS, REQUEST COULD BE PENDING (0 OR 1)
if ($data["change_req"] <= 1 && $data["ui_qoute_submit"] > 0)
{
$code = "<a style='font-size: 12px; color: Red;' title='Job Contacts' target='_blank' class='fancybox' data-fancybox-type='iframe' href='eq_change_request.php?eqid=$eq_id&unit=$uid&job=$jid&uiid=$unid'><i class='fa fa-lock fa-lg' aria-hidden='true'></i></a>";
}
return $code;
}
//////////////////////////
// RESPONSIBILITY NOTES //
//////////////////////////
$col = array();
$col["title"] = "Responsiblity Notes";
$col["name"] = "responsibility_notes";
$col["editable"] = true;
$col["width"] = "100";
$col["edittype"] = "select";
$col["editoptions"] = array("value"=>'FABRICATION:FABRICATION; PURCHASED BY KODIAK:PURCHASED BY KODIAK;PURCHASED BY SHOP:PURCHASED BY SHOP;FABRICATED BY OTHERS:FABRICATED BY OTHERS; PURCHASED BY OTHERS:PURCHASED BY OTHERS; : ');
$col["editrules"] = array("required"=>false, "readonly"=>true, "readonly-when"=>"check_po");
$col["export"] = true;
$cols[] = $col;
////////////////////
// ASSEMBLY NOTES //
////////////////////
$col = array();
$col["title"] = "Assembly Notes";
$col["name"] = "assembly_notes";
$col["editable"] = true;
$col["width"] = "100";
$col["editrules"] = array("required"=>false, "readonly"=>true, "readonly-when"=>"check_po");
$col["export"] = true;
$cols[] = $col;
///////////////////
// GENERAL NOTES //
///////////////////
$col = array();
$col["title"] = "General Notes";
$col["name"] = "general_notes";
$col["editable"] = true;
$col["width"] = "100";
$col["editrules"] = array("required"=>false, "readonly"=>true, "readonly-when"=>"check_po");
$col["export"] = true;
$cols[] = $col;
////////////////////////
// KODIAK PART NUMBER //
////////////////////////
$col = array();
$col["title"] = "Kodiak Part Number";
$col["name"] = "kodiak_part_number";
$col["editable"] = true;
$col["editoptions"]["defaultValue"] = $q_info2['job_number'] . "-" . $q_info2['unit_number'] . "-"; //DEFAULT TEXT
$col["editrules"] = array("required"=>false, "readonly"=>true, "readonly-when"=>"check_po");
$col["width"] = "100";
$col["export"] = true;
$cols[] = $col;
//////////////
// FK EQ ID //
//////////////
$col = array();
$col["title"] = "fk_eq_id";
$col["name"] = "fk_eq_id";
$col["editable"] = true;
$col["hidden"] = true;
$col["width"] = "50";
$col["export"] = false;
$cols[] = $col;
////////////////
// FK UNIT ID //
////////////////
$col = array();
$col["title"] = "fk_unit_id";
$col["name"] = "fk_unit_id";
$col["editable"] = true;
$col["hidden"] = true;
$col["width"] = "50";
$col["export"] = false;
$cols[] = $col;
//////////////////////////////
// MANUFACTURER PART NUMBER //
//////////////////////////////
$col = array();
$col["title"] = "Manufacturer Part Number";
$col["name"] = "eq_part_number";
$col["editable"] = true;
$col["width"] = "100";
$col["align"] = "right";
$col["formatter"] = "autocomplete";
$col["editrules"] = array("readonly"=>true, "readonly-when"=>"check_placeholder");
$str = array("sql"=>"SELECT *, eq_part_number as v FROM tbl_equipment WHERE eq_manufacturer = '{eq_manufacturer}' AND eq_part_number LIKE '%{eq_part_number}%' OR '{eq_manufacturer}' = '' ORDER BY eq_manufacturer desc LIMIT 500",
"search_on"=>"eq_part_number",
"callback"=>"fill_form");
$col["formatoptions"] = $str;
$col["export"] = true;
$cols[] = $col;
//////////////////
// MANUFACTURER //
//////////////////
$col = array();
$col["title"] = "Manufacturer";
$col["name"] = "eq_manufacturer";
$col["editable"] = true;
$col["align"] = "right";
$col["width"] = "100";
$col["formatter"] = "autocomplete";
$col["editrules"] = array("required"=>false, "readonly"=>true, "readonly-when"=>"check_placeholder");
$col["formatoptions"] = array( "sql"=>"SELECT DISTINCT(eq_manufacturer) as v FROM tbl_equipment ORDER BY eq_manufacturer desc LIMIT 500",
"search_on"=>"eq_manufacturer");
$col["export"] = true;
$cols[] = $col;
/////////
// QTY //
/////////
$col = array();
$col["title"] = "QTY";
$col["name"] = "qty";
$col["editable"] = true;
$col["width"] = "30";
$col["align"] = "center";
$col["editrules"] = array("required"=>false, "readonly"=>true, "readonly-when"=>"check_po");
$col["export"] = true;
$cols[] = $col;
//////////////////////////////
// MANUFACTURER DESCRIPTION //
//////////////////////////////
$col = array();
$col["title"] = "Manufacturer Description";
$col["name"] = "eq_description";
$col["editable"] = true;
$col["width"] = "450";
$col["formatter"] = "autocomplete";
$col["editrules"] = array("required"=>true, "readonly"=>true, "readonly-when"=>"check_placeholder");
$str = array( "sql"=>"SELECT *, eq_description as v FROM tbl_equipment WHERE eq_manufacturer = '{eq_manufacturer}' AND eq_description LIKE '%{eq_description}%' OR '{eq_manufacturer}' = 'PLACE HOLDER' AND eq_manufacturer = 'PLACE HOLDER' AND eq_description LIKE '%{eq_description}%' OR '{eq_manufacturer}' = '' AND eq_manufacturer != 'PLACE HOLDER' ORDER BY eq_description desc LIMIT 500",
"search_on"=>"concat(eq_id, eq_description)",
"callback"=>"fill_form");
$col["formatoptions"] = $str;
$col["export"] = true;
$cols[] = $col;
/////////////////////////
// REC SPARES CHECKBOX //
/////////////////////////
$col = array();
$col["title"] = "Rec.<br>Spare";
$col["name"] = "rec_spare";
$col["width"] = "30";
$col["edittype"] = "checkbox";
$col["formatter"] = "checkbox";
$col["editoptions"] = array("value"=>"1:0");
$col["editable"] = true;
$col["export"] = false;
$col["align"] = "center";
$cols[] = $col;
////////////////
// CHECKED BY //
////////////////
$col = array();
$col["title"] = "Chk By";
$col["name"] = "checked_by";
$col["editable"] = true;
$col["width"] = "30";
$col["export"] = false;
$cols[] = $col;
//////////////////////////
// PRICE HISTORY BUTTON //
//////////////////////////
$col = array();
$col["title"] = "Price<br>History";
$col["name"] = "view_price";
$col["fixed"] = true;
$col["width"] = "50";
$col["align"] = "center";
$col["search"] = false;
$col["sortable"] = false;
$col["export"] = false;
$col["editable"] = false;
$col["export"] = false;
$buttons_html = "<a target='_blank' class='fancybox ui-custom-icon ui-icon ui-icon-eye' data-fancybox-type='iframe' href='assets/getprice.php?eqid={fk_eq_id}&fkunit={fk_unit_id}'></a>";
$col["default"] = $buttons_html;
$cols[] = $col;
////////////////////////
// ADD COOKED COLUMNS //
////////////////////////
$g->set_columns($cols);
#########################
# CONDITIONAL FORMATING #
#########################
$f = array();
$f["column"] = "eq_manufacturer";
$f["op"] = "=";
$f["value"] = "PLACE HOLDER";
//$f["celclass"] = "focus-cell";
$f["css"] = "'background-color':'#FFA500', 'color':'black'";
$f_conditions[] = $f;
$f = array();
$f["column"] = "qty";
$f["target"] = "qty";
$f["op"] = "=";
$f["value"] = "0";
$f["cellclass"] = "focus-cell";
$f_conditions[] = $f;
$f = array();
$f["column"] = "kodiak_part_number";
$f["target"] = "kodiak_part_number";
$f["op"] = "=";
$f["value"] = $q_info2['job_number'] . "-" . $q_info2['unit_number'] . "-";
$f["cellclass"] = "focus-cell";
$f_conditions[] = $f;
$g->set_conditional_css($f_conditions);
################
# EVENTS CALLS #
################
$e["on_insert"] = array("add_edit_equipment", null, true);
$e["on_update"] = array("add_edit_equipment", null, true);
$g->set_events($e);
##########################
# CALLED EVENT FUNCTIONS #
##########################
function add_edit_equipment($data)
{
////////////////////////
// GLOBAL VARIABLE(S) //
////////////////////////
global $uid;
global $g;
global $uname;
/////////////////////////////////////
// SET COLUMN TO UPPER CASE ON ADD //
/////////////////////////////////////
$data["params"]["eq_description"] = strtoupper($data["params"]["eq_description"]); //TO UPPER EQ DESCRIPTION
$data["params"]["eq_manufacturer"] = strtoupper($data["params"]["eq_manufacturer"]); //TO UPPER EQ MANUFACTURER
$data["params"]["assembly_notes"] = strtoupper($data["params"]["assembly_notes"]); //TO UPPER EQ ASSEMBLY NOTES
$data["params"]["general_notes"] = strtoupper($data["params"]["general_notes"]); //TO UPPER EQ GENERAL NOTES
$data["params"]["checked_by"] = strtoupper($data["params"]["checked_by"]); //TO UPPER EQ CHECKED BY
///////////////////
// SET VARIABLES //
///////////////////
$q = $data["params"]["qty"]; // QTY
$m = $data["params"]["eq_manufacturer"]; // MANUFACTURER
$d = $data["params"]["eq_description"]; // DESCRIPTION
$p = $data["params"]["eq_part_number"]; // PART NUMBER
$u = $uname;
$dt = date("Y/m/d");
$data["params"]["fk_unit_id"] = $uid; // SET FK_UNIT_ID TO UNIT_ID
///////////////
// CHECK QTY //
///////////////
if (empty($q)) { // IF QTY IS NULL SET TO ZERO
$data["params"]["qty"] = "0"; // SET QTY TO 0
} // END IF
//////////////////////////////////////////////////
// CHECK FOR PLACE HOLDER IN MANUFACTURER FIELD //
//////////////////////////////////////////////////
if ($m != "PLACE HOLDER") { // NOT PLACE HOLDER
$rs = $g->get_one("SELECT * FROM tbl_equipment WHERE eq_manufacturer=? AND eq_part_number=?",array($m,$p)); // ONLY CHECKING MANUFACTURER PART NUMBER
if(!empty($rs['eq_id'])) { // CHECK IF EQ EXISTS
$data["params"]["fk_eq_id"] = $rs['eq_id']; // SET FK_EQ_ID TO EQ_id
} // END IF
if (empty($rs)) { // DATA DID NOT EXIST
unset($data["params"]["fk_eq_id"]); // UNSET FK_EQ_ID
// INSERT NEW EQ (STORE USER CREATED ITEMS)
$insert_id = $g->execute_query("INSERT INTO tbl_equipment (eq_manufacturer,eq_description,eq_part_number, eq_created_by, created_date) VALUES (?,?,?,?,?)",array($m,$d,$p,$u,$dt),"insert_id");
$data["params"]["fk_eq_id"] = $insert_id; // FK_EQ_ID TO NEW EQ_ID
}
}else{ // PLACE HOLDER (PH)
$rs = $g->get_one("SELECT * FROM tbl_equipment WHERE eq_description=?",array($d)); // ONLY CHECKING DESCTIPTION AS 'MATCH' CHECK
if(!empty($rs['eq_id'])) { // DESCRIPTION MATCH
$data["params"]["fk_eq_id"] = $rs['eq_id']; // SET ID TO FK_EQ_ID
} // END IF
if (empty($rs)) // DESCRIPTION DID NOT EXIST
{
unset($data["params"]["fk_eq_id"]); // UNSET FK_EQ_ID
unset($data["params"]["eq_part_number"]); // UNSET EQ_PART_NUMBER
// INSERET NEW PLACE HOLDER EQ (STORE USER CREATED ITEMS)
$insert_id = $g->execute_query("INSERT INTO tbl_equipment (eq_manufacturer,eq_description,eq_part_number, eq_created_by, created_date) VALUES (?,?,?,?,?)",array($m,$d,$p,$u,$dt),"insert_id");
$data["params"]["fk_eq_id"] = $insert_id; // SET FK_EQ_ID TO NEW EQ_ID
$p = $data["params"]["eq_part_number"] = "PH" . $insert_id . "PH"; // CREATE PH ID
// UPDATE MANUFACTERER PART NUMBER WITH PH NUMBER
$g->execute_query("UPDATE tbl_equipment SET eq_part_number ='$p' WHERE eq_id = '$insert_id'");
}
}
/////////////////////////////////////////////////////////////
// UNSET ALL COLUMNS THAT DONOT BELONG TO DEFAULT DATABASE //
/////////////////////////////////////////////////////////////
unset($data["params"]["eq_manufacturer"]); // UNSET MANUFACTURER
unset($data["params"]["eq_description"]); // UNSET MANUFACTURER DESCRIPTION
unset($data["params"]["eq_part_number"]); // UNSET MANUFACTERER PART NUMBER
unset($data["params"]["change_req"]); // UNSET CHANGE REQUEST
unset($data["params"]["ui_qoute_submit"]); // UNSET CHANGE REQUEST
}
#######################
# RENDER GRID (list1) #
#######################
$out_eqlist = $g->render("list1");
################
# INCLUDE MENU #
################
include("assets/menu.php");
################
# DISPLAY GRID #
################
echo $out_eqlist;
?>
<!-- JAVA SCRIPT -->
<script>
//FILL EQUIPMENT INFORMATION
function fill_form(data)
{
jQuery("[name=eq_manufacturer].FormElement,[name=eq_manufacturer].editable").val(data.eq_manufacturer);
jQuery("[name=eq_part_number].FormElement,[name=eq_part_number].editable").val(data.eq_part_number);
jQuery("[name=eq_description].FormElement,[name=eq_description].editable").val(data.eq_description);
jQuery("[name=fk_eq_id].FormElement,[name=fk_eq_id].editable").val(data.eq_id);
}
//BLINKER FOR ARCHIVED
function blinker() {
$('.blinking').fadeOut(500);
$('.blinking').fadeIn(500);
}
setInterval(blinker, 1000);
//FANCYBOX
$(document).ready(function() {
$('.fancybox').fancybox({
'width': '100%',
'height': '50%',
'type': 'iframe',
'fitToView' : false
});
});
//REMOVE DELETE ON MULTI-SELECT
function grid_select(id)
{
var grid = $('#list1');
var rowid = grid.getGridParam('selrow');
if (rowid)
{
var data = grid.getRowData(rowid);
if (data.ui_qoute_submit != 0) // show only edit, no delete
{
jQuery("#list1_pager #del_list1, #list1_toppager #del_list1").addClass("ui-state-disabled");
jQuery("#list1_pager #edit_list1, #list1_toppager #edit_list1").removeClass("ui-state-disabled");
}
else
{
jQuery("#list1_pager #edit_list1, #list1_toppager #edit_list1").removeClass("ui-state-disabled");
jQuery("#list1_pager #del_list1, #list1_toppager #del_list1").removeClass("ui-state-disabled");
}
}
}
//REMOVE DELET ON ROWS WITH EQ LIST IN USE
function grid_load()
{
var grid = $('#list1');
var rowids = grid.getDataIDs();
var columnModels = grid.getGridParam().colModel;
// check each visible row
for (var i = 0; i < rowids.length; i++)
{
var rowid = rowids[i];
var data = grid.getRowData(rowid);
if (data.ui_qoute_submit != 0) // show no delete
{
jQuery("tr#"+rowid+" td[aria-describedby$='_act'] span:first").html(jQuery("tr#"+rowid+" td[aria-describedby$='_act']").find("a:first"));
}
}
}
//CHECK IF PO HAS A VALUE
function check_po(formid)
{
purchase_order = jQuery("input[name=ui_qoute_submit]:last, select[name=ui_qoute_submit]:last",formid).val();
if (purchase_order != 0)
{
return true
}
}
//CHECK IF PLACE HOLDER IS SET
function check_placeholder(formid)
{
place_holder = jQuery("input[name=eq_manufacturer]:last, select[name=eq_manufacturer]:last",formid).val();
if (place_holder != "PLACE HOLDER")
{
return true
}
}
//EXPORT UNIT EQUIPMENT LIST
jQuery(document).ready(function(){
//var job = "<?php echo $jid; ?>";
var unit = "<?php echo $uid ?>";
var job = "<?php echo $jid ?>";
jQuery('#list1').jqGrid('navButtonAdd', '#list1_pager',
{
'caption' : 'Export EQ List',
'buttonicon' : 'ui-icon-extlink',
'onClickButton': function()
{
$.fancybox.open({
href: 'eqlist_export.php?unit=' + unit + '&job=' + job,
type: 'iframe',
autoSize: true,
autoSize: false,
fitToView: false,
maxWidth: 550,
maxHeight: 600
});
$(document).ready(function () {
window.setTimeout(function(){
window.location.href = "?unit=" + unit + "&job=" + job;
}, 2000);
});
},
'position': 'last'
});
});
//CUSTOM CLONE BUTTON
jQuery(document).ready(function(){
var job = "<?php echo $jid; ?>";
var unit = "<?php echo $uid; ?>";
jQuery('#list1').jqGrid('navButtonAdd', '#list1_pager',
{
'caption' : 'Clone',
'buttonicon' : 'ui-icon-copy',
'onClickButton': function()
{
$.fancybox.open({
href: 'clone.php?unit='+unit,
type: 'iframe',
autoSize: true,
autoSize: false, // shouldn't be true ?
fitToView: false,
maxWidth: 550,
maxHeight: 600,
});
},
'position': 'last'
});
});
$(document).ready(function() {
$("#test a").click(function() {
alert("click");
});
});
//CONDITIONAL FORMAT - FOR CHANGE REQUEST
function grid_onload(ids)
{
if(ids.rows)
jQuery.each(ids.rows,function(i)
{
if (parseInt(this.change_req) == 1 )
{
jQuery('#list1 tr.jqgrow:eq('+i+')').css('background-image','inherit').css({'background-color':'Silver', 'color':'white', 'text-decoration': 'none'});
}
if (parseInt(this.change_req) == 2 )
{
jQuery('#list1 tr.jqgrow:eq('+i+')').css('background-image','inherit').css({'background-color':'gray', 'color':'white', 'text-decoration': 'line-through'});
}
});
}
</script>
<!-- CSS STYLE -->
<style>
.ui-autocomplete-loading { background:url('https://loading.io/assets/img/landing/curved-bars.svg') #FFFFFF no-repeat right center !important; }
.ui-jqgrid tr.jqgrow td
{
vertical-align: top;
white-space: normal !important;
padding:2px 5px;
}
</style>
</body>
</html>
<!-- TOP MWNU FOR ALL PAGES WITH TOP MENU -->
<?php
##################################
# SEE IF UNIT/JOB INFO IS PASSED #
##################################
$user = ($_SESSION['user']);
$path = 'C:\\';
$l_ver = '1.7';
$t_ver = '1.7?';
$timec = mysqli_query($conn,"SELECT * FROM tbl_timecard_week LEFT JOIN tbl_users ON user_name = '$user' WHERE time_fk_user = user_id ORDER BY time_week_id DESC LIMIT 3");
if(isset($_GET['job']))
{
$jid=$_GET['job']; //SET JOB ID TO STRING
$j_query = mysqli_query($conn, "SELECT * FROM tbl_job WHERE job_id = '$jid'");
$jn = mysqli_fetch_array($j_query);
$job_number = $jn['job_number'] . " - " . $jn['job_description'];
$uquery = mysqli_query($conn, "SELECT * FROM tbl_unit WHERE fk_job_id = '$jid' ORDER BY unit_number ASC");
} else {
$id = mysqli_query($conn, "SELECT *, job_id FROM tbl_job WHERE job_status != 'NP' ORDER BY job_id DESC LIMIT 1");
$lid = mysqli_fetch_array($id);
$jid=$lid['job_id'];
$job_number = $lid['job_number'] . " - " . $lid['job_description'];
$uquery = mysqli_query($conn, "SELECT * FROM tbl_unit WHERE fk_job_id = '$jid' ORDER BY unit_number ASC");
header("Refresh:0; url=master_job_list.php?unit=0&job=$jid");
}
if(isset($_GET['unit']))
{
$uid=$_GET['unit'];
$u_query = mysqli_query($conn, "SELECT * FROM tbl_unit WHERE unit_id = '$uid' ORDER BY unit_number ASC");
$un = mysqli_fetch_array($u_query);
$unit_number = $un['unit_number'] . " - " . $un['unit_description'];
} else { $uid=0; }
//GET ALL JOB NUMBERS
$query1 = mysqli_query($conn, "SELECT * FROM tbl_job WHERE job_status != 'ARCHIVED' AND job_status != 'NP' ORDER BY job_number desc");
$id = mysqli_query($conn, "SELECT job_id FROM tbl_job ORDER BY job_id DESC LIMIT 1");
//FAV QUERY COMMA SEPERATED TABLE
$user_favs = mysqli_query($conn, "SELECT * FROM tbl_users WHERE user_name = '$user'");
$ufav = mysqli_fetch_array($user_favs);
$array = $ufav['user_favs'];
$u_query = mysqli_query($conn, "SELECT * FROM tbl_job
WHERE job_id IN ($array)");
$qusers = mysqli_query($conn, "SELECT * FROM tbl_users WHERE user_name <> '' ORDER BY full_name ASC");
$result_tasks = mysqli_query($conn, "SELECT COUNT(*) as cnt FROM tbl_tasks");
$row_tasks = mysqli_fetch_assoc($result_tasks);
$result_req = mysqli_query($conn, "SELECT COUNT(*) as cnt FROM tbl_eq_change_request");
$row_req = mysqli_fetch_assoc($result_req);
$result_qj = mysqli_query($conn, "SELECT COUNT(*) as cnt FROM tbl_job WHERE job_status <> 'ARCHIVED' AND ck_qb != 1 ");
$row_qj = mysqli_fetch_assoc($result_qj);
$result_qu = mysqli_query($conn, "SELECT COUNT(*) as cnt FROM tbl_unit WHERE ck_qb_unit != 1 AND unit_status != 'INACTIVE' AND unit_status !='ESTIMATE'");
$row_qu = mysqli_fetch_assoc($result_qu);
$req = $row_req['cnt'];
$quj = $row_qu['cnt'] + $row_qj['cnt'];
$task = $row_tasks['cnt'] -1;
if ($row_req['cnt'] < 10) {$req = "0" . $row_req['cnt']; }
if ($quj < 10) {$quj = "0" . ($row_qu['cnt'] + $row_qj['cnt']); }
if ($row_tasks['cnt'] < 10) {$task = "0" . ($row_tasks['cnt'] -1); }
if ($row_qu['cnt'] < 10) {$qbu = "0" . $row_qu['cnt']; } else {$qbu = $row_qu['cnt'];}
if ($row_qj['cnt'] < 10) {$qbj = "0" . $row_qj['cnt']; } else {$qbj = $row_qj['cnt'];}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<link rel="icon" type="image/png" href="favicon.png"></link>
<html>
<head>
<!-- Required for Grid -->
<link rel="stylesheet" type="text/css" media="screen" href="lib/js/themes/hot-sneaks/jquery-ui.custom.css"></link>
<link rel="stylesheet" type="text/css" media="screen" href="lib/js/themes/hot-sneaks/jquery-ui.theme.css"></link>
<link rel="stylesheet" type="text/css" media="screen" href="lib/js/jqgrid/css/ui.jqgrid.css"></link>
<link rel="stylesheet" type="text/css" media="screen" href="css/kodiak.css"></link>
<script src="lib/js/jquery.min.js" type="text/javascript"></script>
<script src="lib/js/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="lib/js/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="lib/js/themes/jquery-ui.custom.min.js" type="text/javascript"></script>
<!-- -->
<script src="//cdn.jsdelivr.net/jstorage/0.1/jstorage.min.js" type="text/javascript"></script>
<script src="//cdn.jsdelivr.net/json2/0.1/json2.min.js" type="text/javascript"></script>
<script src="//cdn.rawgit.com/gridphp/jqGridState/10b365046ebd687914855e807eb5f769277317d5/jqGrid.state.js" type="text/javascript"></script>
<!-- library for checkbox in column chooser -->
<link href="https://gitcdn.xyz/repo/wenzhixin/multiple-select/master/multiple-select.css" rel="stylesheet" />
<script src="https://gitcdn.xyz/repo/wenzhixin/multiple-select/master/multiple-select.js"></script>
<!-- Add fancyBox main JS and CSS files -->
<link type="text/css" rel="stylesheet" href="//cdn.jsdelivr.net/fancybox/2.1.4/jquery.fancybox.css" />
<script type="text/javascript" src="//cdn.jsdelivr.net/fancybox/2.1.4/jquery.fancybox.js"></script>
<!-- Multiselect filter -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-multiselect-widget/1.17/jquery.multiselect.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-multiselect-widget/1.17/jquery.multiselect.filter.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-multiselect-widget/1.17/jquery.multiselect.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-multiselect-widget/1.17/jquery.multiselect.filter.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-multiselect-widget/1.17/jquery.multiselect.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-multiselect-widget/1.17/jquery.multiselect.filter.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-multiselect-widget/1.17/jquery.multiselect.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-multiselect-widget/1.17/jquery.multiselect.filter.js"></script>
<!-- FONT AWESOME -->
<link href="lib/fontawesome-free-5.6.3-web/css/fontawesome.css" rel="stylesheet">
<link href="lib/fontawesome-free-5.6.3-web/css/brands.css" rel="stylesheet">
<link href="lib/fontawesome-free-5.6.3-web/css/solid.css" rel="stylesheet">
<!-- FONT AWSOME -->
<script defer src="lib/fontawesome-free-5.6.3-web/js/brands.js"></script>
<script defer src="lib/fontawesome-free-5.6.3-web/js/solid.js"></script>
<script defer src="lib/fontawesome-free-5.6.3-web/js/fontawesome.js"></script>
<!-- MASKING -->
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.mask/0.9.0/jquery.mask.min.js"></script>
<!-- SHORT CUT KEYS -->
<script src="//cdn.jsdelivr.net/jquery.hotkeys/0.8b/jquery.hotkeys.js"></script>
<!-- SELECT 2 -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/js/select2.min.js"></script>
<title><?php echo $title; ?></title>
</head>
</body>
<!-- dont show menu -->
<?php if($current != 'nomenu') { ?>
<!-- JOB AND UNIT SELECT -->
<nav class="ui-jqgrid-titlebar ui-jqgrid-caption ui-widget-header ui-corner-top ui-helper-clearfix" style="padding: 5px 0px 2px 5px; margin-right:5px">
<!-- FAVORITES MENU -->
<?php if(mysqli_num_rows($u_query) != 0) { ?>
<ul class='nav' style="">
<li class='fav'><a class="fav" href="#"><i style = "color:#ccd232;" class="fas fa-star"></i></a>
<ul>
<?php while($uq=mysqli_fetch_array($u_query)) {?>
<li><a href="unit_list.php?unit=0&job=<?php echo $uq['job_id']; ?>"><?php echo $uq['job_number'] . ' - ' . $uq['job_description'] ;?></a></li>
<?php } ?>
</ul>
</li>
</ul>
<?php } else { ?>
<a style="padding: 5px 0px 0px 5px" class="fav" href="#"><i style = "color:#fff;" class="fas fa-star"></i></a>
<?php } ?>
<!-- JOB NUMBER DROPDOWN -->
<select class="select-special" name="job_select" onchange="location = this.value;">
<?php if($jid == 0) { ?> <option selected>SELECT JOB NUMBER</option> <?php } else { ?> <option selected><?php echo $job_number ?></option> <?php } ?>
<?php while($query2=mysqli_fetch_array($query1)){ ?>
<option value="<?php echo basename($_SERVER['PHP_SELF']); ?>?unit=0&job=<?php echo $query2['job_id'] ?>"><?php echo $query2['job_number'] . ' - ' . $query2['job_description'] ;?></option>
<?php } ?>
</select>
<!-- UNIT NUMBER DROPDOWN -->
<select class="select-special" name="unit_select" onchange="location = this.value;">
<?php if($uid == 0) { ?> <option selected>SELECT UNIT NUMBER</option> <?php } else { ?> <option selected><?php echo $unit_number ?></option> <?php } ?>
<?php while($qu = mysqli_fetch_array($uquery)){ ?>
<option value="<?php echo basename($_SERVER['PHP_SELF']); ?>?unit=<?php echo $qu['unit_id']; ?>&job=<?php echo $jid ?>"><?php echo $qu['unit_number'] . ' - ' . $qu['unit_description'] ;?></option>
<?php } ?>
</select>
<div class="login-display">
<?php if ($dbname != "kodiaccess") { ?> <span style='padding-right: 100px; color: yellow;' class='blink'>TEST SERVER</span> <?php } ?>
<!-- NOTIFICATION BAR -->
<span style="padding-right: 20px;">
<!-- REQUEST CHANGE -->
<div class='button';>
<?php if($utype > 299) { ?>
<a style='color: #93c3cd' href="eq_change_request_ap.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-exchange-alt"></i>
<?php if($req > 0) { ?> <span style='' class='button__badge'><?php echo $req; ?></span> <?php } ?></a>
<?php } else { ?>
<i class="fas fa-exchange-alt"></i>
<?php if($req > 0) { ?> <span style='' class='button__badge'><?php echo $req; ?></span> <?php } ?>
<?php } ?>
</div>
<!-- QUICKBOOKS -->
<div class='button'>
<?php if($utype > 299) { ?>
<div class="dropdown">
<a class='dropbtn' style='color: #93c3cd' href='#'><i class="fas fa-folder-open"></i></a>
<div class="dropdown-content">
<a href="quickbooks_report_jobs.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-folder-open"></i> New Jobs (<?php echo "<span class=''>" . $qbj . "</span>"; ?>)</a>
<a href="quickbooks_report_units.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-folder-open"></i> New Units (<?php echo "<span class=''>" . $qbu . "</span>"; ?>)</a>
</div>
</div>
<?php } else { ?>
<i class="fas fa-folder-open"></i>
<?php } ?>
<?php if($quj > 0) { ?> <span class='button__badge'><?php echo $quj; ?></span> <?php } ?>
</div>
<!-- TASKS -->
<div class='button';>
<?php if($utype > 799) { ?>
<a style='color: #93c3cd' href="tasks.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-tasks"></i>
<?php if($task > 0) { ?> <span style='' class='button__badge'><?php echo $task; ?></span> <?php } ?></a>
<?php } else { ?>
<i class="fas fa-tasks"></i>
<?php if($task > 0) { ?> <span style='' class='button__badge'><?php echo $task; ?></span> <?php } ?>
<?php } ?>
</div>
</span>
<!-- NOTIFICATION BAR (END) -->
<!-- LOGOUT -->
<a class = "ui-button" style=" position: relative; top: -3px;" href="index.php?out=1">LOGOUT</a>
</div>
</nav>
<!-- DESCRIPTION BAR -->
<div class="header" style="margin-right:5px;"><?php echo $desc; ?></div>
<!-- MAIN MENU -->
<div style="padding-bottom:5px">
<nav class="ui-jqgrid-titlebar ui-jqgrid-caption ui-widget-header ui-corner-top ui-helper-clearfix" style="padding: 5px 0px 0px 5px; margin-right:5px">
<ul class='nav' style="">
<li><a href="#">Master Lists</a>
<ul>
<li><a href="master_equipment_list.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class='fas fa-cogs'></i> Master Equipment List</a></li>
<li><a href="master_job_list.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class='fab fa-korvue'></i> Master Job List</a>
<ul>
<li><a href="master_job_list_arch.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-file-archive"></i> Archived Jobs</a></li>
</ul>
</li>
<li><a href="contacts.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class='fas fa-address-book'></i> Contacts</a></li>
<li><a href="company.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class='fas fa-building'></i> Companies</a></li>
</ul>
</li>
<!-- PROJECT LISTS -->
<li><a href="#">Project Lists</a>
<ul>
<li <?php if($jid != 0) {echo 'class=""';} else {echo 'class="disabled"';} ?>><a href="unit_list.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class='fab fa-uniregistry'></i> Unit List</a></li>
<li <?php if($jid != 0) {echo 'class=""';} else {echo 'class="disabled"';} ?>><a href="unit_equipment_list.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class='fas fa-cog'></i> Unit Equipment List</a></li>
<li <?php if($jid != 0) {echo 'class=""';} else {echo 'class="disabled"';} ?>><a href="plist_equipment_list.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class='fas fa-check-double'></i> Recommended Spare Parts</a></li>
<li><a href="unit_drawing_list.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class='fas fa-clipboard-list'></i> Drawing List</a>
<ul>
<li><a href="unit_release_history.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-history"></i> Unit Release History</a></li>
</ul>
</li>
</li>
<li><a href="sketch_list.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class='fas fa-pencil-ruler'></i> SKETCH LIST</a></li>
<li><a href="#"><i class='fas fa-drafting-compass'></i> CONCEPT DRAWING LIST</a></li>
<li><a target='_blank' class='fancybox' data-fancybox-type='iframe' href="assets/job_notes.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class='fas fa-comment'></i> PROJECT NOTES</a></li>
<li><a target='_blank' class='fancybox' data-fancybox-type='iframe' href="assets/job_contacts.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class='fas fa-users'></i> PROJECT CONTACTS</a></li>
</ul>
</li>
<!-- PURCHASING -->
<li <?php if($jid != 0 && $utype >=100) {echo 'class=""';} else {echo 'class="disabled"';} ?> ><a href="#">Purchasing</a>
<ul>
<li><a href="#"><i class='fas fa-cog'></i> UNIT EQUIPMENT LISTS</a>
<ul>
<li><a href="pq_equipment_list.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class='fas fa-money-bill'></i> PRICING/PURCHASING INFORMATION</a></li>
<li><a href="q_equipment_list.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-tag"></i> PRICING INFORMATION</a></li>
<li><a href="p_equipment_list.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-money-check-alt"></i> PURCHASING INFORMATION</a></li>
</ul>
</li>
<li <?php if($utype >= 300) {echo 'class=""';} else {echo 'class="disabled"';} ?>><a href="eq_change_request_ap.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-exchange-alt"></i> Pending Change Request (<?php echo "<span class=''>" . $req . "</span>"; ?>)</a></li>
</ul>
</li>
<!-- ADMIN MENU -->
<li <?php if($utype >= 100) {echo 'class=""';} else {echo 'class="disabled"';} ?>><a href="#">Admin</a>
<ul>
<li <?php if($utype > 299) {echo 'class=""';} else {echo 'class="disabled"';} ?>><a href="master_job_list_notasks.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-tools"></i> ADD SPECIAL JOB</a></li>
<li <?php if($utype >= 100) {echo 'class=""';} else {echo 'class="disabled"';} ?>><a href=""><i class="fab fa-product-hunt"></i> Production Notes</a>
<ul>
<li><a href="prod_notes_ac.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-user-circle"></i> By Customer</a>
<ul>
<li><a href="prod_notes_cc.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>">Closed</a></li>
</ul>
</li>
<li><a href="prod_notes_ap.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-user-shield"></i> By Project Manager</a>
<ul>
<li><a href="prod_notes_cp.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>">Closed</a></li>
</ul>
</li>
</ul>
</li>
<li <?php if($utype >= 100) {echo 'class=""';} else {echo 'class="disabled"';} ?>><a href=""><i class="fas fa-clipboard-check"></i> Sales Report</a>
<ul>
<li><a href="sales_report_unit.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-check-square"></i> Units Pending</a></li>
<li><a href="sales_report_job.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-check-square"></i> Jobs Pending</a></li>
</ul>
</li>
<li <?php if($utype >= 300) {echo 'class=""';} else {echo 'class="disabled"';} ?>><a href="#"><i class="fab fa-quinscape"></i> Quickbooks</a>
<ul>
<li><a href="quickbooks_report_jobs.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-folder-open"></i>New Jobs (<?php echo "<span class=''>" . $qbj . "</span>"; ?>)</a></li>
<li><a href="quickbooks_report_units.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-folder-open"></i>New Units (<?php echo "<span class=''>" . $qbu . "</span>"; ?>)</a></li>
</ul>
</li>
<li><a href="#"><i class='fas fa-user-clock'></i> Time Sheet</a>
<ul>
<li <?php if($utype >= 300) {echo 'class=""';} else {echo 'class="disabled"';} ?> ><a href="np_master_job.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-edit"></i> NP Categories</a></li>
<li><a href="np_master_job.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-clock"></i> Time Cards</a>
<ul>
<?php while($un=mysqli_fetch_array($qusers)) {?>
<li><a href="timecard.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>&t_emp=<?php echo $un['user_id'] ?>"><?php echo $un['full_name'] ?></a></li>
<?php } ?>
</ul>
</li>
</ul>
</li>
</ul>
<li <?php if($utype >= 800) {echo 'class=""';} else {echo 'class="disabled"';} ?>><a href="#">DB Management</a>
<ul>
<li><a href="users.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-user-cog"></i> User Info</a></li>
<li><a href="tasks.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-tasks"></i> Tasks (<?php echo "<span class=''>" . $task . "</span>"; ?>)</a></li>
<li><a href="http://einstein02:9000/phpmyadmin/index.php" target="_TARGET"><i class="fas fa-server"></i> PHPmyAdmin</a></li>
</ul>
</li>
<!-- USER MENU -->
<li><a href="#"><?php echo $user ?></a>
<UL>
<li><a href="#"><i class='fas fa-user-clock'></i> TIME CARD</a>
<ul>
<?php while($tc2=mysqli_fetch_array($timec)) {?>
<li><a href="time_week.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>&tc=<?php echo $tc2['time_week_id'] ?>"><i class="fas fa-hand-point-right"></i> <?php echo $tc2['time_starting_date'] . " - " . $tc2['time_week_end'] ?></a></li>
<?php } ?>
<li><a href="timecard.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-eye"></i> VIEW ALL / NEW</a></li>
</ul>
<li><a target='_blank' class='fancybox' data-fancybox-type='iframe' href="users_fav.php?unit=<?php echo $uid; ?>&job=<?php echo $jid; ?>"><i style='color:black' class='fas fa-star'></i> FAVORITES</a> </li>
<!-- PENDING PROJECT REQUESTS USERS/PROJECT MANAGERS -->
<li><a href="#"><i class="fas fa-clock"></i> Pending Change Request</a>
<ul>
<li><a href="eq_change_request_user.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-search"></i> My Request</a></li>
<!-- DISPLAY FOR ADMIN OR PROJECT MANAGER -->
<?php if($utype == 100 OR $utype > 799) { ?> <li ><a href="eq_change_request_user_pm.php?unit=<?php echo $uid; ?>&job=<?php echo $jid ?>"><i class="fas fa-project-diagram"></i> My Project Request</a></li> <?php } ?>
</ul>
</li>
</li>
</ul>
</li>
<li><a href="#">Help</a>
<ul>
<li><a class="" target="_TARGET" href="http://kodiacclimate:9000/mediawiki/index.php/Kodiaccess"><i class="fas fa-info-circle"></i> Instructions</a></li>
<li><a class="" target="_TARGET" href="http://kodiacclimate:9000/mediawiki/index.php/Kodiaccess_Bug_Reports"><i class="fas fa-exclamation-triangle"></i> Bug Report</a></li>
<li><a class="" target="_TARGET" href="http://kodiacclimate:9000/mediawiki/index.php/Kodiaccess_Feature_Requests"><i class="fas fa-lightbulb"></i> Feature Request</a></li>
<li><a class="" target="_TARGET" href="http://kodiacclimate:9000/mediawiki/index.php/Kodiaccess_Formatting_Guide"><i class="fas fa-pencil-ruler"></i> Formatting</a></li>
<li><a href="#"><i class="fas fa-link"></i> Links</a>
<ul>
<li><a class="" target="_TARGET" href="http://support.kodiakgroup.us/"><i class="fas fa-life-ring"></i> Help Desk</a></li>
<li><a class="" target="_TARGET" href="http://kodiacclimate:9000/mediawiki/index.php"><i class="fas fa-chalkboard-teacher"></i> kodiacclimate (Wiki)</a></li>
<li><a class="" target="_TARGET" href="http://kodiaccess:9000/phplicensewatcher/details.php?listing=0&server=0"><i class="fas fa-id-badge"></i> Kodiak License Usage (AutoDesk)</a></li>
</ul>
</li>
</ul>
</li>
</li>
</ul>
<!-- VER -->
<span class="login-display" style='padding-right: 10px;'>
<ul class='nav' style="font-size: 12px;">
<?php if ($dbname == "kodiaccess") { ?>
<li class='fav'><a class='fav' style="text-decoration: none;color:#93c3cd;" href="#"><?php echo '(VER: ' . $l_ver . ')' ?></a>
<ul>
<li><a target='_live' href="http://kodiacclimate:9000/eq_list/master_job_list.php">TEST SERVER</a></li>
</ul>
</li>
<?php } else { ?>
<li class='fav'><a class='fav' style="text-decoration: none;color:#93c3cd;" href="#"><?php echo '(VER: ' . $t_ver . ')' ?></a>
<ul>
<li><a target='_test' href="http://kodiacclimate:9000/equipment_list/master_job_list.php">LIVE SERVER</a></li>
</ul>
</li>
<?php } ?>
</ul>
</span>
</nav>
</div>
<?php } ?>
<script>
</script>
<style>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.