CIM71 - Add related users to assest, CIM72 Add related users to accounts
This commit is contained in:
127
cartest_manage.php
Normal file
127
cartest_manage.php
Normal file
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
defined(page_security_key) or exit;
|
||||
|
||||
if (debug && debug_id == $_SESSION['id']){
|
||||
ini_set('display_errors', '1');
|
||||
ini_set('display_startup_errors', '1');
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
|
||||
$page = 'cartest_manage';
|
||||
//Check if allowed
|
||||
if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
||||
header('location: index.php');
|
||||
exit;
|
||||
}
|
||||
//PAGE Security
|
||||
$update_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'U');
|
||||
$delete_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'D');
|
||||
$create_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'C');
|
||||
|
||||
$bearertoken = createCommunicationToken($_SESSION['userkey']);
|
||||
|
||||
//GET PRODUCTS FROM DB
|
||||
$pdo = dbConnect($dbname);
|
||||
$sql = 'SELECT rowID, productcode, productname, product_category,sn from products where status = "1" and build = "1"';
|
||||
$stmt = $pdo->prepare($sql);
|
||||
//Excute Query
|
||||
$stmt->execute();
|
||||
//Get results
|
||||
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
template_header('Buildtool', 'buildtool','view');
|
||||
|
||||
$view = '
|
||||
<div class="content-title">
|
||||
<div class="title">
|
||||
<i class="fa-solid fa-box-open"></i>
|
||||
<div class="txt">
|
||||
<h2>'.$buildtool_h2 .'</h2>
|
||||
<p>'.$buildtool_p.'</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
$view .= '
|
||||
<div class="content-header responsive-flex-column pad-top-5">
|
||||
<a href="index.php?page=dashboard" class="btn">'.$button_cancel.'</a>
|
||||
</div>
|
||||
';
|
||||
|
||||
$view .= '<div class="content-block">
|
||||
<div class="block-header">
|
||||
<i class="fa-solid fa-bars fa-sm"></i><span id="time">25:00</span>
|
||||
</div>
|
||||
<input type="hidden" id="lineToSend" >
|
||||
|
||||
<div id="connectdevice" style="display:flex;">
|
||||
<div>
|
||||
<button class="btn" style="margin-right:10px;" onclick="connectSerial();startGraph()">Connect</button>
|
||||
<button class="btn" id="clear" onclick="closePort()" style="">X</button>
|
||||
<button class="btn" onClick="window.location.reload()">↺</button>
|
||||
</div>
|
||||
<div id="readStatus" style="width: 75%;background-color: #f1f1f1;">
|
||||
<div id="readBar"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="Device_output" style="margin-top: 10px;">
|
||||
<div><canvas id="chart_VCP" style="width:400px;max-width:100%"></canvas></div>
|
||||
<p><small>STATE: -5 = WAIT_CONNECT, 0 = DISCONNECTED, 3 = REACTIVATE, 5 = FULL_CONNECT</small></p>
|
||||
</div>
|
||||
<div id="serialResults" style="display:none;font-family: monospace;white-space: pre;padding: 10px;background-color:#f1f1f1;"></div>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
';
|
||||
|
||||
|
||||
//OUTPUT
|
||||
echo $view;
|
||||
|
||||
//ADD JS FILES
|
||||
echo '
|
||||
<script src = "./assets/readdevice.js?'.script_version.'"></script>
|
||||
<script src = "./assets/charts.js?'.script_version.'"></script>
|
||||
<script src = "./assets/jquery-2.1.4.min.js"></script>
|
||||
<script src = "./assets/DYMO.Label.Framework.latest.js?'.script_version.'" type="text/javascript" charset="UTF-8"> </script>
|
||||
<script>
|
||||
var link = "'.$baseurl.'";
|
||||
|
||||
function startGraph(){
|
||||
setInterval(renderChart,5000);
|
||||
}
|
||||
|
||||
function startTimer(duration, display) {
|
||||
var timer = duration, minutes, seconds;
|
||||
setInterval(function () {
|
||||
minutes = parseInt(timer / 60, 10);
|
||||
seconds = parseInt(timer % 60, 10);
|
||||
|
||||
minutes = minutes < 10 ? "0" + minutes : minutes;
|
||||
seconds = seconds < 10 ? "0" + seconds : seconds;
|
||||
|
||||
display.textContent = minutes + ":" + seconds;
|
||||
|
||||
if (--timer < 0) {
|
||||
timer = duration;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
window.onload = function () {
|
||||
var startMinute = 60 * 25,
|
||||
display = document.querySelector(\'#time\');
|
||||
startTimer(startMinute, display);
|
||||
};
|
||||
</script>
|
||||
';
|
||||
|
||||
|
||||
|
||||
template_footer();
|
||||
?>
|
||||
Reference in New Issue
Block a user