Compare commits
2 Commits
master
...
new-develo
| Author | SHA1 | Date | |
|---|---|---|---|
| d8dc15ac48 | |||
| deb384a31e |
@ -1,11 +0,0 @@
|
||||
<img src="[calzatura] (importata)" width="1153" height="684" 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:info -->
|
||||
<area shape="rect" coords="473,162,534,203" target="a" href="a" />
|
||||
<area shape="rect" coords="770,231,789,258" target="b" href="b" />
|
||||
</map>
|
||||
|
Before Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 466 KiB After Width: | Height: | Size: 460 KiB |
BIN
images/ind19.png
|
Before Width: | Height: | Size: 49 KiB |
BIN
images/ind21.png
|
Before Width: | Height: | Size: 55 KiB |
@ -1 +1 @@
|
||||
cURL response: cURL response: cURL response: cURL response: cURL response: cURL response: cURL response: cURL error: Operation timed out after 15004 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15008 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15014 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15008 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15006 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15010 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15015 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15016 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15015 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15013 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15009 milliseconds with 0 bytes receivedcURL response: 403 - Forbidden | Access to this page is forbidden.
|
||||
cURL response: cURL response: cURL response: cURL response: cURL response: cURL response: cURL response: cURL error: Operation timed out after 15004 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15008 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15014 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15008 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15006 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15010 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15015 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15016 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15015 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15013 milliseconds with 0 bytes receivedcURL error: Operation timed out after 15009 milliseconds with 0 bytes received
|
||||
@ -151,27 +151,18 @@ $certname->execute(); ?>
|
||||
<?php if (($trfnumberfinal->getColumnVal("idcertification") != '5') and ($trfnumberfinal->getColumnVal("idcertification") != '6')) { ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0">
|
||||
<?php echo $addphotosdoc; ?>
|
||||
<i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i>
|
||||
|
||||
<h4 class="mt-0"><?php echo $addphotosdoc; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i>
|
||||
<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>
|
||||
<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
|
||||
$lang = isset($_SESSION['langselect']) ? $_SESSION['langselect'] : 'it';
|
||||
echo ($lang === 'en') ? "Front and side photos" : "Foto frontale e laterale";
|
||||
?>
|
||||
<p>Foto frontale e laterale
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
@ -179,7 +170,6 @@ $certname->execute(); ?>
|
||||
</div><!-- /.modal -->
|
||||
</h4>
|
||||
|
||||
|
||||
<p class="text-muted mb-3"><?php echo $allowedkind; ?></p>
|
||||
|
||||
|
||||
@ -251,7 +241,7 @@ $certname->execute(); ?>
|
||||
<td id="cont_photoone">
|
||||
<?php if (!empty($trfnumberfinal->getColumnVal("photoone"))) { ?>
|
||||
<img src="uploaddocuments/<?php echo ($trfnumberfinal->getColumnVal("photoone")); ?>" height="200" alt="" />
|
||||
<a href="deletephotoone.php?idtrf=<?php echo $idtrf; ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -261,7 +251,6 @@ $certname->execute(); ?>
|
||||
<?php if (!empty($trfnumberfinal->getColumnVal("phototwo"))) { ?>
|
||||
|
||||
<img src="uploaddocuments/<?php echo ($trfnumberfinal->getColumnVal("phototwo")); ?>" height="200" alt="" />
|
||||
<a href="deletephototwo.php?idtrf=<?php echo $idtrf; ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
@ -279,7 +268,7 @@ $certname->execute(); ?>
|
||||
?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0"><?php echo $adddoctitle; ?>
|
||||
<h4 class="mt-0"><?php echo $adddoctitle; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i>
|
||||
<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">
|
||||
@ -752,10 +741,7 @@ $certname->execute(); ?>
|
||||
|
||||
// $("#photoaded").load(location.href + " #photoaded");
|
||||
// SHOW PHOTO 1
|
||||
$('#cont_photoone').html(
|
||||
data + ' <a href="deletephotoone.php?idtrf=<?php echo $idtrf; ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a>'
|
||||
);
|
||||
|
||||
$('#cont_photoone').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -802,10 +788,7 @@ $certname->execute(); ?>
|
||||
// $('.gallery').html(data);
|
||||
// $("#photoaded").load(location.href + " #photoaded");
|
||||
// SHOW PHOTO 2
|
||||
$('#cont_phototwo').html(
|
||||
data + ' <a href="deletephototwo.php?idtrf=<?php echo $idtrf; ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a>'
|
||||
);
|
||||
|
||||
$('#cont_phototwo').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -223,10 +223,10 @@ $drafttrf->execute();
|
||||
<tr>
|
||||
<th>TRF N.</th>
|
||||
<th>REV</th>
|
||||
<th><?= htmlspecialchars($descriptionarchive, ENT_QUOTES, 'UTF-8'); ?></th>
|
||||
<th><?= htmlspecialchars($certarchive, ENT_QUOTES, 'UTF-8'); ?></th>
|
||||
<th><?= htmlspecialchars($artarchive, ENT_QUOTES, 'UTF-8'); ?></th>
|
||||
<th><?= htmlspecialchars($tobesignarchive, ENT_QUOTES, 'UTF-8'); ?></th>
|
||||
<th>Description</th>
|
||||
<th>Cert Type</th>
|
||||
<th>Article type</th>
|
||||
<th>To be Sign</th>
|
||||
<th><?php echo $action; ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@ -245,14 +245,7 @@ $drafttrf->execute();
|
||||
} ?></td>
|
||||
|
||||
<td><?php echo ($drafttrf->getColumnVal("sample_description")); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
$lang = isset($_SESSION['langselect']) ? $_SESSION['langselect'] : 'it';
|
||||
$columnName = ($lang === 'en') ? "showtablename_en" : "showtablename_it";
|
||||
echo $drafttrf->getColumnVal($columnName);
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td><?php echo ($drafttrf->getColumnVal("name_certification")); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
// Assuming session_start() has been called previously if needed.
|
||||
@ -264,7 +257,7 @@ $drafttrf->execute();
|
||||
$revcs = $drafttrf->getColumnVal("revcs");
|
||||
if ($revcs == 's') { ?>
|
||||
|
||||
<a href="declaration.php?idtrf=<?php echo $idtrf; ?>"><button type="button" class="btn btn-success waves-effect waves-light"><?= htmlspecialchars($signarchive, ENT_QUOTES, 'UTF-8'); ?></button></a>
|
||||
<a href="declaration.php?idtrf=<?php echo $idtrf; ?>"><button type="button" class="btn btn-success waves-effect waves-light">SIGN</button></a>
|
||||
|
||||
</td>
|
||||
<td></td><?php } ?>
|
||||
@ -363,15 +356,15 @@ $drafttrf->execute();
|
||||
<tr>
|
||||
<th>TRF N.</th>
|
||||
<th>REV</th>
|
||||
<th><?= htmlspecialchars($signedonarchive, ENT_QUOTES, 'UTF-8'); ?></th>
|
||||
<th><?= htmlspecialchars($descriptionarchive, ENT_QUOTES, 'UTF-8'); ?></th>
|
||||
<th><?= htmlspecialchars($certarchive, ENT_QUOTES, 'UTF-8'); ?></th>
|
||||
<th><?= htmlspecialchars($artarchive, ENT_QUOTES, 'UTF-8'); ?></th>
|
||||
<th><?= htmlspecialchars($insertbyarchive, ENT_QUOTES, 'UTF-8'); ?></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th>Signed On</th>
|
||||
<th>Description</th>
|
||||
<th>Cert Type</th>
|
||||
<th>Article type</th>
|
||||
<th>Insert by</th>
|
||||
<th>PDF1</th>
|
||||
<th>PDF2</th>
|
||||
<th>ZIP</th>
|
||||
<th><?= htmlspecialchars($action, ENT_QUOTES, 'UTF-8'); ?></th>
|
||||
<th>ACTION</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
@ -413,17 +406,7 @@ $drafttrf->execute();
|
||||
<td><?php echo ($archivetrflist->getColumnVal("sample_description"));
|
||||
|
||||
?></td>
|
||||
<td>
|
||||
<?php
|
||||
$lang = isset($_SESSION['langselect']) ? $_SESSION['langselect'] : 'it';
|
||||
$columnName = ($lang === 'en') ? "showtablename_en" : "showtablename_it";
|
||||
$value = $archivetrflist->getColumnVal($columnName);
|
||||
|
||||
// Fallback: se il valore è vuoto, usa name_certification
|
||||
echo !empty($value) ? $value : $archivetrflist->getColumnVal("name_certification");
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td><?php echo ($archivetrflist->getColumnVal("name_certification")); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
// Assuming session_start() has been called previously if needed.
|
||||
@ -474,62 +457,63 @@ $drafttrf->execute();
|
||||
Rev
|
||||
</button>
|
||||
|
||||
<?php
|
||||
if (!in_array($idcertfortd, [5, 6, 10])) {
|
||||
$idtrfdetailschk = $archivetrflist->getColumnVal('idtrfdetails');
|
||||
$ntrfdetailschk = $archivetrflist->getColumnVal('trfnumber');
|
||||
<?php if ((Auth::user()->hasRole('Admin')) || (Auth::user()->hasRole('CustomerService')) || (Auth::user()->hasRole('Superuser')) || (Auth::user()->hasRole('Certification')) || (Auth::user()->id == 178)) : ?>
|
||||
<?php
|
||||
if (!in_array($idcertfortd, [5, 6, 10])) {
|
||||
$idtrfdetailschk = $archivetrflist->getColumnVal('idtrfdetails');
|
||||
$ntrfdetailschk = $archivetrflist->getColumnVal('trfnumber');
|
||||
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
die("Connessione fallita: " . $conn->connect_error);
|
||||
if ($conn->connect_error) {
|
||||
die("Connessione fallita: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
$query = "SELECT COUNT(*) AS count FROM data_td WHERE idtrf = ?";
|
||||
$stmt = $conn->prepare($query);
|
||||
|
||||
if ($stmt === false) {
|
||||
die("Errore nella preparazione della query: " . $conn->error);
|
||||
}
|
||||
|
||||
$stmt->bind_param("i", $idtrfdetailschk);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$rowcheck = $result->fetch_assoc();
|
||||
|
||||
if ($rowcheck['count'] < 1) {
|
||||
$buttonColor = '#ff9800';
|
||||
$onClick = "Swal.fire({
|
||||
title: 'Sei sicuro di voler creare il Fascicolo Tecnico per il TRF N. " . $ntrfdetailschk . "?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, procedi!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='techdossier_start.php?idtrftd=" . $idtrfdetailschk . "';
|
||||
}
|
||||
});";
|
||||
} else {
|
||||
$buttonColor = '#4CAF50';
|
||||
$onClick = "window.location.href='archivetd.php';";
|
||||
}
|
||||
|
||||
$stmt->close();
|
||||
$conn->close();
|
||||
?>
|
||||
|
||||
<button type="button" onclick="<?php echo $onClick; ?>" class="btn <?php echo ($maxrevtrf > $currentrevtrf) ? 'btn-inactive' : ''; ?>" style="border: 1px solid; color: white; background-color: <?php echo $buttonColor; ?>;" <?php echo ($maxrevtrf > $currentrevtrf) ? 'disabled' : ''; ?>>
|
||||
TF
|
||||
</button>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
$query = "SELECT COUNT(*) AS count FROM data_td WHERE idtrf = ?";
|
||||
$stmt = $conn->prepare($query);
|
||||
|
||||
if ($stmt === false) {
|
||||
die("Errore nella preparazione della query: " . $conn->error);
|
||||
}
|
||||
|
||||
$stmt->bind_param("i", $idtrfdetailschk);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$rowcheck = $result->fetch_assoc();
|
||||
|
||||
if ($rowcheck['count'] < 1) {
|
||||
$buttonColor = '#ff9800';
|
||||
$onClick = "Swal.fire({
|
||||
title: 'Sei sicuro di voler creare il Fascicolo Tecnico per il TRF N. " . $ntrfdetailschk . "?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, procedi!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='techdossier_start.php?idtrftd=" . $idtrfdetailschk . "';
|
||||
}
|
||||
});";
|
||||
} else {
|
||||
$buttonColor = '#4CAF50';
|
||||
$onClick = "window.location.href='archivetd.php';";
|
||||
}
|
||||
|
||||
$stmt->close();
|
||||
$conn->close();
|
||||
?>
|
||||
|
||||
<button type="button" onclick="<?php echo $onClick; ?>" class="btn <?php echo ($maxrevtrf > $currentrevtrf) ? 'btn-inactive' : ''; ?>" style="border: 1px solid; color: white; background-color: <?php echo $buttonColor; ?>;" <?php echo ($maxrevtrf > $currentrevtrf) ? 'disabled' : ''; ?>>
|
||||
TF
|
||||
</button>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<button type="button" onclick="
|
||||
Swal.fire({
|
||||
|
||||
30
public/assets/css/additionalstyle.php
Normal file
@ -0,0 +1,30 @@
|
||||
<style>
|
||||
body {
|
||||
background-image: none;
|
||||
/* Rimuovi il logo come sfondo del body */
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body::before {
|
||||
content: "";
|
||||
position: fixed;
|
||||
top: 0%;
|
||||
/* Mantiene uno spazio verticale uniforme */
|
||||
left: 0%;
|
||||
width: 110%;
|
||||
/* Riduce la larghezza al 80% dello schermo */
|
||||
height: 110%;
|
||||
/* Riduce l'altezza al 80% dello schermo */
|
||||
background-image: url('assets/images/logobianco.png');
|
||||
/* Percorso del logo */
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: contain;
|
||||
/* Mantiene le proporzioni del logo */
|
||||
|
||||
/* Imposta la trasparenza del logo */
|
||||
z-index: -1;
|
||||
/* Assicura che il logo rimanga sotto i contenuti */
|
||||
}
|
||||
</style>
|
||||
7621
public/assets/css/app.min.css
vendored
BIN
public/assets/images/cimabackground.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
public/assets/images/logobianco.png
Normal file
|
After Width: | Height: | Size: 55 KiB |
BIN
public/assets/images/logonero.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
public/assets/images/xcimac.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
@ -1,55 +0,0 @@
|
||||
v1.2.3 (2015/04/20)
|
||||
-------------------
|
||||
- Added 'bower.json' to use this package manager
|
||||
- Added 'tbody' in the selector during the construction of the structure, to avoid problems with the 'tfoot'
|
||||
- Now when you tab in a row, the form is saved. Only if there is no save button
|
||||
|
||||
v1.2.2 (2015/04/02)
|
||||
-------------------
|
||||
- Updated 'example.php' file
|
||||
- Updated project page with examples and documentation
|
||||
- Now if 'onAjax()' hook returns false, does not send the ajax request
|
||||
- Added 'rowIdentifier' option to change the name of attribute in td element for the row identifier
|
||||
- Fixed bug that allows you to change to edit mode with mouse click when the line was deleted
|
||||
- Quick fix for issue that sometimes could not remove the warning class on the edited rows
|
||||
|
||||
v1.2.1 (2015/03/10)
|
||||
-------------------
|
||||
- Improved the select element
|
||||
- Does not add hidden save button if the 'editButton' option is false
|
||||
- Does not add hidden restore button if the 'deleteButton' option is false
|
||||
- Added a new option 'autoFocus' to enable or not the focus in the first input when click in edit button
|
||||
- Added a new hook 'onAjax(action, serialize)' that runs before the ajax request
|
||||
|
||||
v1.2.0 (2015/03/07)
|
||||
-------------------
|
||||
- Added 'saveButton' and 'restoreButton' options
|
||||
- Added 'toolbarClass' and 'groupClass' options
|
||||
- Changed 'removeButton' option to 'deleteButton'
|
||||
- Changed 'remove' action to 'delete'
|
||||
- Removed 'textSelection' option, using CSS to prevent the text is selected with double click
|
||||
- Removed 'confirmText' option, because a button was created to confirm the removal
|
||||
- Removed form wrapped on table, because now it serialize inputs instead of the form
|
||||
- In 'buttons' option now have a new child 'action' to change name of action input ('edit', 'delete' and 'restore')
|
||||
- Redesign of toolbox and changed name to toolbar
|
||||
- Minor code improvement
|
||||
- Fixed some bugs
|
||||
|
||||
v1.1.1 (2015/03/05)
|
||||
-------------------
|
||||
- Fixed bug when creates the form wrapped on table
|
||||
|
||||
v1.1.0 (2015/02/08)
|
||||
-------------------
|
||||
- Added toolbox column with edit and remove buttons
|
||||
- Added effect on table row when ajax request fails
|
||||
- Added effect on table row when changes are saved with success
|
||||
- Added 'onAlways()' hook, that is executed whenever there is an ajax request
|
||||
- Change 'onComplete(response)' hook to 'onSuccess(data, textStatus, jqXHR)'
|
||||
- Change 'onError()' hook to 'onFail(jqXHR, textStatus, errorThrown)'
|
||||
- Fixed some minor bugs
|
||||
- Minor code improvement
|
||||
|
||||
v1.0.0 (2015/01/30)
|
||||
-------------------
|
||||
- Initial release
|
||||
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Celso Marques
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@ -1,18 +0,0 @@
|
||||
# jQuery-Tabledit v1.2.3
|
||||
Inline editor for HTML tables compatible with Bootstrap.
|
||||
|
||||
|
||||
## Examples
|
||||
http://markcell.github.io/jquery-tabledit/#examples
|
||||
|
||||
|
||||
## Documentation
|
||||
http://markcell.github.io/jquery-tabledit/#documentation
|
||||
|
||||
|
||||
## Changelog
|
||||
See [CHANGELOG.md](https://github.com/markcell/jquery-tabledit/blob/master/CHANGELOG.md) file.
|
||||
|
||||
|
||||
## License
|
||||
Code released under the MIT license.
|
||||
@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "markcell/jquery-tabledit",
|
||||
"version": "1.2.3",
|
||||
"description": "Inline editor for HTML tables compatible with Bootstrap.",
|
||||
"main": "jquery.tabledit.js",
|
||||
"license": "MIT",
|
||||
"homepage": "http://markcell.github.io/jquery-tabledit",
|
||||
"keywords": [
|
||||
"html",
|
||||
"table",
|
||||
"edit",
|
||||
"bootstrap",
|
||||
"spreadsheet",
|
||||
"inline",
|
||||
"editor"
|
||||
],
|
||||
"ignore": [
|
||||
"*.md",
|
||||
"*.php"
|
||||
],
|
||||
"dependencies": {
|
||||
"jquery": "jquery/jquery"
|
||||
}
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
<?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');
|
||||
|
||||
$input = filter_input_array(INPUT_POST);
|
||||
|
||||
$mysqli = new mysqli('localhost', 'user', 'password', 'database');
|
||||
|
||||
if (mysqli_connect_errno()) {
|
||||
echo json_encode(array('mysqli' => 'Failed to connect to MySQL: ' . mysqli_connect_error()));
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($input['action'] === 'edit') {
|
||||
$mysqli->query("UPDATE users SET username='" . $input['username'] . "', email='" . $input['email'] . "', avatar='" . $input['avatar'] . "' WHERE id='" . $input['id'] . "'");
|
||||
} else if ($input['action'] === 'delete') {
|
||||
$mysqli->query("UPDATE users SET deleted=1 WHERE id='" . $input['id'] . "'");
|
||||
} else if ($input['action'] === 'restore') {
|
||||
$mysqli->query("UPDATE users SET deleted=0 WHERE id='" . $input['id'] . "'");
|
||||
}
|
||||
|
||||
mysqli_close($mysqli);
|
||||
|
||||
echo json_encode($input);
|
||||
@ -1,611 +0,0 @@
|
||||
/*!
|
||||
* 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',
|
||||
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="glyphicon glyphicon-pencil"></span>',
|
||||
action: 'edit'
|
||||
},
|
||||
delete: {
|
||||
class: 'btn btn-sm btn-default',
|
||||
html: '<span class="glyphicon glyphicon-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.
|
||||
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('tbody>tr').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();
|
||||
// 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();
|
||||
// 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 {
|
||||
$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());
|
||||
}
|
||||
// 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()
|
||||
|
||||
if (!serialize) {
|
||||
return false;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
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(event) {
|
||||
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 table element.
|
||||
*
|
||||
* @param {object} event
|
||||
*/
|
||||
$table.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));
|
||||
@ -1,611 +0,0 @@
|
||||
/*!
|
||||
* 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',
|
||||
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="glyphicon glyphicon-pencil"></span>',
|
||||
action: 'edit'
|
||||
},
|
||||
delete: {
|
||||
class: 'btn btn-sm btn-default',
|
||||
html: '<span class="glyphicon glyphicon-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.
|
||||
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('tbody>tr').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();
|
||||
// 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();
|
||||
// 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 {
|
||||
$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());
|
||||
}
|
||||
// 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()
|
||||
|
||||
if (!serialize) {
|
||||
return false;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
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(event) {
|
||||
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 table element.
|
||||
*
|
||||
* @param {object} event
|
||||
*/
|
||||
$table.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
public/assets/js/jquery.tabledit.min.js
vendored
@ -1,380 +1,290 @@
|
||||
<?php
|
||||
|
||||
<?php
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
|
||||
<?php
|
||||
|
||||
// include('include/headscript.php');
|
||||
?>
|
||||
// include('include/headscript.php'); ?>
|
||||
|
||||
|
||||
<?php //insert query
|
||||
if (isset($_POST['adduser'])) {
|
||||
if (isset($_POST['first_name'])) {
|
||||
$first_name = $_POST['first_name'];
|
||||
}
|
||||
if (isset($_POST['last_name'])) {
|
||||
$last_name = $_POST['last_name'];
|
||||
}
|
||||
if (isset($_POST['emailuser'])) {
|
||||
$emailuser = $_POST['emailuser'];
|
||||
}
|
||||
if (isset($_POST['datein'])) {
|
||||
$datein = $_POST['datein'];
|
||||
}
|
||||
if (isset($_POST['language'])) {
|
||||
$langid = $_POST['language'];
|
||||
}
|
||||
if (isset($_POST['company_name'])) {
|
||||
$company_name = $_POST['company_name'];
|
||||
}
|
||||
if (isset($_POST['vat_number'])) {
|
||||
$vat_number = $_POST['vat_number'];
|
||||
}
|
||||
if (isset($_POST['terms_accepted'])) {
|
||||
$terms_accepted = $_POST['terms_accepted'];
|
||||
}
|
||||
if (isset($_POST['privacy_accepted'])) {
|
||||
$privacy_accepted = $_POST['privacy_accepted'];
|
||||
}
|
||||
|
||||
$checkmail = new WA_MySQLi_RS("checkmail", $cmctrfdb, 0);
|
||||
$checkmail->setQuery("SELECT * FROM auth_users WHERE auth_users.email='$emailuser'");
|
||||
$checkmail->execute();
|
||||
if (!empty($checkmail->getColumnVal("id"))) {
|
||||
$varmailrepeat = 'Y'; ?>
|
||||
|
||||
<?php
|
||||
if (isset($_POST['adduser'])) {
|
||||
if (isset($_POST['first_name'])) { $first_name=$_POST['first_name']; }
|
||||
if (isset($_POST['last_name'])) { $last_name=$_POST['last_name']; }
|
||||
if (isset($_POST['emailuser'])) { $emailuser=$_POST['emailuser']; }
|
||||
if (isset($_POST['datein'])) { $datein=$_POST['datein']; }
|
||||
if (isset($_POST['language'])) { $langid=$_POST['language']; }
|
||||
?>
|
||||
<?php //insert query
|
||||
|
||||
$checkmail = new WA_MySQLi_RS("checkmail",$cmctrfdb,0);
|
||||
$checkmail->setQuery("SELECT * FROM auth_users WHERE auth_users.email='$emailuser'");
|
||||
$checkmail->execute();
|
||||
if(!empty($checkmail->getColumnVal("id"))) { $varmailrepeat='Y'; ?>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
|
||||
|
||||
$mysqli = new mysqli($hostname_cmctrfdb, $username_cmctrfdb, $password_cmctrfdb, $database_cmctrfdb);
|
||||
|
||||
$mysqli = new mysqli($hostname_cmctrfdb, $username_cmctrfdb, $password_cmctrfdb, $database_cmctrfdb);
|
||||
|
||||
$query = "INSERT INTO auth_users (email, first_name, last_name, password, role_id, status, email_verified_at, created_at, updated_at, langid, termuseaccepted) VALUES ('$emailuser', '$first_name', '$last_name', '12345!AA', '2','Active','$datein','$datein','$datein','$langid', '$datein')";
|
||||
|
||||
$query = "INSERT INTO auth_users (email, first_name, last_name, password, role_id, status, email_verified_at, created_at, updated_at, langid, termuseaccepted, privacyaccepted, company_name, vat_number) VALUES ('$emailuser', '$first_name', '$last_name', '12345!AA', '2', 'Active', '$datein', '$datein', '$datein', '$langid', '$datein', '$datein', '$company_name', '$vat_number')";
|
||||
// Esegui la query
|
||||
$mysqli->query($query);
|
||||
$inserttrue='Y';
|
||||
// Chiudi la connessione al database
|
||||
$mysqli->close();
|
||||
|
||||
// Esegui la query
|
||||
$mysqli->query($query);
|
||||
$inserttrue = 'Y';
|
||||
// Chiudi la connessione al database
|
||||
$mysqli->close();
|
||||
|
||||
|
||||
//Now include the following following files based
|
||||
//on the correct file path. Third file is required only if you want to enable SMTP.
|
||||
require 'phpmailer/src/Exception.php';
|
||||
require 'phpmailer/src/PHPMailer.php';
|
||||
require 'phpmailer/src/SMTP.php';
|
||||
|
||||
//mail to client
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = "smtp.office365.com"; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = "noreply@cimac.it"; // SMTP username
|
||||
$mail->Password = "Fol42937"; // SMTP password
|
||||
$mail->SMTPSecure = "tls"; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = 587;
|
||||
//Now include the following following files based
|
||||
//on the correct file path. Third file is required only if you want to enable SMTP.
|
||||
|
||||
$mmessage = "mailnewuser";
|
||||
include('include/mailnewuser.php');
|
||||
// Email body content
|
||||
$htmlContent = $mailmessage1;
|
||||
require 'phpmailer/src/Exception.php';
|
||||
require 'phpmailer/src/PHPMailer.php';
|
||||
require 'phpmailer/src/SMTP.php';
|
||||
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addAddress($emailuser); // Add a recipient
|
||||
//mail to client
|
||||
|
||||
$mail->Subject = "Creazione Nuovo Utente";
|
||||
$mail->Body = $htmlContent;
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = "smtp.office365.com"; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = "noreply@cimac.it"; // SMTP username
|
||||
$mail->Password = "Fol42937"; // SMTP password
|
||||
$mail->SMTPSecure = "tls"; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = 587;
|
||||
|
||||
$mmessage="mailnewuser";
|
||||
include('include/mailnewuser.php');
|
||||
// Email body content
|
||||
|
||||
$mail->send();
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
|
||||
// mail to Marco for new user
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
$htmlContent = $mailmessage1;
|
||||
|
||||
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addAddress($emailuser); // Add a recipient
|
||||
|
||||
|
||||
|
||||
// Email body content
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addBCC('m.piccolini@cimac.it'); // Add a recipient
|
||||
$mail->addBCC($csmail); // Add a recipient
|
||||
$mail->addBCC($csmail3);
|
||||
$mail->addBCC('info@acscreativesolutions.com');
|
||||
$mail->Subject = "Creazione Nuovo Utente";
|
||||
$mail->Body = $htmlContent;
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
|
||||
$mail->Subject = 'Nuovo Utente';
|
||||
$mail->Body = "Ciao! E' stato inserito un nuovo Utente $emailuser ";
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
|
||||
$mail->send();
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
}
|
||||
$mail->send();
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
// mail to Marco for new user
|
||||
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
|
||||
|
||||
|
||||
// Email body content
|
||||
|
||||
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addBCC('m.piccolini@cimac.it'); // Add a recipient
|
||||
$mail->addBCC($csmail); // Add a recipient
|
||||
$mail->addBCC($csmail3);
|
||||
$mail->addBCC('info@acscreativesolutions.com');
|
||||
|
||||
|
||||
$mail->Subject = 'Nuovo Utente';
|
||||
$mail->Body = "Ciao! E' stato inserito un nuovo Utente $emailuser ";
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
|
||||
$mail->send();
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
|
||||
}}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>CIMAC Application Form</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
|
||||
<meta content="" name="author" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>CIMAC Application Form</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
|
||||
<meta content="" name="author" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="../assets/images/favicon.ico">
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="../assets/images/favicon.ico">
|
||||
|
||||
<!-- 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" />
|
||||
<!-- 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" />
|
||||
|
||||
</head>
|
||||
|
||||
</head>
|
||||
<body class="account-body accountbg">
|
||||
|
||||
<body class="account-body accountbg">
|
||||
|
||||
<!-- Log In page -->
|
||||
<div class="container-fluid">
|
||||
<div class="row vh-100 ">
|
||||
<div class="col-12 align-self-center">
|
||||
<div class="auth-pagea">
|
||||
<div class="card auth-card shadow-lg" style="max-width: 800px; width: 100%; margin: 0 auto;">
|
||||
|
||||
<div class="card-body">
|
||||
<div class="px-3">
|
||||
<div>
|
||||
<a href="https://www.cimac.it/modulo_certificazione/public/login" class="logo logo-admin"><img src="assets/img/cimac-logo.png" height="55" alt="logo" class="auth-logo"></a>
|
||||
</div><!--end auth-logo-box-->
|
||||
|
||||
<div class="text-center auth-logo-text">
|
||||
<h4 class="mt-0 mb-3 mt-5">REGISTRAZIONE PIATTAFORMA PPEASY<br>REGISTRATION PPEASY PLATFORM</h4>
|
||||
|
||||
</div> <!--end auth-logo-text-->
|
||||
|
||||
<?php if (isset($varmailrepeat)) { ?>
|
||||
<div class="alert icon-custom-alert alert-outline-pink b-round fade show" role="alert">
|
||||
<!-- Log In page -->
|
||||
<div class="container">
|
||||
<div class="row vh-100 ">
|
||||
<div class="col-12 align-self-center">
|
||||
<div class="auth-page">
|
||||
<div class="card auth-card shadow-lg">
|
||||
|
||||
<div class="card-body">
|
||||
<div class="px-3">
|
||||
<div>
|
||||
<a href="https://www.cimac.it/modulo_certificazione/public/login" class="logo logo-admin"><img src="assets/img/cimac-logo.png" height="55" alt="logo" class="auth-logo"></a>
|
||||
</div><!--end auth-logo-box-->
|
||||
|
||||
<div class="text-center auth-logo-text">
|
||||
<h4 class="mt-0 mb-3 mt-5">Registrazione CIMAC Application Form</h4>
|
||||
|
||||
</div> <!--end auth-logo-text-->
|
||||
|
||||
<?php if (isset($varmailrepeat)) { ?>
|
||||
<div class="alert icon-custom-alert alert-outline-pink b-round fade show" role="alert">
|
||||
<i class="mdi mdi-alert-outline alert-icon"></i>
|
||||
<div class="alert-text">
|
||||
<strong>Email già presente nel database.
|
||||
</div>
|
||||
|
||||
|
||||
<div class="alert-close">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true"><i class="mdi mdi-close text-danger"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
</div><?php } ?>
|
||||
|
||||
<?php if (isset($inserttrue)) { ?>
|
||||
<div class="alert icon-custom-alert alert-outline-success alert-success-shadow" role="alert">
|
||||
|
||||
<?php if (isset($inserttrue)) { ?>
|
||||
<div class="alert icon-custom-alert alert-outline-success alert-success-shadow" role="alert">
|
||||
<i class="mdi mdi-check-all alert-icon"></i>
|
||||
<div class="alert-text">
|
||||
<strong>Ben fatto!</strong> Utente creato con successo.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<p>Presto riceverai una mail per impostare la tua prima password e poi potrai procedere con l'uso del portale!</p><br>
|
||||
<p>Soon you will receive an email in order to setup your first password and then you can start to use the portal!</p><br>
|
||||
<?php } ?>
|
||||
<?php if (!isset($inserttrue)) { ?>
|
||||
<form class="form-horizontal auth-form my-4" action="auth-creation.php" method="post" name="usernew" onsubmit="return validateForm();">
|
||||
<?php $nowtime = date("Y-m-d G:i:s"); ?>
|
||||
<div class="form-group">
|
||||
<p>Soon you will receive an email in order to setup your first password and then you can start to use the portal!</p><br>
|
||||
<?php } ?>
|
||||
<?php if (!isset($inserttrue)) { ?>
|
||||
<form class="form-horizontal auth-form my-4" action="auth-creation.php" method="post" name="usernew">
|
||||
<?php $nowtime=date("Y-m-d G:i:s"); ?>
|
||||
<div class="form-group">
|
||||
<label for="useremail">Nome/Name</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-user"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="first_name" name="first_name" placeholder="Nome/Name" required>
|
||||
</div>
|
||||
<i class="dripicons-user"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="first_name" name="first_name" placeholder="Nome/Name">
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="useremail">Cognome / Surname</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-user"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="last_name" name="last_name" placeholder="Cognome / Surname" required>
|
||||
</div>
|
||||
<i class="dripicons-user"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="last_name" name="last_name" placeholder="Cognome / Surname">
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="useremail">Email</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-mail"></i>
|
||||
</span>
|
||||
<input type="email" class="form-control" id="emailuser" name="emailuser" placeholder="Email" required>
|
||||
</div>
|
||||
<i class="dripicons-mail"></i>
|
||||
</span>
|
||||
<input type="email" class="form-control" id="emailuser" name="emailuser" placeholder="Email">
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group">
|
||||
<label for="useremail">Ragione sociale azienda / Company Name</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-briefcase"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="company_name" name="company_name" placeholder="Ragione sociale azienda / Company Name" required>
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group">
|
||||
<label for="useremail">P.IVA azienda / Vat Number or ID Tax Number</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-id"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="vat_number" name="vat_number" placeholder="P.IVA azienda / Vat Number or ID Tax Number" required>
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="col-md-8 mb-8">
|
||||
<label for="exampleFormControlSelect1">Lingua / Language</label>
|
||||
<select class="form-control" id="language" name="language" required>
|
||||
|
||||
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="col-md-8 mb-8">
|
||||
<label for="exampleFormControlSelect1">Lingua / Language</label>
|
||||
<select class="form-control" id="language" name="language">
|
||||
<option value="1">Italiano</option>
|
||||
<option value="2">English</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="status" name="status" value="Active">
|
||||
<input type="hidden" id="role_id" name="role_id" value="2">
|
||||
<input type="hidden" id="adduser" name="adduser" value="Y">
|
||||
<input type="hidden" id="datein" name="datein" value="<?php echo $nowtime; ?>">
|
||||
<input type="hidden" id="adduser" name="adduser" value="Y">
|
||||
<input type="hidden" id="datein" name="datein" value="<?php echo $nowtime; ?>">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group row mt-4">
|
||||
<div class="col-sm-12">
|
||||
<div class="custom-control custom-switch switch-success">
|
||||
<input type="checkbox" class="custom-control-input" id="terms_accepted" name="terms_accepted" onchange="checkAcceptance()">
|
||||
<label class="custom-control-label" for="terms_accepted">Registrandoti accetti i termini e le condizioni d’uso della piattaforma PPEASY <a href="terminiecondizioni.php" target="_blank"><u>qui presenti</u></a> / By registering you agree to <a href="termsandconditions.php" target="_blank"><u>these terms and conditions</u></a> of use of the PPEASY platform </label>
|
||||
<!-- <input type="checkbox" class="custom-control-input" id="customSwitchSuccess"> -->
|
||||
<label class=" for="customSwitchSuccess">Registrandoti accetti le condizioni d'uso di seguito riportate / By registering you agree to the following <a href="terminiecondizioni.php" target='blank' class="text-primary">Terms of Use</a></label>
|
||||
</div>
|
||||
<div class="custom-control custom-switch switch-success">
|
||||
<input type="checkbox" class="custom-control-input" id="privacy_accepted" name="privacy_accepted" onchange="checkAcceptance()">
|
||||
<label class="custom-control-label" for="privacy_accepted">Dichiaro di aver letto e compreso l’informativa sui dati personali <a href="informativappeasy.php" target="_blank"><u>qui presente</u></a>. / I declare that I have read and understood the information on <a href="informativappeasy_eng.php" target="_blank"><u>personal data herein</u></a>.</label>
|
||||
</div>
|
||||
</div><!--end col-->
|
||||
</div><!--end form-group-->
|
||||
|
||||
</div><!--end col-->
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group mb-0 row">
|
||||
<div class="col-12 mt-2">
|
||||
<button class="btn btn-round btn-block" type="submit" id="registerButton" disabled style="background-color: #f5f5f5; color: #333333;">Registrati / Register <i class="fas fa-sign-in-alt ml-1"></i></button>
|
||||
</div><!--end col-->
|
||||
</div> <!--end form-group-->
|
||||
<button class="btn btn-gradient-primary btn-round btn-block waves-effect waves-light" type="submit">Registrati /Register <i class="fas fa-sign-in-alt ml-1"></i></button>
|
||||
</div><!--end col-->
|
||||
</div> <!--end form-group-->
|
||||
</form><?php } ?><!--end form-->
|
||||
</div><!--end /div-->
|
||||
</div><!--end /div-->
|
||||
|
||||
<div class="m-3 text-center text-muted">
|
||||
<p class="">Hai già un account? / Already have an account ? <a href="login" class="text-primary ml-2">Log in</a></p>
|
||||
</div>
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
</div><!--end auth-card-->
|
||||
</div><!--end col-->
|
||||
</div><!--end row-->
|
||||
</div><!--end container-->
|
||||
<!-- End Log In page -->
|
||||
|
||||
<div class="m-3 text-center text-muted">
|
||||
<p class="">Hai già un account? / Already have an account ? <a href="login" class="text-primary ml-2">Log in</a></p>
|
||||
<br>
|
||||
<p> <a href="regolamentoprivacy.php" target="_blank">Privacy Policy ITA</a> / <a href="privacydoc.php" target="_blank">Privacy Policy ENG</a> - <a href="cookie-policy-it.php" target="_blank">Cookie Policy ITA</a> / <a href="cookie-policy-en.php" target="_blank">Cookie Policy ENG</a> </p>
|
||||
</div>
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
</div><!--end auth-card-->
|
||||
</div><!--end col-->
|
||||
</div><!--end row-->
|
||||
</div><!--end container-->
|
||||
|
||||
<!-- End Log In page -->
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="assets/js/jquery.min.js"></script>
|
||||
<script src="assets/js/jquery-ui.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>
|
||||
|
||||
<!-- App js -->
|
||||
<script src="../assets/js/app.js"></script>
|
||||
|
||||
<script>
|
||||
function validateForm() {
|
||||
var termsAccepted = document.getElementById("terms_accepted").checked;
|
||||
var privacyAccepted = document.getElementById("privacy_accepted").checked;
|
||||
if (!termsAccepted || !privacyAccepted) {
|
||||
alert("Devi accettare i Termini di Uso e la Privacy Policy per registrarti / You must accept the Terms of Use and Privacy Policy to register.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function checkAcceptance() {
|
||||
var termsAccepted = document.getElementById("terms_accepted").checked;
|
||||
var privacyAccepted = document.getElementById("privacy_accepted").checked;
|
||||
var registerButton = document.getElementById("registerButton");
|
||||
if (termsAccepted && privacyAccepted) {
|
||||
registerButton.disabled = false;
|
||||
registerButton.className = "btn btn-gradient-primary btn-round btn-block waves-effect waves-light";
|
||||
registerButton.style.backgroundColor = "";
|
||||
registerButton.style.color = "";
|
||||
} else {
|
||||
registerButton.disabled = true;
|
||||
registerButton.className = "btn btn-round btn-block";
|
||||
registerButton.style.backgroundColor = "#f5f5f5";
|
||||
registerButton.style.color = "#333333";
|
||||
}
|
||||
}
|
||||
|
||||
// Initial check on page load
|
||||
window.onload = checkAcceptance;
|
||||
</script>
|
||||
|
||||
<!-- Cookie Banner -->
|
||||
<div id="cookie-banner" style="position: fixed; bottom: 0; width: 100%; background: #333; color: #fff; padding: 15px; text-align: center; z-index: 1000; font-family: Arial, sans-serif;">
|
||||
<div id="cookie-text">
|
||||
<p>
|
||||
Questo sito utilizza esclusivamente cookie tecnici per garantire funzionalità essenziali (come login e sicurezza).
|
||||
<a href="cookie-policy-it.php" target="_blank" style="color: #fff; text-decoration: underline; margin-left: 5px;">Scopri di più</a>
|
||||
</p>
|
||||
<p>
|
||||
This site uses only technical cookies to ensure essential features (such as login and security).
|
||||
<a href="cookie-policy-en.php" target="_blank" style="color: #fff; text-decoration: underline; margin-left: 5px;">Learn more</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button onclick="closeBanner()" style="background: #28a745; color: #fff; border: none; padding: 8px 16px; margin: 5px; cursor: pointer;">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function closeBanner() {
|
||||
document.getElementById('cookie-banner').style.display = 'none';
|
||||
localStorage.setItem('cookiesAcknowledged', 'true');
|
||||
}
|
||||
|
||||
// Nasconde il banner se l'utente ha già chiuso
|
||||
window.onload = function() {
|
||||
if (localStorage.getItem('cookiesAcknowledged')) {
|
||||
document.getElementById('cookie-banner').style.display = 'none';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
<!-- jQuery -->
|
||||
<script src="assets/js/jquery.min.js"></script>
|
||||
<script src="assets/js/jquery-ui.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>
|
||||
|
||||
<!-- App js -->
|
||||
<script src="../assets/js/app.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,375 +0,0 @@
|
||||
<?php
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
|
||||
<?php
|
||||
|
||||
// include('include/headscript.php');
|
||||
?>
|
||||
|
||||
<?php //insert query
|
||||
if (isset($_POST['adduser'])) {
|
||||
if (isset($_POST['first_name'])) {
|
||||
$first_name = $_POST['first_name'];
|
||||
}
|
||||
if (isset($_POST['last_name'])) {
|
||||
$last_name = $_POST['last_name'];
|
||||
}
|
||||
if (isset($_POST['emailuser'])) {
|
||||
$emailuser = $_POST['emailuser'];
|
||||
}
|
||||
if (isset($_POST['datein'])) {
|
||||
$datein = $_POST['datein'];
|
||||
}
|
||||
if (isset($_POST['language'])) {
|
||||
$langid = $_POST['language'];
|
||||
}
|
||||
if (isset($_POST['company_name'])) {
|
||||
$company_name = $_POST['company_name'];
|
||||
}
|
||||
if (isset($_POST['vat_number'])) {
|
||||
$vat_number = $_POST['vat_number'];
|
||||
}
|
||||
if (isset($_POST['terms_accepted'])) {
|
||||
$terms_accepted = $_POST['terms_accepted'];
|
||||
}
|
||||
if (isset($_POST['privacy_accepted'])) {
|
||||
$privacy_accepted = $_POST['privacy_accepted'];
|
||||
}
|
||||
|
||||
$checkmail = new WA_MySQLi_RS("checkmail", $cmctrfdb, 0);
|
||||
$checkmail->setQuery("SELECT * FROM auth_users WHERE auth_users.email='$emailuser'");
|
||||
$checkmail->execute();
|
||||
if (!empty($checkmail->getColumnVal("id"))) {
|
||||
$varmailrepeat = 'Y'; ?>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
|
||||
$mysqli = new mysqli($hostname_cmctrfdb, $username_cmctrfdb, $password_cmctrfdb, $database_cmctrfdb);
|
||||
|
||||
$query = "INSERT INTO auth_users (email, first_name, last_name, password, role_id, status, email_verified_at, created_at, updated_at, langid, termuseaccepted, privacyaccepted, company_name, vat_number) VALUES ('$emailuser', '$first_name', '$last_name', '12345!AA', '2', 'Active', '$datein', '$datein', '$datein', '$langid', '$datein', '$datein', '$company_name', '$vat_number')";
|
||||
|
||||
// Esegui la query
|
||||
$mysqli->query($query);
|
||||
$inserttrue = 'Y';
|
||||
// Chiudi la connessione al database
|
||||
$mysqli->close();
|
||||
|
||||
//Now include the following following files based
|
||||
//on the correct file path. Third file is required only if you want to enable SMTP.
|
||||
require 'phpmailer/src/Exception.php';
|
||||
require 'phpmailer/src/PHPMailer.php';
|
||||
require 'phpmailer/src/SMTP.php';
|
||||
|
||||
//mail to client
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = "smtp.office365.com"; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = "noreply@cimac.it"; // SMTP username
|
||||
$mail->Password = "Fol42937"; // SMTP password
|
||||
$mail->SMTPSecure = "tls"; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = 587;
|
||||
|
||||
$mmessage = "mailnewuser";
|
||||
include('include/mailnewuser.php');
|
||||
// Email body content
|
||||
$htmlContent = $mailmessage1;
|
||||
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addAddress($emailuser); // Add a recipient
|
||||
|
||||
$mail->Subject = "Creazione Nuovo Utente";
|
||||
$mail->Body = $htmlContent;
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
|
||||
$mail->send();
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
|
||||
// mail to Marco for new user
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
|
||||
// Email body content
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addBCC('m.piccolini@cimac.it'); // Add a recipient
|
||||
$mail->addBCC($csmail); // Add a recipient
|
||||
$mail->addBCC($csmail3);
|
||||
$mail->addBCC('info@acscreativesolutions.com');
|
||||
|
||||
$mail->Subject = 'Nuovo Utente';
|
||||
$mail->Body = "Ciao! E' stato inserito un nuovo Utente $emailuser ";
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
|
||||
$mail->send();
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>CIMAC Application Form</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
|
||||
<meta content="" name="author" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="../assets/images/favicon.ico">
|
||||
|
||||
<!-- 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" />
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body class="account-body accountbg">
|
||||
|
||||
<!-- Log In page -->
|
||||
<div class="container-fluid">
|
||||
<div class="row vh-100 ">
|
||||
<div class="col-12 align-self-center">
|
||||
<div class="auth-pagea">
|
||||
<div class="card auth-card shadow-lg" style="max-width: 800px; width: 100%; margin: 0 auto;">
|
||||
|
||||
<div class="card-body">
|
||||
<div class="px-3">
|
||||
<div>
|
||||
<a href="https://www.cimac.it/modulo_certificazione/public/login" class="logo logo-admin"><img src="assets/img/cimac-logo.png" height="55" alt="logo" class="auth-logo"></a>
|
||||
</div><!--end auth-logo-box-->
|
||||
|
||||
<div class="text-center auth-logo-text">
|
||||
<h4 class="mt-0 mb-3 mt-5">REGISTRAZIONE PIATTAFORMA PPEASY<br>REGISTRATION PPEASY PLATFORM</h4>
|
||||
|
||||
</div> <!--end auth-logo-text-->
|
||||
|
||||
<?php if (isset($varmailrepeat)) { ?>
|
||||
<div class="alert icon-custom-alert alert-outline-pink b-round fade show" role="alert">
|
||||
<i class="mdi mdi-alert-outline alert-icon"></i>
|
||||
<div class="alert-text">
|
||||
<strong>Email già presente nel database.
|
||||
</div>
|
||||
|
||||
<div class="alert-close">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true"><i class="mdi mdi-close text-danger"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
</div><?php } ?>
|
||||
|
||||
<?php if (isset($inserttrue)) { ?>
|
||||
<div class="alert icon-custom-alert alert-outline-success alert-success-shadow" role="alert">
|
||||
<i class="mdi mdi-check-all alert-icon"></i>
|
||||
<div class="alert-text">
|
||||
<strong>Ben fatto!</strong> Utente creato con successo.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<p>Presto riceverai una mail per impostare la tua prima password e poi potrai procedere con l'uso del portale!</p><br>
|
||||
<p>Soon you will receive an email in order to setup your first password and then you can start to use the portal!</p><br>
|
||||
<?php } ?>
|
||||
<?php if (!isset($inserttrue)) { ?>
|
||||
<form class="form-horizontal auth-form my-4" action="auth-creation.php" method="post" name="usernew" onsubmit="return validateForm();">
|
||||
<?php $nowtime = date("Y-m-d G:i:s"); ?>
|
||||
<div class="form-group">
|
||||
<label for="useremail">Nome/Name</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-user"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="first_name" name="first_name" placeholder="Nome/Name" required>
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group">
|
||||
<label for="useremail">Cognome / Surname</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-user"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="last_name" name="last_name" placeholder="Cognome / Surname" required>
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group">
|
||||
<label for="useremail">Email</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-mail"></i>
|
||||
</span>
|
||||
<input type="email" class="form-control" id="emailuser" name="emailuser" placeholder="Email" required>
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group">
|
||||
<label for="useremail">Ragione sociale azienda / Company Name</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-briefcase"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="company_name" name="company_name" placeholder="Ragione sociale azienda / Company Name" required>
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group">
|
||||
<label for="useremail">P.IVA azienda / Vat Number or ID Tax Number</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-id"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="vat_number" name="vat_number" placeholder="P.IVA azienda / Vat Number or ID Tax Number" required>
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="col-md-8 mb-8">
|
||||
<label for="exampleFormControlSelect1">Lingua / Language</label>
|
||||
<select class="form-control" id="language" name="language" required>
|
||||
<option value="1">Italiano</option>
|
||||
<option value="2">English</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="status" name="status" value="Active">
|
||||
<input type="hidden" id="role_id" name="role_id" value="2">
|
||||
<input type="hidden" id="adduser" name="adduser" value="Y">
|
||||
<input type="hidden" id="datein" name="datein" value="<?php echo $nowtime; ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-4">
|
||||
<div class="col-sm-12">
|
||||
<div class="custom-control custom-switch switch-success">
|
||||
<input type="checkbox" class="custom-control-input" id="terms_accepted" name="terms_accepted" onchange="checkAcceptance()">
|
||||
<label class="custom-control-label" for="terms_accepted">Registrandoti accetti i termini e le condizioni d’uso della piattaforma PPEASY <a href="terminiecondizioni.php" target="_blank"><u>qui presenti</u></a> / By registering you agree to <a href="termsandconditions.php" target="_blank"><u>these terms and conditions</u></a> of use of the PPEASY platform </label>
|
||||
</div>
|
||||
<div class="custom-control custom-switch switch-success">
|
||||
<input type="checkbox" class="custom-control-input" id="privacy_accepted" name="privacy_accepted" onchange="checkAcceptance()">
|
||||
<label class="custom-control-label" for="privacy_accepted">Dichiaro di aver letto e compreso l’informativa sui dati personali <a href="regolamentoprivacy.php" target="_blank"><u>qui presente</u></a>. Tratteremo i tuoi dati in conformità con la privacy policy di CIMAC / I declare that I have read and understood the information on <a href="privacydoc.php" target="_blank"><u>personal data herein</u></a>. We will handle your data in conformity with CIMAC privacy policy</label>
|
||||
</div>
|
||||
</div><!--end col-->
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group mb-0 row">
|
||||
<div class="col-12 mt-2">
|
||||
<button class="btn btn-round btn-block" type="submit" id="registerButton" disabled style="background-color: #f5f5f5; color: #333333;">Registrati / Register <i class="fas fa-sign-in-alt ml-1"></i></button>
|
||||
</div><!--end col-->
|
||||
</div> <!--end form-group-->
|
||||
</form><?php } ?><!--end form-->
|
||||
</div><!--end /div-->
|
||||
|
||||
<div class="m-3 text-center text-muted">
|
||||
<p class="">Hai già un account? / Already have an account ? <a href="login" class="text-primary ml-2">Log in</a></p>
|
||||
</div>
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
</div><!--end auth-card-->
|
||||
</div><!--end col-->
|
||||
</div><!--end row-->
|
||||
</div><!--end container-->
|
||||
<!-- End Log In page -->
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="assets/js/jquery.min.js"></script>
|
||||
<script src="assets/js/jquery-ui.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>
|
||||
|
||||
<!-- App js -->
|
||||
<script src="../assets/js/app.js"></script>
|
||||
|
||||
<script>
|
||||
function validateForm() {
|
||||
var termsAccepted = document.getElementById("terms_accepted").checked;
|
||||
var privacyAccepted = document.getElementById("privacy_accepted").checked;
|
||||
if (!termsAccepted || !privacyAccepted) {
|
||||
alert("Devi accettare i Termini di Uso e la Privacy Policy per registrarti / You must accept the Terms of Use and Privacy Policy to register.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function checkAcceptance() {
|
||||
var termsAccepted = document.getElementById("terms_accepted").checked;
|
||||
var privacyAccepted = document.getElementById("privacy_accepted").checked;
|
||||
var registerButton = document.getElementById("registerButton");
|
||||
if (termsAccepted && privacyAccepted) {
|
||||
registerButton.disabled = false;
|
||||
registerButton.className = "btn btn-gradient-primary btn-round btn-block waves-effect waves-light";
|
||||
registerButton.style.backgroundColor = "";
|
||||
registerButton.style.color = "";
|
||||
} else {
|
||||
registerButton.disabled = true;
|
||||
registerButton.className = "btn btn-round btn-block";
|
||||
registerButton.style.backgroundColor = "#f5f5f5";
|
||||
registerButton.style.color = "#333333";
|
||||
}
|
||||
}
|
||||
|
||||
// Initial check on page load
|
||||
window.onload = checkAcceptance;
|
||||
</script>
|
||||
|
||||
<!-- Cookie Banner -->
|
||||
<div id="cookie-banner" style="position: fixed; bottom: 0; width: 100%; background: #333; color: #fff; padding: 15px; text-align: center; z-index: 1000; font-family: Arial, sans-serif;">
|
||||
<div id="cookie-text">
|
||||
<p>
|
||||
Questo sito utilizza esclusivamente cookie tecnici per garantire funzionalità essenziali (come login e sicurezza).
|
||||
<a href="cookie-policy-it.php" target="_blank" style="color: #fff; text-decoration: underline; margin-left: 5px;">Scopri di più</a>
|
||||
</p>
|
||||
<p>
|
||||
This site uses only technical cookies to ensure essential features (such as login and security).
|
||||
<a href="cookie-policy-en.php" target="_blank" style="color: #fff; text-decoration: underline; margin-left: 5px;">Learn more</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button onclick="closeBanner()" style="background: #28a745; color: #fff; border: none; padding: 8px 16px; margin: 5px; cursor: pointer;">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function closeBanner() {
|
||||
document.getElementById('cookie-banner').style.display = 'none';
|
||||
localStorage.setItem('cookiesAcknowledged', 'true');
|
||||
}
|
||||
|
||||
// Nasconde il banner se l'utente ha già chiuso
|
||||
window.onload = function() {
|
||||
if (localStorage.getItem('cookiesAcknowledged')) {
|
||||
document.getElementById('cookie-banner').style.display = 'none';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
25
public/back.php
Normal file
@ -0,0 +1,25 @@
|
||||
<style>
|
||||
body {
|
||||
content: "";
|
||||
position: fixed;
|
||||
top: 0%;
|
||||
/* Mantiene uno spazio verticale uniforme */
|
||||
left: 0%;
|
||||
width: 100%;
|
||||
/* Riduce la larghezza al 80% dello schermo */
|
||||
height: 100%;
|
||||
/* Riduce l'altezza al 80% dello schermo */
|
||||
background-color: white;
|
||||
/* Sfondo bianco */
|
||||
background-image: url('assets/images/xcimac.png');
|
||||
/* Percorso del logo */
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: 35%;
|
||||
/* Mantiene le proporzioni del logo */
|
||||
|
||||
/* Imposta la trasparenza del logo */
|
||||
z-index: -1;
|
||||
/* Assicura che il logo rimanga sotto i contenuti */
|
||||
}
|
||||
</style>
|
||||
@ -1,23 +0,0 @@
|
||||
<?php
|
||||
require_once('../Connections/cmctrfdb.php');
|
||||
require_once('../webassist/mysqli/rsobj.php');
|
||||
|
||||
if (isset($_GET['idtd']) && !empty($_GET['idtd'])) {
|
||||
$idtd = $_GET['idtd'];
|
||||
|
||||
// Query per aggiornare statustd a "Revision" e impostare signnametd e signedontd a NULL
|
||||
$updateSQL = "UPDATE data_td SET statustd = 'Revision', signnametd = NULL, signedontd = NULL WHERE iddata_td = ?";
|
||||
|
||||
$stmt = $cmctrfdb->prepare($updateSQL);
|
||||
$stmt->bind_param("i", $idtd);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
// Reindirizza a cstd.php senza variabili
|
||||
header("Location: cstd.php");
|
||||
exit();
|
||||
} else {
|
||||
// Reindirizza a cstd.php in caso di ID non valido
|
||||
header("Location: cstd.php");
|
||||
exit();
|
||||
}
|
||||
@ -1,826 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf = $_GET["idtrf"];
|
||||
}
|
||||
if (isset($_GET["codestep"])) {
|
||||
$code = "8";
|
||||
$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");
|
||||
?>
|
||||
<?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(); ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?php echo $titlepage; ?> </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="<?php echo $ownercompanyname; ?> 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" />
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
<!-- upload image script -->
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".upload-doc").click(function() {
|
||||
$(".form-horizontal").ajaxForm({
|
||||
target: '.preview'
|
||||
}).submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<style>
|
||||
/* Add this CSS to your styles */
|
||||
.custom-file-upload {
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
cursor: pointer;
|
||||
background: #28a745;
|
||||
color: white;
|
||||
border-radius: 0.25rem;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.file-name-display {
|
||||
border: 1px solid #ccc;
|
||||
padding: 6px 12px;
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
min-width: 120px;
|
||||
margin-right: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.upload-div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
</style>
|
||||
</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);"><?php echo $titlepage; ?></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: 95%;" aria-valuenow="95" aria-valuemin="0" aria-valuemax="100">95%</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php // photos
|
||||
?>
|
||||
|
||||
<?php if (($trfnumberfinal->getColumnVal("idcertification") != '5') and ($trfnumberfinal->getColumnVal("idcertification") != '6')) { ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0"><?php echo $addphotosdoc; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i>
|
||||
<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>Foto frontale e laterale
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</h4>
|
||||
|
||||
<p class="text-muted mb-3"><?php echo $allowedkind; ?></p>
|
||||
|
||||
|
||||
<table id="photoaded">
|
||||
<tr>
|
||||
<?php
|
||||
$photoshoesside = "";
|
||||
$photoshoessole = "";
|
||||
|
||||
if ($trfnumberfinal->getColumnVal("idarticletype") == '1') {
|
||||
$photo1 = $photoshoesside;
|
||||
$photo2 = $photoshoessole;
|
||||
} elseif ($trfnumberfinal->getColumnVal("idarticletype") == '2') {
|
||||
$photo1 = $photogloveup;
|
||||
$photo2 = $photoglovebottom;
|
||||
} elseif ($trfnumberfinal->getColumnVal("idarticletype") == '3') {
|
||||
$photo1 = $photomasksidea;
|
||||
$photo2 = $photomasksideb;
|
||||
} ?>
|
||||
<th><?php echo $photo1; ?></th>
|
||||
<th></th>
|
||||
<th><?php echo $photo2; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<form id="uploadFormphoto" enctype="multipart/form-data">
|
||||
<label for="fileInput1" class="custom-file-upload"><?php echo $browsebotton; ?></label>
|
||||
<div class="file-name-display" onclick="document.getElementById('fileInput1').click();"><?php echo $nofilechoosen; ?></div>
|
||||
<input type="file" name="docphotoone[]" id="fileInput1" style="display: none;" onchange="updateFileName(1)">
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo $trfnumberfinal->getColumnVal("idtrfdetails"); ?>">
|
||||
<input type="submit" name="submit" value="UPLOAD" />
|
||||
</form>
|
||||
<!-- Display upload status -->
|
||||
<div id="uploadStatus1"></div>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<form id="uploadFormphototwo" enctype="multipart/form-data">
|
||||
<label for="fileInput2" class="custom-file-upload"><?php echo $browsebotton; ?></label>
|
||||
<div class="file-name-display" onclick="document.getElementById('fileInput2').click();"><?php echo $nofilechoosen; ?></div>
|
||||
<input type="file" name="docphototwo[]" id="fileInput2" style="display: none;" onchange="updateFileName(2)">
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo $trfnumberfinal->getColumnVal("idtrfdetails"); ?>">
|
||||
<input type="submit" name="submit" value="UPLOAD" />
|
||||
</form>
|
||||
<!-- Display upload status -->
|
||||
<div id="uploadStatus2"></div>
|
||||
</div>
|
||||
<script>
|
||||
// Add this script to handle the filename display
|
||||
function updateFileName(index) {
|
||||
var input = document.getElementById('fileInput' + index);
|
||||
var fileNameDisplay = document.querySelector('.upload-div #uploadStatus' + index);
|
||||
fileNameDisplay.textContent = input.files[0].name || 'No file chosen';
|
||||
}
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="cont_photoone">
|
||||
<?php if (!empty($trfnumberfinal->getColumnVal("photoone"))) { ?>
|
||||
<img src="uploaddocuments/<?php echo ($trfnumberfinal->getColumnVal("photoone")); ?>" height="200" alt="" />
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td id="cont_phototwo">
|
||||
|
||||
<?php if (!empty($trfnumberfinal->getColumnVal("phototwo"))) { ?>
|
||||
|
||||
<img src="uploaddocuments/<?php echo ($trfnumberfinal->getColumnVal("phototwo")); ?>" height="200" alt="" />
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card--><?php } ?>
|
||||
|
||||
|
||||
|
||||
<?php // documents
|
||||
?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0"><?php echo $adddoctitle; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i>
|
||||
<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($documenthelp); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</h4>
|
||||
<?php if ($idcert != 5) { ?>
|
||||
<p class="text-muted mb-3"><?php echo $adddoctitle_help; ?></p>
|
||||
<?php } else { ?>
|
||||
<p class="text-muted mb-3"><?php echo $auditdocumenttitle; ?></p>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<form id="uploadForm" enctype="multipart/form-data">
|
||||
<div class="form-group row">
|
||||
<label for="validationTooltip01" class="col-sm-5 col-form-label"><?php echo $filedescription; ?></label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="validationTooltip01" name="filedescription" placeholder="<?php echo $filedescription; ?>" required="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label"><?php echo $selectfileonyourpc; ?></label>
|
||||
<div class="col-sm-8">
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" id="fileInput" name="doc[]" onchange="document.getElementById('fileInputLabel').innerHTML = document.getElementById('fileInput').files[0].name">
|
||||
<label class="custom-file-label" for="fileInput" id="fileInputLabel"><?php echo $nofilechoosen; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo $trfnumberfinal->getColumnVal("idtrfdetails"); ?>">
|
||||
<input type="submit" class="btn btn-primary" name="submit" value="UPLOAD" />
|
||||
</form>
|
||||
|
||||
<script>
|
||||
// Assicurati che questo script sia incluso dopo il form o prima della chiusura del tag body
|
||||
document.getElementById('fileInput').onchange = function() {
|
||||
// Verifica se un file è stato selezionato
|
||||
if (this.files && this.files.length > 0) {
|
||||
// Aggiorna il testo della label con il nome del file
|
||||
document.getElementById('fileInputLabel').innerHTML = this.files[0].name;
|
||||
} else {
|
||||
// Se non è stato selezionato nessun file, mostra il testo di default
|
||||
document.getElementById('fileInputLabel').innerHTML = '<?php echo $nofilechoosen; ?>';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Display upload status -->
|
||||
<div id="uploadStatus"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
<div class="card" id="provacla">
|
||||
|
||||
<?php
|
||||
$filenamelist = new WA_MySQLi_RS("filenamelist", $cmctrfdb, 0);
|
||||
$filenamelist->setQuery("SELECT * FROM fileattached WHERE fileattached.idtrfdetails='$idtrf'");
|
||||
$filenamelist->execute();
|
||||
?>
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $addeddoctitle; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $addeddoctitle_help; ?></p>
|
||||
|
||||
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
|
||||
<div class="table-responsive" id="docadded">
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $filenametitle; ?></th>
|
||||
<th><?php echo $filenamedesc; ?></th>
|
||||
|
||||
<th><?php echo $actiondel; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="cont_file">
|
||||
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$filenamelist->atEnd()) {
|
||||
$wa_startindex = $filenamelist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="uploaddocuments/<?php echo ($filenamelist->getColumnVal("filename_fileattached")); ?>" target="_blank"><?php echo $filesent; ?></a>
|
||||
</td>
|
||||
<td><?php echo ($filenamelist->getColumnVal("description_fileattached")); ?></td>
|
||||
|
||||
<td>
|
||||
|
||||
<a href="deleteaddedoc.php?idtrf=<?php echo $idtrf; ?>&idadddoc=<?php echo ($filenamelist->getColumnVal("idfileattached")); ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$filenamelist->moveNext();
|
||||
}
|
||||
$filenamelist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table><br>
|
||||
|
||||
<!--end /table-->
|
||||
</div><!--end /tableresponsive-->
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
|
||||
<div class="card" id="provaclaphoto">
|
||||
<?php
|
||||
$additionalphotoslist = new WA_MySQLi_RS("additionalphotoslist", $cmctrfdb, 0);
|
||||
$additionalphotoslist->setQuery("SELECT * FROM additionalphotos WHERE additionalphotos.idtrf='$idtrf'");
|
||||
$additionalphotoslist->execute();
|
||||
?>
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $addphotos; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $addphotossuggestion; ?></p>
|
||||
|
||||
<!-- Upload area -->
|
||||
<div class="upload-area" id="uploadfile">
|
||||
<div class="upload-icon">
|
||||
<i class="fas fa-cloud-upload-alt"></i>
|
||||
</div>
|
||||
<p><?php echo $addphotosup; ?></p>
|
||||
<input type="file" id="fileupload" multiple accept="image/*" style="display:none;">
|
||||
</div>
|
||||
<div id="thumbnail-container"></div>
|
||||
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<div class="card-body">
|
||||
<div class="table-responsive" id="docadded">
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $filenametitle; ?>-</th>
|
||||
|
||||
<th><?php echo $actiondel; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="cont_file_photo">
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$additionalphotoslist->atEnd()) {
|
||||
$wa_startindex = $additionalphotoslist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="uploadimages/<?php echo $additionalphotoslist->getColumnVal("filenameadditionalphotos"); ?>" target="_blank">
|
||||
<img src="uploadimages/<?php echo $additionalphotoslist->getColumnVal("filenameadditionalphotos"); ?>" class="thumbnail">
|
||||
</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="deleteaddephotos.php?idtrf=<?php echo $idtrf; ?>&idadditionalphotos=<?php echo $additionalphotoslist->getColumnVal("idadditionalphotos"); ?>">
|
||||
<i class="fas fa-trash-alt text-danger font-16"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$additionalphotoslist->moveNext();
|
||||
}
|
||||
$additionalphotoslist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table><br>
|
||||
<a href="trfoption.php?idtrf=<?php echo $idtrf; ?>&codestep=8"><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="window.location.href='identificationparts.php?idtrf=<?php echo $idtrf; ?>'"><?php echo $backstep; ?></button>
|
||||
<!--end /table-->
|
||||
</div><!--end /tableresponsive-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
|
||||
<style>
|
||||
.upload-area {
|
||||
border: 2px dashed #007bff;
|
||||
border-radius: 5px;
|
||||
background-color: #e9f7ff;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.upload-area:hover {
|
||||
background-color: #d4efff;
|
||||
}
|
||||
|
||||
.upload-icon {
|
||||
font-size: 50px;
|
||||
color: #007bff;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.thumbnail {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
margin: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
document.querySelector('.upload-area').addEventListener('click', function() {
|
||||
document.getElementById('fileupload').click();
|
||||
});
|
||||
|
||||
document.getElementById('fileupload').addEventListener('change', function(e) {
|
||||
const files = e.target.files;
|
||||
handleFiles(files);
|
||||
});
|
||||
|
||||
document.querySelector('.upload-area').addEventListener('dragover', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.style.backgroundColor = '#d4efff';
|
||||
});
|
||||
|
||||
document.querySelector('.upload-area').addEventListener('dragleave', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.style.backgroundColor = '#e9f7ff';
|
||||
});
|
||||
|
||||
document.querySelector('.upload-area').addEventListener('drop', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.style.backgroundColor = '#e9f7ff';
|
||||
const files = e.dataTransfer.files;
|
||||
handleFiles(files);
|
||||
});
|
||||
|
||||
function handleFiles(files) {
|
||||
const thumbnailContainer = document.getElementById('thumbnail-container');
|
||||
thumbnailContainer.innerHTML = ''; // Clear previous thumbnails
|
||||
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
const fileType = file.type.toLowerCase();
|
||||
const validImageTypes = ["image/jpeg", "image/png", "image/jpg"];
|
||||
|
||||
if (!validImageTypes.includes(fileType)) {
|
||||
alert('Only JPG, JPEG, and PNG files are allowed.');
|
||||
continue;
|
||||
}
|
||||
|
||||
const reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
const img = document.createElement('img');
|
||||
img.src = e.target.result;
|
||||
img.classList.add('thumbnail');
|
||||
thumbnailContainer.appendChild(img);
|
||||
|
||||
setTimeout(() => {
|
||||
thumbnailContainer.removeChild(img);
|
||||
}, 3000);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append('idtrf', '<?php echo $idtrf; ?>'); // Pass idtrf from PHP to JS
|
||||
|
||||
fetch('uploadaddphotos.php', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
console.log('File uploaded successfully');
|
||||
updatePhotoTable();
|
||||
} else {
|
||||
console.error('File upload failed: ', data.message);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function updatePhotoTable() {
|
||||
fetch('getphotos.php?idtrf=<?php echo $idtrf; ?>')
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.text(); // Modifica per leggere come testo per il debug
|
||||
})
|
||||
.then(data => {
|
||||
console.log('Server response:', data); // Logga la risposta grezza del server
|
||||
try {
|
||||
let jsonData = JSON.parse(data); // Prova a fare il parsing della risposta come JSON
|
||||
if (jsonData.error) {
|
||||
throw new Error(jsonData.error); // Gestisce errori dal server
|
||||
}
|
||||
let html = '';
|
||||
jsonData.forEach(photo => {
|
||||
html += `<tr>
|
||||
<td><img src="uploadimages/${photo.filename}" class="thumbnail"></td>
|
||||
<td>${photo.description}</td>
|
||||
<td><a href="deleteaddephotos.php?idtrf=<?php echo $idtrf; ?>&idadditionalphotos=${photo.id}">
|
||||
<i class="fas fa-trash-alt text-danger font-16"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>`;
|
||||
});
|
||||
document.getElementById('cont_file_photo').innerHTML = html;
|
||||
} catch (e) {
|
||||
console.error('Error parsing JSON:', e, data); // Logga l'errore di parsing e la risposta
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Fetch error:', error); // Logga eventuali errori di fetch
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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 -->
|
||||
<script>
|
||||
var match = [
|
||||
"application/pdf",
|
||||
"application/msword", // per i file .doc
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document", // per i file .docx
|
||||
"image/jpg",
|
||||
"image/jpeg",
|
||||
"image/gif",
|
||||
"application/xls",
|
||||
"application/xlsx",
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
"application/vnd.ms-excel.sheet.macroEnabled.12",
|
||||
"image/png",
|
||||
"image/bmp"
|
||||
];
|
||||
$(document).ready(function() {
|
||||
// File upload via Ajax
|
||||
$("#uploadForm").on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'uploadfile.php',
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData: false,
|
||||
beforeSend: function() {
|
||||
$('#uploadStatus').html('<img src="../images/uploading.gif"/>');
|
||||
},
|
||||
error: function() {
|
||||
$('#uploadStatus').html('<span style="color:#EA4335;">File upload failed, please try again.<span>');
|
||||
},
|
||||
success: function(data) {
|
||||
$('#uploadForm')[0].reset();
|
||||
$('#uploadStatus').html('<span style="color:#28A74B;">File uploaded successfully.<span>');
|
||||
// $('.gallery').html(data);
|
||||
// $("#docadded").load(location.href + " #docadded");
|
||||
// SHOW UPLOADED FILE
|
||||
$('#cont_file').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// File type validation
|
||||
$("#fileInput").change(function() {
|
||||
var fileLength = this.files.length;
|
||||
// var match= ["application/pdf","application/msword","image/jpg","image/gif","application/xls","application/xlsx", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"];
|
||||
var i;
|
||||
for (i = 0; i < fileLength; i++) {
|
||||
var file = this.files[i];
|
||||
var imagefile = file.type;
|
||||
// if(!((imagefile==match[0]) || (imagefile==match[1]) || (imagefile==match[5]) || (imagefile==match[6]) || (imagefile==match[7]) || (imagefile==match[8]))){
|
||||
// alert('Please select a valid file (PDF, word, excel).');
|
||||
// $("#fileInput").val('');
|
||||
// return false;
|
||||
// }
|
||||
if (!match.includes(imagefile)) {
|
||||
alert('Please select a valid file (PDF, word, excel).');
|
||||
$("#fileInput").val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// File upload via Ajax
|
||||
$("#uploadFormphoto").on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'uploadphotofile.php',
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData: false,
|
||||
beforeSend: function() {
|
||||
$('#uploadStatus1').html('<img src="../images/uploading.gif"/>');
|
||||
},
|
||||
error: function() {
|
||||
$('#uploadStatus1').html('<span style="color:#EA4335;">File upload failed, please try again.<span>');
|
||||
},
|
||||
success: function(data) {
|
||||
$('#uploadFormphoto')[0].reset();
|
||||
$('#uploadStatus1').html('<span style="color:#28A74B;">File uploaded successfully.<span>');
|
||||
// $('.gallery').html(data);
|
||||
|
||||
// $("#photoaded").load(location.href + " #photoaded");
|
||||
// SHOW PHOTO 1
|
||||
$('#cont_photoone').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// File type validation
|
||||
$("#fileInput1").change(function() {
|
||||
var fileLength = this.files.length;
|
||||
// var match= ["application/pdf","application/msword","image/jpg","image/gif","application/xls","application/xlsx", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"];
|
||||
var i;
|
||||
for (i = 0; i < fileLength; i++) {
|
||||
var file = this.files[i];
|
||||
var imagefile = file.type.toLowerCase();
|
||||
if (!((imagefile == match[2]) || (imagefile == match[3]) || (imagefile == match[4]) || (imagefile == match[9]) || (imagefile == match[10]))) {
|
||||
alert('Please select a valid file (jpg, jpeg, png, bmp).');
|
||||
$("#fileInput1").val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// File upload via Ajax
|
||||
$("#uploadFormphototwo").on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'uploadphotofile2.php',
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData: false,
|
||||
beforeSend: function() {
|
||||
$('#uploadStatus2').html('<img src="../images/uploading.gif"/>');
|
||||
},
|
||||
error: function() {
|
||||
$('#uploadStatus2').html('<span style="color:#EA4335;">File upload failed, please try again.<span>');
|
||||
},
|
||||
success: function(data) {
|
||||
$('#uploadFormphototwo')[0].reset();
|
||||
$('#uploadStatus2').html('<span style="color:#28A74B;">File uploaded successfully.<span>');
|
||||
// $('.gallery').html(data);
|
||||
// $("#photoaded").load(location.href + " #photoaded");
|
||||
// SHOW PHOTO 2
|
||||
$('#cont_phototwo').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// File type validation
|
||||
$("#fileInput2").change(function() {
|
||||
var fileLength = this.files.length;
|
||||
// var match= ["application/pdf","application/msword","image/jpg","image/gif","application/xls","application/xlsx", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"];
|
||||
var i;
|
||||
for (i = 0; i < fileLength; i++) {
|
||||
var file = this.files[i];
|
||||
var imagefile = file.type.toLowerCase();
|
||||
if (!((imagefile == match[2]) || (imagefile == match[3]) || (imagefile == match[4]) || (imagefile == match[9]) || (imagefile == match[10]))) {
|
||||
alert('Please select a valid file (jpg, jpeg, png, bmp).');
|
||||
$("#fileInput2").val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- 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>
|
||||
@ -1,826 +0,0 @@
|
||||
<?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["materialpartvalue"])) {
|
||||
$materialpartvalue = $_POST["materialpartvalue"];
|
||||
} else {
|
||||
$materialpartvalue = "";
|
||||
}
|
||||
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["reportof"])) {
|
||||
$reportof = $_POST["reportof"];
|
||||
} else {
|
||||
$reportof = "";
|
||||
}
|
||||
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["arttypeid"])) {
|
||||
$arttypeid = $_POST["arttypeid"];
|
||||
} else {
|
||||
$arttypeid = "";
|
||||
}
|
||||
if (isset($_POST["partid"])) {
|
||||
$partid = $_POST["partid"];
|
||||
} else {
|
||||
$partid = "";
|
||||
}
|
||||
if (isset($_POST["useridn"])) {
|
||||
$useridn = $_POST["useridn"];
|
||||
} else {
|
||||
$useridn = "";
|
||||
}
|
||||
if (isset($_POST["companyidn"])) {
|
||||
$companyidn = $_POST["companyidn"];
|
||||
} else {
|
||||
$companyidn = "";
|
||||
}
|
||||
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("material_identificationparts", "s", "$materialpartvalue", "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("reportof", "s", "$reportof", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idtrfdetails", "i", "$idtrf", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("kindoftest", "s", "$kindoftest", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("partsidnumber", "i", "$partid", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("arttypeid", "i", "$arttypeid", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("useridn", "i", "$useridn", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("companyidn", "i", "$companyidn", "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' ORDER BY identificationparts.partsidnumber ");
|
||||
$listinsertedpart->execute();
|
||||
?>
|
||||
<?php
|
||||
// Definisci la variabile $conn come connessione al database
|
||||
$connpart = mysqli_connect($hostname_cmctrfdb, $username_cmctrfdb, $password_cmctrfdb, $database_cmctrfdb);
|
||||
// Esegui la query SQL per selezionare i dati
|
||||
$searchhighlightpart = "SELECT DISTINCT partsidnumber FROM identificationparts WHERE identificationparts.idtrfdetails='$idtrf'";
|
||||
$resultpart = mysqli_query($connpart, $searchhighlightpart);
|
||||
// Crea un array vuoto per contenere i dati
|
||||
//$partids = array();
|
||||
?>
|
||||
<?php
|
||||
// Scansiona i risultati della query e aggiungi i valori della colonna "partid" all'array
|
||||
while ($row = mysqli_fetch_assoc($resultpart)) {
|
||||
$partids[] = $row['partsidnumber'];
|
||||
}
|
||||
$partids[] = '0';
|
||||
// Stampa l'array per verificare i valori
|
||||
|
||||
?>
|
||||
<?php if ($idcertn == '2') {
|
||||
header("Location: adddocument.php?idtrf=$idtrf");
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?php echo $titlepage; ?>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" />
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10.16.6/dist/sweetalert2.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10.16.6/dist/sweetalert2.min.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>
|
||||
<style>
|
||||
input[data-readonly] {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
img[usemap] {
|
||||
border: none;
|
||||
height: auto;
|
||||
max-width: 90%;
|
||||
width: auto;
|
||||
}
|
||||
</style>
|
||||
</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);"><?php echo $titlepage; ?></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 $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 $whichkindofpart; ?></label>
|
||||
<select class="form-control" name="kindoftest" id="combo">
|
||||
<option value="new"><?php echo $newpartlist; ?></option>
|
||||
<option value="cmc"><?php echo $cmctesttitle; ?></option>
|
||||
<option value="trd"><?php echo $trdpartlist; ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="validationServer01"><?php echo $reportnumbercmctitle; ?></label>
|
||||
<input type="text" required="" class="form-control is-valid" id="cmcreportnumber" name="cmcreportnumber" placeholder="<?php echo $reportnumbercmctitle; ?>" disabled>
|
||||
</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="" onkeydown="return false" class="form-control" id="cmcdatereport" name="cmcdatereport" onchange="validateDate(this.value)" min="2000-01-01" max="<?php echo $todaydate; ?>" disabled 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; ?>" value="<?php echo $companyData["companyname_company"]; ?>" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-3 mb-2">
|
||||
<label for="validationServer01"><?php echo $descriptionpart; ?> </label>
|
||||
|
||||
<input type="text" required data-readonly class="form-control is-valid" id="descriptionpartvalue" name="descriptionpartvalue" placeholder="<?php echo $descriptionpart; ?>">
|
||||
<b>Att </b><i><?php echo $addpartphoto; ?></i>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-3 mb-2">
|
||||
<label for="validationServer02"><?php echo $articlepart; ?></label>
|
||||
<i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i>
|
||||
<input type="text" class="form-control is-valid" id="articlepartvalue" name="articlepartvalue" required placeholder="<?php echo $articlepart; ?>" required="">
|
||||
<b>Ex: </b><i><?php echo $searchsentence; ?></i>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="partid" name="partid">
|
||||
<input type="hidden" id="arttypeid" name="arttypeid" value="<?php echo $idarticletype; ?>">
|
||||
<input type="hidden" id="useridn" name="useridn" value="<?php echo $iduserlog; ?>">
|
||||
<input type="hidden" id="companyidn" name="companyidn" value="<?php echo $idcompany; ?>">
|
||||
<div class="col-md-3 mb-2">
|
||||
<label for="validationServer01"><?php echo $descriptionitem; ?> </label>
|
||||
<i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i>
|
||||
<input type="text" class="form-control is-valid" id="materialpartvalue" name="materialpartvalue" required placeholder="<?php echo $descriptionitem; ?>" required="">
|
||||
</div>
|
||||
<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 $articlealert; ?><br><br>
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<div class="col-md-3 mb-2">
|
||||
<label for="validationServerUsername"><?php echo $colorpart; ?></label>
|
||||
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
</div>
|
||||
<input id="colorvalue" name="colorvalue" required 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="addpart" id="addpart" value="Y">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="display"></div>
|
||||
<!-- <input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $addpartbutton; ?>"> -->
|
||||
<input type="submit" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $addpartbutton; ?>">
|
||||
</form>
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
</div>
|
||||
|
||||
<!-- end -->
|
||||
<script>
|
||||
function formSubmit2() {
|
||||
document.forms["myFormtwo"].submit();
|
||||
}
|
||||
</script>
|
||||
<!-- div CMC parts -->
|
||||
|
||||
<!--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; ?><br>
|
||||
new=<?php echo $newpartlist; ?>, cmc=<?php echo $cmctesttitle; ?> trd=<?php echo $trdpartlist; ?>
|
||||
</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">SN</th>
|
||||
<th class="sorting_asc" tabindex="0" aria-controls="datatable" rowspan="1" colspan="1" style="width: 5%" aria-sort="ascending" aria-label="Name: activate to sort column descending">
|
||||
N.
|
||||
</th>
|
||||
<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">
|
||||
Parte
|
||||
</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: 108px" aria-label="Office: activate to sort column ascending">
|
||||
Descrizione
|
||||
</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 text-center" 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 class="tr_<?php echo $listinsertedpart->getColumnVal("partsidnumber"); ?>">
|
||||
<!-- IDENTIFIER -->
|
||||
<td><?php echo $listinsertedpart->getColumnVal("partsidnumber"); ?>_<?php echo $listinsertedpart->getColumnVal("ididentificationparts"); ?></td>
|
||||
|
||||
<td>
|
||||
<?php echo $listinsertedpart->getColumnVal("partsidnumber"); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if (($listinsertedpart->getColumnVal("kindoftest")) == 'new') {
|
||||
echo $newpartlist;
|
||||
}
|
||||
if (($listinsertedpart->getColumnVal("kindoftest")) == 'cmc') {
|
||||
echo $cmcpartlist;
|
||||
}
|
||||
if (($listinsertedpart->getColumnVal("kindoftest")) == 'trd') {
|
||||
echo $trdpartlist;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo $listinsertedpart->getColumnVal("description_identificationparts"); ?></td>
|
||||
<td><?php echo $listinsertedpart->getColumnVal("article_identificationparts"); ?></td>
|
||||
<td><?php echo $listinsertedpart->getColumnVal("material_identificationparts"); ?></td>
|
||||
<td><?php echo $listinsertedpart->getColumnVal("color_identificationparts"); ?></td>
|
||||
<td><?php echo $listinsertedpart->getColumnVal("cmcreportnumber_identificationparts"); ?></td>
|
||||
<td id="td_reportdate_<?php echo $listinsertedpart->getColumnVal("partsidnumber"); ?>_<?php echo $listinsertedpart->getColumnVal("ididentificationparts"); ?>" parts-id-no="<?php echo $listinsertedpart->getColumnVal("partsidnumber"); ?>" current-val="<?php echo ($listinsertedpart->getColumnVal("cmcreportdate_identificationparts") <> '') ? date("m/d/Y", strtotime($listinsertedpart->getColumnVal("cmcreportdate_identificationparts"))) : ""; ?>"><?php echo ($listinsertedpart->getColumnVal("cmcreportdate_identificationparts") <> '') ? date("m/d/Y", strtotime($listinsertedpart->getColumnVal("cmcreportdate_identificationparts"))) : ''; ?></td>
|
||||
<!-- <td class="text-center">
|
||||
<a style="display:none; cursor:pointer;" title="Save" id="btn_save_<?php echo $listinsertedpart->getColumnVal("partsidnumber"); ?>" onclick="highlight_row(<?php echo $listinsertedpart->getColumnVal('partsidnumber'); ?>);"><i class="fas fa-check text-success font-16"></i></a>
|
||||
|
||||
<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>
|
||||
<!-- <tr role="row" class="odd">
|
||||
<td tabindex="0" class="sorting_1" style="width:5%">
|
||||
<span class="text-x"><?php echo ($listinsertedpart->getColumnVal("partsidnumber")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="text" class="form-control" name="partsidnumber" value="<?php echo ($listinsertedpart->getColumnVal("partsidnumber")); ?>">
|
||||
</span>
|
||||
</td>
|
||||
<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="">
|
||||
<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("material_identificationparts")); ?></span>
|
||||
<span class="input-x hidden-x">
|
||||
<input type="text" class="form-control" name="material_identificationparts" value="<?php echo ($listinsertedpart->getColumnVal("material_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="input-x hidden-x">
|
||||
|
||||
</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>
|
||||
|
||||
<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>
|
||||
|
||||
<?php
|
||||
// for shoes
|
||||
// Define the mandatory parts
|
||||
$mandatoryParts = array();
|
||||
if ($idarticletype == '1') {
|
||||
$mandatoryParts = array(4, 11);
|
||||
$totalparthighlight = array(1, 2, 4, 5, 7, 8, 10, 11, 12, 13, 14, 15, 16, 18, 19);
|
||||
} elseif ($idarticletype == '2') {
|
||||
$mandatoryParts = array(2, 3);
|
||||
$totalparthighlight = array(2, 3, 4);
|
||||
} elseif ($idarticletype == '3') {
|
||||
$totalparthighlight = array(1, 2, 3, 4, 5, 6);
|
||||
}
|
||||
|
||||
$diffparts = array_diff($totalparthighlight, $partids);
|
||||
$missingMandatoryParts = array_intersect($mandatoryParts, $diffparts);
|
||||
|
||||
echo '<button onclick="checkParts()" class="btn btn-success waves-effect waves-light">' . $nextsteptitle . '</button>';
|
||||
|
||||
echo '<script>
|
||||
function checkParts() {
|
||||
var missingMandatoryParts = ' . json_encode(array_values($missingMandatoryParts)) . ';
|
||||
var missingParts = ' . json_encode(array_values($diffparts)) . ';
|
||||
|
||||
if (missingMandatoryParts.length > 0) {
|
||||
Swal.fire({
|
||||
icon: "error",
|
||||
title: "Parti Obbligatorie Mancanti",
|
||||
text: "Le seguenti parti sono obbligatorie e devono essere inserite: " + missingMandatoryParts.join(", "),
|
||||
confirmButtonText: "OK"
|
||||
});
|
||||
} else if (missingParts.length > 0) {
|
||||
Swal.fire({
|
||||
icon: "warning",
|
||||
title: "' . $titlealertstd . '",
|
||||
text: "' . $partsnotfound . ' " + missingParts.join(", "),
|
||||
confirmButtonText: "' . $confirmButtonTextalertstd . '",
|
||||
showCancelButton: true,
|
||||
cancelButtonText: "' . $cancelButtonTextalertstd . '"
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = "adddocument.php?idtrf=' . $idtrf . '&codestep=7";
|
||||
} else if (result.dismiss === Swal.close) {
|
||||
alert("' . $cancelButtonTextalertstd . '");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
window.location.href = "adddocument.php?idtrf=' . $idtrf . '&codestep=7";
|
||||
}
|
||||
}
|
||||
</script>';
|
||||
?>
|
||||
|
||||
<button type="button" class="btn btn-dark waves-effect waves-light" onclick="window.location.href='identificationparts.php?idtrf=<?php echo $idtrf; ?>'"><?php echo $backstep; ?></button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title end breadcrumb -->
|
||||
</div>
|
||||
<!-- container -->
|
||||
<!-- footer start -->
|
||||
|
||||
</div>
|
||||
<!-- end page content -->
|
||||
</div>
|
||||
<?php include('include/footer.php'); ?>
|
||||
</footer><!--end footer-->
|
||||
</div>
|
||||
<!-- end page content -->
|
||||
</div>
|
||||
<!-- end page-wrapper -->
|
||||
<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; ?>');
|
||||
window.location.reload();
|
||||
{
|
||||
$("#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="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>
|
||||
<!--image map library -->
|
||||
|
||||
<!-- <script> src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> -->
|
||||
<script src="mapsresize/jquery.rwdImageMaps.min.js"></script>
|
||||
<!-- 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>
|
||||
<script src="jquery.tabledit.js"></script>
|
||||
<script type="text/javascript">
|
||||
// Definisci l'oggetto JavaScript con le etichette da PHP
|
||||
var kindOfTestLabels = {
|
||||
'new': '<?php echo $newpartlist; ?>',
|
||||
'cmc': '<?php echo $cmctesttitle; ?>',
|
||||
'trd': '<?php echo $trdpartlist; ?>'
|
||||
};
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('img[usemap]').rwdImageMaps();
|
||||
$("#alertcertification").modal('show');
|
||||
/* TABLEDIT */
|
||||
$('#datatable').Tabledit({
|
||||
url: 'identificationparts-process.php',
|
||||
// editButton: false,
|
||||
// deleteButton: false,
|
||||
hideIdentifier: true,
|
||||
autoFocus: false,
|
||||
buttons: {
|
||||
edit: {
|
||||
class: 'btn btn-sm',
|
||||
html: '<i class="fas fa-pen text-primary font-12"></i>',
|
||||
action: 'edit'
|
||||
},
|
||||
// save: {
|
||||
// class: 'btn btn-sm',
|
||||
// html: '<i class="fas fa-check text-success font-12"></i>',
|
||||
// action: 'edit'
|
||||
// },
|
||||
delete: {
|
||||
class: 'btn btn-sm',
|
||||
html: '<i class="fas fa-trash-alt text-danger font-12"></i>',
|
||||
action: 'delete'
|
||||
}
|
||||
},
|
||||
columns: {
|
||||
identifier: [0, 'id'],
|
||||
editable: [
|
||||
[2, 'kindoftest', '{"new":"<?php echo $newpartlist; ?>", "cmc":"<?php echo $cmctesttitle; ?>", "trd":"<?php echo $trdpartlist; ?>"}'],
|
||||
[4, 'article_identificationparts'],
|
||||
[5, 'material_identificationparts'],
|
||||
[6, 'color_identificationparts'],
|
||||
[7, 'cmcreportnumber_identificationparts'],
|
||||
[8, 'cmcreportdate_identificationparts']
|
||||
]
|
||||
},
|
||||
onSuccess: function(response) {
|
||||
if (response['status'] == 'error') {
|
||||
alert(response['message']);
|
||||
/* SHOW CURRENT DATE IN TD */
|
||||
$('#td_reportdate_' + response['id']).children('span').text($('#td_reportdate_' + response['id']).attr('current-val'));
|
||||
/* SHOW CURRENT DATE IN INPUT */
|
||||
$('#td_reportdate_' + response['id']).children('input').val($('#td_reportdate_' + response['id']).attr('current-val'));
|
||||
} else {
|
||||
/* SUCCESS */
|
||||
highlight_row(response['id']);
|
||||
}
|
||||
},
|
||||
onDraw: function() {
|
||||
// Select all inputs of report date column and apply datepicker each of them
|
||||
$('table tr td:nth-child(9) input').each(function() {
|
||||
$(this).datepicker({
|
||||
format: 'yy-mm-dd',
|
||||
todayHighlight: true,
|
||||
autoclose: true,
|
||||
changeMonth: true,
|
||||
|
||||
changeYear: true,
|
||||
// yearRange: "-5:+0",
|
||||
onSelect: function(date) {
|
||||
let td_cont_id = '#' + $(this).parent().attr('id');
|
||||
/* SHOW SELECTED DATE IN TD */
|
||||
$(td_cont_id).children('span').text($(this).val());
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function highlight_row(id) {
|
||||
/* HIGHLIGHT TR */
|
||||
let trID = ".tr_" + id;
|
||||
let defBGColor = $(trID).css("background-color");
|
||||
let defTxtColor = $(trID).css("color");
|
||||
setTimeout(function() {
|
||||
/* REVERT TO DEFAULT BG */
|
||||
$(trID).css({
|
||||
'background-color': '#228B22',
|
||||
'color': '#F0F8FF'
|
||||
});
|
||||
$(trID).fadeOut(300, function() {
|
||||
$(trID).css({
|
||||
'background-color': defBGColor,
|
||||
'color': defTxtColor
|
||||
})
|
||||
}).fadeIn(100);
|
||||
}, 200);
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
$(document).on('change', '#combo', function() {
|
||||
var shouldEnable = $(this).val() === 'new';
|
||||
$('#cmcreportnumber').prop('disabled', shouldEnable);
|
||||
$('#reportof').prop('disabled', shouldEnable);
|
||||
$('#cmcdatereport').prop('disabled', shouldEnable);
|
||||
}
|
||||
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,890 +0,0 @@
|
||||
<?php require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
|
||||
<?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["rangemeasuremintext"])) {
|
||||
$rangemeasuremintext = $_POST["rangemeasuremintext"];
|
||||
}
|
||||
if (isset($_POST["rangemeasuremaxtext"])) {
|
||||
$rangemeasuremaxtext = $_POST["rangemeasuremaxtext"];
|
||||
}
|
||||
if (isset($_POST["articletype"])) {
|
||||
$articletype = $_POST["articletype"];
|
||||
}
|
||||
if (isset($_POST["previousreportnumber"])) {
|
||||
$previousreportnumber = $_POST["previousreportnumber"];
|
||||
} else {
|
||||
$previousreportnumber = '';
|
||||
}
|
||||
if (isset($_POST["toextend"])) {
|
||||
$toextend = $_POST["toextend"];
|
||||
} else {
|
||||
$toextend = '';
|
||||
}
|
||||
if (isset($_POST["revisionfor"])) {
|
||||
$revisionfor = $_POST["revisionfor"];
|
||||
} else {
|
||||
$revisionfor = '';
|
||||
}
|
||||
if (isset($_POST["renewdate"])) {
|
||||
$renewdate = $_POST["renewdate"];
|
||||
} else {
|
||||
$renewdate = '';
|
||||
}
|
||||
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"];
|
||||
}
|
||||
|
||||
if (isset($articlecharacteristic)) {
|
||||
$listartchar = implode(',', $articlecharacteristic);
|
||||
} else {
|
||||
$listartchar = "";
|
||||
}
|
||||
|
||||
|
||||
//echo $listartchar;
|
||||
?>
|
||||
|
||||
<?php
|
||||
include('include/trfqueryscript.php'); ?>
|
||||
<?php if (isset($articlecharacteristic)) {
|
||||
|
||||
foreach ($articlecharacteristic as $ac) {
|
||||
|
||||
$stdfromartchar = new WA_MySQLi_RS("stdfromartchar", $cmctrfdb, 1);
|
||||
$stdfromartchar->setQuery("SELECT * FROM standards WHERE standards.idarticlecharacteristic='$ac'");
|
||||
$stdfromartchar->execute();
|
||||
$value = $stdfromartchar->getColumnVal("idstandards");
|
||||
$dpicatsel = $stdfromartchar->getColumnVal("iddpicategory");
|
||||
|
||||
//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();
|
||||
|
||||
// insert for glovces EN 420 if not present
|
||||
/* if ($articletype==2) {
|
||||
$stdcheckpresent420 = new WA_MySQLi_RS("stdcheckpresent420",$cmctrfdb,1);
|
||||
$stdcheckpresent420->setQuery("SELECT * FROM trfstandards WHERE trfstandards.idtrfdetails='$idtrf' AND trfstandards.idstandards='129'");
|
||||
$stdcheckpresent420->execute();
|
||||
if (empty($stdcheckpresent420->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", "129", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("iddpicategory", "i", "$dpicatsel", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}} */
|
||||
|
||||
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->bindColumn("iddpicategory", "i", "$dpicatsel", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
}
|
||||
} //}
|
||||
|
||||
|
||||
?>
|
||||
<?php
|
||||
if (isset($formupdtrfdetails)) {
|
||||
|
||||
if ($articletype == '1' or $articletype == '2') {
|
||||
$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", "s", "$listartchar", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("registeredmark", "s", "$registeredmark", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("previousreportnumber", "s", "$previousreportnumber", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("toextend", "s", "$toextend", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("revisionfor", "s", "$revisionfor", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("renewdate", "s", "$renewdate", "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);
|
||||
} else {
|
||||
|
||||
$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", "$rangemeasuremintext", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("measureto", "s", "$rangemeasuremaxtext", "WA_DEFAULT");
|
||||
|
||||
$UpdateQuery->bindColumn("model", "s", "$model", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("idarticletype", "i", "$articletype", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("idarticle_characteristics", "s", "$listartchar", "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");
|
||||
$articlecharact = $trfnumberfinal->getColumnVal("idarticle_characteristics");
|
||||
?>
|
||||
<?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 all the standards of articletype
|
||||
// $stdcheck = new WA_MySQLi_RS("stdcheck",$cmctrfdb,0);
|
||||
// $stdcheck->setQuery("SELECT * FROM standards WHERE standards.idarticletype='$articletype'");
|
||||
// $stdcheck->execute();
|
||||
?>
|
||||
<?php // preselection based on article characteristic
|
||||
$stdcheck = new WA_MySQLi_RS("stdcheck", $cmctrfdb, 0);
|
||||
$stdcheck->setQuery("SELECT * FROM standards WHERE standards.idarticlecharacteristic='$articlecharact' ");
|
||||
$stdcheck->execute();
|
||||
$idstselect = $stdcheck->getColumnVal("idstandards");
|
||||
?>
|
||||
<?php // inline edit query
|
||||
$idtrfdetails = $idtrf;
|
||||
$row1 = mysqli_query($con, "SELECT *,trfstandards.iddpicategory as iddpicategoryid,trfstandards.idprotectioncategory as idprotectioncategoryid,trfstandards.idstandards as idstandardsid FROM trfstandards LEFT JOIN standards ON trfstandards.idstandards=standards.idstandards LEFT JOIN dpicategory ON trfstandards.iddpicategory=dpicategory.iddpicategory LEFT JOIN protectioncategory ON trfstandards.idprotectioncategory=protectioncategory.idprotectioncategory WHERE trfstandards.idtrfdetails='$idtrf'");
|
||||
//$rows = mysqli_fetch_assoc($row1);
|
||||
//print_r($rows);
|
||||
//exit;
|
||||
$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']]=utf8_encode($idprotectioncategoryrow['name_protectioncategory']);
|
||||
// }
|
||||
// $idprotectioncategoryJson=json_encode($idproteccategorylistRecord);
|
||||
|
||||
/* GET OPTIONS FOR Categoria di protezione per standard */
|
||||
$idprotectioncategoryJson = json_encode(array());
|
||||
$proteccategorylist = mysqli_query($con, "select s.idstandards, p.idprotectioncategory, p.name_protectioncategory
|
||||
from stdprotectioncat s
|
||||
left join protectioncategory p
|
||||
on s.idprotectioncategory = p.idprotectioncategory
|
||||
where 1");
|
||||
$idproteccategorylistRecord = array();
|
||||
while ($idprotectioncategoryrow = mysqli_fetch_assoc($proteccategorylist)) {
|
||||
$nameprotcat = html_entity_decode($idprotectioncategoryrow['name_protectioncategory']);
|
||||
$nameprotcat = iconv('UTF-8', 'windows-1252', $nameprotcat);
|
||||
$idproteccategorylistRecord[$idprotectioncategoryrow['idstandards']][$idprotectioncategoryrow['idprotectioncategory']] = utf8_encode(htmlspecialchars($nameprotcat, ENT_QUOTES));
|
||||
//utf8_encode(htmlspecialchars($idprotectioncategoryrow['name_protectioncategory']
|
||||
}
|
||||
$idprotectioncategoryperStdJson = json_encode($idproteccategorylistRecord);
|
||||
/* END GET OPTIONS FOR Categoria di protezione per standard */
|
||||
|
||||
// //Impermeabilità
|
||||
// //query list protectioncategory
|
||||
// $dpicategroylist=mysqli_query($con,"SELECT iddpicategory ,value_dpicategory FROM dpicategory");
|
||||
|
||||
// $iddpicategorylistRecord=array();
|
||||
// while($iddpicategoryrow = mysqli_fetch_assoc($dpicategroylist)) {
|
||||
// $iddpicategorylistRecord[$iddpicategoryrow['iddpicategory']]=utf8_encode($iddpicategoryrow['value_dpicategory']);
|
||||
// }
|
||||
// $iddpicategoryJson=json_encode($iddpicategorylistRecord);
|
||||
|
||||
/* GET OPTIONS FOR Categoria DPI per standard */
|
||||
$iddpicategoryJson = json_encode(array());
|
||||
$dpicategroylist = mysqli_query($con, "select s.idstandards, d.iddpicategory, d.value_dpicategory
|
||||
from stddpicategory s
|
||||
left join dpicategory d
|
||||
on s.iddpicategory = d.iddpicategory
|
||||
where 1");
|
||||
$iddpicategorylistRecord = array();
|
||||
while ($iddpicategoryrow = mysqli_fetch_assoc($dpicategroylist)) {
|
||||
$iddpicategorylistRecord[$iddpicategoryrow['idstandards']][$iddpicategoryrow['iddpicategory']] = utf8_encode(htmlspecialchars($iddpicategoryrow['value_dpicategory'], ENT_QUOTES));
|
||||
}
|
||||
$iddpicategoryperStdJson = json_encode($iddpicategorylistRecord);
|
||||
/* END GET OPTIONS FOR Categoria DPI per standard */
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?php echo $titlepage; ?> </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" />
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10.16.6/dist/sweetalert2.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10.16.6/dist/sweetalert2.min.js"></script>
|
||||
<!-- 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() {
|
||||
var articletype = <?php echo $articletype; ?>;
|
||||
populate_cat_tbl();
|
||||
|
||||
$("#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]), select").val(""); //wipe out the inputs.
|
||||
$(this).prop('disabled', true);
|
||||
$('select[name=idprotectioncategoryid]').prepend("<option value='' selected='selected'>Please Select</option>");
|
||||
$('select[name=iddpicategoryid]').prepend("<option value='' selected='selected'>Please Select</option>");
|
||||
});
|
||||
/*$('#example1').Tabledit({
|
||||
url: 'logic-edit-delete.php',
|
||||
columns: {
|
||||
identifier: [0, 'id'],
|
||||
editable: [[2, 'idprotectioncategory','<?php echo $idprotectioncategoryJson; ?>'], [3, 'iddpicategory','<?php echo $iddpicategoryJson; ?>']]
|
||||
},
|
||||
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);
|
||||
//location.reload();
|
||||
},
|
||||
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);
|
||||
}
|
||||
});*/
|
||||
|
||||
|
||||
});
|
||||
|
||||
function populate_cat_tbl() {
|
||||
// $.get('cat-table.php', {idtrf:'<?php echo $idtrf; ?>', standardcodetitle:'<?php echo $standardcodetitle ?>', protectioncategorytitle:'<?php echo $protectioncategorytitle; ?>', dpicategorytitle:'<?php echo $dpicategorytitle; ?>', pleaseselectstd:'<?php echo $pleaseselectstd; ?>'}, function(data){
|
||||
// $('#cat_table_cont').html(data);
|
||||
|
||||
// $('#example1').Tabledit({
|
||||
// url: 'logic-edit-delete.php',
|
||||
// autoFocus: true,
|
||||
// columns: {
|
||||
// identifier: [0, 'id'],
|
||||
// editable: [[2, 'idprotectioncategory','<?php echo $idprotectioncategoryJson; ?>'], [3, 'iddpicategory','<?php echo $iddpicategoryJson; ?>']]
|
||||
// },
|
||||
// editButton: false,
|
||||
// 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);
|
||||
// populate_cat_tbl();
|
||||
|
||||
// /* HIGHLIGHT TR */
|
||||
// let trID = "#"+data['id'];
|
||||
// let defBGColor = $(trID).css("background-color");
|
||||
// let defTxtColor = $(trID).css("color");
|
||||
|
||||
// setTimeout(function(){
|
||||
// $(trID).css({'background-color':'#228B22', 'color':'#F0F8FF'});
|
||||
// $(trID).fadeOut(300, function(){ $(trID).css({'background-color':defBGColor, 'color':defTxtColor}) }).fadeIn(100);
|
||||
// } ,200);
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "cat-table.php",
|
||||
cache: false,
|
||||
data: {
|
||||
"idtrf": "<?php echo $idtrf; ?>",
|
||||
"standardcodetitle": "<?php echo $standardcodetitle ?>",
|
||||
"protectioncategorytitle": "<?php echo $protectioncategorytitle; ?>",
|
||||
"dpicategorytitle": "<?php echo $dpicategorytitle; ?>",
|
||||
"pleaseselectstd": "<?php echo $pleaseselectstd; ?>"
|
||||
},
|
||||
success: function(result) {
|
||||
if (result != '') {
|
||||
/* POPULATE TABLE */
|
||||
$('#cat_table_cont').html(result);
|
||||
|
||||
/* INITIATE TABLEDIT */
|
||||
$('#example1').Tabledit({
|
||||
url: 'logic-edit-delete.php',
|
||||
autoFocus: true,
|
||||
columns: {
|
||||
identifier: [0, 'id'],
|
||||
editable: [
|
||||
[2, 'idprotectioncategory', '<?php echo $idprotectioncategoryJson; ?>'],
|
||||
[3, 'iddpicategory', '<?php echo $iddpicategoryJson; ?>']
|
||||
]
|
||||
},
|
||||
editButton: false,
|
||||
onSuccess: function(data, textStatus, jqXHR) {
|
||||
$("#add").prop('disabled', false);
|
||||
populate_cat_tbl();
|
||||
|
||||
/* HIGHLIGHT TR */
|
||||
let trID = "#" + data['id'];
|
||||
let defBGColor = $(trID).css("background-color");
|
||||
let defTxtColor = $(trID).css("color");
|
||||
|
||||
setTimeout(function() {
|
||||
$(trID).css({
|
||||
'background-color': '#228B22',
|
||||
'color': '#F0F8FF'
|
||||
});
|
||||
$(trID).fadeOut(300, function() {
|
||||
$(trID).css({
|
||||
'background-color': defBGColor,
|
||||
'color': defTxtColor
|
||||
})
|
||||
}).fadeIn(100);
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</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;
|
||||
}
|
||||
</style>
|
||||
</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);"><?php echo $titlepage; ?></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">
|
||||
<?php include('include/alertcheck.php'); ?>
|
||||
<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;
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
$stdcheck->moveNext();
|
||||
}
|
||||
$stdcheck->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</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>
|
||||
|
||||
<div class="table-responsive">
|
||||
<?php include('include/alertcheck.php'); ?>
|
||||
|
||||
<div id="cat_table_cont"></div>
|
||||
<!--<table class="table table-striped mb-0" id="example1" style="border:1px solide red">
|
||||
<tr><th style="display:none;">id</th><th><?php echo $standardcodetitle; ?></th><th><?php echo $protectioncategorytitle; ?></th><th><?php echo $dpicategorytitle; ?></th></tr>
|
||||
<?php while ($rowquery = mysqli_fetch_assoc($row1)) { ?>
|
||||
<tr>
|
||||
<td style="display:none;"><?php echo $rowquery['idtrfstandards']; ?></td>
|
||||
|
||||
<td><?php echo $rowquery['standardcode']; ?></td>
|
||||
<?php $nameprotcatrec = html_entity_decode($rowquery['name_protectioncategory']);
|
||||
//$nameprotcatrec=utf8_encode($nameprotcatrec);
|
||||
|
||||
//$nameprotcatrec = iconv('UTF-8', 'windows-1252', $nameprotcatrec);
|
||||
?>
|
||||
<td><?php if (isset($rowquery['name_protectioncategory'])) {
|
||||
echo $nameprotcatrec;
|
||||
} else { ?><p style="color:red;"><?php echo $pleaseselectstd;
|
||||
} ?></p></td>
|
||||
<td><?php if (isset($rowquery['value_dpicategory'])) {
|
||||
echo $rowquery['value_dpicategory'];
|
||||
} else {
|
||||
echo $pleaseselectstd;
|
||||
} ?></td>
|
||||
//echo $rowquery['name_protectioncategory']
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>-->
|
||||
|
||||
|
||||
<?php include('include/virusquerycheck.php'); ?><br>
|
||||
<?php
|
||||
if (isset($_GET['error']) && $_GET['error'] == "tuttiicampidevonoesserericompilati") {
|
||||
echo '<p style="color: red;">Attenzione: tutti i campi devono essere compilati.</p>';
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$conn = mysqli_connect($hostname_cmctrfdb, $username_cmctrfdb, $password_cmctrfdb, $database_cmctrfdb);
|
||||
if (!$conn) {
|
||||
die("Connessione al database fallita: " . mysqli_connect_error());
|
||||
}
|
||||
|
||||
// Controllo dei campi nulli
|
||||
|
||||
$sql = "SELECT COUNT(*) AS num_rows FROM trfstandards WHERE idtrfdetails = $idtrf AND (idprotectioncategory IS NULL OR iddpicategory IS NULL)";
|
||||
$resultcat = mysqli_query($conn, $sql);
|
||||
// Controllo degli errori
|
||||
if (!$resultcat) {
|
||||
die("Errore nella query: " . mysqli_error($conn));
|
||||
}
|
||||
$row = mysqli_fetch_assoc($resultcat);
|
||||
|
||||
// Campi nulli trovati, torna alla pagina standardstep.php e mostra il messaggio di errore
|
||||
echo '<button onclick="checkParts()" class="btn btn-success waves-effect waves-light">' . $nextsteptitle . '</button>';
|
||||
|
||||
if (($articletype == 1) || (!empty($virusstep))) {
|
||||
echo '<script>
|
||||
|
||||
function checkParts() {
|
||||
var isValid = true;
|
||||
$("select[name=idprotectioncategory]").each(function() {
|
||||
if ($(this).val() === "" || $(this).val() === "Seleziona" || $(this).parent("td").find("span").html() == "Please Select" || $(this).parent("td").find("span").html() == "Seleziona") {
|
||||
isValid = false;
|
||||
}
|
||||
});
|
||||
if (!isValid) {
|
||||
Swal.fire({
|
||||
icon: "warning",
|
||||
title: "Attenzione/Warning",
|
||||
text: "Devi selezionare la categoria di protezione / Please select Protection category!",
|
||||
confirmButtonText: "Conferma/Confirm",
|
||||
showCancelButton: false,
|
||||
}).then((result) => {
|
||||
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
icon: "warning",
|
||||
title: "' . $titlealertstd . '",
|
||||
text: "' . $textalertstd . '",
|
||||
confirmButtonText: "' . $confirmButtonTextalertstd . '",
|
||||
showCancelButton: true,
|
||||
cancelButtonText: "' . $cancelButtonTextalertstdandard . '"
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = "additionalinfo.php?idtrf=' . $idtrf . '&codestep=3";
|
||||
} else if (result.dismiss === Swal.close) {
|
||||
alert("' . $alertTextstd . '");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
</script>';
|
||||
} else {
|
||||
echo '<script>
|
||||
function checkParts() {
|
||||
var isValid = true;
|
||||
$("select[name=idprotectioncategory]").each(function() {
|
||||
if ($(this).val() === "" || $(this).val() === "Seleziona" || $(this).parent("td").find("span").html() == "Please Select" || $(this).parent("td").find("span").html() == "Seleziona") {
|
||||
isValid = false;
|
||||
}
|
||||
});
|
||||
if (!isValid) {
|
||||
Swal.fire({
|
||||
icon: "warning",
|
||||
title: "Warning",
|
||||
text: "Please select Protection category!",
|
||||
confirmButtonText: "Confirm",
|
||||
showCancelButton: false,
|
||||
}).then((result) => {
|
||||
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
icon: "warning",
|
||||
title: "' . $titlealertstd . '",
|
||||
text: "' . $textalertstd . '",
|
||||
confirmButtonText: "' . $confirmButtonTextalertstd . '",
|
||||
showCancelButton: true,
|
||||
cancelButtonText: "' . $cancelButtonTextalertstdandard . '"
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = "addrequirements.php?idtrf=' . $idtrf . '&codestep=3";
|
||||
} else if (result.dismiss === Swal.close) {
|
||||
alert("' . $alertTextstd . '");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<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>
|
||||
|
||||
<script>
|
||||
function getSelectOptions(standardId, selectName, currentValue) {
|
||||
let thisOptions = [];
|
||||
let totalOptionsCount = 0;
|
||||
|
||||
if (selectName == 'iddpicategory') {
|
||||
thisOptions = JSON.parse('<?php echo $iddpicategoryperStdJson; ?>'); /* GET LIST OF dpi category PER STANDARD */
|
||||
} else if (selectName == 'idprotectioncategory') {
|
||||
thisOptions = JSON.parse('<?php echo $idprotectioncategoryperStdJson; ?>'); /* GET LIST OF protection category PER STANDARD */
|
||||
}
|
||||
|
||||
totalOptionsCount = Object.keys(thisOptions[standardId]).length;
|
||||
|
||||
$("[name='" + selectName + "']").empty(); /* CLEAR SELECT OPTIONS */
|
||||
$("[name='" + selectName + "']").append('<option value=\'\'><?php echo $pleaseselectstd; ?></option>'); /* ADD EMPTY OPTION */
|
||||
|
||||
Object.keys(thisOptions[standardId]).forEach(function(key) {
|
||||
if (totalOptionsCount == 1) {
|
||||
/* IF SELECT HAS ONLY 1 OPTION, SET AS "SELECTED" */
|
||||
currentValue = key;
|
||||
$("[name='" + selectName + "']").empty(); /* REMOVE EMPTY OPTION */
|
||||
}
|
||||
|
||||
/* POPULATE SELECT OPTIONS BASED ON STANDARD*/
|
||||
if (currentValue == key) {
|
||||
$("[name='" + selectName + "']").append('<option value=' + key + ' selected=\'selected\'>' + thisOptions[standardId][key] + '</option>');
|
||||
} else {
|
||||
$("[name='" + selectName + "']").append('<option value=' + key + '>' + thisOptions[standardId][key] + '</option>');
|
||||
}
|
||||
});
|
||||
|
||||
if (totalOptionsCount == 1) {
|
||||
/* TRIGGER ONCHANGE EVENT */
|
||||
$("[name='" + selectName + "']").change();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
function checkProtectionCategory() {
|
||||
var isValid = true;
|
||||
$('select[name="idprotectioncategory"]').each(function() {
|
||||
if ($(this).val() === '' || $(this).find('option:selected').text() === 'Seleziona') {
|
||||
isValid = false;
|
||||
}
|
||||
});
|
||||
return isValid;
|
||||
}
|
||||
|
||||
$('#nextStepButton').click(function(e) {
|
||||
if (!checkProtectionCategory()) {
|
||||
Swal.fire({
|
||||
icon: "warning",
|
||||
title: "Devi selezionare una categoria di protezione",
|
||||
confirmButtonText: "OK"
|
||||
});
|
||||
e.preventDefault();
|
||||
} else {
|
||||
// proceed to next step
|
||||
window.location.href = "additionalinfo.php?idtrf=<?php echo $idtrf; ?>&codestep=3";
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,12 +0,0 @@
|
||||
#loading {
|
||||
/* (A1) COVER FULL PAGE */
|
||||
position: fixed;
|
||||
top: 0; left: 0; z-index: 999;
|
||||
width: 100vw; height: 100vh;
|
||||
|
||||
/* (A2) SPINNER IMAGE */
|
||||
background-color: black;
|
||||
background-image: url("ajax-loader.gif");
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
function loader (css, js) {
|
||||
// (A) TOTAL NUMBER OF SCRIPTS
|
||||
var total = css.length + js.length,
|
||||
now = 0, s;
|
||||
|
||||
// (B) READY?
|
||||
var ready = () => {
|
||||
now++;
|
||||
// if (now==total) { document.getElementById("loading").remove(); }
|
||||
|
||||
// FOR THIS DEMO ONLY.
|
||||
// PAGE LOAD IS SO FAST YOU WON'T EVEN SEE THE SPINNER.
|
||||
// SO WE DELAY IT BY 2 SECONDS.
|
||||
if (now==total) {
|
||||
window.setTimeout(()=>{
|
||||
document.getElementById("loading").remove();
|
||||
}, 2000);
|
||||
}
|
||||
};
|
||||
|
||||
// (C) INSERT <LINK> INTO <HEAD>
|
||||
css.forEach((url, i) => {
|
||||
s = document.createElement("link");
|
||||
s.rel = "stylesheet";
|
||||
s.href = url;
|
||||
s.onload = ready; s.onerror = ready;
|
||||
document.head.appendChild(s);
|
||||
});
|
||||
|
||||
// (D) INSERT <SCRIPT> INTO <HEAD>
|
||||
js.forEach((url, i) => {
|
||||
s = document.createElement("script");
|
||||
s.src = url;
|
||||
s.onload = ready; s.onerror = ready;
|
||||
document.head.appendChild(s);
|
||||
});
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
<?php require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
|
||||
<?php
|
||||
$langselect = new WA_MySQLi_RS("langselect",$cmctrfdb,0);
|
||||
$langselect->setQuery("SELECT * FROM languages");
|
||||
$langselect->execute();
|
||||
?>
|
||||
<?php
|
||||
$langidsel=$user->present()->langid;
|
||||
$langintable = new WA_MySQLi_RS("langselect",$cmctrfdb,0);
|
||||
$langintable->setQuery("SELECT * FROM languages WHERE idlanguages='$langidsel'");
|
||||
$langintable->execute();
|
||||
?>
|
||||
<?php
|
||||
|
||||
$lang=$langselect->getColumnVal("acronym_languages");
|
||||
?>
|
||||
|
||||
<select name="langid" id="langid">
|
||||
<?php
|
||||
while(!$langselect->atEnd()) { //dyn select
|
||||
?>
|
||||
<option value="<?php echo($langselect->getColumnVal("idlanguages")); ?>"<?php if (!(strcmp($langselect->getColumnVal("idlanguages"), ($langintable->getColumnVal("idlanguages"))))) {echo "selected=\"selected\"";} ?>><?php echo($langselect->getColumnVal("name_languages")); ?></option>
|
||||
<?php
|
||||
$langselect->moveNext();
|
||||
} //dyn select
|
||||
$langselect->moveFirst();
|
||||
?>
|
||||
</select>
|
||||
@ -1,4 +0,0 @@
|
||||
<?php
|
||||
phpinfo();
|
||||
echo "Ciao";
|
||||
?>
|
||||
@ -1,228 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript2.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
$formname = "nocontact";
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf = $_POST["idtrf"];
|
||||
}
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf = $_GET["idtrf"];
|
||||
}
|
||||
if (isset($_POST["formname"])) {
|
||||
$formname = $_POST["formname"];
|
||||
}
|
||||
if (isset($_POST["csincharge"])) {
|
||||
$csincharge = $_POST["csincharge"];
|
||||
}
|
||||
if (isset($_POST["datecsincharge"])) {
|
||||
$datecsincharge = $_POST["datecsincharge"];
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<?php if (!empty($csincharge)) { ?>
|
||||
|
||||
<?php //pdf creation
|
||||
// Recipient
|
||||
/*
|
||||
$to = $emailuser;
|
||||
|
||||
// Sender
|
||||
$from = $fromaddresssmail;
|
||||
$fromName = 'CIMAC Application Form System';
|
||||
|
||||
// Email subject
|
||||
$subject = 'Azione Richiesta: invio secondo modulo';
|
||||
|
||||
// Attachment file
|
||||
$mmessage="mailsecondmodule";
|
||||
|
||||
include('include/mailhtml.php');
|
||||
// Email body content
|
||||
$htmlContent = $mail2mod;
|
||||
|
||||
|
||||
|
||||
// Header for sender info
|
||||
$headers = "From: $fromName"." <".$from.">";
|
||||
|
||||
// Boundary
|
||||
$semi_rand = md5(time());
|
||||
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
|
||||
|
||||
// Headers for attachment
|
||||
$headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
|
||||
|
||||
// Multipart boundary
|
||||
$message = "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"UTF-8\"\n" .
|
||||
"Content-Transfer-Encoding: 7bit\n\n" . $htmlContent . "\n\n";
|
||||
|
||||
|
||||
|
||||
// Send email
|
||||
$mail = @mail($to, $subject, $message, $headers, $returnpath);
|
||||
|
||||
*/
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "`trf-details`";
|
||||
$UpdateQuery->bindColumn("csincharge", "s", "$csincharge", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("datecsincharge", "s", "$datecsincharge", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idtrfdetails", "=", "i", "" . ($idtrf) . "");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
$UpdateQuery->redirect($UpdateGoTo); ?>
|
||||
<script>
|
||||
window.onunload = refreshParent;
|
||||
|
||||
function refreshParent() {
|
||||
window.opener.location.reload();
|
||||
}
|
||||
window.close()
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
$trfnumberfinal = new WA_MySQLi_RS("trfnumberfinal", $cmctrfdb, 0);
|
||||
$trfnumberfinal->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'");
|
||||
$trfnumberfinal->execute();
|
||||
?>
|
||||
<?php
|
||||
$idcertn = $trfnumberfinal->getColumnVal("idcertification");
|
||||
$idcert = $trfnumberfinal->getColumnVal("idcertification");
|
||||
?>
|
||||
<?php
|
||||
$certname = new WA_MySQLi_RS("certname", $cmctrfdb, 1);
|
||||
$certname->setQuery("SELECT * FROM certificationtype WHERE certificationtype.idcertificationtype='$idcert'");
|
||||
$certname->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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
<!-- upload image script -->
|
||||
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
|
||||
|
||||
<!-- 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/scriptsearchcontact.js"></script>
|
||||
<!-- submit form with button -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<!-- section file already uploaded -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">ACTION CS</h4>
|
||||
PRESA IN CARICO
|
||||
<br><br>
|
||||
|
||||
TRF N. <?php echo ($trfnumberfinal->getColumnVal("trfnumber")); ?> - Description <?php echo ($trfnumberfinal->getColumnVal("sample_description")); ?>
|
||||
<br><br>
|
||||
CERT NAME: <?php echo ($certname->getColumnVal("name_certification")); ?>
|
||||
<br><br>
|
||||
<form method="post">
|
||||
<?php $todaydate = $date = date('Y-m-d H:i:s'); ?>
|
||||
<input name="formname" type="hidden" id="formname" value="actioncsupdate">
|
||||
<input name="idtrf" type="hidden" id="idtrf" value="<?php echo $idtrf; ?>">
|
||||
<input name="csincharge" type="hidden" id="csincharge" value="<?php echo $loginusername; ?>">
|
||||
<input name="datecsincharge" type="hidden" id="datecsincharge" value="<?php echo $todaydate; ?>">
|
||||
<button type="submit" class="btn btn-success waves-effect waves-light">PRENDI IN CARICO</button>
|
||||
</form>
|
||||
<br><br>
|
||||
<a href="csrev.php?idtrf=<?php echo $idtrf; ?>"><button type="submit" class="btn btn-danger waves-effect waves-light">CS REV</button></a>
|
||||
<a href="backtodraft.php?idtrf=<?php echo $idtrf; ?>"><button type="submit" class="btn btn-danger waves-effect waves-light">Back To Draft</button></a>
|
||||
<br><br>
|
||||
<a href="xlsgen.php?idtrf=<?php echo $idtrf; ?>"><button type="submit" class="btn btn-primary waves-effect waves-light">XLS PARTS</button></a>
|
||||
<br><br>
|
||||
<button onclick="self.close()" type="button" class="btn btn-success waves-effect waves-light"><?php echo $closewindow; ?></button>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div>
|
||||
<?php // contact search trial
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<!-- end of page -->
|
||||
|
||||
|
||||
<!-- 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>
|
||||
@ -1,182 +0,0 @@
|
||||
<?php require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
<?php
|
||||
$articletypelist = new WA_MySQLi_RS("articletypelist",$cmctrfdb,0);
|
||||
$articletypelist->setQuery("SELECT * FROM article_type ORDER BY article_type.name_articletype");
|
||||
$articletypelist->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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">Aggiungi Articolo Caratteristica</h4>
|
||||
|
||||
<form class="was-validated" action="admin-characteristic.php" method="post" name="myForm">
|
||||
<div class="form-group row">
|
||||
<label for="standardcode" class="col-sm-2 col-form-label text-right">Nome Caratteristica ITA</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="" id="name_articlecharacteristic" name="name_articlecharacteristic">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="itastdname" class="col-sm-2 col-form-label text-right">NNome Caratteristica ENG</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="" id="name_articlecharacteristic_eng" name="name_articlecharacteristic_eng">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label text-right">Tipologia Articolo</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="idarticletype" id="idarticletype">
|
||||
<option value="">Seleziona</option>
|
||||
<?php
|
||||
while(!$articletypelist->atEnd()) { //dyn select
|
||||
?>
|
||||
<option value="<?php echo($articletypelist->getColumnVal("idarticletype")); ?>"><?php echo($articletypelist->getColumnVal("name_articletype")); ?></option>
|
||||
<?php
|
||||
$articletypelist->moveNext();
|
||||
} //dyn select
|
||||
$articletypelist->moveFirst();
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="formnameadd" id="formnameadd" value="stdaddform">
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="Aggiungi"><br>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,153 +0,0 @@
|
||||
<?php require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
|
||||
|
||||
<!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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">Gestione Chemical AGent</h4>
|
||||
|
||||
<form class="was-validated" action="admin-chemical.php" method="post" name="myForm">
|
||||
<div class="form-group row">
|
||||
<label for="standardcode" class="col-sm-2 col-form-label text-right">Nome Chemical Agent IT</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="" id="name_chemicalagent" name="name_chemicalagent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="itastdname" class="col-sm-2 col-form-label text-right">Nome Chemical Agent EN</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="" id="name_chemicalagent_en" name="name_chemicalagent_en">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="formnameadd" id="formnameadd" value="stdaddform">
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="Aggiungi"><br>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,188 +0,0 @@
|
||||
<?php require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
<?php
|
||||
$articletypelist = new WA_MySQLi_RS("articletypelist",$cmctrfdb,0);
|
||||
$articletypelist->setQuery("SELECT * FROM article_type ORDER BY article_type.name_articletype");
|
||||
$articletypelist->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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">AGGIUNGI DPI CATEGORY</h4>
|
||||
|
||||
<form class="was-validated" action="admin-dpicat.php" method="post" name="myForm">
|
||||
<div class="form-group row">
|
||||
<label for="standardcode" class="col-sm-2 col-form-label text-right">DPI CATEGORY IT</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="" id="value_dpicategory" name="value_dpicategory">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="itastdname" class="col-sm-2 col-form-label text-right">DPI CATEGORY EN</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="" id="value_dpicategory_en" name="value_dpicategory_en">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label text-right">Tipologia Articolo</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="idarticletype" id="idarticletype">
|
||||
<option value="">Seleziona</option>
|
||||
<?php
|
||||
while(!$articletypelist->atEnd()) { //dyn select
|
||||
?>
|
||||
<option value="<?php echo($articletypelist->getColumnVal("idarticletype")); ?>"><?php echo($articletypelist->getColumnVal("name_articletype")); ?></option>
|
||||
<?php
|
||||
$articletypelist->moveNext();
|
||||
} //dyn select
|
||||
$articletypelist->moveFirst();
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="formnameadd" id="formnameadd" value="stdaddform">
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="Aggiungi"><br>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,188 +0,0 @@
|
||||
<?php require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
<?php
|
||||
$articletypelist = new WA_MySQLi_RS("articletypelist",$cmctrfdb,0);
|
||||
$articletypelist->setQuery("SELECT * FROM article_type ORDER BY article_type.name_articletype");
|
||||
$articletypelist->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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">AGGIUNGI PROTECTION CATEGORY</h4>
|
||||
|
||||
<form class="was-validated" action="admin-protcat.php" method="post" name="myForm">
|
||||
<div class="form-group row">
|
||||
<label for="standardcode" class="col-sm-2 col-form-label text-right">PROTECTION CATEGORY IT</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="" id="name_protectioncategory" name="name_protectioncategory">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="itastdname" class="col-sm-2 col-form-label text-right">PROTECTION CATEGORY EN</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="" id="name_protectioncategory_en" name="name_protectioncategory_en">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label text-right">Tipologia Articolo</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="idarticletype" id="idarticletype">
|
||||
<option value="">Seleziona</option>
|
||||
<?php
|
||||
while(!$articletypelist->atEnd()) { //dyn select
|
||||
?>
|
||||
<option value="<?php echo($articletypelist->getColumnVal("idarticletype")); ?>"><?php echo($articletypelist->getColumnVal("name_articletype")); ?></option>
|
||||
<?php
|
||||
$articletypelist->moveNext();
|
||||
} //dyn select
|
||||
$articletypelist->moveFirst();
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="formnameadd" id="formnameadd" value="stdaddform">
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="Aggiungi"><br>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,188 +0,0 @@
|
||||
<?php require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
<?php
|
||||
$articletypelist = new WA_MySQLi_RS("articletypelist",$cmctrfdb,0);
|
||||
$articletypelist->setQuery("SELECT * FROM article_type ORDER BY article_type.name_articletype");
|
||||
$articletypelist->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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">AGGIUNGI REQUIREMENTS</h4>
|
||||
|
||||
<form class="was-validated" action="admin-requirements.php" method="post" name="myForm">
|
||||
<div class="form-group row">
|
||||
<label for="standardcode" class="col-sm-2 col-form-label text-right">REQUIREMENTS IT</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="" id="name_additionalrequirements_it" name="name_additionalrequirements_it">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="itastdname" class="col-sm-2 col-form-label text-right">REQUIREMENTS EN</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="" id="name_additionalrequirements_en" name="name_additionalrequirements_en">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label text-right">Tipologia Articolo</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="idarticletype" id="idarticletype">
|
||||
<option value="">Seleziona</option>
|
||||
<?php
|
||||
while(!$articletypelist->atEnd()) { //dyn select
|
||||
?>
|
||||
<option value="<?php echo($articletypelist->getColumnVal("idarticletype")); ?>"><?php echo($articletypelist->getColumnVal("name_articletype")); ?></option>
|
||||
<?php
|
||||
$articletypelist->moveNext();
|
||||
} //dyn select
|
||||
$articletypelist->moveFirst();
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="formnameadd" id="formnameadd" value="stdaddform">
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="Aggiungi"><br>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,228 +0,0 @@
|
||||
<?php require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
<?php
|
||||
$articletypelist = new WA_MySQLi_RS("articletypelist",$cmctrfdb,0);
|
||||
$articletypelist->setQuery("SELECT * FROM article_type ORDER BY article_type.name_articletype");
|
||||
$articletypelist->execute();
|
||||
?>
|
||||
<?php
|
||||
$articlecharacteristiclist = new WA_MySQLi_RS("articlecharacteristiclist",$cmctrfdb,0);
|
||||
$articlecharacteristiclist->setQuery("SELECT * FROM article_characteristic ORDER BY article_characteristic.idarticletype, article_characteristic.name_articlecharacteristic");
|
||||
$articlecharacteristiclist->execute();
|
||||
?>
|
||||
<?php
|
||||
$categorydpilist = new WA_MySQLi_RS("categorydpilist",$cmctrfdb,0);
|
||||
$categorydpilist->setQuery("SELECT * FROM dpicategory ORDER BY dpicategory.value_dpicategory");
|
||||
$categorydpilist->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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">Gestione Standards</h4>
|
||||
<p class="text-muted mb-3">Da questa pagina puoi gestire gli standards e tutti i dati correlati</p>
|
||||
<form class="was-validated" action="admin-standards.php" method="post" name="myForm">
|
||||
<div class="form-group row">
|
||||
<label for="standardcode" class="col-sm-2 col-form-label text-right">Standard Code</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="" id="standardcode" name="standardcode">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="itastdname" class="col-sm-2 col-form-label text-right">Nome STD Italiano</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="" id="itastdname" name="itastdname">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="engstdname" class="col-sm-2 col-form-label text-right">Nome STD Inglese</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="" id="engstdname" name="engstdname">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="fmcode" class="col-sm-2 col-form-label text-right">Codice FM</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" value="" id="fmcode" name="fmcode">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label text-right">Tipologia Articolo</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="idarticletype" id="idarticletype">
|
||||
<option value="">Seleziona</option>
|
||||
<?php
|
||||
while(!$articletypelist->atEnd()) { //dyn select
|
||||
?>
|
||||
<option value="<?php echo($articletypelist->getColumnVal("idarticletype")); ?>"><?php echo($articletypelist->getColumnVal("name_articletype")); ?></option>
|
||||
<?php
|
||||
$articletypelist->moveNext();
|
||||
} //dyn select
|
||||
$articletypelist->moveFirst();
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label text-right">Caratteristiche Articolo</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" id="articlecharact" name="articlecharact">
|
||||
<option value="">Seleziona</option>
|
||||
<?php
|
||||
while(!$articlecharacteristiclist->atEnd()) { //dyn select
|
||||
?>
|
||||
<option value="<?php echo($articlecharacteristiclist->getColumnVal("idarticlecharacteristic")); ?>"><?php echo($articlecharacteristiclist->getColumnVal("name_articlecharacteristic")); ?></option>
|
||||
<?php
|
||||
$articlecharacteristiclist->moveNext();
|
||||
} //dyn select
|
||||
$articlecharacteristiclist->moveFirst();
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="virusprotection" name="virusprotection" value="Y" data-parsley-multiple="groups" data-parsley-mincheck="2">
|
||||
<label class="custom-control-label" for="virusprotection">Protezione Virus</label>
|
||||
</div>
|
||||
<br>
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="chemicalagent" name="chemicalagent" value="Y" data-parsley-multiple="groups" data-parsley-mincheck="2">
|
||||
<label class="custom-control-label" for="chemicalagent">Agenti Chimici</label>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
|
||||
<input type="hidden" name="formnameadd" id="formnameadd" value="stdaddform">
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="Aggiungi"><br>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,28 +0,0 @@
|
||||
<?php
|
||||
require_once '../Connections/cmctrfdb.php'; // Assicurati che il percorso sia corretto
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
// Prendi le variabili da POST o definiscile qui se non sono dinamiche
|
||||
$idcompany = $_POST['idcompany'] ?? ''; // Assumi che queste vengano passate o impostale qui
|
||||
$idart = $_POST['idart'] ?? '';
|
||||
$idtrftd = $_POST['idtrftd'] ?? '';
|
||||
$useridn = $_POST['iduserlogin'] ?? '';
|
||||
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
if ($conn->connect_error) {
|
||||
die("Connessione fallita: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
$stmt = $conn->prepare("INSERT INTO identificationparts (companyidn, arttypeid, kindoftest, idtrfdetails, useridn) VALUES (?, ?, 'cmc', ?, ?)");
|
||||
$stmt->bind_param("iiii", $idcompany, $idart, $idtrftd, $useridn);
|
||||
$result = $stmt->execute();
|
||||
|
||||
if ($result) {
|
||||
echo json_encode(['success' => true, 'message' => 'Parte aggiunta con successo']);
|
||||
} else {
|
||||
echo json_encode(['success' => false, 'message' => 'Errore nell\'aggiunta della parte']);
|
||||
}
|
||||
|
||||
$stmt->close();
|
||||
$conn->close();
|
||||
}
|
||||
@ -1,829 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf = $_GET["idtrf"];
|
||||
}
|
||||
if (isset($_GET["codestep"])) {
|
||||
$code = "8";
|
||||
$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");
|
||||
?>
|
||||
<?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(); ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?php echo $titlepage; ?> </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="<?php echo $ownercompanyname; ?> 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" />
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
<!-- upload image script -->
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".upload-doc").click(function() {
|
||||
$(".form-horizontal").ajaxForm({
|
||||
target: '.preview'
|
||||
}).submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<style>
|
||||
/* Add this CSS to your styles */
|
||||
.custom-file-upload {
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
cursor: pointer;
|
||||
background: #28a745;
|
||||
color: white;
|
||||
border-radius: 0.25rem;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.file-name-display {
|
||||
border: 1px solid #ccc;
|
||||
padding: 6px 12px;
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
min-width: 120px;
|
||||
margin-right: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.upload-div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
</style>
|
||||
</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);"><?php echo $titlepage; ?></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: 95%;" aria-valuenow="95" aria-valuemin="0" aria-valuemax="100">95%</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php // photos
|
||||
?>
|
||||
|
||||
<?php if (($trfnumberfinal->getColumnVal("idcertification") != '5') and ($trfnumberfinal->getColumnVal("idcertification") != '6')) { ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0"><?php echo $addphotosdoc; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i>
|
||||
<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>Foto frontale e laterale
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</h4>
|
||||
|
||||
<p class="text-muted mb-3"><?php echo $allowedkind; ?></p>
|
||||
|
||||
|
||||
<table id="photoaded">
|
||||
<tr>
|
||||
<?php
|
||||
$photoshoesside = "";
|
||||
$photoshoessole = "";
|
||||
|
||||
if ($trfnumberfinal->getColumnVal("idarticletype") == '1') {
|
||||
$photo1 = $photoshoesside;
|
||||
$photo2 = $photoshoessole;
|
||||
} elseif ($trfnumberfinal->getColumnVal("idarticletype") == '2') {
|
||||
$photo1 = $photogloveup;
|
||||
$photo2 = $photoglovebottom;
|
||||
} elseif ($trfnumberfinal->getColumnVal("idarticletype") == '3') {
|
||||
$photo1 = $photomasksidea;
|
||||
$photo2 = $photomasksideb;
|
||||
} elseif ($trfnumberfinal->getColumnVal("idarticletype") == '4') {
|
||||
$photo1 = "Foto fronte";
|
||||
$photo2 = "Foto retro";
|
||||
} ?>
|
||||
<th><?php echo $photo1; ?></th>
|
||||
<th></th>
|
||||
<th><?php echo $photo2; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<form id="uploadFormphoto" enctype="multipart/form-data">
|
||||
<label for="fileInput1" class="custom-file-upload"><?php echo $browsebotton; ?></label>
|
||||
<div class="file-name-display" onclick="document.getElementById('fileInput1').click();"><?php echo $nofilechoosen; ?></div>
|
||||
<input type="file" name="docphotoone[]" id="fileInput1" style="display: none;" onchange="updateFileName(1)">
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo $trfnumberfinal->getColumnVal("idtrfdetails"); ?>">
|
||||
<input type="submit" name="submit" value="UPLOAD" />
|
||||
</form>
|
||||
<!-- Display upload status -->
|
||||
<div id="uploadStatus1"></div>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<form id="uploadFormphototwo" enctype="multipart/form-data">
|
||||
<label for="fileInput2" class="custom-file-upload"><?php echo $browsebotton; ?></label>
|
||||
<div class="file-name-display" onclick="document.getElementById('fileInput2').click();"><?php echo $nofilechoosen; ?></div>
|
||||
<input type="file" name="docphototwo[]" id="fileInput2" style="display: none;" onchange="updateFileName(2)">
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo $trfnumberfinal->getColumnVal("idtrfdetails"); ?>">
|
||||
<input type="submit" name="submit" value="UPLOAD" />
|
||||
</form>
|
||||
<!-- Display upload status -->
|
||||
<div id="uploadStatus2"></div>
|
||||
</div>
|
||||
<script>
|
||||
// Add this script to handle the filename display
|
||||
function updateFileName(index) {
|
||||
var input = document.getElementById('fileInput' + index);
|
||||
var fileNameDisplay = document.querySelector('.upload-div #uploadStatus' + index);
|
||||
fileNameDisplay.textContent = input.files[0].name || 'No file chosen';
|
||||
}
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="cont_photoone">
|
||||
<?php if (!empty($trfnumberfinal->getColumnVal("photoone"))) { ?>
|
||||
<img src="uploaddocuments/<?php echo ($trfnumberfinal->getColumnVal("photoone")); ?>" height="200" alt="" />
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td id="cont_phototwo">
|
||||
|
||||
<?php if (!empty($trfnumberfinal->getColumnVal("phototwo"))) { ?>
|
||||
|
||||
<img src="uploaddocuments/<?php echo ($trfnumberfinal->getColumnVal("phototwo")); ?>" height="200" alt="" />
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card--><?php } ?>
|
||||
|
||||
|
||||
|
||||
<?php // documents
|
||||
?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0"><?php echo $adddoctitle; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i>
|
||||
<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($documenthelp); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</h4>
|
||||
<?php if ($idcert != 5) { ?>
|
||||
<p class="text-muted mb-3"><?php echo $adddoctitle_help; ?></p>
|
||||
<?php } else { ?>
|
||||
<p class="text-muted mb-3"><?php echo $auditdocumenttitle; ?></p>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<form id="uploadForm" enctype="multipart/form-data">
|
||||
<div class="form-group row">
|
||||
<label for="validationTooltip01" class="col-sm-5 col-form-label"><?php echo $filedescription; ?></label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="validationTooltip01" name="filedescription" placeholder="<?php echo $filedescription; ?>" required="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label"><?php echo $selectfileonyourpc; ?></label>
|
||||
<div class="col-sm-8">
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" id="fileInput" name="doc[]" onchange="document.getElementById('fileInputLabel').innerHTML = document.getElementById('fileInput').files[0].name">
|
||||
<label class="custom-file-label" for="fileInput" id="fileInputLabel"><?php echo $nofilechoosen; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo $trfnumberfinal->getColumnVal("idtrfdetails"); ?>">
|
||||
<input type="submit" class="btn btn-primary" name="submit" value="UPLOAD" />
|
||||
</form>
|
||||
|
||||
<script>
|
||||
// Assicurati che questo script sia incluso dopo il form o prima della chiusura del tag body
|
||||
document.getElementById('fileInput').onchange = function() {
|
||||
// Verifica se un file è stato selezionato
|
||||
if (this.files && this.files.length > 0) {
|
||||
// Aggiorna il testo della label con il nome del file
|
||||
document.getElementById('fileInputLabel').innerHTML = this.files[0].name;
|
||||
} else {
|
||||
// Se non è stato selezionato nessun file, mostra il testo di default
|
||||
document.getElementById('fileInputLabel').innerHTML = '<?php echo $nofilechoosen; ?>';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Display upload status -->
|
||||
<div id="uploadStatus"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
<div class="card" id="provacla">
|
||||
|
||||
<?php
|
||||
$filenamelist = new WA_MySQLi_RS("filenamelist", $cmctrfdb, 0);
|
||||
$filenamelist->setQuery("SELECT * FROM fileattached WHERE fileattached.idtrfdetails='$idtrf'");
|
||||
$filenamelist->execute();
|
||||
?>
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $addeddoctitle; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $addeddoctitle_help; ?></p>
|
||||
|
||||
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
|
||||
<div class="table-responsive" id="docadded">
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $filenametitle; ?></th>
|
||||
<th><?php echo $filenamedesc; ?></th>
|
||||
|
||||
<th><?php echo $actiondel; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="cont_file">
|
||||
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$filenamelist->atEnd()) {
|
||||
$wa_startindex = $filenamelist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="uploaddocuments/<?php echo ($filenamelist->getColumnVal("filename_fileattached")); ?>" target="_blank"><?php echo $filesent; ?></a>
|
||||
</td>
|
||||
<td><?php echo ($filenamelist->getColumnVal("description_fileattached")); ?></td>
|
||||
|
||||
<td>
|
||||
|
||||
<a href="deleteaddedoc.php?idtrf=<?php echo $idtrf; ?>&idadddoc=<?php echo ($filenamelist->getColumnVal("idfileattached")); ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$filenamelist->moveNext();
|
||||
}
|
||||
$filenamelist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table><br>
|
||||
|
||||
<!--end /table-->
|
||||
</div><!--end /tableresponsive-->
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
|
||||
<div class="card" id="provaclaphoto">
|
||||
<?php
|
||||
$additionalphotoslist = new WA_MySQLi_RS("additionalphotoslist", $cmctrfdb, 0);
|
||||
$additionalphotoslist->setQuery("SELECT * FROM additionalphotos WHERE additionalphotos.idtrf='$idtrf'");
|
||||
$additionalphotoslist->execute();
|
||||
?>
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $addphotos; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $addphotossuggestion; ?></p>
|
||||
|
||||
<!-- Upload area -->
|
||||
<div class="upload-area" id="uploadfile">
|
||||
<div class="upload-icon">
|
||||
<i class="fas fa-cloud-upload-alt"></i>
|
||||
</div>
|
||||
<p><?php echo $addphotosup; ?></p>
|
||||
<input type="file" id="fileupload" multiple accept="image/*" style="display:none;">
|
||||
</div>
|
||||
<div id="thumbnail-container"></div>
|
||||
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<div class="card-body">
|
||||
<div class="table-responsive" id="docadded">
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $filenametitle; ?>-</th>
|
||||
|
||||
<th><?php echo $actiondel; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="cont_file_photo">
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$additionalphotoslist->atEnd()) {
|
||||
$wa_startindex = $additionalphotoslist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="uploadimages/<?php echo $additionalphotoslist->getColumnVal("filenameadditionalphotos"); ?>" target="_blank">
|
||||
<img src="uploadimages/<?php echo $additionalphotoslist->getColumnVal("filenameadditionalphotos"); ?>" class="thumbnail">
|
||||
</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="deleteaddephotos.php?idtrf=<?php echo $idtrf; ?>&idadditionalphotos=<?php echo $additionalphotoslist->getColumnVal("idadditionalphotos"); ?>">
|
||||
<i class="fas fa-trash-alt text-danger font-16"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$additionalphotoslist->moveNext();
|
||||
}
|
||||
$additionalphotoslist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table><br>
|
||||
<a href="trfoption.php?idtrf=<?php echo $idtrf; ?>&codestep=8"><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="window.location.href='identificationparts.php?idtrf=<?php echo $idtrf; ?>'"><?php echo $backstep; ?></button>
|
||||
<!--end /table-->
|
||||
</div><!--end /tableresponsive-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
|
||||
<style>
|
||||
.upload-area {
|
||||
border: 2px dashed #007bff;
|
||||
border-radius: 5px;
|
||||
background-color: #e9f7ff;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.upload-area:hover {
|
||||
background-color: #d4efff;
|
||||
}
|
||||
|
||||
.upload-icon {
|
||||
font-size: 50px;
|
||||
color: #007bff;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.thumbnail {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
margin: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
document.querySelector('.upload-area').addEventListener('click', function() {
|
||||
document.getElementById('fileupload').click();
|
||||
});
|
||||
|
||||
document.getElementById('fileupload').addEventListener('change', function(e) {
|
||||
const files = e.target.files;
|
||||
handleFiles(files);
|
||||
});
|
||||
|
||||
document.querySelector('.upload-area').addEventListener('dragover', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.style.backgroundColor = '#d4efff';
|
||||
});
|
||||
|
||||
document.querySelector('.upload-area').addEventListener('dragleave', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.style.backgroundColor = '#e9f7ff';
|
||||
});
|
||||
|
||||
document.querySelector('.upload-area').addEventListener('drop', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.style.backgroundColor = '#e9f7ff';
|
||||
const files = e.dataTransfer.files;
|
||||
handleFiles(files);
|
||||
});
|
||||
|
||||
function handleFiles(files) {
|
||||
const thumbnailContainer = document.getElementById('thumbnail-container');
|
||||
thumbnailContainer.innerHTML = ''; // Clear previous thumbnails
|
||||
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
const fileType = file.type.toLowerCase();
|
||||
const validImageTypes = ["image/jpeg", "image/png", "image/jpg"];
|
||||
|
||||
if (!validImageTypes.includes(fileType)) {
|
||||
alert('Only JPG, JPEG, and PNG files are allowed.');
|
||||
continue;
|
||||
}
|
||||
|
||||
const reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
const img = document.createElement('img');
|
||||
img.src = e.target.result;
|
||||
img.classList.add('thumbnail');
|
||||
thumbnailContainer.appendChild(img);
|
||||
|
||||
setTimeout(() => {
|
||||
thumbnailContainer.removeChild(img);
|
||||
}, 3000);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append('idtrf', '<?php echo $idtrf; ?>'); // Pass idtrf from PHP to JS
|
||||
|
||||
fetch('uploadaddphotos.php', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
console.log('File uploaded successfully');
|
||||
updatePhotoTable();
|
||||
} else {
|
||||
console.error('File upload failed: ', data.message);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function updatePhotoTable() {
|
||||
fetch('getphotos.php?idtrf=<?php echo $idtrf; ?>')
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.text(); // Modifica per leggere come testo per il debug
|
||||
})
|
||||
.then(data => {
|
||||
console.log('Server response:', data); // Logga la risposta grezza del server
|
||||
try {
|
||||
let jsonData = JSON.parse(data); // Prova a fare il parsing della risposta come JSON
|
||||
if (jsonData.error) {
|
||||
throw new Error(jsonData.error); // Gestisce errori dal server
|
||||
}
|
||||
let html = '';
|
||||
jsonData.forEach(photo => {
|
||||
html += `<tr>
|
||||
<td><img src="uploadimages/${photo.filename}" class="thumbnail"></td>
|
||||
<td>${photo.description}</td>
|
||||
<td><a href="deleteaddephotos.php?idtrf=<?php echo $idtrf; ?>&idadditionalphotos=${photo.id}">
|
||||
<i class="fas fa-trash-alt text-danger font-16"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>`;
|
||||
});
|
||||
document.getElementById('cont_file_photo').innerHTML = html;
|
||||
} catch (e) {
|
||||
console.error('Error parsing JSON:', e, data); // Logga l'errore di parsing e la risposta
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Fetch error:', error); // Logga eventuali errori di fetch
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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 -->
|
||||
<script>
|
||||
var match = [
|
||||
"application/pdf",
|
||||
"application/msword", // per i file .doc
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document", // per i file .docx
|
||||
"image/jpg",
|
||||
"image/jpeg",
|
||||
"image/gif",
|
||||
"application/xls",
|
||||
"application/xlsx",
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
"application/vnd.ms-excel.sheet.macroEnabled.12",
|
||||
"image/png",
|
||||
"image/bmp"
|
||||
];
|
||||
$(document).ready(function() {
|
||||
// File upload via Ajax
|
||||
$("#uploadForm").on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'uploadfile.php',
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData: false,
|
||||
beforeSend: function() {
|
||||
$('#uploadStatus').html('<img src="../images/uploading.gif"/>');
|
||||
},
|
||||
error: function() {
|
||||
$('#uploadStatus').html('<span style="color:#EA4335;">File upload failed, please try again.<span>');
|
||||
},
|
||||
success: function(data) {
|
||||
$('#uploadForm')[0].reset();
|
||||
$('#uploadStatus').html('<span style="color:#28A74B;">File uploaded successfully.<span>');
|
||||
// $('.gallery').html(data);
|
||||
// $("#docadded").load(location.href + " #docadded");
|
||||
// SHOW UPLOADED FILE
|
||||
$('#cont_file').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// File type validation
|
||||
$("#fileInput").change(function() {
|
||||
var fileLength = this.files.length;
|
||||
// var match= ["application/pdf","application/msword","image/jpg","image/gif","application/xls","application/xlsx", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"];
|
||||
var i;
|
||||
for (i = 0; i < fileLength; i++) {
|
||||
var file = this.files[i];
|
||||
var imagefile = file.type;
|
||||
// if(!((imagefile==match[0]) || (imagefile==match[1]) || (imagefile==match[5]) || (imagefile==match[6]) || (imagefile==match[7]) || (imagefile==match[8]))){
|
||||
// alert('Please select a valid file (PDF, word, excel).');
|
||||
// $("#fileInput").val('');
|
||||
// return false;
|
||||
// }
|
||||
if (!match.includes(imagefile)) {
|
||||
alert('Please select a valid file (PDF, word, excel).');
|
||||
$("#fileInput").val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// File upload via Ajax
|
||||
$("#uploadFormphoto").on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'uploadphotofile.php',
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData: false,
|
||||
beforeSend: function() {
|
||||
$('#uploadStatus1').html('<img src="../images/uploading.gif"/>');
|
||||
},
|
||||
error: function() {
|
||||
$('#uploadStatus1').html('<span style="color:#EA4335;">File upload failed, please try again.<span>');
|
||||
},
|
||||
success: function(data) {
|
||||
$('#uploadFormphoto')[0].reset();
|
||||
$('#uploadStatus1').html('<span style="color:#28A74B;">File uploaded successfully.<span>');
|
||||
// $('.gallery').html(data);
|
||||
|
||||
// $("#photoaded").load(location.href + " #photoaded");
|
||||
// SHOW PHOTO 1
|
||||
$('#cont_photoone').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// File type validation
|
||||
$("#fileInput1").change(function() {
|
||||
var fileLength = this.files.length;
|
||||
// var match= ["application/pdf","application/msword","image/jpg","image/gif","application/xls","application/xlsx", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"];
|
||||
var i;
|
||||
for (i = 0; i < fileLength; i++) {
|
||||
var file = this.files[i];
|
||||
var imagefile = file.type.toLowerCase();
|
||||
if (!((imagefile == match[2]) || (imagefile == match[3]) || (imagefile == match[4]) || (imagefile == match[9]) || (imagefile == match[10]))) {
|
||||
alert('Please select a valid file (jpg, jpeg, png, bmp).');
|
||||
$("#fileInput1").val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// File upload via Ajax
|
||||
$("#uploadFormphototwo").on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'uploadphotofile2.php',
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData: false,
|
||||
beforeSend: function() {
|
||||
$('#uploadStatus2').html('<img src="../images/uploading.gif"/>');
|
||||
},
|
||||
error: function() {
|
||||
$('#uploadStatus2').html('<span style="color:#EA4335;">File upload failed, please try again.<span>');
|
||||
},
|
||||
success: function(data) {
|
||||
$('#uploadFormphototwo')[0].reset();
|
||||
$('#uploadStatus2').html('<span style="color:#28A74B;">File uploaded successfully.<span>');
|
||||
// $('.gallery').html(data);
|
||||
// $("#photoaded").load(location.href + " #photoaded");
|
||||
// SHOW PHOTO 2
|
||||
$('#cont_phototwo').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// File type validation
|
||||
$("#fileInput2").change(function() {
|
||||
var fileLength = this.files.length;
|
||||
// var match= ["application/pdf","application/msword","image/jpg","image/gif","application/xls","application/xlsx", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"];
|
||||
var i;
|
||||
for (i = 0; i < fileLength; i++) {
|
||||
var file = this.files[i];
|
||||
var imagefile = file.type.toLowerCase();
|
||||
if (!((imagefile == match[2]) || (imagefile == match[3]) || (imagefile == match[4]) || (imagefile == match[9]) || (imagefile == match[10]))) {
|
||||
alert('Please select a valid file (jpg, jpeg, png, bmp).');
|
||||
$("#fileInput2").val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- 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>
|
||||
@ -1,339 +0,0 @@
|
||||
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf=$_GET["idtrf"]; }
|
||||
if (isset($_GET["codestep"])) {
|
||||
$code="8";
|
||||
|
||||
$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");
|
||||
?>
|
||||
|
||||
<?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();?>
|
||||
|
||||
<!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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
<!-- upload image script -->
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".upload-doc").click(function(){
|
||||
$(".form-horizontal").ajaxForm({target: '.preview'}).submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Top Bar Start -->
|
||||
<?php include('include/topbar.php'); ?>
|
||||
<!-- Top Bar End -->
|
||||
|
||||
|
||||
<!-- Left Sidenav -->
|
||||
<?php include('include/leftsidenav2.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: 95%;" aria-valuenow="95" aria-valuemin="0" aria-valuemax="100">95%</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0"><?php echo $adddoctitle; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i>
|
||||
<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($documenthelp); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal --></h4>
|
||||
<?php if ($idcert!=5) { ?>
|
||||
<p class="text-muted mb-3"><?php echo $adddoctitle_help; ?></p>
|
||||
<?php } else { ?>
|
||||
<p class="text-muted mb-3"><?php echo $auditdocumenttitle; ?></p>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<form id="uploadForm" enctype="multipart/form-data">
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="validationTooltip01" class="col-sm-2 col-form-label"><?php echo $filedescription; ?></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" id="validationTooltip01" name="filedescription" placeholder="<?php echo $filedescription; ?>" required="">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label><?php echo $selectfileonyourpc; ?></label>
|
||||
<input type="file" name="doc[]" id="fileInput" >
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo($trfnumberfinal->getColumnVal("idtrfdetails")); ?>">
|
||||
<input type="submit" name="submit" value="UPLOAD"/>
|
||||
</form>
|
||||
|
||||
<!-- Display upload status -->
|
||||
<div id="uploadStatus"></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
<div class="card" id="provacla">
|
||||
|
||||
<?php
|
||||
$filenamelist = new WA_MySQLi_RS("filenamelist",$cmctrfdb,0);
|
||||
$filenamelist->setQuery("SELECT * FROM fileattached WHERE fileattached.idtrfdetails='$idtrf'");
|
||||
$filenamelist->execute();
|
||||
?>
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $addeddoctitle; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $addeddoctitle_help; ?></p>
|
||||
|
||||
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
|
||||
<div class="table-responsive" id="docadded">
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $filenametitle; ?></th>
|
||||
<th><?php echo $filenamedesc; ?></th>
|
||||
|
||||
<th><?php echo $actiondel; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while(!$filenamelist->atEnd()) {
|
||||
$wa_startindex = $filenamelist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td><a href="uploaddocuments/<?php echo($filenamelist->getColumnVal("filename_fileattached")); ?>" target="_blank"><?php echo $filesent; ?></a></td>
|
||||
<td><?php echo($filenamelist->getColumnVal("description_fileattached")); ?></td>
|
||||
|
||||
<td>
|
||||
|
||||
<a href="deleteaddedoc.php?idtrf=<?php echo $idtrf; ?>&idadddoc=<?php echo($filenamelist->getColumnVal("idfileattached")); ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$filenamelist->moveNext();
|
||||
}
|
||||
$filenamelist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table><br>
|
||||
<a href="declaration.php?idtrf=<?php echo $idtrf; ?>&sndrpt=Y"><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>
|
||||
|
||||
<!--end /table-->
|
||||
</div><!--end /tableresponsive-->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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 -->
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
// File upload via Ajax
|
||||
$("#uploadForm").on('submit', function(e){
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'uploadfile.php',
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
beforeSend: function(){
|
||||
$('#uploadStatus').html('<img src="images/uploading.gif"/>');
|
||||
},
|
||||
error:function(){
|
||||
$('#uploadStatus').html('<span style="color:#EA4335;">File upload failed, please try again.<span>');
|
||||
},
|
||||
success: function(data){
|
||||
$('#uploadForm')[0].reset();
|
||||
$('#uploadStatus').html('<span style="color:#28A74B;">File uploaded successfully.<span>');
|
||||
$('.gallery').html(data);
|
||||
$("#docadded").load(location.href + " #docadded");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// File type validation
|
||||
$("#fileInput").change(function(){
|
||||
var fileLength = this.files.length;
|
||||
// var match= ["application/pdf","application/msword","image/jpg","image/gif","application/xls","application/xlsx", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"];
|
||||
var i;
|
||||
for(i = 0; i < fileLength; i++){
|
||||
var file = this.files[i];
|
||||
var imagefile = file.type;
|
||||
if(!((imagefile==match[0]) || (imagefile==match[1]) || (imagefile==match[2]) || (imagefile==match[3]))){
|
||||
alert('Please select a valid file (PDF, word, excel).');
|
||||
$("#fileInput").val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- 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>
|
||||
@ -1,425 +0,0 @@
|
||||
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf=$_GET["idtrf"]; }
|
||||
if (isset($_GET["codestep"])) {
|
||||
$code="8";
|
||||
|
||||
$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");
|
||||
?>
|
||||
|
||||
<?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();?>
|
||||
|
||||
<!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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
<!-- upload image script -->
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".upload-doc").click(function(){
|
||||
$(".form-horizontal").ajaxForm({target: '.preview'}).submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="jquery.form.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#photoimg').live('change', function()
|
||||
{
|
||||
$("#preview").html('');
|
||||
$("#preview").html('<img src="loader.gif" alt="Uploading...."/>');
|
||||
$("#imageform").ajaxForm(
|
||||
{
|
||||
target: '#preview'
|
||||
}).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">
|
||||
|
||||
<?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: 95%;" aria-valuenow="95" aria-valuemin="0" aria-valuemax="100">95%</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php // photos ?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0">Aggiungi le foto <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i>
|
||||
<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>Foto frontale e laterale
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal --></h4>
|
||||
|
||||
<p class="text-muted mb-3">Aggiungi foto etc.....</p>
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Foto Frontale</th>
|
||||
<th></th>
|
||||
<th>Foto Laterale</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="imageform" method="post" enctype="multipart/form-data" action='ajaximage.php'>
|
||||
Upload image <input type="file" name="photoimg" id="photoimg" />
|
||||
</form>
|
||||
|
||||
<div id='preview'>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<form id="imageform" method="post" enctype="multipart/form-data" action='ajaximage.php'>
|
||||
Upload image <input type="file" name="photoimg" id="photoimg" />
|
||||
</form>
|
||||
|
||||
<div id='preview'>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
<?php // documents?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0"><?php echo $adddoctitle; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i>
|
||||
<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($documenthelp); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal --></h4>
|
||||
<?php if ($idcert!=5) { ?>
|
||||
<p class="text-muted mb-3"><?php echo $adddoctitle_help; ?></p>
|
||||
<?php } else { ?>
|
||||
<p class="text-muted mb-3"><?php echo $auditdocumenttitle; ?></p>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<form id="uploadForm" enctype="multipart/form-data">
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="validationTooltip01" class="col-sm-2 col-form-label"><?php echo $filedescription; ?></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" id="validationTooltip01" name="filedescription" placeholder="<?php echo $filedescription; ?>" required="">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label><?php echo $selectfileonyourpc; ?></label>
|
||||
<input type="file" name="doc[]" id="fileInput" >
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo($trfnumberfinal->getColumnVal("idtrfdetails")); ?>">
|
||||
<input type="submit" name="submit" value="UPLOAD"/>
|
||||
</form>
|
||||
|
||||
<!-- Display upload status -->
|
||||
<div id="uploadStatus"></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
<div class="card" id="provacla">
|
||||
|
||||
<?php
|
||||
$filenamelist = new WA_MySQLi_RS("filenamelist",$cmctrfdb,0);
|
||||
$filenamelist->setQuery("SELECT * FROM fileattached WHERE fileattached.idtrfdetails='$idtrf'");
|
||||
$filenamelist->execute();
|
||||
?>
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $addeddoctitle; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $addeddoctitle_help; ?></p>
|
||||
|
||||
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
|
||||
<div class="table-responsive" id="docadded">
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $filenametitle; ?></th>
|
||||
<th><?php echo $filenamedesc; ?></th>
|
||||
|
||||
<th><?php echo $actiondel; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while(!$filenamelist->atEnd()) {
|
||||
$wa_startindex = $filenamelist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td><a href="uploaddocuments/<?php echo($filenamelist->getColumnVal("filename_fileattached")); ?>" target="_blank"><?php echo $filesent; ?></a></td>
|
||||
<td><?php echo($filenamelist->getColumnVal("description_fileattached")); ?></td>
|
||||
|
||||
<td>
|
||||
|
||||
<a href="deleteaddedoc.php?idtrf=<?php echo $idtrf; ?>&idadddoc=<?php echo($filenamelist->getColumnVal("idfileattached")); ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$filenamelist->moveNext();
|
||||
}
|
||||
$filenamelist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table><br>
|
||||
<a href="trfoption.php?idtrf=<?php echo $idtrf; ?>&codestep=8"><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>
|
||||
|
||||
<!--end /table-->
|
||||
</div><!--end /tableresponsive-->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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 -->
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
// File upload via Ajax
|
||||
$("#uploadForm").on('submit', function(e){
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'uploadfile.php',
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
beforeSend: function(){
|
||||
$('#uploadStatus').html('<img src="images/uploading.gif"/>');
|
||||
},
|
||||
error:function(){
|
||||
$('#uploadStatus').html('<span style="color:#EA4335;">File upload failed, please try again.<span>');
|
||||
},
|
||||
success: function(data){
|
||||
$('#uploadForm')[0].reset();
|
||||
$('#uploadStatus').html('<span style="color:#28A74B;">File uploaded successfully.<span>');
|
||||
$('.gallery').html(data);
|
||||
$("#docadded").load(location.href + " #docadded");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// File type validation
|
||||
$("#fileInput").change(function(){
|
||||
var fileLength = this.files.length;
|
||||
// var match= ["application/pdf","application/msword","image/jpg","image/gif","application/xls","application/xlsx", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"];
|
||||
var i;
|
||||
for(i = 0; i < fileLength; i++){
|
||||
var file = this.files[i];
|
||||
var imagefile = file.type;
|
||||
if(!((imagefile==match[0]) || (imagefile==match[1]) || (imagefile==match[2]) || (imagefile==match[3]))){
|
||||
alert('Please select a valid file (PDF, word, excel).');
|
||||
$("#fileInput").val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- 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>
|
||||
@ -1,284 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf = $_GET["idtrf"];
|
||||
}
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf = $_POST["idtrf"];
|
||||
}
|
||||
//include('include/alertcheckquery.php');
|
||||
if (isset($_GET["codestep"])) {
|
||||
$code = "4";
|
||||
$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 /*
|
||||
$conn = mysqli_connect($hostname_cmctrfdb, $username_cmctrfdb, $password_cmctrfdb, $database_cmctrfdb);
|
||||
if (!$conn) {
|
||||
die("Connessione al database fallita: " . mysqli_connect_error());
|
||||
}
|
||||
|
||||
// Controllo dei campi nulli
|
||||
|
||||
$sql = "SELECT COUNT(*) AS num_rows FROM trfstandards WHERE idtrfdetails = $idtrf AND (idprotectioncategory IS NULL OR iddpicategory IS NULL)";
|
||||
$resultcat = mysqli_query($conn, $sql);
|
||||
// Controllo degli errori
|
||||
if (!$resultcat) {
|
||||
die("Errore nella query: " . mysqli_error($conn));
|
||||
}
|
||||
$row = mysqli_fetch_assoc($resultcat);
|
||||
if ($row['num_rows'] > 0) {
|
||||
// Campi nulli trovati, torna alla pagina standardstep.php e mostra il messaggio di errore
|
||||
header("Location: standardstep.php?idtrf=$idtrf&error=tuttiicampidevonoesserericompilati");
|
||||
exit;
|
||||
} */
|
||||
?>
|
||||
<?php
|
||||
$trfnumberfinal = new WA_MySQLi_RS("trfnumberfinal", $cmctrfdb, 1);
|
||||
$trfnumberfinal->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'");
|
||||
$trfnumberfinal->execute();
|
||||
?>
|
||||
<?php
|
||||
$idcertn = $trfnumberfinal->getColumnVal("idcertification");
|
||||
$idtrf = $trfnumberfinal->getColumnVal("idtrfdetails");
|
||||
?>
|
||||
<?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();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?php echo $titlepage; ?> </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" />
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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);"><?php echo $titlepage; ?></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: 60%;" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100">60%</div>
|
||||
</div>
|
||||
<!-- card for additional info gloves -->
|
||||
<?php if ($trfnumberfinal->getColumnVal("idarticletype") == "2") { ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $additionalinfotitle; ?>
|
||||
</h4>
|
||||
<p class="text-muted mb-3"><?php echo $additionalinfotitle_help; ?>
|
||||
</p>
|
||||
<form class="was-validated" action="addrequirements.php" method="post" name="myForm">
|
||||
<div class="checkbox my-2">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="virusprot" name="virusprot" data-parsley-multiple="groups" value="Y" data-parsley-mincheck="2" <?php if ($trfnumberfinal->getColumnVal("virusprotection") == 'Y') {
|
||||
echo "checked";
|
||||
} ?>>
|
||||
<label class="custom-control-label" for="virusprot"><?php echo $virusprottitle; ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="addinfo" id="addinfo" 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 $nextsteptitle; ?>">
|
||||
<a href="standardstep.php?idtrf=<?php echo $idtrf; ?>" <button type="button" class="btn btn-dark waves-effect waves-light"><?php echo $backstep; ?>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
<?php } ?>
|
||||
<!-- card for additional info shoes -->
|
||||
<?php if ($trfnumberfinal->getColumnVal("idarticletype") == "1") { ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $additionalinfotitle; ?>
|
||||
</h4>
|
||||
<p class="text-muted mb-3"><?php echo $additionalinfotitle_help; ?>
|
||||
</p>
|
||||
<form class="form-parsley" action="addrequirements.php" method="post" name="myForm">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label"><?php echo $slippingtitle; ?>
|
||||
</label>
|
||||
<div class="col-sm-2">
|
||||
<select class="form-control" id="slipping" name="slipping">
|
||||
<option value="" <?php if (!(strcmp("", ($trfnumberfinal->getColumnVal("slipping"))))) {
|
||||
echo "selected=\"selected\"";
|
||||
} ?>>No</option>
|
||||
<option value="SR" <?php if (!(strcmp("SR", ($trfnumberfinal->getColumnVal("slipping"))))) {
|
||||
echo "selected=\"selected\"";
|
||||
} ?>>SR</option>
|
||||
<option value="SRA" <?php if (!(strcmp("SRA", ($trfnumberfinal->getColumnVal("slipping"))))) {
|
||||
echo "selected=\"selected\"";
|
||||
} ?>>SRA</option>
|
||||
<option value="SRB" <?php if (!(strcmp("SRB", ($trfnumberfinal->getColumnVal("slipping"))))) {
|
||||
echo "selected=\"selected\"";
|
||||
} ?>>SRB</option>
|
||||
<option value="SRC" <?php if (!(strcmp("SRC", ($trfnumberfinal->getColumnVal("slipping"))))) {
|
||||
echo "selected=\"selected\"";
|
||||
} ?>>SRC</option>
|
||||
</select>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="checkbox my-2">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="orthopedic" name="orthopedic" data-parsley-multiple="groups" value="Y" data-parsley-mincheck="2" <?php if ($trfnumberfinal->getColumnVal("shoesorthopedic") == 'Y') {
|
||||
echo "checked";
|
||||
} ?>>
|
||||
<label class="custom-control-label" for="orthopedic"><?php echo $orthopedictitle; ?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="orthopedicmod" name="orthopedicmod" data-parsley-multiple="groups" value="Y" data-parsley-mincheck="2" <?php if ($trfnumberfinal->getColumnVal("shoesorthopedicmod") == 'Y') {
|
||||
echo "checked";
|
||||
} ?>>
|
||||
<label class="custom-control-label" for="orthopedicmod"><?php echo $orthopedicmodtitle; ?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="autoclavable" name="autoclavable" data-parsley-multiple="groups" value="Y" data-parsley-mincheck="2" <?php if ($trfnumberfinal->getColumnVal("autoclavable") == 'Y') {
|
||||
echo "checked";
|
||||
} ?>>
|
||||
<label class="custom-control-label" for="autoclavable"><?php echo $autoclavabletitle; ?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="esd" name="esd" data-parsley-multiple="groups" value="Y" data-parsley-mincheck="2" <?php if ($trfnumberfinal->getColumnVal("esd") == 'Y') {
|
||||
echo "checked";
|
||||
} ?>>
|
||||
<label class="custom-control-label" for="esd"><?php echo $esdtitle; ?>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<input type="hidden" name="addinfo" id="addinfo" value="Y">
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo $idtrf; ?>">
|
||||
<input type="hidden" name="codestep" id="codestep" value="4">
|
||||
<br>
|
||||
<br>
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $nextsteptitle; ?>">
|
||||
<a href="standardstep.php?idtrf=<?php echo $idtrf; ?>" <button type="button" class="btn btn-dark waves-effect waves-light"><?php echo $backstep; ?>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
<?php } ?>
|
||||
</div>
|
||||
<!--end card-->
|
||||
</div>
|
||||
<!--end col-->
|
||||
</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>
|
||||
@ -1,430 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf = $_GET["idtrf"];
|
||||
}
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf = $_POST["idtrf"];
|
||||
}
|
||||
|
||||
//include('include/alertcheckquery.php');
|
||||
|
||||
if (isset($_POST["virusprot"])) {
|
||||
$virusprot = $_POST["virusprot"];
|
||||
} else {
|
||||
$virusprot = "";
|
||||
}
|
||||
if (isset($_POST["addinfo"])) {
|
||||
$addinfo = $_POST["addinfo"];
|
||||
} else {
|
||||
$addinfo = "";
|
||||
}
|
||||
if (isset($_POST["slipping"])) {
|
||||
$slipping = $_POST["slipping"];
|
||||
} else {
|
||||
$slipping = "";
|
||||
}
|
||||
if (isset($_POST["orthopedic"])) {
|
||||
$orthopedic = $_POST["orthopedic"];
|
||||
} else {
|
||||
$orthopedic = "";
|
||||
}
|
||||
if (isset($_POST["orthopedicmod"])) {
|
||||
$orthopedicmod = $_POST["orthopedicmod"];
|
||||
} else {
|
||||
$orthopedicmod = "";
|
||||
}
|
||||
if (isset($_POST["autoclavable"])) {
|
||||
$autoclavable = $_POST["autoclavable"];
|
||||
} else {
|
||||
$autoclavable = "";
|
||||
}
|
||||
if (isset($_POST["esd"])) {
|
||||
$esd = $_POST["esd"];
|
||||
} else {
|
||||
$esd = "";
|
||||
}
|
||||
if (isset($_POST["ukcacert"])) {
|
||||
$ukcacert = $_POST["ukcacert"];
|
||||
} else {
|
||||
$ukcacert = "";
|
||||
}
|
||||
if (isset($_POST["addreq"])) {
|
||||
$addreq = $_POST["addreq"];
|
||||
}
|
||||
if (isset($_POST["addreqform"])) {
|
||||
$addreqform = $_POST["addreqform"];
|
||||
} else {
|
||||
$addreqform = "";
|
||||
}
|
||||
if (isset($_POST["codestep"])) {
|
||||
$code = "5";
|
||||
|
||||
$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
|
||||
$conn = mysqli_connect($hostname_cmctrfdb, $username_cmctrfdb, $password_cmctrfdb, $database_cmctrfdb);
|
||||
if (!$conn) {
|
||||
die("Connessione al database fallita: " . mysqli_connect_error());
|
||||
}
|
||||
|
||||
// Controllo dei campi nulli
|
||||
|
||||
$sql = "SELECT COUNT(*) AS num_rows FROM trfstandards WHERE idtrfdetails = $idtrf AND (idprotectioncategory IS NULL OR iddpicategory IS NULL)";
|
||||
$resultcat = mysqli_query($conn, $sql);
|
||||
// Controllo degli errori
|
||||
if (!$resultcat) {
|
||||
die("Errore nella query: " . mysqli_error($conn));
|
||||
}
|
||||
/*$row = mysqli_fetch_assoc($resultcat);
|
||||
if ($row['num_rows'] > 0) {
|
||||
// Campi nulli trovati, torna alla pagina standardstep.php e mostra il messaggio di errore
|
||||
header("Location: standardstep.php?idtrf=$idtrf&error=tuttiicampidevonoesserericompilati");
|
||||
exit;
|
||||
}*/
|
||||
?>
|
||||
<?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");
|
||||
$idstandards = $trfnumberfinal->getColumnVal("idstandards");
|
||||
$idarticletype = $trfnumberfinal->getColumnVal("idarticletype");
|
||||
?>
|
||||
<?php
|
||||
$standardlistsel = new WA_MySQLi_RS("standardlistsel", $cmctrfdb, 0);
|
||||
$standardlistsel->setQuery("SELECT * FROM trfstandards WHERE trfstandards.idtrfdetails='$idtrf'");
|
||||
$standardlistsel->execute();
|
||||
?>
|
||||
<?php
|
||||
|
||||
$arraystd = array(); ?>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$standardlistsel->atEnd()) {
|
||||
$wa_startindex = $standardlistsel->Index;
|
||||
?>
|
||||
<?php
|
||||
$idstandards = $standardlistsel->getColumnVal("idstandards");
|
||||
$arraystd[] = $idstandards;
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
$standardlistsel->moveNext();
|
||||
}
|
||||
$standardlistsel->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
$array2std = implode("','", $arraystd);
|
||||
$array3std = "'" . $array2std . "'";
|
||||
?>
|
||||
|
||||
|
||||
<?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 //complete list add req
|
||||
//$addreqlist = new WA_MySQLi_RS("addreqlist",$cmctrfdb,0);
|
||||
//$addreqlist->setQuery("SELECT * FROM additionalrequirements WHERE additionalrequirements.idarticletype='$idarticletype' ORDER BY additionalrequirements.name_additionalrequirements");
|
||||
//$addreqlist->execute();
|
||||
?>
|
||||
|
||||
<?php // specific list of add req for std
|
||||
// Determine the column to select based on the session variable
|
||||
$additionalRequirementsField = ($_SESSION['langselect'] == 'en') ? 'name_additionalrequirements_en' : 'name_additionalrequirements_it';
|
||||
|
||||
// Specific list of add req for std
|
||||
$addreqlist = new WA_MySQLi_RS("addreqlist", $cmctrfdb, 0);
|
||||
$addreqlist->setQuery("SELECT DISTINCT stdreqlist.idadditionalrequirements, additionalrequirements." . $additionalRequirementsField . " FROM stdreqlist LEFT JOIN additionalrequirements ON stdreqlist.idadditionalrequirements=additionalrequirements.idadditionalrequirements WHERE stdreqlist.idstandards IN ($array3std)");
|
||||
$addreqlist->execute();
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
if ($addinfo == "Y") {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "`trf-details`";
|
||||
$UpdateQuery->bindColumn("virusprotection", "s", "$virusprot", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("shoesorthopedic", "s", "$orthopedic", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("shoesorthopedicmod", "s", "$orthopedicmod", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("autoclavable", "s", "$autoclavable", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("esd", "s", "$esd", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("slipping", "s", "$slipping", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idtrfdetails", "=", "i", "" . ($idtrf) . "");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if ($addreqform == "Y") {
|
||||
|
||||
|
||||
$addreqcheck = new WA_MySQLi_RS("addreqcheck", $cmctrfdb, 1);
|
||||
$addreqcheck->setQuery("SELECT * FROM trfaddrequirements WHERE trfaddrequirements.idtrf='$idtrf' AND trfaddrequirements.idadditionalrequirements='$addreq'");
|
||||
$addreqcheck->execute();
|
||||
if (empty($addreqcheck->getColumnVal("idtrfaddrequirements"))) {
|
||||
|
||||
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "trfaddrequirements";
|
||||
$InsertQuery->bindColumn("idtrf", "i", "$idtrf", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idadditionalrequirements", "i", "$addreq", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$addreqselectedlist = new WA_MySQLi_RS("addreqselectedlist", $cmctrfdb, 0);
|
||||
$addreqselectedlist->setQuery("SELECT * FROM trfaddrequirements LEFT JOIN additionalrequirements ON trfaddrequirements.idadditionalrequirements=additionalrequirements.idadditionalrequirements WHERE trfaddrequirements.idtrf='$idtrf'");
|
||||
$addreqselectedlist->execute(); ?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?php echo $titlepage; ?> </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" />
|
||||
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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);"><?php echo $titlepage; ?></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: 70%;" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100">70%</div>
|
||||
</div>
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $additionalreqtitle; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $additionalreqtitle_help; ?></p>
|
||||
<form class="form-parsley" action="" method="post" name="myForm">
|
||||
<div class="form-group row">
|
||||
<?php // var for language translation table name and help
|
||||
$colvarname = $addreqlist->getColumnVal("name_additionalrequirements");
|
||||
$varnamelang = $colvarname . $lang;
|
||||
$varhelplang = "additionalrequirements_" . $lang;
|
||||
?>
|
||||
<div class="col-sm-5">
|
||||
<select class="form-control" id="addreq" name="addreq">
|
||||
<option value=""><?php echo $pleaseselect; ?></option>
|
||||
<?php
|
||||
while (!$addreqlist->atEnd()) { //dyn select
|
||||
?><?php
|
||||
// Assuming the session_start() has been called earlier in the PHP code to start the session.
|
||||
$nameField = ($_SESSION['langselect'] == 'en') ? "name_additionalrequirements_en" : "name_additionalrequirements_it";
|
||||
?>
|
||||
|
||||
<option value="<?php echo ($addreqlist->getColumnVal("idadditionalrequirements")); ?>">
|
||||
<?php echo ($addreqlist->getColumnVal($nameField)); ?>
|
||||
</option> <?php
|
||||
$addreqlist->moveNext();
|
||||
} //dyn select
|
||||
$addreqlist->moveFirst();
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="addreqform" id="addreqform" value="Y">
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo ($trfnumberfinal->getColumnVal("idtrfdetails")); ?>">
|
||||
|
||||
<br><br>
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $addtitle; ?>">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $additionalreqtitleselected; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $additionalreqtitleselected_help; ?></p>
|
||||
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $addreqtitle; ?></th>
|
||||
|
||||
<th><?php echo $action; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$addreqselectedlist->atEnd()) {
|
||||
$wa_startindex = $addreqselectedlist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
// Assuming session_start() has already been called.
|
||||
$nameField = ($_SESSION['langselect'] == 'en') ? 'name_additionalrequirements_en' : 'name_additionalrequirements_it';
|
||||
echo ($addreqselectedlist->getColumnVal($nameField));
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<a href="deleteaddreq.php?idaddreq=<?php echo ($addreqselectedlist->getColumnVal("idtrfaddrequirements")); ?>&idtrf=<?php echo $idtrf; ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$addreqselectedlist->moveNext();
|
||||
}
|
||||
$addreqselectedlist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php include('include/chemicalsquerycheck.php'); ?>
|
||||
<?php if (!empty($chemicalstep)) { ?>
|
||||
<a href="chemicalagent.php?idtrf=<?php echo $idtrf; ?>&codestep=5"><button type="button" class="btn btn-success waves-effect waves-light"><?php echo $nextsteptitle; ?></button> </a>
|
||||
<?php } else { ?>
|
||||
<a href="identificationparts.php?idtrf=<?php echo $idtrf; ?>&codestep=6"><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>
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,230 +0,0 @@
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
<?php
|
||||
if (isset($_POST["idcertificationtype"])) {
|
||||
$idcertificationtype=$_POST["idcertificationtype"];
|
||||
}
|
||||
if (isset($_POST["formnameedit"])) {
|
||||
$formnameedit=$_POST["formnameedit"];
|
||||
}
|
||||
if (isset($_POST["formnameadd"])) {
|
||||
$formnameadd=$_POST["formnameadd"];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($formnameedit)) {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "certificationtype";
|
||||
$UpdateQuery->bindColumn("name_certification", "s", "".((isset($_POST["name_certification"]))?$_POST["name_certification"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("description", "s", "".((isset($_POST["description"]))?$_POST["description"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("rev", "s", "".((isset($_POST["rev"]))?$_POST["rev"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("date", "s", "".((isset($_POST["date"]))?$_POST["date"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("descriptionm30", "s", "".((isset($_POST["descriptionm30"]))?$_POST["descriptionm30"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("m30namecert", "s", "".((isset($_POST["m30namecert"]))?$_POST["m30namecert"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("revm30", "s", "".((isset($_POST["revm30"]))?$_POST["revm30"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("datem30", "s", "".((isset($_POST["datem30"]))?$_POST["datem30"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("description_en", "s", "".((isset($_POST["description_en"]))?$_POST["description_en"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("descriptionm30_en", "s", "".((isset($_POST["descriptionm30_en"]))?$_POST["descriptionm30_en"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idcertificationtype", "=", "i", "".($idcertificationtype) ."");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<?php
|
||||
$certlist = new WA_MySQLi_RS("certlist",$cmctrfdb,0);
|
||||
$certlist->setQuery("SELECT * FROM certificationtype");
|
||||
$certlist->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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">Gestione Tipi di Certificazione</h4>
|
||||
<p class="text-muted mb-3">Riferimenti certificazione</p>
|
||||
|
||||
|
||||
<br><br>
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome prima certificazione (No M30)</th>
|
||||
<th>flusso checkbox</th>
|
||||
<th>Descrizione (No M30)</th>
|
||||
<th>Revisione (No M30)</th>
|
||||
<th>Data (No M30)</th>
|
||||
<th>Nome M30</th>
|
||||
<th>Descrizione M30</th>
|
||||
<th>Revisione M30</th>
|
||||
<th>Data M30</th>
|
||||
|
||||
|
||||
<th><?php echo $action; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while(!$certlist->atEnd()) {
|
||||
$wa_startindex = $certlist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo($certlist->getColumnVal("name_certification")); ?></td>
|
||||
<td><?php echo($certlist->getColumnVal("certificationname")); ?></td>
|
||||
<td><?php echo($certlist->getColumnVal("description")); ?></td>
|
||||
<td><?php echo($certlist->getColumnVal("rev")); ?></td>
|
||||
<td><?php echo($certlist->getColumnVal("date")); ?></td>
|
||||
<td><?php echo($certlist->getColumnVal("m30namecert")); ?></td>
|
||||
<td><?php echo($certlist->getColumnVal("descriptionm30")); ?></td>
|
||||
<td><?php echo($certlist->getColumnVal("revm30")); ?></td>
|
||||
<td><?php echo($certlist->getColumnVal("datem30")); ?></td>
|
||||
|
||||
|
||||
|
||||
<td>
|
||||
<a href="edit-certtype.php?idcertificationtype=<?php echo($certlist->getColumnVal("idcertificationtype")); ?>" class="mr-2"><i class="fas fa-edit text-info font-16"></i></a>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$certlist->moveNext();
|
||||
}
|
||||
$certlist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,212 +0,0 @@
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
<?php
|
||||
if (isset($_POST["idstandards"])) {
|
||||
$idstandards=$_POST["idstandards"];
|
||||
}
|
||||
if (isset($_POST["formnameedit"])) {
|
||||
$formnameedit=$_POST["formnameedit"];
|
||||
}
|
||||
if (isset($_POST["formnameadd"])) {
|
||||
$formnameadd=$_POST["formnameadd"];
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
$charactlist = new WA_MySQLi_RS("charactlist",$cmctrfdb,1);
|
||||
$charactlist->setQuery("SELECT * FROM article_characteristic LEFT JOIN article_type ON article_type.idarticletype=article_characteristic.idarticletype");
|
||||
$charactlist->execute();
|
||||
?>
|
||||
<?php
|
||||
if (isset($formnameadd)) {
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "standards";
|
||||
$InsertQuery->bindColumn("fmidstandards", "i", "".((isset($_POST["fmcode"]))?$_POST["fmcode"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("standardname", "s", "".((isset($_POST["itastdname"]))?$_POST["itastdname"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("standardname_eng", "s", "".((isset($_POST["engstdname"]))?$_POST["engstdname"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("standardcode", "s", "".((isset($_POST["standardcode"]))?$_POST["standardcode"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idarticletype", "i", "".((isset($_POST["idarticletype"]))?$_POST["idarticletype"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idarticlecharacteristic", "i", "".((isset($_POST["articlecharact"]))?$_POST["articlecharact"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("virusset", "s", "".((isset($_POST["virusprotection"]))?$_POST["virusprotection"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("chemicalsset", "s", "".((isset($_POST["chemicalagent"]))?$_POST["chemicalagent"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<!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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">Gestione Caratteristiche articolo</h4>
|
||||
<p class="text-muted mb-3">Da questa pagina puoi aggiungere le caratteristiche articolo in modo che poi le potrai associare agli standards</p>
|
||||
|
||||
<a href="admin-standard.php"><button type="button" class="btn btn-primary waves-effect waves-light">STANDARDS</button></a>
|
||||
<br><br>
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome Caratteristica Articolo (ITA)</th>
|
||||
<th>Nome Caratteristica Articolo (ITA)</th>
|
||||
<th>Tipo Articolo</th>
|
||||
|
||||
|
||||
<th><?php echo $action; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while(!$charactlist->atEnd()) {
|
||||
$wa_startindex = $charactlist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo($charactlist->getColumnVal("name_articlecharacteristic")); ?></td>
|
||||
<td><?php echo($charactlist->getColumnVal("name_articlecharacteristic_eng")); ?></td>
|
||||
<td><?php echo($charactlist->getColumnVal("name_articletype")); ?></td>
|
||||
|
||||
|
||||
<td>
|
||||
<a href="edit-standard.php?idstandards=<?php echo($charactlist->getColumnVal("idarticlecharacteristic")); ?>" class="mr-2"><i class="fas fa-edit text-info font-16"></i></a>
|
||||
|
||||
|
||||
<!-- <a href="cancel-standard.php?idstd=<?php echo($charactlist->getColumnVal("idarticlecharacteristic")); ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a> -->
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$charactlist->moveNext();
|
||||
}
|
||||
$charactlist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,224 +0,0 @@
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
<?php
|
||||
if (isset($_POST["idarticlecharacteristic"])) {
|
||||
$idarticlecharacteristic=$_POST["idarticlecharacteristic"];
|
||||
}
|
||||
if (isset($_POST["formnameedit"])) {
|
||||
$formnameedit=$_POST["formnameedit"];
|
||||
}
|
||||
if (isset($_POST["formnameadd"])) {
|
||||
$formnameadd=$_POST["formnameadd"];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($formnameedit)) {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "article_characteristic";
|
||||
$UpdateQuery->bindColumn("name_articlecharacteristic", "s", "".((isset($_POST["name_articlecharacteristic"]))?$_POST["name_articlecharacteristic"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("name_articlecharacteristic_eng", "s", "".((isset($_POST["name_articlecharacteristic_eng"]))?$_POST["name_articlecharacteristic_eng"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("idarticletype", "i", "".((isset($_POST["idarticletype"]))?$_POST["idarticletype"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idarticlecharacteristic", "=", "i", "".($idarticlecharacteristic) ."");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
|
||||
|
||||
if (isset($formnameadd)) {
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "article_characteristic";
|
||||
$InsertQuery->bindColumn("name_articlecharacteristic", "s", "".((isset($_POST["name_articlecharacteristic"]))?$_POST["name_articlecharacteristic"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("name_articlecharacteristic_eng", "s", "".((isset($_POST["name_articlecharacteristic_eng"]))?$_POST["name_articlecharacteristic_eng"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idarticletype", "i", "".((isset($_POST["idarticletype"]))?$_POST["idarticletype"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$charactlist = new WA_MySQLi_RS("charactlist",$cmctrfdb,0);
|
||||
$charactlist->setQuery("SELECT * FROM article_characteristic LEFT JOIN article_type ON article_type.idarticletype=article_characteristic.idarticletype");
|
||||
$charactlist->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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">Gestione Caratteristiche articolo</h4>
|
||||
<p class="text-muted mb-3">Da questa pagina puoi aggiungere le caratteristiche articolo in modo che poi le potrai associare agli standards</p>
|
||||
|
||||
<a href="add-characteristic.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADD CHARACTERISTIC</button></a> <a href="admin-standards.php"><button type="button" class="btn btn-primary waves-effect waves-light">STANDARDS</button></a>
|
||||
|
||||
|
||||
<br><br>
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome Caratteristica Articolo (ITA)</th>
|
||||
<th>Nome Caratteristica Articolo (ENG)</th>
|
||||
<th>Tipo Articolo</th>
|
||||
|
||||
|
||||
<th><?php echo $action; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while(!$charactlist->atEnd()) {
|
||||
$wa_startindex = $charactlist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo($charactlist->getColumnVal("name_articlecharacteristic")); ?></td>
|
||||
<td><?php echo($charactlist->getColumnVal("name_articlecharacteristic_eng")); ?></td>
|
||||
<td><?php echo($charactlist->getColumnVal("name_articletype")); ?></td>
|
||||
|
||||
|
||||
<td>
|
||||
<a href="edit-characteristic.php?idarticlecharacteristic=<?php echo($charactlist->getColumnVal("idarticlecharacteristic")); ?>" class="mr-2"><i class="fas fa-edit text-info font-16"></i></a>
|
||||
|
||||
|
||||
<!-- <a href="cancel-standard.php?idstd=<?php echo($charactlist->getColumnVal("idarticlecharacteristic")); ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a> -->
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$charactlist->moveNext();
|
||||
}
|
||||
$charactlist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,220 +0,0 @@
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
<?php
|
||||
if (isset($_POST["idchemicalagent"])) {
|
||||
$idchemicalagent=$_POST["idchemicalagent"];
|
||||
}
|
||||
if (isset($_POST["formnameedit"])) {
|
||||
$formnameedit=$_POST["formnameedit"];
|
||||
}
|
||||
if (isset($_POST["formnameadd"])) {
|
||||
$formnameadd=$_POST["formnameadd"];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($formnameedit)) {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "chemicalagent";
|
||||
$UpdateQuery->bindColumn("name_chemicalagent", "s", "".((isset($_POST["name_chemicalagent"]))?$_POST["name_chemicalagent"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("name_chemicalagent_en", "s", "".((isset($_POST["name_chemicalagent_en"]))?$_POST["name_chemicalagent_en"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idchemicalagent", "=", "i", "".($idchemicalagent) ."");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
|
||||
|
||||
if (isset($formnameadd)) {
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "chemicalagent";
|
||||
$InsertQuery->bindColumn("name_chemicalagent", "s", "".((isset($_POST["name_chemicalagent"]))?$_POST["name_chemicalagent"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("name_chemicalagent_en", "s", "".((isset($_POST["name_chemicalagent_en"]))?$_POST["name_chemicalagent_en"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$chemlist = new WA_MySQLi_RS("chemlist",$cmctrfdb,0);
|
||||
$chemlist->setQuery("SELECT * FROM chemicalagent ORDER BY chemicalagent.name_chemicalagent");
|
||||
$chemlist->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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">Gestione CHEMICAL AGENTS</h4>
|
||||
|
||||
|
||||
<a href="add-chemical.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADD CHEMICAL AGENT</button></a> <a href="admin-dashboard.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADMIN DASHBOARD</button></a>
|
||||
|
||||
|
||||
<br><br>
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome Chemical Agent (ITA)</th>
|
||||
<th>Nome Chemical Agent (ENG)</th>
|
||||
|
||||
|
||||
<th><?php echo $action; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while(!$chemlist->atEnd()) {
|
||||
$wa_startindex = $chemlist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo($chemlist->getColumnVal("name_chemicalagent")); ?></td>
|
||||
<td><?php echo($chemlist->getColumnVal("name_chemicalagent_en")); ?></td>
|
||||
|
||||
|
||||
<td>
|
||||
<a href="edit-chemical.php?idchemicalagent=<?php echo($chemlist->getColumnVal("idchemicalagent")); ?>" class="mr-2"><i class="fas fa-edit text-info font-16"></i></a>
|
||||
|
||||
|
||||
<!-- <a href="cancel-standard.php?idstd=<?php echo($chemlist->getColumnVal("idchemicalagent")); ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a> -->
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$chemlist->moveNext();
|
||||
}
|
||||
$chemlist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,130 +0,0 @@
|
||||
|
||||
<?php
|
||||
include('include/headscript.php');
|
||||
?>
|
||||
|
||||
<!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" />
|
||||
|
||||
</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-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="media">
|
||||
<img src="upload/users/<?php echo $avatarname; ?>" alt="" class="thumb-md rounded-circle mr-2">
|
||||
<div class="media-body align-self-center">
|
||||
<h4 class="mt-0 mb-1"><?php echo $welcomeuser; ?><?php echo $nameuser; ?></h4>
|
||||
<p class="text-muted mb-0 font-14 pr-5">Questo è il pannello amministrazione</p>
|
||||
</div><!--end media-body-->
|
||||
</div><!--end media-->
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title mt-0">Pannello amministrazione</h4>
|
||||
<div id="CrmDashChart" class=""></div>
|
||||
|
||||
<a href="admin-certtype.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADMIN CERTIFICATION TYPE</button></a> <a href="admin-standards.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADMIN STANDARDS</button></a> <a href="admin-requirements.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADMIN ADD REQUIREMENTS</button></a>
|
||||
|
||||
<br><br>
|
||||
<a href="admin-protcat.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADMIN PROTECTION CATEGORY</button></a> <a href="admin-dpicat.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADMIN DPI CATEGORY</button></a> <a href="admin-chemical.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADMIN CHEMICALS</button></a>
|
||||
|
||||
<br><br>
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--end row-->
|
||||
|
||||
</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>
|
||||
@ -1,224 +0,0 @@
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
<?php
|
||||
if (isset($_POST["iddpicategory"])) {
|
||||
$iddpicategory=$_POST["iddpicategory"];
|
||||
}
|
||||
if (isset($_POST["formnameedit"])) {
|
||||
$formnameedit=$_POST["formnameedit"];
|
||||
}
|
||||
if (isset($_POST["formnameadd"])) {
|
||||
$formnameadd=$_POST["formnameadd"];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($formnameedit)) {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "dpicategory";
|
||||
$UpdateQuery->bindColumn("value_dpicategory", "s", "".((isset($_POST["value_dpicategory"]))?$_POST["value_dpicategory"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("value_dpicategory_en", "s", "".((isset($_POST["value_dpicategory_en"]))?$_POST["value_dpicategory_en"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("idarticletype", "i", "".((isset($_POST["idarticletype"]))?$_POST["idarticletype"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("iddpicategory", "=", "i", "".($iddpicategory) ."");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
|
||||
|
||||
if (isset($formnameadd)) {
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "dpicategory";
|
||||
$InsertQuery->bindColumn("value_dpicategory", "s", "".((isset($_POST["value_dpicategory"]))?$_POST["value_dpicategory"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("value_dpicategory_en", "s", "".((isset($_POST["value_dpicategory_en"]))?$_POST["value_dpicategory_en"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idarticletype", "i", "".((isset($_POST["idarticletype"]))?$_POST["idarticletype"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$dpilist = new WA_MySQLi_RS("dpilist",$cmctrfdb,0);
|
||||
$dpilist->setQuery("SELECT * FROM dpicategory LEFT JOIN article_type ON article_type.idarticletype=dpicategory.idarticletype ORDER BY dpicategory.idarticletype");
|
||||
$dpilist->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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">Gestione DPI Category </h4>
|
||||
<p class="text-muted mb-3">Da questa pagina puoi gestire DPI Category da associare poi agli standard</p>
|
||||
|
||||
<a href="add-dpicat.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADD DPI CATEGORY</button></a> <a href="admin-dashboard.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADMIN DASHBOARD</button></a>
|
||||
|
||||
|
||||
<br><br>
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome Protection Category (ITA)</th>
|
||||
<th>Nome Protection Category (ENG)</th>
|
||||
<th>Tipo Articolo</th>
|
||||
|
||||
|
||||
<th><?php echo $action; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while(!$dpilist->atEnd()) {
|
||||
$wa_startindex = $dpilist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo($dpilist->getColumnVal("value_dpicategory")); ?></td>
|
||||
<td><?php echo($dpilist->getColumnVal("value_dpicategory_en")); ?></td>
|
||||
<td><?php echo($dpilist->getColumnVal("name_articletype")); ?></td>
|
||||
|
||||
|
||||
<td>
|
||||
<a href="edit-dpicat.php?iddpicategory=<?php echo($dpilist->getColumnVal("iddpicategory")); ?>" class="mr-2"><i class="fas fa-edit text-info font-16"></i></a>
|
||||
|
||||
|
||||
<!-- <a href="cancel-standard.php?idstd=<?php echo($dpilist->getColumnVal("iddpicategory")); ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a> -->
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$dpilist->moveNext();
|
||||
}
|
||||
$dpilist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,224 +0,0 @@
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
<?php
|
||||
if (isset($_POST["idprotectioncategory"])) {
|
||||
$idprotectioncategory=$_POST["idprotectioncategory"];
|
||||
}
|
||||
if (isset($_POST["formnameedit"])) {
|
||||
$formnameedit=$_POST["formnameedit"];
|
||||
}
|
||||
if (isset($_POST["formnameadd"])) {
|
||||
$formnameadd=$_POST["formnameadd"];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($formnameedit)) {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "protectioncategory";
|
||||
$UpdateQuery->bindColumn("name_protectioncategory", "s", "".((isset($_POST["name_protectioncategory"]))?$_POST["name_protectioncategory"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("name_protectioncategory_en", "s", "".((isset($_POST["name_protectioncategory_en"]))?$_POST["name_protectioncategory_en"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("idarticletype", "i", "".((isset($_POST["idarticletype"]))?$_POST["idarticletype"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idprotectioncategory", "=", "i", "".($idprotectioncategory) ."");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
|
||||
|
||||
if (isset($formnameadd)) {
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "protectioncategory";
|
||||
$InsertQuery->bindColumn("name_protectioncategory", "s", "".((isset($_POST["name_protectioncategory"]))?$_POST["name_protectioncategory"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("name_protectioncategory_en", "s", "".((isset($_POST["name_protectioncategory_en"]))?$_POST["name_protectioncategory_en"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idarticletype", "i", "".((isset($_POST["idarticletype"]))?$_POST["idarticletype"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$protlist = new WA_MySQLi_RS("protlist",$cmctrfdb,0);
|
||||
$protlist->setQuery("SELECT * FROM protectioncategory LEFT JOIN article_type ON article_type.idarticletype=protectioncategory.idarticletype ORDER BY protectioncategory.idarticletype");
|
||||
$protlist->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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">Gestione Protection Category articolo</h4>
|
||||
<p class="text-muted mb-3">Da questa pagina puoi gestire le Protection Category in modo che poi le potrai associare agli standards</p>
|
||||
|
||||
<a href="add-protcat.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADD PROTECTION CATEGORY</button></a> <a href="admin-dashboard.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADMIN DASHBOARD</button></a>
|
||||
|
||||
|
||||
<br><br>
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome Protection Category (ITA)</th>
|
||||
<th>Nome Protection Category (ENG)</th>
|
||||
<th>Tipo Articolo</th>
|
||||
|
||||
|
||||
<th><?php echo $action; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while(!$protlist->atEnd()) {
|
||||
$wa_startindex = $protlist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo($protlist->getColumnVal("name_protectioncategory")); ?></td>
|
||||
<td><?php echo($protlist->getColumnVal("name_protectioncategory_en")); ?></td>
|
||||
<td><?php echo($protlist->getColumnVal("name_articletype")); ?></td>
|
||||
|
||||
|
||||
<td>
|
||||
<a href="edit-protcat.php?idprotectioncategory=<?php echo($protlist->getColumnVal("idprotectioncategory")); ?>" class="mr-2"><i class="fas fa-edit text-info font-16"></i></a>
|
||||
|
||||
|
||||
<!-- <a href="cancel-standard.php?idstd=<?php echo($protlist->getColumnVal("idprotectioncategory")); ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a> -->
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$protlist->moveNext();
|
||||
}
|
||||
$protlist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,224 +0,0 @@
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
<?php
|
||||
if (isset($_POST["idadditionalrequirements"])) {
|
||||
$idadditionalrequirements=$_POST["idadditionalrequirements"];
|
||||
}
|
||||
if (isset($_POST["formnameedit"])) {
|
||||
$formnameedit=$_POST["formnameedit"];
|
||||
}
|
||||
if (isset($_POST["formnameadd"])) {
|
||||
$formnameadd=$_POST["formnameadd"];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($formnameedit)) {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "additionalrequirements";
|
||||
$UpdateQuery->bindColumn("name_additionalrequirements_it", "s", "".((isset($_POST["name_additionalrequirements_it"]))?$_POST["name_additionalrequirements_it"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("name_additionalrequirements_en", "s", "".((isset($_POST["name_additionalrequirements_en"]))?$_POST["name_additionalrequirements_en"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("idarticletype", "i", "".((isset($_POST["idarticletype"]))?$_POST["idarticletype"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idadditionalrequirements", "=", "i", "".($idadditionalrequirements) ."");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
|
||||
|
||||
if (isset($formnameadd)) {
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "additionalrequirements";
|
||||
$InsertQuery->bindColumn("name_additionalrequirements_it", "s", "".((isset($_POST["name_additionalrequirements_it"]))?$_POST["name_additionalrequirements_it"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("name_additionalrequirements_en", "s", "".((isset($_POST["name_additionalrequirements_en"]))?$_POST["name_additionalrequirements_en"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idarticletype", "i", "".((isset($_POST["idarticletype"]))?$_POST["idarticletype"]:"") ."", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$requlist = new WA_MySQLi_RS("requlist",$cmctrfdb,0);
|
||||
$requlist->setQuery("SELECT * FROM additionalrequirements LEFT JOIN article_type ON article_type.idarticletype=additionalrequirements.idarticletype ORDER BY additionalrequirements.idarticletype");
|
||||
$requlist->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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">Gestione Requirements articolo</h4>
|
||||
<p class="text-muted mb-3">Da questa pagina puoi i requirements in modo che poi le potrai associare agli standards</p>
|
||||
|
||||
<a href="add-requirements.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADD REQUIREMENTS</button></a> <a href="admin-dashboard.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADMIN DASHBOARD</button></a>
|
||||
|
||||
|
||||
<br><br>
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome Requirements (ITA)</th>
|
||||
<th>Nome Requirements (ENG)</th>
|
||||
<th>Tipo Articolo</th>
|
||||
|
||||
|
||||
<th><?php echo $action; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while(!$requlist->atEnd()) {
|
||||
$wa_startindex = $requlist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo($requlist->getColumnVal("name_additionalrequirements_it")); ?></td>
|
||||
<td><?php echo($requlist->getColumnVal("name_additionalrequirements_en")); ?></td>
|
||||
<td><?php echo($requlist->getColumnVal("name_articletype")); ?></td>
|
||||
|
||||
|
||||
<td>
|
||||
<a href="edit-req.php?idadditionalrequirements=<?php echo($requlist->getColumnVal("idadditionalrequirements")); ?>" class="mr-2"><i class="fas fa-edit text-info font-16"></i></a>
|
||||
|
||||
|
||||
<!-- <a href="cancel-standard.php?idstd=<?php echo($requlist->getColumnVal("idadditionalrequirements")); ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a> -->
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$requlist->moveNext();
|
||||
}
|
||||
$requlist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,250 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
<?php
|
||||
if (isset($_POST["idstandards"])) {
|
||||
$idstandards = $_POST["idstandards"];
|
||||
}
|
||||
if (isset($_POST["formnameedit"])) {
|
||||
$formnameedit = $_POST["formnameedit"];
|
||||
}
|
||||
if (isset($_POST["formnameadd"])) {
|
||||
$formnameadd = $_POST["formnameadd"];
|
||||
}
|
||||
|
||||
|
||||
if (isset($formnameedit)) {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "standards";
|
||||
$UpdateQuery->bindColumn("fmidstandards", "i", "" . ((isset($_POST["fmcode"])) ? $_POST["fmcode"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("standardname", "s", "" . ((isset($_POST["itastdname"])) ? $_POST["itastdname"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("standardname_eng", "s", "" . ((isset($_POST["engstdname"])) ? $_POST["engstdname"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("standardcode", "s", "" . ((isset($_POST["standardcode"])) ? $_POST["standardcode"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("idarticletype", "i", "" . ((isset($_POST["idarticletype"])) ? $_POST["idarticletype"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("idarticlecharacteristic", "i", "" . ((isset($_POST["articlecharact"])) ? $_POST["articlecharact"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("iddpicategory", "i", "" . ((isset($_POST["categorydpi"])) ? $_POST["categorydpi"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("virusset", "s", "" . ((isset($_POST["virusprotection"])) ? $_POST["virusprotection"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("chemicalsset", "s", "" . ((isset($_POST["chemicalagent"])) ? $_POST["chemicalagent"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("active", "s", "" . ((isset($_POST["active"])) ? $_POST["active"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idstandards", "=", "i", "" . ($idstandards) . "");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (isset($formnameadd)) {
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "standards";
|
||||
$InsertQuery->bindColumn("fmidstandards", "i", "" . ((isset($_POST["fmcode"])) ? $_POST["fmcode"] : "") . "", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("standardname", "s", "" . ((isset($_POST["itastdname"])) ? $_POST["itastdname"] : "") . "", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("standardname_eng", "s", "" . ((isset($_POST["engstdname"])) ? $_POST["engstdname"] : "") . "", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("standardcode", "s", "" . ((isset($_POST["standardcode"])) ? $_POST["standardcode"] : "") . "", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idarticletype", "i", "" . ((isset($_POST["idarticletype"])) ? $_POST["idarticletype"] : "") . "", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idarticlecharacteristic", "i", "" . ((isset($_POST["articlecharact"])) ? $_POST["articlecharact"] : "") . "", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("virusset", "s", "" . ((isset($_POST["virusprotection"])) ? $_POST["virusprotection"] : "") . "", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("chemicalsset", "s", "" . ((isset($_POST["chemicalagent"])) ? $_POST["chemicalagent"] : "") . "", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : "";
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$standardlist = new WA_MySQLi_RS("standardlist", $cmctrfdb, 0);
|
||||
$standardlist->setQuery("SELECT * FROM standards LEFT JOIN article_type ON article_type.idarticletype=standards.idarticletype LEFT JOIN article_characteristic ON article_characteristic.idarticlecharacteristic=standards.idarticlecharacteristic LEFT JOIN dpicategory ON dpicategory.iddpicategory=standards.iddpicategory ORDER BY standards.idarticletype, standards.standardcode");
|
||||
$standardlist->execute();
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?php echo $titlepage; ?> </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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">Gestione Standards</h4>
|
||||
<p class="text-muted mb-3">Da questa pagina puoi gestire gli standards e tutti i dati correlati</p>
|
||||
|
||||
<a href="add-standard.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADD STANDARDS</button></a> <a href="admin-characteristic.php"><button type="button" class="btn btn-primary waves-effect waves-light">ADD CHARACTERISTIC</button></a>
|
||||
<br><br>
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Tipo Articolo</th>
|
||||
<th>Standard</th>
|
||||
<th>FM Code</th>
|
||||
<th>Caratteristiche</th>
|
||||
|
||||
<th>Virus</th>
|
||||
<th>Chemical</th>
|
||||
<th>Active</th>
|
||||
|
||||
<th><?php echo $action; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$standardlist->atEnd()) {
|
||||
$wa_startindex = $standardlist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo ($standardlist->getColumnVal("name_articletype")); ?></td>
|
||||
<td><?php echo ($standardlist->getColumnVal("standardcode")); ?></td>
|
||||
<td><?php echo ($standardlist->getColumnVal("fmidstandards")); ?></td>
|
||||
<td><?php echo ($standardlist->getColumnVal("name_articlecharacteristic")); ?></td>
|
||||
|
||||
|
||||
<td><?php
|
||||
|
||||
if ($standardlist->getColumnVal("virusset") == "Y") { ?>
|
||||
<div class="col-sm-6 col-md-4 col-xl-3">
|
||||
<i class="fas fa-check"></i>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td><?php if ($standardlist->getColumnVal("chemicalsset") == "Y") { ?>
|
||||
<div class="col-sm-6 col-md-4 col-xl-3">
|
||||
<i class="fas fa-check"></i>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td><?php echo ($standardlist->getColumnVal("active")); ?></td>
|
||||
<td>
|
||||
<a href="edit-standard.php?idstandards=<?php echo ($standardlist->getColumnVal("idstandards")); ?>" class="mr-2"><i class="fas fa-edit text-info font-16"></i></a>
|
||||
<a href="edit-protcategory.php?idstandards=<?php echo ($standardlist->getColumnVal("idstandards")); ?>">PC</a>
|
||||
<a href="edit-dpicategory.php?idstandards=<?php echo ($standardlist->getColumnVal("idstandards")); ?>">DC</a>
|
||||
<a href="edit-requirements.php?idstandards=<?php echo ($standardlist->getColumnVal("idstandards")); ?>">REQ</a>
|
||||
<!-- <a href="cancel-standard.php?idstd=<?php echo ($standardlist->getColumnVal("idstandards")); ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a> -->
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$standardlist->moveNext();
|
||||
}
|
||||
$standardlist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
|
Before Width: | Height: | Size: 6.6 KiB |
@ -1,37 +0,0 @@
|
||||
// ajax script for getting state data
|
||||
$(document).on('change','#country', function(){
|
||||
var countryID = $(this).val();
|
||||
if(countryID){
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
url:'backend-script.php',
|
||||
data:{'idarticletype':countryID},
|
||||
success:function(result){
|
||||
$('#state').html(result);
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$('#state').html('<option value="">Country</option>');
|
||||
$('#city').html('<option value=""> State </option>');
|
||||
}
|
||||
});
|
||||
|
||||
// ajax script for getting city data
|
||||
$(document).on('change','#state', function(){
|
||||
var stateID = $(this).val();
|
||||
if(stateID){
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
url:'backend-script.php',
|
||||
data:{'state_id':stateID},
|
||||
success:function(result){
|
||||
$('#city').html(result);
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$('#city').html('<option value="">City</option>');
|
||||
|
||||
}
|
||||
});
|
||||
@ -1,57 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript.php');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$requiredParams = [
|
||||
'description_identificationparts', 'article_identificationparts',
|
||||
'color_identificationparts',
|
||||
'idtrfdetails', 'kindoftest', 'ididentificationparts'
|
||||
];
|
||||
|
||||
foreach ($requiredParams as $param) {
|
||||
if (! in_array($param, array_keys($_POST)) || empty($_POST[$param])) {
|
||||
$response = json_encode([
|
||||
'status' => 'failed',
|
||||
'message' => "Mandatory field is missing !({$param})"
|
||||
]);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo $response;
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "identificationparts";
|
||||
$UpdateQuery->bindColumn("description_identificationparts", "s", "{$_POST['description_identificationparts']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("article_identificationparts", "s", "{$_POST['article_identificationparts']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("color_identificationparts", "s", "{$_POST['color_identificationparts']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("cmcreportnumber_identificationparts", "s", "{$_POST['cmcreportnumber_identificationparts']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("cmcreportdate_identificationparts", "s", "{$_POST['cmcreportdate_identificationparts']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("thirdlabreportnumber_identificationparts", "s", "{$_POST['thirdlabreportnumber_identificationparts']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("thirdlabreportdate_identificationparts", "s", "{$_POST['thirdlabreportdate_identificationparts']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("idtrfdetails", "i", "{$_POST['idtrfdetails']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("kindoftest", "s", "{$_POST['kindoftest']}", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("ididentificationparts", "=", "i", "{$_POST['ididentificationparts']}");
|
||||
|
||||
try {
|
||||
$UpdateQuery->execute();
|
||||
$response = json_encode([
|
||||
'status' => 'success'
|
||||
]);
|
||||
} catch (Exception $e) {
|
||||
$response = json_encode([
|
||||
'status' => 'failed',
|
||||
'message' => $e->getMessage()
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
$response = json_encode([
|
||||
'status' => 'failed',
|
||||
'message' => 'Method not allowed'
|
||||
]);
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo $response;
|
||||
@ -1,57 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript.php');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$requiredParams = [
|
||||
'description_identificationparts', 'article_identificationparts',
|
||||
'color_identificationparts',
|
||||
'idtrfdetails', 'kindoftest', 'ididentificationparts'
|
||||
];
|
||||
|
||||
foreach ($requiredParams as $param) {
|
||||
if (! in_array($param, array_keys($_POST)) || empty($_POST[$param])) {
|
||||
$response = json_encode([
|
||||
'status' => 'failed',
|
||||
'message' => "Mandatory field is missing !({$param})"
|
||||
]);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo $response;
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "identificationparts";
|
||||
$UpdateQuery->bindColumn("description_identificationparts", "s", "{$_POST['description_identificationparts']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("article_identificationparts", "s", "{$_POST['article_identificationparts']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("color_identificationparts", "s", "{$_POST['color_identificationparts']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("cmcreportnumber_identificationparts", "s", "{$_POST['cmcreportnumber_identificationparts']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("cmcreportdate_identificationparts", "s", "{$_POST['cmcreportdate_identificationparts']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("thirdlabreportnumber_identificationparts", "s", "{$_POST['thirdlabreportnumber_identificationparts']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("thirdlabreportdate_identificationparts", "s", "{$_POST['thirdlabreportdate_identificationparts']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("idtrfdetails", "i", "{$_POST['idtrfdetails']}", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("kindoftest", "s", "abc", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("ididentificationparts", "=", "i", "{$_POST['ididentificationparts']}");
|
||||
|
||||
try {
|
||||
$UpdateQuery->execute();
|
||||
$response = json_encode([
|
||||
'status' => 'success'
|
||||
]);
|
||||
} catch (Exception $e) {
|
||||
$response = json_encode([
|
||||
'status' => 'failed',
|
||||
'message' => $e->getMessage()
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
$response = json_encode([
|
||||
'status' => 'failed',
|
||||
'message' => 'Method not allowed'
|
||||
]);
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo $response;
|
||||
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
require('db_config.php');
|
||||
|
||||
|
||||
$sql = "SELECT * FROM demo_cities
|
||||
WHERE state_id LIKE '%".$_GET['id']."%'";
|
||||
|
||||
|
||||
$result = $mysqli->query($sql);
|
||||
|
||||
|
||||
$json = [];
|
||||
while($row = $result->fetch_assoc()){
|
||||
$json[$row['id']] = $row['name'];
|
||||
}
|
||||
|
||||
|
||||
echo json_encode($json);
|
||||
?>
|
||||
@ -1,165 +0,0 @@
|
||||
|
||||
<?php if (isset($_GET['idcertificate'])) {
|
||||
$idcertificate=$_GET['idcertificate']; ?>
|
||||
<?php if ($idcertificate=="2") { ?>
|
||||
<div id="alertcertification" class="modal fade">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><?php echo $certificatealertm15c; ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-warning border-0" role="alert">
|
||||
<strong><?php echo $certificatealertmesm15c; ?></strong>
|
||||
</div>
|
||||
<div class="alert alert-link border-0" role="alert">
|
||||
<strong><?php echo $certificatealertmesm15ca; ?></strong><br>
|
||||
<strong><?php echo $certificatealertmesm15cb; ?></strong>
|
||||
</div>
|
||||
|
||||
<!-- <button type="submit" class="btn btn-success" data-dismiss="modal"><?php echo $confirmalert; ?></button> -->
|
||||
<a href="typeofcertificate5.php?idcertificate=<?php echo $idcertificate;?>&idtrf=<?php echo $idtrf;?>&proc=confirmed"><button type="submit" class="btn btn-success"><?php echo $confirmalert; ?></button></a>
|
||||
<a href="typeofcertificate.php?varcertificate=0"><button type="submit" class="btn btn-danger"><?php echo $unconfirmalert; ?></button></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><?php } ?>
|
||||
|
||||
<?php if ($idcertificate=="3") { ?>
|
||||
<div id="alertcertification" class="modal fade">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><?php echo $certificatealertm15bm30s; ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-warning border-0" role="alert">
|
||||
<strong><?php echo $certificatealertmesm15bm30s; ?></strong>
|
||||
</div>
|
||||
<div class="alert alert-link border-0" role="alert">
|
||||
<strong><?php echo $certificatealertmesm15bm30sa; ?></strong><br>
|
||||
<strong><?php echo $certificatealertmesm15bm30sb; ?></strong><br>
|
||||
<strong><?php echo $certificatealertmesm15bm30sc; ?></strong><br>
|
||||
<strong><?php echo $certificatealertmesm15bm30sd; ?></strong><br>
|
||||
<strong><?php echo $certificatealertmesm15bm30se; ?></strong><br>
|
||||
</div>
|
||||
|
||||
<!-- <a href=""><button type="submit" class="btn btn-success" data-dismiss="modal"><?php echo $confirmalert; ?></button></a> -->
|
||||
<a href="typeofcertificate5.php?idcertificate=<?php echo $idcertificate;?>&idtrf=<?php echo $idtrf;?>&proc=confirmed"><button type="submit" class="btn btn-success"><?php echo $confirmalert; ?></button></a>
|
||||
<a href="typeofcertificate.php?varcertificate=0><button type="submit" class="btn btn-danger"><?php echo $unconfirmalert; ?></button></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><?php } ?>
|
||||
<!-- M15A M30S -->
|
||||
<?php if ($idcertificate=="4") { ?>
|
||||
<div id="alertcertification" class="modal fade">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><?php echo $certificatealertm15bm30s; ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-warning border-0" role="alert">
|
||||
<strong><?php echo $certificatealertmesm15am30s; ?></strong>
|
||||
</div>
|
||||
<div class="alert alert-link border-0" role="alert">
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <button type="submit" class="btn btn-success" data-dismiss="modal"><?php echo $confirmalert; ?></button> -->
|
||||
<a href="typeofcertificate5.php?idcertificate=<?php echo $idcertificate;?>&idtrf=<?php echo $idtrf;?>&proc=confirmed"><button type="submit" class="btn btn-success"><?php echo $confirmalert; ?></button></a>
|
||||
<a href="typeofcertificate.php?varcertificate=0"><button type="submit" class="btn btn-danger"><?php echo $unconfirmalert; ?></button></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><?php } ?>
|
||||
<!-- M18A -->
|
||||
<?php if ($idcertificate=="5") { ?>
|
||||
<div id="alertcertification" class="modal fade">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><?php echo $certificatealertm18a; ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-warning border-0" role="alert">
|
||||
<strong><?php echo $certificatealertmesm18a; ?></strong>
|
||||
</div>
|
||||
<div class="alert alert-link border-0" role="alert">
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <button type="submit" class="btn btn-success" data-dismiss="modal"><?php echo $confirmalert; ?></button> -->
|
||||
<a href="typeofcertificate5.php?idcertificate=<?php echo $idcertificate;?>&idtrf=<?php echo $idtrf;?>&proc=confirmed"><button type="submit" class="btn btn-success"><?php echo $confirmalert; ?></button></a>
|
||||
<a href="typeofcertificate.php?varcertificate=0"><button type="submit" class="btn btn-danger"><?php echo $unconfirmalert; ?></button></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><?php } ?>
|
||||
|
||||
<?php if ($idcertificate=="6") { ?>
|
||||
<div id="alertcertification" class="modal fade">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><?php echo $certificatealertm18a; ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-warning border-0" role="alert">
|
||||
<strong><?php echo $certificatealertmesm18a; ?></strong>
|
||||
</div>
|
||||
<div class="alert alert-link border-0" role="alert">
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <button type="submit" class="btn btn-success" data-dismiss="modal"><?php echo $confirmalert; ?></button> -->
|
||||
<a href="typeofcertificate5.php?idcertificate=<?php echo $idcertificate;?>&idtrf=<?php echo $idtrf;?>&proc=confirmed"><button type="submit" class="btn btn-success"><?php echo $confirmalert; ?></button></a>
|
||||
<a href="typeofcertificate.php?varcertificate=0"><button type="submit" class="btn btn-danger"><?php echo $unconfirmalert; ?></button></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><?php } ?>
|
||||
|
||||
<?php if ($idcertificate=="md") { ?>
|
||||
<div id="alertcertification" class="modal fade">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><?php echo $certificateforclient; ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-warning border-0" role="alert">
|
||||
<strong><?php echo $certificateforclientquestion; ?></strong>
|
||||
</div>
|
||||
<div class="alert alert-link border-0" role="alert">
|
||||
<?php echo $intermiedateclient; ?>
|
||||
</div>
|
||||
|
||||
<!-- <button type="submit" class="btn btn-success" data-dismiss="modal"><?php echo $confirmalert; ?></button> -->
|
||||
<a href="typeofcertificate5.php?idcertificate=<?php echo $idcertificate;?>&idtrf=<?php echo $idtrf;?>&proc=confirmed"><button type="submit" class="btn btn-success"><?php echo $confirmalert; ?></button></a>
|
||||
<a href="typeofcertificate.php?varcertificate=0"><button type="submit" class="btn btn-danger"><?php echo $unconfirmalert; ?></button></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><?php } ?>
|
||||
|
||||
<?php } ?>
|
||||
@ -1,463 +0,0 @@
|
||||
<?php require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
|
||||
<?php
|
||||
|
||||
include('include/headscript.php');
|
||||
include('languages/' . $_SESSION['langselect'] . '/tdgen.php');
|
||||
?>
|
||||
<?php
|
||||
$archivetdlist = new WA_MySQLi_RS("archivetdlist", $cmctrfdb, 0);
|
||||
$archivetdlist->setQuery("SELECT data_td.*, `trf-details`.*, data_td.zipname AS zipnametd FROM data_td LEFT JOIN `trf-details` ON `trf-details`.idtrfdetails=data_td.idtrf WHERE data_td.idcompany='$idcompany' AND data_td.signedontd IS NOT NULL ORDER BY data_td.signedontd");
|
||||
$archivetdlist->execute();
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
$drafttd = new WA_MySQLi_RS("drafttd", $cmctrfdb, 0);
|
||||
$drafttd->setQuery("SELECT * FROM data_td LEFT JOIN `trf-details` ON `trf-details`.idtrfdetails=data_td.idtrf WHERE data_td.idcompany='$idcompany' AND data_td.signedontd IS NULL ORDER BY data_td.signedontd");
|
||||
$drafttd->execute();
|
||||
$idtrftd = $drafttd->getColumnVal("idtrf");
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?php echo $titlepage; ?> </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">
|
||||
|
||||
<!-- DataTables -->
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="/media/images/favicon.png">
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://www.datatables.net/rss.xml">
|
||||
<link rel="stylesheet" type="text/css" href="/media/css/site-examples.css?_=8f7cff5ee7757412879aedf3efbfaee01">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/2.3.2/css/buttons.dataTables.min.css">
|
||||
<style type="text/css" class="init">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript" src="/media/js/site.js?_=1d5abd169416a09a2b389885211721dd" data-domain="datatables.net" data-api="https://plausible.sprymedia.co.uk/api/event"></script>
|
||||
<script src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>
|
||||
<script type="text/javascript" src="/media/js/dynamic.php?comments-page=extensions%2Fbuttons%2Fexamples%2Finitialisation%2Fexport.html" async></script>
|
||||
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/2.3.2/js/dataTables.buttons.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.html5.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.print.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-RqEzHvnvS1k5K5wzgp5yoWY5U6TD5EoXyj9iikETmdcy1G6dbCVa+ZmzBm7VWzmj8Ov7VwtA9x9X7VWjG8SRFg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<!--Form Wizard-->
|
||||
<link href="../plugins/jquery-steps/jquery.steps.css" rel="stylesheet" type="text/css">
|
||||
<link href="https://cdn.jsdelivr.net/npm/boxicons@2.0.7/css/boxicons.min.css" rel="stylesheet">
|
||||
|
||||
<!-- 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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
<script type="text/javascript" class="init">
|
||||
$(document).ready(function() {
|
||||
var table = $('#example').DataTable({
|
||||
pageLength: 20,
|
||||
order: [
|
||||
[0, 'desc']
|
||||
],
|
||||
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf'
|
||||
]
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('a.toggle-vis').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Get the column API object
|
||||
var column = table.column($(this).attr('data-column'));
|
||||
|
||||
// Toggle the visibility
|
||||
column.visible(!column.visible());
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" class="init">
|
||||
$(document).ready(function() {
|
||||
var table = $('#readytrf').DataTable({
|
||||
pageLength: 20,
|
||||
order: [
|
||||
[0, 'desc']
|
||||
],
|
||||
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf'
|
||||
]
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('a.toggle-vis').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Get the column API object
|
||||
var column = table.column($(this).attr('data-column'));
|
||||
|
||||
// Toggle the visibility
|
||||
column.visible(!column.visible());
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
document.getElementById('clonetrfalert').addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
if (confirm("Sei sicuro di voler andare al link clonetrf.php?")) {
|
||||
window.location.href = e.target.parentNode.href;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Top Bar Start -->
|
||||
|
||||
|
||||
|
||||
<!-- 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">
|
||||
|
||||
|
||||
|
||||
<!-- DRAFT TRF -->
|
||||
|
||||
<div class="card">
|
||||
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $drafttdtitle; ?></h4>
|
||||
|
||||
<table id="example" class="display table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>TD N.</th>
|
||||
<th>REV</th>
|
||||
<th>Description</th>
|
||||
<th>Status</th>
|
||||
<th><?php echo $action; ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$drafttd->atEnd()) {
|
||||
$wa_startindex = $drafttd->Index;
|
||||
?>
|
||||
<tr><?php $iddata_td = $drafttd->getColumnVal("iddata_td"); ?>
|
||||
<td><?php echo ($drafttd->getColumnVal("tdnumber")); ?></td>
|
||||
<td><?php if (($drafttd->getColumnVal("td_rev")) > 0) { ?>R<?php echo $drafttd->getColumnVal("td_rev");
|
||||
} ?></td>
|
||||
|
||||
<td><?php echo ($drafttd->getColumnVal("sample_description")); ?></td>
|
||||
|
||||
|
||||
<td><?php
|
||||
$statusnow = $drafttd->getColumnVal("statustd");
|
||||
if ($statusnow == "Draft") { ?>
|
||||
<div class="d-flex align-items-center text-danger"> <i class="bx bx-radio-circle-marked bx-burst bx-rotate-90 align-middle font-18 me-1"></i>
|
||||
<span>Draft</span>
|
||||
</div>
|
||||
<?php } elseif ($statusnow == "Revision") { ?>
|
||||
<div class="d-flex align-items-center text-warning"> <i class="bx bx-radio-circle-marked bx-burst bx-rotate-90 align-middle font-18 me-1"></i>
|
||||
<span>Revision</span>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="d-flex align-items-center text-primary"> <i class="bx bx-radio-circle-marked bx-burst bx-rotate-90 align-middle font-18 me-1"></i>
|
||||
<span>Waiting Sign</span>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td>
|
||||
<?php if ($statusnow == "Draft") { ?>
|
||||
<a href="techdossier_start.php?idtd=<?php echo $iddata_td; ?>&idtrftd=<?php echo $drafttd->getColumnVal("idtrf"); ?>"><button type="button" class="btn btn-danger waves-effect waves-danger"><?php echo $proceedtd; ?></button></a>
|
||||
</td>
|
||||
<?php } elseif ($statusnow == "Revision") { ?>
|
||||
<button type="button" class="btn btn-warning"><?php echo $waitingrevision; ?></button></td>
|
||||
<?php } else { ?>
|
||||
<a href="declarationtd.php?idtd=<?php echo $iddata_td; ?>&idtrftd=<?php echo $drafttd->getColumnVal("idtrf"); ?>""><button type=" button" class="btn btn-primary waves-effect waves-light"><?php echo $waitingsign; ?></button></a></td>
|
||||
<?php } ?>
|
||||
|
||||
<td>
|
||||
<a href="javascript:void(0);" onclick="confirmDeletion(<?php echo $iddata_td; ?>, '<?php echo $drafttd->getColumnVal("tdnumber"); ?>')">
|
||||
<i class="fas fa-trash-alt text-danger font-16"></i>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<script>
|
||||
function confirmDeletion(id, tdNumber) {
|
||||
Swal.fire({
|
||||
title: '<?php echo $areyousure; ?>',
|
||||
text: "<?php echo $proceeddeletetd; ?>" + tdNumber + "?",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: '<?php echo $yescancel; ?>',
|
||||
cancelButtonText: '<?php echo $nostop; ?>'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = "deletetd.php?idtd=" + id;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<?php
|
||||
$drafttd->moveNext();
|
||||
}
|
||||
$drafttd->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
|
||||
<!-- COMPLETE TRF -->
|
||||
|
||||
<div class="card">
|
||||
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $archivetd; ?></h4>
|
||||
|
||||
<table id="readytrf" class="display table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>TD N.</th>
|
||||
<th>REV</th>
|
||||
<th>Signed On</th>
|
||||
<th>Description</th>
|
||||
<th>Insert by</th>
|
||||
<th>PDF</th>
|
||||
<th>ZIP</th>
|
||||
<th>ACTION</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$archivetdlist->atEnd()) {
|
||||
$wa_startindex = $archivetdlist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo ($archivetdlist->getColumnVal("tdnumber")); ?></td>
|
||||
<td><?php if (($archivetdlist->getColumnVal("td_rev")) > 0) { ?>R<?php echo $archivetdlist->getColumnVal("td_rev");
|
||||
} ?></td>
|
||||
<td><?php echo ($archivetdlist->getColumnVal("signedontd")); ?></td>
|
||||
|
||||
<td><?php echo ($archivetdlist->getColumnVal("sample_description")); ?></td>
|
||||
|
||||
|
||||
|
||||
|
||||
<td><?php echo ($archivetdlist->getColumnVal("signametd")); ?></td>
|
||||
<td><a href="tdpdf/<?php echo $archivetdlist->getColumnVal("pdffilenametd"); ?>" target="_blank"><i class="fas fa-file-pdf text-danger font-20"></i></a></td>
|
||||
|
||||
<?php if (!empty($archivetdlist->getColumnVal("zipnametd"))) : ?>
|
||||
<td>
|
||||
<a href="uploadtddocuments/ziptd//<?php echo htmlspecialchars($archivetdlist->getColumnVal("zipnametd")); ?>" target="_blank">
|
||||
<i class="fas fa-file-archive text-warning font-20"></i>
|
||||
</a>
|
||||
</td>
|
||||
<?php else : ?>
|
||||
<td>N/A</td> <!-- o lascia vuoto se preferisci -->
|
||||
<?php endif; ?>
|
||||
|
||||
<td>
|
||||
<button type="button" onclick="
|
||||
Swal.fire({
|
||||
title: 'Sei sicuro di voler duplicare il TF N. <?php echo $archivetdlist->getColumnVal('tdnumber'); ?>?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, duplica!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='tdclone1step.php?idtrf=<?php echo $archivetdlist->getColumnVal('idtrfdetails'); ?>&idtd=<?php echo $archivetdlist->getColumnVal('iddata_td'); ?>';
|
||||
}
|
||||
});
|
||||
" class="btn btn-outline-warning waves-effect waves-light">
|
||||
<i class="far fa-copy"></i>
|
||||
</button>
|
||||
|
||||
<button type="button" onclick="
|
||||
Swal.fire({
|
||||
title: 'Sei sicuro di voler revisionare il TF N. <?php echo $archivetdlist->getColumnVal('tdnumber'); ?>?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, procedi!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='tdrev.php?idtrf=<?php echo $archivetdlist->getColumnVal('idtrfdetails'); ?>&idtd=<?php echo $archivetdlist->getColumnVal('iddata_td'); ?>';
|
||||
}
|
||||
});
|
||||
" class="btn btn-outline-danger waves-effect waves-light">
|
||||
Rev
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$archivetdlist->moveNext();
|
||||
}
|
||||
$archivetdlist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
|
||||
</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/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>
|
||||
@ -1,598 +0,0 @@
|
||||
<?php require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
|
||||
<?php
|
||||
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
$archivetrflist = new WA_MySQLi_RS("archivetrflist", $cmctrfdb, 0);
|
||||
$archivetrflist->setQuery("SELECT * FROM `trf-details`
|
||||
LEFT JOIN auth_users ON `trf-details`.iduser=auth_users.id
|
||||
LEFT JOIN article_type ON `trf-details`.idarticletype=article_type.idarticletype
|
||||
LEFT JOIN certificationtype ON certificationtype.idcertificationtype=`trf-details`.idcertification
|
||||
WHERE `trf-details`.idcompany='$idcompany'
|
||||
AND `trf-details`.signedon <> ''
|
||||
ORDER BY `trf-details`.trfnumber, `trf-details`.revtrf DESC");
|
||||
$archivetrflist->execute();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
$drafttrf = new WA_MySQLi_RS("drafttrf", $cmctrfdb, 0);
|
||||
$drafttrf->setQuery("SELECT * FROM `trf-details`
|
||||
LEFT JOIN article_type ON `trf-details`.idarticletype=article_type.idarticletype
|
||||
LEFT JOIN certificationtype ON certificationtype.idcertificationtype=`trf-details`.idcertification
|
||||
WHERE `trf-details`.idcompany='$idcompany'
|
||||
AND `trf-details`.signedon =''
|
||||
ORDER BY `trf-details`.trfnumber");
|
||||
$drafttrf->execute();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?php echo $titlepage; ?> </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">
|
||||
|
||||
<!-- DataTables -->
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="/media/images/favicon.png">
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://www.datatables.net/rss.xml">
|
||||
<link rel="stylesheet" type="text/css" href="/media/css/site-examples.css?_=8f7cff5ee7757412879aedf3efbfaee01">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/2.3.2/css/buttons.dataTables.min.css">
|
||||
<style type="text/css" class="init">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript" src="/media/js/site.js?_=1d5abd169416a09a2b389885211721dd" data-domain="datatables.net" data-api="https://plausible.sprymedia.co.uk/api/event"></script>
|
||||
<script src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>
|
||||
<script type="text/javascript" src="/media/js/dynamic.php?comments-page=extensions%2Fbuttons%2Fexamples%2Finitialisation%2Fexport.html" async></script>
|
||||
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/2.3.2/js/dataTables.buttons.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.html5.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.print.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-RqEzHvnvS1k5K5wzgp5yoWY5U6TD5EoXyj9iikETmdcy1G6dbCVa+ZmzBm7VWzmj8Ov7VwtA9x9X7VWjG8SRFg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<!--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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
<script type="text/javascript" class="init">
|
||||
$(document).ready(function() {
|
||||
var table = $('#example').DataTable({
|
||||
pageLength: 20,
|
||||
order: [
|
||||
[0, 'desc']
|
||||
],
|
||||
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf'
|
||||
]
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('a.toggle-vis').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Get the column API object
|
||||
var column = table.column($(this).attr('data-column'));
|
||||
|
||||
// Toggle the visibility
|
||||
column.visible(!column.visible());
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" class="init">
|
||||
$(document).ready(function() {
|
||||
var table = $('#readytrf').DataTable({
|
||||
pageLength: 20,
|
||||
order: [
|
||||
[0, 'desc']
|
||||
],
|
||||
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf'
|
||||
]
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('a.toggle-vis').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Get the column API object
|
||||
var column = table.column($(this).attr('data-column'));
|
||||
|
||||
// Toggle the visibility
|
||||
column.visible(!column.visible());
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
document.getElementById('clonetrfalert').addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
if (confirm("Sei sicuro di voler andare al link clonetrf.php?")) {
|
||||
window.location.href = e.target.parentNode.href;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.btn-active {
|
||||
border-color: #dc3545;
|
||||
color: #dc3545;
|
||||
}
|
||||
|
||||
.btn-inactive {
|
||||
border-color: #6c757d;
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
.btn-inactive:disabled {
|
||||
background-color: #e9ecef;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Top Bar Start -->
|
||||
|
||||
|
||||
|
||||
<!-- 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">
|
||||
|
||||
|
||||
|
||||
<!-- DRAFT TRF -->
|
||||
|
||||
<div class="card">
|
||||
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $drafttrftitle; ?></h4>
|
||||
|
||||
<table id="example" class="display table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>TRF N.</th>
|
||||
<th>REV</th>
|
||||
<th>Description</th>
|
||||
<th>Cert Type</th>
|
||||
<th>Article type</th>
|
||||
<th>To be Sign</th>
|
||||
<th><?php echo $action; ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$drafttrf->atEnd()) {
|
||||
$wa_startindex = $drafttrf->Index;
|
||||
?>
|
||||
<tr><?php $idtrf = $drafttrf->getColumnVal("idtrfdetails"); ?>
|
||||
<td><?php echo ($drafttrf->getColumnVal("trfnumber")); ?></td>
|
||||
<td><?php if (($drafttrf->getColumnVal("revtrf")) > 0) { ?>R<?php echo $drafttrf->getColumnVal("revtrf");
|
||||
} ?></td>
|
||||
|
||||
<td><?php echo ($drafttrf->getColumnVal("sample_description")); ?></td>
|
||||
<td><?php echo ($drafttrf->getColumnVal("name_certification")); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
// Assuming session_start() has been called previously if needed.
|
||||
$nameField = ($_SESSION['langselect'] == 'en') ? 'name_articletypeeng' : 'name_articletype';
|
||||
echo ($drafttrf->getColumnVal($nameField));
|
||||
?>
|
||||
</td>
|
||||
<td><?php
|
||||
$revcs = $drafttrf->getColumnVal("revcs");
|
||||
if ($revcs == 's') { ?>
|
||||
|
||||
<a href="declaration.php?idtrf=<?php echo $idtrf; ?>"><button type="button" class="btn btn-success waves-effect waves-light">SIGN</button></a>
|
||||
|
||||
</td>
|
||||
<td></td><?php } ?>
|
||||
|
||||
|
||||
<?php if ($drafttrf->getColumnVal("idcertification") == 5 && $drafttrf->getColumnVal("revcs") != 's') { ?>
|
||||
|
||||
<td><a href="typeofcertificate5.php?idtrf=<?php echo $idtrf; ?>"><button type="button" class="btn btn-info waves-effect waves-light"><?php echo $proceedtrf; ?></button></a></td>
|
||||
|
||||
<?php } elseif ($drafttrf->getColumnVal("idcertification") == 6 && $drafttrf->getColumnVal("revcs") != 's') { ?>
|
||||
|
||||
<td><a href="typeofcertificate6.php?idtrf=<?php echo $idtrf; ?>"><button type="button" class="btn btn-info waves-effect waves-light"><?php echo $proceedtrf; ?></button></a></td>
|
||||
|
||||
|
||||
<?php } elseif ($drafttrf->getColumnVal("revcs") != 's') { ?>
|
||||
<td><a href="trfdetails.php?idtrf=<?php echo $idtrf; ?>"><button type="button" class="btn btn-info waves-effect waves-light"><?php echo $proceedtrf; ?></button></a></td>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<td>
|
||||
<button type="button" onclick="
|
||||
Swal.fire({
|
||||
title: 'Sei sicuro di voler duplicare il TRF N. <?php echo $drafttrf->getColumnVal('trfnumber'); ?>?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, duplica!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='clonetrf.php?idtrf=<?php echo $drafttrf->getColumnVal('idtrfdetails'); ?>';
|
||||
}
|
||||
});
|
||||
" class="btn btn-outline-warning waves-effect waves-light">
|
||||
<i class="far fa-copy"></i>
|
||||
</button>
|
||||
<button type="button" onclick="
|
||||
Swal.fire({
|
||||
title: 'Sei sicuro di voler cancellare il Draft TRF N. <?php echo $drafttrf->getColumnVal('trfnumber'); ?>?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, procedi!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='deleteappform.php?idtrf=<?php echo $drafttrf->getColumnVal('idtrfdetails'); ?>';
|
||||
}
|
||||
});
|
||||
" class="btn btn-outline-danger waves-effect waves-light">
|
||||
<i class="fas fa-trash-alt text-danger font-16"></i>
|
||||
</button>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
$drafttrf->moveNext();
|
||||
}
|
||||
$drafttrf->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
|
||||
<!-- COMPLETE TRF -->
|
||||
|
||||
<div class="card">
|
||||
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $archivetrf; ?></h4>
|
||||
|
||||
<table id="readytrf" class="display table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>TRF N.</th>
|
||||
<th>REV</th>
|
||||
<th>Signed On</th>
|
||||
<th>Description</th>
|
||||
<th>Cert Type</th>
|
||||
<th>Article type</th>
|
||||
<th>Insert by</th>
|
||||
<th>PDF1</th>
|
||||
<th>PDF2</th>
|
||||
<th>ZIP</th>
|
||||
<th>ACTION</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
$last_trfnumber = null;
|
||||
$last_revtrf = -1;
|
||||
|
||||
while (!$archivetrflist->atEnd()) {
|
||||
|
||||
// without signed for rev
|
||||
$idtrf_nosign = $archivetrflist->getColumnVal("idtrfdetails");
|
||||
$trfnosign = $archivetrflist->getColumnVal("trfnumber");
|
||||
$archivetrflistnosign = new WA_MySQLi_RS("archivetrflistnosign", $cmctrfdb, 0);
|
||||
$archivetrflistnosign->setQuery("SELECT MAX(revtrf) as max_revtrf FROM `trf-details` WHERE `trf-details`.trfnumber='$trfnosign'");
|
||||
$archivetrflistnosign->execute();
|
||||
$maxrevtrf = $archivetrflistnosign->getColumnVal("max_revtrf");
|
||||
$currentrevtrf = $archivetrflist->getColumnVal("revtrf");
|
||||
$current_trfnumber = $archivetrflist->getColumnVal("trfnumber");
|
||||
$current_revtrf = $archivetrflist->getColumnVal("revtrf");
|
||||
|
||||
// Check if this is a new TRF number
|
||||
if ($last_trfnumber !== $current_trfnumber) {
|
||||
$last_trfnumber = $current_trfnumber;
|
||||
$last_revtrf = $current_revtrf;
|
||||
}
|
||||
$wa_startindex = $archivetrflist->Index;
|
||||
$idcertfortd = $archivetrflist->getColumnVal("idcertification")
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo ($archivetrflist->getColumnVal("trfnumber")); ?></td>
|
||||
<td><?php if (($archivetrflist->getColumnVal("revtrf")) > 0) { ?>R<?php echo $archivetrflist->getColumnVal("revtrf");
|
||||
} ?></td>
|
||||
<td><?php echo ($archivetrflist->getColumnVal("signedon")); ?></td>
|
||||
|
||||
<td><?php echo ($archivetrflist->getColumnVal("sample_description"));
|
||||
|
||||
?></td>
|
||||
<td><?php echo ($archivetrflist->getColumnVal("name_certification")); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
// Assuming session_start() has been called previously if needed.
|
||||
$nameField = ($_SESSION['langselect'] == 'en') ? 'name_articletypeeng' : 'name_articletype';
|
||||
echo ($archivetrflist->getColumnVal($nameField));
|
||||
?>
|
||||
</td>
|
||||
|
||||
|
||||
<td><?php echo ($archivetrflist->getColumnVal("email")); ?></td>
|
||||
<td><a href="pdf/<?php echo $archivetrflist->getColumnVal("pdffilename"); ?>" target="_blank"><i class="fas fa-file-pdf text-danger font-20"></i></a></td>
|
||||
<td><?php if (!empty($archivetrflist->getColumnVal("pdffilename2"))) { ?><a href="pdf/<?php echo $archivetrflist->getColumnVal("pdffilename2"); ?>" target="_blank"><i class="fas fa-file-pdf text-danger font-20"></i></a><?php } ?></td>
|
||||
<td><?php if (!empty($archivetrflist->getColumnVal("zipname"))) { ?><a href="uploaddocuments/zip/<?php echo $archivetrflist->getColumnVal("zipname"); ?>" target="_blank"><i class="fas fa-file-archive text-warning font-20"></i></a><?php } ?></td>
|
||||
<td>
|
||||
<button type="button" onclick="
|
||||
Swal.fire({
|
||||
title: 'Sei sicuro di voler duplicare il TRF N. <?php echo $archivetrflist->getColumnVal('trfnumber'); ?>?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, duplica!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='clonetrf.php?idtrf=<?php echo $archivetrflist->getColumnVal('idtrfdetails'); ?>';
|
||||
}
|
||||
});
|
||||
" class="btn <?php echo ($maxrevtrf > $currentrevtrf) ? 'btn-inactive' : 'btn-outline-warning'; ?> waves-effect waves-light" <?php echo ($maxrevtrf > $currentrevtrf) ? 'disabled' : ''; ?>>
|
||||
<i class="far fa-copy"></i>
|
||||
</button>
|
||||
|
||||
<button type="button" onclick="
|
||||
Swal.fire({
|
||||
title: 'Sei sicuro di voler revisionare il TRF N. <?php echo $archivetrflist->getColumnVal('trfnumber'); ?>?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, procedi!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='revtrf.php?idtrf=<?php echo $archivetrflist->getColumnVal('idtrfdetails'); ?>';
|
||||
}
|
||||
});
|
||||
" class="btn <?php echo ($maxrevtrf > $currentrevtrf) ? 'btn-inactive' : 'btn-active'; ?> waves-effect waves-light" <?php echo ($maxrevtrf > $currentrevtrf) ? 'disabled' : ''; ?>>
|
||||
Rev
|
||||
</button>
|
||||
|
||||
<?php if ((Auth::user()->hasRole('Admin')) || (Auth::user()->hasRole('CustomerService')) || (Auth::user()->hasRole('Superuser')) || (Auth::user()->hasRole('Certification')) || (Auth::user()->id == 178)) : ?>
|
||||
<?php
|
||||
if (!in_array($idcertfortd, [5, 6, 10])) {
|
||||
$idtrfdetailschk = $archivetrflist->getColumnVal('idtrfdetails');
|
||||
$ntrfdetailschk = $archivetrflist->getColumnVal('trfnumber');
|
||||
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
die("Connessione fallita: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
$query = "SELECT COUNT(*) AS count FROM data_td WHERE idtrf = ?";
|
||||
$stmt = $conn->prepare($query);
|
||||
|
||||
if ($stmt === false) {
|
||||
die("Errore nella preparazione della query: " . $conn->error);
|
||||
}
|
||||
|
||||
$stmt->bind_param("i", $idtrfdetailschk);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$rowcheck = $result->fetch_assoc();
|
||||
|
||||
if ($rowcheck['count'] < 1) {
|
||||
$buttonColor = '#ff9800';
|
||||
$onClick = "Swal.fire({
|
||||
title: 'Sei sicuro di voler creare il Fascicolo Tecnico per il TRF N. " . $ntrfdetailschk . "?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, procedi!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='techdossier_start.php?idtrftd=" . $idtrfdetailschk . "';
|
||||
}
|
||||
});";
|
||||
} else {
|
||||
$buttonColor = '#4CAF50';
|
||||
$onClick = "window.location.href='archivetd.php';";
|
||||
}
|
||||
|
||||
$stmt->close();
|
||||
$conn->close();
|
||||
?>
|
||||
|
||||
<button type="button" onclick="<?php echo $onClick; ?>" class="btn <?php echo ($maxrevtrf > $currentrevtrf) ? 'btn-inactive' : ''; ?>" style="border: 1px solid; color: white; background-color: <?php echo $buttonColor; ?>;" <?php echo ($maxrevtrf > $currentrevtrf) ? 'disabled' : ''; ?>>
|
||||
TF
|
||||
</button>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<button type="button" onclick="
|
||||
Swal.fire({
|
||||
title: 'Sei sicuro di voler cancellare il TRF N. <?php echo $archivetrflist->getColumnVal('trfnumber'); ?>?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, procedi!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='deleteappform.php?idtrf=<?php echo $archivetrflist->getColumnVal('idtrfdetails'); ?>';
|
||||
}
|
||||
});
|
||||
" class="btn btn-outline-danger waves-effect waves-light">
|
||||
<i class="fas fa-trash-alt text-danger font-16"></i>
|
||||
</button>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$archivetrflist->moveNext();
|
||||
}
|
||||
$archivetrflist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
|
||||
</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/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>
|
||||
@ -1,211 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf = $_POST["idtrf"];
|
||||
}
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf = $_GET["idtrf"];
|
||||
}
|
||||
if (isset($_GET["issuebycimac"])) {
|
||||
$issuebycimac = $_GET["issuebycimac"];
|
||||
}
|
||||
if (isset($_POST["manufnamevalue"])) {
|
||||
$manufnamevalue = $_POST["manufnamevalue"];
|
||||
}
|
||||
if (isset($_POST["manufform"])) {
|
||||
$manufform = $_POST["manufform"];
|
||||
} else {
|
||||
$manufform = "N";
|
||||
}
|
||||
|
||||
if (isset($_GET["codestep"])) {
|
||||
$code = $_GET["codestep"];
|
||||
}
|
||||
|
||||
if (isset($_GET["idauditdpi"])) {
|
||||
$idauditdpi = $_GET["idauditdpi"];
|
||||
}
|
||||
if (isset($_POST["idauditdpi"])) {
|
||||
$idauditdpi = $_POST["idauditdpi"];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?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");
|
||||
$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 ($manufform == "Y") {
|
||||
|
||||
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "auditmanufacturer";
|
||||
$InsertQuery->bindColumn("idtrfdetails", "i", "$idtrf", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("nameauditmanufacturer", "s", "$manufnamevalue", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idauditdpi", "i", "$idauditdpi", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$manufactlist = new WA_MySQLi_RS("manufactlist", $cmctrfdb, 0);
|
||||
$manufactlist->setQuery("SELECT * FROM auditmanufacturer WHERE auditmanufacturer.idauditdpi='$idauditdpi'");
|
||||
$manufactlist->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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
<!-- upload image script -->
|
||||
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="card">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $manufacturernameaudit; ?> - <?php echo $dpireportnumbertitle; ?> <?php echo $idtrf; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $manufacturernameaudit_help; ?></p>
|
||||
<p class="text-muted mb-3"><?php echo $manufacturernameaudit_help2; ?></p>
|
||||
<form class="was-validated" action="" method="post" name="myForm">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="manufnamevalue" class="col-form-label"><?php echo $manufnametitle; ?> - (Max 50 caratteri / chars)</label>
|
||||
<input class="form-control" type="text" value="" id="manufnamevalue" name="manufnamevalue" maxlength="50">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="manufform" id="manufform" value="Y">
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo ($trfnumberfinal->getColumnVal("idtrfdetails")); ?>">
|
||||
|
||||
<br><br>
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $addtitle; ?>">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div>
|
||||
|
||||
<!-- section file already uploaded -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $manufnametitleselected; ?></h4>
|
||||
|
||||
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $manufnametitle; ?></th>
|
||||
|
||||
<th><?php echo $action; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$manufactlist->atEnd()) {
|
||||
$wa_startindex = $manufactlist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo ($manufactlist->getColumnVal("nameauditmanufacturer")); ?></td>
|
||||
|
||||
<td>
|
||||
|
||||
<a href="deleteproducer.php?idtrf=<?php echo $idtrf; ?>&idauditdpi=<?php echo $idauditdpi; ?>&idauditmanufacturer=<?php echo ($manufactlist->getColumnVal("idauditmanufacturer")); ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$manufactlist->moveNext();
|
||||
}
|
||||
$manufactlist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table><br>
|
||||
|
||||
<button onclick="self.close()" type="button" class="btn btn-success waves-effect waves-light"><?php echo $closewindow; ?></button>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- end of page -->
|
||||
|
||||
|
||||
<!-- 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>
|
||||
@ -1,290 +0,0 @@
|
||||
<?php
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
|
||||
<?php
|
||||
|
||||
// include('include/headscript.php'); ?>
|
||||
|
||||
|
||||
<?php //insert query
|
||||
if (isset($_POST['adduser'])) {
|
||||
if (isset($_POST['first_name'])) { $first_name=$_POST['first_name']; }
|
||||
if (isset($_POST['last_name'])) { $last_name=$_POST['last_name']; }
|
||||
if (isset($_POST['emailuser'])) { $emailuser=$_POST['emailuser']; }
|
||||
if (isset($_POST['datein'])) { $datein=$_POST['datein']; }
|
||||
if (isset($_POST['language'])) { $langid=$_POST['language']; }
|
||||
?>
|
||||
<?php //insert query
|
||||
|
||||
$checkmail = new WA_MySQLi_RS("checkmail",$cmctrfdb,0);
|
||||
$checkmail->setQuery("SELECT * FROM auth_users WHERE auth_users.email='$emailuser'");
|
||||
$checkmail->execute();
|
||||
if(!empty($checkmail->getColumnVal("id"))) { $varmailrepeat='Y'; ?>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
|
||||
|
||||
$mysqli = new mysqli($hostname_cmctrfdb, $username_cmctrfdb, $password_cmctrfdb, $database_cmctrfdb);
|
||||
|
||||
|
||||
$query = "INSERT INTO auth_users (email, first_name, last_name, password, role_id, status, email_verified_at, created_at, updated_at, langid, termuseaccepted) VALUES ('$emailuser', '$first_name', '$last_name', '12345!AA', '2','Active','$datein','$datein','$datein','$langid', '$datein')";
|
||||
|
||||
// Esegui la query
|
||||
$mysqli->query($query);
|
||||
$inserttrue='Y';
|
||||
// Chiudi la connessione al database
|
||||
$mysqli->close();
|
||||
|
||||
|
||||
|
||||
|
||||
//Now include the following following files based
|
||||
//on the correct file path. Third file is required only if you want to enable SMTP.
|
||||
|
||||
require 'phpmailer/src/Exception.php';
|
||||
require 'phpmailer/src/PHPMailer.php';
|
||||
require 'phpmailer/src/SMTP.php';
|
||||
|
||||
//mail to client
|
||||
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = "smtp.office365.com"; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = "noreply@cimac.it"; // SMTP username
|
||||
$mail->Password = "Fol42937"; // SMTP password
|
||||
$mail->SMTPSecure = "tls"; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = 587;
|
||||
|
||||
$mmessage="mailnewuser";
|
||||
include('include/mailnewuser.php');
|
||||
// Email body content
|
||||
|
||||
|
||||
$htmlContent = $mailmessage1;
|
||||
|
||||
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addAddress($emailuser); // Add a recipient
|
||||
|
||||
|
||||
|
||||
$mail->Subject = "Creazione Nuovo Utente";
|
||||
$mail->Body = $htmlContent;
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
|
||||
|
||||
$mail->send();
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
|
||||
// mail to Marco for new user
|
||||
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
|
||||
|
||||
|
||||
// Email body content
|
||||
|
||||
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addBCC('m.piccolini@cimac.it'); // Add a recipient
|
||||
$mail->addBCC($csmail); // Add a recipient
|
||||
$mail->addBCC($csmail3);
|
||||
$mail->addBCC('info@acscreativesolutions.com');
|
||||
|
||||
|
||||
$mail->Subject = 'Nuovo Utente';
|
||||
$mail->Body = "Ciao! E' stato inserito un nuovo Utente $emailuser ";
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
|
||||
$mail->send();
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
|
||||
}}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>CIMAC Application Form</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
|
||||
<meta content="" name="author" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="../assets/images/favicon.ico">
|
||||
|
||||
<!-- 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" />
|
||||
|
||||
</head>
|
||||
|
||||
<body class="account-body accountbg">
|
||||
|
||||
<!-- Log In page -->
|
||||
<div class="container">
|
||||
<div class="row vh-100 ">
|
||||
<div class="col-12 align-self-center">
|
||||
<div class="auth-page">
|
||||
<div class="card auth-card shadow-lg">
|
||||
|
||||
<div class="card-body">
|
||||
<div class="px-3">
|
||||
<div>
|
||||
<a href="https://www.cimac.it/modulo_certificazione/public/login" class="logo logo-admin"><img src="assets/img/cimac-logo.png" height="55" alt="logo" class="auth-logo"></a>
|
||||
</div><!--end auth-logo-box-->
|
||||
|
||||
<div class="text-center auth-logo-text">
|
||||
<h4 class="mt-0 mb-3 mt-5">Registrazione CIMAC Application Form</h4>
|
||||
|
||||
</div> <!--end auth-logo-text-->
|
||||
|
||||
<?php if (isset($varmailrepeat)) { ?>
|
||||
<div class="alert icon-custom-alert alert-outline-pink b-round fade show" role="alert">
|
||||
<i class="mdi mdi-alert-outline alert-icon"></i>
|
||||
<div class="alert-text">
|
||||
<strong>Email già presente nel database.
|
||||
</div>
|
||||
|
||||
<div class="alert-close">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true"><i class="mdi mdi-close text-danger"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
</div><?php } ?>
|
||||
|
||||
<?php if (isset($inserttrue)) { ?>
|
||||
<div class="alert icon-custom-alert alert-outline-success alert-success-shadow" role="alert">
|
||||
<i class="mdi mdi-check-all alert-icon"></i>
|
||||
<div class="alert-text">
|
||||
<strong>Ben fatto!</strong> Utente creato con successo.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<p>Presto riceverai una mail per impostare la tua prima password e poi potrai procedere con l'uso del portale!</p><br>
|
||||
<p>Soon you will receive an email in order to setup your first password and then you can start to use the portal!</p><br>
|
||||
<?php } ?>
|
||||
<?php if (!isset($inserttrue)) { ?>
|
||||
<form class="form-horizontal auth-form my-4" action="auth-creation.php" method="post" name="usernew">
|
||||
<?php $nowtime=date("Y-m-d G:i:s"); ?>
|
||||
<div class="form-group">
|
||||
<label for="useremail">Nome/Name</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-user"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="first_name" name="first_name" placeholder="Nome/Name">
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group">
|
||||
<label for="useremail">Cognome / Surname</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-user"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="last_name" name="last_name" placeholder="Cognome / Surname">
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group">
|
||||
<label for="useremail">Email</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-mail"></i>
|
||||
</span>
|
||||
<input type="email" class="form-control" id="emailuser" name="emailuser" placeholder="Email">
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="col-md-8 mb-8">
|
||||
<label for="exampleFormControlSelect1">Lingua / Language</label>
|
||||
<select class="form-control" id="language" name="language">
|
||||
<option value="1">Italiano</option>
|
||||
<option value="2">English</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="status" name="status" value="Active">
|
||||
<input type="hidden" id="role_id" name="role_id" value="2">
|
||||
<input type="hidden" id="adduser" name="adduser" value="Y">
|
||||
<input type="hidden" id="datein" name="datein" value="<?php echo $nowtime; ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-4">
|
||||
<div class="col-sm-12">
|
||||
<div class="custom-control custom-switch switch-success">
|
||||
<!-- <input type="checkbox" class="custom-control-input" id="customSwitchSuccess"> -->
|
||||
<label class=" for="customSwitchSuccess">Registrandoti accetti le condizioni d'uso di seguito riportate / By registering you agree to the following <a href="terminiecondizioni.php" target='blank' class="text-primary">Terms of Use</a></label>
|
||||
</div>
|
||||
</div><!--end col-->
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group mb-0 row">
|
||||
<div class="col-12 mt-2">
|
||||
<button class="btn btn-gradient-primary btn-round btn-block waves-effect waves-light" type="submit">Registrati /Register <i class="fas fa-sign-in-alt ml-1"></i></button>
|
||||
</div><!--end col-->
|
||||
</div> <!--end form-group-->
|
||||
</form><?php } ?><!--end form-->
|
||||
</div><!--end /div-->
|
||||
|
||||
<div class="m-3 text-center text-muted">
|
||||
<p class="">Hai già un account? / Already have an account ? <a href="login" class="text-primary ml-2">Log in</a></p>
|
||||
</div>
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
</div><!--end auth-card-->
|
||||
</div><!--end col-->
|
||||
</div><!--end row-->
|
||||
</div><!--end container-->
|
||||
<!-- End Log In page -->
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="assets/js/jquery.min.js"></script>
|
||||
<script src="assets/js/jquery-ui.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>
|
||||
|
||||
<!-- App js -->
|
||||
<script src="../assets/js/app.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,253 +0,0 @@
|
||||
<?php
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
|
||||
<?php
|
||||
|
||||
// include('include/headscript.php'); ?>
|
||||
|
||||
|
||||
<?php //insert query
|
||||
if (isset($_POST['adduser'])) {
|
||||
if (isset($_POST['first_name'])) { $first_name=$_POST['first_name']; }
|
||||
if (isset($_POST['last_name'])) { $last_name=$_POST['last_name']; }
|
||||
if (isset($_POST['emailuser'])) { $emailuser=$_POST['emailuser']; }
|
||||
if (isset($_POST['datein'])) { $datein=$_POST['datein']; }
|
||||
if (isset($_POST['language'])) { $langid=$_POST['language']; }
|
||||
?>
|
||||
<?php //insert query
|
||||
|
||||
$checkmail = new WA_MySQLi_RS("checkmail",$cmctrfdb,0);
|
||||
$checkmail->setQuery("SELECT * FROM auth_users WHERE auth_users.email='$emailuser'");
|
||||
$checkmail->execute();
|
||||
if(!empty($checkmail->getColumnVal("id"))) { $varmailrepeat='Y'; ?>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
|
||||
|
||||
$mysqli = new mysqli($hostname_cmctrfdb, $username_cmctrfdb, $password_cmctrfdb, $database_cmctrfdb);
|
||||
|
||||
|
||||
$query = "INSERT INTO auth_users (email, first_name, last_name, password, role_id, status, email_verified_at, created_at, updated_at, langid, termuseaccepted) VALUES ('$emailuser', '$first_name', '$last_name', '12345!AA', '2','Active','$datein','$datein','$datein','$langid', '$datein')";
|
||||
|
||||
// Esegui la query
|
||||
$mysqli->query($query);
|
||||
$inserttrue='Y';
|
||||
// Chiudi la connessione al database
|
||||
$mysqli->close();
|
||||
|
||||
|
||||
|
||||
|
||||
//Now include the following following files based
|
||||
//on the correct file path. Third file is required only if you want to enable SMTP.
|
||||
|
||||
require 'phpmailer/src/Exception.php';
|
||||
require 'phpmailer/src/PHPMailer.php';
|
||||
require 'phpmailer/src/SMTP.php';
|
||||
|
||||
//mail to client
|
||||
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
|
||||
$mmessage="mailnewuser";
|
||||
include('include/mailnewuser.php');
|
||||
// Email body content
|
||||
|
||||
|
||||
$htmlContent = $mailmessage1;
|
||||
|
||||
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addAddress($emailuser); // Add a recipient
|
||||
|
||||
|
||||
|
||||
$mail->Subject = "Creazione Nuovo Utente";
|
||||
$mail->Body = $htmlContent;
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
|
||||
|
||||
$mail->send();
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>CIMAC Application Form</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
|
||||
<meta content="" name="author" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="../assets/images/favicon.ico">
|
||||
|
||||
<!-- 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" />
|
||||
|
||||
</head>
|
||||
|
||||
<body class="account-body accountbg">
|
||||
|
||||
<!-- Log In page -->
|
||||
<div class="container">
|
||||
<div class="row vh-100 ">
|
||||
<div class="col-12 align-self-center">
|
||||
<div class="auth-page">
|
||||
<div class="card auth-card shadow-lg">
|
||||
|
||||
<div class="card-body">
|
||||
<div class="px-3">
|
||||
<div>
|
||||
<a href="https://www.cimac.it/modulo_certificazione/public/login" class="logo logo-admin"><img src="assets/img/cimac-logo.png" height="55" alt="logo" class="auth-logo"></a>
|
||||
</div><!--end auth-logo-box-->
|
||||
|
||||
<div class="text-center auth-logo-text">
|
||||
<h4 class="mt-0 mb-3 mt-5">Registrazione CIMAC Application Form</h4>
|
||||
|
||||
</div> <!--end auth-logo-text-->
|
||||
|
||||
<?php if (isset($varmailrepeat)) { ?>
|
||||
<div class="alert icon-custom-alert alert-outline-pink b-round fade show" role="alert">
|
||||
<i class="mdi mdi-alert-outline alert-icon"></i>
|
||||
<div class="alert-text">
|
||||
<strong>Email già presente nel database.
|
||||
</div>
|
||||
|
||||
<div class="alert-close">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true"><i class="mdi mdi-close text-danger"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
</div><?php } ?>
|
||||
|
||||
<?php if (isset($inserttrue)) { ?>
|
||||
<div class="alert icon-custom-alert alert-outline-success alert-success-shadow" role="alert">
|
||||
<i class="mdi mdi-check-all alert-icon"></i>
|
||||
<div class="alert-text">
|
||||
<strong>Ben fatto!</strong> Utente creato con successo.
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<form class="form-horizontal auth-form my-4" action="auth-register.php" method="post" name="usernew">
|
||||
<?php $nowtime=date("Y-m-d G:i:s"); ?>
|
||||
<div class="form-group">
|
||||
<label for="useremail">Nome/Name</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-user"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="first_name" name="first_name" placeholder="Nome/Name">
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group">
|
||||
<label for="useremail">Cognome / Surname</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-user"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="last_name" name="last_name" placeholder="Cognome / Surname">
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group">
|
||||
<label for="useremail">Email</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-mail"></i>
|
||||
</span>
|
||||
<input type="email" class="form-control" id="emailuser" name="emailuser" placeholder="Email">
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="col-md-8 mb-8">
|
||||
<label for="exampleFormControlSelect1">Lingua / Language</label>
|
||||
<select class="form-control" id="language" name="language">
|
||||
<option value="1">Italiano</option>
|
||||
<option value="2">English</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="status" name="status" value="Active">
|
||||
<input type="hidden" id="role_id" name="role_id" value="2">
|
||||
<input type="hidden" id="adduser" name="adduser" value="Y">
|
||||
<input type="hidden" id="datein" name="datein" value="<?php echo $nowtime; ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-4">
|
||||
<div class="col-sm-12">
|
||||
<div class="custom-control custom-switch switch-success">
|
||||
<input type="checkbox" class="custom-control-input" id="customSwitchSuccess">
|
||||
<label class="custom-control-label text-muted" for="customSwitchSuccess">Registrandoti accetti le condizioni d'uso di seguito riportate / By registering you agree to the following <a href="#" class="text-primary">Terms of Use</a></label>
|
||||
</div>
|
||||
</div><!--end col-->
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group mb-0 row">
|
||||
<div class="col-12 mt-2">
|
||||
<button class="btn btn-gradient-primary btn-round btn-block waves-effect waves-light" type="submit">Registrati /Register <i class="fas fa-sign-in-alt ml-1"></i></button>
|
||||
</div><!--end col-->
|
||||
</div> <!--end form-group-->
|
||||
</form><!--end form-->
|
||||
</div><!--end /div-->
|
||||
|
||||
<div class="m-3 text-center text-muted">
|
||||
<p class="">Hai già un account? / Already have an account ? <a href="../login" class="text-primary ml-2">Log in</a></p>
|
||||
</div>
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
</div><!--end auth-card-->
|
||||
</div><!--end col-->
|
||||
</div><!--end row-->
|
||||
</div><!--end container-->
|
||||
<!-- End Log In page -->
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="assets/js/jquery.min.js"></script>
|
||||
<script src="assets/js/jquery-ui.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>
|
||||
|
||||
<!-- App js -->
|
||||
<script src="../assets/js/app.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,253 +0,0 @@
|
||||
<?php
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
|
||||
<?php
|
||||
|
||||
// include('include/headscript.php'); ?>
|
||||
<?php include('generalsettings.php'); ?>
|
||||
|
||||
<?php //insert query
|
||||
if (isset($_POST['adduser'])) {
|
||||
if (isset($_POST['first_name'])) { $first_name=$_POST['first_name']; }
|
||||
if (isset($_POST['last_name'])) { $last_name=$_POST['last_name']; }
|
||||
if (isset($_POST['emailuser'])) { $emailuser=$_POST['emailuser']; }
|
||||
if (isset($_POST['datein'])) { $datein=$_POST['datein']; }
|
||||
if (isset($_POST['language'])) { $langid=$_POST['language']; }
|
||||
?>
|
||||
<?php //insert query
|
||||
|
||||
$checkmail = new WA_MySQLi_RS("checkmail",$cmctrfdb,0);
|
||||
$checkmail->setQuery("SELECT * FROM auth_users WHERE auth_users.email='$emailuser'");
|
||||
$checkmail->execute();
|
||||
if(!empty($checkmail->getColumnVal("id"))) { $varmailrepeat='Y'; ?>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
|
||||
|
||||
$mysqli = new mysqli($hostname_cmctrfdb, $username_cmctrfdb, $password_cmctrfdb, $database_cmctrfdb);
|
||||
|
||||
|
||||
$query = "INSERT INTO auth_users (email, first_name, last_name, password, role_id, status, email_verified_at, created_at, updated_at, langid, termuseaccepted) VALUES ('$emailuser', '$first_name', '$last_name', '12345!AA', '2','Active','$datein','$datein','$datein','$langid', '$datein')";
|
||||
|
||||
// Esegui la query
|
||||
$mysqli->query($query);
|
||||
$inserttrue='Y';
|
||||
// Chiudi la connessione al database
|
||||
$mysqli->close();
|
||||
|
||||
|
||||
|
||||
|
||||
//Now include the following following files based
|
||||
//on the correct file path. Third file is required only if you want to enable SMTP.
|
||||
|
||||
require 'phpmailer/src/Exception.php';
|
||||
require 'phpmailer/src/PHPMailer.php';
|
||||
require 'phpmailer/src/SMTP.php';
|
||||
|
||||
//mail to client
|
||||
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
|
||||
$mmessage="mailnewuser";
|
||||
include('include/mailnewuser.php');
|
||||
// Email body content
|
||||
|
||||
|
||||
$htmlContent = $mailmessage1;
|
||||
|
||||
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addAddress($emailuser); // Add a recipient
|
||||
|
||||
|
||||
|
||||
$mail->Subject = "Creazione Nuovo Utente";
|
||||
$mail->Body = $htmlContent;
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
|
||||
|
||||
$mail->send();
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>CIMAC Application Form</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
|
||||
<meta content="" name="author" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="../assets/images/favicon.ico">
|
||||
|
||||
<!-- 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" />
|
||||
|
||||
</head>
|
||||
|
||||
<body class="account-body accountbg">
|
||||
|
||||
<!-- Log In page -->
|
||||
<div class="container">
|
||||
<div class="row vh-100 ">
|
||||
<div class="col-12 align-self-center">
|
||||
<div class="auth-page">
|
||||
<div class="card auth-card shadow-lg">
|
||||
|
||||
<div class="card-body">
|
||||
<div class="px-3">
|
||||
<div>
|
||||
<a href="https://www.cimac.it/modulo_certificazione/public/login" class="logo logo-admin"><img src="assets/img/cimac-logo.png" height="55" alt="logo" class="auth-logo"></a>
|
||||
</div><!--end auth-logo-box-->
|
||||
|
||||
<div class="text-center auth-logo-text">
|
||||
<h4 class="mt-0 mb-3 mt-5">Registrazione CIMAC Application Form</h4>
|
||||
|
||||
</div> <!--end auth-logo-text-->
|
||||
|
||||
<?php if (isset($varmailrepeat)) { ?>
|
||||
<div class="alert icon-custom-alert alert-outline-pink b-round fade show" role="alert">
|
||||
<i class="mdi mdi-alert-outline alert-icon"></i>
|
||||
<div class="alert-text">
|
||||
<strong>Email già presente nel database.
|
||||
</div>
|
||||
|
||||
<div class="alert-close">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true"><i class="mdi mdi-close text-danger"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
</div><?php } ?>
|
||||
|
||||
<?php if (isset($inserttrue)) { ?>
|
||||
<div class="alert icon-custom-alert alert-outline-success alert-success-shadow" role="alert">
|
||||
<i class="mdi mdi-check-all alert-icon"></i>
|
||||
<div class="alert-text">
|
||||
<strong>Ben fatto!</strong> Utente creato con successo.
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<form class="form-horizontal auth-form my-4" action="auth-registration.php" method="post" name="usernew">
|
||||
<?php $nowtime=date("Y-m-d G:i:s"); ?>
|
||||
<div class="form-group">
|
||||
<label for="useremail">Nome/Name</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-user"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="first_name" name="first_name" placeholder="Nome/Name">
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group">
|
||||
<label for="useremail">Cognome / Surname</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-user"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="last_name" name="last_name" placeholder="Cognome / Surname">
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group">
|
||||
<label for="useremail">Email</label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="auth-form-icon">
|
||||
<i class="dripicons-mail"></i>
|
||||
</span>
|
||||
<input type="email" class="form-control" id="emailuser" name="emailuser" placeholder="Email">
|
||||
</div>
|
||||
</div><!--end form-group-->
|
||||
|
||||
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="col-md-8 mb-8">
|
||||
<label for="exampleFormControlSelect1">Lingua / Language</label>
|
||||
<select class="form-control" id="language" name="language">
|
||||
<option value="1">Italiano</option>
|
||||
<option value="2">English</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="status" name="status" value="Active">
|
||||
<input type="hidden" id="role_id" name="role_id" value="2">
|
||||
<input type="hidden" id="adduser" name="adduser" value="Y">
|
||||
<input type="hidden" id="datein" name="datein" value="<?php echo $nowtime; ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-4">
|
||||
<div class="col-sm-12">
|
||||
<div class="custom-control custom-switch switch-success">
|
||||
<input type="checkbox" class="custom-control-input" id="customSwitchSuccess">
|
||||
<label class="custom-control-label text-muted" for="customSwitchSuccess">Registrandoti accetti le condizioni d'uso di seguito riportate / By registering you agree to the following <a href="#" class="text-primary">Terms of Use</a></label>
|
||||
</div>
|
||||
</div><!--end col-->
|
||||
</div><!--end form-group-->
|
||||
|
||||
<div class="form-group mb-0 row">
|
||||
<div class="col-12 mt-2">
|
||||
<button class="btn btn-gradient-primary btn-round btn-block waves-effect waves-light" type="submit">Registrati /Register <i class="fas fa-sign-in-alt ml-1"></i></button>
|
||||
</div><!--end col-->
|
||||
</div> <!--end form-group-->
|
||||
</form><!--end form-->
|
||||
</div><!--end /div-->
|
||||
|
||||
<div class="m-3 text-center text-muted">
|
||||
<p class="">Hai già un account? / Already have an account ? <a href="../login" class="text-primary ml-2">Log in</a></p>
|
||||
</div>
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
</div><!--end auth-card-->
|
||||
</div><!--end col-->
|
||||
</div><!--end row-->
|
||||
</div><!--end container-->
|
||||
<!-- End Log In page -->
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="assets/js/jquery.min.js"></script>
|
||||
<script src="assets/js/jquery-ui.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>
|
||||
|
||||
<!-- App js -->
|
||||
<script src="../assets/js/app.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,39 +0,0 @@
|
||||
<?php
|
||||
include('db.php');
|
||||
session_start();
|
||||
$session_id='1'; // User session id
|
||||
$path = "uploaddocuments/";
|
||||
|
||||
$valid_formats = array("jpg", "png", "gif", "bmp","jpeg");
|
||||
if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST")
|
||||
{
|
||||
$name = $_FILES['photoimg']['name'];
|
||||
$size = $_FILES['photoimg']['size'];
|
||||
if(strlen($name))
|
||||
{
|
||||
list($txt, $ext) = explode(".", $name);
|
||||
if(in_array($ext,$valid_formats))
|
||||
{
|
||||
if($size<(1024*1024)) // Image size max 1 MB
|
||||
{
|
||||
$actual_image_name = time().$session_id.".".$ext;
|
||||
$tmp = $_FILES['photoimg']['tmp_name'];
|
||||
if(move_uploaded_file($tmp, $path.$actual_image_name))
|
||||
{
|
||||
mysqli_query($conn,"UPDATE users SET profile_image='$actual_image_name' WHERE uid='$session_id'");
|
||||
echo "<img src='uploaddocuments/".$actual_image_name."' class='preview'>";
|
||||
}
|
||||
else
|
||||
echo "failed";
|
||||
}
|
||||
else
|
||||
echo "Image file size max 1 MB";
|
||||
}
|
||||
else
|
||||
echo "Invalid file format..";
|
||||
}
|
||||
else
|
||||
echo "Please select image..!";
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
@ -1,46 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript.php');
|
||||
// Fetching state data
|
||||
$country_id=!empty($_POST['country_id'])?$_POST['country_id']:'';
|
||||
if(!empty($country_id))
|
||||
{
|
||||
|
||||
$query="SELECT idmodelarticle, namemodelarticle from modelarticle WHERE idarticletype=?";
|
||||
$countryData = $cmctrfdb->prepare($query);
|
||||
$countryData->bind_param('s',$country_id);
|
||||
$countryData->execute();
|
||||
$result=$query->get_result();
|
||||
|
||||
if($result->num_rows>0)
|
||||
{
|
||||
echo "<option value=''>Select State</option>";
|
||||
while($arr= $result->fetch_assoc())
|
||||
{
|
||||
echo "<option value='".$arr['idmodelarticle']."'>".$arr['namemodelarticle']."</option><br>";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Fetching city data
|
||||
$state_id=!empty($_POST['state_id'])?$_POST['state_id']:'';
|
||||
if(!empty($state_id))
|
||||
{
|
||||
$query="SELECT id, name from cities WHERE state_id=?";
|
||||
$countryData = $conn->prepare($query);
|
||||
$countryData->bind_param('i',$state_id);
|
||||
$countryData->execute();
|
||||
$result=$query->get_result();
|
||||
|
||||
if($result->num_rows>0)
|
||||
{
|
||||
echo "<option value=''>Select City</option>";
|
||||
while($arr= $result->fetch_assoc())
|
||||
{
|
||||
echo "<option value='".$arr['id']."'>".$arr['name']."</option><br>";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,28 +0,0 @@
|
||||
|
||||
|
||||
<?php
|
||||
// Connessione al database (assumendo che tu abbia già configurato la connessione)
|
||||
include('include/headscript2.php');
|
||||
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
|
||||
// Controlla la connessione al database
|
||||
if ($conn->connect_error) {
|
||||
die("Connessione al database fallita: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
// Recupera l'IDTRF dalla richiesta GET
|
||||
$idtrf = $_GET['idtrf'];
|
||||
|
||||
// Esegui l'aggiornamento nella tabella trf-details
|
||||
$sql = "UPDATE `trf-details` SET signedon = '', signedonsecondcert = NULL WHERE idtrfdetails = '$idtrf'";
|
||||
|
||||
if ($conn->query($sql) === TRUE) {
|
||||
// Chiudi la finestra corrente e aggiorna la finestra padre
|
||||
echo '<script>window.opener.location.reload(); window.close();</script>';
|
||||
} else {
|
||||
echo "Errore nell'aggiornamento del database: " . $conn->error;
|
||||
}
|
||||
|
||||
$conn->close();
|
||||
?>
|
||||
@ -1,678 +0,0 @@
|
||||
/*!
|
||||
* 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');
|
||||
}
|
||||
|
||||
if(settings.columns.editable[i][1]=='filenameaudit'){
|
||||
var spantext='<a href="upload/'+$(this).text() +'" target="_blank">'+$(this).text()+' </a>';
|
||||
}
|
||||
else {
|
||||
var spantext=$(this).text();
|
||||
}
|
||||
// Create span element.
|
||||
var span = '<span class="tabledit-span">' + spantext + '</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'){
|
||||
if (text === yessent) {
|
||||
var input = '<input class="tabledit-input" type="checkbox" name="' + settings.columns.editable[i][1] + '" value="yes" checked="checked" style="display: none;" disabled>';
|
||||
|
||||
}
|
||||
else{
|
||||
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');
|
||||
var inputname=$input.attr('name');
|
||||
// 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==yessent){
|
||||
$input.attr('checked', 'checked');
|
||||
}
|
||||
}
|
||||
else if(inputname=='filenameaudit'){
|
||||
|
||||
var filename=$(this).find('.tabledit-span').text();
|
||||
if(filename!=''){
|
||||
$(this).find('.tabledit-span').html('<a href="upload/'+filename +'" target="_blank">'+filename+' </a>');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
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');
|
||||
var inputname=$input.attr('name');
|
||||
// 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(yessent);
|
||||
}
|
||||
else{
|
||||
$(this).find('.tabledit-span').text(nosent);
|
||||
}
|
||||
|
||||
}
|
||||
else if(inputname=='filenameaudit'){
|
||||
console.log('file type');
|
||||
var filename=$(this).find('.tabledit-span').text();
|
||||
if(filename!=''){
|
||||
$(this).find('.tabledit-span').html('<a href="upload/'+filename +'" target="_blank">'+filename+' </a>');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
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));
|
||||
@ -1,693 +0,0 @@
|
||||
/*!
|
||||
* 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');
|
||||
}
|
||||
|
||||
if(settings.columns.editable[i][1]=='filenameaudit'){
|
||||
var spantext='<a href="upload/'+$(this).text() +'" target="_blank">'+$(this).text()+' </a>';
|
||||
}
|
||||
else {
|
||||
var spantext=$(this).text();
|
||||
}
|
||||
// Create span element.
|
||||
var span = '<span class="tabledit-span">' + spantext + '</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'){
|
||||
if (text === yessent) {
|
||||
var input = '<input class="tabledit-input" type="checkbox" name="' + settings.columns.editable[i][1] + '" value="yes" checked="checked" style="display: none;" disabled>';
|
||||
|
||||
}
|
||||
else{
|
||||
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');
|
||||
var inputname=$input.attr('name');
|
||||
// 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==yessent){
|
||||
$input.attr('checked', 'checked');
|
||||
}
|
||||
}
|
||||
else if(inputname=='filenameaudit'){
|
||||
|
||||
var filename=$(this).find('.tabledit-span').text();
|
||||
if(filename!=''){
|
||||
$(this).find('.tabledit-span').html('<a href="upload/'+filename +'" target="_blank">'+filename+' </a>');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
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');
|
||||
var inputname=$input.attr('name');
|
||||
// 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(yessent);
|
||||
}
|
||||
else{
|
||||
$(this).find('.tabledit-span').text(nosent);
|
||||
}
|
||||
|
||||
}
|
||||
if( $(this).find('.active-badge')){
|
||||
// alert($(this).parents('tr').find('input[type=checkbox]').prop('checked'));
|
||||
if($(this).parents('tr').find('input[type=checkbox]').prop('checked')==true)
|
||||
{
|
||||
$(this).find('.badge_btn').text(activebadge);
|
||||
$(this).find('.badge_btn').removeClass('btn-secondary');
|
||||
$(this).find('.badge_btn').addClass('btn-primary');
|
||||
}
|
||||
else{
|
||||
$(this).find('.badge_btn').text(inactivebadge);
|
||||
$(this).find('.badge_btn').removeClass('btn-primary');
|
||||
$(this).find('.badge_btn').addClass('btn-secondary');
|
||||
}
|
||||
}
|
||||
|
||||
else if(inputname=='filenameaudit'){
|
||||
console.log('file type');
|
||||
var filename=$(this).find('.tabledit-span').text();
|
||||
if(filename!=''){
|
||||
$(this).find('.tabledit-span').html('<a href="upload/'+filename +'" target="_blank">'+filename+' </a>');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
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));
|
||||
@ -1,246 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf=$_GET["idtrf"]; }
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf=$_POST["idtrf"]; }
|
||||
//include('include/alertcheckquery.php');
|
||||
if (isset($_GET["codestep"])) {
|
||||
$code="4";
|
||||
$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 /*
|
||||
$conn = mysqli_connect($hostname_cmctrfdb, $username_cmctrfdb, $password_cmctrfdb, $database_cmctrfdb);
|
||||
if (!$conn) {
|
||||
die("Connessione al database fallita: " . mysqli_connect_error());
|
||||
}
|
||||
|
||||
// Controllo dei campi nulli
|
||||
|
||||
$sql = "SELECT COUNT(*) AS num_rows FROM trfstandards WHERE idtrfdetails = $idtrf AND (idprotectioncategory IS NULL OR iddpicategory IS NULL)";
|
||||
$resultcat = mysqli_query($conn, $sql);
|
||||
// Controllo degli errori
|
||||
if (!$resultcat) {
|
||||
die("Errore nella query: " . mysqli_error($conn));
|
||||
}
|
||||
$row = mysqli_fetch_assoc($resultcat);
|
||||
if ($row['num_rows'] > 0) {
|
||||
// Campi nulli trovati, torna alla pagina standardstep.php e mostra il messaggio di errore
|
||||
header("Location: standardstep.php?idtrf=$idtrf&error=tuttiicampidevonoesserericompilati");
|
||||
exit;
|
||||
} */
|
||||
?>
|
||||
<?php
|
||||
$trfnumberfinal = new WA_MySQLi_RS("trfnumberfinal",$cmctrfdb,1);
|
||||
$trfnumberfinal->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'");
|
||||
$trfnumberfinal->execute();
|
||||
?>
|
||||
<?php
|
||||
$idcertn=$trfnumberfinal->getColumnVal("idcertification");
|
||||
$idtrf=$trfnumberfinal->getColumnVal("idtrfdetails");
|
||||
?>
|
||||
<?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();
|
||||
?>
|
||||
<!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"/>
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
<?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: 60%;" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100">60%</div>
|
||||
</div>
|
||||
<!-- card for additional info gloves -->
|
||||
<?php if ($trfnumberfinal->getColumnVal("idarticletype")=="2") { ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $additionalinfotitle; ?>
|
||||
</h4>
|
||||
<p class="text-muted mb-3"><?php echo $additionalinfotitle_help; ?>
|
||||
</p>
|
||||
<form class="was-validated" action="addrequirements.php" method="post" name="myForm">
|
||||
<div class="checkbox my-2">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="virusprot" name="virusprot" data-parsley-multiple="groups" value="Y" data-parsley-mincheck="2" <?php if ($trfnumberfinal->getColumnVal("virusprotection")=='Y') { echo "checked"; } ?>>
|
||||
<label class="custom-control-label" for="virusprot"><?php echo $virusprottitle; ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="addinfo" id="addinfo" 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 $nextsteptitle; ?>">
|
||||
<a href="standardstep.php?idtrf=<?php echo $idtrf; ?>"
|
||||
<button type="button" class="btn btn-dark waves-effect waves-light"><?php echo $backstep; ?>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
<?php } ?>
|
||||
<!-- card for additional info shoes -->
|
||||
<?php if ($trfnumberfinal->getColumnVal("idarticletype")=="1") { ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $additionalinfotitle; ?>
|
||||
</h4>
|
||||
<p class="text-muted mb-3"><?php echo $additionalinfotitle_help; ?>
|
||||
</p>
|
||||
<form class="form-parsley" action="addrequirements.php" method="post" name="myForm">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label"><?php echo $slippingtitle; ?>
|
||||
</label>
|
||||
<div class="col-sm-2">
|
||||
<select class="form-control" id="slipping" name="slipping">
|
||||
<option value="" <?php if (!(strcmp("", ($trfnumberfinal->getColumnVal("slipping"))))) {echo "selected=\"selected\"";} ?>>No</option>
|
||||
<option value="SR" <?php if (!(strcmp("SR", ($trfnumberfinal->getColumnVal("slipping"))))) {echo "selected=\"selected\"";} ?>>SR</option>
|
||||
<option value="SRA" <?php if (!(strcmp("SRA", ($trfnumberfinal->getColumnVal("slipping"))))) {echo "selected=\"selected\"";} ?>>SRA</option>
|
||||
<option value="SRB" <?php if (!(strcmp("SRB", ($trfnumberfinal->getColumnVal("slipping"))))) {echo "selected=\"selected\"";} ?>>SRB</option>
|
||||
<option value="SRC" <?php if (!(strcmp("SRC", ($trfnumberfinal->getColumnVal("slipping"))))) {echo "selected=\"selected\"";} ?>>SRC</option>
|
||||
</select>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="checkbox my-2">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="orthopedic" name="orthopedic" data-parsley-multiple="groups" value="Y" data-parsley-mincheck="2" <?php if ($trfnumberfinal->getColumnVal("shoesorthopedic")=='Y') { echo "checked"; } ?>>
|
||||
<label class="custom-control-label" for="orthopedic"><?php echo $orthopedictitle; ?> (DGUV)
|
||||
</label>
|
||||
</div>
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="autoclavable" name="autoclavable" data-parsley-multiple="groups" value="Y" data-parsley-mincheck="2" <?php if ($trfnumberfinal->getColumnVal("autoclavable")=='Y') { echo "checked"; } ?>>
|
||||
<label class="custom-control-label" for="autoclavable"><?php echo $autoclavabletitle; ?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="esd" name="esd" data-parsley-multiple="groups" value="Y" data-parsley-mincheck="2" <?php if ($trfnumberfinal->getColumnVal("esd")=='Y') { echo "checked"; } ?>>
|
||||
<label class="custom-control-label" for="esd"><?php echo $esdtitle; ?>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<input type="hidden" name="addinfo" id="addinfo" value="Y">
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo $idtrf; ?>">
|
||||
<input type="hidden" name="codestep" id="codestep" value="4">
|
||||
<br>
|
||||
<br>
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $nextsteptitle; ?>">
|
||||
<a href="standardstep.php?idtrf=<?php echo $idtrf; ?>"
|
||||
<button type="button" class="btn btn-dark waves-effect waves-light"><?php echo $backstep; ?>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!--end card-body-->
|
||||
<?php } ?>
|
||||
</div>
|
||||
<!--end card-->
|
||||
</div>
|
||||
<!--end col-->
|
||||
</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>
|
||||
@ -1,404 +0,0 @@
|
||||
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf=$_GET["idtrf"]; }
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf=$_POST["idtrf"]; }
|
||||
|
||||
//include('include/alertcheckquery.php');
|
||||
|
||||
if (isset($_POST["virusprot"])) {
|
||||
$virusprot=$_POST["virusprot"]; }
|
||||
else { $virusprot=""; }
|
||||
if (isset($_POST["addinfo"])) {
|
||||
$addinfo=$_POST["addinfo"]; }
|
||||
else { $addinfo=""; }
|
||||
if (isset($_POST["slipping"])) {
|
||||
$slipping=$_POST["slipping"]; }
|
||||
else { $slipping=""; }
|
||||
if (isset($_POST["orthopedic"])) {
|
||||
$orthopedic=$_POST["orthopedic"]; }
|
||||
else { $orthopedic=""; }
|
||||
if (isset($_POST["autoclavable"])) {
|
||||
$autoclavable=$_POST["autoclavable"]; }
|
||||
else { $autoclavable=""; }
|
||||
if (isset($_POST["esd"])) {
|
||||
$esd=$_POST["esd"]; }
|
||||
else { $esd=""; }
|
||||
if (isset($_POST["ukcacert"])) {
|
||||
$ukcacert=$_POST["ukcacert"]; }
|
||||
else { $ukcacert=""; }
|
||||
if (isset($_POST["addreq"])) {
|
||||
$addreq=$_POST["addreq"]; }
|
||||
if (isset($_POST["addreqform"])) {
|
||||
$addreqform=$_POST["addreqform"]; }
|
||||
else { $addreqform=""; }
|
||||
if (isset($_POST["codestep"])) {
|
||||
$code="5";
|
||||
|
||||
$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
|
||||
$conn = mysqli_connect($hostname_cmctrfdb, $username_cmctrfdb, $password_cmctrfdb, $database_cmctrfdb);
|
||||
if (!$conn) {
|
||||
die("Connessione al database fallita: " . mysqli_connect_error());
|
||||
}
|
||||
|
||||
// Controllo dei campi nulli
|
||||
|
||||
$sql = "SELECT COUNT(*) AS num_rows FROM trfstandards WHERE idtrfdetails = $idtrf AND (idprotectioncategory IS NULL OR iddpicategory IS NULL)";
|
||||
$resultcat = mysqli_query($conn, $sql);
|
||||
// Controllo degli errori
|
||||
if (!$resultcat) {
|
||||
die("Errore nella query: " . mysqli_error($conn));
|
||||
}
|
||||
/*$row = mysqli_fetch_assoc($resultcat);
|
||||
if ($row['num_rows'] > 0) {
|
||||
// Campi nulli trovati, torna alla pagina standardstep.php e mostra il messaggio di errore
|
||||
header("Location: standardstep.php?idtrf=$idtrf&error=tuttiicampidevonoesserericompilati");
|
||||
exit;
|
||||
}*/
|
||||
?>
|
||||
<?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");
|
||||
$idstandards=$trfnumberfinal->getColumnVal("idstandards");
|
||||
$idarticletype=$trfnumberfinal->getColumnVal("idarticletype");
|
||||
?>
|
||||
<?php
|
||||
$standardlistsel = new WA_MySQLi_RS("standardlistsel",$cmctrfdb,0);
|
||||
$standardlistsel->setQuery("SELECT * FROM trfstandards WHERE trfstandards.idtrfdetails='$idtrf'");
|
||||
$standardlistsel->execute();
|
||||
?>
|
||||
<?php
|
||||
|
||||
$arraystd=array(); ?>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while(!$standardlistsel->atEnd()) {
|
||||
$wa_startindex = $standardlistsel->Index;
|
||||
?>
|
||||
<?php
|
||||
$idstandards=$standardlistsel->getColumnVal("idstandards");
|
||||
$arraystd[]=$idstandards;
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
$standardlistsel->moveNext();
|
||||
}
|
||||
$standardlistsel->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
$array2std=implode("','",$arraystd);
|
||||
$array3std="'".$array2std."'";
|
||||
?>
|
||||
|
||||
|
||||
<?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 //complete list add req
|
||||
//$addreqlist = new WA_MySQLi_RS("addreqlist",$cmctrfdb,0);
|
||||
//$addreqlist->setQuery("SELECT * FROM additionalrequirements WHERE additionalrequirements.idarticletype='$idarticletype' ORDER BY additionalrequirements.name_additionalrequirements");
|
||||
//$addreqlist->execute();?>
|
||||
|
||||
<?php // specific list of add req for std
|
||||
// Determine the column to select based on the session variable
|
||||
$additionalRequirementsField = ($_SESSION['langselect'] == 'en') ? 'name_additionalrequirements_en' : 'name_additionalrequirements_it';
|
||||
|
||||
// Specific list of add req for std
|
||||
$addreqlist = new WA_MySQLi_RS("addreqlist", $cmctrfdb, 0);
|
||||
$addreqlist->setQuery("SELECT DISTINCT stdreqlist.idadditionalrequirements, additionalrequirements." . $additionalRequirementsField . " FROM stdreqlist LEFT JOIN additionalrequirements ON stdreqlist.idadditionalrequirements=additionalrequirements.idadditionalrequirements WHERE stdreqlist.idstandards IN ($array3std)");
|
||||
$addreqlist->execute();
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
if ($addinfo=="Y") {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "`trf-details`";
|
||||
$UpdateQuery->bindColumn("virusprotection", "s", "$virusprot", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("shoesorthopedic", "s", "$orthopedic", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("autoclavable", "s", "$autoclavable", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("esd", "s", "$esd", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("slipping", "s", "$slipping", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idtrfdetails", "=", "i", "".($idtrf) ."");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if ($addreqform=="Y") {
|
||||
|
||||
|
||||
$addreqcheck = new WA_MySQLi_RS("addreqcheck",$cmctrfdb,1);
|
||||
$addreqcheck->setQuery("SELECT * FROM trfaddrequirements WHERE trfaddrequirements.idtrf='$idtrf' AND trfaddrequirements.idadditionalrequirements='$addreq'");
|
||||
$addreqcheck->execute();
|
||||
if (empty($addreqcheck->getColumnVal("idtrfaddrequirements"))) {
|
||||
|
||||
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "trfaddrequirements";
|
||||
$InsertQuery->bindColumn("idtrf", "i", "$idtrf", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idadditionalrequirements", "i", "$addreq", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}}
|
||||
?>
|
||||
<?php
|
||||
$addreqselectedlist = new WA_MySQLi_RS("addreqselectedlist",$cmctrfdb,0);
|
||||
$addreqselectedlist->setQuery("SELECT * FROM trfaddrequirements LEFT JOIN additionalrequirements ON trfaddrequirements.idadditionalrequirements=additionalrequirements.idadditionalrequirements WHERE trfaddrequirements.idtrf='$idtrf'");
|
||||
$addreqselectedlist->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" />
|
||||
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
<?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: 70%;" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100">70%</div>
|
||||
</div>
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $additionalreqtitle; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $additionalreqtitle_help; ?></p>
|
||||
<form class="form-parsley" action="" method="post" name="myForm">
|
||||
<div class="form-group row">
|
||||
<?php // var for language translation table name and help
|
||||
$colvarname=$addreqlist->getColumnVal("name_additionalrequirements");
|
||||
$varnamelang=$colvarname.$lang;
|
||||
$varhelplang="additionalrequirements_".$lang;
|
||||
?>
|
||||
<div class="col-sm-5">
|
||||
<select class="form-control" id="addreq" name="addreq">
|
||||
<option value=""><?php echo $pleaseselect; ?></option>
|
||||
<?php
|
||||
while(!$addreqlist->atEnd()) { //dyn select
|
||||
?><?php
|
||||
// Assuming the session_start() has been called earlier in the PHP code to start the session.
|
||||
$nameField = ($_SESSION['langselect'] == 'en') ? "name_additionalrequirements_en" : "name_additionalrequirements_it";
|
||||
?>
|
||||
|
||||
<option value="<?php echo($addreqlist->getColumnVal("idadditionalrequirements")); ?>">
|
||||
<?php echo($addreqlist->getColumnVal($nameField)); ?>
|
||||
</option> <?php
|
||||
$addreqlist->moveNext();
|
||||
} //dyn select
|
||||
$addreqlist->moveFirst();
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="addreqform" id="addreqform" value="Y">
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo($trfnumberfinal->getColumnVal("idtrfdetails")); ?>">
|
||||
|
||||
<br><br>
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $addtitle; ?>">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $additionalreqtitleselected; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $additionalreqtitleselected_help; ?></p>
|
||||
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $addreqtitle; ?></th>
|
||||
|
||||
<th><?php echo $action; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while(!$addreqselectedlist->atEnd()) {
|
||||
$wa_startindex = $addreqselectedlist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
// Assuming session_start() has already been called.
|
||||
$nameField = ($_SESSION['langselect'] == 'en') ? 'name_additionalrequirements_en' : 'name_additionalrequirements_it';
|
||||
echo($addreqselectedlist->getColumnVal($nameField));
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<a href="deleteaddreq.php?idaddreq=<?php echo($addreqselectedlist->getColumnVal("idtrfaddrequirements")); ?>&idtrf=<?php echo $idtrf; ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$addreqselectedlist->moveNext();
|
||||
}
|
||||
$addreqselectedlist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php include('include/chemicalsquerycheck.php'); ?>
|
||||
<?php if (!empty($chemicalstep)) { ?>
|
||||
<a href="chemicalagent.php?idtrf=<?php echo $idtrf; ?>&codestep=5"><button type="button" class="btn btn-success waves-effect waves-light"><?php echo $nextsteptitle; ?></button> </a>
|
||||
<?php } else { ?>
|
||||
<a href="identificationparts.php?idtrf=<?php echo $idtrf; ?>&codestep=6"><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>
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,481 +0,0 @@
|
||||
<?php
|
||||
//You shall use the following exact namespaces no
|
||||
//matter in whathever directory you upload your
|
||||
//phpmailer files.
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf = $_POST["idtrf"];
|
||||
}
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf = $_GET["idtrf"];
|
||||
}
|
||||
if (isset($_POST["tokensignatureon"])) {
|
||||
$tokensignatureon = $_POST["tokensignatureon"];
|
||||
}
|
||||
if (isset($_POST["clientname"])) {
|
||||
$clientname = $_POST["clientname"];
|
||||
}
|
||||
if (isset($_POST["datetrf"])) {
|
||||
$datetrf = $_POST["datetrf"];
|
||||
}
|
||||
if (isset($_POST["sndrpt"])) {
|
||||
$sndrpt = $_POST["sndrpt"];
|
||||
} else {
|
||||
$sndrpt = "N";
|
||||
}
|
||||
if (isset($_POST["adminconfirm"])) {
|
||||
$adminconfirm = $_POST["adminconfirm"];
|
||||
} else {
|
||||
$adminconfirm = "N";
|
||||
}
|
||||
if (isset($_GET["codestep"])) {
|
||||
$code = $_GET["codestep"];
|
||||
$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
|
||||
$tokenid = $user->present()->signaturecode;
|
||||
if ($tokenid != $tokensignatureon) {
|
||||
header("Location: declaration.php?idtrf=$idtrf&tokenresult=ko");
|
||||
} else {
|
||||
// update trf details`
|
||||
if (isset($_POST["formdeclaration"])) {
|
||||
if ($sndrpt == 'N') {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "`trf-details`";
|
||||
$UpdateQuery->bindColumn("signedon", "s", "$datetrf", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("revcs", "s", "N", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idtrfdetails", "=", "i", "" . ($idtrf) . "");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
} else {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "`trf-details`";
|
||||
$UpdateQuery->bindColumn("signedonsecondcert", "s", "$datetrf", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("revcs", "s", "N", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idtrfdetails", "=", "i", "" . ($idtrf) . "");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<?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");
|
||||
$appformn = $trfnumberfinal->getColumnVal("trfnumber");
|
||||
$ntrfmail = $trfnumberfinal->getColumnVal("trfnumber");;
|
||||
$revnumb = $trfnumberfinal->getColumnVal("revtrf");
|
||||
?>
|
||||
<?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
|
||||
$chemicalagentlist = new WA_MySQLi_RS("chemicalagentlist", $cmctrfdb, 0);
|
||||
$chemicalagentlist->setQuery("SELECT * FROM chemicalagent ORDER BY chemicalagent.name_chemicalagent");
|
||||
$chemicalagentlist->execute();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?php echo $titlepage; ?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="<?php echo $ownercompanyname; ?> 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" />
|
||||
<!-- submit form with button -->
|
||||
<style>
|
||||
input:invalid {
|
||||
border-color: #ff0000;
|
||||
background-color: #fff7e6;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
background: yellow;
|
||||
}
|
||||
|
||||
input:valid {
|
||||
border-color: #66ff33;
|
||||
background-color: #eeffe6;
|
||||
}
|
||||
|
||||
select:invalid {
|
||||
border-color: #ff0000;
|
||||
background-color: #fff7e6;
|
||||
}
|
||||
|
||||
select:focus {
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
select:valid {
|
||||
border-color: #66ff33;
|
||||
background-color: #eeffe6;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
body {
|
||||
font-family: arial;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
p {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function show1() {
|
||||
document.getElementById('div1').style.display = 'none';
|
||||
}
|
||||
|
||||
function show2() {
|
||||
document.getElementById('div1').style.display = 'block';
|
||||
}
|
||||
|
||||
function show3() {
|
||||
document.getElementById('div3').style.display = 'none';
|
||||
}
|
||||
|
||||
function show4() {
|
||||
document.getElementById('div3').style.display = 'block';
|
||||
}
|
||||
|
||||
function show5() {
|
||||
document.getElementById('div5').style.display = 'none';
|
||||
}
|
||||
|
||||
function show6() {
|
||||
document.getElementById('div5').style.display = 'block';
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Top Bar Start -->
|
||||
<?php include('include/topbar.php'); ?>
|
||||
<!-- Top Bar End -->
|
||||
<!-- Left Sidenav -->
|
||||
<?php include('include/leftsidenav2.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);"><?php echo $titlepage; ?></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: 100%;" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">100%</div>
|
||||
</div>
|
||||
<!-- card for optional TRF -->
|
||||
<?php //pdf creation
|
||||
|
||||
include('pdf-creation.php');
|
||||
|
||||
//if ($idcertificate==1 or $idcertificate==3 or $idcertificate==4)
|
||||
//{
|
||||
//include('pdf-creation2.php'); }
|
||||
// attachment
|
||||
|
||||
$checkpdffiles = new WA_MySQLi_RS("checkpdffiles", $cmctrfdb, 1);
|
||||
$checkpdffiles->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'");
|
||||
$checkpdffiles->execute();
|
||||
$path = 'pdf';
|
||||
$filename1 = $checkpdffiles->getColumnVal("pdffilename");
|
||||
$file1 = $path . "/" . $filename1;
|
||||
if (!empty($checkpdffiles->getColumnVal("pdffilename2"))) {
|
||||
$filename2 = $checkpdffiles->getColumnVal("pdffilename2");
|
||||
$file2 = $path . "/" . $filename2;
|
||||
}
|
||||
//Now include the following following files based
|
||||
//on the correct file path. Third file is required only if you want to enable SMTP.
|
||||
require 'phpmailer/src/Exception.php';
|
||||
require 'phpmailer/src/PHPMailer.php';
|
||||
require 'phpmailer/src/SMTP.php';
|
||||
//mail to client
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
$mmessage = "mailtrf";
|
||||
include('include/mailhtml.php');
|
||||
// Email body content
|
||||
$trfnmbmail = $appformn . 'r' . $revnumb;
|
||||
$htmlContent = $mailmessage1;
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addAddress($emailuser); // Add a recipient
|
||||
$mail->addAttachment($file1); // Add attachments
|
||||
if (!empty($checkpdffiles->getColumnVal("pdffilename2"))) {
|
||||
$mail->addAttachment($file2);
|
||||
} // Optional name
|
||||
$mail->Subject = $appformn . 'r' . $revnumb;
|
||||
$mail->Body = $htmlContent;
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
if ($adminconfirm == 'N') {
|
||||
$mail->send();
|
||||
}
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent CL. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
// mail to CS
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
$mmessage = "mailtrf";
|
||||
// Email body content
|
||||
$htmlContent = $mailmessage1;
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
if (!empty($csmail)) {
|
||||
$mail->addAddress($csmail); // Aggiunge il destinatario solo se non è vuoto
|
||||
}
|
||||
if (!empty($csmail2)) {
|
||||
$mail->addAddress($csmail2);
|
||||
}
|
||||
if (!empty($csmail3)) {
|
||||
$mail->addAddress($csmail3);
|
||||
}
|
||||
if (!empty($csmailccn)) {
|
||||
$mail->addBCC($csmailccn);
|
||||
}
|
||||
|
||||
$mail->Subject = $appformn . 'r' . $revnumb;;
|
||||
$mail->Body = "Ciao! E' stato inserito un nuovo ETRF N. $trfnmbmail ";
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
if ($adminconfirm == 'N') {
|
||||
$mail->send();
|
||||
}
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent CS. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
// mail REV to CS
|
||||
// if rev is > 0
|
||||
if ($revnumb > 0) {
|
||||
//query to see the previous CS in charge
|
||||
$revnumberprev = $revnumb - 1;
|
||||
$trfprevrev = new WA_MySQLi_RS("trfprevrev", $cmctrfdb, 1);
|
||||
$trfprevrev->setQuery("SELECT * FROM `trf-details` LEFT JOIN company ON `trf-details`.idcompany=company.idcompany WHERE `trf-details`.trfnumber='$ntrfmail' AND `trf-details`.revtrf='$revnumberprev'");
|
||||
$trfprevrev->execute();
|
||||
$csinchargeprev = $trfprevrev->getColumnVal("csincharge");
|
||||
if ($csinchargeprev == 'ddondena') {
|
||||
$mailincharge = 'd.dondena@cimac.it';
|
||||
} elseif ($csinchargeprev == 'cboscaino') {
|
||||
$mailincharge = 'c.boscaino@cimac.it';
|
||||
} elseif ($csinchargeprev == 'solocla') {
|
||||
$mailincharge = 'info@acscreativesolutions.com';
|
||||
} else {
|
||||
$mailincharge = 'd.dondena@cimac.it';
|
||||
}
|
||||
// Define array with all CS mails
|
||||
$csmailall = array($csmail, $csmail3);
|
||||
// Extract the recipient that matches $mailincharge
|
||||
$recipientTo = $mailincharge;
|
||||
$recipientsCC = array_diff($csmailall, array($recipientTo));
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
$mmessage = "mailtrf";
|
||||
// Email body content
|
||||
$htmlContent = $mailmessage1;
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addAddress($recipientTo); // Add the recipient in "To" field
|
||||
foreach ($recipientsCC as $ccRecipient) {
|
||||
$mail->addCC($ccRecipient); // Add recipients in "CC" field
|
||||
}
|
||||
$companynamemail = $trfprevrev->getColumnVal("companyname_company");
|
||||
$descart = $trfprevrev->getColumnVal("sample_description");
|
||||
$mail->Subject = $appformn . 'r' . $revnumb;
|
||||
if ($_SESSION['langselect'] == 'it') {
|
||||
// Imposta il testo in italiano
|
||||
$mail->Body = "Ciao $csinchargeprev! <br> È stato inserito un nuovo ETRF N. $trfnmbmail.<br><br>" .
|
||||
"Ragione Sociale = $companynamemail<br><br>" .
|
||||
"Descrizione articolo $descart.<br>";
|
||||
} else if ($_SESSION['langselect'] == 'en') {
|
||||
// Imposta il testo in inglese
|
||||
$mail->Body = "Hi $csinchargeprev! <br> A new ETRF No. $trfnmbmail has been submitted.<br><br>" .
|
||||
"Company Name = $companynamemail<br><br>" .
|
||||
"Item Description $descart.<br>";
|
||||
} else {
|
||||
// Imposta un valore di default o gestisci l'errore
|
||||
$mail->Body = "Language setting is not recognized.";
|
||||
}
|
||||
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
if ($adminconfirm == 'N') {
|
||||
$mail->send();
|
||||
}
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
}
|
||||
// exit();
|
||||
/*
|
||||
//$filename = $filepathname;
|
||||
$path = 'pdf';
|
||||
$file1 = $path . "/" . $filename1;
|
||||
$file2 = $path . "/" . $filename2;
|
||||
// Recipient
|
||||
$to = $emailuser;
|
||||
// Sender
|
||||
$from = $fromaddresssmail;
|
||||
$fromName = 'CIMAC Application Form System';
|
||||
// Email subject
|
||||
$subject = $appformn;
|
||||
// Attachment file
|
||||
$file = $file1;
|
||||
$mmessage="mailtrf";
|
||||
include('include/mailhtml.php');
|
||||
// Email body content
|
||||
$htmlContent = $mailmessage1;
|
||||
// Header for sender info
|
||||
$headers = "From: $fromName"." <".$from.">";
|
||||
// Boundary
|
||||
$semi_rand = md5(time());
|
||||
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
|
||||
// Headers for attachment
|
||||
$headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
|
||||
// Multipart boundary
|
||||
$message = "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"UTF-8\"\n" .
|
||||
"Content-Transfer-Encoding: 7bit\n\n" . $htmlContent . "\n\n";
|
||||
// Preparing attachment
|
||||
if(!empty($file) > 0){
|
||||
if(is_file($file)){
|
||||
$message .= "--{$mime_boundary}\n";
|
||||
$fp = @fopen($file,"rb");
|
||||
$data = @fread($fp,filesize($file));
|
||||
@fclose($fp);
|
||||
$data = chunk_split(base64_encode($data));
|
||||
$message .= "Content-Type: application/octet-stream; name=\"".basename($file)."\"\n" .
|
||||
"Content-Description: ".basename($file)."\n" .
|
||||
"Content-Disposition: attachment;\n" . " filename=\"".basename($file)."\"; size=".filesize($file).";\n" .
|
||||
"Content-Transfer-Encoding: base64\n\n" . $data . "\n\n";
|
||||
}
|
||||
}
|
||||
$message .= "--{$mime_boundary}--";
|
||||
$returnpath = "-f" . $from;
|
||||
// Send email
|
||||
$mail = @mail($to, $subject, $message, $headers, $returnpath);
|
||||
*/
|
||||
}
|
||||
?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $sendtitle; ?></h4>
|
||||
<br><br>
|
||||
<p><?php echo $companyname; ?> <?php echo $sendsentence; ?></p><br>
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,607 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf = $_GET["idtrf"];
|
||||
}
|
||||
if (isset($_GET["codestep"])) {
|
||||
$code = "8";
|
||||
$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");
|
||||
?>
|
||||
<?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(); ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>TRF <?php echo $ownercompanyname; ?> </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="<?php echo $ownercompanyname; ?> 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" />
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
<!-- upload image script -->
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".upload-doc").click(function() {
|
||||
$(".form-horizontal").ajaxForm({
|
||||
target: '.preview'
|
||||
}).submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<style>
|
||||
/* Add this CSS to your styles */
|
||||
.custom-file-upload {
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
cursor: pointer;
|
||||
background: #28a745;
|
||||
color: white;
|
||||
border-radius: 0.25rem;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.file-name-display {
|
||||
border: 1px solid #ccc;
|
||||
padding: 6px 12px;
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
min-width: 120px;
|
||||
margin-right: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.upload-div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
</style>
|
||||
</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: 95%;" aria-valuenow="95" aria-valuemin="0" aria-valuemax="100">95%</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php // photos
|
||||
?>
|
||||
|
||||
<?php if (($trfnumberfinal->getColumnVal("idcertification") != '5') and ($trfnumberfinal->getColumnVal("idcertification") != '6')) { ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0"><?php echo $addphotosdoc; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i>
|
||||
<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>Foto frontale e laterale
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</h4>
|
||||
|
||||
<p class="text-muted mb-3"><?php echo $allowedkind; ?></p>
|
||||
|
||||
|
||||
<table id="photoaded">
|
||||
<tr>
|
||||
<?php
|
||||
$photoshoesside = "";
|
||||
$photoshoessole = "";
|
||||
|
||||
if ($trfnumberfinal->getColumnVal("idarticletype") == '1') {
|
||||
$photo1 = $photoshoesside;
|
||||
$photo2 = $photoshoessole;
|
||||
} elseif ($trfnumberfinal->getColumnVal("idarticletype") == '2') {
|
||||
$photo1 = $photogloveup;
|
||||
$photo2 = $photoglovebottom;
|
||||
} elseif ($trfnumberfinal->getColumnVal("idarticletype") == '3') {
|
||||
$photo1 = $photomasksidea;
|
||||
$photo2 = $photomasksideb;
|
||||
} ?>
|
||||
<th><?php echo $photo1; ?></th>
|
||||
<th></th>
|
||||
<th><?php echo $photo2; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<form id="uploadFormphoto" enctype="multipart/form-data">
|
||||
<label for="fileInput1" class="custom-file-upload"><?php echo $browsebotton; ?></label>
|
||||
<div class="file-name-display" onclick="document.getElementById('fileInput1').click();"><?php echo $nofilechoosen; ?></div>
|
||||
<input type="file" name="docphotoone[]" id="fileInput1" style="display: none;" onchange="updateFileName(1)">
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo $trfnumberfinal->getColumnVal("idtrfdetails"); ?>">
|
||||
<input type="submit" name="submit" value="UPLOAD" />
|
||||
</form>
|
||||
<!-- Display upload status -->
|
||||
<div id="uploadStatus1"></div>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<form id="uploadFormphototwo" enctype="multipart/form-data">
|
||||
<label for="fileInput2" class="custom-file-upload"><?php echo $browsebotton; ?></label>
|
||||
<div class="file-name-display" onclick="document.getElementById('fileInput2').click();"><?php echo $nofilechoosen; ?></div>
|
||||
<input type="file" name="docphototwo[]" id="fileInput2" style="display: none;" onchange="updateFileName(2)">
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo $trfnumberfinal->getColumnVal("idtrfdetails"); ?>">
|
||||
<input type="submit" name="submit" value="UPLOAD" />
|
||||
</form>
|
||||
<!-- Display upload status -->
|
||||
<div id="uploadStatus2"></div>
|
||||
</div>
|
||||
<script>
|
||||
// Add this script to handle the filename display
|
||||
function updateFileName(index) {
|
||||
var input = document.getElementById('fileInput' + index);
|
||||
var fileNameDisplay = document.querySelector('.upload-div #uploadStatus' + index);
|
||||
fileNameDisplay.textContent = input.files[0].name || 'No file chosen';
|
||||
}
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="cont_photoone">
|
||||
<?php if (!empty($trfnumberfinal->getColumnVal("photoone"))) { ?>
|
||||
<img src="uploaddocuments/<?php echo ($trfnumberfinal->getColumnVal("photoone")); ?>" height="200" alt="" />
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td id="cont_phototwo">
|
||||
|
||||
<?php if (!empty($trfnumberfinal->getColumnVal("phototwo"))) { ?>
|
||||
|
||||
<img src="uploaddocuments/<?php echo ($trfnumberfinal->getColumnVal("phototwo")); ?>" height="200" alt="" />
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card--><?php } ?>
|
||||
|
||||
|
||||
|
||||
<?php // documents
|
||||
?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0"><?php echo $adddoctitle; ?> <i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center5"></i>
|
||||
<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($documenthelp); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</h4>
|
||||
<?php if ($idcert != 5) { ?>
|
||||
<p class="text-muted mb-3"><?php echo $adddoctitle_help; ?></p>
|
||||
<?php } else { ?>
|
||||
<p class="text-muted mb-3"><?php echo $auditdocumenttitle; ?></p>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<form id="uploadForm" enctype="multipart/form-data">
|
||||
<div class="form-group row">
|
||||
<label for="validationTooltip01" class="col-sm-5 col-form-label"><?php echo $filedescription; ?></label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="validationTooltip01" name="filedescription" placeholder="<?php echo $filedescription; ?>" required="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label"><?php echo $selectfileonyourpc; ?></label>
|
||||
<div class="col-sm-8">
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" id="fileInput" name="doc[]" onchange="document.getElementById('fileInputLabel').innerHTML = document.getElementById('fileInput').files[0].name">
|
||||
<label class="custom-file-label" for="fileInput" id="fileInputLabel"><?php echo $nofilechoosen; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo $trfnumberfinal->getColumnVal("idtrfdetails"); ?>">
|
||||
<input type="submit" class="btn btn-primary" name="submit" value="UPLOAD" />
|
||||
</form>
|
||||
|
||||
<script>
|
||||
// Assicurati che questo script sia incluso dopo il form o prima della chiusura del tag body
|
||||
document.getElementById('fileInput').onchange = function() {
|
||||
// Verifica se un file è stato selezionato
|
||||
if (this.files && this.files.length > 0) {
|
||||
// Aggiorna il testo della label con il nome del file
|
||||
document.getElementById('fileInputLabel').innerHTML = this.files[0].name;
|
||||
} else {
|
||||
// Se non è stato selezionato nessun file, mostra il testo di default
|
||||
document.getElementById('fileInputLabel').innerHTML = '<?php echo $nofilechoosen; ?>';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Display upload status -->
|
||||
<div id="uploadStatus"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
<div class="card" id="provacla">
|
||||
|
||||
<?php
|
||||
$filenamelist = new WA_MySQLi_RS("filenamelist", $cmctrfdb, 0);
|
||||
$filenamelist->setQuery("SELECT * FROM fileattached WHERE fileattached.idtrfdetails='$idtrf'");
|
||||
$filenamelist->execute();
|
||||
?>
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $addeddoctitle; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $addeddoctitle_help; ?></p>
|
||||
|
||||
|
||||
<div class="upload-div">
|
||||
<!-- File upload form -->
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
|
||||
<div class="table-responsive" id="docadded">
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $filenametitle; ?></th>
|
||||
<th><?php echo $filenamedesc; ?></th>
|
||||
|
||||
<th><?php echo $actiondel; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="cont_file">
|
||||
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$filenamelist->atEnd()) {
|
||||
$wa_startindex = $filenamelist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="uploaddocuments/<?php echo ($filenamelist->getColumnVal("filename_fileattached")); ?>" target="_blank"><?php echo $filesent; ?></a>
|
||||
</td>
|
||||
<td><?php echo ($filenamelist->getColumnVal("description_fileattached")); ?></td>
|
||||
|
||||
<td>
|
||||
|
||||
<a href="deleteaddedoc.php?idtrf=<?php echo $idtrf; ?>&idadddoc=<?php echo ($filenamelist->getColumnVal("idfileattached")); ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$filenamelist->moveNext();
|
||||
}
|
||||
$filenamelist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table><br>
|
||||
<a href="trfoption.php?idtrf=<?php echo $idtrf; ?>&codestep=8"><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="window.location.href='identificationparts.php?idtrf=<?php echo $idtrf; ?>'"><?php echo $backstep; ?></button>
|
||||
|
||||
|
||||
<!--end /table-->
|
||||
</div><!--end /tableresponsive-->
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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 -->
|
||||
<script>
|
||||
var match = [
|
||||
"application/pdf",
|
||||
"application/msword", // per i file .doc
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document", // per i file .docx
|
||||
"image/jpg",
|
||||
"image/jpeg",
|
||||
"image/gif",
|
||||
"application/xls",
|
||||
"application/xlsx",
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
"application/vnd.ms-excel.sheet.macroEnabled.12",
|
||||
"image/png",
|
||||
"image/bmp"
|
||||
];
|
||||
$(document).ready(function() {
|
||||
// File upload via Ajax
|
||||
$("#uploadForm").on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'uploadfile.php',
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData: false,
|
||||
beforeSend: function() {
|
||||
$('#uploadStatus').html('<img src="../images/uploading.gif"/>');
|
||||
},
|
||||
error: function() {
|
||||
$('#uploadStatus').html('<span style="color:#EA4335;">File upload failed, please try again.<span>');
|
||||
},
|
||||
success: function(data) {
|
||||
$('#uploadForm')[0].reset();
|
||||
$('#uploadStatus').html('<span style="color:#28A74B;">File uploaded successfully.<span>');
|
||||
// $('.gallery').html(data);
|
||||
// $("#docadded").load(location.href + " #docadded");
|
||||
// SHOW UPLOADED FILE
|
||||
$('#cont_file').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// File type validation
|
||||
$("#fileInput").change(function() {
|
||||
var fileLength = this.files.length;
|
||||
// var match= ["application/pdf","application/msword","image/jpg","image/gif","application/xls","application/xlsx", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"];
|
||||
var i;
|
||||
for (i = 0; i < fileLength; i++) {
|
||||
var file = this.files[i];
|
||||
var imagefile = file.type;
|
||||
// if(!((imagefile==match[0]) || (imagefile==match[1]) || (imagefile==match[5]) || (imagefile==match[6]) || (imagefile==match[7]) || (imagefile==match[8]))){
|
||||
// alert('Please select a valid file (PDF, word, excel).');
|
||||
// $("#fileInput").val('');
|
||||
// return false;
|
||||
// }
|
||||
if (!match.includes(imagefile)) {
|
||||
alert('Please select a valid file (PDF, word, excel).');
|
||||
$("#fileInput").val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// File upload via Ajax
|
||||
$("#uploadFormphoto").on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'uploadphotofile.php',
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData: false,
|
||||
beforeSend: function() {
|
||||
$('#uploadStatus1').html('<img src="../images/uploading.gif"/>');
|
||||
},
|
||||
error: function() {
|
||||
$('#uploadStatus1').html('<span style="color:#EA4335;">File upload failed, please try again.<span>');
|
||||
},
|
||||
success: function(data) {
|
||||
$('#uploadFormphoto')[0].reset();
|
||||
$('#uploadStatus1').html('<span style="color:#28A74B;">File uploaded successfully.<span>');
|
||||
// $('.gallery').html(data);
|
||||
|
||||
// $("#photoaded").load(location.href + " #photoaded");
|
||||
// SHOW PHOTO 1
|
||||
$('#cont_photoone').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// File type validation
|
||||
$("#fileInput1").change(function() {
|
||||
var fileLength = this.files.length;
|
||||
// var match= ["application/pdf","application/msword","image/jpg","image/gif","application/xls","application/xlsx", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"];
|
||||
var i;
|
||||
for (i = 0; i < fileLength; i++) {
|
||||
var file = this.files[i];
|
||||
var imagefile = file.type.toLowerCase();
|
||||
if (!((imagefile == match[2]) || (imagefile == match[3]) || (imagefile == match[4]) || (imagefile == match[9]) || (imagefile == match[10]))) {
|
||||
alert('Please select a valid file (jpg, jpeg, png, bmp).');
|
||||
$("#fileInput1").val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// File upload via Ajax
|
||||
$("#uploadFormphototwo").on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'uploadphotofile2.php',
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData: false,
|
||||
beforeSend: function() {
|
||||
$('#uploadStatus2').html('<img src="../images/uploading.gif"/>');
|
||||
},
|
||||
error: function() {
|
||||
$('#uploadStatus2').html('<span style="color:#EA4335;">File upload failed, please try again.<span>');
|
||||
},
|
||||
success: function(data) {
|
||||
$('#uploadFormphototwo')[0].reset();
|
||||
$('#uploadStatus2').html('<span style="color:#28A74B;">File uploaded successfully.<span>');
|
||||
// $('.gallery').html(data);
|
||||
// $("#photoaded").load(location.href + " #photoaded");
|
||||
// SHOW PHOTO 2
|
||||
$('#cont_phototwo').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// File type validation
|
||||
$("#fileInput2").change(function() {
|
||||
var fileLength = this.files.length;
|
||||
// var match= ["application/pdf","application/msword","image/jpg","image/gif","application/xls","application/xlsx", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"];
|
||||
var i;
|
||||
for (i = 0; i < fileLength; i++) {
|
||||
var file = this.files[i];
|
||||
var imagefile = file.type.toLowerCase();
|
||||
if (!((imagefile == match[2]) || (imagefile == match[3]) || (imagefile == match[4]) || (imagefile == match[9]) || (imagefile == match[10]))) {
|
||||
alert('Please select a valid file (jpg, jpeg, png, bmp).');
|
||||
$("#fileInput2").val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- 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>
|
||||
@ -1,489 +0,0 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
</head>
|
||||
<?php require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/rsobj.php');
|
||||
require_once('../webassist/mysqli/queryobj.php'); ?>
|
||||
<?php
|
||||
//global variable
|
||||
include('include/generalsettings.php');
|
||||
// start fpdf
|
||||
require('fpdf/fpdf.php');
|
||||
include('languages/' . $_SESSION['langselect'] . '/pdflang.php');
|
||||
|
||||
function convertToPDFEncoding($string)
|
||||
{
|
||||
$decoded = html_entity_decode($string, ENT_QUOTES, 'UTF-8');
|
||||
return iconv('UTF-8', 'windows-1252', $decoded);
|
||||
}
|
||||
|
||||
//include('include/headscript.php'); ?>
|
||||
<?php
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf=$_GET["idtrf"];
|
||||
}
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf=$_POST["idtrf"];
|
||||
}
|
||||
//zip creation
|
||||
include('include/zipcreation.php');
|
||||
include('datarecover/parsedata.php');
|
||||
$nappform=$trfData['trfnumber'];
|
||||
if ($trfData['revtrf']==0) {
|
||||
$nappformfinaltest=$pdnappformtest.' '.$nappform;
|
||||
} else {
|
||||
$revnbr=$trfData['revtrf'];
|
||||
$nappformfinaltest=$pdnappformtest.' '.$nappform.'R'.$revnbr;
|
||||
}
|
||||
if ($trfData['revtrf']==0) {
|
||||
$nappformfinal=$pdnappform.' '.$nappform;
|
||||
} else {
|
||||
$revnbr=$trfData['revtrf'];
|
||||
$nappformfinal=$pdnappform.' '.$nappform.'R'.$revnbr;
|
||||
}
|
||||
$nappformfinaltest = html_entity_decode($nappformfinaltest, ENT_QUOTES);
|
||||
$nappformfinaltest = iconv('UTF-8', 'windows-1252//IGNORE', $nappformfinaltest);
|
||||
$nappformfinal = html_entity_decode($nappformfinal, ENT_QUOTES);
|
||||
$nappformfinal = iconv('UTF-8', 'windows-1252//IGNORE', $nappformfinal);
|
||||
//$nappformtest=$pdnappformtest.' '.$nappform;
|
||||
//$nappformfinal=$nappform;
|
||||
//$nappformfinal=$nappformtest;
|
||||
$_SESSION["idcertificatesession"]=$idcertificate;
|
||||
$_SESSION["sndrptsession"]=$sndrpt;
|
||||
$_SESSION["revisioncert"]=$certificationrevision->getColumnVal("rev");
|
||||
$_SESSION["revisioncertm30"]=$certificationrevision->getColumnVal("revm30");
|
||||
$_SESSION["certname"]=$certificationrevision->getColumnVal("name_certification");
|
||||
$_SESSION["certname30"]=$certificationrevision->getColumnVal("m30namecert");
|
||||
$daterevformat=$certificationrevision->getColumnVal("date");
|
||||
$timeStamp = strtotime($daterevformat);
|
||||
$_SESSION["certdate"] = date("d-m-Y", $timeStamp);
|
||||
$daterevformatm30=$certificationrevision->getColumnVal("datem30");
|
||||
$timeStampm30 = strtotime($daterevformatm30);
|
||||
$_SESSION["certdatem30"] = date("d-m-Y", $timeStampm30);
|
||||
$_SESSION["certtitle"]=$_SESSION["certname"].' rev. '.$_SESSION["revisioncert"].' del '.$_SESSION["certdate"];
|
||||
$_SESSION["certtitlem30"]=$_SESSION["certname30"].' rev. '.$_SESSION["revisioncertm30"].' del '.$_SESSION["certdatem30"];
|
||||
|
||||
class PDF extends FPDF
|
||||
{
|
||||
/* CENTER IMAGE IN CELL */
|
||||
const DPI = 96;
|
||||
const MM_IN_INCH = 25.4;
|
||||
const A4_HEIGHT = 297;
|
||||
const A4_WIDTH = 210;
|
||||
// tweak these values (in pixels), convert mm to px
|
||||
const MAX_WIDTH = 359.05511811; /* IMG CONTAINER - WIDTH */
|
||||
const MAX_HEIGHT = 226.77165354; /* IMG CONTAINER - HEIGHT */
|
||||
const MAX_WIDTH_S = 264.56692913; /* IMG CONTAINER SMALL - WIDTH */
|
||||
const MAX_HEIGHT_S = 158.74015748; /* IMG CONTAINER SMALL - HEIGHT */
|
||||
function pixelsToMM($val) {
|
||||
return $val * self::MM_IN_INCH / self::DPI;
|
||||
}
|
||||
function resizeToFit($imgFilename, $cellWidth, $cellHeight, $containerSize) {
|
||||
list($width, $height) = getimagesize($imgFilename);
|
||||
if($containerSize == 'S'){
|
||||
/* SMALL CONTAINER SIZE */
|
||||
$widthScale = self::MAX_WIDTH_S / $width;
|
||||
$heightScale = self::MAX_HEIGHT_S / $height;
|
||||
}else{
|
||||
/* DEFAULT CONTAINER SIZE */
|
||||
$widthScale = self::MAX_WIDTH / $width;
|
||||
$heightScale = self::MAX_HEIGHT / $height;
|
||||
}
|
||||
$scale = min($widthScale, $heightScale);
|
||||
$width_in_mm = round($this->pixelsToMM($scale * $width)); /* IMAGE WIDTH */
|
||||
$height_in_mm = round($this->pixelsToMM($scale * $height)); /* IMAGE HEIGHT */
|
||||
/* IF IMAGE WIDTH IS SMALLER THAN THE CELL WIDTH, STRETCH IMAGE */
|
||||
if($width_in_mm < $cellWidth){
|
||||
$add_w = $cellWidth - $width_in_mm;
|
||||
}else{
|
||||
$add_w = 0;
|
||||
}
|
||||
|
||||
/* IF IMAGE IS IN PORTRAIT MODE, ALIGN TO CENTER */
|
||||
if($width_in_mm <= ($cellWidth / 2)){
|
||||
$image_x = $width_in_mm / 2;
|
||||
$add_w = 0;
|
||||
}else{
|
||||
$image_x = 1;
|
||||
}
|
||||
/* IF IMAGE IS TALLER THAN CELL HEIGHT, RESIZE TO FIT */
|
||||
if($height_in_mm > $cellHeight){
|
||||
$height_in_mm = $cellHeight;
|
||||
}
|
||||
/* IF IMAGE IS WIDER THAN CELL, RESIZE TO FIT */
|
||||
if($width_in_mm > $cellWidth){
|
||||
$width_in_mm = $cellWidth - 2;
|
||||
}
|
||||
return array(
|
||||
$width_in_mm,
|
||||
$height_in_mm,
|
||||
$add_w,
|
||||
$image_x
|
||||
);
|
||||
}
|
||||
function centreImage($img, $cellWidth, $cellHeight, $containerSize) {
|
||||
list($width, $height, $add_image_width, $add_abscissa) = $this->resizeToFit($img, $cellWidth-2, $cellHeight-1, $containerSize);
|
||||
// $this->Image($img, $this->GetX()+$add_abscissa, $this->GetY(), $width+$add_image_width, $height);
|
||||
$this->Image($img, $this->GetX()+$add_abscissa, $this->GetY()+1, $width+$add_image_width, $height-1);
|
||||
|
||||
}
|
||||
/* END CENTER IMAGE IN CELL */
|
||||
// Page header
|
||||
function Header()
|
||||
{
|
||||
// Logo
|
||||
$this->Image('../images/cimac-logo.png',5,5,70);
|
||||
$this->SetFont('Arial','',7);
|
||||
//$this->Cell(0,-5,'A.N.C.I. Servizi S.r.l. a socio unico',0,0,"R");
|
||||
//$this->Cell(0,2,'Sede operativa / Operational headquarters: Via Aguzzafame 60/b - 27029 Vigevano (PV)',0,0,"R");
|
||||
//$this->Cell(0,9,'ORGANISMO NOTIFICATO / NOTIFIED BODY N. 0465',0,0,"R");
|
||||
$this->SetFont('Arial','B',14);
|
||||
if ($_SESSION["sndrptsession"]=='N' and $_SESSION["idcertificatesession"]==1 || $_SESSION["idcertificatesession"]==3 || $_SESSION["idcertificatesession"]==8 || $_SESSION["idcertificatesession"]==9) {
|
||||
$this->Cell(0,35,$GLOBALS['nappformfinaltest'],0,0,"C"); } else {
|
||||
$this->Cell(0,35,$GLOBALS['nappformfinal'],0,0,"C");
|
||||
}
|
||||
// Line break
|
||||
$this->Ln(25);
|
||||
}
|
||||
// Page footer
|
||||
function Footer()
|
||||
{
|
||||
// Position at 1.5 cm from bottom
|
||||
|
||||
$this->SetY(-45);
|
||||
// Arial italic 8
|
||||
$this->SetFont('Arial','',8);
|
||||
// Page number and certification revision
|
||||
// $revisioncert=$certificationrevision->getColumnVal("rev");
|
||||
// $certname=$certificationrevision->getColumnVal("name_certification");
|
||||
// $certdate=$certificationrevision->getColumnVal("date");
|
||||
// $certtitle=$certname.' rev. '.$revisioncert.' '.$certdate;
|
||||
$certittle=$_SESSION["certtitle"];
|
||||
$certittlem30=$_SESSION["certtitlem30"];
|
||||
if ($_SESSION["sndrptsession"]=='N' and $_SESSION["idcertificatesession"]==1 || $_SESSION["idcertificatesession"]==3 || $_SESSION["idcertificatesession"]==8 || $_SESSION["idcertificatesession"]==9) {
|
||||
$this->Cell(0,10,$certittlem30.' - Pagina '.$this->PageNo().'/{nb}',0,0,'C');
|
||||
|
||||
$this->Image('../images/cimaclaboratories.png',10,260,190);
|
||||
|
||||
|
||||
} else {
|
||||
$this->Cell(0,10,$certittle.' - Pagina '.$this->PageNo().'/{nb}',0,0,'C');
|
||||
$this->Image('../images/cimaccertifications.png',10,260,190);
|
||||
}
|
||||
}
|
||||
//include('pdfcreation/headerandfooter.php');
|
||||
}
|
||||
//some general data
|
||||
$certname=$certificationrevision->getColumnVal("name_certification");
|
||||
// Instanciation of inherited class
|
||||
$pdf = new PDF();
|
||||
$pdf->AliasNbPages();
|
||||
$pdf->AddPage();
|
||||
$pdf->SetFont('Times','',9);
|
||||
$pdf->SetAutoPageBreak(true, 45);
|
||||
// from here start customization based on certification required required
|
||||
// certificate 5 and 6 Table: contacts auditdpi and documents
|
||||
|
||||
|
||||
if ($idcertificate==5 || $idcertificate==6) {
|
||||
include('pdfcreation/pdf5and6.php');
|
||||
} elseif ($sndrpt=='Y' and $idcertificate==4) {
|
||||
|
||||
include('pdfcreation/pdf4snd.php');
|
||||
|
||||
} elseif ($sndrpt=='Y' and $idcertificate==1) {
|
||||
|
||||
include('pdfcreation/pdf1snd.php');
|
||||
|
||||
} elseif ($sndrpt=='N' and $idcertificate==4) {
|
||||
|
||||
include('pdfcreation/pdf4.php');
|
||||
|
||||
} elseif ($sndrpt=='N' and $idcertificate==1) {
|
||||
|
||||
include('pdfcreation/pdf1.php');
|
||||
} elseif ($idcertificate==2) {
|
||||
|
||||
include('pdfcreation/pdf2.php');
|
||||
|
||||
} elseif ($sndrpt=='Y' and $idcertificate==3) {
|
||||
|
||||
include('pdfcreation/pdf3snd.php');
|
||||
} elseif ($sndrpt=='N' and $idcertificate==3) {
|
||||
include('pdfcreation/pdf3.php');
|
||||
|
||||
} elseif ($sndrpt=='Y' and $idcertificate==8) {
|
||||
include('pdfcreation/pdf8snd.php');
|
||||
} elseif ($sndrpt=='N' and $idcertificate==8) {
|
||||
include('pdfcreation/pdf8.php');
|
||||
} else {
|
||||
//othercertificate
|
||||
//description table
|
||||
include('pdfcreation/descriptiontable.php');
|
||||
$pdf->Ln();
|
||||
// standards table
|
||||
include('pdfcreation/standardstable.php');
|
||||
$pdf->Ln();
|
||||
// additionalinfo requirements
|
||||
include('pdfcreation/addreqtable.php');
|
||||
$pdf->Ln();
|
||||
|
||||
// additionalinfo
|
||||
include('pdfcreation/addinfotable.php');
|
||||
$pdf->Ln();
|
||||
|
||||
// parts table
|
||||
include('pdfcreation/partstable.php');
|
||||
$pdf->Ln();
|
||||
|
||||
// chem table
|
||||
include('pdfcreation/chemtable.php');
|
||||
$pdf->Ln();
|
||||
//trf option
|
||||
include('pdfcreation/trfoption.php');
|
||||
$pdf->Ln();
|
||||
|
||||
//trf option
|
||||
include('pdfcreation/fileattached.php');
|
||||
$pdf->Ln();
|
||||
$pdf->Ln();
|
||||
//header report contact
|
||||
include('pdfcreation/headerreporttable.php');
|
||||
$pdf->Ln();
|
||||
//header certificate contact
|
||||
include('pdfcreation/headercertificatetable.php');
|
||||
$pdf->Ln();
|
||||
//invoice contact
|
||||
include('pdfcreation/invoicecontacttable.php');
|
||||
$pdf->Ln();
|
||||
//Sign datatable
|
||||
include('pdfcreation/signdatatable.php');
|
||||
$pdf->Ln();
|
||||
}
|
||||
//outpt pdf for all certificate
|
||||
include('pdfcreation/pdfoutput.php');
|
||||
//include('pdfcreation/pdf1sndbis.php');
|
||||
|
||||
?>
|
||||
<?php
|
||||
//second pdf creation
|
||||
if ($idcertificate==1 or $idcertificate==3 or $idcertificate==8 or $idcertificate==9) {
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf=$_GET["idtrf"];
|
||||
}
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf=$_POST["idtrf"];
|
||||
}
|
||||
//zip creation
|
||||
include('include/zipcreation.php');
|
||||
include('datarecover/parsedata.php');
|
||||
$_SESSION["sndrptsession"]='Y';
|
||||
$_SESSION["idcertificatesession"]=$idcertificate;
|
||||
$sndrpt="Y";
|
||||
$_SESSION["revisioncert"]=$certificationrevision->getColumnVal("rev");
|
||||
$_SESSION["revisioncertm30"]=$certificationrevision->getColumnVal("revm30");
|
||||
$_SESSION["certname"]=$certificationrevision->getColumnVal("name_certification");
|
||||
$_SESSION["certname30"]=$certificationrevision->getColumnVal("m30namecert");
|
||||
$daterevformat=$certificationrevision->getColumnVal("date");
|
||||
$timeStamp = strtotime($daterevformat);
|
||||
$_SESSION["certdate"] = date("d-m-Y", $timeStamp);
|
||||
$daterevformatm30=$certificationrevision->getColumnVal("datem30");
|
||||
$timeStampm30 = strtotime($daterevformatm30);
|
||||
$_SESSION["certdatem30"] = date("d-m-Y", $timeStampm30);
|
||||
$_SESSION["certtitle"]=$_SESSION["certname"].' rev. '.$_SESSION["revisioncert"].' del '.$_SESSION["certdate"];
|
||||
$_SESSION["certtitlem30"]=$_SESSION["certname30"].' rev. '.$_SESSION["revisioncertm30"].' del '.$_SESSION["certdatem30"];
|
||||
class PDF2 extends FPDF
|
||||
{
|
||||
/* CENTER IMAGE IN CELL */
|
||||
const DPI = 96;
|
||||
const MM_IN_INCH = 25.4;
|
||||
const A4_HEIGHT = 297;
|
||||
const A4_WIDTH = 210;
|
||||
// tweak these values (in pixels), convert mm to px
|
||||
const MAX_WIDTH = 359.05511811; /* IMG CONTAINER - WIDTH */
|
||||
const MAX_HEIGHT = 226.77165354; /* IMG CONTAINER - HEIGHT */
|
||||
const MAX_WIDTH_S = 264.56692913; /* IMG CONTAINER SMALL - WIDTH */
|
||||
const MAX_HEIGHT_S = 158.74015748; /* IMG CONTAINER SMALL - HEIGHT */
|
||||
function pixelsToMM($val) {
|
||||
return $val * self::MM_IN_INCH / self::DPI;
|
||||
}
|
||||
function resizeToFit($imgFilename, $cellWidth, $cellHeight, $containerSize) {
|
||||
list($width, $height) = getimagesize($imgFilename);
|
||||
if($containerSize == 'S'){
|
||||
/* SMALL CONTAINER SIZE */
|
||||
$widthScale = self::MAX_WIDTH_S / $width;
|
||||
$heightScale = self::MAX_HEIGHT_S / $height;
|
||||
}else{
|
||||
/* DEFAULT CONTAINER SIZE */
|
||||
$widthScale = self::MAX_WIDTH / $width;
|
||||
$heightScale = self::MAX_HEIGHT / $height;
|
||||
}
|
||||
$scale = min($widthScale, $heightScale);
|
||||
$width_in_mm = round($this->pixelsToMM($scale * $width)); /* IMAGE WIDTH */
|
||||
$height_in_mm = round($this->pixelsToMM($scale * $height)); /* IMAGE HEIGHT */
|
||||
/* IF IMAGE WIDTH IS SMALLER THAN THE CELL WIDTH, STRETCH IMAGE */
|
||||
if($width_in_mm < $cellWidth){
|
||||
$add_w = $cellWidth - $width_in_mm;
|
||||
}else{
|
||||
$add_w = 0;
|
||||
}
|
||||
|
||||
/* IF IMAGE IS IN PORTRAIT MODE, ALIGN TO CENTER */
|
||||
if($width_in_mm <= ($cellWidth / 2)){
|
||||
$image_x = $width_in_mm / 2;
|
||||
$add_w = 0;
|
||||
}else{
|
||||
$image_x = 1;
|
||||
}
|
||||
/* IF IMAGE IS TALLER THAN CELL HEIGHT, RESIZE TO FIT */
|
||||
if($height_in_mm > $cellHeight){
|
||||
$height_in_mm = $cellHeight;
|
||||
}
|
||||
/* IF IMAGE IS WIDER THAN CELL, RESIZE TO FIT */
|
||||
if($width_in_mm > $cellWidth){
|
||||
$width_in_mm = $cellWidth - 2;
|
||||
}
|
||||
return array(
|
||||
$width_in_mm,
|
||||
$height_in_mm,
|
||||
$add_w,
|
||||
$image_x
|
||||
);
|
||||
}
|
||||
function centreImage($img, $cellWidth, $cellHeight, $containerSize) {
|
||||
list($width, $height, $add_image_width, $add_abscissa) = $this->resizeToFit($img, $cellWidth-2, $cellHeight-1, $containerSize);
|
||||
// $this->Image($img, $this->GetX()+$add_abscissa, $this->GetY(), $width+$add_image_width, $height);
|
||||
$this->Image($img, $this->GetX()+$add_abscissa, $this->GetY()+1, $width+$add_image_width, $height-1);
|
||||
|
||||
}
|
||||
/* END CENTER IMAGE IN CELL */
|
||||
|
||||
// Page header
|
||||
function Header()
|
||||
{
|
||||
// Logo
|
||||
// if ($_SESSION["sndrptsession"]=='N' and $_SESSION["idcertificatesession"]==1 || $_SESSION["idcertificatesession"]==3 || $_SESSION["idcertificatesession"]==5 || $_SESSION["idcertificatesession"]==7) {
|
||||
//$this->Image('../images/cimaclaboratories.png',10,5,190);
|
||||
|
||||
// } else {
|
||||
$this->Image('../images/cimac-logo.png',5,5,70);
|
||||
|
||||
$this->SetFont('Arial','',7);
|
||||
//$this->Cell(0,-5,'A.N.C.I. Servizi S.r.l. a socio unico',0,0,"R");
|
||||
//$this->Cell(0,2,'Sede operativa / Operational headquarters: Via Aguzzafame 60/b - 27029 Vigevano (PV)',0,0,"R");
|
||||
//$this->Cell(0,9,'ORGANISMO NOTIFICATO / NOTIFIED BODY N. 0465',0,0,"R");
|
||||
$this->SetFont('Arial','B',14);
|
||||
$this->Cell(0,35,$GLOBALS['nappformfinal'],0,0,"C");
|
||||
// Line break
|
||||
$this->Ln(25);
|
||||
}
|
||||
// Page footer
|
||||
function Footer()
|
||||
{
|
||||
// Position at 1.5 cm from bottom
|
||||
$this->SetY(-45);
|
||||
// Arial italic 8
|
||||
$this->SetFont('Arial','',8);
|
||||
// Page number and certification revision
|
||||
// $revisioncert=$certificationrevision->getColumnVal("rev");
|
||||
// $certname=$certificationrevision->getColumnVal("name_certification");
|
||||
// $certdate=$certificationrevision->getColumnVal("date");
|
||||
// $certtitle=$certname.' rev. '.$revisioncert.' '.$certdate;
|
||||
$certittle=$_SESSION["certtitle"];
|
||||
|
||||
$this->Cell(0,10,$certittle.' - Pagina '.$this->PageNo().'/{nb}',0,0,'C');
|
||||
$this->Image('../images/cimaccertifications.png',10,260,190); //}
|
||||
}
|
||||
//include('pdfcreation/headerandfooter.php');
|
||||
}
|
||||
//some general data
|
||||
$certname=$certificationrevision->getColumnVal("name_certification");
|
||||
// Instanciation of inherited class
|
||||
$pdf = new PDF2();
|
||||
$pdf->AliasNbPages();
|
||||
$pdf->AddPage();
|
||||
$pdf->SetFont('Times','',9);
|
||||
$pdf->SetAutoPageBreak(true, 45);
|
||||
// from here start customization based on certification required required
|
||||
// certificate 5 and 6 Table: contacts auditdpi and documents
|
||||
if ($idcertificate==5 and $idcertificate==6) {
|
||||
include('pdfcreation/pdf5and6.php');
|
||||
} elseif ($sndrpt=='Y' and $idcertificate==4) {
|
||||
|
||||
include('pdfcreation/pdf4snd.php');
|
||||
|
||||
} elseif ($sndrpt=='Y' and $idcertificate==1) {
|
||||
|
||||
include('pdfcreation/pdf1snd.php');
|
||||
|
||||
} elseif ($sndrpt=='N' and $idcertificate==4) {
|
||||
|
||||
include('pdfcreation/pdf4.php');
|
||||
|
||||
} elseif ($sndrpt=='N' and $idcertificate==1) {
|
||||
|
||||
include('pdfcreation/pdf1.php');
|
||||
} elseif ($idcertificate==2) {
|
||||
|
||||
include('pdfcreation/pdf2.php');
|
||||
|
||||
} elseif ($sndrpt=='Y' and $idcertificate==3) {
|
||||
|
||||
include('pdfcreation/pdf3snd.php');
|
||||
|
||||
} elseif ($sndrpt=='N' and $idcertificate==3) {
|
||||
|
||||
include('pdfcreation/pdf3.php');
|
||||
|
||||
} elseif ($sndrpt=='Y' and $idcertificate==8) {
|
||||
include('pdfcreation/pdf8snd.php');
|
||||
} elseif ($sndrpt=='N' and $idcertificate==8) {
|
||||
include('pdfcreation/pdf8.php');
|
||||
} else {
|
||||
//othercertificate
|
||||
//description table
|
||||
include('pdfcreation/descriptiontable.php');
|
||||
$pdf->Ln();
|
||||
// standards table
|
||||
include('pdfcreation/standardstable.php');
|
||||
$pdf->Ln();
|
||||
// additionalinfo requirements
|
||||
include('pdfcreation/addreqtable.php');
|
||||
$pdf->Ln();
|
||||
|
||||
// additionalinfo
|
||||
include('pdfcreation/addinfotable.php');
|
||||
$pdf->Ln();
|
||||
|
||||
// parts table
|
||||
include('pdfcreation/partstable.php');
|
||||
$pdf->Ln();
|
||||
|
||||
// chem table
|
||||
include('pdfcreation/chemtable.php');
|
||||
$pdf->Ln();
|
||||
//trf option
|
||||
include('pdfcreation/trfoption.php');
|
||||
$pdf->Ln();
|
||||
|
||||
//trf option
|
||||
include('pdfcreation/fileattached.php');
|
||||
$pdf->Ln();
|
||||
$pdf->Ln();
|
||||
//header report contact
|
||||
include('pdfcreation/headerreporttable.php');
|
||||
$pdf->Ln();
|
||||
//header certificate contact
|
||||
include('pdfcreation/headercertificatetable.php');
|
||||
$pdf->Ln();
|
||||
//invoice contact
|
||||
include('pdfcreation/invoicecontacttable.php');
|
||||
$pdf->Ln();
|
||||
//Sign datatable
|
||||
include('pdfcreation/signdatatable.php');
|
||||
$pdf->Ln();
|
||||
}
|
||||
//outpt pdf for all certificate
|
||||
include('pdfcreation/pdfoutput.php');
|
||||
}
|
||||
?>
|
||||
@ -1,479 +0,0 @@
|
||||
<?php
|
||||
//You shall use the following exact namespaces no
|
||||
//matter in whathever directory you upload your
|
||||
//phpmailer files.
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf = $_POST["idtrf"];
|
||||
}
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf = $_GET["idtrf"];
|
||||
}
|
||||
if (isset($_POST["tokensignatureon"])) {
|
||||
$tokensignatureon = $_POST["tokensignatureon"];
|
||||
}
|
||||
if (isset($_POST["clientname"])) {
|
||||
$clientname = $_POST["clientname"];
|
||||
}
|
||||
if (isset($_POST["datetrf"])) {
|
||||
$datetrf = $_POST["datetrf"];
|
||||
}
|
||||
if (isset($_POST["sndrpt"])) {
|
||||
$sndrpt = $_POST["sndrpt"];
|
||||
} else {
|
||||
$sndrpt = "N";
|
||||
}
|
||||
if (isset($_POST["adminconfirm"])) {
|
||||
$adminconfirm = $_POST["adminconfirm"];
|
||||
} else {
|
||||
$adminconfirm = "N";
|
||||
}
|
||||
if (isset($_GET["codestep"])) {
|
||||
$code = $_GET["codestep"];
|
||||
$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
|
||||
$tokenid = $user->present()->signaturecode;
|
||||
if ($tokenid != $tokensignatureon) {
|
||||
header("Location: declaration.php?idtrf=$idtrf&tokenresult=ko");
|
||||
} else {
|
||||
// update trf details`
|
||||
if (isset($_POST["formdeclaration"])) {
|
||||
if ($sndrpt == 'N') {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "`trf-details`";
|
||||
$UpdateQuery->bindColumn("signedon", "s", "$datetrf", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("revcs", "s", "N", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idtrfdetails", "=", "i", "" . ($idtrf) . "");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
} else {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "`trf-details`";
|
||||
$UpdateQuery->bindColumn("signedonsecondcert", "s", "$datetrf", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("revcs", "s", "N", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idtrfdetails", "=", "i", "" . ($idtrf) . "");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<?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");
|
||||
$appformn = $trfnumberfinal->getColumnVal("trfnumber");
|
||||
$ntrfmail = $trfnumberfinal->getColumnVal("trfnumber");;
|
||||
$revnumb = $trfnumberfinal->getColumnVal("revtrf");
|
||||
?>
|
||||
<?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
|
||||
$chemicalagentlist = new WA_MySQLi_RS("chemicalagentlist", $cmctrfdb, 0);
|
||||
$chemicalagentlist->setQuery("SELECT * FROM chemicalagent ORDER BY chemicalagent.name_chemicalagent");
|
||||
$chemicalagentlist->execute();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>TRF <?php echo $ownercompanyname; ?> </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="<?php echo $ownercompanyname; ?> 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" />
|
||||
<!-- submit form with button -->
|
||||
<style>
|
||||
input:invalid {
|
||||
border-color: #ff0000;
|
||||
background-color: #fff7e6;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
background: yellow;
|
||||
}
|
||||
|
||||
input:valid {
|
||||
border-color: #66ff33;
|
||||
background-color: #eeffe6;
|
||||
}
|
||||
|
||||
select:invalid {
|
||||
border-color: #ff0000;
|
||||
background-color: #fff7e6;
|
||||
}
|
||||
|
||||
select:focus {
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
select:valid {
|
||||
border-color: #66ff33;
|
||||
background-color: #eeffe6;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
body {
|
||||
font-family: arial;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
p {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function show1() {
|
||||
document.getElementById('div1').style.display = 'none';
|
||||
}
|
||||
|
||||
function show2() {
|
||||
document.getElementById('div1').style.display = 'block';
|
||||
}
|
||||
|
||||
function show3() {
|
||||
document.getElementById('div3').style.display = 'none';
|
||||
}
|
||||
|
||||
function show4() {
|
||||
document.getElementById('div3').style.display = 'block';
|
||||
}
|
||||
|
||||
function show5() {
|
||||
document.getElementById('div5').style.display = 'none';
|
||||
}
|
||||
|
||||
function show6() {
|
||||
document.getElementById('div5').style.display = 'block';
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Top Bar Start -->
|
||||
<?php include('include/topbar.php'); ?>
|
||||
<!-- Top Bar End -->
|
||||
<!-- Left Sidenav -->
|
||||
<?php include('include/leftsidenav2.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: 100%;" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">100%</div>
|
||||
</div>
|
||||
<!-- card for optional TRF -->
|
||||
<?php //pdf creation
|
||||
include('pdf-creation.php');
|
||||
|
||||
//if ($idcertificate==1 or $idcertificate==3 or $idcertificate==4)
|
||||
//{
|
||||
//include('pdf-creation2.php'); }
|
||||
// attachment
|
||||
$checkpdffiles = new WA_MySQLi_RS("checkpdffiles", $cmctrfdb, 1);
|
||||
$checkpdffiles->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'");
|
||||
$checkpdffiles->execute();
|
||||
$path = 'pdf';
|
||||
$filename1 = $checkpdffiles->getColumnVal("pdffilename");
|
||||
$file1 = $path . "/" . $filename1;
|
||||
if (!empty($checkpdffiles->getColumnVal("pdffilename2"))) {
|
||||
$filename2 = $checkpdffiles->getColumnVal("pdffilename2");
|
||||
$file2 = $path . "/" . $filename2;
|
||||
}
|
||||
//Now include the following following files based
|
||||
//on the correct file path. Third file is required only if you want to enable SMTP.
|
||||
require 'phpmailer/src/Exception.php';
|
||||
require 'phpmailer/src/PHPMailer.php';
|
||||
require 'phpmailer/src/SMTP.php';
|
||||
//mail to client
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
$mmessage = "mailtrf";
|
||||
include('include/mailhtml.php');
|
||||
// Email body content
|
||||
$trfnmbmail = $appformn . 'r' . $revnumb;
|
||||
$htmlContent = $mailmessage1;
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addAddress($emailuser); // Add a recipient
|
||||
$mail->addAttachment($file1); // Add attachments
|
||||
if (!empty($checkpdffiles->getColumnVal("pdffilename2"))) {
|
||||
$mail->addAttachment($file2);
|
||||
} // Optional name
|
||||
$mail->Subject = $appformn . 'r' . $revnumb;
|
||||
$mail->Body = $htmlContent;
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
if ($adminconfirm == 'N') {
|
||||
$mail->send();
|
||||
}
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
// mail to CS
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
$mmessage = "mailtrf";
|
||||
// Email body content
|
||||
$htmlContent = $mailmessage1;
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
if (!empty($csmail)) {
|
||||
$mail->addAddress($csmail); // Aggiunge il destinatario solo se non è vuoto
|
||||
}
|
||||
if (!empty($csmail2)) {
|
||||
$mail->addAddress($csmail2);
|
||||
}
|
||||
if (!empty($csmail3)) {
|
||||
$mail->addAddress($csmail3);
|
||||
}
|
||||
if (!empty($csmailccn)) {
|
||||
$mail->addBCC($csmailccn);
|
||||
}
|
||||
|
||||
$mail->Subject = $appformn . 'r' . $revnumb;;
|
||||
$mail->Body = "Ciao! E' stato inserito un nuovo ETRF N. $trfnmbmail ";
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
if ($adminconfirm == 'N') {
|
||||
$mail->send();
|
||||
}
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
// mail REV to CS
|
||||
// if rev is > 0
|
||||
if ($revnumb > 0) {
|
||||
//query to see the previous CS in charge
|
||||
$revnumberprev = $revnumb - 1;
|
||||
$trfprevrev = new WA_MySQLi_RS("trfprevrev", $cmctrfdb, 1);
|
||||
$trfprevrev->setQuery("SELECT * FROM `trf-details` LEFT JOIN company ON `trf-details`.idcompany=company.idcompany WHERE `trf-details`.trfnumber='$ntrfmail' AND `trf-details`.revtrf='$revnumberprev'");
|
||||
$trfprevrev->execute();
|
||||
$csinchargeprev = $trfprevrev->getColumnVal("csincharge");
|
||||
if ($csinchargeprev == 'ddondena') {
|
||||
$mailincharge = 'd.dondena@cimac.it';
|
||||
} elseif ($csinchargeprev == 'cboscaino') {
|
||||
$mailincharge = 'c.boscaino@cimac.it';
|
||||
} elseif ($csinchargeprev == 'solocla') {
|
||||
$mailincharge = 'info@acscreativesolutions.com';
|
||||
} else {
|
||||
$mailincharge = 'd.dondena@cimac.it';
|
||||
}
|
||||
// Define array with all CS mails
|
||||
$csmailall = array($csmail, $csmail2, $csmail3);
|
||||
// Extract the recipient that matches $mailincharge
|
||||
$recipientTo = $mailincharge;
|
||||
$recipientsCC = array_diff($csmailall, array($recipientTo));
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
$mmessage = "mailtrf";
|
||||
// Email body content
|
||||
$htmlContent = $mailmessage1;
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addAddress($recipientTo); // Add the recipient in "To" field
|
||||
foreach ($recipientsCC as $ccRecipient) {
|
||||
$mail->addCC($ccRecipient); // Add recipients in "CC" field
|
||||
}
|
||||
$companynamemail = $trfprevrev->getColumnVal("companyname_company");
|
||||
$descart = $trfprevrev->getColumnVal("sample_description");
|
||||
$mail->Subject = $appformn . 'r' . $revnumb;
|
||||
if ($_SESSION['langselect'] == 'it') {
|
||||
// Imposta il testo in italiano
|
||||
$mail->Body = "Ciao $csinchargeprev! <br> È stato inserito un nuovo ETRF N. $trfnmbmail.<br><br>" .
|
||||
"Ragione Sociale = $companynamemail<br><br>" .
|
||||
"Descrizione articolo $descart.<br>";
|
||||
} else if ($_SESSION['langselect'] == 'en') {
|
||||
// Imposta il testo in inglese
|
||||
$mail->Body = "Hi $csinchargeprev! <br> A new ETRF No. $trfnmbmail has been submitted.<br><br>" .
|
||||
"Company Name = $companynamemail<br><br>" .
|
||||
"Item Description $descart.<br>";
|
||||
} else {
|
||||
// Imposta un valore di default o gestisci l'errore
|
||||
$mail->Body = "Language setting is not recognized.";
|
||||
}
|
||||
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
if ($adminconfirm == 'N') {
|
||||
$mail->send();
|
||||
}
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
}
|
||||
// exit();
|
||||
/*
|
||||
//$filename = $filepathname;
|
||||
$path = 'pdf';
|
||||
$file1 = $path . "/" . $filename1;
|
||||
$file2 = $path . "/" . $filename2;
|
||||
// Recipient
|
||||
$to = $emailuser;
|
||||
// Sender
|
||||
$from = $fromaddresssmail;
|
||||
$fromName = 'CIMAC Application Form System';
|
||||
// Email subject
|
||||
$subject = $appformn;
|
||||
// Attachment file
|
||||
$file = $file1;
|
||||
$mmessage="mailtrf";
|
||||
include('include/mailhtml.php');
|
||||
// Email body content
|
||||
$htmlContent = $mailmessage1;
|
||||
// Header for sender info
|
||||
$headers = "From: $fromName"." <".$from.">";
|
||||
// Boundary
|
||||
$semi_rand = md5(time());
|
||||
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
|
||||
// Headers for attachment
|
||||
$headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
|
||||
// Multipart boundary
|
||||
$message = "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"UTF-8\"\n" .
|
||||
"Content-Transfer-Encoding: 7bit\n\n" . $htmlContent . "\n\n";
|
||||
// Preparing attachment
|
||||
if(!empty($file) > 0){
|
||||
if(is_file($file)){
|
||||
$message .= "--{$mime_boundary}\n";
|
||||
$fp = @fopen($file,"rb");
|
||||
$data = @fread($fp,filesize($file));
|
||||
@fclose($fp);
|
||||
$data = chunk_split(base64_encode($data));
|
||||
$message .= "Content-Type: application/octet-stream; name=\"".basename($file)."\"\n" .
|
||||
"Content-Description: ".basename($file)."\n" .
|
||||
"Content-Disposition: attachment;\n" . " filename=\"".basename($file)."\"; size=".filesize($file).";\n" .
|
||||
"Content-Transfer-Encoding: base64\n\n" . $data . "\n\n";
|
||||
}
|
||||
}
|
||||
$message .= "--{$mime_boundary}--";
|
||||
$returnpath = "-f" . $from;
|
||||
// Send email
|
||||
$mail = @mail($to, $subject, $message, $headers, $returnpath);
|
||||
*/
|
||||
}
|
||||
?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $sendtitle; ?></h4>
|
||||
<br><br>
|
||||
<p><?php echo $companyname; ?> <?php echo $sendsentence; ?></p><br>
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,524 +0,0 @@
|
||||
<?php
|
||||
//You shall use the following exact namespaces no
|
||||
//matter in whathever directory you upload your
|
||||
//phpmailer files.
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
ob_start();
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
if (isset($companyData["logoimage"]) && !empty($companyData["logoimage"])) {
|
||||
$companylogo = $companyData["logoimage"];
|
||||
$_SESSION['companylogo'] = $companylogo;
|
||||
}
|
||||
// pickup the get variable
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf = $_POST["idtrf"];
|
||||
}
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf = $_GET["idtrf"];
|
||||
}
|
||||
|
||||
if (isset($_GET["idtrftd"])) {
|
||||
$idtrftd = $_GET["idtrftd"];
|
||||
}
|
||||
if (isset($_POST["idtrftd"])) {
|
||||
$idtrftd = $_GET["idtrftd"];
|
||||
}
|
||||
if (isset($_GET["idtd"])) {
|
||||
$idtd = $_GET["idtd"];
|
||||
}
|
||||
if (isset($_POST["idtd"])) {
|
||||
$idtd = $_POST["idtd"];
|
||||
}
|
||||
if (isset($_POST["tokensignatureon"])) {
|
||||
$tokensignatureon = $_POST["tokensignatureon"];
|
||||
}
|
||||
if (isset($_POST["clientname"])) {
|
||||
$clientname = $_POST["clientname"];
|
||||
}
|
||||
if (isset($_POST["datetrf"])) {
|
||||
$datetrf = $_POST["datetrf"];
|
||||
}
|
||||
if (isset($_POST["sndrpt"])) {
|
||||
$sndrpt = $_POST["sndrpt"];
|
||||
} else {
|
||||
$sndrpt = "N";
|
||||
}
|
||||
if (isset($_POST["adminconfirm"])) {
|
||||
$adminconfirm = $_POST["adminconfirm"];
|
||||
} else {
|
||||
$adminconfirm = "N";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<?php
|
||||
$tokenid = $user->present()->signaturecode;
|
||||
if ($tokenid != $tokensignatureon) {
|
||||
header("Location: declaration.php?idtrf=$idtrf&tokenresult=ko");
|
||||
} else {
|
||||
// update trf details`
|
||||
if (isset($_POST["formdeclaration"])) {
|
||||
if ($sndrpt == 'N') {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "data_td";
|
||||
$UpdateQuery->bindColumn("signnametd", "s", "$clientname", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("signedontd", "s", "$datetrf", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("statustd", "s", "Signed", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("iddata_td", "=", "i", "" . ($idtd) . "");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<?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");
|
||||
$appformn = $trfnumberfinal->getColumnVal("trfnumber");
|
||||
$ntrfmail = $trfnumberfinal->getColumnVal("trfnumber");;
|
||||
$revnumb = $trfnumberfinal->getColumnVal("revtrf");
|
||||
?>
|
||||
<?php $idcert = $trfnumberfinal->getColumnVal("idcertification") ?>
|
||||
<?php
|
||||
// query data_td
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
$sql = "SELECT * FROM data_td WHERE iddata_td = ?";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bind_param("i", $idtd); // "i" indica che l'id è un intero
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$row = $result->fetch_assoc();
|
||||
$statustd = $row['statustd'];
|
||||
$idtrftd = $row['idtrf'];
|
||||
$tdnumber = $row['tdnumber'];
|
||||
$tdrev = $row['td_rev'];
|
||||
$trfmod = $row['trfmod'];
|
||||
$stmt->close();
|
||||
$conn->close();
|
||||
?>
|
||||
<?php
|
||||
$certname = new WA_MySQLi_RS("certname", $cmctrfdb, 1);
|
||||
$certname->setQuery("SELECT * FROM certificationtype WHERE certificationtype.idcertificationtype='$idcert'");
|
||||
$certname->execute(); ?>
|
||||
<?php
|
||||
$chemicalagentlist = new WA_MySQLi_RS("chemicalagentlist", $cmctrfdb, 0);
|
||||
$chemicalagentlist->setQuery("SELECT * FROM chemicalagent ORDER BY chemicalagent.name_chemicalagent");
|
||||
$chemicalagentlist->execute();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>TRF <?php echo $ownercompanyname; ?> </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta content="<?php echo $ownercompanyname; ?> 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" />
|
||||
<!-- submit form with button -->
|
||||
<style>
|
||||
input:invalid {
|
||||
border-color: #ff0000;
|
||||
background-color: #fff7e6;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
background: yellow;
|
||||
}
|
||||
|
||||
input:valid {
|
||||
border-color: #66ff33;
|
||||
background-color: #eeffe6;
|
||||
}
|
||||
|
||||
select:invalid {
|
||||
border-color: #ff0000;
|
||||
background-color: #fff7e6;
|
||||
}
|
||||
|
||||
select:focus {
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
select:valid {
|
||||
border-color: #66ff33;
|
||||
background-color: #eeffe6;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
body {
|
||||
font-family: arial;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
p {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function show1() {
|
||||
document.getElementById('div1').style.display = 'none';
|
||||
}
|
||||
|
||||
function show2() {
|
||||
document.getElementById('div1').style.display = 'block';
|
||||
}
|
||||
|
||||
function show3() {
|
||||
document.getElementById('div3').style.display = 'none';
|
||||
}
|
||||
|
||||
function show4() {
|
||||
document.getElementById('div3').style.display = 'block';
|
||||
}
|
||||
|
||||
function show5() {
|
||||
document.getElementById('div5').style.display = 'none';
|
||||
}
|
||||
|
||||
function show6() {
|
||||
document.getElementById('div5').style.display = 'block';
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Top Bar Start -->
|
||||
<?php include('include/topbar.php'); ?>
|
||||
<!-- Top Bar End -->
|
||||
<!-- Left Sidenav -->
|
||||
<?php include('include/leftsidenav2.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/appformtd.php'); ?>
|
||||
</div><!--end media-->
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
<div class="progress mb-4">
|
||||
<div class="progress-bar" role="progressbar" style="width: 100%;" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">100%</div>
|
||||
</div>
|
||||
<!-- card for optional TRF -->
|
||||
<?php //pdf creation
|
||||
|
||||
include('tf_pdfcreation.php');
|
||||
|
||||
if ($trfmod == 'Y') {
|
||||
|
||||
// Esegui la chiamata cURL per previewtrf.php
|
||||
$url = "http://localhost/cmccopiaoriginale/public/previewtrf.php?idtrf=" . urlencode($idtrf);
|
||||
|
||||
// Recupera i cookie di sessione
|
||||
$cookies = '';
|
||||
foreach ($_COOKIE as $key => $value) {
|
||||
$cookies .= $key . '=' . $value . '; ';
|
||||
}
|
||||
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 15); // Timeout leggermente più lungo
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt($ch, CURLOPT_COOKIE, $cookies); // Invia i cookie di sessione
|
||||
|
||||
// Aggiungi gestione degli errori cURL
|
||||
$response = curl_exec($ch);
|
||||
if (curl_errno($ch)) {
|
||||
$error_msg = curl_error($ch);
|
||||
error_log("cURL error: " . $error_msg, 3, "../logfile.log"); // Sostituisci con il percorso del tuo file di log
|
||||
} else {
|
||||
// Registra la risposta per debug
|
||||
error_log("cURL response: " . $response, 3, "../logfile.log"); // Sostituisci con il percorso del tuo file di log
|
||||
}
|
||||
curl_close($ch);
|
||||
}
|
||||
|
||||
//if ($idcertificate==1 or $idcertificate==3 or $idcertificate==4)
|
||||
//{
|
||||
//include('pdf-creation2.php'); }
|
||||
// attachment
|
||||
|
||||
$checkpdffiles = new WA_MySQLi_RS("checkpdffiles", $cmctrfdb, 1);
|
||||
$checkpdffiles->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'");
|
||||
$checkpdffiles->execute();
|
||||
$path = 'pdf';
|
||||
$filename1 = $checkpdffiles->getColumnVal("pdffilename");
|
||||
$file1 = $path . "/" . $filename1;
|
||||
if (!empty($checkpdffiles->getColumnVal("pdffilename2"))) {
|
||||
$filename2 = $checkpdffiles->getColumnVal("pdffilename2");
|
||||
$file2 = $path . "/" . $filename2;
|
||||
}
|
||||
//Now include the following following files based
|
||||
//on the correct file path. Third file is required only if you want to enable SMTP.
|
||||
require 'phpmailer/src/Exception.php';
|
||||
require 'phpmailer/src/PHPMailer.php';
|
||||
require 'phpmailer/src/SMTP.php';
|
||||
//mail to client
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
$mmessage = "mailtrf";
|
||||
include('include/mailhtml.php');
|
||||
// Email body content
|
||||
$trfnmbmail = $appformn . 'r' . $revnumb;
|
||||
$htmlContent = $mailmessage1;
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addAddress($emailuser); // Add a recipient
|
||||
$mail->addAttachment($file1); // Add attachments
|
||||
if (!empty($checkpdffiles->getColumnVal("pdffilename2"))) {
|
||||
$mail->addAttachment($file2);
|
||||
} // Optional name
|
||||
$mail->Subject = $appformn . 'r' . $revnumb;
|
||||
$mail->Body = $htmlContent;
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
if ($adminconfirm == 'N') {
|
||||
// $mail->send();
|
||||
}
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
// mail to CS
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
$mmessage = "mailtrf";
|
||||
// Email body content
|
||||
$htmlContent = $mailmessage1;
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
if (!empty($csmail)) {
|
||||
$mail->addAddress($csmail); // Aggiunge il destinatario solo se non è vuoto
|
||||
}
|
||||
if (!empty($csmail2)) {
|
||||
$mail->addAddress($csmail2);
|
||||
}
|
||||
if (!empty($csmail3)) {
|
||||
$mail->addAddress($csmail3);
|
||||
}
|
||||
if (!empty($csmailccn)) {
|
||||
$mail->addBCC($csmailccn);
|
||||
}
|
||||
|
||||
$mail->Subject = $appformn . 'r' . $revnumb;;
|
||||
$mail->Body = "Ciao! E' stato inserito un nuovo ETRF N. $trfnmbmail ";
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
if ($adminconfirm == 'N') {
|
||||
// $mail->send();
|
||||
}
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
// mail REV to CS
|
||||
// if rev is > 0
|
||||
if ($revnumb > 0) {
|
||||
//query to see the previous CS in charge
|
||||
$revnumberprev = $revnumb - 1;
|
||||
$trfprevrev = new WA_MySQLi_RS("trfprevrev", $cmctrfdb, 1);
|
||||
$trfprevrev->setQuery("SELECT * FROM `trf-details` LEFT JOIN company ON `trf-details`.idcompany=company.idcompany WHERE `trf-details`.trfnumber='$ntrfmail' AND `trf-details`.revtrf='$revnumberprev'");
|
||||
$trfprevrev->execute();
|
||||
$csinchargeprev = $trfprevrev->getColumnVal("csincharge");
|
||||
if ($csinchargeprev == 'ddondena') {
|
||||
$mailincharge = 'd.dondena@cimac.it';
|
||||
} elseif ($csinchargeprev == 'cboscaino') {
|
||||
$mailincharge = 'c.boscaino@cimac.it';
|
||||
} elseif ($csinchargeprev == 'solocla') {
|
||||
$mailincharge = 'info@acscreativesolutions.com';
|
||||
} else {
|
||||
$mailincharge = 'd.dondena@cimac.it';
|
||||
}
|
||||
// Define array with all CS mails
|
||||
$csmailall = array($csmail, $csmail2, $csmail3);
|
||||
// Extract the recipient that matches $mailincharge
|
||||
$recipientTo = $mailincharge;
|
||||
$recipientsCC = array_diff($csmailall, array($recipientTo));
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $mailhost; // Specify main and backup server
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $mailusername; // SMTP username
|
||||
$mail->Password = $mailpassword; // SMTP password
|
||||
$mail->SMTPSecure = $mailmethod; // Enable encryption, 'ssl' also accepted
|
||||
$mail->Port = $mailport;
|
||||
$mmessage = "mailtrf";
|
||||
// Email body content
|
||||
$htmlContent = $mailmessage1;
|
||||
$mail->From = $fromaddresssmail;
|
||||
$mail->FromName = 'CIMAC Application Form System';
|
||||
$mail->addAddress($recipientTo); // Add the recipient in "To" field
|
||||
foreach ($recipientsCC as $ccRecipient) {
|
||||
$mail->addCC($ccRecipient); // Add recipients in "CC" field
|
||||
}
|
||||
$companynamemail = $trfprevrev->getColumnVal("companyname_company");
|
||||
$descart = $trfprevrev->getColumnVal("sample_description");
|
||||
$mail->Subject = $appformn . 'r' . $revnumb;
|
||||
if ($_SESSION['langselect'] == 'it') {
|
||||
// Imposta il testo in italiano
|
||||
$mail->Body = "Ciao $csinchargeprev! <br> È stato inserito un nuovo ETRF N. $trfnmbmail.<br><br>" .
|
||||
"Ragione Sociale = $companynamemail<br><br>" .
|
||||
"Descrizione articolo $descart.<br>";
|
||||
} else if ($_SESSION['langselect'] == 'en') {
|
||||
// Imposta il testo in inglese
|
||||
$mail->Body = "Hi $csinchargeprev! <br> A new ETRF No. $trfnmbmail has been submitted.<br><br>" .
|
||||
"Company Name = $companynamemail<br><br>" .
|
||||
"Item Description $descart.<br>";
|
||||
} else {
|
||||
// Imposta un valore di default o gestisci l'errore
|
||||
$mail->Body = "Language setting is not recognized.";
|
||||
}
|
||||
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
if ($adminconfirm == 'N') {
|
||||
// $mail->send();
|
||||
}
|
||||
// echo 'Message has been sent';
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
}
|
||||
}
|
||||
// exit();
|
||||
/*
|
||||
//$filename = $filepathname;
|
||||
$path = 'pdf';
|
||||
$file1 = $path . "/" . $filename1;
|
||||
$file2 = $path . "/" . $filename2;
|
||||
// Recipient
|
||||
$to = $emailuser;
|
||||
// Sender
|
||||
$from = $fromaddresssmail;
|
||||
$fromName = 'CIMAC Application Form System';
|
||||
// Email subject
|
||||
$subject = $appformn;
|
||||
// Attachment file
|
||||
$file = $file1;
|
||||
$mmessage="mailtrf";
|
||||
include('include/mailhtml.php');
|
||||
// Email body content
|
||||
$htmlContent = $mailmessage1;
|
||||
// Header for sender info
|
||||
$headers = "From: $fromName"." <".$from.">";
|
||||
// Boundary
|
||||
$semi_rand = md5(time());
|
||||
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
|
||||
// Headers for attachment
|
||||
$headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
|
||||
// Multipart boundary
|
||||
$message = "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"UTF-8\"\n" .
|
||||
"Content-Transfer-Encoding: 7bit\n\n" . $htmlContent . "\n\n";
|
||||
// Preparing attachment
|
||||
if(!empty($file) > 0){
|
||||
if(is_file($file)){
|
||||
$message .= "--{$mime_boundary}\n";
|
||||
$fp = @fopen($file,"rb");
|
||||
$data = @fread($fp,filesize($file));
|
||||
@fclose($fp);
|
||||
$data = chunk_split(base64_encode($data));
|
||||
$message .= "Content-Type: application/octet-stream; name=\"".basename($file)."\"\n" .
|
||||
"Content-Description: ".basename($file)."\n" .
|
||||
"Content-Disposition: attachment;\n" . " filename=\"".basename($file)."\"; size=".filesize($file).";\n" .
|
||||
"Content-Transfer-Encoding: base64\n\n" . $data . "\n\n";
|
||||
}
|
||||
}
|
||||
$message .= "--{$mime_boundary}--";
|
||||
$returnpath = "-f" . $from;
|
||||
// Send email
|
||||
$mail = @mail($to, $subject, $message, $headers, $returnpath);
|
||||
*/
|
||||
}
|
||||
?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $sendtitle; ?></h4>
|
||||
<br><br>
|
||||
<p><?php echo $companyname; ?> <?php echo $sendsentence; ?></p><br>
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,580 +0,0 @@
|
||||
<?php require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
|
||||
<?php
|
||||
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
$archivetrflist = new WA_MySQLi_RS("archivetrflist", $cmctrfdb, 0);
|
||||
$archivetrflist->setQuery("SELECT * FROM `trf-details`
|
||||
LEFT JOIN auth_users ON `trf-details`.iduser=auth_users.id
|
||||
LEFT JOIN article_type ON `trf-details`.idarticletype=article_type.idarticletype
|
||||
LEFT JOIN certificationtype ON certificationtype.idcertificationtype=`trf-details`.idcertification
|
||||
WHERE `trf-details`.idcompany='$idcompany'
|
||||
AND `trf-details`.signedon <> ''
|
||||
ORDER BY `trf-details`.trfnumber, `trf-details`.revtrf DESC");
|
||||
$archivetrflist->execute();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
$drafttrf = new WA_MySQLi_RS("drafttrf", $cmctrfdb, 0);
|
||||
$drafttrf->setQuery("SELECT * FROM `trf-details`
|
||||
LEFT JOIN article_type ON `trf-details`.idarticletype=article_type.idarticletype
|
||||
LEFT JOIN certificationtype ON certificationtype.idcertificationtype=`trf-details`.idcertification
|
||||
WHERE `trf-details`.idcompany='$idcompany'
|
||||
AND `trf-details`.signedon =''
|
||||
AND `trf-details`.revcs != 'Y'
|
||||
ORDER BY `trf-details`.trfnumber");
|
||||
$drafttrf->execute();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?php echo $titlepage; ?> </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">
|
||||
|
||||
<!-- DataTables -->
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="/media/images/favicon.png">
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://www.datatables.net/rss.xml">
|
||||
<link rel="stylesheet" type="text/css" href="/media/css/site-examples.css?_=8f7cff5ee7757412879aedf3efbfaee01">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/2.3.2/css/buttons.dataTables.min.css">
|
||||
<style type="text/css" class="init">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript" src="/media/js/site.js?_=1d5abd169416a09a2b389885211721dd" data-domain="datatables.net" data-api="https://plausible.sprymedia.co.uk/api/event"></script>
|
||||
<script src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>
|
||||
<script type="text/javascript" src="/media/js/dynamic.php?comments-page=extensions%2Fbuttons%2Fexamples%2Finitialisation%2Fexport.html" async></script>
|
||||
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/2.3.2/js/dataTables.buttons.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.html5.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.print.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-RqEzHvnvS1k5K5wzgp5yoWY5U6TD5EoXyj9iikETmdcy1G6dbCVa+ZmzBm7VWzmj8Ov7VwtA9x9X7VWjG8SRFg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<!--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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
<script type="text/javascript" class="init">
|
||||
$(document).ready(function() {
|
||||
var table = $('#example').DataTable({
|
||||
pageLength: 20,
|
||||
order: [
|
||||
[0, 'desc']
|
||||
],
|
||||
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf'
|
||||
]
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('a.toggle-vis').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Get the column API object
|
||||
var column = table.column($(this).attr('data-column'));
|
||||
|
||||
// Toggle the visibility
|
||||
column.visible(!column.visible());
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" class="init">
|
||||
$(document).ready(function() {
|
||||
var table = $('#readytrf').DataTable({
|
||||
pageLength: 20,
|
||||
order: [
|
||||
[0, 'desc']
|
||||
],
|
||||
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf'
|
||||
]
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('a.toggle-vis').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Get the column API object
|
||||
var column = table.column($(this).attr('data-column'));
|
||||
|
||||
// Toggle the visibility
|
||||
column.visible(!column.visible());
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
document.getElementById('clonetrfalert').addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
if (confirm("Sei sicuro di voler andare al link clonetrf.php?")) {
|
||||
window.location.href = e.target.parentNode.href;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.btn-active {
|
||||
border-color: #dc3545;
|
||||
color: #dc3545;
|
||||
}
|
||||
|
||||
.btn-inactive {
|
||||
border-color: #6c757d;
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
.btn-inactive:disabled {
|
||||
background-color: #e9ecef;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Top Bar Start -->
|
||||
|
||||
|
||||
|
||||
<!-- 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">
|
||||
|
||||
|
||||
|
||||
<!-- DRAFT TRF -->
|
||||
|
||||
<div class="card">
|
||||
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $drafttrftitle; ?></h4>
|
||||
|
||||
<table id="example" class="display table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>TRF N.</th>
|
||||
<th>REV</th>
|
||||
<th>Description</th>
|
||||
<th>Cert Type</th>
|
||||
<th>Article type</th>
|
||||
<th>To be Sign</th>
|
||||
<th><?php echo $action; ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$drafttrf->atEnd()) {
|
||||
$wa_startindex = $drafttrf->Index;
|
||||
?>
|
||||
<tr><?php $idtrf = $drafttrf->getColumnVal("idtrfdetails"); ?>
|
||||
<td><?php echo ($drafttrf->getColumnVal("trfnumber")); ?></td>
|
||||
<td><?php if (($drafttrf->getColumnVal("revtrf")) > 0) { ?>R<?php echo $drafttrf->getColumnVal("revtrf");
|
||||
} ?></td>
|
||||
|
||||
<td><?php echo ($drafttrf->getColumnVal("sample_description")); ?></td>
|
||||
<td><?php echo ($drafttrf->getColumnVal("name_certification")); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
// Assuming session_start() has been called previously if needed.
|
||||
$nameField = ($_SESSION['langselect'] == 'en') ? 'name_articletypeeng' : 'name_articletype';
|
||||
echo ($drafttrf->getColumnVal($nameField));
|
||||
?>
|
||||
</td>
|
||||
<td><?php
|
||||
$revcs = $drafttrf->getColumnVal("revcs");
|
||||
if ($revcs == 's') { ?>
|
||||
|
||||
<a href="declaration.php?idtrf=<?php echo $idtrf; ?>"><button type="button" class="btn btn-success waves-effect waves-light">SIGN</button></a>
|
||||
|
||||
</td>
|
||||
<td></td><?php } ?>
|
||||
|
||||
|
||||
<?php if ($drafttrf->getColumnVal("idcertification") == 5 && $drafttrf->getColumnVal("revcs") != 's') { ?>
|
||||
|
||||
<td><a href="typeofcertificate5.php?idtrf=<?php echo $idtrf; ?>"><button type="button" class="btn btn-info waves-effect waves-light"><?php echo $proceedtrf; ?></button></a></td>
|
||||
|
||||
<?php } elseif ($drafttrf->getColumnVal("idcertification") == 6 && $drafttrf->getColumnVal("revcs") != 's') { ?>
|
||||
|
||||
<td><a href="typeofcertificate6.php?idtrf=<?php echo $idtrf; ?>"><button type="button" class="btn btn-info waves-effect waves-light"><?php echo $proceedtrf; ?></button></a></td>
|
||||
|
||||
|
||||
<?php } elseif ($drafttrf->getColumnVal("revcs") != 's') { ?>
|
||||
<td><a href="trfdetails.php?idtrf=<?php echo $idtrf; ?>"><button type="button" class="btn btn-info waves-effect waves-light"><?php echo $proceedtrf; ?></button></a></td>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<td>
|
||||
<button type="button" onclick="
|
||||
Swal.fire({
|
||||
title: 'Sei sicuro di voler duplicare il TRF N. <?php echo $drafttrf->getColumnVal('trfnumber'); ?>?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, duplica!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='clonetrf.php?idtrf=<?php echo $drafttrf->getColumnVal('idtrfdetails'); ?>';
|
||||
}
|
||||
});
|
||||
" class="btn btn-outline-warning waves-effect waves-light">
|
||||
<i class="far fa-copy"></i>
|
||||
</button>
|
||||
<button type="button" onclick="
|
||||
Swal.fire({
|
||||
title: 'Sei sicuro di voler cancellare il Draft TRF N. <?php echo $drafttrf->getColumnVal('trfnumber'); ?>?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, procedi!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='deleteappform.php?idtrf=<?php echo $drafttrf->getColumnVal('idtrfdetails'); ?>';
|
||||
}
|
||||
});
|
||||
" class="btn btn-outline-danger waves-effect waves-light">
|
||||
<i class="fas fa-trash-alt text-danger font-16"></i>
|
||||
</button>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
$drafttrf->moveNext();
|
||||
}
|
||||
$drafttrf->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
|
||||
<!-- COMPLETE TRF -->
|
||||
|
||||
<div class="card">
|
||||
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $archivetrf; ?></h4>
|
||||
|
||||
<table id="readytrf" class="display table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>TRF N.</th>
|
||||
<th>REV</th>
|
||||
<th>Signed On</th>
|
||||
<th>Description</th>
|
||||
<th>Cert Type</th>
|
||||
<th>Article type</th>
|
||||
<th>Insert by</th>
|
||||
<th>PDF1</th>
|
||||
<th>PDF2</th>
|
||||
<th>ZIP</th>
|
||||
<th>ACTION</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
$last_trfnumber = null;
|
||||
$last_revtrf = -1;
|
||||
|
||||
while (!$archivetrflist->atEnd()) {
|
||||
|
||||
// without signed for rev
|
||||
$idtrf_nosign = $archivetrflist->getColumnVal("idtrfdetails");
|
||||
$trfnosign = $archivetrflist->getColumnVal("trfnumber");
|
||||
$archivetrflistnosign = new WA_MySQLi_RS("archivetrflistnosign", $cmctrfdb, 0);
|
||||
$archivetrflistnosign->setQuery("SELECT MAX(revtrf) as max_revtrf FROM `trf-details` WHERE `trf-details`.trfnumber='$trfnosign'");
|
||||
$archivetrflistnosign->execute();
|
||||
$maxrevtrf = $archivetrflistnosign->getColumnVal("max_revtrf");
|
||||
$currentrevtrf = $archivetrflist->getColumnVal("revtrf");
|
||||
$current_trfnumber = $archivetrflist->getColumnVal("trfnumber");
|
||||
$current_revtrf = $archivetrflist->getColumnVal("revtrf");
|
||||
|
||||
// Check if this is a new TRF number
|
||||
if ($last_trfnumber !== $current_trfnumber) {
|
||||
$last_trfnumber = $current_trfnumber;
|
||||
$last_revtrf = $current_revtrf;
|
||||
}
|
||||
$wa_startindex = $archivetrflist->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo ($archivetrflist->getColumnVal("trfnumber")); ?></td>
|
||||
<td><?php if (($archivetrflist->getColumnVal("revtrf")) > 0) { ?>R<?php echo $archivetrflist->getColumnVal("revtrf");
|
||||
} ?></td>
|
||||
<td><?php echo ($archivetrflist->getColumnVal("signedon")); ?></td>
|
||||
|
||||
<td><?php echo ($archivetrflist->getColumnVal("sample_description"));
|
||||
|
||||
?></td>
|
||||
<td><?php echo ($archivetrflist->getColumnVal("name_certification")); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
// Assuming session_start() has been called previously if needed.
|
||||
$nameField = ($_SESSION['langselect'] == 'en') ? 'name_articletypeeng' : 'name_articletype';
|
||||
echo ($archivetrflist->getColumnVal($nameField));
|
||||
?>
|
||||
</td>
|
||||
|
||||
|
||||
<td><?php echo ($archivetrflist->getColumnVal("email")); ?></td>
|
||||
<td><a href="pdf/<?php echo $archivetrflist->getColumnVal("pdffilename"); ?>" target="_blank"><i class="fas fa-file-pdf text-danger font-20"></i></a></td>
|
||||
<td><?php if (!empty($archivetrflist->getColumnVal("pdffilename2"))) { ?><a href="pdf/<?php echo $archivetrflist->getColumnVal("pdffilename2"); ?>" target="_blank"><i class="fas fa-file-pdf text-danger font-20"></i></a><?php } ?></td>
|
||||
<td><?php if (!empty($archivetrflist->getColumnVal("zipname"))) { ?><a href="uploaddocuments/zip/<?php echo $archivetrflist->getColumnVal("zipname"); ?>" target="_blank"><i class="fas fa-file-archive text-warning font-20"></i></a><?php } ?></td>
|
||||
<td>
|
||||
<button type="button" onclick="
|
||||
Swal.fire({
|
||||
title: 'Sei sicuro di voler duplicare il TRF N. <?php echo $archivetrflist->getColumnVal('trfnumber'); ?>?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, duplica!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='clonetrf.php?idtrf=<?php echo $archivetrflist->getColumnVal('idtrfdetails'); ?>';
|
||||
}
|
||||
});
|
||||
" class="btn <?php echo ($maxrevtrf > $currentrevtrf) ? 'btn-inactive' : 'btn-outline-warning'; ?> waves-effect waves-light" <?php echo ($maxrevtrf > $currentrevtrf) ? 'disabled' : ''; ?>>
|
||||
<i class="far fa-copy"></i>
|
||||
</button>
|
||||
|
||||
<button type="button" onclick="
|
||||
Swal.fire({
|
||||
title: 'Sei sicuro di voler revisionare il TRF N. <?php echo $archivetrflist->getColumnVal('trfnumber'); ?>?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, procedi!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='revtrf.php?idtrf=<?php echo $archivetrflist->getColumnVal('idtrfdetails'); ?>';
|
||||
}
|
||||
});
|
||||
" class="btn <?php echo ($maxrevtrf > $currentrevtrf) ? 'btn-inactive' : 'btn-active'; ?> waves-effect waves-light" <?php echo ($maxrevtrf > $currentrevtrf) ? 'disabled' : ''; ?>>
|
||||
Rev
|
||||
</button>
|
||||
|
||||
<?php if ((Auth::user()->hasRole('Admin')) || (Auth::user()->hasRole('CustomerService')) || (Auth::user()->hasRole('Superuser'))) : ?>
|
||||
<?php
|
||||
$idtrfdetailschk = $archivetrflist->getColumnVal('idtrfdetails');
|
||||
$ntrfdetailschk = $archivetrflist->getColumnVal('trfnumber');
|
||||
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
$query = "SELECT COUNT(*) AS count FROM data_td WHERE idtrf = ?";
|
||||
|
||||
$stmt = $conn->prepare($query);
|
||||
$stmt->bind_param("i", $idtrfdetailschk);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$rowcheck = $result->fetch_assoc();
|
||||
|
||||
if ($rowcheck['count'] < 1) {
|
||||
$buttonColor = '#ff9800';
|
||||
$onClick = "Swal.fire({
|
||||
title: 'Sei sicuro di voler creare il Fascicolo Tecnico per il TRF N. " . $ntrfdetailschk . "?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, procedi!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='techdossier_start.php?idtrftd=" . $idtrfdetailschk . "';
|
||||
}
|
||||
});";
|
||||
} else {
|
||||
$buttonColor = '#4CAF50';
|
||||
$onClick = "window.location.href='archivetd.php';";
|
||||
}
|
||||
?>
|
||||
|
||||
<button type="button" onclick="<?php echo $onClick; ?>" class="btn <?php echo ($maxrevtrf > $currentrevtrf) ? 'btn-inactive' : ''; ?>" style="border: 1px solid; color: white; background-color: <?php echo $buttonColor; ?>;" <?php echo ($maxrevtrf > $currentrevtrf) ? 'disabled' : ''; ?>>
|
||||
TF
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
|
||||
<button type="button" onclick="
|
||||
Swal.fire({
|
||||
title: 'Sei sicuro di voler cancellare il TRF N. <?php echo $archivetrflist->getColumnVal('trfnumber'); ?>?',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Sì, procedi!',
|
||||
cancelButtonText: 'No, chiudi!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href='deleteappform.php?idtrf=<?php echo $archivetrflist->getColumnVal('idtrfdetails'); ?>';
|
||||
}
|
||||
});
|
||||
" class="btn btn-outline-danger waves-effect waves-light">
|
||||
<i class="fas fa-trash-alt text-danger font-16"></i>
|
||||
</button>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$archivetrflist->moveNext();
|
||||
}
|
||||
$archivetrflist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
|
||||
</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/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>
|
||||
@ -1,678 +0,0 @@
|
||||
/*!
|
||||
* 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');
|
||||
}
|
||||
|
||||
if(settings.columns.editable[i][1]=='filenameaudit'){
|
||||
var spantext='<a href="upload/'+$(this).text() +'" target="_blank">'+$(this).text()+' </a>';
|
||||
}
|
||||
else {
|
||||
var spantext=$(this).text();
|
||||
}
|
||||
// Create span element.
|
||||
var span = '<span class="tabledit-span">' + spantext + '</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'){
|
||||
if (text === yessent) {
|
||||
var input = '<input class="tabledit-input" type="checkbox" name="' + settings.columns.editable[i][1] + '" value="yes" checked="checked" style="display: none;" disabled>';
|
||||
|
||||
}
|
||||
else{
|
||||
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');
|
||||
var inputname=$input.attr('name');
|
||||
// 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==yessent){
|
||||
$input.attr('checked', 'checked');
|
||||
}
|
||||
}
|
||||
else if(inputname=='filenameaudit'){
|
||||
|
||||
var filename=$(this).find('.tabledit-span').text();
|
||||
if(filename!=''){
|
||||
$(this).find('.tabledit-span').html('<a href="upload/'+filename +'" target="_blank">'+filename+' </a>');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
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');
|
||||
var inputname=$input.attr('name');
|
||||
// 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(yessent);
|
||||
}
|
||||
else{
|
||||
$(this).find('.tabledit-span').text(nosent);
|
||||
}
|
||||
|
||||
}
|
||||
else if(inputname=='filenameaudit'){
|
||||
console.log('file type');
|
||||
var filename=$(this).find('.tabledit-span').text();
|
||||
if(filename!=''){
|
||||
$(this).find('.tabledit-span').html('<a href="upload/'+filename +'" target="_blank">'+filename+' </a>');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
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));
|
||||
@ -1,14 +0,0 @@
|
||||
<?php require_once('../Connections/cmctrfdb.php'); ?>
|
||||
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
|
||||
<?php
|
||||
if (true) {
|
||||
$DeleteQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$DeleteQuery->Action = "delete";
|
||||
$DeleteQuery->Table = "standards";
|
||||
$DeleteQuery->addFilter("idstandards", "=", "i", "".($_GET['idstd']) ."");
|
||||
$DeleteQuery->execute();
|
||||
$DeleteGoTo = "admin-standards.php";
|
||||
if (function_exists("rel2abs")) $DeleteGoTo = $DeleteGoTo?rel2abs($DeleteGoTo,dirname(__FILE__)):"";
|
||||
$DeleteQuery->redirect($DeleteGoTo);
|
||||
}
|
||||
?>
|
||||
@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
include('db-connect.php');
|
||||
|
||||
$row1 = mysqli_query($con,"SELECT *,trfstandards.iddpicategory as iddpicategoryid,trfstandards.idprotectioncategory as idprotectioncategoryid,trfstandards.idstandards as idstandardsid FROM trfstandards LEFT JOIN standards ON trfstandards.idstandards=standards.idstandards LEFT JOIN dpicategory ON trfstandards.iddpicategory=dpicategory.iddpicategory LEFT JOIN protectioncategory ON trfstandards.idprotectioncategory=protectioncategory.idprotectioncategory WHERE trfstandards.idtrfdetails='{$_GET['idtrf']}' order by standardcode");
|
||||
|
||||
$html = "<table class=\"table table-striped mb-0\" id=\"example1\" style=\"border:1px solide red\">
|
||||
<tr>
|
||||
<th style=\"display:none;\">id</th>
|
||||
<th>{$_GET['standardcodetitle']}</th>
|
||||
<th>{$_GET['protectioncategorytitle']}</th>
|
||||
<th>{$_GET['dpicategorytitle']}</th>
|
||||
</tr>";
|
||||
|
||||
while($rowquery = mysqli_fetch_assoc($row1)) {
|
||||
$this_pcat = (isset($rowquery['name_protectioncategory']))? $rowquery['name_protectioncategory']: $_GET['pleaseselectstd'];
|
||||
$this_dpcat = (isset($rowquery['value_dpicategory']))? $rowquery['value_dpicategory']: $_GET['pleaseselectstd'];
|
||||
$html .= "<tr>
|
||||
<td style=\"display:none;\">{$rowquery['idtrfstandards']}</td>
|
||||
<td>{$rowquery['standardcode']}</td>
|
||||
<td onclick=\"getSelectOptions('{$rowquery['idstandards']}','idprotectioncategory', '{$rowquery['idprotectioncategoryid']}');\">{$this_pcat}</td>
|
||||
<td onclick=\"getSelectOptions('{$rowquery['idstandards']}','iddpicategory', '{$rowquery['iddpicategoryid']}');\">{$this_dpcat}</td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
$html .= "</table>";
|
||||
|
||||
echo $html;
|
||||
?>
|
||||
@ -1,52 +0,0 @@
|
||||
<?php
|
||||
include('db-connect.php');
|
||||
|
||||
// $row1 = mysqli_query($con,"SELECT *,trfstandards.iddpicategory as iddpicategoryid,trfstandards.idprotectioncategory as idprotectioncategoryid,trfstandards.idstandards as idstandardsid FROM trfstandards LEFT JOIN standards ON trfstandards.idstandards=standards.idstandards LEFT JOIN dpicategory ON trfstandards.iddpicategory=dpicategory.iddpicategory LEFT JOIN protectioncategory ON trfstandards.idprotectioncategory=protectioncategory.idprotectioncategory WHERE trfstandards.idtrfdetails='{$_GET['idtrf']}' order by standardcode");
|
||||
$query = "select t.idtrfstandards, t.idstandards, s.standardcode, t.idprotectioncategory as idprotectioncategoryid, p.name_protectioncategory, t.iddpicategory as iddpicategoryid, d.value_dpicategory
|
||||
from trfstandards t
|
||||
left join standards s
|
||||
on t.idstandards = s.idstandards
|
||||
left join dpicategory d
|
||||
on t.iddpicategory = d.iddpicategory
|
||||
left join protectioncategory p
|
||||
on t.idprotectioncategory = p.idprotectioncategory
|
||||
where 1
|
||||
and t.idtrfdetails = {$_GET['idtrf']}
|
||||
order by s.standardcode;";
|
||||
$row1 = mysqli_query($con, $query);
|
||||
|
||||
$rowcount=mysqli_num_rows($row1);
|
||||
|
||||
$html = "";
|
||||
|
||||
if($rowcount > 0){
|
||||
|
||||
$html = "<table class=\"table table-striped mb-0\" id=\"example1\" style=\"border:1px solide red\">
|
||||
<tr>
|
||||
<th style=\"display:none;\">id</th>
|
||||
<th>{$_GET['standardcodetitle']}</th>
|
||||
<th>{$_GET['protectioncategorytitle']}</th>
|
||||
<th>{$_GET['dpicategorytitle']}</th>
|
||||
</tr>";
|
||||
|
||||
while($rowquery = mysqli_fetch_assoc($row1)) {
|
||||
$nameprotcatrec=html_entity_decode($rowquery['name_protectioncategory']);
|
||||
|
||||
$this_pcat = (isset($rowquery['name_protectioncategory']))? $nameprotcatrec: $_GET['pleaseselectstd'];
|
||||
|
||||
$this_dpcat = (isset($rowquery['value_dpicategory']))? $rowquery['value_dpicategory']: $_GET['pleaseselectstd'];
|
||||
|
||||
$html .= "<tr>
|
||||
<td style=\"display:none;\">{$rowquery['idtrfstandards']}</td>
|
||||
<td>{$rowquery['standardcode']}</td>
|
||||
<td onclick=\"getSelectOptions('{$rowquery['idstandards']}','idprotectioncategory', '{$rowquery['idprotectioncategoryid']}');\">{$this_pcat}</td>
|
||||
<td onclick=\"getSelectOptions('{$rowquery['idstandards']}','iddpicategory', '{$rowquery['iddpicategoryid']}');\">{$this_dpcat}</td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
$html .= "</table>";
|
||||
|
||||
}
|
||||
|
||||
echo $html;
|
||||
?>
|
||||
@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
include('db-connect.php');
|
||||
|
||||
$row1 = mysqli_query($con,"SELECT *,trfstandards.iddpicategory as iddpicategoryid,trfstandards.idprotectioncategory as idprotectioncategoryid,trfstandards.idstandards as idstandardsid FROM trfstandards LEFT JOIN standards ON trfstandards.idstandards=standards.idstandards LEFT JOIN dpicategory ON trfstandards.iddpicategory=dpicategory.iddpicategory LEFT JOIN protectioncategory ON trfstandards.idprotectioncategory=protectioncategory.idprotectioncategory WHERE trfstandards.idtrfdetails='{$_GET['idtrf']}' order by standardcode");
|
||||
|
||||
$html = "<table class=\"table table-striped mb-0\" id=\"example1\" style=\"border:1px solide red\">
|
||||
<tr>
|
||||
<th style=\"display:none;\">id</th>
|
||||
<th>{$_GET['standardcodetitle']}</th>
|
||||
<th>{$_GET['protectioncategorytitle']}</th>
|
||||
<th>{$_GET['dpicategorytitle']}</th>
|
||||
</tr>";
|
||||
|
||||
while($rowquery = mysqli_fetch_assoc($row1)) {
|
||||
$this_pcat = (isset($rowquery['name_protectioncategory']))? $rowquery['name_protectioncategory']: $_GET['pleaseselectstd'];
|
||||
$this_dpcat = (isset($rowquery['value_dpicategory']))? $rowquery['value_dpicategory']: $_GET['pleaseselectstd'];
|
||||
$html .= "<tr>
|
||||
<td style=\"display:none;\">{$rowquery['idtrfstandards']}</td>
|
||||
<td>{$rowquery['standardcode']}</td>
|
||||
<td>{$this_pcat}</td>
|
||||
<td>{$this_dpcat}</td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
$html .= "</table>";
|
||||
|
||||
echo $html;
|
||||
?>
|
||||
@ -1,615 +0,0 @@
|
||||
|
||||
<?php
|
||||
include('include/headscript.php');
|
||||
include('db-connect.php');
|
||||
?>
|
||||
<!-- recover variables from form or link -->
|
||||
<?php
|
||||
$varcertificate="";
|
||||
if (isset($_GET['varcertificate'])) {
|
||||
$varcertificate=$_GET['varcertificate']; }
|
||||
?>
|
||||
|
||||
<?php
|
||||
$idcertificate=0;
|
||||
if (isset($_GET['idcertificate'])) {
|
||||
$idcertificate=$_GET['idcertificate'];
|
||||
$certtype=$idcertificate;
|
||||
}
|
||||
?>
|
||||
<?php //pickup variable post
|
||||
if (isset($_POST["formname"])) {
|
||||
$formname=$_POST["formname"]; }
|
||||
if (isset($_POST["kindofcontacts"])) {
|
||||
$kindofcontacts=$_POST["kindofcontacts"]; }
|
||||
if (isset($_POST["companyname"])) {
|
||||
$companyname=$_POST["companyname"]; }
|
||||
if (isset($_POST["piva"])) {
|
||||
$piva=$_POST["piva"]; }
|
||||
if (isset($_POST["companyaddress"])) {
|
||||
$companyaddress=$_POST["companyaddress"]; }
|
||||
if (isset($_POST["city"])) {
|
||||
$city=$_POST["city"]; }
|
||||
if (isset($_POST["cap"])) {
|
||||
$cap=$_POST["cap"]; }
|
||||
if (isset($_POST["country"])) {
|
||||
$country=$_POST["country"]; }
|
||||
if (isset($_POST["telephone"])) {
|
||||
$telephone=$_POST["telephone"]; }
|
||||
if (isset($_POST["email"])) {
|
||||
$email=$_POST["email"]; }
|
||||
if (isset($_POST["contactname"])) {
|
||||
$contactname=$_POST["contactname"]; }
|
||||
if (isset($_POST["contactsurname"])) {
|
||||
$contactsurname=$_POST["contactsurname"]; }
|
||||
if (isset($_POST["tempcode"])) {
|
||||
$tempcode=$_POST["tempcode"]; }
|
||||
if (isset($_GET["formnameme"])) {
|
||||
$formnameme=$_GET["formnameme"]; }
|
||||
if (isset($_GET["kindofcontacts"])) {
|
||||
$kindofcontacts=$_GET["kindofcontacts"]; }
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf=$_GET["idtrf"]; }
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if (isset($formname)) {
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "contacts";
|
||||
$InsertQuery->bindColumn("kindofcontacts", "s", "$kindofcontacts", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("companyname", "s", "$companyname", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("piva", "s", "$piva", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("address", "s", "$companyaddress", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("city", "s", "$city", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("cap", "s", "$cap", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("country", "s", "$country", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("telephone", "s", "$telephone", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("email", "s", "$email", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("contactname", "s", "$contactname", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("contactsurname", "s", "$contactsurname", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("tempcode", "s", "$tempcode", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (isset($formnameme)) {
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "contacts";
|
||||
$InsertQuery->bindColumn("kindofcontacts", "s", "$kindofcontacts", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("companyid", "s", "$idcompany", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("tempcode", "s", "$tempcode", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
|
||||
$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");
|
||||
|
||||
$idtrf='160';
|
||||
$idcertificate='5';
|
||||
$idtrfdetails=$idtrf;
|
||||
?>
|
||||
|
||||
<?php
|
||||
include('include/trfqueryscript.php'); ?>
|
||||
|
||||
<?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 // 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 <?php //echo $tempcode; ?></a></li>
|
||||
<li class="breadcrumb-item active">Starter</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h3 class="page-title"><?php echo $titlewb; ?></h3>
|
||||
</div><!--end page-title-box-->
|
||||
</div><!--end col-->
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<button type="button" class="btn btn-purple btn-square btn-outline-dashed waves-effect waves-light"><i class="mdi mdi-arrow-right-bold"></i> <?php echo $kindcertificatetitle; ?></button><br>
|
||||
<br>
|
||||
|
||||
<h4 class="mt-0 header-title"><?php echo $typeofcertificate_question; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $typeofcertificate_help; ?></p>
|
||||
<!-- certificate 1st question-->
|
||||
<?php if ($varcertificate=="md") { ?>
|
||||
<div class="progress mb-4">
|
||||
<div class="progress-bar" role="progressbar" style="width: 5%;" aria-valuenow="5" aria-valuemin="0" aria-valuemax="100">5%</div>
|
||||
</div>
|
||||
<div name="1stquestion" class="alert alert-light text-muted mb-0" role="alert">
|
||||
<h4 class="alert-heading font-18 text-dark"><?php echo $insertintermediatecontact; ?></h4>
|
||||
<?php echo $fabbricantehelp; ?><br><br>
|
||||
|
||||
<form action="typeofcertificate.php?varcertificate=0" method="post" class="was-validated">
|
||||
<!-- intermediate means that the certificate is request for the intermediate -->
|
||||
<?php $kindofcontacts="intermediate";
|
||||
include('include/contactform.php'); ?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!-- certificate 1st questioon-->
|
||||
<?php if ($varcertificate=="0") { ?>
|
||||
<div class="progress mb-4">
|
||||
<div class="progress-bar" role="progressbar" style="width: 5%;" aria-valuenow="5" aria-valuemin="0" aria-valuemax="100">5%</div>
|
||||
</div>
|
||||
<div name="1stquestion" class="alert alert-light text-muted mb-0" role="alert">
|
||||
<h4 class="alert-heading font-18 text-dark"><?php echo $questionm16m30s; ?></h4>
|
||||
<p><?php echo $questionm16m30s_help; ?></p>
|
||||
<a href="typeofcertificate.php?varcertificate=1"> <button type="button" class="btn btn-success waves-effect waves-light"><?php echo $yes; ?></button></a>
|
||||
<a href="typeofcertificate.php?varcertificate=m"><button type="button" class="btn btn-danger waves-effect waves-light"><?php echo $no; ?></button></a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!-- certificate m16 + m30s -->
|
||||
<?php if ($varcertificate=="1") { ?>
|
||||
<div class="progress mb-4">
|
||||
<div class="progress-bar" role="progressbar" style="width: 20%;" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">20%</div>
|
||||
</div>
|
||||
<div name="1stquestion" class="alert alert-light text-muted mb-0" role="alert">
|
||||
<h4 class="alert-heading font-18 text-dark"><?php echo $certificatem16m30svar; ?> <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 $variationhelp_ia; ?><br><br>
|
||||
<?php echo $variationhelp_ib; ?><br><br>
|
||||
<?php echo $variationhelp_ic; ?>
|
||||
</p>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<p><?php echo $certificatem16m30s_help; ?></p>
|
||||
|
||||
<a href="typeofcertificate.php?varcertificate=1b&idcertificate=7"> <button type="button" class="btn btn-success waves-effect waves-light"><?php echo $yes; ?></button></a>
|
||||
<a href="typeofcertificate.php?varcertificate=1a&idcertificate=1"><button type="button" class="btn btn-danger waves-effect waves-light"><?php echo $no; ?></button></a>
|
||||
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- confirm certificate M18A -->
|
||||
<?php if ($idcertificate=="5") { ?>
|
||||
<?php
|
||||
$certtype = new WA_MySQLi_RS("certtype",$cmctrfdb,1);
|
||||
$certtype->setQuery("SELECT * FROM certificationtype WHERE certificationtype.idcertificationtype='$idcertificate'");
|
||||
$certtype->execute();
|
||||
?>
|
||||
<div class="progress mb-4">
|
||||
<div class="progress-bar" role="progressbar" style="width: 20%;" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">20%</div>
|
||||
</div>
|
||||
<div name="1stquestion" class="alert alert-light text-muted mb-0" role="alert">
|
||||
|
||||
<h4 class="alert-heading font-18 text-dark"><?php echo $certificatem18a; ?></h4>
|
||||
<p><?php echo $certificatem18a_help; ?></p>
|
||||
<form action="trfdetails.php" method="get" class="was-validated" name="myForm">
|
||||
<input name="certtype" type="hidden" id="certtype" value="<?php echo($certtype->getColumnVal("idcertificationtype")); ?>">
|
||||
<input name="tempcode" type="hidden" id="tempcode" value="<?php echo $tempcode; ?>">
|
||||
<?php echo $prevcertificatehelp; ?><br>
|
||||
<br>
|
||||
|
||||
<p><?php echo $auditcompanylocation; ?></p>
|
||||
<input type="radio" name="tab" value="igotnone" onclick="show1();" checked />
|
||||
<?php echo $tometitle; ?>
|
||||
<input type="radio" name="tab" value="igottwo" onclick="show2();" />
|
||||
<?php echo $toothertitle; ?>
|
||||
<div id="div3" class="hide">
|
||||
<hr><p><?php echo $modifydatacontact; ?></p>
|
||||
<?php $kindofcontacts=""; ?>
|
||||
<?php include('include/contactformaudit.php'); ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<div class="form-group row">
|
||||
<label for="example-text-input" class="col-sm-4 col-form-label text-right"><?php echo $dpinumbersurveillance; ?></label>
|
||||
<div class="col-sm-3">
|
||||
<input class="form-control" type="text" id="previousrepnumber" name="previousrepnumber">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group mb-0 row">
|
||||
<label class="col-md-3 my-1 control-label"><?php echo $issuebycimac; ?></label>
|
||||
<div class="col-md-9">
|
||||
<div class="form-check-inline my-1">
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="customRadio7" name="issuebycimac" class="custom-control-input" value="Y" checked="checked">
|
||||
<label class="custom-control-label" for="customRadio7"><?php echo $yestitle; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-check-inline my-1">
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="customRadio8" name="issuebycimac" class="custom-control-input" value="N">
|
||||
<label class="custom-control-label" for="customRadio8"><?php echo $notitle; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div><br>
|
||||
<div class="form-group">
|
||||
<label for="surveillanceoption"><?php echo $surveillancec2option; ?></label>
|
||||
<select class="form-control col-md-6" id="surveillanceoption" name="surveillanceoption">
|
||||
<option selected value="option1"><?php echo $surveillancec2option1; ?></option>
|
||||
<option value="option2"><?php echo $surveillancec2option2; ?></option>
|
||||
<option value="option3"><?php echo $surveillancec2option3; ?></option>
|
||||
|
||||
</select>
|
||||
</div><br>
|
||||
|
||||
<div class="form-group mb-0 row">
|
||||
<label class="col-md-6 my-1 control-label"><?php echo $samplestoredtitle; ?></label>
|
||||
<div class="col-md-2">
|
||||
<div class="form-check-inline my-1">
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="samplestorey" name="samplestore" class="custom-control-input" value="Y" checked="checked">
|
||||
<label class="custom-control-label" for="samplestorey"><?php echo $yestitle; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-check-inline my-1">
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="samplestoren" name="samplestore" class="custom-control-input" value="N">
|
||||
<label class="custom-control-label" for="samplestoren"><?php echo $notitle; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div><br>
|
||||
|
||||
|
||||
|
||||
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $nextsteptitle; ?>">
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<div class="table-responsive">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<form style="display:none;">
|
||||
<div id="dropBox" >
|
||||
|
||||
</div>
|
||||
<input type="file" name="fileInput" id="fileInput" />
|
||||
</form>
|
||||
<div class="panel panel-default">
|
||||
|
||||
|
||||
<div class="panel-body">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
<?php } ?> <!-- close confirm -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!--end form-->
|
||||
</div><!--end card-body-->
|
||||
</div><!--end card-->
|
||||
</div><!--end col-->
|
||||
</div>
|
||||
<!-- 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>
|
||||
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// connessione al database
|
||||
$conn = mysqli_connect($hostname_cmctrfdb, $username_cmctrfdb, $password_cmctrfdb, $database_cmctrfdb);
|
||||
if (!$conn) {
|
||||
die("Connessione al database fallita: " . mysqli_connect_error());
|
||||
}
|
||||
|
||||
// Controllo dei campi nulli
|
||||
$sql = "SELECT COUNT(*) AS num_rows FROM trfstandards WHERE idtrfdetails = $idtrf AND (idprotectioncategory IS NULL OR iddpicategory IS NULL)";
|
||||
$resultcat = mysqli_query($conn, $sql);
|
||||
// Controllo degli errori
|
||||
if (!$resultcat) {
|
||||
die("Errore nella query: " . mysqli_error($conn));
|
||||
}
|
||||
$row = mysqli_fetch_assoc($resultcat);
|
||||
|
||||
if ($row['num_rows'] > 0) {
|
||||
// Campi nulli trovati, restituisci la risposta JSON con flag false e il messaggio di errore
|
||||
$response = array(
|
||||
'success' => false,
|
||||
'message' => 'Non hai compilato la categoria di protezione e categoria DPI per tutti gli standards.'
|
||||
);
|
||||
} else {
|
||||
// Tutti i campi sono compilati, restituisci la risposta JSON con flag true e il messaggio di successo
|
||||
$response = array(
|
||||
'success' => true,
|
||||
'message' => 'Tutte le categorie sono state compilate.'
|
||||
);
|
||||
}
|
||||
|
||||
// Restituisci la risposta JSON
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($response);
|
||||
|
||||
?>
|
||||
@ -1,288 +0,0 @@
|
||||
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf=$_POST["idtrf"]; }
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf=$_GET["idtrf"]; }
|
||||
|
||||
if (isset($_POST["addchem"])) {
|
||||
$addchem=$_POST["addchem"]; }
|
||||
if (isset($_POST["addchemform"])) {
|
||||
$addchemform=$_POST["addchemform"]; }
|
||||
else { $addchemform=""; }
|
||||
|
||||
if (isset($_GET["codestep"])) {
|
||||
$code="6";
|
||||
|
||||
$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();
|
||||
$idarticletype=$trfnumberfinal->getColumnVal("idarticletype");
|
||||
$idcertn=$trfnumberfinal->getColumnVal("idcertification");
|
||||
?>
|
||||
<?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
|
||||
$chemicalagentlist = new WA_MySQLi_RS("chemicalagentlist",$cmctrfdb,0);
|
||||
$chemicalagentlist->setQuery("SELECT * FROM chemicalagent ORDER BY chemicalagent.name_chemicalagent");
|
||||
$chemicalagentlist->execute();
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
if ($addchemform=="Y") {
|
||||
|
||||
|
||||
$checkchemical = new WA_MySQLi_RS("checkchemical",$cmctrfdb,1);
|
||||
$checkchemical->setQuery("SELECT * FROM trfchemicalagent WHERE trfchemicalagent.idtrf='$idtrf' AND trfchemicalagent.idchemicalagent='$addchem'");
|
||||
$checkchemical->execute();
|
||||
if (empty($checkchemical->getColumnVal("idtrfchemicalagent"))) {
|
||||
|
||||
$InsertQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$InsertQuery->Action = "insert";
|
||||
$InsertQuery->Table = "trfchemicalagent";
|
||||
$InsertQuery->bindColumn("idtrf", "i", "$idtrf", "WA_DEFAULT");
|
||||
$InsertQuery->bindColumn("idchemicalagent", "i", "$addchem", "WA_DEFAULT");
|
||||
$InsertQuery->saveInSession("");
|
||||
$InsertQuery->execute();
|
||||
$InsertGoTo = "";
|
||||
|
||||
$InsertQuery->redirect($InsertGoTo);
|
||||
}}
|
||||
?>
|
||||
<?php
|
||||
$chemagentselected = new WA_MySQLi_RS("chemagentselected",$cmctrfdb,0);
|
||||
$chemagentselected->setQuery("SELECT * FROM trfchemicalagent LEFT JOIN chemicalagent ON trfchemicalagent.idchemicalagent=chemicalagent.idchemicalagent WHERE trfchemicalagent.idtrf='$idtrf'");
|
||||
$chemagentselected->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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].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">
|
||||
|
||||
<?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: 80%;" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100">80%</div>
|
||||
</div>
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $chemagenttitle; ?></h4>
|
||||
<p class="text-muted mb-3"><?php echo $chemagenttitle_help; ?></p>
|
||||
<form class="was-validated" action="" method="post" name="myForm">
|
||||
<div class="form-group row">
|
||||
|
||||
<div class="col-sm-2">
|
||||
|
||||
<select class="form-control" id="addchem" name="addchem">
|
||||
<option value=""><?php echo $pleaseselect; ?></option>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while(!$chemicalagentlist->atEnd()) {
|
||||
$wa_startindex = $chemicalagentlist->Index;
|
||||
?>
|
||||
<option value="<?php echo($chemicalagentlist->getColumnVal("idchemicalagent")); ?>"><?php echo($chemicalagentlist->getColumnVal("name_chemicalagent")); ?></option>
|
||||
<?php
|
||||
$chemicalagentlist->moveNext();
|
||||
}
|
||||
$chemicalagentlist->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="addchemform" id="addchemform" value="Y">
|
||||
<input type="hidden" name="idtrf" id="idtrf" value="<?php echo($trfnumberfinal->getColumnVal("idtrfdetails")); ?>">
|
||||
|
||||
<br><br>
|
||||
<input type="button" onclick="formSubmit()" class="btn btn-gradient-success waves-effect waves-light" value="<?php echo $addtitle; ?>">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
<!-- 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>
|
||||
|
||||
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $addchemtitle; ?></th>
|
||||
|
||||
<th><?php echo $action; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while(!$chemagentselected->atEnd()) {
|
||||
$wa_startindex = $chemagentselected->Index;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo($chemagentselected->getColumnVal("name_chemicalagent")); ?></td>
|
||||
|
||||
<td>
|
||||
|
||||
<a href="deletechemadd.php?idchemadd=<?php echo($chemagentselected->getColumnVal("idtrfchemicalagent")); ?>&idtrf=<?php echo $idtrf; ?>"><i class="fas fa-trash-alt text-danger font-16"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$chemagentselected->moveNext();
|
||||
}
|
||||
$chemagentselected->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="identificationparts.php?idtrf=<?php echo $idtrf; ?>&codestep=6"><button type="button" class="btn btn-success waves-effect waves-light"><?php echo $nextsteptitle; ?></button> </a>
|
||||
<a href="addrequirements.php?idtrf=<?php echo $idtrf; ?>"<button type="button" class="btn btn-dark waves-effect waves-light"><?php echo $backstep; ?></button></a>
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1 +0,0 @@
|
||||
Ciao
|
||||
@ -1,412 +0,0 @@
|
||||
<?php
|
||||
// duplicate row from trf-details
|
||||
|
||||
include('include/headscript.php');
|
||||
|
||||
$lasttrfnumber = new WA_MySQLi_RS("lasttrfnumber", $cmctrfdb, 1);
|
||||
$lasttrfnumber->setQuery("SELECT * FROM `trf-details` ORDER BY `trf-details`.trfnumber DESC LIMIT 1");
|
||||
$lasttrfnumber->execute();
|
||||
|
||||
// Variabili per la modifica dei campi
|
||||
$lastnumber = $lasttrfnumber->getColumnVal("trfnumber");
|
||||
$nexttrfnumber = $lastnumber + 1;
|
||||
$datein = date('Y-m-d');
|
||||
$tempcode = time();
|
||||
$idtrf = $_GET["idtrf"];
|
||||
|
||||
?>
|
||||
<?php
|
||||
// Connessione al database
|
||||
$servername = $hostname_cmctrfdb;
|
||||
$username = $username_cmctrfdb;
|
||||
$password = $password_cmctrfdb;
|
||||
$dbname = $database_cmctrfdb;
|
||||
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
if ($conn->connect_error) {
|
||||
die("Connessione fallita: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
// Selezionare la riga da duplicare
|
||||
$sql_select = "SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails = '$idtrf'";
|
||||
$result_select = $conn->query($sql_select);
|
||||
|
||||
$row = $result_select->fetch_assoc();
|
||||
|
||||
// Creare una copia dell'array con tutte le colonne invariate
|
||||
$new_row = $row;
|
||||
$trfoldnumber = $new_row['trfnumber'];
|
||||
unset($new_row['idtrfdetails']);
|
||||
unset($new_row['pdffilename']);
|
||||
unset($new_row['pdffilename2']);
|
||||
unset($new_row['csgo']);
|
||||
unset($new_row['csincharge']);
|
||||
unset($new_row['datecsincharge']);
|
||||
unset($new_row['signedon']);
|
||||
unset($new_row['signedonsecondcert']);
|
||||
unset($new_row['revtrf']);
|
||||
if (is_null($new_row['photofilename'])) {
|
||||
unset($new_row['photofilename']);
|
||||
}
|
||||
if (is_null($new_row['photoone'])) {
|
||||
unset($new_row['photoone']);
|
||||
}
|
||||
if (is_null($new_row['phototwo'])) {
|
||||
unset($new_row['phototwo']);
|
||||
}
|
||||
|
||||
// Modificare solo le colonne necessarie
|
||||
$new_row['idtrfdetails'] = null;
|
||||
$new_row['pdffilename'] = null;
|
||||
$new_row['pdffilename2'] = null;
|
||||
$new_row['csgo'] = null;
|
||||
$new_row['csincharge'] = null;
|
||||
$new_row['datecsincharge'] = null;
|
||||
$new_row['signedon'] = null;
|
||||
$new_row['signedonsecondcert'] = null;
|
||||
$new_row['trfnumber'] = $nexttrfnumber;
|
||||
$new_row['iduser'] = $iduserlogin;
|
||||
$new_row['dateintrf'] = $datein;
|
||||
$new_row['tempcode'] = $tempcode;
|
||||
$new_row['revtrf'] = '0';
|
||||
|
||||
// Inserire la nuova riga nella tabella trf-details
|
||||
$columns = implode(", ", array_keys($new_row));
|
||||
$values = "'" . implode("', '", array_values($new_row)) . "'";
|
||||
$sql_insert = "INSERT INTO `trf-details` ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo TRF-Details";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
// recover last idtrdetails number_format$lasttrfnumber = new WA_MySQLi_RS("lasttrfnumber",$cmctrfdb,1);
|
||||
$newidtrf = new WA_MySQLi_RS("newidtrf", $cmctrfdb, 1);
|
||||
$newidtrf->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.trfnumber='$nexttrfnumber'");
|
||||
$newidtrf->execute();
|
||||
$newidtrfnumber = $newidtrf->getColumnVal("idtrfdetails");
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for auditdpi
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM auditdpi WHERE idtrfdetails = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Salvo l'ID precedente
|
||||
$oldidauditdpi = $row['idauditdpi'];
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrfdetails'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idauditdpi nullo
|
||||
unset($row['idauditdpi']);
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO auditdpi ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo AuditDPI";
|
||||
|
||||
// Ottengo l'ID della nuova riga inserita
|
||||
$newidauditdpi = $conn->insert_id;
|
||||
|
||||
// Preparo la query per selezionare le righe da duplicare in auditmanufacturer
|
||||
$queryman = "SELECT * FROM auditmanufacturer WHERE idtrfdetails = '$idtrf' AND idauditdpi = '$oldidauditdpi'";
|
||||
|
||||
$resultman = mysqli_query($conn, $queryman);
|
||||
|
||||
|
||||
|
||||
while ($rowman = mysqli_fetch_assoc($resultman)) {
|
||||
// Imposto il valore di idtrfdetails come desiderato (es. 250)
|
||||
$rowman['idtrfdetails'] = $newidtrfnumber;
|
||||
|
||||
// Assegno il nuovo idauditdpi ottenuto dalla duplicazione in auditdpi
|
||||
$rowman['idauditdpi'] = $newidauditdpi;
|
||||
|
||||
// Lascio idauditmanufacturer nullo (sarà generato automaticamente)
|
||||
unset($rowman['idauditmanufacturer']);
|
||||
|
||||
// Preparo la query per duplicare la riga in auditmanufacturer
|
||||
$columnsman = implode(", ", array_keys($rowman));
|
||||
$valuesman = "'" . implode("', '", array_values($rowman)) . "'";
|
||||
$sql_insert_man = "INSERT INTO auditmanufacturer ($columnsman) VALUES ($valuesman)";
|
||||
if ($conn->query($sql_insert_man) === TRUE) {
|
||||
echo "Nuova riga inserita con successo in Auditmanufacturer.";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga in Auditmanufacturer: " . $conn->error;
|
||||
}
|
||||
}
|
||||
|
||||
$queryfile = "SELECT * FROM fileattached WHERE idtrfdetails = '$idtrf' AND idauditdpi = '$oldidauditdpi'";
|
||||
$resultfile = mysqli_query($conn, $queryfile);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($rowfile = mysqli_fetch_assoc($resultfile)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$rowfile['idtrfdetails'] = $newidtrfnumber;
|
||||
$rowfile['idauditdpi'] = $newidauditdpi;
|
||||
|
||||
// Lascio idfileattached nullos
|
||||
unset($rowfile['idfileattached']);
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columnsfile = implode(", ", array_keys($rowfile));
|
||||
$valuesfile = "'" . implode("', '", array_values($rowfile)) . "'";
|
||||
$sql_insertfile = "INSERT INTO fileattached ($columnsfile) VALUES ($valuesfile)";
|
||||
if ($conn->query($sql_insertfile) === TRUE) {
|
||||
echo "Nuova riga inserita con successo fileattached";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for contacts
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM contacts WHERE idtrf = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrf'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idcontacts nullo
|
||||
unset($row['idcontacts']);
|
||||
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO contacts ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo contacts";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for fileattached
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM fileattached WHERE idtrfdetails = '$idtrf' AND idauditdpi IS NULL";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrfdetails'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idfileattached nullos
|
||||
unset($row['idfileattached']);
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO fileattached ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo fileattached";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for identificationparts
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM identificationparts WHERE idtrfdetails = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrfdetails'] = $newidtrfnumber;
|
||||
|
||||
// Lascio identificationparts nullo
|
||||
unset($row['ididentificationparts']);
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO identificationparts ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo identificationparts";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for trfaddrequirements
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM trfaddrequirements WHERE idtrf = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrf'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idtrfaddrequirements nullo
|
||||
unset($row['idtrfaddrequirements']);
|
||||
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO trfaddrequirements ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo trfaddrequirements";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for trfchemicalagent
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM trfchemicalagent WHERE idtrf = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrf'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idtrfchemicalagent nullo
|
||||
unset($row['idtrfchemicalagent']);
|
||||
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO trfchemicalagent ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo trfchemicalagent";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for trfstandards
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM trfstandards WHERE idtrfdetails = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrfdetails'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idtrfstandards nullo
|
||||
unset($row['idtrfstandards']);
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO trfstandards ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo trfstandards";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for trfchemicalagent
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM wheretrfstep WHERE idtrf = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrf'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idwheretrfstep nullo
|
||||
unset($row['idwheretrfstep']);
|
||||
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO wheretrfstep ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo wheretrfstep";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// Imposta le variabili GET
|
||||
$idtrfnew = $newidtrfnumber; // Inserisci qui il valore per idtrfnew
|
||||
$trfnewnumber = $nexttrfnumber; // Inserisci qui il valore per trfnewnumber
|
||||
|
||||
// Costruisci l'URL con le variabili GET
|
||||
$url = "newclonetrf.php?idtrfnew=" . urlencode($idtrfnew) . "&trfnewnumber=" . urlencode($trfnewnumber) . "&trfoldnumber=" . urlencode($trfoldnumber);
|
||||
|
||||
// Esegui il redirect alla nuova pagina
|
||||
header("Location: " . $url);
|
||||
exit;
|
||||
?>
|
||||
@ -1,382 +0,0 @@
|
||||
<?php
|
||||
// duplicate row from trf-details
|
||||
|
||||
include('include/headscript.php');
|
||||
|
||||
$lasttrfnumber = new WA_MySQLi_RS("lasttrfnumber",$cmctrfdb,1);
|
||||
$lasttrfnumber->setQuery("SELECT * FROM `trf-details` ORDER BY `trf-details`.trfnumber DESC LIMIT 1");
|
||||
$lasttrfnumber->execute();
|
||||
|
||||
// Variabili per la modifica dei campi
|
||||
$lastnumber=$lasttrfnumber->getColumnVal("trfnumber");
|
||||
$nexttrfnumber=$lastnumber+1;
|
||||
$datein=date('Y-m-d');
|
||||
$tempcode=time();
|
||||
$idtrf=$_GET["idtrf"];
|
||||
$trfoldnumber=$lastnumber;
|
||||
?>
|
||||
<?php
|
||||
// Connessione al database
|
||||
$servername = "localhost";
|
||||
$username = "solocla";
|
||||
$password = "!Massarosa2";
|
||||
$dbname = "trfcmcauthorized";
|
||||
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
if ($conn->connect_error) {
|
||||
die("Connessione fallita: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
// Selezionare la riga da duplicare
|
||||
$sql_select = "SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails = '$idtrf'";
|
||||
$result_select = $conn->query($sql_select);
|
||||
|
||||
$row = $result_select->fetch_assoc();
|
||||
|
||||
// Creare una copia dell'array con tutte le colonne invariate
|
||||
$new_row = $row;
|
||||
unset($new_row['idtrfdetails']);
|
||||
unset($new_row['pdffilename']);
|
||||
unset($new_row['pdffilename2']);
|
||||
unset($new_row['csgo']);
|
||||
unset($new_row['csincharge']);
|
||||
unset($new_row['datecsincharge']);
|
||||
unset($new_row['signedon']);
|
||||
unset($new_row['signedonsecondcert']);
|
||||
|
||||
// Modificare solo le colonne necessarie
|
||||
$new_row['idtrfdetails'] = null;
|
||||
$new_row['pdffilename'] = null;
|
||||
$new_row['pdffilename2'] = null;
|
||||
$new_row['csgo'] = null;
|
||||
$new_row['csincharge'] = null;
|
||||
$new_row['datecsincharge'] = null;
|
||||
$new_row['signedon'] = null;
|
||||
$new_row['signedonsecondcert'] = null;
|
||||
$new_row['trfnumber'] = $nexttrfnumber;
|
||||
$new_row['iduser'] = $iduserlogin;
|
||||
$new_row['dateintrf'] = $datein;
|
||||
$new_row['tempcode'] = $tempcode;
|
||||
|
||||
// Inserire la nuova riga nella tabella trf-details
|
||||
$columns = implode(", ", array_keys($new_row));
|
||||
$values = "'" . implode("', '", array_values($new_row)) . "'";
|
||||
$sql_insert = "INSERT INTO `trf-details` ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo TRF-Details";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
// recover last idtrdetails number_format$lasttrfnumber = new WA_MySQLi_RS("lasttrfnumber",$cmctrfdb,1);
|
||||
$newidtrf = new WA_MySQLi_RS("newidtrf",$cmctrfdb,1);
|
||||
$newidtrf->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.trfnumber='$nexttrfnumber'");
|
||||
$newidtrf->execute();
|
||||
$newidtrfnumber=$newidtrf->getColumnVal("idtrfdetails");
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for auditdpi
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM auditdpi WHERE idtrfdetails = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrfdetails'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idauditdpi nullo
|
||||
unset($row['idauditdpi']);
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO auditdpi ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo AuditDPI";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for auditmanufacturer
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM auditmanufacturer WHERE idtrfdetails = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrfdetails'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idauditmanufacturer nullo
|
||||
unset($row['idauditmanufacturer']);
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO auditmanufacturer ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo Auditmanufacturer";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for contacts
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM contacts WHERE idtrf = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrf'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idcontacts nullo
|
||||
unset($row['idcontacts']);
|
||||
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO contacts ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo contacts";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for fileattached
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM fileattached WHERE idtrfdetails = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrfdetails'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idfileattached nullos
|
||||
unset($row['idfileattached']);
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO fileattached ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo fileattached";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for identificationparts
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM identificationparts WHERE idtrfdetails = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrfdetails'] = $newidtrfnumber;
|
||||
|
||||
// Lascio identificationparts nullo
|
||||
unset($row['ididentificationparts']);
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO identificationparts ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo identificationparts";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for trfaddrequirements
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM trfaddrequirements WHERE idtrf = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrf'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idtrfaddrequirements nullo
|
||||
unset($row['idtrfaddrequirements']);
|
||||
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO trfaddrequirements ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo trfaddrequirements";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for trfchemicalagent
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM trfchemicalagent WHERE idtrf = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrf'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idtrfchemicalagent nullo
|
||||
unset($row['idtrfchemicalagent']);
|
||||
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO trfchemicalagent ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo trfchemicalagent";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for trfstandards
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM trfstandards WHERE idtrfdetails = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrfdetails'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idtrfstandards nullo
|
||||
unset($row['idtrfstandards']);
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO trfstandards ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo trfstandards";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// duplicate row for trfchemicalagent
|
||||
|
||||
// Connessione al database
|
||||
$conn = mysqli_connect($servername, $username, $password, $dbname);
|
||||
|
||||
// Query per selezionare le righe da duplicare
|
||||
$query = "SELECT * FROM wheretrfstep WHERE idtrf = '$idtrf'";
|
||||
$result = mysqli_query($conn, $query);
|
||||
|
||||
// Ciclo attraverso i risultati e duplico le righe
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// Imposto il valore di idtrfdetails come 250
|
||||
$row['idtrf'] = $newidtrfnumber;
|
||||
|
||||
// Lascio idwheretrfstep nullo
|
||||
unset($row['idwheretrfstep']);
|
||||
|
||||
|
||||
// Query per duplicare la riga
|
||||
$columns = implode(", ", array_keys($row));
|
||||
$values = "'" . implode("', '", array_values($row)) . "'";
|
||||
$sql_insert = "INSERT INTO wheretrfstep ($columns) VALUES ($values)";
|
||||
if ($conn->query($sql_insert) === TRUE) {
|
||||
echo "Nuova riga inserita con successo wheretrfstep";
|
||||
} else {
|
||||
echo "Errore nell'inserimento della nuova riga: " . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// Imposta le variabili GET
|
||||
$idtrfnew = $newidtrfnumber; // Inserisci qui il valore per idtrfnew
|
||||
$trfnewnumber = $nexttrfnumber; // Inserisci qui il valore per trfnewnumber
|
||||
|
||||
// Costruisci l'URL con le variabili GET
|
||||
$url = "newclonetrf.php?idtrfnew=" . urlencode($idtrfnew) . "&trfnewnumber=" . urlencode($trfnewnumber) . "&trfoldnumber=" . urlencode($trfoldnumber);
|
||||
|
||||
// Esegui il redirect alla nuova pagina
|
||||
header("Location: " . $url);
|
||||
exit;
|
||||
?>
|
||||
@ -1,196 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript2.php'); ?>
|
||||
|
||||
<?php
|
||||
if (isset($_POST["formname"])) {
|
||||
$formname = $_POST["formname"];
|
||||
} else {
|
||||
$formname = "N";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<?php
|
||||
if ($formname == "Y") {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "company";
|
||||
$UpdateQuery->bindColumn("companyname_company", "s", "" . ((isset($_POST["companyname_company"])) ? $_POST["companyname_company"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("address_company", "s", "" . ((isset($_POST["companyaddress"])) ? $_POST["companyaddress"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("city_company", "s", "" . ((isset($_POST["city"])) ? $_POST["city"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("zip_company", "s", "" . ((isset($_POST["cap"])) ? $_POST["cap"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("country_company", "i", "" . ((isset($_POST["country"])) ? $_POST["country"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("piva_company", "s", "" . ((isset($_POST["piva"])) ? $_POST["piva"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("telephone_company", "s", "" . ((isset($_POST["telephone"])) ? $_POST["telephone"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("email_company", "s", "" . ((isset($_POST["email"])) ? $_POST["email"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("maincontactname_company", "s", "" . ((isset($_POST["contactname"])) ? $_POST["contactname"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("maincontactsurname_company", "s", "" . ((isset($_POST["contactsurname"])) ? $_POST["contactsurname"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("maincontactmail_company", "s", "" . ((isset($_POST["emailmain"])) ? $_POST["emailmain"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("maincontactphone_company", "s", "" . ((isset($_POST["telephonemain"])) ? $_POST["telephonemain"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("edited", "s", "" . ((isset($_POST["edited"])) ? $_POST["edited"] : "") . "", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idcompany", "=", "i", "" . ($idcompany) . "");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "dashboard.php";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
$companydetails = mysqli_query($cmctrfdb, "SELECT * FROM company WHERE company.idcompany='$idcompany'");
|
||||
$companyData = mysqli_fetch_assoc($companydetails);
|
||||
?>
|
||||
|
||||
<!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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Top Bar Start -->
|
||||
|
||||
|
||||
|
||||
<!-- 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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<div class="card">
|
||||
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $companyprofiletitle; ?></h4>
|
||||
<?php if ($companyData["edited"] != "Y") { ?>
|
||||
<div class="alert alert-outline-warning alert-warning-shadow mb-0 alert-dismissible fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true"><i class="mdi mdi-close"></i></span>
|
||||
</button>
|
||||
<?php echo $companyupdatetitle; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<br>
|
||||
<?php include('include/companycontactform.php'); ?>
|
||||
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $uploadCompanyLogoTitle; ?></h4>
|
||||
<form action="upload_logocompany.php" method="post" enctype="multipart/form-data">
|
||||
<?php echo $selectImageToUploadTitle; ?>
|
||||
<input type="file" name="companyLogo" id="companyLogo" accept=".jpg, .jpeg, .png">
|
||||
<button type="submit" class="btn btn-primary"><?php echo $uploadButtonTitle; ?></button>
|
||||
</form>
|
||||
<?php if (!empty($companyData["logoimage"])) : ?>
|
||||
<div class="logo-container" style="margin-top: 20px;">
|
||||
<img src="<?php echo htmlspecialchars("logos/" . $companyData["logoimage"]); ?>" alt="<?php echo $companyLogoAltTitle; ?>" style="max-width: 200px; max-height: 200px;">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</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>
|
||||
<!-- 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>
|
||||
@ -1,173 +0,0 @@
|
||||
|
||||
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
|
||||
<?php
|
||||
if (isset($_POST["formname"])) {
|
||||
$formname=$_POST["formname"]; }
|
||||
else {
|
||||
$formname="N"; }
|
||||
|
||||
|
||||
?>
|
||||
<?php
|
||||
if ($formname=="Y") {
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "company";
|
||||
$UpdateQuery->bindColumn("companyname_company", "s", "".((isset($_POST["companyname_company"]))?$_POST["companyname_company"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("address_company", "s", "".((isset($_POST["companyaddress"]))?$_POST["companyaddress"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("city_company", "s", "".((isset($_POST["city"]))?$_POST["city"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("zip_company", "s", "".((isset($_POST["cap"]))?$_POST["cap"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("country_company", "s", "".((isset($_POST["country"]))?$_POST["country"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("piva_company", "s", "".((isset($_POST["piva"]))?$_POST["piva"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("telephone_company", "s", "".((isset($_POST["telephone"]))?$_POST["telephone"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("email_company", "s", "".((isset($_POST["email"]))?$_POST["email"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("maincontactname_company", "s", "".((isset($_POST["contactname"]))?$_POST["contactname"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("maincontactsurname_company", "s", "".((isset($_POST["contactsurname"]))?$_POST["contactsurname"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("maincontactmail_company", "s", "".((isset($_POST["emailmain"]))?$_POST["emailmain"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("maincontactphone_company", "s", "".((isset($_POST["telephonemain"]))?$_POST["telephonemain"]:"") ."", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idcompany", "=", "i", "".($idcompany) ."");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
$companydetails = mysqli_query($cmctrfdb, "SELECT * FROM company WHERE company.idcompany='$idcompany'");
|
||||
$companyData = mysqli_fetch_assoc($companydetails);
|
||||
?>
|
||||
|
||||
<!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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Top Bar Start -->
|
||||
|
||||
|
||||
|
||||
<!-- 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">
|
||||
|
||||
|
||||
|
||||
<!-- card for additional info gloves -->
|
||||
|
||||
<div class="card">
|
||||
|
||||
|
||||
<!-- card for show requirements -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title"><?php echo $companyprofiletitle; ?></h4>
|
||||
|
||||
|
||||
<br>
|
||||
<?php include('include/companycontactform.php'); ?>
|
||||
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div><!--end card-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!--end col-->
|
||||
</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>
|
||||
@ -1,641 +0,0 @@
|
||||
<?php
|
||||
include('include/headscript.php'); ?>
|
||||
<?php
|
||||
// pickup the get variable
|
||||
$formname = "nocontact";
|
||||
if (isset($_POST["idtrf"])) {
|
||||
$idtrf = $_POST["idtrf"];
|
||||
}
|
||||
if (isset($_GET["idtrf"])) {
|
||||
$idtrf = $_GET["idtrf"];
|
||||
}
|
||||
if (isset($_GET["formname"])) {
|
||||
$formname = $_GET["formname"];
|
||||
}
|
||||
if (isset($_POST["formname"])) {
|
||||
$formname = $_POST["formname"];
|
||||
}
|
||||
if (isset($_GET["kindcontacts"])) {
|
||||
$kindcontacts = $_GET["kindcontacts"];
|
||||
}
|
||||
if (isset($_POST["kindcontacts"])) {
|
||||
$kindcontacts = $_POST["kindcontacts"];
|
||||
}
|
||||
if (isset($_GET["idauditdpi"])) {
|
||||
$idauditdpi = $_GET["idauditdpi"];
|
||||
}
|
||||
if (isset($_POST["idauditdpi"])) {
|
||||
$idauditdpi = $_POST["idauditdpi"];
|
||||
}
|
||||
if (isset($_GET["idcontacts"])) {
|
||||
$idcontacts = $_GET["idcontacts"];
|
||||
}
|
||||
if (isset($_POST["idcontacts"])) {
|
||||
$idcontacts = $_POST["idcontacts"];
|
||||
}
|
||||
if (isset($_GET["kindcontactscopy"])) {
|
||||
$kindcontactscopy = $_GET["kindcontactscopy"];
|
||||
}
|
||||
if (isset($_POST["kindcontactscopy"])) {
|
||||
$kindcontactscopy = $_POST["kindcontactscopy"];
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$countrylist = new WA_MySQLi_RS("countrylist", $cmctrfdb, 0);
|
||||
$countrylist->setQuery("SELECT * FROM countries ORDER BY countries.namecountry");
|
||||
$countrylist->execute();
|
||||
?>
|
||||
<?php //edit contact search engine
|
||||
if ($formname == "searchnamedet") {
|
||||
|
||||
|
||||
|
||||
if (isset($_GET["companynamevalue"])) {
|
||||
$compname = $_GET["companynamevalue"];
|
||||
}
|
||||
|
||||
$companyid = 0;
|
||||
|
||||
$searchctdetail = new WA_MySQLi_RS("searchctdetail", $cmctrfdb, 1);
|
||||
$searchctdetail->setQuery("SELECT * FROM contacts WHERE contacts.companyname='$compname'");
|
||||
$searchctdetail->execute();
|
||||
|
||||
if (!empty($searchctdetail->getColumnVal("companyname"))) {
|
||||
$companynamet = $searchctdetail->getColumnVal("companyname");
|
||||
} else {
|
||||
$companynamet = "";
|
||||
}
|
||||
if (!empty($searchctdetail->getColumnVal("piva"))) {
|
||||
$piva = $searchctdetail->getColumnVal("piva");
|
||||
} else {
|
||||
$piva = "";
|
||||
}
|
||||
if (!empty($searchctdetail->getColumnVal("address"))) {
|
||||
$address = $searchctdetail->getColumnVal("address");
|
||||
} else {
|
||||
$address = "";
|
||||
}
|
||||
if (!empty($searchctdetail->getColumnVal("city"))) {
|
||||
$city = $searchctdetail->getColumnVal("city");
|
||||
} else {
|
||||
$city = "";
|
||||
}
|
||||
if (!empty($searchctdetail->getColumnVal("cap"))) {
|
||||
$cap = $searchctdetail->getColumnVal("cap");
|
||||
} else {
|
||||
$cap = "";
|
||||
}
|
||||
if (!empty($searchctdetail->getColumnVal("country"))) {
|
||||
$country = $searchctdetail->getColumnVal("country");
|
||||
} else {
|
||||
$country = "";
|
||||
}
|
||||
if (!empty($searchctdetail->getColumnVal("telephone"))) {
|
||||
$telephone = $searchctdetail->getColumnVal("telephone");
|
||||
} else {
|
||||
$telephone = "";
|
||||
}
|
||||
if (!empty($searchctdetail->getColumnVal("email"))) {
|
||||
$email = $searchctdetail->getColumnVal("email");
|
||||
} else {
|
||||
$email = "";
|
||||
}
|
||||
if (!empty($searchctdetail->getColumnVal("contactname"))) {
|
||||
$contactname = $searchctdetail->getColumnVal("contactname");
|
||||
} else {
|
||||
$contactname = "";
|
||||
}
|
||||
if (!empty($searchctdetail->getColumnVal("contactsurname"))) {
|
||||
$contactsurname = $searchctdetail->getColumnVal("contactsurname");
|
||||
} else {
|
||||
$contactsurname = "";
|
||||
}
|
||||
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "contacts";
|
||||
$UpdateQuery->bindColumn("companyname", "s", "$companynamet", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("piva", "s", "$piva", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("address", "s", "$address", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("city", "s", "$city", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("cap", "s", "$cap", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("country", "s", "$country", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("telephone", "s", "$telephone", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("email", "s", "$email", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("contactname", "s", "$contactname", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("contactsurname", "s", "$contactsurname", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("companyid", "i", "$companyid", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idcontacts", "=", "i", "" . ($idcontacts) . "");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
?>
|
||||
<?php //edit contact details
|
||||
if ($formname == "editcontactsdetails") {
|
||||
|
||||
|
||||
|
||||
if (isset($_POST["companyname"])) {
|
||||
$companynamet = $_POST["companyname"];
|
||||
} else {
|
||||
$companynamet = "";
|
||||
}
|
||||
if (isset($_POST["piva"])) {
|
||||
$piva = $_POST["piva"];
|
||||
} else {
|
||||
$piva = "";
|
||||
}
|
||||
if (isset($_POST["companyaddress"])) {
|
||||
$address = $_POST["companyaddress"];
|
||||
} else {
|
||||
$address = "";
|
||||
}
|
||||
if (isset($_POST["city"])) {
|
||||
$city = $_POST["city"];
|
||||
} else {
|
||||
$city = "";
|
||||
}
|
||||
if (isset($_POST["cap"])) {
|
||||
$cap = $_POST["cap"];
|
||||
} else {
|
||||
$cap = "";
|
||||
}
|
||||
if (isset($_POST["country"])) {
|
||||
$country = $_POST["country"];
|
||||
} else {
|
||||
$country = "";
|
||||
}
|
||||
if (isset($_POST["telephone"])) {
|
||||
$telephone = $_POST["telephone"];
|
||||
} else {
|
||||
$telephone = "";
|
||||
}
|
||||
if (isset($_POST["email"])) {
|
||||
$email = $_POST["email"];
|
||||
} else {
|
||||
$email = "";
|
||||
}
|
||||
if (isset($_POST["contactname"])) {
|
||||
$contactname = $_POST["contactname"];
|
||||
} else {
|
||||
$contactname = "";
|
||||
}
|
||||
if (isset($_POST["contactsurname"])) {
|
||||
$contactsurname = $_POST["contactsurname"];
|
||||
} else {
|
||||
$contactsurname = "";
|
||||
}
|
||||
$companyid = 0;
|
||||
|
||||
|
||||
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "contacts";
|
||||
$UpdateQuery->bindColumn("companyname", "s", "$companynamet", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("piva", "s", "$piva", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("address", "s", "$address", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("city", "s", "$city", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("cap", "s", "$cap", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("country", "s", "$country", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("telephone", "s", "$telephone", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("email", "s", "$email", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("contactname", "s", "$contactname", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("contactsurname", "s", "$contactsurname", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("companyid", "i", "$companyid", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idcontacts", "=", "i", "" . ($idcontacts) . "");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
?>
|
||||
|
||||
<?php //copy mycompany
|
||||
if ($formname == "copymycompany") {
|
||||
|
||||
$contactsdet = new WA_MySQLi_RS("contactsdet", $cmctrfdb, 1);
|
||||
$contactsdet->setQuery("SELECT * FROM company WHERE company.idcompany='$idcompany'");
|
||||
$contactsdet->execute();
|
||||
|
||||
if (!is_null($contactsdet->getColumnVal("companyname_company"))) {
|
||||
$companynamet = $contactsdet->getColumnVal("companyname_company");
|
||||
} else {
|
||||
$companynamet = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("piva_company"))) {
|
||||
$piva = $contactsdet->getColumnVal("piva_company");
|
||||
} else {
|
||||
$piva = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("address_company"))) {
|
||||
$address = $contactsdet->getColumnVal("address_company");
|
||||
} else {
|
||||
$address = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("city_company"))) {
|
||||
$city = $contactsdet->getColumnVal("city_company");
|
||||
} else {
|
||||
$city = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("zip_company"))) {
|
||||
$cap = $contactsdet->getColumnVal("zip_company");
|
||||
} else {
|
||||
$cap = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("country_company"))) {
|
||||
$country = $contactsdet->getColumnVal("country_company");
|
||||
} else {
|
||||
$country = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("telephone_company"))) {
|
||||
$telephone = $contactsdet->getColumnVal("telephone_company");
|
||||
} else {
|
||||
$telephone = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("email_company"))) {
|
||||
$email = $contactsdet->getColumnVal("email_company");
|
||||
} else {
|
||||
$email = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("maincontactname_company"))) {
|
||||
$contactname = $contactsdet->getColumnVal("maincontactname_company");
|
||||
} else {
|
||||
$contactname = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("maincontactsurname_company"))) {
|
||||
$contactsurname = $contactsdet->getColumnVal("maincontactsurname_company");
|
||||
} else {
|
||||
$contactsurname = "";
|
||||
}
|
||||
if (!is_null($idcompany)) {
|
||||
$companyid = $idcompany;
|
||||
} else {
|
||||
$companyid = "";
|
||||
}
|
||||
|
||||
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "contacts";
|
||||
$UpdateQuery->bindColumn("companyname", "s", "$companynamet", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("piva", "s", "$piva", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("address", "s", "$address", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("city", "s", "$city", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("cap", "s", "$cap", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("country", "s", "$country", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("telephone", "s", "$telephone", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("email", "s", "$email", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("contactname", "s", "$contactname", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("contactsurname", "s", "$contactsurname", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("companyid", "i", "$companyid", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idcontacts", "=", "i", "" . ($idcontacts) . "");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
?>
|
||||
|
||||
<?php //copy contacts
|
||||
if ($formname == "copycontacts") {
|
||||
|
||||
$contactsdet = new WA_MySQLi_RS("contactsdet", $cmctrfdb, 1);
|
||||
$contactsdet->setQuery("SELECT * FROM contacts WHERE contacts.idtrf='$idtrf' AND contacts.kindofcontacts='$kindcontactscopy'");
|
||||
$contactsdet->execute();
|
||||
|
||||
if (!is_null($contactsdet->getColumnVal("companyname"))) {
|
||||
$companynamet = $contactsdet->getColumnVal("companyname");
|
||||
} else {
|
||||
$companynamet = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("piva"))) {
|
||||
$piva = $contactsdet->getColumnVal("piva");
|
||||
} else {
|
||||
$piva = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("address"))) {
|
||||
$address = $contactsdet->getColumnVal("address");
|
||||
} else {
|
||||
$address = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("city"))) {
|
||||
$city = $contactsdet->getColumnVal("city");
|
||||
} else {
|
||||
$city = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("cap"))) {
|
||||
$cap = $contactsdet->getColumnVal("cap");
|
||||
} else {
|
||||
$cap = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("country"))) {
|
||||
$country = $contactsdet->getColumnVal("country");
|
||||
} else {
|
||||
$country = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("telephone"))) {
|
||||
$telephone = $contactsdet->getColumnVal("telephone");
|
||||
} else {
|
||||
$telephone = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("email"))) {
|
||||
$email = $contactsdet->getColumnVal("email");
|
||||
} else {
|
||||
$email = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("contactname"))) {
|
||||
$contactname = $contactsdet->getColumnVal("contactname");
|
||||
} else {
|
||||
$contactname = "";
|
||||
}
|
||||
if (!is_null($contactsdet->getColumnVal("contactsurname"))) {
|
||||
$contactsurname = $contactsdet->getColumnVal("contactsurname");
|
||||
} else {
|
||||
$contactsurname = "";
|
||||
}
|
||||
$companyid = 0;
|
||||
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "contacts";
|
||||
$UpdateQuery->bindColumn("companyname", "s", "$companynamet", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("piva", "s", "$piva", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("address", "s", "$address", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("city", "s", "$city", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("cap", "s", "$cap", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("country", "s", "$country", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("telephone", "s", "$telephone", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("email", "s", "$email", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("contactname", "s", "$contactname", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("contactsurname", "s", "$contactsurname", "WA_DEFAULT");
|
||||
$UpdateQuery->bindColumn("companyid", "i", "$companyid", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idcontacts", "=", "i", "" . ($idcontacts) . "");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
|
||||
if ($kindcontacts == "certificatetotest") {
|
||||
|
||||
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
|
||||
$UpdateQuery->Action = "update";
|
||||
$UpdateQuery->Table = "`trf-details`";
|
||||
$UpdateQuery->bindColumn("certotherclient", "s", "Y", "WA_DEFAULT");
|
||||
$UpdateQuery->addFilter("idtrfdetails", "=", "i", "" . ($idtrf) . "");
|
||||
$UpdateQuery->execute();
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$trfnumberfinal = new WA_MySQLi_RS("trfnumberfinal", $cmctrfdb, 0);
|
||||
$trfnumberfinal->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'");
|
||||
$trfnumberfinal->execute();
|
||||
?>
|
||||
<?php
|
||||
$idcertn = $trfnumberfinal->getColumnVal("idcertification");
|
||||
$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
|
||||
$contactdatacheck = new WA_MySQLi_RS("contactdatacheck", $cmctrfdb, 0);
|
||||
$contactdatacheck->setQuery("SELECT * FROM contacts WHERE contacts.idtrf='$idtrf'");
|
||||
$contactdatacheck->execute();
|
||||
$contactlist = array();
|
||||
?>
|
||||
<?php
|
||||
$wa_startindex = 0;
|
||||
while (!$contactdatacheck->atEnd()) {
|
||||
$wa_startindex = $contactdatacheck->Index;
|
||||
?>
|
||||
<?php
|
||||
$contactlist[] = $contactdatacheck->getColumnVal("kindofcontacts");
|
||||
|
||||
?>
|
||||
<?php
|
||||
$contactdatacheck->moveNext();
|
||||
}
|
||||
$contactdatacheck->moveFirst(); //return RS to first record
|
||||
unset($wa_startindex);
|
||||
unset($wa_repeatcount);
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<!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" />
|
||||
|
||||
|
||||
<!-- submit form with button -->
|
||||
<script>
|
||||
function formSubmit() {
|
||||
document.forms["myForm"].submit();
|
||||
}
|
||||
</script>
|
||||
<!-- upload image script -->
|
||||
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script type='text/javascript'>
|
||||
window.onunload = function() {
|
||||
window.opener.location.reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- 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/scriptsearchcontact.js"></script>
|
||||
<!-- submit form with button -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<!-- section file already uploaded -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-0 header-title">CONTACT FORM</h4>
|
||||
<?php echo $copycontactfrom; ?>
|
||||
<?php include('include/querycontacts.php'); ?>
|
||||
<?php if ($compid < 1) { ?>
|
||||
<a href="contactpop.php?idcontacts=<?php echo ($contactdata->getColumnVal("idcontacts")); ?>&kindcontactscopy=mycompany&idtrf=<?php echo $idtrf; ?>&formname=copymycompany&kindcontacts=<?php echo $kindcontacts; ?>"><button type="button" class="btn btn-outline-secondary waves-effect"><?php echo $anagraficamycompany; ?></button> </a> <?php } ?>
|
||||
<?php if ($kindcontacts != "audit") { ?><?php if (in_array('audit', $contactlist)) { ?><a href="contactpop.php?idcontacts=<?php echo ($contactdata->getColumnVal("idcontacts")); ?>&kindcontactscopy=audit&idtrf=<?php echo $idtrf; ?>&formname=copycontacts&kindcontacts=<?php echo $kindcontacts; ?>"><button type="button" class="btn btn-outline-secondary waves-effect"><?php echo $anagraficaaudit; ?></button></a><?php }
|
||||
} ?>
|
||||
<?php if ($kindcontacts != "headertest") { ?><?php if (in_array('headertest', $contactlist)) { ?><a href="contactpop.php?idcontacts=<?php echo ($contactdata->getColumnVal("idcontacts")); ?>&kindcontactscopy=headertest&idtrf=<?php echo $idtrf; ?>&formname=copycontacts&kindcontacts=<?php echo $kindcontacts; ?>"><button type="button" class="btn btn-outline-secondary waves-effect"><?php echo $anagraficatest; ?></button></a><?php }
|
||||
} ?>
|
||||
<?php if ($kindcontacts != "headercertificate") { ?><?php if (in_array('headercertificate', $contactlist)) { ?><a href="contactpop.php?idcontacts=<?php echo ($contactdata->getColumnVal("idcontacts")); ?>&kindcontactscopy=headercertificate&idtrf=<?php echo $idtrf; ?>&formname=copycontacts&kindcontacts=<?php echo $kindcontacts; ?>"><button type="button" class="btn btn-outline-secondary waves-effect"><?php echo $anagraficacertificate; ?></button></a><?php }
|
||||
} ?>
|
||||
<?php if ($kindcontacts != "invoice") { ?><?php if (in_array('invoice', $contactlist)) { ?><a href="contactpop.php?idcontacts=<?php echo ($contactdata->getColumnVal("idcontacts")); ?>&kindcontactscopy=invoice&idtrf=<?php echo $idtrf; ?>&formname=copycontacts&kindcontacts=<?php echo $kindcontacts; ?>"><button type="button" class="btn btn-outline-secondary waves-effect"><?php echo $anagraficainvoice; ?></button></a><?php }
|
||||
} ?>
|
||||
<br><br>
|
||||
|
||||
<form class="needs-validation" id="editcontacts" name="editcontacts" action="#" method="POST" novalidate="">
|
||||
<div class="form-row">
|
||||
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="companyname"><?php echo $companynametitle; ?></label>
|
||||
<input type="text" class="form-control" id="companyname" name="companyname" value="<?php echo ($contactdata->getColumnVal("companyname")); ?>" placeholder="<?php echo $companynametitle; ?>" required>
|
||||
</div>
|
||||
<div class="col-md-5 mb-3">
|
||||
<label for="companyaddress"><?php echo $companyaddresstitle; ?></label>
|
||||
<input type="text" class="form-control" id="companyaddress" name="companyaddress" value="<?php echo ($contactdata->getColumnVal("address")); ?>" placeholder="<?php echo $companyaddresstitle; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label for="piva"><?php echo $pivatitle; ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="piva" name="piva" value="<?php echo ($contactdata->getColumnVal("piva")); ?>" placeholder="<?php echo $pivatitle; ?>" aria-describedby="inputGroupPrepend3" required="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-5 mb-3">
|
||||
<label for="city"><?php echo $citytitle; ?></label>
|
||||
<input type="text" class="form-control" id="city" name="city" value="<?php echo ($contactdata->getColumnVal("city")); ?>" placeholder="<?php echo $citytitle; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="country"><?php echo $countrytitle; ?></label>
|
||||
|
||||
|
||||
<select class="form-control" id="country" name="country">
|
||||
|
||||
<?php
|
||||
while (!$countrylist->atEnd()) { //dyn select
|
||||
?>
|
||||
<option value="<?php echo ($countrylist->getColumnVal("idcountries")); ?>" <?php if (!(strcmp($countrylist->getColumnVal("idcountries"), ($contactdata->getColumnVal("country"))))) {
|
||||
echo "selected=\"selected\"";
|
||||
} ?>><?php echo ($countrylist->getColumnVal("namecountry")); ?></option>
|
||||
<?php
|
||||
$countrylist->moveNext();
|
||||
} //dyn select
|
||||
$countrylist->moveFirst();
|
||||
?>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label for="cap"><?php echo $captitle; ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="cap" name="cap" value="<?php echo ($contactdata->getColumnVal("cap")); ?>" placeholder="<?php echo $captitle; ?>" aria-describedby="inputGroupPrepend3" required="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-3 mb-3">
|
||||
<label for="telephone"><?php echo $telephonetitle; ?></label>
|
||||
<input type="text" class="form-control" id="telephone" name="telephone" value="<?php echo ($contactdata->getColumnVal("telephone")); ?>" placeholder="<?php echo $telephonetitle; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label for="email"><?php echo $emailtitle; ?></label>
|
||||
<input type="text" class="form-control" id="email" name="email" value="<?php echo ($contactdata->getColumnVal("email")); ?>" placeholder="<?php echo $emailtitle; ?>" required="">
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label for="contactname"><?php echo $contactnametitle; ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="contactname" value="<?php echo ($contactdata->getColumnVal("contactname")); ?>" name="contactname" placeholder="<?php echo $contactnametitle; ?>" aria-describedby="inputGroupPrepend3" required="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label for="contactsurname"><?php echo $contactsurnametitle; ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="contactsurname" name="contactsurname" value="<?php echo ($contactdata->getColumnVal("contactsurname")); ?>" placeholder="<?php echo $contactsurnametitle; ?>" aria-describedby="inputGroupPrepend3" required="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="tempcode" name="tempcode" value="<?php echo $tempcode; ?>">
|
||||
<input type="hidden" id="kindcontacts" name="kindcontacts" value="<?php echo ($contactdata->getColumnVal("kindofcontacts")); ?>">
|
||||
<input type="hidden" id="idtrf" name="idtrf" value="<?php echo $idtrf; ?>">
|
||||
<input type="hidden" id="formname" name="formname" value="editcontactsdetails">
|
||||
<input type="hidden" id="idcontacts" name="idcontacts" value="<?php echo $contactdata->getColumnVal("idcontacts"); ?>">
|
||||
</div>
|
||||
<button class="btn btn-gradient-primary" type="submit"><?php echo $edictcontacttitle; ?></button>
|
||||
|
||||
</form><br><br>
|
||||
<button onclick="self.close()" type="button" class="btn btn-success waves-effect waves-light"><?php echo $closewindow; ?></button>
|
||||
|
||||
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div>
|
||||
<?php // contact search trial
|
||||
?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-md-12 mb-4">
|
||||
<form class="needs-validation" id="searchname" name="searchname" action="#" method="GET" novalidate="">
|
||||
<label for="validationServer02"><?php echo $anagraficacompany; ?></label>
|
||||
<i class="fas fa-info-circle" data-toggle="modal" data-animation="bounce" data-target=".bs-example-modal-center"></i>
|
||||
<input type="hidden" id="kindcontacts" name="kindcontacts" value="<?php echo ($contactdata->getColumnVal("kindofcontacts")); ?>">
|
||||
<input type="hidden" id="idtrf" name="idtrf" value="<?php echo $idtrf; ?>">
|
||||
<input type="hidden" id="formname" name="formname" value="searchnamedet">
|
||||
<input type="hidden" id="idcontacts" name="idcontacts" value="<?php echo $contactdata->getColumnVal("idcontacts"); ?>">
|
||||
<input type="text" class="form-control is-valid" id="companynamevalue" name="companynamevalue" placeholder="<?php echo $companyname; ?>" required="">
|
||||
<input type="submit" value="Submit">
|
||||
<br>
|
||||
<b>Ex: </b><i><?php echo $searchsentence; ?></i>
|
||||
<br />
|
||||
<div id="display"></div>
|
||||
</div>
|
||||
</div><!--end card-body-->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- end of page -->
|
||||
|
||||
|
||||
<!-- 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>
|
||||