Esempio n. 1
0
 function getLists()
 {
     $gdbo = new ArcDb();
     $gdbo->dbConStr = $GLOBALS['globalDBCON'];
     $gdbo->dbType = $GLOBALS['globalDBTP'];
     $gdbo->dbSchema = $GLOBALS['globalDB'];
     # Countries
     $gdbo->sql = "SELECT id_loc_country,loc_country FROM _loc_country";
     $gdbo->getRec();
     $this->listCountries = $gdbo->dbData;
     # Regions
     $gdbo->sql = "SELECT id_loc_region,loc_region,id_loc_country FROM _loc_region";
     $gdbo->getRec();
     $this->listRegions = $gdbo->dbData;
     # Filterable Objects
     $gdbo = new ArcDb();
     $gdbo->dbConStr = $GLOBALS['globalDBCON'];
     $gdbo->dbType = $GLOBALS['globalDBTP'];
     $gdbo->dbSchema = $GLOBALS['globalDB'];
     $gdbo->sql = "SELECT id_loc_region,loc_region FROM _loc_region";
     $gdbo->dbFilter = "WHERE id_loc_country=";
     $gdbo->type = "list";
     $gdbo->id = "id_loc_region";
     $gdbo->attributes = 'class="chRegion"';
     $this->regionDBO = encrypt(json_encode((array) $gdbo));
     return true;
 }
Esempio n. 2
0
 function getLists()
 {
     $gdbo = new ArcDb();
     $gdbo->dbConStr = $GLOBALS['globalDBCON'];
     $gdbo->dbType = $GLOBALS['globalDBTP'];
     $gdbo->dbSchema = $GLOBALS['globalDB'];
     # Degree Level
     require "_model/dboDegreeLevel.php";
     $gdbo->getRec();
     $this->listDegreeLevel = $gdbo->dbData;
     # Campuses
     require "_model/dboCampus.php";
     $gdbo->getRec();
     $this->listCampus = $gdbo->dbData;
     $this->listCampusJSON = json_encode($this->listCampus);
     echo '<script>window.listCampusJSON=\'' . $this->listCampusJSON . '\'</script>';
     # Education Status
     require "_model/dboEducationStatus.php";
     $gdbo->getRec();
     $this->listEducationStatus = $gdbo->dbData;
     # University
     require "_model/dboUniversity.php";
     $gdbo->getRec();
     $this->listUniversity = $gdbo->dbData;
     return true;
 }
Esempio n. 3
0
 function getRecords()
 {
     $gdbo = new ArcDb();
     $gdbo->dbConStr = $GLOBALS['globalDBCON'];
     $gdbo->dbType = $GLOBALS['globalDBTP'];
     $gdbo->dbSchema = $GLOBALS['globalDB'];
     if (is_null($this->filter) || is_null($this->id)) {
         return false;
     }
     $gdbo->sql = "SELECT\n_contract_payment.id_contract_payment,\n_contract_payment.contract_payment,\ncontract_payment_dr,\ncontract_payment_dp,\n_contract_payment.id_contract_payment_method_tp,\n_contract_payment.id_contract\nFROM _contract_payment\nWHERE " . $this->filter . "=" . $this->id . " ORDER BY contract_payment_dr ASC, id_contract_payment ASC";
     $gdbo->getRec();
     $results = $gdbo->getAssociative();
     return $results;
 }
Esempio n. 4
0
 function getLists()
 {
     $gdbo = new ArcDb();
     $gdbo->dbConStr = $GLOBALS['globalDBCON'];
     $gdbo->dbType = $GLOBALS['globalDBTP'];
     $gdbo->dbSchema = $GLOBALS['globalDB'];
     $gdbo->sql = "SELECT id_purchaseorder_payment_tp, purchaseorder_payment_tp FROM _purchaseorder_payment_tp";
     $gdbo->getRec();
     $this->listPaymentTp = $gdbo->dbData;
     $gdbo->sql = "SELECT\na.id_contract,\na.contract,\na.id_cust_company,\nb.cust_company\nFROM _contract a\nLEFT JOIN _cust_company b\nON a.id_cust_company = b.id_cust_company\nORDER by b.cust_company\n";
     $gdbo->getRec();
     $this->listContract = $gdbo->dbData;
     return true;
 }
Esempio n. 5
0
 function getLists()
 {
     $gdbo = new ArcDb();
     $gdbo->dbConStr = $GLOBALS['globalDBCON'];
     $gdbo->dbType = $GLOBALS['globalDBTP'];
     $gdbo->dbSchema = $GLOBALS['globalDB'];
     $gdbo->sql = "SELECT \nid_invoice_qty_tp,\ninvoice_qty_tp\nFROM _invoice_qty_tp;\n";
     $gdbo->getRec();
     $this->listQtyType = $gdbo->dbData;
     $gdbo->sql = "SELECT\na.id_contract,\na.contract,\na.id_cust_company,\nb.cust_company\nFROM _contract a\nLEFT JOIN _cust_company b\nON a.id_cust_company = b.id_cust_company\nORDER by b.cust_company\n";
     $gdbo->getRec();
     $this->listContract = $gdbo->dbData;
     return true;
 }
Esempio n. 6
0
 function getLists()
 {
     $gdbo = new ArcDb();
     $gdbo->dbConStr = $GLOBALS['globalDBCON'];
     $gdbo->dbType = $GLOBALS['globalDBTP'];
     $gdbo->dbSchema = $GLOBALS['globalDB'];
     # Insurance Plan
     $gdbo->sql = "SELECT \nid_hr_insurance_plan,\nhr_insurance_plan,\nid_cust_company \nFROM _hr_insurance_plan\nORDER BY id_cust_company asc,hr_insurance_plan asc";
     $gdbo->getRec();
     $this->listInsurancePlan = $gdbo->dbData;
     $this->listInsurancePlanJSON = json_encode($this->listInsurancePlan);
     echo '<script>window.listInsurancePlanJSON=\'' . $this->listInsurancePlanJSON . '\'</script>';
     # Insurance Provider
     require "_model/dboInsuranceProvider.php";
     $gdbo->getRec();
     $this->listInsuranceProvider = $gdbo->dbData;
     # Insurance Coverage
     require "_model/dboInsuranceCoverage.php";
     $gdbo->getRec();
     $this->listInsuranceCoverage = $gdbo->dbData;
     return true;
 }
 function getLists()
 {
     $gdbo = new ArcDb();
     $gdbo->dbConStr = $GLOBALS['globalDBCON'];
     $gdbo->dbType = $GLOBALS['globalDBTP'];
     $gdbo->dbSchema = $GLOBALS['globalDB'];
     # Certification Type
     require "_model/dboCertification.php";
     $gdbo->getRec();
     $this->listCertification = $gdbo->dbData;
     $this->listCertificationJSON = json_encode($this->listCertification);
     echo '<script>window.listCertificationJSON=\'' . $this->listCertificationJSON . '\'</script>';
     # Education Status
     require "_model/dboEducationStatus.php";
     $gdbo->getRec();
     $this->listEducationStatus = $gdbo->dbData;
     # Provider
     require "_model/dboCertificationProvider.php";
     $gdbo->getRec();
     $this->listProvider = $gdbo->dbData;
     return true;
 }
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
/**************************************************/
$interfacerec = new ArcDb();
$interfacerec->dbConStr = $globalDBCON;
$interfacerec->dbType = $globalDBTP;
$interfacerec->dbSchema = $globalDB;
/**************************************************/
#netgroup
$interfacerec->sql = "SELECT a.id_cfg_device_netgroup,a.cfg_device_netgroup from _cfg_device_netgroup a\nWHERE EXISTS (SELECT b.id_cfg_device_netgroup FROM _cfg_device_ip4netaddress b WHERE a.id_cfg_device_netgroup=b.id_cfg_device_netgroup AND b.cfg_device_ip4netaddress_enabled = 1)\norder by cfg_device_netgroup";
$interfacerec->getRec();
$listnetgroup = $interfacerec->dbData;
/**************************************************/
#interfaces
$interfacerec->sql = "SELECT\na.id_cfg_device_ip4netaddress,\nconcat(RTRIM(cast(inet_ntoa(a.cfg_device_ip4netaddress) as char)),'/',RTRIM(cast(a.cfg_device_ip4netaddress_nmbits as char))) as net,\na.id_cfg_device_netgroup,b.cfg_device_netgroup\nFROM _cfg_device_ip4netaddress a LEFT JOIN _cfg_device_netgroup b ON a.id_cfg_device_netgroup=b.id_cfg_device_netgroup\nWHERE a.cfg_device_ip4netaddress_enabled=1 ORDER BY a.id_cfg_device_netgroup,a.cfg_device_ip4netaddress";
$interfacerec->getRec();
$listnetworkinterfaces = $interfacerec->dbData;
echo "<script type='text/javascript'>window.listNetworkInterface=" . json_encode($listnetworkinterfaces) . ";</script>";
/**************************************************/
Esempio n. 9
0
<?php

/*
* @dependency lib_ip.js
* @dependency ArcJS-13.3.0.1.js
* @dependency ArcCore-13.3.0.0.php
* @dependency ArcDb-13.3.0.0.php
* @dependency ArcTbl-13.3.0.0.php
* @dependency ArcDbFilter.php
* @dependency auth.php (Contains references for preceding *.php)
*
* */
require_once "_lib/php/auth.php";
/* define database */
$ip = new ArcDb();
$ip->dbConStr = $globalDBCON;
$ip->dbType = $globalDBTP;
$ip->dbSchema = $globalDB;
/* return all interfaces with the same address */
$ip->sql = "\nSELECT\nid_cfg_device_interface,\nid_cfg_device_ip4netaddress,\na.id_cfg_device,\na.id_device_interfacelabel,\nid_device_ifspeedduplex,\ncfg_device_interface_ip4hostaddress,\ncfg_device_interface_enabled,\nd.device,\ne.cfg,\nc.device_interfacelabel\nFROM\n_cfg_device_interface a\nINNER JOIN\n_cfg_device b \nON a.id_cfg_device=b.id_cfg_device\nINNER JOIN\n_device_interfacelabel c \nON a.id_device_interfacelabel=c.id_device_interfacelabel\nINNER JOIN\n_device d \nON b.id_device=d.id_device\nINNER JOIN\n_cfg e \nON b.id_cfg=e.id_cfg\nWHERE\ncfg_device_interface_enabled=1\nAND cfg_device_interface_ip4hostaddress=" . $_POST["cfg_device_interface_ip4hostaddress"];
$ip->getRec();
if ($ip->dbRows > 0) {
    $existingInterfaceAssignments = $ip->getAssociative();
} else {
    die('<script>prepSaveChanges("' . $_POST["form"] . '")</script>');
}
/* evaluate returned results */
if (count($existingInterfaceAssignments) > 0) {
    /* matches were found */
    /* * search array for network id passed via POST */
    $netIsDefined = multiArraySearch($existingInterfaceAssignments, $_POST["id_cfg_device_ip4netaddress"]);
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
$sql = isset($_POST["sqlbox"]) ? hex2str($_POST["sqlbox"]) : "";
if (isset($_POST["id_con"]) && $_POST["id_con"] != "") {
    $arcdb = new ArcDb();
    $arcdb->dbConStr = $globalDBCON;
    $arcdb->dbType = $globalDBTP;
    $arcdb->dbSchema = $globalDB;
    /**************************************************/
    $arcdb->sql = "\nSELECT\na.id_con, \na.con, \na.id_con_db_tp,\na.con_alias,\na.con_user,\na.con_enabledbit,\na.con_password,\na.con_host,\na.con_port,\na.con_catalog,\na.con_options,\nb.con_db_tp\nFROM _con a\nLEFT JOIN _con_db_tp b ON a.id_con_db_tp=b.id_con_db_tp\nWHERE a.id_con =" . $_POST["id_con"];
    $arcdb->getRec();
    $con = $arcdb->getAssociative();
}
$arcCon = new ArcTbl();
$arcCon->dbLimit = 23;
$arcCon->dbOffset = 0;
$arcCon->dbCatalog = isset($con[0]["con_catalog"]) ? $con[0]["con_catalog"] : $arcCon->dbCatalog;
$arcCon->oCon = isset($con[0]["con"]) ? $con[0]["con"] : $arcCon->oCon;
$arcCon->dbTable = $arcCon->oCon;
$arcCon->dbSchema = isset($con[0]["con"]) ? $con[0]["con"] : $arcCon->dbSchema;
Esempio n. 11
0
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
$ajCfgDevice = null;
$ajCfgDevice = isset($_POST["id_cfg_device"]) ? "&id_cfg_device=" . $_POST["id_cfg_device"] : "";
$ajCfgDevice .= isset($_POST["id_device"]) ? "&id_device=" . $_POST["id_device"] : "";
$ajCfgDevice .= isset($_POST["id_cfg"]) ? "&id_cfg=" . $_POST["id_cfg"] : "";
/**************************************************/
$iflabel = new ArcDb();
$iflabel->dbConStr = $globalDBCON;
$iflabel->dbType = $globalDBTP;
$iflabel->dbSchema = $globalDB;
$iflabel->sql = "SELECT id_cfg_device_netgroup,cfg_device_netgroup from _cfg_device_netgroup order by cfg_device_netgroup";
$iflabel->getRec();
$listiflabel = $iflabel->dbData;
/**************************************************/
$buttonAdd = '<div class="elementIconBox" onclick="prepSaveChanges(\'frmIFLabel\')"><i class="fa fa-plus"></i></div>';
/**************************************************/
$mnuiflabel = array(array(array("Interface Label", "device_interfacelabel", 'class="elementIcon"', 0, null, null, null, $buttonAdd, null, 'Network Interface')));
/**************************************************/
?>
<legend>
Add Inteface Label
</legend>
$periodArray = explode(".", $period);
$periodStart = $periodArray[1];
$periodEnd = $periodArray[2];
/*************************************/
/* application variables */
/*************************************/
$curYear = date('Y', strtotime($dtTimeCurrent));
$curDay = date('j', strtotime($dtTimeCurrent));
$curMonth = date('n', strtotime($dtTimeCurrent));
$yearID = isset($yearID) ? $yearID : $curYear;
$monthID = isset($monthID) ? $monthID : $curMonth;
$firstDayofMonth = date("l", mktime(0, 0, 0, $monthID, 1, $yearID));
$dayCount = cal_days_in_month(CAL_GREGORIAN, $monthID, $yearID);
$todayTime = strtotime("{$yearID}-{$monthID}-{$curDay} 00:00:00 ");
/************************************************************************/
$arc = new ArcDb();
$arc->dbType = $globalDBTP;
$arc->dbSchema = $globalDB;
$arc->dbConStr = $globalDBCON;
$arc->sql = "\nSELECT\nid_tm_timesheet,\ntm_timesheet_ds,\ntm_timesheet_de,\nid_hr_emp,\ntm_timesheet_approved\nFROM\n_tm_timesheet WHERE\nid_hr_emp={$id_hr_emp_derived} AND\ntm_timesheet_ds={$periodStart} AND\ntm_timesheet_de={$periodEnd} \n";
$arc->getRec();
$timesheet = $arc->getAssociative();
if ($arc->dbRows > 0) {
    /*timesheet has been submitted. validate what the current state*/
    switch ($timesheet[0]["tm_timesheet_approved"]) {
        case 0:
            $status = "Submitted";
            break;
        case 1:
            $status = "Approved";
            break;
    $body = $decoded[0]['Body'];
} elseif (substr($decoded[0]['Parts'][0]['Headers']['content-type:'], 0, strlen('text/plain')) == 'text/plain' && isset($decoded[0]['Parts'][0]['Body'])) {
    $body = $decoded[0]['Parts'][0]['Body'];
} elseif (substr($decoded[0]['Parts'][0]['Parts'][0]['Headers']['content-type:'], 0, strlen('text/plain')) == 'text/plain' && isset($decoded[0]['Parts'][0]['Parts'][0]['Body'])) {
    $body = $decoded[0]['Parts'][0]['Parts'][0]['Body'];
}
/*********************************************************************/
/*Get Time Card Data*/
require_once "bootstrap.php";
date_default_timezone_set('UTC');
$gmtOffset = "-21600";
//Central Time
$dtCurrent = date("l, F j, Y e");
$dtTimeCurrent = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $gmtOffset);
$id_tm_timesheet = decrypt(trim(preg_replace("/.+?\\|.+?\\|(.*)/", "\$1", $subject)));
$arc = new ArcDb();
$arc->dbType = $globalDBTP;
$arc->dbSchema = $globalDB;
$arc->dbConStr = $globalDBCON;
$arc->sql = "\nSELECT\nc.id_cust_contact,\nconcat(c.cust_contact_givenName,' ',c.cust_contact_familyName) as fullName,\nc.cust_contact_givenName,\nc.cust_contact_familyName\nFROM\n_sys_user_emp a \nLEFT JOIN _hr_emp b ON a.id_cust_contact=b.id_cust_contact\nLEFT JOIN _cust_contact c ON a.id_cust_contact=c.id_cust_contact\nLEFT JOIN _sys_user d ON a.id_sys_user=d.id_sys_user\nWHERE d.id_sys_status=21 AND d.sys_user_tmEmail='" . $fromEmail . "'";
$arc->getRec();
$approver = $arc->getAssociative();
$approverFull = $approver[0]["fullName"];
$approverFirst = $approver[0]["cust_contact_givenName"];
$approverLast = $approver[0]["cust_contact_familyName"];
$approverCount = $arc->dbRows;
$arc->sql = "\nSELECT\nconcat(b.cust_contact_givenName,' ',b.cust_contact_familyName) as fullName\nFROM\n_tm_timesheet a\nLEFT JOIN\n_hr_emp c ON a.id_hr_emp=c.id_hr_emp\nLEFT JOIN\n_cust_contact b ON c.id_cust_contact=b.id_cust_contact\nWHERE\na.id_tm_timesheet={$id_tm_timesheet}\n";
$arc->getRec();
$timesheetdetail = $arc->getAssociative();
if ($approverCount > 0) {
    /*********************************************************************/
Esempio n. 14
0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
$timecard = preg_replace("/onclick=\".+?\"|onmouseover=\".+?\"|onmouseout=\".+?\"|style=\".+?\"/i", "", hex2str($_POST["data"]));
$gdbo = new ArcDb();
$gdbo->dbConStr = $globalDBCON;
$gdbo->dbSchema = $globalDB;
$gdbo->dbType = $globalDBTP;
/*Get Employee Data*/
$gdbo->sql = "\nSELECT\na.hr_emp_timeApprover\nFROM _hr_emp a WHERE id_hr_emp={$id_hr_emp_derived} AND a.hr_emp_timeApprover is not null;";
$gdbo->getRec();
$employee = $gdbo->getAssociative();
if ($gdbo->dbRows > 0) {
    $gdbo->sql = "\nSELECT \na.id_sys_user,\na.sys_user_tmEmail,\nb.cust_contact_givenName\nFROM _sys_user a\nLEFT JOIN _sys_user_emp c ON a.id_sys_user=c.id_sys_user\nLEFT JOIN _cust_contact b ON c.id_cust_contact=b.id_cust_contact\nWHERE b.id_cust_contact=" . $employee[0]["hr_emp_timeApprover"];
    $gdbo->getRec();
    $approver = $gdbo->getAssociative();
    $gdbo->sql = "\nSELECT \nid_tm_timesheet,\nid_hr_emp,\ntm_timesheet_ds,\ntm_timesheet_de,\ntm_timesheet_approved\nFROM _tm_timesheet\nWHERE tm_timesheet_ds=" . $_POST["datestart"] . " AND tm_timesheet_de=" . $_POST["dateend"] . " AND id_hr_emp=" . $id_hr_emp_derived;
    $gdbo->getRec();
    $timesheet = $gdbo->getAssociative();
    $timesheetCount = $gdbo->dbRows;
Esempio n. 15
0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
$gdbo = new ArcDb();
$gdbo->dbConStr = $globalDBCON;
$gdbo->dbType = $globalDBTP;
$gdbo->dbSchema = $globalDB;
# Device Group
$gdbo->sql = "SELECT \nid_device_grp,\ndevice_grp\nFROM _device_grp";
$gdbo->getRec();
$listDeviceGroup = $gdbo->dbData;
# Users
$gdbo->sql = "SELECT\na.id_hr_emp,\nconcat(b.cust_contact_givenName,' ',b.cust_contact_familyName) as \"fullname\" \nFROM\n_hr_emp as a\nLEFT JOIN _cust_contact b ON a.id_cust_contact=b.id_cust_contact\nORDER BY b.cust_contact_givenName,b.cust_contact_familyName";
$gdbo->getRec();
$listUsers = $gdbo->dbData;
# Status
$gdbo->sql = "SELECT \nid_sys_status,\nsys_status\nFROM\n_sys_status \nWHERE id_sys_status_tp=7";
$gdbo->getRec();
$listStatus = $gdbo->dbData;
Esempio n. 16
0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
$dbo = new ArcDb();
$dbo->dbConStr = $globalDBCON;
$dbo->dbType = $globalDBTP;
$dbo->dbSchema = $globalDB;
$action = $_POST['action'];
$form = $_POST['form'];
$formAction = $form . "," . $action;
if (isset($_POST["con_password"]) && $_POST["con_password"] != "") {
    $_POST["con_password"] = encrypt($_POST["con_password"]);
}
switch ($formAction) {
    /* ********************************************************************** */
    case "dbcon,insert":
        /* ********************************************************************** */
        $dbo->dbTable = "_con";
        $dbo->insertRec();
Esempio n. 17
0
 public function getSchemata($dbType, $dbSchema, $dbTable, $dbCon = null, $dbConStr = null, $dbCatalog = null)
 {
     switch ($dbType) {
         case "mysql":
             $sql = "SELECT COLUMN_NAME,DATA_TYPE,ORDINAL_POSITION FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='" . $dbSchema . "' AND TABLE_NAME='" . $dbTable . "';";
             break;
         case "mssql":
             $sql = "SELECT COLUMN_NAME,DATA_TYPE,ORDINAL_POSITION FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='" . $dbTable . "';";
             break;
         case "pgsql":
             $sql = "SELECT COLUMN_NAME,DATA_TYPE,ORDINAL_POSITION FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='" . $dbTable . "';";
             $dbSchema = "information_schema";
             break;
     }
     $dbCatalogInsert = !is_null($dbCatalog) ? ",dbCatalog=" . $dbCatalog : "";
     $schDbo = new ArcDb();
     $schDbo->sql = $sql;
     $schDbo->dbConStr = $dbConStr;
     $schDbo->dbSettings = "dbSchema=" . $dbSchema . ",dbType=" . $dbType . ",dbCon=" . $dbCon . $dbCatalogInsert;
     $schDbo->getRec();
     $schemadata = $schDbo->dbData;
     $this->primaryKey = $schemadata[0][0];
     return $schemadata;
 }
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
$_POST["tm_timesheet_approvedBy"] = $id_cust_contact_derived;
$arc = new ArcDb();
$arc->dbType = $globalDBTP;
$arc->dbSchema = $globalDB;
$arc->dbConStr = $globalDBCON;
$arc->dbTable = "_tm_timesheet";
switch ($_POST["edit"]) {
    case 1:
        $arc->updateRec("id_tm_timesheet=" . $_POST["id_tm_timesheet"]);
        break;
    case 2:
        $arc->deleteRec("id_tm_timesheet=" . $_POST["id_tm_timesheet"]);
        break;
    default:
        break;
}
?>
Esempio n. 19
0
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
require_once "_includes/optionstoolbar.php";
/**************************************************/
$arcdb = new ArcDb();
$arcdb->dbConStr = $globalDBCON;
$arcdb->dbType = $globalDBTP;
$arcdb->dbSchema = $globalDB;
$id = $_POST["id_con"];
/**************************************************/
$arcdb->sql = "\nSELECT\nid_con,\ncon,\nid_con_db_tp,\ncon_alias,\ncon_user,\ncon_enabledbit,\ncon_password,\ncon_host,\ncon_port,\nUNHEX(con_options) as con_options,\ncon_catalog\nFROM _con\nWHERE id_con={$id}";
$arcdb->getRec();
$connections = $arcdb->getAssociative();
$arcdb->sql = "\nSELECT \nid_con_db_tp,\ncon_db_tp_alias\nFROM _con_db_tp\n";
$arcdb->getRec();
$dbtypes = $arcdb->dbData;
/**************************************************/
$password = $connections[0]["con_password"] != "" ? decrypt($connections[0]["con_password"]) : "";
$enabledBoo = array(array(1, "Enable"), array(0, "Disable"));
$conFields = array(array(array('Friendly Name', 'con_alias', null, 0, null, $connections[0]["con_alias"]), array('Database Type', 'id_con_db_tp', null, 1, $dbtypes, $connections[0]["id_con_db_tp"]), array('Status', 'con_enabledbit', null, 4, $enabledBoo, $connections[0]["con_enabledbit"])), array(array('Database', 'con', null, 0, null, $connections[0]["con"]), array('Table Schema', 'con_catalog', null, 0, null, $connections[0]["con_catalog"])), array(array('Username', 'con_user', null, 0, null, $connections[0]["con_user"]), array('Password', 'con_password', null, 7, null, $password)), array(array('Host', 'con_host', null, 0, null, $connections[0]["con_host"]), array('Port', 'con_port', null, 0, null, $connections[0]["con_port"])), array(array('Options', 'con_options', null, 6, null, $connections[0]["con_options"])));
Esempio n. 20
0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
$gdbo = new ArcDb();
$gdbo->dbConStr = $globalDBCON;
$gdbo->dbType = $globalDBTP;
$gdbo->dbSchema = $globalDB;
# Record
$gdbo->sql = "SELECT\na.id_cfg_device,\na.id_hr_emp,\na.id_device,\na.cfg_device,\na.id_cfg,\na.cfg_device_serialnumber,\nUNHEX(a.cfg_device_notes) as \"cfg_device_notes\",\nFROM_UNIXTIME(UNIX_TIMESTAMP(a.cfg_device_dc)+{$gmtOffset}) as \"cfg_device_dc\",\nFROM_UNIXTIME(UNIX_TIMESTAMP(a.cfg_device_du)+{$gmtOffset}) as \"cfg_device_du\",\na.cfg_device_dr,\na.id_sys_status,\na.cfg_device_keyenabled,\na.cfg_device_key,\nb.id_device_grp,\na.cfg_device_os\nFROM\n_cfg_device a\nLEFT JOIN\n_device b ON a.id_device=b.id_device\nWHERE a.id_cfg_device=" . $_POST["id_cfg_device"];
$gdbo->getRec();
$rec = $gdbo->getAssociative();
# Device Group
$gdbo->sql = "SELECT \nid_device_grp,\ndevice_grp\nFROM _device_grp";
$gdbo->getRec();
$listDeviceGroup = $gdbo->dbData;
# Users
$gdbo->sql = "SELECT\na.id_hr_emp,\nconcat(b.cust_contact_givenName,' ',b.cust_contact_familyName) as \"fullname\" \nFROM\n_hr_emp as a\nLEFT JOIN _cust_contact b ON a.id_cust_contact=b.id_cust_contact\nORDER BY b.cust_contact_givenName,b.cust_contact_familyName";
$gdbo->getRec();
$listUsers = $gdbo->dbData;
Esempio n. 21
0
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
if (isset($_POST["id_con"]) && $_POST["id_con"] != "") {
    $arcdb = new ArcDb();
    $arcdb->dbConStr = $globalDBCON;
    $arcdb->dbType = $globalDBTP;
    $arcdb->dbSchema = $globalDB;
    /**************************************************/
    $arcdb->sql = "\nSELECT\na.id_con, \na.con, \na.id_con_db_tp,\na.con_alias,\na.con_user,\na.con_enabledbit,\na.con_password,\na.con_host,\na.con_port,\na.con_catalog,\na.con_options,\nb.con_db_tp\nFROM _con a\nLEFT JOIN _con_db_tp b ON a.id_con_db_tp=b.id_con_db_tp\nWHERE a.id_con =" . $_POST["id_con"];
    $arcdb->getRec();
    $con = $arcdb->getAssociative();
    /**************************************************/
}
$arcCon = new ArcDb();
$arcCon->dbCatalog = isset($con[0]["con_catalog"]) ? $con[0]["con_catalog"] : $arcCon->dbCatalog;
$arcCon->oCon = isset($con[0]["con"]) ? $con[0]["con"] : $arcCon->oCon;
$arcCon->dbTable = $arcCon->oCon;
$arcCon->dbSchema = isset($con[0]["con"]) ? $con[0]["con"] : $arcCon->dbSchema;
$arcCon->oUser = isset($con[0]["con_user"]) ? $con[0]["con_user"] : $arcCon->oUser;
$arcCon->oPassword = isset($con[0]["con_password"]) && !empty($con[0]["con_password"]) ? decrypt($con[0]["con_password"]) : $arcCon->oPassword;
$arcCon->oHost = isset($con[0]["con_host"]) ? $con[0]["con_host"] : $arcCon->oHost;
$arcCon->oPort = isset($con[0]["con_port"]) ? $con[0]["con_port"] : $arcCon->oPort;
$arcCon->oOptions = isset($con[0]["con_options"]) ? $con[0]["con_options"] : $arcCon->oOptions;
$arcCon->dbType = isset($con[0]["con_db_tp"]) ? $con[0]["con_db_tp"] : $arcCon->dbType;
/*Make Connection*/
if ($arcCon->oCon == "" | $arcCon->dbType == "") {
    die;
}
switch ($arcCon->dbType) {
Esempio n. 22
0
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
require_once "_includes/optionstoolbar.php";
/**************************************************/
$arcdb = new ArcDb();
$arcdb->dbConStr = $globalDBCON;
$arcdb->dbType = $globalDBTP;
$arcdb->dbSchema = $globalDB;
/**************************************************/
$arcdb->sql = "\nSELECT \nid_con_db_tp,\ncon_db_tp_alias\nFROM _con_db_tp\n";
$arcdb->getRec();
$dbtypes = $arcdb->dbData;
/**************************************************/
$enabledBoo = array(array(1, "Enable"), array(0, "Disable"));
$conFields = array(array(array('Friendly Name', 'con_alias', null, 0), array('Database Type', 'id_con_db_tp', null, 1, $dbtypes), array('Status', 'con_enabledbit', null, 4, $enabledBoo, 0)), array(array('Database', 'con', null, 0), array('Table Schema', 'con_catalog', null, 0, null)), array(array('Username', 'con_user', null, 0), array('Password', 'con_password', null, 7)), array(array('Host', 'con_host', null, 0), array('Port', 'con_port', null, 0)), array(array('Options', 'con_options', null, 6)));
?>
<script type="text/javascript">$(".icoadd").remove();</script>
<form method="post" name="dbcon" id="dbcon" action="javascript:submitFrmVals('content','/_mod/smod_22/sql.php',null,'&form=dbcon&action=insert','dbcon')">
<fieldset id="database_connection">
<legend>Database Connection</legend>
Esempio n. 23
0
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require "config.php";
require $serverrootpath . "_lib/php/bootstrap/ArcCore.php";
require $serverrootpath . "_lib/php/bootstrap/ArcDb.php";
$gdbo = new ArcDb();
$gdbo->dbConStr = $globalDBCON;
$gdbo->dbType = $globalDBTP;
$SOURCE = "_bifrost";
$DESTINATION = $globalDB;
$LASTNAME = "Administrator";
$FIRSTNAME = "System";
$PASSWORD = "******";
$RECOVERYEMAIL = "*****@*****.**";
$USERNAME = "******";
$COMPANY = "Your Company Name";
$BRANCH = "Headquarters";
$gdbo->debug = true;
$gdbo->dbSchema = $DESTINATION;
$gdbo->sql = "SELECT TABLE_NAME FROM information_schema.tables WHERE TABLE_SCHEMA='{$DESTINATION}'";
$gdbo->getRec();
Esempio n. 24
0
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
$curYear = date('Y', strtotime($dtTimeCurrent));
$curMonth = date('n', strtotime($dtTimeCurrent));
$dayCount = cal_days_in_month(CAL_GREGORIAN, $curMonth, $curYear);
$start = strtotime("{$curYear}-{$curMonth}-1 00:00:00 ");
$end = strtotime("{$curYear}-{$curMonth}-{$dayCount} 23:59:59");
$arc = new ArcDb();
$arc->dbConStr = $globalDBCON;
$arc->dbOffset = 0;
$arc->dbType = $globalDBTP;
$arc->dbSchema = $globalDB;
if (isset($_POST["start_date"]) && isset($_POST["end_date"])) {
    $start = strtotime($_POST["start_date"]);
    $end = strtotime($_POST["end_date"]);
}
$daterange = "{$start} and {$end}";
$daterangeFriendly = date('F j, Y', $start) . " through " . date('F j, Y', $end);
$filter = $start != "" ? "where UNIX_TIMESTAMP(a.srv_dc)+{$gmtOffset} between " . $daterange : "";
$arc->sql = "\nSELECT * FROM(\nSELECT\nFROM_UNIXTIME(UNIX_TIMESTAMP(a.srv_dc)+{$gmtOffset},'%m-%d-%y') name,\ncount(id_srv) as data\nFROM _srv a {$filter} group by name order by name desc) as derived WHERE data >=1";
$arc->getRec();
$arcData = $arc->getAssociative();
$arcJSON = json_encode($arcData);
Esempio n. 25
0
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
$ajCfgDevice = null;
$ajCfgDevice = isset($_POST["id_cfg_device"]) ? "&id_cfg_device=" . $_POST["id_cfg_device"] : "";
$ajCfgDevice .= isset($_POST["id_device"]) ? "&id_device=" . $_POST["id_device"] : "";
$ajCfgDevice .= isset($_POST["id_cfg"]) ? "&id_cfg=" . $_POST["id_cfg"] : "";
/**************************************************/
$netgroup = new ArcDb();
$netgroup->dbConStr = $globalDBCON;
$netgroup->dbType = $globalDBTP;
$netgroup->dbSchema = $globalDB;
$netgroup->sql = "SELECT id_cfg_device_netgroup,cfg_device_netgroup from _cfg_device_netgroup order by cfg_device_netgroup";
$netgroup->getRec();
$listnetgroup = $netgroup->dbData;
/**************************************************/
$netgroup->sql = "\nSELECT \ninet_ntoa(a.cfg_device_ip4netaddress) as \"Network\",\na.cfg_device_ip4netaddress_nmbits as \"Netmask\",\na.id_cfg_device_netgroup,\nb.cfg_device_netgroup\nFROM _cfg_device_ip4netaddress a\nINNER JOIN _cfg_device_netgroup b\nON a.id_cfg_device_netgroup=b.id_cfg_device_netgroup \nWHERE cfg_device_ip4netaddress_enabled=1";
$netgroup->getRec();
$listnetwork = $netgroup->dbData;
echo "<script type='text/javascript'>window.listNetwork=" . json_encode($listnetwork) . ";</script>";
/**************************************************/
$buttonAdd = '<div class="elementIconBox" onclick="prepSaveChanges(\'frmNetGroup\')"><i class="fa fa-plus"></i></div>';
$mnunetgroup = array(array(array("Network Group", "cfg_device_netgroup", "class=\"elementIcon\"", 0, null, null, null, $buttonAdd, null, 'Network Group')));
/**************************************************/
Esempio n. 26
0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
$dbo = new ArcDb();
$dbo->dbConStr = $globalDBCON;
$dbo->dbType = $globalDBTP;
$dbo->dbSchema = $globalDB;
$action = $_POST['action'];
$form = $_POST['form'];
$formAction = $form . "," . $action;
# POST variables
$ajCfgDevice = null;
$ajCfgDevice = isset($_POST["id_cfg_device"]) ? "&id_cfg_device=" . $_POST["id_cfg_device"] : "";
$ajCfgDevice .= isset($_POST["id_device"]) ? "&id_device=" . $_POST["id_device"] : "";
$ajCfgDevice .= isset($_POST["id_cfg"]) ? "&id_cfg=" . $_POST["id_cfg"] : "";
$_POST["cfg_device_du"] = $dtTimeUTC;
$_POST["cfg_du"] = $dtTimeUTC;
if ($form != "frmConfig" && $form != "frmDevice") {
    # Ajax actions
Esempio n. 27
0
            case 0:
                echo $_POST["id_srv_board_alt"];
                if ($_POST["id_srv_board_alt"] != "") {
                    $gdbo->dbTable = "_srv_board";
                    $gdbo->sql = "update _srv set id_srv_board=" . $_POST["id_srv_board_alt"] . " WHERE id_srv_board=" . $id_srv_board;
                    $gdbo->execQuery();
                }
                break;
            case 1:
                $service = new ArcDb();
                $service->dbConStr = $globalDBCON;
                $service->dbType = $globalDBTP;
                $service->dbSchema = $globalDB;
                $service->dbTable = "_srv";
                $service->deleteRec("id_srv_board=" . $id_srv_board);
                break;
            default:
                break;
        }
        $service = new ArcDb();
        $service->dbConStr = $globalDBCON;
        $service->dbType = $globalDBTP;
        $service->dbSchema = $globalDB;
        $service->dbTable = "_srv_board";
        $service->deleteRec("id_srv_board=" . $id_srv_board);
        require "index.php";
        break;
}
?>
<script type="text/javascript">clearPop();</script>