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;
 }
示例#2
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;
 }
 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;
 }
示例#4
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;
 }
 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;
 }
示例#7
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;
 }
示例#8
0
$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);
?>
<script type="text/javascript">
var chartData=<?php 
echo $arcJSON;
?>
;
var chart = AmCharts.makeChart("chartdiv", {
"theme": "none",
"type": "serial",
"dataProvider": chartData,
"chartCursor": {},
"pathToImages": "/_thirdparty/amcharts/images/",
"valueAxes": [{
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;
$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;
示例#10
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";
$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>
<form name="frmIFLabel" id="frmIFLabel" method="post" action="javascript:submitFrmVals('fs_labels','/_mod/smod_18/sql.php','device_interfacelabel','<?php 
echo $ajCfgDevice;
?>
&action=insert&form=frmIFLabel','frmIFLabel')">
<?php 
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;
# Status
$gdbo->sql = "SELECT \nid_sys_status,\nsys_status\nFROM _sys_status \nWHERE id_sys_status_tp=7";
$gdbo->getRec();
$listStatus = $gdbo->dbData;
# Configuration
$gdbo->sql = "SELECT \nid_cfg,\ncfg FROM _cfg;";
示例#12
0
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>";
/**************************************************/
#speedandduplex
$interfacerec->sql = "SELECT id_device_ifspeedduplex,device_ifspeedduplex FROM _device_ifspeedduplex";
$interfacerec->getRec();
$listifspeedduplex = $interfacerec->dbData;
/**************************************************/
#label
$interfacerec->sql = "\nSELECT \na.id_device_interfacelabel,\na.device_interfacelabel \nFROM _device_interfacelabel a\nWHERE NOT EXISTS \n(SELECT b.id_device_interfacelabel \nFROM _cfg_device_interface b \nWHERE a.id_device_interfacelabel=b.id_device_interfacelabel \nAND b.id_cfg_device=" . $_POST["id_cfg_device"] . " \nAND b.cfg_device_interface_enabled=1) AND id_device=" . $_POST["id_device"];
示例#13
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";
$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')));
/**************************************************/
?>
<legend>
Add Network Group
</legend>
<form name="frmNetGroup" id="frmNetGroup" method="post" action="javascript:submitFrmVals('fs_network_groups','/_mod/smod_18/sql.php','cfg_device_netgroup','<?php 
示例#14
0
}
switch ($arcCon->dbType) {
    case "mysql":
        $arcCon->dbSchema = "information_schema";
        $sql = "SELECT TABLE_SCHEMA as `Schema`,TABLE_NAME as `Table`,COLUMN_NAME as `Column`,DATA_TYPE as `Type` FROM COLUMNS WHERE TABLE_SCHEMA='" . $arcCon->oCon . "' ORDER BY TABLE_NAME,COLUMN_NAME";
        break;
    case "mssql":
        $sql = "SELECT TABLE_SCHEMA as [Schema],TABLE_NAME as [Table],COLUMN_NAME as [Column],DATA_TYPE as [Type] FROM INFORMATION_SCHEMA.COLUMNS ORDER BY TABLE_NAME,COLUMN_NAME";
        $arcCon->recOrderCol = "[Column]";
        break;
    case "pgsql":
        $sql = "SELECT TABLE_Catalog as \"Database Schema\",TABLE_SCHEMA as \"Table Schema\",TABLE_NAME as \"Table\",COLUMN_NAME as \"Column\",DATA_TYPE as \"Type\" FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='" . $arcCon->dbCatalog . "' AND TABLE_CATALOG='" . $arcCon->oCon . "' ORDER BY TABLE_NAME,COLUMN_NAME";
        break;
}
$arcCon->sql = $sql;
$arcCon->getRec();
$schemaCols = $arcCon->dbData;
$schemaColsList = "";
for ($i = 0; $i < count($schemaCols); $i++) {
    $next = $i + 1;
    $prev = $i - 1;
    if ($i == 0 || $schemaCols[$i][1] != $schemaCols[$prev][1]) {
        $topLevel = '<ul class="fa-ul"><li onclick="toggleChild(this)"><i class="fa-li fa fa-chevron-circle-up"></i>' . $schemaCols[$i][1] . '</li>';
        $subLevelTop = '<ul style="display:none" class="childlist">';
        $closeTopLevel = '';
        $closeSubLevel = '';
    } else {
        $topLevel = '';
        $subLevelTop = '';
    }
    if ($i == count($schemaCols) - 1 || $schemaCols[$i][1] != $schemaCols[$next][1]) {
示例#15
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;
 }
示例#16
0
 case "frmConfig,insert":
     $dbo->dbTable = "_cfg";
     $dbo->insertRec();
     $_POST['id_cfg'] = $dbo->insertedID;
     include "edit.php";
     break;
 case "frmConfig,edit":
     $dbo->dbTable = "_cfg";
     $dbo->updateRec("id_cfg=" . $_POST["id_cfg"]);
     include "edit.php";
     break;
 case "frmConfig,delete":
     $dbo->dbTable = "_cfg";
     $dbo->deleteRec("id_cfg=" . $_POST["id_cfg"]);
     $dbo->sql = "SELECT id_cfg_device FROM _cfg_device WHERE id_cfg=" . $_POST["id_cfg"];
     $dbo->getRec();
     $devices = $dbo->dbData;
     $dbo->dbTable = "_cfg_device_interface";
     foreach ($devices as $record => $cols) {
         $dbo->deleteRec("id_cfg_cdevice=" . $cols[0]);
     }
     $dbo->dbTable = "_cfg_device";
     $dbo->deleteRec("id_cfg=" . $_POST["id_cfg"]);
     include "index.php";
     break;
     # frmDevice
 # frmDevice
 case "frmDevice,insert":
     $dbo->dbTable = "_cfg_device";
     $dbo->insertRec();
     $_POST['id_cfg_device'] = $dbo->insertedID;
示例#17
0
* @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"]);
    if ($netIsDefined !== false) {
        $errorMsg = long2ip($_POST["cfg_device_interface_ip4hostaddress"]) . " already exists.";
        $errorMsg .= "</br> The address is assigned to the following device interface.";
        $errorMsg .= "<pre>" . print_r($existingInterfaceAssignments[$netIsDefined], true) . "</pre>";
    } else {