fixed color class
This commit is contained in:
@@ -367,10 +367,8 @@ $services = $pdo->query(
|
||||
<a href="associate-services.php?id=<?php echo (int) $svc['idservice']; ?>">
|
||||
<button type="button" class="btn btn-info btn-sm">Associa</button>
|
||||
</a>
|
||||
<a href="updateservice.php?idservice=<?php echo (int) $svc['idservice']; ?>">
|
||||
<button type="button" class="btn btn-warning btn-sm">
|
||||
<a href="updateservice.php?idservice=<?php echo (int) $svc['idservice']; ?>" class="btn btn-warning btn-sm">
|
||||
<i class="mdi mdi-lead-pencil font-size-16 align-middle"></i>
|
||||
</button>
|
||||
</a>
|
||||
<a href="cancelservice.php?idservice=<?php echo (int) $svc['idservice']; ?>">
|
||||
<button type="button" class="btn btn-danger btn-sm">
|
||||
@@ -443,9 +441,14 @@ $services = $pdo->query(
|
||||
palette: [
|
||||
["#FF0000", "#00FF00", "#0000FF"],
|
||||
["#1ebf73", "#f39c12", "#8e44ad"]
|
||||
],
|
||||
change: function(color) {
|
||||
$('#colorclass').val(color.toHexString());
|
||||
]
|
||||
});
|
||||
|
||||
// Forza il valore del colore nel campo prima dell'invio del form
|
||||
$('#insertclass').on('submit', function() {
|
||||
var col = $('#colorclass').spectrum('get');
|
||||
if (col) {
|
||||
$('#colorclass').val(col.toHexString());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
+16
-13
@@ -1,7 +1,12 @@
|
||||
<?php require_once('include/headscript.php'); ?>
|
||||
<?php require_once('Connections/bkngstm.php'); ?>
|
||||
<?php require_once('webassist/mysqli/rsobj.php'); ?>
|
||||
<?php require_once('webassist/mysqli/queryobj.php'); ?>
|
||||
<?php if (isset($_POST['classinsert'])) { $formclass='Y'; } else { $formclass='N'; } ?>
|
||||
<?php if (isset($_POST['classinsert'])) {
|
||||
$formclass = 'Y';
|
||||
} else {
|
||||
$formclass = 'N';
|
||||
} ?>
|
||||
<?php
|
||||
if (isset($_GET['idservice'])) {
|
||||
$idservice = $_GET['idservice'];
|
||||
@@ -25,11 +30,9 @@ if ($formclass == 'Y') {
|
||||
$UpdateQuery->saveInSession("");
|
||||
$UpdateQuery->execute();
|
||||
|
||||
$UpdateGoTo = "";
|
||||
if (function_exists("rel2abs")) {
|
||||
$UpdateGoTo = $UpdateGoTo ? rel2abs($UpdateGoTo, dirname(__FILE__)) : "";
|
||||
}
|
||||
$UpdateQuery->redirect($UpdateGoTo);
|
||||
$UpdateQuery->execute();
|
||||
header('Location: admin-services.php?message=updated');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -265,8 +268,7 @@ $result = $conn->query($query);
|
||||
<div class="col-lg-4">
|
||||
<div class="mb-3">
|
||||
<label for="formrow-inputCity" class="form-label">Ora</label>
|
||||
<input type="text" class="form-control" placeholder="Ora" id="classtime" name="classtime" value="<?php echo ($servicesclass->getColumnVal("classtime")); ?>">
|
||||
</div>
|
||||
<input type="text" class="form-control" placeholder="Ora" id="classtime" name="classtime" value="<?php echo ($servicesclass->getColumnVal("time")); ?>">
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="mb-3">
|
||||
@@ -279,11 +281,12 @@ $result = $conn->query($query);
|
||||
<label for="servicecategory">Seleziona una categoria:</label>
|
||||
<select name="servicecategory" id="servicecategory" class="form-select">
|
||||
<?php
|
||||
// Popola il dropdown con le opzioni dalla query
|
||||
$catattuale = $servicesclass->getColumnVal("category");
|
||||
while ($rowcat = $result->fetch_assoc()) {
|
||||
$idservicecategory = $rowcat['idservicecategory'];
|
||||
$namecategory = $rowcat['namecategory'];
|
||||
echo "<option value='$idservicecategory'>$namecategory</option>";
|
||||
$sel = ($idservicecategory == $catattuale) ? "selected" : "";
|
||||
echo "<option value='$idservicecategory' $sel>$namecategory</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
@@ -304,7 +307,7 @@ $result = $conn->query($query);
|
||||
<div class="mb-3">
|
||||
<label for="color-picker" class="form-label">Seleziona e modifica un colore</label>
|
||||
<input type="color" class="form-control color-picker" id="color-picker" name="color-picker" value="<?php echo ($servicesclass->getColumnVal("colorclass")); ?>">
|
||||
<input type="text" class="form-control color-code" id="color-code" name="color-code" maxlength="7" pattern="#[0-9A-Fa-f]{6}" value="<?php echo ($servicesclass->getColumnVal("colorclass")); ?>">
|
||||
<input type="text" class="form-control color-code" id="color-code" name="colorclass" maxlength="7" pattern="#[0-9A-Fa-f]{6}" value="<?php echo ($servicesclass->getColumnVal("colorclass")); ?>">
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -413,9 +416,9 @@ $result = $conn->query($query);
|
||||
<a href="associate-services.php?id=<?php echo ($servicesclass->getColumnVal("idservice")); ?>"><button type="button" class="btn btn-info toggle-form">
|
||||
Associa
|
||||
</button></a>
|
||||
<button type="button" class="btn btn-warning waves-effect waves-light">
|
||||
<a href="updateservice.php?idservice=<?php echo ($servicesclass->getColumnVal("idservice")); ?>" class="btn btn-warning waves-effect waves-light">
|
||||
<i class="mdi mdi-lead-pencil font-size-16 align-middle me-2"></i>
|
||||
</button>
|
||||
</a>
|
||||
<a href="cancelservice.php?idservice=<?php echo ($servicesclass->getColumnVal("idservice")); ?>"><button type="button" class="btn btn-danger waves-effect waves-light">
|
||||
<i class="bx bx-block font-size-16 align-middle me-2"></i>
|
||||
</button></a>
|
||||
|
||||
Reference in New Issue
Block a user