Primo commit: trasferimento del progetto PPEasy
This commit is contained in:
@@ -0,0 +1,544 @@
|
||||
|
||||
<?php
|
||||
include('include/headscript.php');
|
||||
include('db-connect.php');
|
||||
?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
// pickup the get variable
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf=$_POST["idtrf"]; }
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf=$_GET["idtrf"]; }
|
||||
if (isset($_POST["photoname"])) {
|
||||
$photoname=$_POST["photoname"]; }
|
||||
if (isset($_POST["description"])) {
|
||||
$description=$_POST["description"]; }
|
||||
if (isset($_POST["model"])) {
|
||||
$model=$_POST["model"]; }
|
||||
if (isset($_POST["rangemeasuremin"])) {
|
||||
$rangemeasuremin=$_POST["rangemeasuremin"]; }
|
||||
if (isset($_POST["rangemeasuremax"])) {
|
||||
$rangemeasuremax=$_POST["rangemeasuremax"]; }
|
||||
if (isset($_POST["registeredmark"])) {
|
||||
$registeredmark=$_POST["registeredmark"]; }
|
||||
if (isset($_POST["articletype"])) {
|
||||
$articletype=$_POST["articletype"]; }
|
||||
if (isset($_POST["articlecharacteristic"])) {
|
||||
$articlecharacteristic=$_POST["articlecharacteristic"]; }
|
||||
if (isset($_POST["formupdtrfdetails"])) {
|
||||
$formupdtrfdetails=$_POST["formupdtrfdetails"]; }
|
||||
if (isset($_POST['stdselected']))
|
||||
{
|
||||
$stds = $_POST['stdselected'];
|
||||
}
|
||||
if (isset($_POST["updstdform"])) {
|
||||
$updstdform=$_POST["updstdform"]; }
|
||||
$idtrf='160';
|
||||
$idcertificate='5';
|
||||
$idtrfdetails=$idtrf;
|
||||
?>
|
||||
|
||||
<?php
|
||||
include('include/trfqueryscript.php'); ?>
|
||||
<?php if (isset($stds)) {
|
||||
foreach ($stds as $hobys=>$value) {
|
||||
|
||||
$stdcheckpresent = new WA_MySQLi_RS("stdcheckpresent",$cmctrfdb,1);
|
||||
$stdcheckpresent->setQuery("SELECT * FROM trfstandards WHERE trfstandards.idtrfdetails='$idtrf' AND trfstandards.idstandards='$value'");
|
||||
$stdcheckpresent->execute();
|
||||
|
||||
if (empty($stdcheckpresent->getColumnVal("idtrfstandards"))) {
|
||||
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "trfstandards";
|
||||
$InsertQuery->bindColumn("idtrfdetails", "i", "$idtrf", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idstandards", "i", "$value", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
|
||||
}}}
|
||||
|
||||
|
||||
?>
|
||||
<?php
|
||||
if (isset($formupdtrfdetails)) {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "`trf-details`";
|
||||
$UpdateQuery->bindColumn("sample_description", "s", "$description", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("measurefrom", "s", "$rangemeasuremin", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("measureto", "s", "$rangemeasuremax", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("model", "s", "$model", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("idarticletype", "i", "$articletype", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("idarticle_characteristics", "i", "$articlecharacteristic", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("registeredmark", "s", "$registeredmark", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idtrfdetails", "=", "i", "".($idtrf) ."");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
|
||||
$code="3";
|
||||
$InsertQuery2 = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery2->Action = "insert";
|
||||
$InsertQuery2->Table = "wheretrfstep";
|
||||
$InsertQuery2->bindColumn("idtrf", "i", "$idtrf", "WA_DEFAULT");
|
||||
$InsertQuery2->bindColumn("code", "s", "$code", "WA_DEFAULT");
|
||||
$InsertQuery2->saveInSession("");
|
||||
$InsertQuery2->execute();
|
||||
$InsertGoTo = "";
|
||||
|
||||
$InsertQuery2->redirect($InsertGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
include('include/trfqueryscript.php'); ?>
|
||||
<?php
|
||||
$trfnumberfinal = new WA_MySQLi_RS("trfnumberfinal",$cmctrfdb,1);
|
||||
$trfnumberfinal->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'");
|
||||
$trfnumberfinal->execute();
|
||||
$idcertn=$trfnumberfinal->getColumnVal("idcertification");
|
||||
$articletype=$trfnumberfinal->getColumnVal("idarticletype");
|
||||
?>
|
||||
<?php $idcert=$trfnumberfinal->getColumnVal("idcertification") ?>
|
||||
<?php
|
||||
$certname = new WA_MySQLi_RS("certname",$cmctrfdb,1);
|
||||
$certname->setQuery("SELECT * FROM certificationtype WHERE certificationtype.idcertificationtype='$idcert'");
|
||||
$certname->execute();?>
|
||||
<?php
|
||||
$stdcheck = new WA_MySQLi_RS("stdcheck",$cmctrfdb,0);
|
||||
$stdcheck->setQuery("SELECT * FROM standards WHERE standards.idarticletype='$articletype'");
|
||||
$stdcheck->execute();?>
|
||||
<?php // inline edit query
|
||||
|
||||
$row1 = mysqli_query($con,"SELECT * FROM auditdpi WHERE auditdpi.idtrfdetails='$idtrfdetails'");
|
||||
$idstandards=mysqli_query($con,"SELECT idstandards ,standardname FROM standards");
|
||||
|
||||
//query list protectioncategory
|
||||
$proteccategorylist=mysqli_query($con,"SELECT idprotectioncategory ,name_protectioncategory FROM protectioncategory");
|
||||
|
||||
$idproteccategorylistRecord=array();
|
||||
while($idprotectioncategoryrow = mysqli_fetch_assoc($proteccategorylist)) {
|
||||
$idproteccategorylistRecord[$idprotectioncategoryrow['idprotectioncategory']]=$idprotectioncategoryrow['name_protectioncategory'];
|
||||
}
|
||||
$idprotectioncategoryJson=json_encode($idproteccategorylistRecord);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head>
|
||||
<meta charset="utf-8" />
|
||||
<title>TRF CIMAC </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="CIMAC TRF Portal" name="description" />
|
||||
<meta content="" name="author" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="../images/favicon.ico">
|
||||
|
||||
<!--Form Wizard-->
|
||||
<link href="../plugins/jquery-steps/jquery.steps.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- App css -->
|
||||
<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="assets/css/jquery-ui.min.css" rel="stylesheet">
|
||||
<link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="assets/css/metisMenu.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="assets/css/app.min.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<!-- inline edit -->
|
||||
|
||||
<!-- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"> -->
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://kit.fontawesome.com/f13e61f9bf.js" crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
|
||||
<script src="jquery.tabledit.js"></script>
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#add").click(function(e){
|
||||
var table = $(this).attr('for-table'); //get the target table selector
|
||||
var $tr = $(table + ">tbody>tr:last-child").clone(true, true); //clone the last row
|
||||
var nextID = parseInt($tr.find("input.tabledit-identifier").val()) + 1; //get the ID and add one.
|
||||
$tr.find("input.tabledit-identifier").val(nextID); //set the row identifier
|
||||
$tr.find("span.tabledit-identifier").text(nextID); //set the row identifier
|
||||
$(table + ">tbody").append($tr); //add the row to the table
|
||||
$tr.find(".tabledit-edit-button").click(); //pretend to click the edit button
|
||||
$tr.find("input:not([type=hidden]):not([type=checkbox]), select").val("");
|
||||
$tr.find("input[type='checkbox']").attr('checked', false);
|
||||
$tr.find("input[name=idtrfdetails]").val('<?php echo $idtrfdetails; ?>');
|
||||
//wipe out the inputs.
|
||||
$(this).prop('disabled', true);
|
||||
});
|
||||
$('#example1').Tabledit({
|
||||
url: 'logic-edit-delete2.php',
|
||||
columns: {
|
||||
identifier: [0, 'id'],
|
||||
editable: [[2, 'certificatenumber'], [3, 'issuebycimac','checkbox'], [4, 'moduleselection'], [5, 'sampleinstore','checkbox'], [6, 'filenameaudit','file'],[7, 'idtrfdetails']]
|
||||
},
|
||||
onDraw: function() {
|
||||
console.log('onDraw()');
|
||||
},
|
||||
onSuccess: function(data, textStatus, jqXHR) {
|
||||
console.log('onSuccess(data, textStatus, jqXHR)');
|
||||
console.log(data);
|
||||
console.log(textStatus);
|
||||
console.log(jqXHR);
|
||||
$("#add").prop('disabled', false);
|
||||
},
|
||||
onFail: function(jqXHR, textStatus, errorThrown) {
|
||||
console.log('onFail(jqXHR, textStatus, errorThrown)');
|
||||
console.log(jqXHR);
|
||||
console.log(textStatus);
|
||||
console.log(errorThrown);
|
||||
},
|
||||
onAlways: function() {
|
||||
console.log('onAlways()');
|
||||
},
|
||||
onAjax: function(action, serialize) {
|
||||
console.log('onAjax(action, serialize)');
|
||||
console.log(action);
|
||||
console.log(serialize);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
||||
.table.user-select-none {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.file-upload {
|
||||
display:none !important;
|
||||
}
|
||||
.uploadfile {
|
||||
cursor: pointer;
|
||||
color: #fff;
|
||||
background-color: #0d6efd;
|
||||
border-color: #0d6efd;
|
||||
padding: 0.375rem 0.75rem;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(function(){
|
||||
//file input field trigger when the drop box is clicked
|
||||
//call a function to handle file upload on select file
|
||||
$(".uploadfile").click(function(e){
|
||||
$('#fileInput').click();
|
||||
|
||||
});
|
||||
$('input[type=file]').on('change', fileUpload);
|
||||
});
|
||||
|
||||
function fileUpload(event){
|
||||
//get selected file
|
||||
files = event.target.files;
|
||||
|
||||
//form data check the above bullet for what it is
|
||||
var data = new FormData();
|
||||
|
||||
//file data is presented as an array
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
var file = files[i];
|
||||
/*if(!file.type.match('image.*')) {
|
||||
//check file type
|
||||
$("#dropBox").html("Please choose an images file.");
|
||||
}else if(file.size > 1048576){
|
||||
//check file size (in bytes)
|
||||
$("#dropBox").html("Sorry, your file is too large (>1 MB");
|
||||
}else{ */
|
||||
//append the uploadable file to FormData object
|
||||
data.append('file', file, file.name);
|
||||
|
||||
//create a new XMLHttpRequest
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
||||
//post file data for upload
|
||||
xhr.open('POST', 'uploadfileaudit.php', true);
|
||||
xhr.send(data);
|
||||
xhr.onload = function () {
|
||||
//get response and show the uploading status
|
||||
var response = JSON.parse(xhr.responseText);
|
||||
if(xhr.status === 200 && response.status == 'ok'){
|
||||
$('.file-upload').each(function(){
|
||||
|
||||
|
||||
if ( $(this).closest( ".tabledit-edit-mode" ).find('.uploadfile').css('display') == 'inline')
|
||||
{
|
||||
$(this).val(response.filename);
|
||||
}
|
||||
});
|
||||
|
||||
$("#dropBox").html("File has been uploaded successfully.");
|
||||
}else if(response.status == 'type_err'){
|
||||
$("#dropBox").html("Please choose an images file.");
|
||||
}else{
|
||||
$("#dropBox").html("Some problem occured, please try again.");
|
||||
}
|
||||
};
|
||||
/* } */
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Top Bar Start -->
|
||||
<?php include('include/topbar.php'); ?>
|
||||
<!-- Top Bar End -->
|
||||
|
||||
|
||||
<!-- Left Sidenav -->
|
||||
<?php include('include/leftsidenav.php'); ?>
|
||||
<!-- end left-sidenav-->
|
||||
|
||||
<div class="page-wrapper">
|
||||
<!-- Page Content-->
|
||||
<div class="page-content">
|
||||
|
||||
<div class="container-fluid">
|
||||
<!-- Page-Title -->
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="page-title-box">
|
||||
<div class="float-right">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="javascript:void(0);">CIMAC TRF</a></li>
|
||||
<li class="breadcrumb-item active">Starter</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $titlewb; ?></h4>
|
||||
</div><!--end page-title-box-->
|
||||
</div><!--end col-->
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="media">
|
||||
|
||||
<?php include('include/appform.php'); ?>
|
||||
</div><!--end media-->
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
<div id="accordion">
|
||||
<div class="card">
|
||||
<div class="card-2" id="headingThree">
|
||||
<h5 class="mb-0">
|
||||
<button class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
|
||||
<?php echo $descriptionstep; ?>
|
||||
</button>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-success mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><?php echo $typearticletitle; ?></th>
|
||||
<th><?php echo $descriptiontitle; ?></th>
|
||||
<th><?php echo $modeltitle; ?></th>
|
||||
<th><?php echo $rangemeasuremintitle; ?></th>
|
||||
<th><?php echo $rangemeasuremaxtitle; ?></th>
|
||||
<th><?php echo $articlecharacteristictitle; ?></th>
|
||||
<th><?php echo $registeredmarktitle; ?></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><img src="uploadimages/<?php echo $sphotofilename; ?>" height="100" alt=""/></td>
|
||||
<td><span class="badge badge-soft-primary"><?php echo $sname_articletype; ?></span></td>
|
||||
<td><?php echo $sdescription; ?></td>
|
||||
<td><?php echo $smodel; ?></td>
|
||||
<td><?php echo $smeasuremin; ?></td>
|
||||
<td><?php echo $smeasuremax; ?></td>
|
||||
|
||||
<td><span class="badge badge-soft-primary"><?php echo $sname_articlecharacteristic; ?></span></td>
|
||||
<td><?php echo $sregisteredmark; ?></td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table><!--end /table-->
|
||||
<br>
|
||||
|
||||
<a href="trfdetails.php?idtrf=<?php echo $idtrf; ?>"><button type="button" class="btn btn-success waves-effect waves-light"><?php echo $edittitle; ?></button> </a>
|
||||
</div><!--end /tableresponsive-->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="progress mb-4">
|
||||
<div class="progress-bar" role="progressbar" style="width: 50%;" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100">50%</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5><?php echo $standardlink; ?></h5>
|
||||
<p class="text-muted mb-3"><?php echo $standardlink_help; ?></p>
|
||||
<form class="was-validated" action="standardstep.php" method="post" name="myForm">
|
||||
|
||||
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while(!$stdcheck->atEnd()) {
|
||||
$wa_startindex = $stdcheck->Index;
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="<?php echo($stdcheck->getColumnVal("idstandards")); ?>" name="stdselected[]" data-parsley-multiple="groups" data-parsley-mincheck="2" value="<?php echo($stdcheck->getColumnVal("idstandards")); ?>">
|
||||
<label class="custom-control-label" for="<?php echo($stdcheck->getColumnVal("idstandards")); ?>"><?php echo($stdcheck->getColumnVal("standardcode")); ?>-<?php echo($stdcheck->getColumnVal("standardname")); ?></label>
|
||||
</div>
|
||||
<?php
|
||||
$stdcheck->moveNext();
|
||||
}
|
||||
$stdcheck->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
<input type="hidden" name="articletype" id="articletype" value="<?php echo $articletype; ?>">
|
||||
<input type="hidden" name="updstdform" id="articletype" value="Y">
|
||||
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo $idtrf; ?>">
|
||||
<br><br>
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $addstandardtitle; ?>">
|
||||
|
||||
</div><!--end card-body-->
|
||||
</form>
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
<?php
|
||||
$standardselectedlist = new WA_MySQLi_RS("standardselectedlist",$cmctrfdb,0);
|
||||
$standardselectedlist->setQuery("SELECT * FROM trfstandards LEFT JOIN standards ON trfstandards.idstandards=standards.idstandards WHERE trfstandards.idtrfdetails='$idtrf'");
|
||||
$standardselectedlist->execute();?>
|
||||
|
||||
|
||||
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<h5><?php echo $assignedstd; ?></h4>
|
||||
<p class="text-muted mb-3">
|
||||
<?php echo $assignedstd_help; ?>.
|
||||
</p>
|
||||
<form style="display:none;">
|
||||
<div id="dropBox" >
|
||||
|
||||
</div>
|
||||
<input type="file" name="fileInput" id="fileInput" />
|
||||
</form>
|
||||
<div class="table-responsive">
|
||||
|
||||
<div class="text-end">
|
||||
<button type="button" id="add" class="btn btn-primary" for-table='#example1'>Add</button>
|
||||
</div>
|
||||
<table class="table" id="example1" style="border:1px solide red">
|
||||
<tr><th style="display:none;">id</th><th style="display:none;">idtrfdetails</th><th>certificatenumber</th><th>issuebycimac</th><th>moduleselection</th><th>sampleinstore</th><th>filenameaudit</th></tr>
|
||||
<?php while($row = mysqli_fetch_assoc($row1)) {?>
|
||||
<tr>
|
||||
<td style="display:none;"><?php echo $row['idauditdpi'];?></td>
|
||||
<td style="display:none;"><?php echo $row['idtrfdetails'];?></td>
|
||||
<td><?php echo $row['certificatenumber']; ?></td>
|
||||
<td><?php if ($row['issuebycimac']=='yes') { ?>OK<?php } else { ?>NO<?php } ?></td>
|
||||
<td><?php echo $row['moduleselection']; ?></td>
|
||||
<td><?php if ($row['sampleinstore']=='yes') { ?>OK<?php } else { ?>NO<?php } ?></td>
|
||||
<td><a href="proa.php"><?php if (!empty($row['filenameaudit'])) { ?><a href="proa.php">LINK</a><?php } else { ?><?php } ?></td>
|
||||
<td style="display:none;"><?php echo $row['idtrfdetails']; ?></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
</table>
|
||||
|
||||
|
||||
<?php include('include/virusquerycheck.php'); ?><br>
|
||||
|
||||
<?php if (($articletype==1) || (!empty($virusstep))) { ?>
|
||||
<a href="additionalinfo.php?idtrf=<?php echo $idtrf; ?>&codestep=<?php echo '3'; ?>"><button type="button" class="btn btn-success waves-effect waves-light"><?php echo $nextsteptitle; ?></button> </a>
|
||||
<?php } else { ?>
|
||||
<a href="addrequirements.php?idtrf=<?php echo $idtrf; ?>&codestep=<?php echo '3'; ?>"><button type="button" class="btn btn-success waves-effect waves-light"><?php echo $nextsteptitle; ?></button> </a>
|
||||
<?php } ?>
|
||||
<button type="button" class="btn btn-dark waves-effect waves-light" onclick="history.back()"><?php echo $backstep; ?></button>
|
||||
<!--end /table-->
|
||||
</div><!--end /tableresponsive-->
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end page title end breadcrumb -->
|
||||
|
||||
|
||||
</div><!-- container -->
|
||||
<!-- footer start -->
|
||||
<?php include('include/footer.php'); ?>
|
||||
</footer><!--end footer-->
|
||||
</div>
|
||||
<!-- end page content -->
|
||||
</div>
|
||||
<!-- end page-wrapper -->
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- jQuery -->
|
||||
<!-- <script src="assets/js/jquery.min.js"></script> -->
|
||||
<script src="assets/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="assets/js/metismenu.min.js"></script>
|
||||
<script src="assets/js/waves.js"></script>
|
||||
<script src="assets/js/feather.min.js"></script>
|
||||
<script src="assets/js/jquery.slimscroll.min.js"></script>
|
||||
<script src="assets/js/jquery-ui.min.js"></script>
|
||||
|
||||
<script src="../plugins/jquery-steps/jquery.steps.min.js"></script>
|
||||
<script src="assets/pages/jquery.form-wizard.init.js"></script>
|
||||
|
||||
<!-- App js -->
|
||||
<script src="assets/js/app.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,776 @@
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
$codeposition='7';
|
||||
// pickup the get variable
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf=$_GET["idtrf"];
|
||||
}
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf=$_POST["idtrf"];
|
||||
}
|
||||
if (isset($_POST["descriptionpartvalue"])) {
|
||||
$descriptionpartvalue=$_POST["descriptionpartvalue"];
|
||||
} else {
|
||||
$descriptionpartvalue="";
|
||||
}
|
||||
if (isset($_POST["articlepartvalue"])) {
|
||||
$articlepartvalue=$_POST["articlepartvalue"];
|
||||
} else {
|
||||
$articlepartvalue="";
|
||||
}
|
||||
if (isset($_POST["colorvalue"])) {
|
||||
$colorvalue=$_POST["colorvalue"];
|
||||
} else {
|
||||
$colorvalue="";
|
||||
}
|
||||
if (isset($_POST["cmcreportnumber"])) {
|
||||
$cmcreportnumber=$_POST["cmcreportnumber"];
|
||||
} else {
|
||||
$cmcreportnumber="";
|
||||
}
|
||||
if (isset($_POST["cmcdatereport"])) {
|
||||
$cmcdatereport=$_POST["cmcdatereport"];
|
||||
} else {
|
||||
$cmcdatereport="";
|
||||
}
|
||||
if (isset($_POST["trdreportnumber"])) {
|
||||
$trdreportnumber=$_POST["trdreportnumber"];
|
||||
} else {
|
||||
$trdreportnumber="";
|
||||
}
|
||||
if (isset($_POST["trddatereport"])) {
|
||||
$trddatereport=$_POST["trddatereport"];
|
||||
} else {
|
||||
$trddatereport="";
|
||||
}
|
||||
if (isset($_POST["kindoftest"])) {
|
||||
$kindoftest=$_POST["kindoftest"];
|
||||
} else {
|
||||
$kindoftest="";
|
||||
}
|
||||
if (isset($_POST["addpart"])) {
|
||||
$addpart=$_POST["addpart"];
|
||||
} else {
|
||||
$addpart="";
|
||||
}
|
||||
|
||||
|
||||
$todaydate=date("Y-m-d");
|
||||
|
||||
if (isset($_GET["codestep"])) {
|
||||
$code="7";
|
||||
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "wheretrfstep";
|
||||
$InsertQuery->bindColumn("idtrf", "i", "$idtrf", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("code", "i", "$code", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$trfnumberfinal = new WA_MySQLi_RS("trfnumberfinal", $cmctrfdb, 1);
|
||||
$trfnumberfinal->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'");
|
||||
$trfnumberfinal->execute();
|
||||
$idcertn=$trfnumberfinal->getColumnVal("idcertification");
|
||||
$idarticletype=$trfnumberfinal->getColumnVal("idarticletype");
|
||||
?>
|
||||
<?php $idcert=$trfnumberfinal->getColumnVal("idcertification") ?>
|
||||
<?php
|
||||
$certname = new WA_MySQLi_RS("certname", $cmctrfdb, 1);
|
||||
$certname->setQuery("SELECT * FROM certificationtype WHERE certificationtype.idcertificationtype='$idcert'");
|
||||
$certname->execute();?>
|
||||
<?php
|
||||
if ($addpart=="Y") {
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "identificationparts";
|
||||
$InsertQuery->bindColumn("description_identificationparts", "s", "$descriptionpartvalue", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("article_identificationparts", "s", "$articlepartvalue", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("color_identificationparts", "s", "$colorvalue", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("cmcreportnumber_identificationparts", "s", "$cmcreportnumber", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("cmcreportdate_identificationparts", "t", "$cmcdatereport", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("thirdlabreportnumber_identificationparts", "s", "$trdreportnumber", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("thirdlabreportdate_identificationparts", "t", "$trddatereport", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idtrfdetails", "i", "$idtrf", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("kindoftest", "s", "$kindoftest", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$listinsertedpart = new WA_MySQLi_RS("listinsertedpart", $cmctrfdb, 0);
|
||||
$listinsertedpart->setQuery("SELECT * FROM identificationparts WHERE identificationparts.idtrfdetails='$idtrf'");
|
||||
$listinsertedpart->execute();
|
||||
?>
|
||||
|
||||
<?php if ($idcertn=='2') {
|
||||
header("Location: adddocument.php?idtrf=$idtrf");
|
||||
} elseif ($idcertn=='4' ) {
|
||||
header("Location: adddocument.php?idtrf=$idtrf");
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>TRF CIMAC </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="CIMAC TRF Portal" name="description" />
|
||||
<meta content="" name="author" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="../images/favicon.ico">
|
||||
<!--Form Wizard-->
|
||||
<link href="../plugins/jquery-steps/jquery.steps.css" rel="stylesheet" type="text/css">
|
||||
<!-- App css -->
|
||||
<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="assets/css/jquery-ui.min.css" rel="stylesheet">
|
||||
<link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="assets/css/metisMenu.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="assets/css/app.min.css" rel="stylesheet" type="text/css" />
|
||||
<!-- Sweet Alert -->
|
||||
<link href="../plugins/sweet-alert2/sweetalert2.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="../plugins/animate/animate.css" rel="stylesheet" type="text/css">
|
||||
<link href="../plugins/spectrum/spectrum.min.css" rel="stylesheet" type="text/css">
|
||||
<!-- Plugins css -->
|
||||
<link href="../plugins/daterangepicker/daterangepicker.css" rel="stylesheet" />
|
||||
<link href="../plugins/select2/select2.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../plugins/timepicker/bootstrap-material-datetimepicker.css" rel="stylesheet">
|
||||
<link href="../plugins/bootstrap-touchspin/css/jquery.bootstrap-touchspin.min.css" rel="stylesheet" />
|
||||
<!-- search on article -->
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="searchengine/scriptsearch.js"></script>
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myFormone"].submit();
|
||||
}
|
||||
function setInputVal(id, value) {
|
||||
let input = document.getElementById(id);
|
||||
input.value = value;
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myFormtwo"].submit();
|
||||
}
|
||||
function setInputVal(id, value) {
|
||||
let input = document.getElementById(id);
|
||||
input.value = value;
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<!-- Top Bar Start -->
|
||||
<?php include('include/topbar.php'); ?>
|
||||
<!-- Top Bar End -->
|
||||
<!-- Left Sidenav -->
|
||||
<?php include('include/leftsidenav.php'); ?>
|
||||
<!-- end left-sidenav-->
|
||||
<div class="page-wrapper">
|
||||
<!-- Page Content-->
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- Page-Title -->
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="page-title-box">
|
||||
<div class="float-right">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="javascript:void(0);">TRF</a></li>
|
||||
<li class="breadcrumb-item active">Starter</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $titlewb; ?></h4>
|
||||
</div>
|
||||
<!--end page-title-box-->
|
||||
</div>
|
||||
<!--end col-->
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="media">
|
||||
<?php include('include/appform.php'); ?>
|
||||
</div>
|
||||
<!--end media-->
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
</div>
|
||||
<!--end card-->
|
||||
<div class="progress mb-4">
|
||||
<div class="progress-bar" role="progressbar" style="width: 90%;" aria-valuenow="90" aria-valuemin="0" aria-valuemax="100">90%</div>
|
||||
</div>
|
||||
<!-- card for additional info gloves -->
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $identificationparttitle; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $identificationparttitle_help; ?></p>
|
||||
<p>
|
||||
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#newpart" aria-expanded="false" aria-controls="newpart">
|
||||
<?php echo $newtest; ?>
|
||||
</button>
|
||||
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#cmcpart" aria-expanded="false" aria-controls="cmcpart">
|
||||
<?php echo $oldcmctest; ?>
|
||||
</button>
|
||||
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#thirdpart" aria-expanded="false" aria-controls="thirdpart">
|
||||
<?php echo $trdparttest; ?>
|
||||
</button>
|
||||
</p>
|
||||
<div class="collapse" id="newpart">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $newtesttitle; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i></h4>
|
||||
|
||||
<div class="modal fade bs-example-modal-center5" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title mt-0" id="exampleModalLabel"><?php echo $m18btitle; ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p><?php echo nl2br($newtestparthelp); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<p class="text-muted mb-3"><?php echo $newtesttitle_help; ?>
|
||||
</p>
|
||||
<form class="was-validated" action="" method="post" name="myFormone">
|
||||
<!-- image section -->
|
||||
<?php include('include/maparticle.php'); ?>
|
||||
<!-- div new parts -->
|
||||
<div class="form-row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $descriptionpart; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center"></i></label>
|
||||
|
||||
<input type="text" class="form-control is-valid" id="descriptionpartvalue" name="descriptionpartvalue" placeholder="<?php echo $descriptionpart; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer02"><?php echo $articlepart; ?></label>
|
||||
<i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center"></i>
|
||||
<input type="text" class="form-control is-valid" id="articlepartvalue" name="articlepartvalue" placeholder="<?php echo $articlepart; ?>" required="">
|
||||
<br>
|
||||
<b>Ex: </b><i><?php echo $searchsentence; ?></i>
|
||||
<br />
|
||||
<div id="display"></div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServerUsername"><?php echo $colorpart; ?></label>
|
||||
<i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center"></i>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
</div>
|
||||
<input id="colorvalue" name="colorvalue" class="form-control" type="text" placeholder="<?php echo $colorpart; ?>" aria-describedby="inputGroupPrepend3" required="">
|
||||
<script>
|
||||
|
||||
setTimeout(function(){
|
||||
$("#colorvalue").spectrum({
|
||||
showPalette: true,
|
||||
showPaletteOnly: true,
|
||||
palette: [
|
||||
["Red","Cyan","Blue","DarkBlue","LightBlue","Purple"],
|
||||
["Yellow","Lime","Magenta","Pink","White","Silver"],
|
||||
["Gray","Black","Orange","Brown","Green"],
|
||||
["Olive","Aquamarine"]
|
||||
]
|
||||
});
|
||||
}, 1000);
|
||||
</script>
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo($trfnumberfinal->getColumnVal("idtrfdetails")); ?>">
|
||||
<input type="hidden" name="kindoftest" id="kindoftest" value="new">
|
||||
<input type="hidden" name="addpart" id="addpart" value="Y">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $addpartbutton; ?>">
|
||||
</form>
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- end -->
|
||||
|
||||
|
||||
<!-- div CMC parts -->
|
||||
<div class="collapse" id="cmcpart">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $cmctesttitle; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center9"></i></h4>
|
||||
|
||||
<div class="modal fade bs-example-modal-center9" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title mt-0" id="exampleModalLabel"><?php echo $m18btitle; ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p><?php echo nl2br($newtestparthelp); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<p class="text-muted mb-3"><?php echo $cmctesttitle_help; ?>
|
||||
</p>
|
||||
<form class="was-validated" action="" method="POST" name="myFormtwo">
|
||||
<?php include('include/maparticle2.php'); ?>
|
||||
<!-- div new parts -->
|
||||
<div class="form-row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $descriptionpart; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="descriptionpartvalue2" name="descriptionpartvalue" placeholder="<?php echo $descriptionpart; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer02"><?php echo $articlepart; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="articlepartvalue" name="articlepartvalue" placeholder="<?php echo $articlepart; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServerUsername"><?php echo $colorpart; ?></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
</div>
|
||||
<input type="text" class="form-control" id="colorvalue" name="colorvalue" placeholder="<?php echo $colorpart; ?>" aria-describedby="inputGroupPrepend3" required="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $reportnumbercmctitle; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="cmcreportnumber" name="cmcreportnumber" placeholder="<?php echo $reportnumbercmctitle; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServerUsername"><?php echo $datereporttitle; ?></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
</div>
|
||||
<input type="date" required="" class="form-control" id="daterport" name="cmcdatereport" onchange="validateDate(this.value)" min="2000-01-01" max="<?php echo $todaydate; ?>" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $reportoftitle; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="reportof" name="reportof" placeholder="<?php echo $reportoftitle; ?>" required="">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo($trfnumberfinal->getColumnVal("idtrfdetails")); ?>">
|
||||
<input type="hidden" name="kindoftest" id="kindoftest" value="cmc">
|
||||
<input type="hidden" name="addpart" id="addpart" value="Y">
|
||||
<input type="button" onclick="formSubmit2()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $addpartbutton; ?>">
|
||||
</form>
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- end -->
|
||||
<script>
|
||||
function formSubmit3() {
|
||||
document.forms["myFormthree"].submit();
|
||||
}
|
||||
</script>
|
||||
<!-- div 3rd lab parts -->
|
||||
<div class="collapse" id="thirdpart">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $trdlabparttitle; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center10"></i></h4>
|
||||
|
||||
<div class="modal fade bs-example-modal-center10" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title mt-0" id="exampleModalLabel"><?php echo $m18btitle; ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p><?php echo nl2br($newtestparthelp); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal --></h4>
|
||||
<p class="text-muted mb-3"><?php echo $trdlabparttitle_help; ?>
|
||||
</p>
|
||||
<script>
|
||||
function formSubmit3() {
|
||||
document.forms["myFormthree"].submit();
|
||||
}
|
||||
function setInputVal(id, value) {
|
||||
let input = document.getElementById(id);
|
||||
input.value = value;
|
||||
}
|
||||
</script>
|
||||
<form class="was-validated" action="" method="post" name="myFormthree">
|
||||
<?php include('include/maparticle.php'); ?>
|
||||
<!-- div new parts -->
|
||||
<div class="form-row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $descriptionpart; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="descriptionpartvalue" name="descriptionpartvalue" placeholder="<?php echo $descriptionpart; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer02"><?php echo $articlepart; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="articlepartvalue" name="articlepartvalue" placeholder="<?php echo $articlepart; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServerUsername"><?php echo $colorpart; ?></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
</div>
|
||||
<input type="text" class="form-control" id="colorvalue" name="colorvalue" placeholder="<?php echo $colorpart; ?>" aria-describedby="inputGroupPrepend3" required="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $reprtonumbertrdlabtitle; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="trdreportnumber" name="trdreportnumber" placeholder="<?php echo $reprtonumbertrdlabtitle; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServerUsername"><?php echo $trddatereporttitle; ?></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
</div>
|
||||
<input name="trddatereport" type="date" required="" class="form-control" id="daterport" onchange="validateDate(this.value)" min="2000-01-01" max="<?php echo $todaydate; ?>" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $reportoftitle; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="reportof" name="reportof" placeholder="<?php echo $reportoftitle; ?>" required="">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo($trfnumberfinal->getColumnVal("idtrfdetails")); ?>">
|
||||
<input type="hidden" name="kindoftest" id="kindoftest" value="trd">
|
||||
<input type="hidden" name="addpart" id="addpart" value="Y">
|
||||
<input type="button" onclick="formSubmit3()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $addpartbutton; ?>">
|
||||
</form>
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- end -->
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
</div>
|
||||
<!--end card-->
|
||||
</div>
|
||||
<!--end col-->
|
||||
<!-- show the parts -->
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $assignedparts; ?></h4>
|
||||
<p class="text-muted mb-6"><?php echo $assignedparts_help; ?>
|
||||
</p>
|
||||
<style media="screen">
|
||||
.hidden-x {
|
||||
display: none!important;
|
||||
}
|
||||
</style>
|
||||
<div id="datatable_wrapper" class="dataTables_wrapper dt-bootstrap4 no-footer">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="datatable" class="table table-bordered dt-responsive nowrap dataTable no-footer dtr-inline" style="border-collapse: collapse; border-spacing: 0px; width: 100%;" role="grid" aria-describedby="datatable_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="sorting_asc" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 149px;" aria-sort="ascending" aria-label="Name: activate to sort column descending">
|
||||
<?php echo $kindpart; ?>
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 230px;" aria-label="Position: activate to sort column ascending">
|
||||
<?php echo $descriptionpartlist; ?>
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 108px;" aria-label="Office: activate to sort column ascending">
|
||||
<?php echo $articlepartlist; ?>
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 45px;" aria-label="Age: activate to sort column ascending">
|
||||
<?php echo $colorpartlist; ?>
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 97px;" aria-label="Start date: activate to sort column ascending">
|
||||
<?php echo $reportlist; ?>
|
||||
</th>
|
||||
|
||||
<th class="sorting" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 75px;" aria-label="Salary: activate to sort column ascending">
|
||||
<?php echo $datereportlist; ?>
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 75px;" aria-label="Salary: activate to sort column ascending">
|
||||
<?php echo $action; ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$listinsertedpart->atEnd()) {
|
||||
$wa_startindex = $listinsertedpart->Index; ?>
|
||||
<tr role="row" class="odd">
|
||||
<td tabindex="0" class="sorting_1">
|
||||
<span class="text-x"><?php echo($listinsertedpart->getColumnVal("kindoftest")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="text" class="form-control" name="kindoftest" value="<?php echo($listinsertedpart->getColumnVal("kindoftest")); ?>">
|
||||
<input type="hidden" class="form-control" name="ididentificationparts" value="<?php echo($listinsertedpart->getColumnVal("ididentificationparts")); ?>">
|
||||
<input type="hidden" class="form-control" name="idtrfdetails" value="<?php echo($listinsertedpart->getColumnVal("idtrfdetails")); ?>">
|
||||
</span>
|
||||
</td>
|
||||
<td tabindex="0" class="sorting_1">
|
||||
<span class="text-x"><?php echo($listinsertedpart->getColumnVal("description_identificationparts")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="text" class="form-control" name="description_identificationparts" value="<?php echo($listinsertedpart->getColumnVal("description_identificationparts")); ?>">
|
||||
</span>
|
||||
</td>
|
||||
<td tabindex="0" class="sorting_1">
|
||||
<span class="text-x"><?php echo($listinsertedpart->getColumnVal("article_identificationparts")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="text" class="form-control" name="article_identificationparts" value="<?php echo($listinsertedpart->getColumnVal("article_identificationparts")); ?>">
|
||||
</span>
|
||||
</td>
|
||||
<td tabindex="0" class="sorting_1">
|
||||
<span class="text-x"><?php echo($listinsertedpart->getColumnVal("color_identificationparts")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="text" class="form-control" name="color_identificationparts" value="<?php echo($listinsertedpart->getColumnVal("color_identificationparts")); ?>">
|
||||
</span>
|
||||
</td>
|
||||
<td tabindex="0" class="sorting_1">
|
||||
<span class="text-x"><?php echo($listinsertedpart->getColumnVal("cmcreportnumber_identificationparts")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="text" class="form-control" name="cmcreportnumber_identificationparts" value="<?php echo($listinsertedpart->getColumnVal("cmcreportnumber_identificationparts")); ?>">
|
||||
</span> -
|
||||
<span class="text-x"><?php echo($listinsertedpart->getColumnVal("thirdlabreportnumber_identificationparts")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="text" class="form-control" name="thirdlabreportnumber_identificationparts" value="<?php echo($listinsertedpart->getColumnVal("thirdlabreportnumber_identificationparts")); ?>">
|
||||
</span>
|
||||
</td>
|
||||
|
||||
<td tabindex="0" class="sorting_1">
|
||||
<span class="text-x"><?php echo($listinsertedpart->getColumnVal("thirdlabreportdate_identificationparts")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="date" class="form-control" name="thirdlabreportdate_identificationparts" value="<?php echo($listinsertedpart->getColumnVal("thirdlabreportdate_identificationparts")); ?>">
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="edit-btn-x">
|
||||
<button id="bEdit" type="button" class="btn btn-sm btn-soft-success btn-circle mr-2" onclick="makeEditable(this)"><i class="dripicons-pencil"></i></button>
|
||||
<button id="bElim" type="button" class="btn btn-sm btn-soft-danger btn-circle" onclick="deleteRow(this, <?php echo($listinsertedpart->getColumnVal("ididentificationparts")); ?>)"style=""><i class="dripicons-trash" aria-hidden="true"></i></button>
|
||||
</span>
|
||||
<span class="save-btn-x hidden-x">
|
||||
<button id="bAcep" type="button" class="btn btn-sm btn-soft-purple mr-2 btn-circle" style="" onclick="saveEditable(this)"><i class="dripicons-checkmark"></i></button>
|
||||
<button id="bCanc" type="button" class="btn btn-sm btn-soft-info btn-circle" style="" onclick="cancelEdit(this)"><i class="dripicons-cross" aria-hidden="true"></i></button>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$listinsertedpart->moveNext();
|
||||
}
|
||||
$listinsertedpart->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<a href="adddocument.php?idtrf=<?php echo $idtrf; ?>&codestep=7"><button type="button" class="btn btn-success waves-effect waves-light"><?php echo $nextsteptitle; ?></button> </a>
|
||||
<button type="button" class="btn btn-dark waves-effect waves-light" onclick="history.back()"><?php echo $backstep; ?></button>
|
||||
<script>
|
||||
function makeEditable(node) {
|
||||
let tr = node.parentNode.parentNode.parentNode;
|
||||
let td = node.parentNode.parentNode;
|
||||
let all_text = tr.getElementsByClassName('text-x');
|
||||
let all_input = tr.getElementsByClassName('input-x');
|
||||
let edit_btn = td.getElementsByClassName('edit-btn-x')[0];
|
||||
let save_btn = td.getElementsByClassName('save-btn-x')[0];
|
||||
|
||||
edit_btn.classList.add('hidden-x');
|
||||
save_btn.classList.remove('hidden-x');
|
||||
|
||||
for(let i of all_text) {
|
||||
i.classList.add('hidden-x');
|
||||
}
|
||||
for(let i of all_input) {
|
||||
i.classList.remove('hidden-x');
|
||||
}
|
||||
// console.log()
|
||||
}
|
||||
|
||||
function saveEditable(node) {
|
||||
let tr = node.parentNode.parentNode.parentNode;
|
||||
let td = node.parentNode.parentNode;
|
||||
window.all_text = tr.getElementsByClassName('text-x');
|
||||
window.all_input = tr.getElementsByClassName('input-x');
|
||||
window.edit_btn = td.getElementsByClassName('edit-btn-x')[0];
|
||||
window.save_btn = td.getElementsByClassName('save-btn-x')[0];
|
||||
let payload = {};
|
||||
|
||||
for(let input of tr.getElementsByTagName('input')) {
|
||||
payload[input.name] = input.value;
|
||||
|
||||
/*if(!input.value) {
|
||||
alert(`Empty value is not allowed(${input.name})!`);
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'ajax.php',
|
||||
data : payload,
|
||||
success : function(response) {
|
||||
if(response.status == 'success') {
|
||||
window.edit_btn.classList.remove('hidden-x');
|
||||
window.save_btn.classList.add('hidden-x');
|
||||
|
||||
for(let i = 0; i < window.all_input.length; i++) {
|
||||
window.all_input[i].classList.add('hidden-x');
|
||||
window.all_text[i].innerHTML = window.all_input[i].getElementsByTagName('input')[0].value;
|
||||
}
|
||||
for(let i of window.all_text) {
|
||||
i.classList.remove('hidden-x');
|
||||
}
|
||||
} else {
|
||||
alert(response.message);
|
||||
}
|
||||
},
|
||||
error : function(e){
|
||||
if (e.status == 200) {
|
||||
window.edit_btn.classList.remove('hidden-x');
|
||||
window.save_btn.classList.add('hidden-x');
|
||||
|
||||
for(let i = 0; i < window.all_input.length; i++) {
|
||||
window.all_input[i].classList.add('hidden-x');
|
||||
window.all_text[i].innerHTML = window.all_input[i].getElementsByTagName('input')[0].value;
|
||||
}
|
||||
for(let i of window.all_text) {
|
||||
i.classList.remove('hidden-x');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function deleteRow(node, id) {
|
||||
let cnf = confirm('<?php echo $confirmdeleteline; ?>');
|
||||
|
||||
if(!cnf) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.tr = node.parentNode.parentNode.parentNode;
|
||||
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'delete_ajax.php',
|
||||
data : {id : id},
|
||||
success : function(response) {
|
||||
if(response.status == 'success') {
|
||||
window.tr.remove();
|
||||
} else {
|
||||
alert(response.message);
|
||||
}
|
||||
},
|
||||
error : function(e){
|
||||
if (e.status == 200) {
|
||||
window.tr.remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function cancelEdit(node) {
|
||||
let tr = node.parentNode.parentNode.parentNode;
|
||||
let td = node.parentNode.parentNode;
|
||||
window.all_text = tr.getElementsByClassName('text-x');
|
||||
window.all_input = tr.getElementsByClassName('input-x');
|
||||
window.edit_btn = td.getElementsByClassName('edit-btn-x')[0];
|
||||
window.save_btn = td.getElementsByClassName('save-btn-x')[0];
|
||||
window.edit_btn.classList.remove('hidden-x');
|
||||
window.save_btn.classList.add('hidden-x');
|
||||
|
||||
for(let i = 0; i < window.all_input.length; i++) {
|
||||
window.all_input[i].classList.add('hidden-x');
|
||||
}
|
||||
for(let i of window.all_text) {
|
||||
i.classList.remove('hidden-x');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title end breadcrumb -->
|
||||
</div>
|
||||
<!-- container -->
|
||||
<!-- footer start -->
|
||||
<?php include('include/footer.php'); ?>
|
||||
</footer><!--end footer-->
|
||||
</div>
|
||||
<!-- end page content -->
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function validateDate(date) {
|
||||
var five_years_before_from_current = moment().subtract(5, 'years');
|
||||
var selected_date = moment(date);
|
||||
|
||||
if (selected_date < five_years_before_from_current) {
|
||||
alert('<?php echo $alertdate; ?>');
|
||||
{
|
||||
$("#newpart").addClass('show');
|
||||
$("#cmcpart").removeClass('show');
|
||||
$("#thirdpart").removeClass('show');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!-- end page-wrapper -->
|
||||
<!-- jQuery -->
|
||||
<script src="assets/js/jquery.min.js"></script>
|
||||
<script src="assets/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="assets/js/metismenu.min.js"></script>
|
||||
<script src="assets/js/waves.js"></script>
|
||||
<script src="assets/js/feather.min.js"></script>
|
||||
<script src="assets/js/jquery.slimscroll.min.js"></script>
|
||||
<script src="assets/js/jquery-ui.min.js"></script>
|
||||
<!-- Plugins js -->
|
||||
<script src="../plugins/moment/moment.js"></script>
|
||||
<script src="../plugins/daterangepicker/daterangepicker.js"></script>
|
||||
<script src="../plugins/select2/select2.min.js"></script>
|
||||
<script src="../plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js"></script>
|
||||
<script src="../plugins/timepicker/bootstrap-material-datetimepicker.js"></script>
|
||||
<script src="../plugins/bootstrap-maxlength/bootstrap-maxlength.min.js"></script>
|
||||
<script src="../plugins/bootstrap-touchspin/js/jquery.bootstrap-touchspin.min.js"></script>
|
||||
<script src="../plugins/spectrum/spectrum.min.js"></script>
|
||||
<!-- Sweet-Alert -->
|
||||
<script src="../plugins/sweet-alert2/sweetalert2.min.js"></script>
|
||||
<script src="assets/pages/jquery.sweet-alert.init.js"></script>
|
||||
<script src="assets/pages/jquery.forms-advanced.js"></script>
|
||||
<script src="../plugins/jquery-steps/jquery.steps.min.js"></script>
|
||||
<script src="assets/pages/jquery.form-wizard.init.js"></script>
|
||||
<!-- App js -->
|
||||
<script src="assets/js/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,633 @@
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
$codeposition='7';
|
||||
// pickup the get variable
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf=$_GET["idtrf"];
|
||||
}
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf=$_POST["idtrf"];
|
||||
}
|
||||
if (isset($_POST["descriptionpartvalue"])) {
|
||||
$descriptionpartvalue=$_POST["descriptionpartvalue"];
|
||||
} else {
|
||||
$descriptionpartvalue="";
|
||||
}
|
||||
if (isset($_POST["articlepartvalue"])) {
|
||||
$articlepartvalue=$_POST["articlepartvalue"];
|
||||
} else {
|
||||
$articlepartvalue="";
|
||||
}
|
||||
if (isset($_POST["colorvalue"])) {
|
||||
$colorvalue=$_POST["colorvalue"];
|
||||
} else {
|
||||
$colorvalue="";
|
||||
}
|
||||
if (isset($_POST["cmcreportnumber"])) {
|
||||
$cmcreportnumber=$_POST["cmcreportnumber"];
|
||||
} else {
|
||||
$cmcreportnumber="";
|
||||
}
|
||||
if (isset($_POST["cmcdatereport"])) {
|
||||
$cmcdatereport=$_POST["cmcdatereport"];
|
||||
} else {
|
||||
$cmcdatereport="";
|
||||
}
|
||||
if (isset($_POST["trdreportnumber"])) {
|
||||
$trdreportnumber=$_POST["trdreportnumber"];
|
||||
} else {
|
||||
$trdreportnumber="";
|
||||
}
|
||||
if (isset($_POST["trddatereport"])) {
|
||||
$trddatereport=$_POST["trddatereport"];
|
||||
} else {
|
||||
$trddatereport="";
|
||||
}
|
||||
if (isset($_POST["kindoftest"])) {
|
||||
$kindoftest=$_POST["kindoftest"];
|
||||
} else {
|
||||
$kindoftest="";
|
||||
}
|
||||
if (isset($_POST["addpart"])) {
|
||||
$addpart=$_POST["addpart"];
|
||||
} else {
|
||||
$addpart="";
|
||||
}
|
||||
|
||||
|
||||
$todaydate=date("Y-m-d");
|
||||
|
||||
if (isset($_GET["codestep"])) {
|
||||
$code="7";
|
||||
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "wheretrfstep";
|
||||
$InsertQuery->bindColumn("idtrf", "i", "$idtrf", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("code", "i", "$code", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$trfnumberfinal = new WA_MySQLi_RS("trfnumberfinal", $cmctrfdb, 1);
|
||||
$trfnumberfinal->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'");
|
||||
$trfnumberfinal->execute();
|
||||
$idcertn=$trfnumberfinal->getColumnVal("idcertification");
|
||||
$idarticletype=$trfnumberfinal->getColumnVal("idarticletype");
|
||||
?>
|
||||
<?php $idcert=$trfnumberfinal->getColumnVal("idcertification") ?>
|
||||
<?php
|
||||
$certname = new WA_MySQLi_RS("certname", $cmctrfdb, 1);
|
||||
$certname->setQuery("SELECT * FROM certificationtype WHERE certificationtype.idcertificationtype='$idcert'");
|
||||
$certname->execute();?>
|
||||
<?php
|
||||
if ($addpart=="Y") {
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "identificationparts";
|
||||
$InsertQuery->bindColumn("description_identificationparts", "s", "$descriptionpartvalue", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("article_identificationparts", "s", "$articlepartvalue", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("color_identificationparts", "s", "$colorvalue", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("cmcreportnumber_identificationparts", "s", "$cmcreportnumber", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("cmcreportdate_identificationparts", "t", "$cmcdatereport", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("thirdlabreportnumber_identificationparts", "s", "$trdreportnumber", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("thirdlabreportdate_identificationparts", "t", "$trddatereport", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idtrfdetails", "i", "$idtrf", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("kindoftest", "s", "$kindoftest", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$listinsertedpart = new WA_MySQLi_RS("listinsertedpart", $cmctrfdb, 0);
|
||||
$listinsertedpart->setQuery("SELECT * FROM identificationparts WHERE identificationparts.idtrfdetails='$idtrf'");
|
||||
$listinsertedpart->execute();
|
||||
?>
|
||||
|
||||
<?php if ($idcertn=='2') {
|
||||
header("Location: adddocument.php?idtrf=$idtrf");
|
||||
} elseif ($idcertn=='4' ) {
|
||||
header("Location: adddocument.php?idtrf=$idtrf");
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>TRF CIMAC </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="CIMAC TRF Portal" name="description" />
|
||||
<meta content="" name="author" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="../images/favicon.ico">
|
||||
<!--Form Wizard-->
|
||||
<link href="../plugins/jquery-steps/jquery.steps.css" rel="stylesheet" type="text/css">
|
||||
<!-- App css -->
|
||||
<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="assets/css/jquery-ui.min.css" rel="stylesheet">
|
||||
<link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="assets/css/metisMenu.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="assets/css/app.min.css" rel="stylesheet" type="text/css" />
|
||||
<!-- Sweet Alert -->
|
||||
<link href="../plugins/sweet-alert2/sweetalert2.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="../plugins/animate/animate.css" rel="stylesheet" type="text/css">
|
||||
<link href="../plugins/spectrum/spectrum.min.css" rel="stylesheet" type="text/css">
|
||||
<!-- Plugins css -->
|
||||
<link href="../plugins/daterangepicker/daterangepicker.css" rel="stylesheet" />
|
||||
<link href="../plugins/select2/select2.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../plugins/timepicker/bootstrap-material-datetimepicker.css" rel="stylesheet">
|
||||
<link href="../plugins/bootstrap-touchspin/css/jquery.bootstrap-touchspin.min.css" rel="stylesheet" />
|
||||
<!-- search on article -->
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="searchengine/scriptsearch.js"></script>
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myFormone"].submit();
|
||||
}
|
||||
function setInputVal(id, value) {
|
||||
let input = document.getElementById(id);
|
||||
input.value = value;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Top Bar Start -->
|
||||
<?php include('include/topbar.php'); ?>
|
||||
<!-- Top Bar End -->
|
||||
<!-- Left Sidenav -->
|
||||
<?php include('include/leftsidenav.php'); ?>
|
||||
<!-- end left-sidenav-->
|
||||
<div class="page-wrapper">
|
||||
<!-- Page Content-->
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- Page-Title -->
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="page-title-box">
|
||||
<div class="float-right">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="javascript:void(0);">TRF</a></li>
|
||||
<li class="breadcrumb-item active">Starter</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title"><?php echo $titlewb; ?></h4>
|
||||
</div>
|
||||
<!--end page-title-box-->
|
||||
</div>
|
||||
<!--end col-->
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="media">
|
||||
<?php include('include/appform.php'); ?>
|
||||
</div>
|
||||
<!--end media-->
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
</div>
|
||||
<!--end card-->
|
||||
<div class="progress mb-4">
|
||||
<div class="progress-bar" role="progressbar" style="width: 90%;" aria-valuenow="90" aria-valuemin="0" aria-valuemax="100">90%</div>
|
||||
</div>
|
||||
<!-- card for additional info gloves -->
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $identificationparttitle; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $identificationparttitle_help; ?></p>
|
||||
<p>
|
||||
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#newpart" aria-expanded="false" aria-controls="newpart">
|
||||
<?php echo $newtest; ?>
|
||||
</button>
|
||||
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#cmcpart" aria-expanded="false" aria-controls="cmcpart">
|
||||
<?php echo $oldcmctest; ?>
|
||||
</button>
|
||||
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#thirdpart" aria-expanded="false" aria-controls="thirdpart">
|
||||
<?php echo $trdparttest; ?>
|
||||
</button>
|
||||
</p>
|
||||
<div class="collapse" id="newpart">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $newtesttitle; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i></h4>
|
||||
|
||||
<div class="modal fade bs-example-modal-center5" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title mt-0" id="exampleModalLabel"><?php echo $m18btitle; ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p><?php echo nl2br($newtestparthelp); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<p class="text-muted mb-3"><?php echo $newtesttitle_help; ?>
|
||||
</p>
|
||||
<form class="was-validated" action="" method="post" name="myFormone">
|
||||
<!-- image section -->
|
||||
<?php include('include/maparticle.php'); ?>
|
||||
<!-- div new parts -->
|
||||
<div class="form-row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $descriptionpart; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center"></i></label>
|
||||
|
||||
<input type="text" class="form-control is-valid" id="descriptionpartvalue" name="descriptionpartvalue" placeholder="<?php echo $descriptionpart; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer02"><?php echo $articlepart; ?></label>
|
||||
<i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center"></i>
|
||||
<input type="text" class="form-control is-valid" id="articlepartvalue" name="articlepartvalue" placeholder="<?php echo $articlepart; ?>" required="">
|
||||
<br>
|
||||
<b>Ex: </b><i><?php echo $searchsentence; ?></i>
|
||||
<br />
|
||||
<div id="display"></div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServerUsername"><?php echo $colorpart; ?></label>
|
||||
<i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center"></i>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
</div>
|
||||
<input id="colorvalue" name="colorvalue" class="form-control" type="text" placeholder="<?php echo $colorpart; ?>" aria-describedby="inputGroupPrepend3" required="">
|
||||
<script>
|
||||
|
||||
setTimeout(function(){
|
||||
$("#colorvalue").spectrum({
|
||||
showPalette: true,
|
||||
showPaletteOnly: true,
|
||||
palette: [
|
||||
["Red","Cyan","Blue","DarkBlue","LightBlue","Purple"],
|
||||
["Yellow","Lime","Magenta","Pink","White","Silver"],
|
||||
["Gray","Black","Orange","Brown","Green"],
|
||||
["Olive","Aquamarine"]
|
||||
]
|
||||
});
|
||||
}, 1000);
|
||||
</script>
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo($trfnumberfinal->getColumnVal("idtrfdetails")); ?>">
|
||||
<input type="hidden" name="kindoftest" id="kindoftest" value="new">
|
||||
<input type="hidden" name="addpart" id="addpart" value="Y">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $addpartbutton; ?>">
|
||||
</form>
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- end -->
|
||||
<script>
|
||||
function formSubmit2() {
|
||||
document.forms["myFormtwo"].submit();
|
||||
}
|
||||
</script>
|
||||
<!-- div CMC parts -->
|
||||
<div class="collapse" id="cmcpart">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $cmctesttitle; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center9"></i></h4>
|
||||
|
||||
<div class="modal fade bs-example-modal-center9" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title mt-0" id="exampleModalLabel"><?php echo $m18btitle; ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p><?php echo nl2br($newtestparthelp); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<p class="text-muted mb-3"><?php echo $cmctesttitle_help; ?>
|
||||
</p>
|
||||
<form class="was-validated" action="" method="POST" name="myFormtwo">
|
||||
<?php include('include/maparticle.php'); ?>
|
||||
<!-- div new parts -->
|
||||
<div class="form-row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $descriptionpart; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="descriptionpartvalue" name="descriptionpartvalue" placeholder="<?php echo $descriptionpart; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer02"><?php echo $articlepart; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="articlepartvalue" name="articlepartvalue" placeholder="<?php echo $articlepart; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServerUsername"><?php echo $colorpart; ?></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
</div>
|
||||
<input type="text" class="form-control" id="colorvalue" name="colorvalue" placeholder="<?php echo $colorpart; ?>" aria-describedby="inputGroupPrepend3" required="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $reportnumbercmctitle; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="cmcreportnumber" name="cmcreportnumber" placeholder="<?php echo $reportnumbercmctitle; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServerUsername"><?php echo $datereporttitle; ?></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
</div>
|
||||
<input type="date" required="" class="form-control" id="daterport" name="cmcdatereport" onchange="validateDate(this.value)" min="2000-01-01" max="<?php echo $todaydate; ?>" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $reportoftitle; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="reportof" name="reportof" placeholder="<?php echo $reportoftitle; ?>" required="">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo($trfnumberfinal->getColumnVal("idtrfdetails")); ?>">
|
||||
<input type="hidden" name="kindoftest" id="kindoftest" value="cmc">
|
||||
<input type="hidden" name="addpart" id="addpart" value="Y">
|
||||
<input type="button" onclick="formSubmit2()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $addpartbutton; ?>">
|
||||
</form>
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- end -->
|
||||
<script>
|
||||
function formSubmit3() {
|
||||
document.forms["myFormthree"].submit();
|
||||
}
|
||||
</script>
|
||||
<!-- div 3rd lab parts -->
|
||||
<div class="collapse" id="thirdpart">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $trdlabparttitle; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center10"></i></h4>
|
||||
|
||||
<div class="modal fade bs-example-modal-center10" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title mt-0" id="exampleModalLabel"><?php echo $m18btitle; ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p><?php echo nl2br($newtestparthelp); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal --></h4>
|
||||
<p class="text-muted mb-3"><?php echo $trdlabparttitle_help; ?>
|
||||
</p>
|
||||
<form class="was-validated" action="" method="post" name="myFormthree">
|
||||
<!-- div new parts -->
|
||||
<div class="form-row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $descriptionpart; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="descriptionpartvalue" name="descriptionpartvalue" placeholder="<?php echo $descriptionpart; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer02"><?php echo $articlepart; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="articlepartvalue" name="articlepartvalue" placeholder="<?php echo $articlepart; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServerUsername"><?php echo $colorpart; ?></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
</div>
|
||||
<input type="text" class="form-control" id="colorvalue" name="colorvalue" placeholder="<?php echo $colorpart; ?>" aria-describedby="inputGroupPrepend3" required="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $reprtonumbertrdlabtitle; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="trdreportnumber" name="trdreportnumber" placeholder="<?php echo $reprtonumbertrdlabtitle; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServerUsername"><?php echo $trddatereporttitle; ?></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
</div>
|
||||
<input name="trddatereport" type="date" required="" class="form-control" id="daterport" onchange="validateDate(this.value)" min="2000-01-01" max="<?php echo $todaydate; ?>" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $reportoftitle; ?></label>
|
||||
<input type="text" class="form-control is-valid" id="reportof" name="reportof" placeholder="<?php echo $reportoftitle; ?>" required="">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo($trfnumberfinal->getColumnVal("idtrfdetails")); ?>">
|
||||
<input type="hidden" name="kindoftest" id="kindoftest" value="trd">
|
||||
<input type="hidden" name="addpart" id="addpart" value="Y">
|
||||
<input type="button" onclick="formSubmit3()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $addpartbutton; ?>">
|
||||
</form>
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- end -->
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
</div>
|
||||
<!--end card-->
|
||||
</div>
|
||||
<!--end col-->
|
||||
<!-- show the parts -->
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $assignedparts; ?></h4>
|
||||
<p class="text-muted mb-6"><?php echo $assignedparts_help; ?>
|
||||
</p>
|
||||
<style media="screen">
|
||||
.hidden-x {
|
||||
display: none!important;
|
||||
}
|
||||
</style>
|
||||
<div id="datatable_wrapper" class="dataTables_wrapper dt-bootstrap4 no-footer">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="datatable" class="table table-bordered dt-responsive nowrap dataTable no-footer dtr-inline" style="border-collapse: collapse; border-spacing: 0px; width: 100%;" role="grid" aria-describedby="datatable_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="sorting_asc" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 149px;" aria-sort="ascending" aria-label="Name: activate to sort column descending">
|
||||
<?php echo $kindpart; ?>
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 230px;" aria-label="Position: activate to sort column ascending">
|
||||
<?php echo $descriptionpartlist; ?>
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 108px;" aria-label="Office: activate to sort column ascending">
|
||||
<?php echo $articlepartlist; ?>
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 45px;" aria-label="Age: activate to sort column ascending">
|
||||
<?php echo $colorpartlist; ?>
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 97px;" aria-label="Start date: activate to sort column ascending">
|
||||
<?php echo $reportlist; ?>
|
||||
</th>
|
||||
|
||||
<th class="sorting" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 75px;" aria-label="Salary: activate to sort column ascending">
|
||||
<?php echo $datereportlist; ?>
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 75px;" aria-label="Salary: activate to sort column ascending">
|
||||
<?php echo $action; ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$listinsertedpart->atEnd()) {
|
||||
$wa_startindex = $listinsertedpart->Index; ?>
|
||||
<tr role="row" class="odd">
|
||||
<td tabindex="0" class="sorting_1">
|
||||
<span class="text-x"><?php if (($listinsertedpart->getColumnVal("kindoftest"))=='new') { echo $newpartlist; }
|
||||
if (($listinsertedpart->getColumnVal("kindoftest"))=='cmc') { echo $cmcpartlist; }
|
||||
if (($listinsertedpart->getColumnVal("kindoftest"))=='trd') { echo $trdpartlist; } ?> </span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="text" class="form-control" name="kindoftest" value="<?php echo($listinsertedpart->getColumnVal("kindoftest")); ?>">
|
||||
|
||||
|
||||
<input type="hidden" class="form-control" name="ididentificationparts" value="<?php echo($listinsertedpart->getColumnVal("ididentificationparts")); ?>">
|
||||
<input type="hidden" class="form-control" name="idtrfdetails" value="<?php echo($listinsertedpart->getColumnVal("idtrfdetails")); ?>">
|
||||
</span>
|
||||
</td>
|
||||
<td tabindex="0" class="sorting_1">
|
||||
<span class="text-x"><?php echo($listinsertedpart->getColumnVal("description_identificationparts")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="text" class="form-control" name="description_identificationparts" value="<?php echo($listinsertedpart->getColumnVal("description_identificationparts")); ?>">
|
||||
</span>
|
||||
</td>
|
||||
<td tabindex="0" class="sorting_1">
|
||||
<span class="text-x"><?php echo($listinsertedpart->getColumnVal("article_identificationparts")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="text" class="form-control" name="article_identificationparts" value="<?php echo($listinsertedpart->getColumnVal("article_identificationparts")); ?>">
|
||||
</span>
|
||||
</td>
|
||||
<td tabindex="0" class="sorting_1">
|
||||
<span class="text-x"><?php echo($listinsertedpart->getColumnVal("color_identificationparts")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="text" class="form-control" name="color_identificationparts" value="<?php echo($listinsertedpart->getColumnVal("color_identificationparts")); ?>">
|
||||
</span>
|
||||
</td>
|
||||
<td tabindex="0" class="sorting_1">
|
||||
<span class="text-x"><?php echo($listinsertedpart->getColumnVal("cmcreportnumber_identificationparts")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="text" class="form-control" name="cmcreportnumber_identificationparts" value="<?php echo($listinsertedpart->getColumnVal("cmcreportnumber_identificationparts")); ?>">
|
||||
</span> -
|
||||
<span class="text-x"><?php echo($listinsertedpart->getColumnVal("thirdlabreportnumber_identificationparts")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="text" class="form-control" name="thirdlabreportnumber_identificationparts" value="<?php echo($listinsertedpart->getColumnVal("thirdlabreportnumber_identificationparts")); ?>">
|
||||
</span>
|
||||
</td>
|
||||
|
||||
<td tabindex="0" class="sorting_1">
|
||||
<span class="text-x"><?php echo($listinsertedpart->getColumnVal("thirdlabreportdate_identificationparts")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="date" class="form-control" name="thirdlabreportdate_identificationparts" value="<?php echo($listinsertedpart->getColumnVal("thirdlabreportdate_identificationparts")); ?>">
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="deleteidentparts.php?ididentpart=<?php echo($listinsertedpart->getColumnVal("ididentificationparts")); ?>&idtrf=<?php echo $idtrf; ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$listinsertedpart->moveNext();
|
||||
}
|
||||
$listinsertedpart->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<a href="adddocument.php?idtrf=<?php echo $idtrf; ?>&codestep=7"><button type="button" class="btn btn-success waves-effect waves-light"><?php echo $nextsteptitle; ?></button> </a>
|
||||
<button type="button" class="btn btn-dark waves-effect waves-light" onclick="history.back()"><?php echo $backstep; ?></button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title end breadcrumb -->
|
||||
</div>
|
||||
<!-- container -->
|
||||
<!-- footer start -->
|
||||
<?php include('include/footer.php'); ?>
|
||||
</footer><!--end footer-->
|
||||
</div>
|
||||
<!-- end page content -->
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function validateDate(date) {
|
||||
var five_years_before_from_current = moment().subtract(5, 'years');
|
||||
var selected_date = moment(date);
|
||||
|
||||
if (selected_date < five_years_before_from_current) {
|
||||
alert('<?php echo $alertdate; ?>');
|
||||
{
|
||||
$("#newpart").addClass('show');
|
||||
$("#cmcpart").removeClass('show');
|
||||
$("#thirdpart").removeClass('show');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!-- end page-wrapper -->
|
||||
<!-- jQuery -->
|
||||
<script src="assets/js/jquery.min.js"></script>
|
||||
<script src="assets/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="assets/js/metismenu.min.js"></script>
|
||||
<script src="assets/js/waves.js"></script>
|
||||
<script src="assets/js/feather.min.js"></script>
|
||||
<script src="assets/js/jquery.slimscroll.min.js"></script>
|
||||
<script src="assets/js/jquery-ui.min.js"></script>
|
||||
<!-- Plugins js -->
|
||||
<script src="../plugins/moment/moment.js"></script>
|
||||
<script src="../plugins/daterangepicker/daterangepicker.js"></script>
|
||||
<script src="../plugins/select2/select2.min.js"></script>
|
||||
<script src="../plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js"></script>
|
||||
<script src="../plugins/timepicker/bootstrap-material-datetimepicker.js"></script>
|
||||
<script src="../plugins/bootstrap-maxlength/bootstrap-maxlength.min.js"></script>
|
||||
<script src="../plugins/bootstrap-touchspin/js/jquery.bootstrap-touchspin.min.js"></script>
|
||||
<script src="../plugins/spectrum/spectrum.min.js"></script>
|
||||
<!-- Sweet-Alert -->
|
||||
<script src="../plugins/sweet-alert2/sweetalert2.min.js"></script>
|
||||
<script src="assets/pages/jquery.sweet-alert.init.js"></script>
|
||||
<script src="assets/pages/jquery.forms-advanced.js"></script>
|
||||
<script src="../plugins/jquery-steps/jquery.steps.min.js"></script>
|
||||
<script src="assets/pages/jquery.form-wizard.init.js"></script>
|
||||
<!-- App js -->
|
||||
<script src="assets/js/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,646 @@
|
||||
/*!
|
||||
* Tabledit v1.2.3 (https://github.com/markcell/jQuery-Tabledit)
|
||||
* Copyright (c) 2015 Celso Marques
|
||||
* Licensed under MIT (https://github.com/markcell/jQuery-Tabledit/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
/**
|
||||
* @description Inline editor for HTML tables compatible with Bootstrap
|
||||
* @version 1.2.3
|
||||
* @author Celso Marques
|
||||
*/
|
||||
|
||||
if (typeof jQuery === 'undefined') {
|
||||
throw new Error('Tabledit requires jQuery library.');
|
||||
}
|
||||
|
||||
(function($) {
|
||||
'use strict';
|
||||
|
||||
$.fn.Tabledit = function(options) {
|
||||
if (!this.is('table')) {
|
||||
throw new Error('Tabledit only works when applied to a table.');
|
||||
}
|
||||
|
||||
var $table = this;
|
||||
|
||||
var defaults = {
|
||||
url: window.location.href,
|
||||
inputClass: 'form-control input-sm',
|
||||
toolbarClass: 'btn-toolbar',
|
||||
groupClass: 'btn-group btn-group-sm',
|
||||
dangerClass: 'danger',
|
||||
warningClass: 'warning',
|
||||
mutedClass: 'text-muted bg-light',
|
||||
eventType: 'click',
|
||||
rowIdentifier: 'id',
|
||||
hideIdentifier: false,
|
||||
autoFocus: true,
|
||||
editButton: true,
|
||||
deleteButton: true,
|
||||
saveButton: true,
|
||||
restoreButton: true,
|
||||
buttons: {
|
||||
edit: {
|
||||
class: 'btn btn-sm btn-default',
|
||||
html: '<span class="fa fa-pencil "></span>',
|
||||
action: 'edit'
|
||||
},
|
||||
delete: {
|
||||
class: 'btn btn-sm btn-default',
|
||||
html: '<span class="fa fa-trash "></span>',
|
||||
action: 'delete'
|
||||
},
|
||||
save: {
|
||||
class: 'btn btn-sm btn-success',
|
||||
html: 'Save'
|
||||
},
|
||||
restore: {
|
||||
class: 'btn btn-sm btn-warning',
|
||||
html: 'Restore',
|
||||
action: 'restore'
|
||||
},
|
||||
confirm: {
|
||||
class: 'btn btn-sm btn-danger',
|
||||
html: 'Confirm'
|
||||
}
|
||||
},
|
||||
onDraw: function() { return; },
|
||||
onSuccess: function() { return; },
|
||||
onFail: function() { return; },
|
||||
onAlways: function() { return; },
|
||||
onAjax: function() { return; }
|
||||
};
|
||||
|
||||
var settings = $.extend(true, defaults, options);
|
||||
|
||||
var $lastEditedRow = 'undefined';
|
||||
var $lastDeletedRow = 'undefined';
|
||||
var $lastRestoredRow = 'undefined';
|
||||
|
||||
/**
|
||||
* Draw Tabledit structure (identifier column, editable columns, toolbar column).
|
||||
*
|
||||
* @type {object}
|
||||
*/
|
||||
var Draw = {
|
||||
columns: {
|
||||
identifier: function() {
|
||||
// Hide identifier column.
|
||||
if (settings.hideIdentifier) {
|
||||
$table.find('th:nth-child(' + parseInt(settings.columns.identifier[0]) + 1 + '), tbody td:nth-child(' + parseInt(settings.columns.identifier[0]) + 1 + ')').hide();
|
||||
}
|
||||
|
||||
var $td = $table.find('tbody td:nth-child(' + (parseInt(settings.columns.identifier[0]) + 1) + ')');
|
||||
|
||||
$td.each(function() {
|
||||
// Create hidden input with row identifier.
|
||||
var span = '<span class="tabledit-span tabledit-identifier">' + $(this).text() + '</span>';
|
||||
var input = '<input class="tabledit-input tabledit-identifier" type="hidden" name="' + settings.columns.identifier[1] + '" value="' + $(this).text() + '" disabled>';
|
||||
|
||||
// Add elements to table cell.
|
||||
$(this).html(span + input);
|
||||
|
||||
// Add attribute "id" to table row.
|
||||
$(this).parent('tr').attr(settings.rowIdentifier, $(this).text());
|
||||
});
|
||||
},
|
||||
editable: function() {
|
||||
for (var i = 0; i < settings.columns.editable.length; i++) {
|
||||
var $td = $table.find('tbody td:nth-child(' + (parseInt(settings.columns.editable[i][0]) + 1) + ')');
|
||||
|
||||
$td.each(function() {
|
||||
// Get text of this cell.
|
||||
var text = $(this).text();
|
||||
|
||||
// Add pointer as cursor.
|
||||
if (!settings.editButton) {
|
||||
$(this).css('cursor', 'pointer');
|
||||
}
|
||||
|
||||
// Create span element.
|
||||
var span = '<span class="tabledit-span">' + text + '</span>';
|
||||
|
||||
// Check if exists the third parameter of editable array.
|
||||
if (typeof settings.columns.editable[i][2] !== 'undefined') {
|
||||
// Create select element.
|
||||
if(settings.columns.editable[i][2]=='checkbox'){
|
||||
var input = '<input class="tabledit-input" type="checkbox" name="' + settings.columns.editable[i][1] + '" value="yes" style="display: none;" disabled>';
|
||||
|
||||
}
|
||||
else if(settings.columns.editable[i][2]=='file'){
|
||||
var input = '<input class="tabledit-input file-upload" type="text" name="' + settings.columns.editable[i][1] + '" style="display: none;" value="' + $(this).text() + '" disabled><span style="display:none;" class="uploadfile" >Upload File</span>';
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
|
||||
var input = '<select class="tabledit-input ' + settings.inputClass + '" name="' + settings.columns.editable[i][1] + '" style="display: none;" disabled>';
|
||||
|
||||
// Create options for select element.
|
||||
$.each(jQuery.parseJSON(settings.columns.editable[i][2]), function(index, value) {
|
||||
if (text === value) {
|
||||
input += '<option value="' + index + '" selected>' + value + '</option>';
|
||||
} else {
|
||||
input += '<option value="' + index + '">' + value + '</option>';
|
||||
}
|
||||
});
|
||||
|
||||
// Create last piece of select element.
|
||||
input += '</select>';
|
||||
}
|
||||
} else {
|
||||
// Create text input element.
|
||||
var input = '<input class="tabledit-input ' + settings.inputClass + '" type="text" name="' + settings.columns.editable[i][1] + '" value="' + $(this).text() + '" style="display: none;" disabled>';
|
||||
}
|
||||
|
||||
// Add elements and class "view" to table cell.
|
||||
$(this).html(span + input);
|
||||
$(this).addClass('tabledit-view-mode');
|
||||
});
|
||||
}
|
||||
},
|
||||
toolbar: function() {
|
||||
if (settings.editButton || settings.deleteButton) {
|
||||
var editButton = '';
|
||||
var deleteButton = '';
|
||||
var saveButton = '';
|
||||
var restoreButton = '';
|
||||
var confirmButton = '';
|
||||
|
||||
// Add toolbar column header if not exists.
|
||||
if ($table.find('th.tabledit-toolbar-column').length === 0) {
|
||||
$table.find('tr:first').append('<th class="tabledit-toolbar-column"></th>');
|
||||
}
|
||||
|
||||
// Create edit button.
|
||||
if (settings.editButton) {
|
||||
editButton = '<button type="button" class="tabledit-edit-button ' + settings.buttons.edit.class + '" style="float: none;">' + settings.buttons.edit.html + '</button>';
|
||||
}
|
||||
|
||||
// Create delete button.
|
||||
if (settings.deleteButton) {
|
||||
deleteButton = '<button type="button" class="tabledit-delete-button ' + settings.buttons.delete.class + '" style="float: none;">' + settings.buttons.delete.html + '</button>';
|
||||
confirmButton = '<button type="button" class="tabledit-confirm-button ' + settings.buttons.confirm.class + '" style="display: none; float: none;">' + settings.buttons.confirm.html + '</button>';
|
||||
}
|
||||
|
||||
// Create save button.
|
||||
if (settings.editButton && settings.saveButton) {
|
||||
saveButton = '<button type="button" class="tabledit-save-button ' + settings.buttons.save.class + '" style="display: none; float: none;">' + settings.buttons.save.html + '</button>';
|
||||
}
|
||||
|
||||
// Create restore button.
|
||||
if (settings.deleteButton && settings.restoreButton) {
|
||||
restoreButton = '<button type="button" class="tabledit-restore-button ' + settings.buttons.restore.class + '" style="display: none; float: none;">' + settings.buttons.restore.html + '</button>';
|
||||
}
|
||||
|
||||
var toolbar = '<div class="tabledit-toolbar ' + settings.toolbarClass + '" style="text-align: left;">\n\
|
||||
<div class="' + settings.groupClass + '" style="float: none;">' + editButton + deleteButton + '</div>\n\
|
||||
' + saveButton + '\n\
|
||||
' + confirmButton + '\n\
|
||||
' + restoreButton + '\n\
|
||||
</div></div>';
|
||||
|
||||
// Add toolbar column cells.
|
||||
$table.find('tr:gt(0)').append('<td style="white-space: nowrap; width: 1%;">' + toolbar + '</td>');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Change to view mode or edit mode with table td element as parameter.
|
||||
*
|
||||
* @type object
|
||||
*/
|
||||
var Mode = {
|
||||
view: function(td) {
|
||||
// Get table row.
|
||||
var $tr = $(td).parent('tr');
|
||||
// Disable identifier.
|
||||
$(td).parent('tr').find('.tabledit-input.tabledit-identifier').prop('disabled', true);
|
||||
// Hide and disable input element.
|
||||
$(td).find('.tabledit-input').blur().hide().prop('disabled', true);
|
||||
// Show span element.
|
||||
$(td).find('.tabledit-span').show();
|
||||
$(td).find('.uploadfile').hide();
|
||||
// Add "view" class and remove "edit" class in td element.
|
||||
$(td).addClass('tabledit-view-mode').removeClass('tabledit-edit-mode');
|
||||
// Update toolbar buttons.
|
||||
if (settings.editButton) {
|
||||
$tr.find('button.tabledit-save-button').hide();
|
||||
$tr.find('button.tabledit-edit-button').removeClass('active').blur();
|
||||
}
|
||||
},
|
||||
edit: function(td) {
|
||||
Delete.reset(td);
|
||||
// Get table row.
|
||||
var $tr = $(td).parent('tr');
|
||||
// Enable identifier.
|
||||
$tr.find('.tabledit-input.tabledit-identifier').prop('disabled', false);
|
||||
// Hide span element.
|
||||
$(td).find('.tabledit-span').hide();
|
||||
$(td).find('.uploadfile').show();
|
||||
// Get input element.
|
||||
var $input = $(td).find('.tabledit-input');
|
||||
// Enable and show input element.
|
||||
$input.prop('disabled', false).show();
|
||||
// Focus on input element.
|
||||
if (settings.autoFocus) {
|
||||
$input.focus();
|
||||
}
|
||||
// Add "edit" class and remove "view" class in td element.
|
||||
$(td).addClass('tabledit-edit-mode').removeClass('tabledit-view-mode');
|
||||
// Update toolbar buttons.
|
||||
if (settings.editButton) {
|
||||
$tr.find('button.tabledit-edit-button').addClass('active');
|
||||
$tr.find('button.tabledit-save-button').show();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Available actions for edit function, with table td element as parameter or set of td elements.
|
||||
*
|
||||
* @type object
|
||||
*/
|
||||
var Edit = {
|
||||
reset: function(td) {
|
||||
$(td).each(function() {
|
||||
// Get input element.
|
||||
var $input = $(this).find('.tabledit-input');
|
||||
|
||||
// Get span text.
|
||||
var text = $(this).find('.tabledit-span').text();
|
||||
// Set input/select value with span text.
|
||||
if ($input.is('select')) {
|
||||
$input.find('option').filter(function() {
|
||||
return $.trim($(this).text()) === text;
|
||||
}).attr('selected', true);
|
||||
}
|
||||
else if($input.is(':checkbox')){
|
||||
if(text=='yes'){
|
||||
$input.attr('checked', 'checked');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$input.val(text);
|
||||
}
|
||||
|
||||
// Change to view mode.
|
||||
Mode.view(this);
|
||||
});
|
||||
},
|
||||
submit: function(td) {
|
||||
// Send AJAX request to server.
|
||||
var ajaxResult = ajax(settings.buttons.edit.action);
|
||||
|
||||
if (ajaxResult === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(td).each(function() {
|
||||
// Get input element.
|
||||
var $input = $(this).find('.tabledit-input');
|
||||
// Set span text with input/select new value.
|
||||
if ($input.is('select')) {
|
||||
$(this).find('.tabledit-span').text($input.find('option:selected').text());
|
||||
} else {
|
||||
$(this).find('.tabledit-span').text($input.val());
|
||||
}
|
||||
if ($input.is(':checkbox')) {
|
||||
if($input.prop('checked')==true){
|
||||
$(this).find('.tabledit-span').text('yes');
|
||||
}
|
||||
else{
|
||||
$(this).find('.tabledit-span').text('no');
|
||||
}
|
||||
|
||||
}
|
||||
else if($input.is(':checkbox')){
|
||||
$(this).find('.tabledit-span').text('test2');
|
||||
}
|
||||
else {
|
||||
$(this).find('.tabledit-span').text($input.val());
|
||||
}
|
||||
|
||||
// Change to view mode.
|
||||
Mode.view(this);
|
||||
});
|
||||
|
||||
// Set last edited column and row.
|
||||
$lastEditedRow = $(td).parent('tr');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Available actions for delete function, with button as parameter.
|
||||
*
|
||||
* @type object
|
||||
*/
|
||||
var Delete = {
|
||||
reset: function(td) {
|
||||
// Reset delete button to initial status.
|
||||
$table.find('.tabledit-confirm-button').hide();
|
||||
// Remove "active" class in delete button.
|
||||
$table.find('.tabledit-delete-button').removeClass('active').blur();
|
||||
},
|
||||
submit: function(td) {
|
||||
Delete.reset(td);
|
||||
// Enable identifier hidden input.
|
||||
$(td).parent('tr').find('input.tabledit-identifier').attr('disabled', false);
|
||||
// Send AJAX request to server.
|
||||
var ajaxResult = ajax(settings.buttons.delete.action);
|
||||
// Disable identifier hidden input.
|
||||
$(td).parents('tr').find('input.tabledit-identifier').attr('disabled', true);
|
||||
|
||||
if (ajaxResult === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Add class "deleted" to row.
|
||||
$(td).parent('tr').addClass('tabledit-deleted-row');
|
||||
// Hide table row.
|
||||
$(td).parent('tr').addClass(settings.mutedClass).find('.tabledit-toolbar button:not(.tabledit-restore-button)').attr('disabled', true);
|
||||
// Show restore button.
|
||||
$(td).find('.tabledit-restore-button').show();
|
||||
// Set last deleted row.
|
||||
$lastDeletedRow = $(td).parent('tr');
|
||||
},
|
||||
confirm: function(td) {
|
||||
// Reset all cells in edit mode.
|
||||
$table.find('td.tabledit-edit-mode').each(function() {
|
||||
Edit.reset(this);
|
||||
});
|
||||
// Add "active" class in delete button.
|
||||
$(td).find('.tabledit-delete-button').addClass('active');
|
||||
// Show confirm button.
|
||||
$(td).find('.tabledit-confirm-button').show();
|
||||
},
|
||||
restore: function(td) {
|
||||
// Enable identifier hidden input.
|
||||
$(td).parent('tr').find('input.tabledit-identifier').attr('disabled', false);
|
||||
// Send AJAX request to server.
|
||||
var ajaxResult = ajax(settings.buttons.restore.action);
|
||||
// Disable identifier hidden input.
|
||||
$(td).parents('tr').find('input.tabledit-identifier').attr('disabled', true);
|
||||
|
||||
if (ajaxResult === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove class "deleted" to row.
|
||||
$(td).parent('tr').removeClass('tabledit-deleted-row');
|
||||
// Hide table row.
|
||||
$(td).parent('tr').removeClass(settings.mutedClass).find('.tabledit-toolbar button').attr('disabled', false);
|
||||
// Hide restore button.
|
||||
$(td).find('.tabledit-restore-button').hide();
|
||||
// Set last restored row.
|
||||
$lastRestoredRow = $(td).parent('tr');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Send AJAX request to server.
|
||||
*
|
||||
* @param {string} action
|
||||
*/
|
||||
function ajax(action)
|
||||
{
|
||||
var serialize = $table.find('.tabledit-input').serialize() + '&action=' + action;
|
||||
|
||||
var result = settings.onAjax(action, serialize);
|
||||
|
||||
if (result === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var jqXHR = $.post(settings.url, serialize, function(data, textStatus, jqXHR) {
|
||||
if (action === settings.buttons.edit.action) {
|
||||
$lastEditedRow.removeClass(settings.dangerClass).addClass(settings.warningClass);
|
||||
setTimeout(function() {
|
||||
//$lastEditedRow.removeClass(settings.warningClass);
|
||||
$table.find('tr.' + settings.warningClass).removeClass(settings.warningClass);
|
||||
}, 1400);
|
||||
}
|
||||
|
||||
settings.onSuccess(data, textStatus, jqXHR);
|
||||
}, 'json');
|
||||
|
||||
jqXHR.fail(function(jqXHR, textStatus, errorThrown) {
|
||||
if (action === settings.buttons.delete.action) {
|
||||
$lastDeletedRow.removeClass(settings.mutedClass).addClass(settings.dangerClass);
|
||||
$lastDeletedRow.find('.tabledit-toolbar button').attr('disabled', false);
|
||||
$lastDeletedRow.find('.tabledit-toolbar .tabledit-restore-button').hide();
|
||||
} else if (action === settings.buttons.edit.action) {
|
||||
$lastEditedRow.addClass(settings.dangerClass);
|
||||
}
|
||||
|
||||
settings.onFail(jqXHR, textStatus, errorThrown);
|
||||
});
|
||||
|
||||
jqXHR.always(function() {
|
||||
settings.onAlways();
|
||||
});
|
||||
|
||||
return jqXHR;
|
||||
}
|
||||
|
||||
Draw.columns.identifier();
|
||||
Draw.columns.editable();
|
||||
Draw.columns.toolbar();
|
||||
|
||||
settings.onDraw();
|
||||
|
||||
if (settings.deleteButton) {
|
||||
/**
|
||||
* Delete one row.
|
||||
*
|
||||
* @param {object} event
|
||||
*/
|
||||
$table.on('click', 'button.tabledit-delete-button', function(event) {
|
||||
if (event.handled !== true) {
|
||||
event.preventDefault();
|
||||
|
||||
// Get current state before reset to view mode.
|
||||
var activated = $(this).hasClass('active');
|
||||
|
||||
var $td = $(this).parents('td');
|
||||
|
||||
Delete.reset($td);
|
||||
|
||||
if (!activated) {
|
||||
Delete.confirm($td);
|
||||
}
|
||||
|
||||
event.handled = true;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Delete one row (confirm).
|
||||
*
|
||||
* @param {object} event
|
||||
*/
|
||||
$table.on('click', 'button.tabledit-confirm-button', function(event) {
|
||||
if (event.handled !== true) {
|
||||
event.preventDefault();
|
||||
|
||||
var $td = $(this).parents('td');
|
||||
|
||||
Delete.submit($td);
|
||||
setTimeout(function() {
|
||||
$td.parent('tr').remove();
|
||||
}, 3000);
|
||||
event.handled = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (settings.restoreButton) {
|
||||
/**
|
||||
* Restore one row.
|
||||
*
|
||||
* @param {object} event
|
||||
*/
|
||||
$table.on('click', 'button.tabledit-restore-button', function(event) {
|
||||
if (event.handled !== true) {
|
||||
event.preventDefault();
|
||||
|
||||
Delete.restore($(this).parents('td'));
|
||||
|
||||
event.handled = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (settings.editButton) {
|
||||
/**
|
||||
* Activate edit mode on all columns.
|
||||
*
|
||||
* @param {object} event
|
||||
*/
|
||||
$table.on('click', 'button.tabledit-edit-button', function(event) {
|
||||
|
||||
if (event.handled !== true) {
|
||||
event.preventDefault();
|
||||
|
||||
var $button = $(this);
|
||||
|
||||
// Get current state before reset to view mode.
|
||||
var activated = $button.hasClass('active');
|
||||
|
||||
// Change to view mode columns that are in edit mode.
|
||||
Edit.reset($table.find('td.tabledit-edit-mode'));
|
||||
|
||||
if (!activated) {
|
||||
// Change to edit mode for all columns in reverse way.
|
||||
$($button.parents('tr').find('td.tabledit-view-mode').get().reverse()).each(function() {
|
||||
Mode.edit(this);
|
||||
});
|
||||
}
|
||||
|
||||
event.handled = true;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Save edited row.
|
||||
*
|
||||
* @param {object} event
|
||||
*/
|
||||
$table.on('click', 'button.tabledit-save-button', function(event) {
|
||||
if (event.handled !== true) {
|
||||
event.preventDefault();
|
||||
|
||||
// Submit and update all columns.
|
||||
Edit.submit($(this).parents('tr').find('td.tabledit-edit-mode'));
|
||||
|
||||
event.handled = true;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
/**
|
||||
* Change to edit mode on table td element.
|
||||
*
|
||||
* @param {object} event
|
||||
*/
|
||||
$table.on(settings.eventType, 'tr:not(.tabledit-deleted-row) td.tabledit-view-mode', function(event) {
|
||||
if (event.handled !== true) {
|
||||
event.preventDefault();
|
||||
|
||||
// Reset all td's in edit mode.
|
||||
Edit.reset($table.find('td.tabledit-edit-mode'));
|
||||
|
||||
// Change to edit mode.
|
||||
Mode.edit(this);
|
||||
|
||||
event.handled = true;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Change event when input is a select element.
|
||||
*/
|
||||
$table.on('change', 'select.tabledit-input:visible', function() {
|
||||
if (event.handled !== true) {
|
||||
// Submit and update the column.
|
||||
Edit.submit($(this).parent('td'));
|
||||
|
||||
event.handled = true;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Click event on document element.
|
||||
*
|
||||
* @param {object} event
|
||||
*/
|
||||
$(document).on('click', function(event) {
|
||||
var $editMode = $table.find('.tabledit-edit-mode');
|
||||
// Reset visible edit mode column.
|
||||
if (!$editMode.is(event.target) && $editMode.has(event.target).length === 0) {
|
||||
Edit.reset($table.find('.tabledit-input:visible').parent('td'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Keyup event on document element.
|
||||
*
|
||||
* @param {object} event
|
||||
*/
|
||||
$(document).on('keyup', function(event) {
|
||||
// Get input element with focus or confirmation button.
|
||||
var $input = $table.find('.tabledit-input:visible');
|
||||
var $button = $table.find('.tabledit-confirm-button');
|
||||
|
||||
if ($input.length > 0) {
|
||||
var $td = $input.parents('td');
|
||||
} else if ($button.length > 0) {
|
||||
var $td = $button.parents('td');
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
// Key?
|
||||
switch (event.keyCode) {
|
||||
case 9: // Tab.
|
||||
if (!settings.editButton) {
|
||||
Edit.submit($td);
|
||||
Mode.edit($td.closest('td').next());
|
||||
}
|
||||
break;
|
||||
case 13: // Enter.
|
||||
Edit.submit($td);
|
||||
break;
|
||||
case 27: // Escape.
|
||||
Edit.reset($td);
|
||||
Delete.reset($td);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
}(jQuery));
|
||||
+6
File diff suppressed because one or more lines are too long
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
// Basic example of PHP script to handle with jQuery-Tabledit plug-in.
|
||||
// Note that is just an example. Should take precautions such as filtering the input data.
|
||||
|
||||
//header('Content-Type: application/json');
|
||||
|
||||
include('db-connect.php');
|
||||
|
||||
$input = filter_input_array(INPUT_POST);
|
||||
|
||||
if ($input['action'] === 'edit')
|
||||
{
|
||||
$sqlSelect="SELECT * FROM trfstandards WHERE idtrfstandards='" . $input['id'] . "'";
|
||||
$records=mysqli_query($con,$sqlSelect);
|
||||
if(mysqli_num_rows($records)>0){
|
||||
$sql = "UPDATE trfstandards SET idprotectioncategory='" . $input['idprotectioncategory'] . "'" ." , iddpicategory='" . $input['iddpicategory'] . "'" ." WHERE idtrfstandards='" . $input['id'] . "'";
|
||||
mysqli_query($con,$sql);
|
||||
}
|
||||
else {
|
||||
$sql = "INSERT INTO trfstandards SET idtrfdetails ='" . $input['idtrfdetails'] . "', idstandards='" . $input['idstandards'] . "'" ." , idprotectioncategory='" . $input['idprotectioncategory'] . "'" ." , iddpicategory='" . $input['iddpicategory'] . "'";
|
||||
}
|
||||
mysqli_query($con,$sql);
|
||||
|
||||
|
||||
}
|
||||
if ($input['action'] === 'delete')
|
||||
{
|
||||
mysqli_query($con,"DELETE FROM trfstandards WHERE idtrfstandards='" . $input['id'] . "'");
|
||||
}
|
||||
|
||||
|
||||
//mysqli_close($mysqli);
|
||||
|
||||
echo json_encode($input);
|
||||
?>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
// Basic example of PHP script to handle with jQuery-Tabledit plug-in.
|
||||
// Note that is just an example. Should take precautions such as filtering the input data.
|
||||
|
||||
//header('Content-Type: application/json');
|
||||
|
||||
include('db-connect.php');
|
||||
|
||||
$input = filter_input_array(INPUT_POST);
|
||||
|
||||
if ($input['action'] === 'edit')
|
||||
{
|
||||
$sqlSelect="SELECT * FROM auditdpi WHERE idauditdpi='" . $input['id'] . "'";
|
||||
$records=mysqli_query($con,$sqlSelect);
|
||||
$issuebycimac=$input['issuebycimac']?'yes': 'no';
|
||||
if(mysqli_num_rows($records)>0){
|
||||
|
||||
|
||||
$sql = "UPDATE auditdpi SET certificatenumber='" . $input['certificatenumber'] . "'" ." , issuebycimac='" . $issuebycimac . "'" ." , moduleselection='" . $input['moduleselection'] . "'" ." , sampleinstore='" . $input['sampleinstore'] . "'" ." , filenameaudit='" . $input['filenameaudit'] . "'" ." WHERE idauditdpi='" . $input['id'] . "'";
|
||||
mysqli_query($con,$sql);
|
||||
}
|
||||
else {
|
||||
$sql = "INSERT INTO auditdpi SET idtrfdetails='" . $input['idtrfdetails'] . "'" ." , certificatenumber='" . $input['certificatenumber'] . "'" ." , moduleselection='" . $input['moduleselection'] . "'" ." , sampleinstore='" . $input['sampleinstore'] . "'" ." , filenameaudit='" . $input['filenameaudit'] . "'" ." , issuebycimac='" . $issuebycimac . "'";
|
||||
}
|
||||
mysqli_query($con,$sql);
|
||||
|
||||
|
||||
}
|
||||
if ($input['action'] === 'delete')
|
||||
{
|
||||
mysqli_query($con,"DELETE FROM auditdpi WHERE idauditdpi='" . $input['id'] . "'");
|
||||
}
|
||||
|
||||
|
||||
//mysqli_close($mysqli);
|
||||
|
||||
echo json_encode($input);
|
||||
?>
|
||||
Reference in New Issue
Block a user