mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
feat: page clients and create client
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
|
||||
button {
|
||||
background-color: #007BFF;
|
||||
color: white;
|
||||
padding: 10px 10px;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
|
||||
.modal {
|
||||
display: none;
|
||||
position: fixed;
|
||||
padding: 20px;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background-color: #fefefe;
|
||||
margin: 15% auto;
|
||||
padding: 20px;
|
||||
border: 1px solid #888;
|
||||
border-radius: 10px;
|
||||
width: 90%;
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
|
||||
form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
input, textarea {
|
||||
width: 95%;
|
||||
max-width: 95%;
|
||||
padding: 8px;
|
||||
margin-top: 5px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
* dialog {
|
||||
transform: scale(1);
|
||||
/* display: flexbox;
|
||||
max-width: 200;
|
||||
max-height: 400; */
|
||||
}
|
||||
|
||||
|
||||
|
||||
.grid-buttons {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 10px;
|
||||
max-width: 500px; /* Define a largura máxima do grid */
|
||||
/* margin: 0 auto; */
|
||||
}
|
||||
|
||||
.grid-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
gap: 20px;
|
||||
max-width: 1300px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.grid-top {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
background-color: #f2f2f2;
|
||||
border-radius: 15px;
|
||||
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
|
||||
text-align: center;
|
||||
line-height: 120px; /* Centraliza o texto verticalmente */
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
transform: scale(1.05);
|
||||
box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.hide-on-mobile {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
function openModal() {
|
||||
document.getElementById('Modal-create-client').style.display = 'block';
|
||||
var clientId = document.getElementById('clientId');
|
||||
var clientName = document.getElementById('clientName');
|
||||
var clientDebt = document.getElementById('clientDebt');
|
||||
var clientContact = document.getElementById('clientContact');
|
||||
var clientActive = document.getElementById('active');
|
||||
|
||||
var buttonEdit = document.getElementById('edit');
|
||||
var buttonSave = document.getElementById('save');
|
||||
buttonEdit.style.display = 'none';
|
||||
buttonSave.style.display = 'block';
|
||||
|
||||
clientId.value = '';
|
||||
clientName.value = '';
|
||||
clientDebt.value = '';
|
||||
clientContact.value ='';
|
||||
clientActive.checked = false
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
document.getElementById('Modal-create-client').style.display = 'none';
|
||||
}
|
||||
|
||||
function editclient(id) {
|
||||
|
||||
openModal();
|
||||
var buttonSave = document.getElementById('save');
|
||||
var buttonEdit = document.getElementById('edit');
|
||||
buttonSave.style.display = 'none';
|
||||
buttonEdit.style.display = 'block';
|
||||
var clientId = document.getElementById('clientId');
|
||||
var clientName = document.getElementById('clientName');
|
||||
var clientDebt = document.getElementById('clientDebt');
|
||||
var clientContact = document.getElementById('clientContact');
|
||||
var clientqtd = document.getElementById('clientqtd');
|
||||
var clientActive = document.getElementById('active');
|
||||
var categorie = document.getElementById('select-categorie');
|
||||
|
||||
clientId.value = id;
|
||||
clientName.value = document.getElementById('name-'+id).innerHTML;
|
||||
var preco = document.getElementById('debt-'+id).innerHTML;
|
||||
preco = preco.replace('R$ ', '');
|
||||
preco = preco.replace(',', '.');
|
||||
clientDebt.value = preco;
|
||||
clientContact.value = document.getElementById('contact-'+id).value;
|
||||
clientqtd.value = document.getElementById('quantity-'+id).innerHTML;
|
||||
clientActive.checked = document.getElementById('Active-'+id).value == 'True' ? true : false;
|
||||
categorie.value = document.getElementById('h-category-'+id).value;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user