Remove development & test files
This commit is contained in:
81
dev.php
81
dev.php
@@ -1,81 +0,0 @@
|
|||||||
<?php
|
|
||||||
ini_set('display_errors', '1');
|
|
||||||
ini_set('display_startup_errors', '1');
|
|
||||||
error_reporting(E_ALL);
|
|
||||||
|
|
||||||
include './assets/functions.php';
|
|
||||||
include './settings/settings.php';
|
|
||||||
include './settings/config.php';
|
|
||||||
|
|
||||||
//-----------------------------------------
|
|
||||||
//Connect to DATABASE FROM WHERE TO MIGRATE
|
|
||||||
//-----------------------------------------
|
|
||||||
|
|
||||||
$dbcon_dev = 'VELITIProduct';
|
|
||||||
$pdo = new PDO('mysql:host=' . $db . ';dbname=' . $dbcon_dev . ';charset=utf8', $dbuser, $dbpw);
|
|
||||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
||||||
|
|
||||||
//-----------------------------------------
|
|
||||||
//-----------------------------------------
|
|
||||||
|
|
||||||
//GET DATA
|
|
||||||
$sql ="SELECT carbrand,cartype,header,questions,datapoints,created,createdby FROM cartest where createdby like '%r2r%'";
|
|
||||||
$stmt = $pdo->prepare($sql);
|
|
||||||
//Excute Query
|
|
||||||
$stmt->execute();
|
|
||||||
//Get results
|
|
||||||
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
||||||
|
|
||||||
$accounthierarchy = '{"salesid":"21-Total Safety Solutions B.V.","soldto":"48-TSS-Demo","shipto":"2854-R2R","location":"","section":"Demo TSS"}';
|
|
||||||
|
|
||||||
foreach ($messages as &$message ){
|
|
||||||
//ADD ACCOUNTHIERARCHY
|
|
||||||
$message['accounthierarchy'] = $accounthierarchy;
|
|
||||||
|
|
||||||
//default whereclause
|
|
||||||
$whereclause = '';
|
|
||||||
|
|
||||||
//CREATE EMPTY STRINGS
|
|
||||||
$clause = '';
|
|
||||||
$clause_insert ='';
|
|
||||||
$input_insert = '';
|
|
||||||
|
|
||||||
$post_content = $message;
|
|
||||||
|
|
||||||
//CREAT NEW ARRAY AND MAP TO CLAUSE
|
|
||||||
if(isset($post_content) && $post_content!=''){
|
|
||||||
foreach ($post_content as $key => $var){
|
|
||||||
if ($key == 'submit' || $key == 'delete' || $key == 'rowID'){
|
|
||||||
//do nothing
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$criterias[$key] = $var;
|
|
||||||
$clause .= ' , '.$key.' = ?';
|
|
||||||
$clause_insert .= ' , '.$key.'';
|
|
||||||
$input_insert .= ', ?'; // ? for each insert item
|
|
||||||
$execute_input[]= $var; // Build array for input
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//CLEAN UP INPUT
|
|
||||||
$clause = substr($clause, 2); //Clean clause - remove first comma
|
|
||||||
$clause_insert = substr($clause_insert, 2); //Clean clause - remove first comma
|
|
||||||
$input_insert = substr($input_insert, 1); //Clean clause - remove first comma
|
|
||||||
|
|
||||||
//-----------------------------------------
|
|
||||||
//Connect to TARGET DATABASE
|
|
||||||
//-----------------------------------------
|
|
||||||
|
|
||||||
$pdo2 = dbConnect($dbname);
|
|
||||||
|
|
||||||
//-----------------------------------------
|
|
||||||
//-----------------------------------------
|
|
||||||
//SQL EXECUTION
|
|
||||||
$sql = 'INSERT INTO cartest ('.$clause_insert.') VALUES ('.$input_insert.')';
|
|
||||||
$stmt = $pdo2->prepare($sql);
|
|
||||||
//$stmt->execute($execute_input);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
30
test.php
30
test.php
@@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
ini_set('display_errors', '1');
|
|
||||||
ini_set('display_startup_errors', '1');
|
|
||||||
error_reporting(E_ALL);
|
|
||||||
|
|
||||||
include './assets/functions.php';
|
|
||||||
include './settings/settings.php';
|
|
||||||
include './settings/config.php';
|
|
||||||
include_once './settings/translations/translations_US.php';
|
|
||||||
include_once './settings/systemfirmware.php';
|
|
||||||
|
|
||||||
$allviews = explode(',' , standard_profile);
|
|
||||||
|
|
||||||
$admin_profile = ["dashboard","profile","equipments","equipment"];
|
|
||||||
|
|
||||||
$view = '<html><form action="" method="post">';
|
|
||||||
|
|
||||||
foreach ($allviews as $view){
|
|
||||||
|
|
||||||
if (in_stir($view,$admin_profile)){
|
|
||||||
$view .= '<input type="checkbox" id="'.$view.'" name="" value="'.$view.'" checked>';
|
|
||||||
} else {
|
|
||||||
$view .= '<input type="checkbox" id="'.$view.'" name="profile[]" value="'.$view.'">';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
$view .= '<input type="submit" name="submit" value="Save" class="btn">';
|
|
||||||
$view .= '</form></html>';
|
|
||||||
|
|
||||||
echo $view;
|
|
||||||
Reference in New Issue
Block a user