public function envelope($data) { global $AUTH, $DBO; $valid_formats = array("json"); $this->_data = new stdClass(); if (isset($data->id)) { $this->_id = (int) $data->id; } if (isset($data->token)) { $this->_token = dbo::escape($data->token); } if (isset($data->transaction)) { $this->_transaction = (int) $data->transaction; } if (isset($data->api)) { $this->_api = dbo::escape($data->api); } if (isset($data->data)) { $this->_data = $data->data; } if (isset($data->format) && in_array(strtolower($data->format), $valid_formats)) { $this->_format = strtolower($data->format); } if ($this->_id == -1) { return false; } global $DBO; $sql = "SELECT `a`.`space` FROM `##_customer` `a`\n\t\t LEFT JOIN `##_auth_user` `b` ON (`b`.`customer_id`=`a`.`id`)\n\t\t WHERE `a`.`deleted`=0 AND `b`.`id`='" . $this->_id . "' LIMIT 0,1;"; $DBO->query($sql); if ($DBO->result_count != 1) { exit("Error: Table space could not be found!"); } $this->_tbl_space = $DBO->result("single"); }
<?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 }
<?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"; include_once "{$_SERVER['DOCUMENT_ROOT']}/classes/email.class.php"; $function = $_POST['function']; $dbo = new dbo(); $dbo->ny_connect(); switch ($function) { case "detailLvl3": $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>";
<?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"; 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
<!-- sidebar --> <link href="css/simple-sidebar.css" rel="stylesheet"> <!-- for js Tree --> <link rel="stylesheet" href="jsTree/dist/themes/default/style.min.css" /> <script src="jsTree/dist/jstree.min.js"></script> <!--- main css --> <link rel="stylesheet" href="css/main.css" /> <!-- To resize based on screen size --> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> </head> <?php $dbo = new dbo(); $dbo->ny_connect(); ?> <body id="MainBody" style="background-color:#F9F8F6;"> <div class="loader"></div> <div id="wrapper" class="toggled" > <!-- Sidebar --> <div id="sidebar-wrapper" style="background-color:black;"> <div style="color:white;"> <!--class = sidebar- nav (?)--> <div class="text-center"> <h2>Pick Columns:</h2> <hr>
function __construct() { parent::__construct(); }
<?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/>"; } }
<?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(); $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; ?>
<?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"; include_once "{$_SERVER['DOCUMENT_ROOT']}/classes/email.class.php"; $dbo = new dbo(); $dbo->ny_connect(); $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";
define("APP_NAME", "Wingman"); define("APP_VERSION", "5"); define("APP_RELEASE", "201404011642"); define("APP_STATUS", "DEV"); define("FS_HTDOCS", FS_ROOT . "htdocs/"); define("FS_LIB", FS_ROOT . "lib/"); define("FS_CLASS", FS_LIB . "class/"); define("FS_LANGUAGE", FS_LIB . "languages/"); define("FS_DIALOG", FS_LIB . "dialog/"); define("FS_ADVANCED", FS_LIB . "advanced/"); define("FS_VAR", FS_LIB . "var/"); define("WW_JS", WW_ROOT . "js/"); define("WW_CSS", WW_ROOT . "css/"); define("WW_images", WW_ROOT . "images/"); include_once FS_LIB . 'autoload.php'; $DBO = new dbo(DBO_HOST, DBO_USER, DBO_PASSWORD, DBO_DB, DBO_TBL_PREFIX); if (!isset($_SESSION["auth::id"])) { $_SESSION["auth::id"] = -1; } if (!isset($_SESSION["auth::token"])) { $_SESSION["auth::token"] = ""; } if (!isset($_SESSION["space"])) { $_SESSION["space"] = ""; } $AUTH = new auth(); list($_SESSION["auth::id"], $_SESSION["auth::token"]) = $AUTH->verifyToken($_SESSION["auth::id"], $_SESSION["auth::token"]); $tUser = new user($_SESSION["auth::id"]); $tUser->details(); $_SESSION["space"] = $tUser->get("space"); if (isset($_SESSION["auth::id"]) && $_SESSION["auth::id"] > -1) {
function __construct() { parent::__construct(); foreach (static::$dbFields as $dbField) { //dbFields[tagname]=>attributename switch ($dbField) { case 'id': $dbFieldTag = 'NID'; break; case 'given_name': $dbFieldTag = 'GIVEN-NAME'; break; case 'family_name': $dbFieldTag = 'FAMILY-NAME'; break; case 'name_suffix': $dbFieldTag = 'NAME-SUFFIX'; break; case 'name_order': $dbFieldTag = 'NAME-ORDER'; break; case 'pseudonym': $dbFieldTag = 'PSEUDONYM'; break; case 'gender': $dbFieldTag = 'GENDER'; break; case 'year_of_birth': $dbFieldTag = 'YEAR-OF-BIRTH'; break; case 'year_of_death': $dbFieldTag = 'YEAR-OF-DEATH'; break; case 'year_of_attendance': $dbFieldTag = 'SESSION'; break; case 'language': $dbFieldTag = 'LANGUAGE'; break; case 'writing_role': $dbFieldTag = 'ROLE'; break; case 'website': $dbFieldTag = 'WEBSITE'; break; case 'bibliography': $dbFieldTag = 'BIBLIOGRAPHY'; break; case 'writing_sample': $dbFieldTag = 'WRITING-SAMPLE'; break; case 'continent': $dbFieldTag = 'CONTINENT'; break; case 'country': $dbFieldTag = 'COUNTRY'; break; case 'region': $dbFieldTag = 'REGION'; break; case 'bio': $dbFieldTag = 'BIO'; break; default: $dbFieldTag = null; break; } if (!empty($dbFieldTag)) { static::$dbFieldsTags[$dbFieldTag] = $dbField; } } }
public static function close() { static::$dbo->close(); }