<?php include_once "{$_SERVER['DOCUMENT_ROOT']}/auth.php"; include_once "{$_SERVER['DOCUMENT_ROOT']}/PRC-Data/includes/adminConnect.php"; include_once "{$_SERVER['DOCUMENT_ROOT']}/classes/dbo.class.php"; $dbo = new dbo(); $dbo->ny_connect(); $sql = "SELECT\n\t\t*\n\t\tFROM `npi`.`subCategories`\n\t\t;"; $rSubCat = $dbo->run_query($sql); if (count($rSubCat) > 0) { ?> <select name="subCat" id="subCat" class="required" style="width: 175px; height: 32px;"> <?php for ($i = 0; $i < count($rSubCat); $i++) { ?> <option value="<?php echo $rSubCat[$i]->SubCategoryID; ?> " <?php echo $current_subCat == $rSubCat[$i]->SubCategoryID ? " selected " : ""; ?> ><?php echo $rSubCat[$i]->SubCategoryName; ?> </option> <?php } ?> </select> <?php }
include_once "{$_SERVER['DOCUMENT_ROOT']}/classes/email.class.php"; $dbo = new dbo(); $dbo->ny_connect(); $file = $_FILES['file']; $params = array(); parse_str($_POST['data'], $params); $isFileStatus = !empty($file['name']) ? true : false; $isFile = $isFileStatus ? 1 : 0; $FileName = $isFileStatus ? "'" . $file['name'] . "'" : "NULL"; $FileLocation = $isFileStatus ? "'" . $file['name'] . "'" : "NULL"; $ReLvlID = $params['ReLvlID']; $status = $params['status']; $comment = !empty($params['comment']) ? "'" . addslashes($params['comment']) . "'" : "NULL"; $UseLastFile = $params['UseLastFile']; $sql = "SELECT \n\t\tm.MainID,\n\t\tm.ModelName,\n\t\tm.RelationID,\n\t\tl.LevelID\n\t\t#,l2.*\n\t\tFROM `npi`.`main` m\n\t\tJOIN `npi`.`level_relations` lr on m.RelationID = lr.LRID\n\t\tJOIN `npi`.`levels` l on lr.ParentLevelID = l.LevelID\n\t\t#JOIN `npi`.`levels` l2 on lr.ChildLevelID = l2.ID\n\t\tWHERE m.MainID = {$ReLvlID};"; $r = $dbo->run_query($sql); // uplaod file if ($isFileStatus) { $sourcePath = $file['tmp_name']; // Storing source path of the file in a variable $targetPath = "files/" . $file['name']; // Target path where file is to be stored if (move_uploaded_file($sourcePath, $targetPath)) { } } // use the last uploaded file if ($UseLastFile == "on") { $sql = "SELECT l.*\n\t\t\tFROM `npi`.`logs` l\n\t\t\tJOIN `npi`.`main` m on l.SKU = m.ModelName and l.LevelID = m.RelationID and l.StatusID = m.StatusID\n\t\t\tWHERE m.mainID = {$ReLvlID}\n\t\t\tORDER BY LogID DESC LIMIT 1;"; $r_last = $dbo->run_query($sql); $isFile = 1; $FileName = "'" . $r_last[0]->FileName . "'";
$permitted = true; $SKU = $_POST['SKU']; $levelID = $_POST['LevelID']; $ReLvlID = $_POST['ReLvlID']; /* print "<pre>"; print_r($_POST); print "</pre>"; */ $sql = "SELECT \n\t\t\t\tx.*,\n\t\t\t\ty.MainRelationID,\n\t\t\t\ty.Status as 'MainStatus',\n\t\t\t\ty.CSS_Class,\n\t\t\t\ty.pack_dim,\n\t\t\t\ty.pack_weight,\n\t\t\t\ty.Comments\n\t\t\t\tFROM\n\n\t\t\t\t(SELECT \n\t\t\t\tm.MainID as 'ReLvlID',\n\t\t\t\tm.RelationID,\n\t\t\t\tm.ModelName,\n\t\t\t\tm.StatusID,\n\t\t\t\tl.DisplayName as 'Main',\n\t\t\t\tl2.DisplayName as 'Sub',\n\t\t\t\ts.Description as 'SubStatus',\n\t\t\t\ts.CSS_Class as 'SubClass',\n\t\t\t\tdate(m.DateTimeUpdated) as 'DateTimeUpdated',\n\t\t\t\tconcat(e.en_first_name, ' ', e.en_last_name) as 'UserName',\n\t\t\t\tlog.IsFile,\n\t\t\t\tlog.FileName,\n\t\t\t\tlog.FileLocation,\n\t\t\t\tlog.Comments\n\t\t\t\tFROM\n\t\t\t\tnpi.main m\n\t\t\t\tJOIN npi.level_relations lr on m.RelationID = lr.LRID\n\t\t\t\tJOIN npi.levels l on lr.ParentLevelID = l.LevelID\n\t\t\t\tJOIN npi.levels l2 on lr.ChildLevelID = l2.LevelID\n\t\t\t\tJOIN npi.status s on m.StatusID = s.StatusID\n\t\t\t\tLEFT JOIN mgmt_tools.employee_name e on m.UserID = e.en_id_num\n\t\t\t\tLEFT JOIN (\tSELECT * FROM npi.logs \n\t\t\t\t\t\t\tWHERE LogID in \n\t\t\t\t\t\t\t(SELECT MAX(LogID) FROM npi.logs GROUP BY SKU, LevelID)) log on m.RelationID = log.LevelID and m.ModelName = log.SKU\n\t\t\t\twhere ModelName = '" . $SKU . "'\n\t\t\t\tAND ParentLevelID = " . $levelID . ") x\n\n\t\t\t\tJOIN\n\t\t\t\t(\n\t\t\t\tSelect \n\t\t\t\tm.RelationID as 'MainRelationID',\n\t\t\t\tm.ModelName,\n\t\t\t\ts.Description as 'Status',\n\t\t\t\ts.CSS_Class,\n\t\t\t\ti.pack_dim,\n\t\t\t\ti.pack_weight,\n\t\t\t\tm.comments\n\t\t\t\tFROM npi.main m\n\t\t\t\tJOIN npi.level_relations lr on m.RelationID = lr.LRID\n\t\t\t\tJOIN npi.status s on m.statusId = s.StatusID\n\t\t\t\tJOIN npi.items i on m.ModelName = i.ModelNumber\n\t\t\t\tWHERE m.ModelName = '" . $SKU . "' and ChildLevelID = " . $levelID . ") y\n\t\t\t\ton x.ModelName = y.ModelName\n\t\t\t\torder by x.RelationID"; /* print "<pre>"; print $sql; print "</pre>"; */ $r = $dbo->run_query($sql); /* print "<pre>"; print_r($r); print "</pre>"; */ $SKUcolumnSelected = $r[0]->Main; $iconFileName = $r[0]->Main; // always .png and in /img/ folder $detailStatus = $r[0]->MainStatus; $detailClass = $r[0]->CSS_Class; // same as class from cell // Packaging Dimensions & Weight (?) $dimensions = $r[0]->pack_dim; $dims = explode(",", $dimensions); $weight = $r[0]->pack_weight;
<div id="sidebar-wrapper" style="background-color:black;"> <div style="color:white;"> <!--class = sidebar- nav (?)--> <div class="text-center"> <h2>Pick Columns:</h2> <hr> <a class="btn btn-default btn-sm" href="#"> Summary View </a> <a class="btn btn-default btn-sm" href="#"> Detailed View </a> <br><br> </div> <div id="treeData" > <ul> <?php $sql = "SELECT \n\t\t\t\t\t\t\t\tParentLevelID,\n\t\t\t\t\t\t\t\tp.LevelDescription as 'ParentLevel',\n\t\t\t\t\t\t\t\tc.LevelDescription as 'ChildLevel'\n\t\t\t\t\t\t\t\tFROM npi.level_relations lr\n\t\t\t\t\t\t\t\tjoin npi.levels p on lr.ParentLevelID = p.LevelID\n\t\t\t\t\t\t\t\tjoin npi.levels c on lr.ChildLevelID = c.LevelID\n\t\t\t\t\t\t\t\twhere ParentLevelID != 18\n\t\t\t\t\t\t\t\tGROUP BY ParentLevel\n\t\t\t\t\t\t\t\tORDER BY Field(p.LevelID, 1,2,3,4,5,6);"; $r = $dbo->run_query($sql); for ($i = 0; $i < count($r); $i++) { echo "\n\t\t\t\t\t\t\t\t<li data-jstree='{\"selected\":true,\"opened\":false}'>" . $r[$i]->ParentLevel . "</li>"; #echo " # <ul>"; $sql_child = "\tSELECT \n\t\t\t\t\t\t\t\t\t\t\tc.DisplayName as 'Name'\n\t\t\t\t\t\t\t\t\t\t\tFROM npi.level_relations lr\n\t\t\t\t\t\t\t\t\t\t\tjoin npi.levels p on lr.ParentLevelID = p.LevelID\n\t\t\t\t\t\t\t\t\t\t\tjoin npi.levels c on lr.ChildLevelID = c.LevelID\n\t\t\t\t\t\t\t\t\t\t\twhere ParentLevelID = " . $r[$i]->ParentLevelID . ";"; $r_child = $dbo->run_query($sql_child); /* for($j = 0; $j < count($r_child); $j++){ ?> <li><?php echo $r_child[$j]->Name; ?></li> <?php } */ # echo "
<?php include_once "{$_SERVER['DOCUMENT_ROOT']}/auth.php"; include_once "{$_SERVER['DOCUMENT_ROOT']}/PRC-Data/includes/adminConnect.php"; include_once "{$_SERVER['DOCUMENT_ROOT']}/classes/dbo.class.php"; $dbo = new dbo(); $dbo->ny_connect(); $sql = "SELECT\n\t\t*\n\t\tFROM `npi`.`categories`\n\t\t;"; $rCat = $dbo->run_query($sql); if (count($rCat) > 0) { ?> <select name="category" id="category" class="required" style="width: 175px; height: 32px;"> <?php for ($i = 0; $i < count($rCat); $i++) { ?> <option value="<?php echo $rCat[$i]->CategoryID; ?> " <?php echo $current_category == $rCat[$i]->CategoryID ? " selected " : ""; ?> ><?php echo $rCat[$i]->CategoryName; ?> </option> <?php } ?> </select> <?php }
<?php include_once "{$_SERVER['DOCUMENT_ROOT']}/auth.php"; include_once "{$_SERVER['DOCUMENT_ROOT']}/PRC-Data/includes/adminConnect.php"; include_once "{$_SERVER['DOCUMENT_ROOT']}/classes/dbo.class.php"; $dbo = new dbo(); $dbo->ny_connect(); $sql = "select * from npi.items\n\t\twhere modelnumber not in ('BBL560XL');\n\t\t#where modelnumber = '800CPXL';"; $r = $dbo->run_query($sql); $sql = "select * from\n\t\t`npi`.level_relations\n\t\tWHERE LRID = 28"; $lr = $dbo->run_query($sql); for ($i = 0; $i < count($r); $i++) { for ($j = 0; $j < count($lr); $j++) { $sql = "INSERT INTO `npi`.`main`\n\t\t\t\t(ModelName, RelationID, StatusID)\n\t\t\t\tVALUES\n\t\t\t\t('" . $r[$i]->ModelNumber . "', " . $lr[$j]->LRID . ", 1);"; echo "#" . ($i + 1) . ": " . $sql . "........"; if (!$dbo->run_query($sql)) { echo "<span style='color:red;'>Error!!!</span>"; } else { echo "<span style='color:green;'>Done</span>"; } echo "<br/>"; } }
$dbo->ny_connect(); $filter = ""; switch ($current_level) { case "Art Work": $filter = "WHERE StatusID NOT IN (6,8)"; break; case "Work Instruction": case "ETL Certification": $filter = "WHERE StatusID NOT IN (8)"; break; case "Packaging": $filter = "WHERE StatusID NOT IN (4)"; break; } $sql = "SELECT\n\t\t*\n\t\tFROM `npi`.`status`\n\t\t{$filter}\n\t\tORDER BY Seq\n\t\t;"; $r_dd_status = $dbo->run_query($sql); if (count($r_dd_status) > 0) { ?> <select name="status" id="status" class="required" style="height: 32px; border-radius:5px;"> <?php for ($i = 0; $i < count($r_dd_status); $i++) { ?> <option class="<?php echo $r_dd_status[$i]->CSS_Class; ?> " value="<?php echo $r_dd_status[$i]->StatusID; ?> " <?php echo $current_status == $r_dd_status[$i]->StatusID ? " selected " : ""; ?>
$file = $_FILES['file']; $d = array(); parse_str($_POST['d'], $d); // upload file if (!empty($file['name'])) { $sourcePath = $file['tmp_name']; // Storing source path of the file in a variable $targetPath = "files/" . $file['name']; // Target path where file is to be stored if (move_uploaded_file($sourcePath, $targetPath)) { } } /* print "<pre>"; print_r($d); print "</pre>"; */ $dim = $d['width'] . "," . $d['length'] . "," . $d['height']; $upc = !empty($d['upc']) ? "'" . $d['upc'] . "'" : "NULL"; $reman_upc = !empty($d['reman_upc']) ? "'" . $d['reman_upc'] . "'" : "NULL"; $sfid = !empty($d['sfid']) ? "'" . $d['sfid'] . "'" : "NULL"; $sfid_reman = !empty($d['reman_sfid']) ? "'" . $d['reman_sfid'] . "'" : "NULL"; $sfid_rmb = !empty($d['rmb_sfid']) ? "'" . $d['rmb_sfid'] . "'" : "NULL"; $sql = "UPDATE `npi`.`items`\n\t\tSET `Description` = '" . addslashes(trim($d['desc'])) . "',\n\t\t`reman_status` = " . $d['reman_status'] . ",\n\t\t`UPC` = " . $upc . ",\n\t\t`reman_upc` = " . $reman_upc . ",\n\t\t`prod_cat` = " . $d['category'] . ",\n\t\t`prod_sub_cat` = " . $d['subCat'] . ",\n\t\t`pack_dim` = '" . $dim . "',\n\t\t`pack_weight` = " . $d['weight'] . ",\n\t\t`SFID` = " . $sfid . ",\n\t\t`SFID_REMAN` = " . $sfid_reman . ",\n\t\t`SFID_RMB` = " . $sfid_rmb . "\n\t\tWHERE ModelNumber = '" . $d['sku'] . "';"; #print $sql; if ($dbo->run_query($sql)) { $d = array("status" => true, "msg" => "Update successfully"); } else { $d = array("status" => false, "msg" => "Error! Update failed.", "sql" => $sql); } print json_encode($d);