730 lines
43 KiB
PHP
730 lines
43 KiB
PHP
<?php
|
|
include('include/headscript.php'); ?>
|
|
<?php
|
|
// 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");
|
|
?>
|
|
|
|
|
|
<?php
|
|
$trfnumberfinal = new WA_MySQLi_RS("trfnumberfinal",$cmctrfdb,1);
|
|
$trfnumberfinal->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'");
|
|
$trfnumberfinal->execute();
|
|
$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();
|
|
?>
|
|
<!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">
|
|
|
|
|
|
<!-- 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" />
|
|
|
|
|
|
<!-- submit form with button -->
|
|
<script>
|
|
function formSubmit() {
|
|
document.forms["myFormone"].submit();
|
|
}
|
|
</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">
|
|
|
|
<div class="avatar-box thumb-xl align-self-center mr-2">
|
|
<span class="avatar-title bg-soft-purple rounded">TRF</span>
|
|
</div>
|
|
<div class="media-body align-self-center">
|
|
<h4 class="mt-0 header-title"><?php echo $etrfcodetitle; ?> <?php echo($trfnumberfinal->getColumnVal("iduser")); ?>-<?php echo($trfnumberfinal->getColumnVal("trfnumber")); ?></h4>
|
|
<p class="mt-0 header-title"><?php echo $certificationrequired; ?><?php echo($certname->getColumnVal("name_certification")); ?></p>
|
|
</div><!--end media-body-->
|
|
</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 $addchemselected; ?></h4>
|
|
<p class="text-muted mb-3"><?php echo $addchemselected_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 $newtest; ?></h4>
|
|
<p class="text-muted mb-3"><?php echo $newtest_help; ?>
|
|
</p>
|
|
<form class="was-validated" action="" method="post" name="myFormone">
|
|
|
|
<!-- image section -->
|
|
|
|
<img src="../images/scarpa.jpg" width="612" height="334" border="0" usemap="#map" />
|
|
|
|
<map name="map">
|
|
<!-- #$-:Image map file created by GIMP Image Map plug-in -->
|
|
<!-- #$-:GIMP Image Map plug-in by Maurits Rijk -->
|
|
<!-- #$-:Please do not edit lines starting with "#$" -->
|
|
<!-- #$VERSION:2.3 -->
|
|
<!-- #$AUTHOR:USUARIO -->
|
|
<area shape="poly" coords="88,184,150,191,199,183,207,157,144,169,89,180,83,188,98,192,125,191,109,189" href="#part=toebox" />
|
|
<area shape="poly" coords="58,230,100,256,245,264,450,263,529,245,510,269,370,280,276,278,208,278,121,274,75,261,53,235,60,238" href="identificationparts.php?part=outersole" />
|
|
<area shape="poly" coords="80,182,59,207,104,219,248,227,308,218,282,184,254,161,239,143,209,155,202,182,173,189,118,193,95,191,82,187" href="identificationparts.php?part=toe" />
|
|
<area shape="poly" coords="392,155,418,208,519,191,515,133,504,121,395,154" href="identificationparts.php?part=back" />
|
|
<area shape="poly" coords="310,221,418,205,393,156,315,170,283,164,272,141,292,118,253,134,243,141,242,145" href="identificationparts.php?part=middle" />
|
|
<area shape="poly" coords="498,76,490,96,476,111,489,113,511,129,519,133,509,100,502,78" href="identificationpars.php?part=heel" />
|
|
</map>
|
|
<!-- 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="">
|
|
|
|
<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; ?></h4>
|
|
<p class="text-muted mb-3"><?php echo $cmctesttitle_help; ?>
|
|
</p>
|
|
<form class="was-validated" action="" method="POST" name="myFormtwo">
|
|
|
|
<!-- 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" min="2000-01-01" max="<?php echo $todaydate; ?>" value="">
|
|
</div>
|
|
</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; ?></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>
|
|
|
|
<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 $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("cmcreportdate_identificationparts")); ?></span>
|
|
<span class="input-x hidden-x">
|
|
<input type="date" class="form-control" name="cmcreportdate_identificationparts" value="<?php echo($listinsertedpart->getColumnVal("cmcreportdate_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; ?>"><button type="button" class="btn btn-success waves-effect waves-light"><?php echo $nextsteptitle; ?></button> </a>
|
|
<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');
|
|
$("#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>
|
|
|
|
<!-- 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>
|